Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'staging-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
"Here are a set of staging driver cleanups for 6.6-rc1. Nothing huge in
here at all, overall we dropped a few hundred lines of code, it's been
a quiet development cycle for this subsystem.

Nothing stands out, everything can be categorized as "minor coding
style cleanups for staging drivers" and there was one race condition
fixed.

Full details in the shortlog.

All have been in linux-next for a while with no reported problems"

* tag 'staging-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (71 commits)
staging: rtl8192e: Annotate struct rtllib_txb with __counted_by
staging: greybus: fix alignment of open parenthesis
staging: sm750fb: fix sii164InitChip function name
staging: vme_user: fix check lines should not end with a '('
staging: vme_user: fix check blank lines not necessary
staging: rtl8723bs: Use helpers to check broadcast and multicast Ether addresses
staging: vt6655: replace camel case by snake case
staging: rtl8192e: Remove unsupported mode IW_MODE_MESH
staging: rtl8192e: Remove unsupported mode IW_MODE_REPEAT
staging: rtl8192e: Remove unused function rtllib_start_master_bss()
staging: rtl8192e: Remove unsupported mode IW_MODE_MASTER
staging: vt6655: Change camel case variables to snake case
staging: fieldbus: arcx-anybus: Remove redundant of_match_ptr()
staging: vme_user: fix alignment of open parenthesis
Staging: rtl8192e: Rename function RxBaInactTimeout
Staging: rtl8192e: Rename function TxBaInactTimeout
Staging: rtl8192e: Rename function BaSetupTimeOut
Staging: rtl8192e: Rename function TsInitDelBA
Staging: rtl8192e: Rename function TsInitAddBA
staging: vme_user: fix check alignment should match open parenthesis
...

+486 -940
+4 -14
drivers/staging/axis-fifo/axis-fifo.c
··· 15 15 */ 16 16 17 17 #include <linux/kernel.h> 18 + #include <linux/of.h> 19 + #include <linux/platform_device.h> 18 20 #include <linux/wait.h> 19 21 #include <linux/mutex.h> 20 22 #include <linux/device.h> ··· 33 31 #include <linux/uaccess.h> 34 32 #include <linux/jiffies.h> 35 33 #include <linux/miscdevice.h> 36 - 37 - #include <linux/of_address.h> 38 - #include <linux/of_device.h> 39 - #include <linux/of_platform.h> 40 34 41 35 /* ---------------------------- 42 36 * driver parameters ··· 837 839 * ---------------------------- 838 840 */ 839 841 840 - /* get iospace for the device */ 841 - r_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 842 - if (!r_mem) { 843 - dev_err(fifo->dt_device, "invalid address\n"); 844 - rc = -ENODEV; 845 - goto err_initial; 846 - } 847 - 848 - /* request physical memory */ 849 - fifo->base_addr = devm_ioremap_resource(fifo->dt_device, r_mem); 842 + /* get iospace for the device and request physical memory */ 843 + fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem); 850 844 if (IS_ERR(fifo->base_addr)) { 851 845 rc = PTR_ERR(fifo->base_addr); 852 846 goto err_initial;
+3 -3
drivers/staging/fieldbus/anybuss/arcx-anybus.c
··· 156 156 if (IS_ERR(ops.regmap)) 157 157 return ERR_CAST(ops.regmap); 158 158 ops.irq = platform_get_irq(pdev, idx); 159 - if (ops.irq <= 0) 160 - return ERR_PTR(-EINVAL); 159 + if (ops.irq < 0) 160 + return ERR_PTR(ops.irq); 161 161 return devm_anybuss_host_common_probe(&pdev->dev, &ops); 162 162 } 163 163 ··· 343 343 .remove_new = controller_remove, 344 344 .driver = { 345 345 .name = "arcx-anybus-controller", 346 - .of_match_table = of_match_ptr(controller_of_match), 346 + .of_match_table = controller_of_match, 347 347 }, 348 348 }; 349 349
+1
drivers/staging/greybus/arche-platform.c
··· 20 20 #include <linux/suspend.h> 21 21 #include <linux/time.h> 22 22 #include <linux/greybus.h> 23 + #include <linux/of.h> 23 24 #include "arche_platform.h" 24 25 25 26 #if IS_ENABLED(CONFIG_USB_HSIC_USB3613)
+2 -2
drivers/staging/greybus/fw-core.c
··· 89 89 } 90 90 91 91 connection = gb_connection_create(bundle, cport_id, 92 - gb_fw_mgmt_request_handler); 92 + gb_fw_mgmt_request_handler); 93 93 if (IS_ERR(connection)) { 94 94 ret = PTR_ERR(connection); 95 95 dev_err(&bundle->dev, ··· 110 110 } 111 111 112 112 connection = gb_connection_create(bundle, cport_id, 113 - gb_fw_download_request_handler); 113 + gb_fw_download_request_handler); 114 114 if (IS_ERR(connection)) { 115 115 dev_err(&bundle->dev, "failed to create download connection (%ld)\n", 116 116 PTR_ERR(connection));
-1
drivers/staging/greybus/pwm.c
··· 19 19 u8 pwm_max; /* max pwm number */ 20 20 21 21 struct pwm_chip chip; 22 - struct pwm_chip *pwm; 23 22 }; 24 23 25 24 static inline struct gb_pwm_chip *pwm_chip_to_gb_pwm_chip(struct pwm_chip *chip)
-1
drivers/staging/media/imx/imx-media-capture.c
··· 7 7 #include <linux/delay.h> 8 8 #include <linux/fs.h> 9 9 #include <linux/module.h> 10 - #include <linux/of_platform.h> 11 10 #include <linux/pinctrl/consumer.h> 12 11 #include <linux/platform_device.h> 13 12 #include <linux/sched.h>
-2
drivers/staging/media/imx/imx-media-dev-common.c
··· 6 6 * Copyright (c) 2016 Mentor Graphics Inc. 7 7 */ 8 8 9 - #include <linux/of_graph.h> 10 - #include <linux/of_platform.h> 11 9 #include <media/v4l2-ctrls.h> 12 10 #include <media/v4l2-event.h> 13 11 #include <media/v4l2-ioctl.h>
-1
drivers/staging/media/imx/imx8mq-mipi-csi2.c
··· 17 17 #include <linux/module.h> 18 18 #include <linux/mutex.h> 19 19 #include <linux/of.h> 20 - #include <linux/of_device.h> 21 20 #include <linux/platform_device.h> 22 21 #include <linux/pm_runtime.h> 23 22 #include <linux/regmap.h>
-1
drivers/staging/media/meson/vdec/esparser.c
··· 11 11 #include <linux/ioctl.h> 12 12 #include <linux/list.h> 13 13 #include <linux/module.h> 14 - #include <linux/of_device.h> 15 14 #include <linux/reset.h> 16 15 #include <linux/interrupt.h> 17 16 #include <media/videobuf2-dma-contig.h>
+1 -1
drivers/staging/media/meson/vdec/vdec.c
··· 4 4 * Author: Maxime Jourdan <mjourdan@baylibre.com> 5 5 */ 6 6 7 - #include <linux/of_device.h> 7 + #include <linux/of.h> 8 8 #include <linux/clk.h> 9 9 #include <linux/io.h> 10 10 #include <linux/module.h>
+1 -1
drivers/staging/media/sunxi/cedrus/cedrus_hw.c
··· 14 14 */ 15 15 16 16 #include <linux/platform_device.h> 17 + #include <linux/of.h> 17 18 #include <linux/of_reserved_mem.h> 18 - #include <linux/of_device.h> 19 19 #include <linux/dma-mapping.h> 20 20 #include <linux/interrupt.h> 21 21 #include <linux/clk.h>
-1
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
··· 10 10 #include <linux/interrupt.h> 11 11 #include <linux/module.h> 12 12 #include <linux/of.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/platform_device.h> 15 14 #include <linux/pm_runtime.h> 16 15 #include <linux/regmap.h>
-1
drivers/staging/media/tegra-video/csi.c
··· 10 10 #include <linux/module.h> 11 11 #include <linux/of.h> 12 12 #include <linux/of_graph.h> 13 - #include <linux/of_device.h> 14 13 #include <linux/platform_device.h> 15 14 #include <linux/pm_runtime.h> 16 15
+1 -1
drivers/staging/media/tegra-video/vi.c
··· 11 11 #include <linux/list.h> 12 12 #include <linux/module.h> 13 13 #include <linux/of.h> 14 - #include <linux/of_device.h> 15 14 #include <linux/of_graph.h> 15 + #include <linux/of_platform.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/regulator/consumer.h> 18 18 #include <linux/pm_runtime.h>
-1
drivers/staging/media/tegra-video/vip.c
··· 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 15 #include <linux/of_graph.h> 16 - #include <linux/of_device.h> 17 16 #include <linux/platform_device.h> 18 17 #include <linux/pm_runtime.h> 19 18
+1 -1
drivers/staging/most/dim2/dim2.c
··· 8 8 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9 9 10 10 #include <linux/module.h> 11 - #include <linux/of_platform.h> 12 11 #include <linux/printk.h> 13 12 #include <linux/kernel.h> 14 13 #include <linux/init.h> ··· 20 21 #include <linux/sched.h> 21 22 #include <linux/kthread.h> 22 23 #include <linux/most.h> 24 + #include <linux/of.h> 23 25 #include "hal.h" 24 26 #include "errors.h" 25 27 #include "sysfs.h"
-1
drivers/staging/pi433/pi433_if.c
··· 31 31 #include <linux/errno.h> 32 32 #include <linux/mutex.h> 33 33 #include <linux/of.h> 34 - #include <linux/of_device.h> 35 34 #include <linux/interrupt.h> 36 35 #include <linux/irq.h> 37 36 #include <linux/gpio/consumer.h>
+2 -9
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
··· 59 59 if (priv->rtllib->link_state == MAC80211_LINKED) 60 60 msr |= MSR_LINK_ADHOC; 61 61 break; 62 - case IW_MODE_MASTER: 63 - if (priv->rtllib->link_state == MAC80211_LINKED) 64 - msr |= MSR_LINK_MASTER; 65 - break; 66 62 default: 67 63 break; 68 64 } ··· 415 419 416 420 rtl92e_init_adaptive_rate(dev); 417 421 418 - if (priv->reg_chnl_plan == 0xf) 419 - priv->chnl_plan = priv->eeprom_chnl_plan; 420 - else 421 - priv->chnl_plan = priv->reg_chnl_plan; 422 + priv->chnl_plan = priv->eeprom_chnl_plan; 422 423 423 424 switch (priv->eeprom_customer_id) { 424 425 case EEPROM_CID_NetCore: ··· 1908 1915 rtl92e_writel(dev, TX_DESC_BASE[i], priv->tx_ring[i].dma); 1909 1916 } 1910 1917 1911 - void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta, u32 *p_intb) 1918 + void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta) 1912 1919 { 1913 1920 *p_inta = rtl92e_readl(dev, ISR); 1914 1921 rtl92e_writel(dev, ISR, *p_inta);
+1 -1
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.h
··· 13 13 bool rtl92e_get_nmode_support_by_sec(struct net_device *dev); 14 14 bool rtl92e_is_tx_stuck(struct net_device *dev); 15 15 bool rtl92e_is_rx_stuck(struct net_device *dev); 16 - void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta, u32 *p_intb); 16 + void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta); 17 17 void rtl92e_enable_rx(struct net_device *dev); 18 18 void rtl92e_enable_tx(struct net_device *dev); 19 19 void rtl92e_enable_irq(struct net_device *dev);
+7 -10
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
··· 49 49 } 50 50 51 51 void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, 52 - u16 KeyType, const u8 *MacAddr, u8 DefaultKey, 53 - u32 *KeyContent, u8 is_mesh) 52 + u16 KeyType, const u8 *MacAddr, u32 *KeyContent) 54 53 { 55 54 struct r8192_priv *priv = rtllib_priv(dev); 56 55 struct rtllib_device *ieee = priv->rtllib; ··· 57 58 if (EntryNo >= TOTAL_CAM_ENTRY) 58 59 return; 59 60 60 - if (!is_mesh) { 61 - ieee->swcamtable[EntryNo].bused = true; 62 - ieee->swcamtable[EntryNo].key_index = KeyIndex; 63 - ieee->swcamtable[EntryNo].key_type = KeyType; 64 - memcpy(ieee->swcamtable[EntryNo].macaddr, MacAddr, 6); 65 - ieee->swcamtable[EntryNo].useDK = DefaultKey; 66 - memcpy(ieee->swcamtable[EntryNo].key_buf, (u8 *)KeyContent, 16); 67 - } 61 + ieee->swcamtable[EntryNo].bused = true; 62 + ieee->swcamtable[EntryNo].key_index = KeyIndex; 63 + ieee->swcamtable[EntryNo].key_type = KeyType; 64 + memcpy(ieee->swcamtable[EntryNo].macaddr, MacAddr, 6); 65 + ieee->swcamtable[EntryNo].useDK = 0; 66 + memcpy(ieee->swcamtable[EntryNo].key_buf, (u8 *)KeyContent, 16); 68 67 } 69 68 70 69 void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
+1 -2
drivers/staging/rtl8192e/rtl8192e/rtl_cam.h
··· 19 19 u16 KeyType, const u8 *MacAddr, u8 DefaultKey, 20 20 u32 *KeyContent); 21 21 void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, 22 - u16 KeyType, const u8 *MacAddr, u8 DefaultKey, 23 - u32 *KeyContent, u8 is_mesh); 22 + u16 KeyType, const u8 *MacAddr, u32 *KeyContent); 24 23 void rtl92e_cam_restore(struct net_device *dev); 25 24 26 25 #endif
+1 -24
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
··· 618 618 (&priv->rtllib->pwr_save_ctrl); 619 619 bool init_status; 620 620 621 - priv->bdisable_nic = false; 622 - 623 621 priv->up = 1; 624 622 priv->rtllib->ieee_up = 1; 625 623 ··· 758 760 priv->up_first_time = 1; 759 761 priv->blinked_ingpio = false; 760 762 priv->being_init_adapter = false; 761 - priv->bdisable_nic = false; 762 763 priv->txringcount = 64; 763 764 priv->rxbuffersize = 9100; 764 765 priv->rxringcount = MAX_RX_COUNT; 765 766 priv->irq_enabled = 0; 766 767 priv->chan = 1; 767 - priv->reg_chnl_plan = 0xf; 768 768 priv->rtllib->mode = WIRELESS_MODE_AUTO; 769 769 priv->rtllib->iw_mode = IW_MODE_INFRA; 770 770 priv->rtllib->net_promiscuous_md = false; ··· 774 778 priv->retry_data = DEFAULT_RETRY_DATA; 775 779 priv->rtllib->rts = DEFAULT_RTS_THRESHOLD; 776 780 priv->rtllib->rate = 110; 777 - priv->rtllib->short_slot = 1; 778 781 priv->promisc = (dev->flags & IFF_PROMISC) ? 1 : 0; 779 782 priv->bcck_in_ch14 = false; 780 783 priv->cck_present_attn = 0; ··· 799 804 priv->rtllib->iw_mode = IW_MODE_INFRA; 800 805 priv->rtllib->active_scan = 1; 801 806 priv->rtllib->be_scan_inprogress = false; 802 - priv->rtllib->modulation = RTLLIB_CCK_MODULATION | 803 - RTLLIB_OFDM_MODULATION; 804 - priv->rtllib->host_encrypt = 1; 805 - priv->rtllib->host_decrypt = 1; 806 807 807 808 priv->rtllib->fts = DEFAULT_FRAG_THRESHOLD; 808 - 809 - priv->card_type = PCI; 810 809 811 810 priv->fw_info = vzalloc(sizeof(struct rt_firmware)); 812 811 if (!priv->fw_info) ··· 1493 1504 int idx; 1494 1505 u32 fwinfo_size = 0; 1495 1506 1496 - if (priv->bdisable_nic) { 1497 - netdev_warn(dev, "%s: Nic is disabled! Can't tx packet.\n", 1498 - __func__); 1499 - return skb->len; 1500 - } 1501 - 1502 1507 priv->rtllib->bAwakePktSent = true; 1503 1508 1504 1509 fwinfo_size = sizeof(struct tx_fwinfo_8190pci); ··· 1973 1990 struct r8192_priv *priv = rtllib_priv(dev); 1974 1991 unsigned long flags; 1975 1992 u32 inta; 1976 - u32 intb; 1977 - 1978 - intb = 0; 1979 1993 1980 1994 if (priv->irq_enabled == 0) 1981 1995 goto done; 1982 1996 1983 1997 spin_lock_irqsave(&priv->irq_th_lock, flags); 1984 1998 1985 - rtl92e_ack_irq(dev, &inta, &intb); 1999 + rtl92e_ack_irq(dev, &inta); 1986 2000 1987 2001 if (!inta) { 1988 2002 spin_unlock_irqrestore(&priv->irq_th_lock, flags); ··· 2231 2251 2232 2252 if (!priv->up) { 2233 2253 netdev_warn(dev, "%s(): Driver is already down!\n", __func__); 2234 - priv->bdisable_nic = false; 2235 2254 return false; 2236 2255 } 2237 2256 2238 2257 init_status = rtl92e_start_adapter(dev); 2239 2258 if (!init_status) { 2240 2259 netdev_warn(dev, "%s(): Initialization failed!\n", __func__); 2241 - priv->bdisable_nic = false; 2242 2260 return false; 2243 2261 } 2244 2262 RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); 2245 2263 2246 2264 rtl92e_irq_enable(dev); 2247 - priv->bdisable_nic = false; 2248 2265 return init_status; 2249 2266 } 2250 2267
-8
drivers/staging/rtl8192e/rtl8192e/rtl_core.h
··· 259 259 u8 polling_timer_on; 260 260 261 261 /**********************************************************/ 262 - 263 - enum card_type { 264 - PCI, MINIPCI, 265 - CARDBUS, USB 266 - } card_type; 267 - 268 262 struct work_struct qos_activate; 269 263 270 264 short promisc; ··· 316 322 317 323 bool tx_pwr_data_read_from_eeprom; 318 324 319 - u16 reg_chnl_plan; 320 325 u16 chnl_plan; 321 326 u8 hw_rf_off_action; 322 327 323 328 bool rf_change_in_progress; 324 329 bool set_rf_pwr_state_in_progress; 325 - bool bdisable_nic; 326 330 327 331 u8 cck_pwr_enl; 328 332 u16 tssi_13dBm;
+19 -19
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
··· 277 277 struct r8192_priv *priv = rtllib_priv(dev); 278 278 struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; 279 279 struct rate_adaptive *pra = &priv->rate_adaptive; 280 - u32 currentRATR, targetRATR = 0; 281 - u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0; 280 + u32 current_ratr, target_ratr = 0; 281 + u32 low_rssi_thresh_for_ra = 0, high_rssi_thresh_for_ra = 0; 282 282 bool bshort_gi_enabled = false; 283 283 static u8 ping_rssi_state; 284 284 ··· 319 319 ((bshort_gi_enabled) ? BIT31 : 0); 320 320 321 321 if (pra->ratr_state == DM_RATR_STA_HIGH) { 322 - HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; 323 - LowRSSIThreshForRA = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? 322 + high_rssi_thresh_for_ra = pra->high2low_rssi_thresh_for_ra; 323 + low_rssi_thresh_for_ra = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? 324 324 (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); 325 325 } else if (pra->ratr_state == DM_RATR_STA_LOW) { 326 - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; 327 - LowRSSIThreshForRA = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? 326 + high_rssi_thresh_for_ra = pra->high_rssi_thresh_for_ra; 327 + low_rssi_thresh_for_ra = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? 328 328 (pra->low2high_rssi_thresh_for_ra40M) : (pra->low2high_rssi_thresh_for_ra20M); 329 329 } else { 330 - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; 331 - LowRSSIThreshForRA = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? 330 + high_rssi_thresh_for_ra = pra->high_rssi_thresh_for_ra; 331 + low_rssi_thresh_for_ra = (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) ? 332 332 (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); 333 333 } 334 334 335 335 if (priv->undecorated_smoothed_pwdb >= 336 - (long)HighRSSIThreshForRA) { 336 + (long)high_rssi_thresh_for_ra) { 337 337 pra->ratr_state = DM_RATR_STA_HIGH; 338 - targetRATR = pra->upper_rssi_threshold_ratr; 338 + target_ratr = pra->upper_rssi_threshold_ratr; 339 339 } else if (priv->undecorated_smoothed_pwdb >= 340 - (long)LowRSSIThreshForRA) { 340 + (long)low_rssi_thresh_for_ra) { 341 341 pra->ratr_state = DM_RATR_STA_MIDDLE; 342 - targetRATR = pra->middle_rssi_threshold_ratr; 342 + target_ratr = pra->middle_rssi_threshold_ratr; 343 343 } else { 344 344 pra->ratr_state = DM_RATR_STA_LOW; 345 - targetRATR = pra->low_rssi_threshold_ratr; 345 + target_ratr = pra->low_rssi_threshold_ratr; 346 346 } 347 347 348 348 if (pra->ping_rssi_enable) { ··· 352 352 (long)pra->ping_rssi_thresh_for_ra) || 353 353 ping_rssi_state) { 354 354 pra->ratr_state = DM_RATR_STA_LOW; 355 - targetRATR = pra->ping_rssi_ratr; 355 + target_ratr = pra->ping_rssi_ratr; 356 356 ping_rssi_state = 1; 357 357 } 358 358 } else { ··· 361 361 } 362 362 363 363 if (priv->rtllib->GetHalfNmodeSupportByAPsHandler(dev)) 364 - targetRATR &= 0xf00fffff; 364 + target_ratr &= 0xf00fffff; 365 365 366 - currentRATR = rtl92e_readl(dev, RATR0); 367 - if (targetRATR != currentRATR) { 366 + current_ratr = rtl92e_readl(dev, RATR0); 367 + if (target_ratr != current_ratr) { 368 368 u32 ratr_value; 369 369 370 - ratr_value = targetRATR; 370 + ratr_value = target_ratr; 371 371 ratr_value &= ~(RATE_ALL_OFDM_2SS); 372 372 rtl92e_writel(dev, RATR0, ratr_value); 373 373 rtl92e_writeb(dev, UFWP, 1); 374 374 375 - pra->last_ratr = targetRATR; 375 + pra->last_ratr = target_ratr; 376 376 } 377 377 378 378 } else {
+2 -4
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
··· 118 118 119 119 rt_state = priv->rtllib->rf_power_state; 120 120 if (rt_state == rf_on && !psc->bSwRfProcessing && 121 - (priv->rtllib->link_state != MAC80211_LINKED) && 122 - (priv->rtllib->iw_mode != IW_MODE_MASTER)) { 121 + (priv->rtllib->link_state != MAC80211_LINKED)) { 123 122 psc->eInactivePowerState = rf_off; 124 123 _rtl92e_ps_update_rf_state(dev); 125 124 } ··· 209 210 210 211 if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && 211 212 (priv->rtllib->link_state == MAC80211_LINKED)) 212 - || (priv->rtllib->iw_mode == IW_MODE_ADHOC) || 213 - (priv->rtllib->iw_mode == IW_MODE_MASTER)) 213 + || (priv->rtllib->iw_mode == IW_MODE_ADHOC)) 214 214 return; 215 215 216 216 if (psc->bLeisurePs) {
+5 -7
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
··· 428 428 429 429 ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP); 430 430 431 - rtllib_start_scan_syncro(priv->rtllib, 0); 431 + rtllib_start_scan_syncro(priv->rtllib); 432 432 433 433 ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE); 434 434 } ··· 712 712 rtl92e_set_key(dev, key_idx, key_idx, KEY_TYPE_WEP104, 713 713 zero_addr[key_idx], 0, hwkey); 714 714 rtl92e_set_swcam(dev, key_idx, key_idx, KEY_TYPE_WEP104, 715 - zero_addr[key_idx], 0, hwkey, 0); 715 + zero_addr[key_idx], hwkey); 716 716 } else { 717 717 netdev_info(dev, 718 718 "wrong type in WEP, not WEP40 and WEP104\n"); ··· 857 857 if (ext->key_len == 13) 858 858 ieee->pairwise_key_type = alg = KEY_TYPE_WEP104; 859 859 rtl92e_set_key(dev, idx, idx, alg, zero, 0, key); 860 - rtl92e_set_swcam(dev, idx, idx, alg, zero, 0, key, 0); 860 + rtl92e_set_swcam(dev, idx, idx, alg, zero, key); 861 861 } else if (group) { 862 862 ieee->group_key_type = alg; 863 863 rtl92e_set_key(dev, idx, idx, alg, broadcast_addr, 0, 864 864 key); 865 - rtl92e_set_swcam(dev, idx, idx, alg, broadcast_addr, 0, 866 - key, 0); 865 + rtl92e_set_swcam(dev, idx, idx, alg, broadcast_addr, key); 867 866 } else { 868 867 if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && 869 868 ieee->ht_info->bCurrentHTSupport) 870 869 rtl92e_writeb(dev, 0x173, 1); 871 870 rtl92e_set_key(dev, 4, idx, alg, 872 871 (u8 *)ieee->ap_mac_addr, 0, key); 873 - rtl92e_set_swcam(dev, 4, idx, alg, 874 - (u8 *)ieee->ap_mac_addr, 0, key, 0); 872 + rtl92e_set_swcam(dev, 4, idx, alg, (u8 *)ieee->ap_mac_addr, key); 875 873 } 876 874 } 877 875
+30 -30
drivers/staging/rtl8192e/rtl819x_BAProc.c
··· 10 10 #include "rtllib.h" 11 11 #include "rtl819x_BA.h" 12 12 13 - static void ActivateBAEntry(struct ba_record *pBA, u16 Time) 13 + static void activate_ba_entry(struct ba_record *pBA, u16 Time) 14 14 { 15 15 pBA->b_valid = true; 16 16 if (Time != 0) 17 17 mod_timer(&pBA->timer, jiffies + msecs_to_jiffies(Time)); 18 18 } 19 19 20 - static void DeActivateBAEntry(struct rtllib_device *ieee, struct ba_record *pBA) 20 + static void deactivate_ba_entry(struct rtllib_device *ieee, struct ba_record *pBA) 21 21 { 22 22 pBA->b_valid = false; 23 23 del_timer_sync(&pBA->timer); 24 24 } 25 25 26 - static u8 TxTsDeleteBA(struct rtllib_device *ieee, struct tx_ts_record *pTxTs) 26 + static u8 tx_ts_delete_ba(struct rtllib_device *ieee, struct tx_ts_record *pTxTs) 27 27 { 28 28 struct ba_record *pAdmittedBa = &pTxTs->TxAdmittedBARecord; 29 29 struct ba_record *pPendingBa = &pTxTs->TxPendingBARecord; 30 30 u8 bSendDELBA = false; 31 31 32 32 if (pPendingBa->b_valid) { 33 - DeActivateBAEntry(ieee, pPendingBa); 33 + deactivate_ba_entry(ieee, pPendingBa); 34 34 bSendDELBA = true; 35 35 } 36 36 37 37 if (pAdmittedBa->b_valid) { 38 - DeActivateBAEntry(ieee, pAdmittedBa); 38 + deactivate_ba_entry(ieee, pAdmittedBa); 39 39 bSendDELBA = true; 40 40 } 41 41 return bSendDELBA; 42 42 } 43 43 44 - static u8 RxTsDeleteBA(struct rtllib_device *ieee, struct rx_ts_record *pRxTs) 44 + static u8 rx_ts_delete_ba(struct rtllib_device *ieee, struct rx_ts_record *pRxTs) 45 45 { 46 46 struct ba_record *pBa = &pRxTs->rx_admitted_ba_record; 47 47 u8 bSendDELBA = false; 48 48 49 49 if (pBa->b_valid) { 50 - DeActivateBAEntry(ieee, pBa); 50 + deactivate_ba_entry(ieee, pBa); 51 51 bSendDELBA = true; 52 52 } 53 53 54 54 return bSendDELBA; 55 55 } 56 56 57 - void ResetBaEntry(struct ba_record *pBA) 57 + void rtllib_reset_ba_entry(struct ba_record *pBA) 58 58 { 59 59 pBA->b_valid = false; 60 60 pBA->ba_param_set.short_data = 0; ··· 270 270 271 271 rtllib_FlushRxTsPendingPkts(ieee, pTS); 272 272 273 - DeActivateBAEntry(ieee, pBA); 273 + deactivate_ba_entry(ieee, pBA); 274 274 pBA->dialog_token = *pDialogToken; 275 275 pBA->ba_param_set = *pBaParamSet; 276 276 pBA->ba_timeout_value = *pBaTimeoutVal; ··· 282 282 else 283 283 pBA->ba_param_set.field.buffer_size = 32; 284 284 285 - ActivateBAEntry(pBA, 0); 285 + activate_ba_entry(pBA, 0); 286 286 rtllib_send_ADDBARsp(ieee, dst, pBA, ADDBA_STATUS_SUCCESS); 287 287 288 288 return 0; ··· 363 363 netdev_dbg(ieee->dev, 364 364 "%s(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n", 365 365 __func__, *pStatusCode); 366 - DeActivateBAEntry(ieee, pPendingBA); 366 + deactivate_ba_entry(ieee, pPendingBA); 367 367 } 368 368 369 369 if (*pStatusCode == ADDBA_STATUS_SUCCESS) { 370 370 if (pBaParamSet->field.ba_policy == BA_POLICY_DELAYED) { 371 371 pTS->bAddBaReqDelayed = true; 372 - DeActivateBAEntry(ieee, pAdmittedBA); 372 + deactivate_ba_entry(ieee, pAdmittedBA); 373 373 ReasonCode = DELBA_REASON_END_BA; 374 374 goto OnADDBARsp_Reject; 375 375 } ··· 378 378 pAdmittedBA->ba_timeout_value = *pBaTimeoutVal; 379 379 pAdmittedBA->ba_start_seq_ctrl = pPendingBA->ba_start_seq_ctrl; 380 380 pAdmittedBA->ba_param_set = *pBaParamSet; 381 - DeActivateBAEntry(ieee, pAdmittedBA); 382 - ActivateBAEntry(pAdmittedBA, *pBaTimeoutVal); 381 + deactivate_ba_entry(ieee, pAdmittedBA); 382 + activate_ba_entry(pAdmittedBA, *pBaTimeoutVal); 383 383 } else { 384 384 pTS->bAddBaReqDelayed = true; 385 385 pTS->bDisable_AddBa = true; ··· 441 441 return -1; 442 442 } 443 443 444 - RxTsDeleteBA(ieee, pRxTs); 444 + rx_ts_delete_ba(ieee, pRxTs); 445 445 } else { 446 446 struct tx_ts_record *pTxTs; 447 447 ··· 456 456 pTxTs->bAddBaReqInProgress = false; 457 457 pTxTs->bAddBaReqDelayed = false; 458 458 del_timer_sync(&pTxTs->TsAddBaTimer); 459 - TxTsDeleteBA(ieee, pTxTs); 459 + tx_ts_delete_ba(ieee, pTxTs); 460 460 } 461 461 return 0; 462 462 } 463 463 464 - void TsInitAddBA(struct rtllib_device *ieee, struct tx_ts_record *pTS, 465 - u8 Policy, u8 bOverwritePending) 464 + void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *pTS, 465 + u8 Policy, u8 bOverwritePending) 466 466 { 467 467 struct ba_record *pBA = &pTS->TxPendingBARecord; 468 468 469 469 if (pBA->b_valid && !bOverwritePending) 470 470 return; 471 471 472 - DeActivateBAEntry(ieee, pBA); 472 + deactivate_ba_entry(ieee, pBA); 473 473 474 474 pBA->dialog_token++; 475 475 pBA->ba_param_set.field.amsdu_support = 0; ··· 479 479 pBA->ba_timeout_value = 0; 480 480 pBA->ba_start_seq_ctrl.field.seq_num = (pTS->TxCurSeq + 3) % 4096; 481 481 482 - ActivateBAEntry(pBA, BA_SETUP_TIMEOUT); 482 + activate_ba_entry(pBA, BA_SETUP_TIMEOUT); 483 483 484 484 rtllib_send_ADDBAReq(ieee, pTS->TsCommonInfo.Addr, pBA); 485 485 } 486 486 487 - void TsInitDelBA(struct rtllib_device *ieee, 488 - struct ts_common_info *pTsCommonInfo, 489 - enum tr_select TxRxSelect) 487 + void rtllib_ts_init_del_ba(struct rtllib_device *ieee, 488 + struct ts_common_info *pTsCommonInfo, 489 + enum tr_select TxRxSelect) 490 490 { 491 491 if (TxRxSelect == TX_DIR) { 492 492 struct tx_ts_record *pTxTs = 493 493 (struct tx_ts_record *)pTsCommonInfo; 494 494 495 - if (TxTsDeleteBA(ieee, pTxTs)) 495 + if (tx_ts_delete_ba(ieee, pTxTs)) 496 496 rtllib_send_DELBA(ieee, pTsCommonInfo->Addr, 497 497 (pTxTs->TxAdmittedBARecord.b_valid) ? 498 498 (&pTxTs->TxAdmittedBARecord) : ··· 501 501 } else if (TxRxSelect == RX_DIR) { 502 502 struct rx_ts_record *pRxTs = 503 503 (struct rx_ts_record *)pTsCommonInfo; 504 - if (RxTsDeleteBA(ieee, pRxTs)) 504 + if (rx_ts_delete_ba(ieee, pRxTs)) 505 505 rtllib_send_DELBA(ieee, pTsCommonInfo->Addr, 506 506 &pRxTs->rx_admitted_ba_record, 507 507 TxRxSelect, DELBA_REASON_END_BA); 508 508 } 509 509 } 510 510 511 - void BaSetupTimeOut(struct timer_list *t) 511 + void rtllib_ba_setup_timeout(struct timer_list *t) 512 512 { 513 513 struct tx_ts_record *pTxTs = from_timer(pTxTs, t, 514 514 TxPendingBARecord.timer); ··· 518 518 pTxTs->TxPendingBARecord.b_valid = false; 519 519 } 520 520 521 - void TxBaInactTimeout(struct timer_list *t) 521 + void rtllib_tx_ba_inact_timeout(struct timer_list *t) 522 522 { 523 523 struct tx_ts_record *pTxTs = from_timer(pTxTs, t, 524 524 TxAdmittedBARecord.timer); 525 525 struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, 526 526 TxTsRecord[pTxTs->num]); 527 - TxTsDeleteBA(ieee, pTxTs); 527 + tx_ts_delete_ba(ieee, pTxTs); 528 528 rtllib_send_DELBA(ieee, pTxTs->TsCommonInfo.Addr, 529 529 &pTxTs->TxAdmittedBARecord, TX_DIR, 530 530 DELBA_REASON_TIMEOUT); 531 531 } 532 532 533 - void RxBaInactTimeout(struct timer_list *t) 533 + void rtllib_rx_ba_inact_timeout(struct timer_list *t) 534 534 { 535 535 struct rx_ts_record *pRxTs = from_timer(pRxTs, t, 536 536 rx_admitted_ba_record.timer); 537 537 struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device, 538 538 RxTsRecord[pRxTs->num]); 539 539 540 - RxTsDeleteBA(ieee, pRxTs); 540 + rx_ts_delete_ba(ieee, pRxTs); 541 541 rtllib_send_DELBA(ieee, pRxTs->ts_common_info.Addr, 542 542 &pRxTs->rx_admitted_ba_record, RX_DIR, 543 543 DELBA_REASON_TIMEOUT);
+1 -2
drivers/staging/rtl8192e/rtl819x_HTProc.c
··· 363 363 } 364 364 365 365 memset(posHTInfo, 0, *len); 366 - if ((ieee->iw_mode == IW_MODE_ADHOC) || 367 - (ieee->iw_mode == IW_MODE_MASTER)) { 366 + if (ieee->iw_mode == IW_MODE_ADHOC) { 368 367 pHTInfoEle->ControlChl = ieee->current_network.channel; 369 368 pHTInfoEle->ExtChlOffset = ((!pHT->bRegBW40MHz) ? 370 369 HT_EXTCHNL_OFFSET_NO_EXT :
-2
drivers/staging/rtl8192e/rtl819x_TS.h
··· 19 19 20 20 struct ts_common_info { 21 21 struct list_head List; 22 - struct timer_list SetupTimer; 23 - struct timer_list InactTimer; 24 22 u8 Addr[ETH_ALEN]; 25 23 union tspec_body TSpec; 26 24 union qos_tclas TClass[TCLAS_NUM];
+10 -55
drivers/staging/rtl8192e/rtl819x_TSProc.c
··· 8 8 #include <linux/etherdevice.h> 9 9 #include "rtl819x_TS.h" 10 10 11 - static void TsSetupTimeOut(struct timer_list *unused) 12 - { 13 - } 14 - 15 - static void TsInactTimeout(struct timer_list *unused) 16 - { 17 - } 18 - 19 11 static void RxPktPendingTimeout(struct timer_list *t) 20 12 { 21 13 struct rx_ts_record *pRxTs = from_timer(pRxTs, t, ··· 88 96 struct rtllib_device *ieee = container_of(pTxTs, struct rtllib_device, 89 97 TxTsRecord[num]); 90 98 91 - TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false); 99 + rtllib_ts_init_add_ba(ieee, pTxTs, BA_POLICY_IMMEDIATE, false); 92 100 netdev_dbg(ieee->dev, "%s(): ADDBA Req is started\n", __func__); 93 101 } 94 102 ··· 109 117 pTS->bAddBaReqDelayed = false; 110 118 pTS->bUsingBa = false; 111 119 pTS->bDisable_AddBa = false; 112 - ResetBaEntry(&pTS->TxAdmittedBARecord); 113 - ResetBaEntry(&pTS->TxPendingBARecord); 120 + rtllib_reset_ba_entry(&pTS->TxAdmittedBARecord); 121 + rtllib_reset_ba_entry(&pTS->TxPendingBARecord); 114 122 } 115 123 116 124 static void ResetRxTsEntry(struct rx_ts_record *pTS) ··· 118 126 ResetTsCommonInfo(&pTS->ts_common_info); 119 127 pTS->rx_indicate_seq = 0xffff; 120 128 pTS->rx_timeout_indicate_seq = 0xffff; 121 - ResetBaEntry(&pTS->rx_admitted_ba_record); 129 + rtllib_reset_ba_entry(&pTS->rx_admitted_ba_record); 122 130 } 123 131 124 132 void TSInitialize(struct rtllib_device *ieee) ··· 134 142 135 143 for (count = 0; count < TOTAL_TS_NUM; count++) { 136 144 pTxTS->num = count; 137 - timer_setup(&pTxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, 138 - 0); 139 - 140 - timer_setup(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout, 141 - 0); 142 - 143 145 timer_setup(&pTxTS->TsAddBaTimer, TsAddBaProcess, 0); 144 146 145 - timer_setup(&pTxTS->TxPendingBARecord.timer, BaSetupTimeOut, 147 + timer_setup(&pTxTS->TxPendingBARecord.timer, rtllib_ba_setup_timeout, 146 148 0); 147 149 timer_setup(&pTxTS->TxAdmittedBARecord.timer, 148 - TxBaInactTimeout, 0); 150 + rtllib_tx_ba_inact_timeout, 0); 149 151 150 152 ResetTxTsEntry(pTxTS); 151 153 list_add_tail(&pTxTS->TsCommonInfo.List, ··· 153 167 for (count = 0; count < TOTAL_TS_NUM; count++) { 154 168 pRxTS->num = count; 155 169 INIT_LIST_HEAD(&pRxTS->rx_pending_pkt_list); 156 - 157 - timer_setup(&pRxTS->ts_common_info.SetupTimer, TsSetupTimeOut, 158 - 0); 159 - 160 - timer_setup(&pRxTS->ts_common_info.InactTimer, TsInactTimeout, 161 - 0); 162 - 163 170 timer_setup(&pRxTS->rx_admitted_ba_record.timer, 164 - RxBaInactTimeout, 0); 171 + rtllib_rx_ba_inact_timeout, 0); 165 172 166 173 timer_setup(&pRxTS->rx_pkt_pending_timer, RxPktPendingTimeout, 0); 167 174 ··· 173 194 } 174 195 } 175 196 176 - static void AdmitTS(struct rtllib_device *ieee, 177 - struct ts_common_info *pTsCommonInfo, u32 InactTime) 178 - { 179 - del_timer_sync(&pTsCommonInfo->SetupTimer); 180 - del_timer_sync(&pTsCommonInfo->InactTimer); 181 - 182 - if (InactTime != 0) 183 - mod_timer(&pTsCommonInfo->InactTimer, jiffies + 184 - msecs_to_jiffies(InactTime)); 185 - } 186 - 187 197 static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee, 188 198 u8 *Addr, u8 TID, 189 199 enum tr_select TxRxSelect) ··· 182 214 struct list_head *psearch_list; 183 215 struct ts_common_info *pRet = NULL; 184 216 185 - if (ieee->iw_mode == IW_MODE_MASTER) { 186 - if (TxRxSelect == TX_DIR) { 187 - search_dir[DIR_DOWN] = true; 188 - search_dir[DIR_BI_DIR] = true; 189 - } else { 190 - search_dir[DIR_UP] = true; 191 - search_dir[DIR_BI_DIR] = true; 192 - } 193 - } else if (ieee->iw_mode == IW_MODE_ADHOC) { 217 + if (ieee->iw_mode == IW_MODE_ADHOC) { 194 218 if (TxRxSelect == TX_DIR) 195 219 search_dir[DIR_UP] = true; 196 220 else ··· 303 343 (&ieee->Tx_TS_Admit_List) : 304 344 (&ieee->Rx_TS_Admit_List); 305 345 306 - Dir = (ieee->iw_mode == IW_MODE_MASTER) ? 307 - ((TxRxSelect == TX_DIR) ? DIR_DOWN : DIR_UP) : 308 - ((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN); 346 + Dir = ((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN); 309 347 310 348 if (!list_empty(pUnusedList)) { 311 349 (*ppTS) = list_entry(pUnusedList->next, ··· 337 379 pTSInfo->field.ucSchedule = 0; 338 380 339 381 MakeTSEntry(*ppTS, Addr, &TSpec, NULL, 0, 0); 340 - AdmitTS(ieee, *ppTS, 0); 341 382 list_add_tail(&((*ppTS)->List), pAddmitList); 342 383 343 384 return true; ··· 351 394 static void RemoveTsEntry(struct rtllib_device *ieee, 352 395 struct ts_common_info *pTs, enum tr_select TxRxSelect) 353 396 { 354 - del_timer_sync(&pTs->SetupTimer); 355 - del_timer_sync(&pTs->InactTimer); 356 - TsInitDelBA(ieee, pTs, TxRxSelect); 397 + rtllib_ts_init_del_ba(ieee, pTs, TxRxSelect); 357 398 358 399 if (TxRxSelect == RX_DIR) { 359 400 struct rx_reorder_entry *pRxReorderEntry;
+11 -21
drivers/staging/rtl8192e/rtllib.h
··· 89 89 #define HIGH_QUEUE 7 90 90 #define BEACON_QUEUE 8 91 91 92 - #ifndef IW_MODE_MESH 93 - #define IW_MODE_MESH 7 94 - #endif 95 - 96 92 #define IE_CISCO_FLAG_POSITION 0x08 97 93 #define SUPPORT_CKIP_MIC 0x08 98 94 #define SUPPORT_CKIP_PK 0x10 ··· 814 818 u16 reserved; 815 819 __le16 frag_size; 816 820 __le16 payload_size; 817 - struct sk_buff *fragments[]; 821 + struct sk_buff *fragments[] __counted_by(nr_frags); 818 822 }; 819 823 820 824 #define MAX_SUBFRAME_COUNT 64 ··· 1436 1440 * WEP key changes 1437 1441 */ 1438 1442 1439 - /* If the host performs {en,de}cryption, then set to 1 */ 1440 - int host_encrypt; 1441 - int host_decrypt; 1442 - 1443 1443 int ieee802_1x; /* is IEEE 802.1X used */ 1444 1444 1445 1445 /* WPA data */ ··· 1482 1490 1483 1491 enum rtl_link_state link_state; 1484 1492 1485 - int short_slot; 1486 1493 int mode; /* A, B, G */ 1487 - int modulation; /* CCK, OFDM */ 1488 1494 1489 1495 /* used for forcing the ibss workqueue to terminate 1490 1496 * without wait for the syncro scan to terminate ··· 1883 1893 void rtllib_stop_scan(struct rtllib_device *ieee); 1884 1894 bool rtllib_act_scanning(struct rtllib_device *ieee, bool sync_scan); 1885 1895 void rtllib_stop_scan_syncro(struct rtllib_device *ieee); 1886 - void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh); 1896 + void rtllib_start_scan_syncro(struct rtllib_device *ieee); 1887 1897 void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee, short pwr); 1888 1898 void rtllib_sta_ps_send_pspoll_frame(struct rtllib_device *ieee); 1889 1899 void rtllib_start_protocol(struct rtllib_device *ieee); ··· 1998 2008 int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb); 1999 2009 int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb); 2000 2010 int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb); 2001 - void TsInitAddBA(struct rtllib_device *ieee, struct tx_ts_record *pTS, 2002 - u8 Policy, u8 bOverwritePending); 2003 - void TsInitDelBA(struct rtllib_device *ieee, 2004 - struct ts_common_info *pTsCommonInfo, 2005 - enum tr_select TxRxSelect); 2006 - void BaSetupTimeOut(struct timer_list *t); 2007 - void TxBaInactTimeout(struct timer_list *t); 2008 - void RxBaInactTimeout(struct timer_list *t); 2009 - void ResetBaEntry(struct ba_record *pBA); 2011 + void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *pTS, 2012 + u8 Policy, u8 bOverwritePending); 2013 + void rtllib_ts_init_del_ba(struct rtllib_device *ieee, 2014 + struct ts_common_info *pTsCommonInfo, 2015 + enum tr_select TxRxSelect); 2016 + void rtllib_ba_setup_timeout(struct timer_list *t); 2017 + void rtllib_tx_ba_inact_timeout(struct timer_list *t); 2018 + void rtllib_rx_ba_inact_timeout(struct timer_list *t); 2019 + void rtllib_reset_ba_entry(struct ba_record *pBA); 2010 2020 bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, u8 *Addr, 2011 2021 u8 TID, enum tr_select TxRxSelect, bool bAddNewTs); 2012 2022 void TSInitialize(struct rtllib_device *ieee);
-3
drivers/staging/rtl8192e/rtllib_module.c
··· 97 97 ieee->scan_age = DEFAULT_MAX_SCAN_AGE; 98 98 ieee->open_wep = 1; 99 99 100 - /* Default to enabling full open WEP with host based encrypt/decrypt */ 101 - ieee->host_encrypt = 1; 102 - ieee->host_decrypt = 1; 103 100 ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ 104 101 105 102 ieee->rtllib_ap_sec_type = rtllib_ap_sec_type;
+30 -54
drivers/staging/rtl8192e/rtllib_rx.c
··· 1013 1013 } 1014 1014 } 1015 1015 1016 - if (ieee->iw_mode != IW_MODE_MESH) { 1017 - /* packets from our adapter are dropped (echo) */ 1018 - if (!memcmp(src, ieee->dev->dev_addr, ETH_ALEN)) 1019 - return -1; 1016 + /* packets from our adapter are dropped (echo) */ 1017 + if (!memcmp(src, ieee->dev->dev_addr, ETH_ALEN)) 1018 + return -1; 1020 1019 1021 - /* {broad,multi}cast packets to our BSS go through */ 1022 - if (is_multicast_ether_addr(dst)) { 1023 - if (memcmp(bssid, ieee->current_network.bssid, 1024 - ETH_ALEN)) 1025 - return -1; 1026 - } 1020 + /* {broad,multi}cast packets to our BSS go through */ 1021 + if (is_multicast_ether_addr(dst)) { 1022 + if (memcmp(bssid, ieee->current_network.bssid, 1023 + ETH_ALEN)) 1024 + return -1; 1027 1025 } 1028 1026 return 0; 1029 1027 } ··· 1033 1035 u16 fc = le16_to_cpu(hdr->frame_ctl); 1034 1036 int idx = 0; 1035 1037 1036 - if (ieee->host_decrypt) { 1037 - if (skb->len >= hdrlen + 3) 1038 - idx = skb->data[hdrlen + 3] >> 6; 1038 + if (skb->len >= hdrlen + 3) 1039 + idx = skb->data[hdrlen + 3] >> 6; 1039 1040 1040 - *crypt = ieee->crypt_info.crypt[idx]; 1041 - /* allow NULL decrypt to indicate an station specific override 1042 - * for default encryption 1041 + *crypt = ieee->crypt_info.crypt[idx]; 1042 + /* allow NULL decrypt to indicate an station specific override 1043 + * for default encryption 1044 + */ 1045 + if (*crypt && ((*crypt)->ops == NULL || 1046 + (*crypt)->ops->decrypt_mpdu == NULL)) 1047 + *crypt = NULL; 1048 + 1049 + if (!*crypt && (fc & RTLLIB_FCTL_WEP)) { 1050 + /* This seems to be triggered by some (multicast?) 1051 + * frames from other than current BSS, so just drop the 1052 + * frames silently instead of filling system log with 1053 + * these reports. 1043 1054 */ 1044 - if (*crypt && ((*crypt)->ops == NULL || 1045 - (*crypt)->ops->decrypt_mpdu == NULL)) 1046 - *crypt = NULL; 1047 - 1048 - if (!*crypt && (fc & RTLLIB_FCTL_WEP)) { 1049 - /* This seems to be triggered by some (multicast?) 1050 - * frames from other than current BSS, so just drop the 1051 - * frames silently instead of filling system log with 1052 - * these reports. 1053 - */ 1054 - netdev_dbg(ieee->dev, 1055 - "Decryption failed (not set) (SA= %pM)\n", 1056 - hdr->addr2); 1057 - return -1; 1058 - } 1055 + netdev_dbg(ieee->dev, 1056 + "Decryption failed (not set) (SA= %pM)\n", 1057 + hdr->addr2); 1058 + return -1; 1059 1059 } 1060 1060 1061 1061 return 0; ··· 1079 1083 ieee->need_sw_enc = 0; 1080 1084 1081 1085 keyidx = rtllib_rx_frame_decrypt(ieee, skb, crypt); 1082 - if (ieee->host_decrypt && (fc & RTLLIB_FCTL_WEP) && (keyidx < 0)) { 1086 + if ((fc & RTLLIB_FCTL_WEP) && (keyidx < 0)) { 1083 1087 netdev_info(ieee->dev, "%s: decrypt frame error\n", __func__); 1084 1088 return -1; 1085 1089 } ··· 1143 1147 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still 1144 1148 * encrypted/authenticated 1145 1149 */ 1146 - if (ieee->host_decrypt && (fc & RTLLIB_FCTL_WEP) && 1150 + if ((fc & RTLLIB_FCTL_WEP) && 1147 1151 rtllib_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) { 1148 1152 netdev_info(ieee->dev, "%s: ==>decrypt msdu error\n", __func__); 1149 1153 return -1; ··· 1443 1447 return 0; 1444 1448 } 1445 1449 1446 - static int rtllib_rx_Master(struct rtllib_device *ieee, struct sk_buff *skb, 1447 - struct rtllib_rx_stats *rx_stats) 1448 - { 1449 - return 0; 1450 - } 1451 - 1452 1450 static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb, 1453 1451 struct rtllib_rx_stats *rx_stats) 1454 1452 { ··· 1471 1481 return 1; 1472 1482 } 1473 1483 1474 - static int rtllib_rx_Mesh(struct rtllib_device *ieee, struct sk_buff *skb, 1475 - struct rtllib_rx_stats *rx_stats) 1476 - { 1477 - return 0; 1478 - } 1479 - 1480 1484 /* All received frames are sent to this function. @skb contains the frame in 1481 1485 * IEEE 802.11 format, i.e., in the format it was sent over air. 1482 1486 * This function is called only as a tasklet (software IRQ). ··· 1494 1510 case IW_MODE_INFRA: 1495 1511 ret = rtllib_rx_InfraAdhoc(ieee, skb, rx_stats); 1496 1512 break; 1497 - case IW_MODE_MASTER: 1498 - case IW_MODE_REPEAT: 1499 - ret = rtllib_rx_Master(ieee, skb, rx_stats); 1500 - break; 1501 1513 case IW_MODE_MONITOR: 1502 1514 ret = rtllib_rx_Monitor(ieee, skb, rx_stats); 1503 - break; 1504 - case IW_MODE_MESH: 1505 - ret = rtllib_rx_Mesh(ieee, skb, rx_stats); 1506 1515 break; 1507 1516 default: 1508 1517 netdev_info(ieee->dev, "%s: ERR iw mode!!!\n", __func__); ··· 2675 2698 netdev_dbg(ieee->dev, "received PROBE REQUEST (%d)\n", 2676 2699 WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))); 2677 2700 if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && 2678 - ((ieee->iw_mode == IW_MODE_ADHOC || 2679 - ieee->iw_mode == IW_MODE_MASTER) && 2701 + (ieee->iw_mode == IW_MODE_ADHOC && 2680 2702 ieee->link_state == MAC80211_LINKED)) 2681 2703 rtllib_rx_probe_rq(ieee, skb); 2682 2704 break;
+63 -283
drivers/staging/rtl8192e/rtllib_softmac.c
··· 35 35 { 36 36 unsigned int rate_len = 0; 37 37 38 - if (ieee->modulation & RTLLIB_CCK_MODULATION) 39 - rate_len = RTLLIB_CCK_RATE_LEN + 2; 40 - 41 - if (ieee->modulation & RTLLIB_OFDM_MODULATION) 42 - 43 - rate_len += RTLLIB_OFDM_RATE_LEN + 2; 38 + rate_len = RTLLIB_CCK_RATE_LEN + 2; 39 + rate_len += RTLLIB_OFDM_RATE_LEN + 2; 44 40 45 41 return rate_len; 46 42 } ··· 49 53 { 50 54 u8 *tag = *tag_p; 51 55 52 - if (ieee->modulation & RTLLIB_CCK_MODULATION) { 53 - *tag++ = MFIE_TYPE_RATES; 54 - *tag++ = 4; 55 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; 56 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; 57 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; 58 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; 59 - } 56 + *tag++ = MFIE_TYPE_RATES; 57 + *tag++ = 4; 58 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; 59 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; 60 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; 61 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; 60 62 61 63 /* We may add an option for custom rates that specific HW 62 64 * might support ··· 66 72 { 67 73 u8 *tag = *tag_p; 68 74 69 - if (ieee->modulation & RTLLIB_OFDM_MODULATION) { 70 - *tag++ = MFIE_TYPE_RATES_EX; 71 - *tag++ = 8; 72 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_6MB; 73 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_9MB; 74 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_12MB; 75 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_18MB; 76 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_24MB; 77 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_36MB; 78 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_48MB; 79 - *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_54MB; 80 - } 75 + *tag++ = MFIE_TYPE_RATES_EX; 76 + *tag++ = 8; 77 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_6MB; 78 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_9MB; 79 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_12MB; 80 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_18MB; 81 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_24MB; 82 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_36MB; 83 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_48MB; 84 + *tag++ = RTLLIB_BASIC_RATE_MASK | RTLLIB_OFDM_RATE_54MB; 85 + 81 86 /* We may add an option for custom rates that specific HW might 82 87 * support 83 88 */ ··· 449 456 } 450 457 EXPORT_SYMBOL(rtllib_DisableIntelPromiscuousMode); 451 458 452 - static void rtllib_send_probe(struct rtllib_device *ieee, u8 is_mesh) 459 + static void rtllib_send_probe(struct rtllib_device *ieee) 453 460 { 454 461 struct sk_buff *skb; 455 462 ··· 460 467 } 461 468 } 462 469 463 - static void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh) 470 + static void rtllib_send_probe_requests(struct rtllib_device *ieee) 464 471 { 465 472 if (ieee->active_scan && (ieee->softmac_features & 466 473 IEEE_SOFTMAC_PROBERQ)) { 467 - rtllib_send_probe(ieee, 0); 468 - rtllib_send_probe(ieee, 0); 474 + rtllib_send_probe(ieee); 475 + rtllib_send_probe(ieee); 469 476 } 470 477 } 471 478 ··· 478 485 /* this performs syncro scan blocking the caller until all channels 479 486 * in the allowed channel map has been checked. 480 487 */ 481 - static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) 488 + static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee) 482 489 { 483 490 union iwreq_data wrqu; 484 491 short ch = 0; ··· 525 532 526 533 ieee->set_chan(ieee->dev, ch); 527 534 if (ieee->active_channel_map[ch] == 1) 528 - rtllib_send_probe_requests(ieee, 0); 535 + rtllib_send_probe_requests(ieee); 529 536 530 537 /* this prevent excessive time wait when we 531 538 * need to wait for a syncro scan to end.. ··· 587 594 ieee->set_chan(ieee->dev, ieee->current_network.channel); 588 595 589 596 if (ieee->active_channel_map[ieee->current_network.channel] == 1) 590 - rtllib_send_probe_requests(ieee, 0); 597 + rtllib_send_probe_requests(ieee); 591 598 592 599 schedule_delayed_work(&ieee->softmac_scan_wq, 593 600 msecs_to_jiffies(RTLLIB_SOFTMAC_SCAN_TIME)); ··· 707 714 } 708 715 709 716 /* called with wx_mutex held */ 710 - void rtllib_start_scan_syncro(struct rtllib_device *ieee, u8 is_mesh) 717 + void rtllib_start_scan_syncro(struct rtllib_device *ieee) 711 718 { 712 719 if (IS_DOT11D_ENABLE(ieee)) { 713 720 if (IS_COUNTRY_IE_VALID(ieee)) ··· 715 722 } 716 723 ieee->sync_scan_hurryup = 0; 717 724 if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) 718 - rtllib_softmac_scan_syncro(ieee, is_mesh); 725 + rtllib_softmac_scan_syncro(ieee); 719 726 } 720 727 EXPORT_SYMBOL(rtllib_start_scan_syncro); 721 728 ··· 807 814 } 808 815 809 816 crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 810 - encrypt = ieee->host_encrypt && crypt && crypt->ops && 817 + encrypt = crypt && crypt->ops && 811 818 ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); 812 819 if (ieee->ht_info->bCurrentHTSupport) { 813 820 tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); ··· 852 859 cpu_to_le16(ieee->current_network.capability & 853 860 WLAN_CAPABILITY_SHORT_PREAMBLE); 854 861 855 - if (ieee->short_slot && (ieee->current_network.capability & 856 - WLAN_CAPABILITY_SHORT_SLOT_TIME)) 862 + if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) 857 863 beacon_buf->capability |= 858 864 cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); 859 865 ··· 909 917 return skb; 910 918 } 911 919 912 - static struct sk_buff *rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest) 913 - { 914 - struct sk_buff *skb; 915 - u8 *tag; 916 - 917 - struct lib80211_crypt_data *crypt; 918 - struct rtllib_assoc_response_frame *assoc; 919 - short encrypt; 920 - 921 - unsigned int rate_len = rtllib_MFIE_rate_len(ieee); 922 - int len = sizeof(struct rtllib_assoc_response_frame) + rate_len + 923 - ieee->tx_headroom; 924 - 925 - skb = dev_alloc_skb(len); 926 - 927 - if (!skb) 928 - return NULL; 929 - 930 - skb_reserve(skb, ieee->tx_headroom); 931 - 932 - assoc = skb_put(skb, sizeof(struct rtllib_assoc_response_frame)); 933 - 934 - assoc->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_RESP); 935 - ether_addr_copy(assoc->header.addr1, dest); 936 - ether_addr_copy(assoc->header.addr3, ieee->dev->dev_addr); 937 - ether_addr_copy(assoc->header.addr2, ieee->dev->dev_addr); 938 - assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ? 939 - WLAN_CAPABILITY_ESS : WLAN_CAPABILITY_IBSS); 940 - 941 - if (ieee->short_slot) 942 - assoc->capability |= 943 - cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); 944 - 945 - if (ieee->host_encrypt) 946 - crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 947 - else 948 - crypt = NULL; 949 - 950 - encrypt = (crypt && crypt->ops); 951 - 952 - if (encrypt) 953 - assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); 954 - 955 - assoc->status = 0; 956 - assoc->aid = cpu_to_le16(ieee->assoc_id); 957 - if (ieee->assoc_id == 0x2007) 958 - ieee->assoc_id = 0; 959 - else 960 - ieee->assoc_id++; 961 - 962 - tag = skb_put(skb, rate_len); 963 - rtllib_MFIE_Brate(ieee, &tag); 964 - rtllib_MFIE_Grate(ieee, &tag); 965 - 966 - return skb; 967 - } 968 - 969 - static struct sk_buff *rtllib_auth_resp(struct rtllib_device *ieee, int status, 970 - u8 *dest) 971 - { 972 - struct sk_buff *skb = NULL; 973 - struct rtllib_authentication *auth; 974 - int len = ieee->tx_headroom + sizeof(struct rtllib_authentication) + 1; 975 - 976 - skb = dev_alloc_skb(len); 977 - if (!skb) 978 - return NULL; 979 - 980 - skb->len = sizeof(struct rtllib_authentication); 981 - 982 - skb_reserve(skb, ieee->tx_headroom); 983 - 984 - auth = skb_put(skb, sizeof(struct rtllib_authentication)); 985 - 986 - auth->status = cpu_to_le16(status); 987 - auth->transaction = cpu_to_le16(2); 988 - auth->algorithm = cpu_to_le16(WLAN_AUTH_OPEN); 989 - 990 - ether_addr_copy(auth->header.addr3, ieee->dev->dev_addr); 991 - ether_addr_copy(auth->header.addr2, ieee->dev->dev_addr); 992 - ether_addr_copy(auth->header.addr1, dest); 993 - auth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_AUTH); 994 - return skb; 995 - } 996 - 997 920 static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr) 998 921 { 999 922 struct sk_buff *skb; ··· 954 1047 RTLLIB_FCTL_PM); 955 1048 956 1049 return skb; 957 - } 958 - 959 - static void rtllib_resp_to_assoc_rq(struct rtllib_device *ieee, u8 *dest) 960 - { 961 - struct sk_buff *buf = rtllib_assoc_resp(ieee, dest); 962 - 963 - if (buf) 964 - softmac_mgmt_xmit(buf, ieee); 965 - } 966 - 967 - static void rtllib_resp_to_auth(struct rtllib_device *ieee, int s, u8 *dest) 968 - { 969 - struct sk_buff *buf = rtllib_auth_resp(ieee, s, dest); 970 - 971 - if (buf) 972 - softmac_mgmt_xmit(buf, ieee); 973 1050 } 974 1051 975 1052 static void rtllib_resp_to_probe(struct rtllib_device *ieee, u8 *dest) ··· 1013 1122 1014 1123 crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 1015 1124 if (crypt != NULL) 1016 - encrypt = ieee->host_encrypt && crypt && crypt->ops && 1125 + encrypt = crypt && crypt->ops && 1017 1126 ((strcmp(crypt->ops->name, "R-WEP") == 0 || 1018 1127 wpa_ie_len)); 1019 1128 else ··· 1091 1200 if (beacon->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 1092 1201 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); 1093 1202 1094 - if (ieee->short_slot && 1095 - (beacon->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) 1203 + if (beacon->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) 1096 1204 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); 1097 1205 1098 1206 hdr->listen_interval = cpu_to_le16(beacon->listen_interval); ··· 1355 1465 1356 1466 netif_carrier_on(ieee->dev); 1357 1467 ieee->is_roaming = false; 1358 - if (rtllib_is_54g(&ieee->current_network) && 1359 - (ieee->modulation & RTLLIB_OFDM_MODULATION)) { 1468 + if (rtllib_is_54g(&ieee->current_network)) { 1360 1469 ieee->rate = 108; 1361 1470 netdev_info(ieee->dev, "Using G rates:%d\n", ieee->rate); 1362 1471 } else { ··· 1541 1652 schedule_delayed_work( 1542 1653 &ieee->associate_procedure_wq, 0); 1543 1654 } else { 1544 - if (rtllib_is_54g(&ieee->current_network) && 1545 - (ieee->modulation & 1546 - RTLLIB_OFDM_MODULATION)) { 1655 + if (rtllib_is_54g(&ieee->current_network)) { 1547 1656 ieee->rate = 108; 1548 1657 ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); 1549 1658 netdev_info(ieee->dev, ··· 1613 1726 return 0; 1614 1727 } 1615 1728 1616 - static int auth_rq_parse(struct net_device *dev, struct sk_buff *skb, u8 *dest) 1617 - { 1618 - struct rtllib_authentication *a; 1619 - 1620 - if (skb->len < (sizeof(struct rtllib_authentication) - 1621 - sizeof(struct rtllib_info_element))) { 1622 - netdev_dbg(dev, "invalid len in auth request: %d\n", skb->len); 1623 - return -1; 1624 - } 1625 - a = (struct rtllib_authentication *)skb->data; 1626 - 1627 - ether_addr_copy(dest, a->header.addr2); 1628 - 1629 - if (le16_to_cpu(a->algorithm) != WLAN_AUTH_OPEN) 1630 - return WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG; 1631 - 1632 - return WLAN_STATUS_SUCCESS; 1633 - } 1634 - 1635 1729 static short probe_rq_parse(struct rtllib_device *ieee, struct sk_buff *skb, 1636 1730 u8 *src) 1637 1731 { ··· 1659 1791 return !strncmp(ssid, ieee->current_network.ssid, ssidlen); 1660 1792 } 1661 1793 1662 - static int assoc_rq_parse(struct net_device *dev, struct sk_buff *skb, u8 *dest) 1663 - { 1664 - struct rtllib_assoc_request_frame *a; 1665 - 1666 - if (skb->len < (sizeof(struct rtllib_assoc_request_frame) - 1667 - sizeof(struct rtllib_info_element))) { 1668 - netdev_dbg(dev, "invalid len in auth request:%d\n", skb->len); 1669 - return -1; 1670 - } 1671 - 1672 - a = (struct rtllib_assoc_request_frame *)skb->data; 1673 - 1674 - ether_addr_copy(dest, a->header.addr2); 1675 - 1676 - return 0; 1677 - } 1678 - 1679 1794 static inline u16 assoc_parse(struct rtllib_device *ieee, struct sk_buff *skb, 1680 1795 int *aid) 1681 1796 { ··· 1697 1846 ieee->softmac_stats.tx_probe_rs++; 1698 1847 rtllib_resp_to_probe(ieee, dest); 1699 1848 } 1700 - } 1701 - 1702 - static inline void rtllib_rx_auth_rq(struct rtllib_device *ieee, 1703 - struct sk_buff *skb) 1704 - { 1705 - u8 dest[ETH_ALEN]; 1706 - int status; 1707 - 1708 - ieee->softmac_stats.rx_auth_rq++; 1709 - 1710 - status = auth_rq_parse(ieee->dev, skb, dest); 1711 - if (status != -1) 1712 - rtllib_resp_to_auth(ieee, status, dest); 1713 - } 1714 - 1715 - static inline void rtllib_rx_assoc_rq(struct rtllib_device *ieee, 1716 - struct sk_buff *skb) 1717 - { 1718 - u8 dest[ETH_ALEN]; 1719 - 1720 - ieee->softmac_stats.rx_ass_rq++; 1721 - if (assoc_rq_parse(ieee->dev, skb, dest) != -1) 1722 - rtllib_resp_to_assoc_rq(ieee, dest); 1723 - 1724 - netdev_info(ieee->dev, "New client associated: %pM\n", dest); 1725 1849 } 1726 1850 1727 1851 void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee, short pwr) ··· 2091 2265 netdev_dbg(ieee->dev, 2092 2266 "Received authentication response"); 2093 2267 rtllib_rx_auth_resp(ieee, skb); 2094 - } else if (ieee->iw_mode == IW_MODE_MASTER) { 2095 - rtllib_rx_auth_rq(ieee, skb); 2096 2268 } 2097 2269 } 2098 2270 return 0; ··· 2150 2326 break; 2151 2327 case RTLLIB_STYPE_ASSOC_REQ: 2152 2328 case RTLLIB_STYPE_REASSOC_REQ: 2153 - if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && 2154 - ieee->iw_mode == IW_MODE_MASTER) 2155 - rtllib_rx_assoc_rq(ieee, skb); 2156 2329 break; 2157 2330 case RTLLIB_STYPE_AUTH: 2158 2331 rtllib_rx_auth(ieee, skb, rx_stats); ··· 2263 2442 netif_tx_wake_all_queues(ieee->dev); 2264 2443 } 2265 2444 2266 - /* called in user context only */ 2267 - static void rtllib_start_master_bss(struct rtllib_device *ieee) 2268 - { 2269 - ieee->assoc_id = 1; 2270 - 2271 - if (ieee->current_network.ssid_len == 0) { 2272 - strncpy(ieee->current_network.ssid, 2273 - RTLLIB_DEFAULT_TX_ESSID, 2274 - IW_ESSID_MAX_SIZE); 2275 - 2276 - ieee->current_network.ssid_len = 2277 - strlen(RTLLIB_DEFAULT_TX_ESSID); 2278 - ieee->ssid_set = 1; 2279 - } 2280 - 2281 - ether_addr_copy(ieee->current_network.bssid, ieee->dev->dev_addr); 2282 - 2283 - ieee->set_chan(ieee->dev, ieee->current_network.channel); 2284 - ieee->link_state = MAC80211_LINKED; 2285 - ieee->link_change(ieee->dev); 2286 - notify_wx_assoc_event(ieee); 2287 - netif_carrier_on(ieee->dev); 2288 - } 2289 - 2290 2445 static void rtllib_start_monitor_mode(struct rtllib_device *ieee) 2291 2446 { 2292 2447 /* reset hardware status */ ··· 2314 2517 * associated. 2315 2518 */ 2316 2519 if (ieee->link_state == MAC80211_NOLINK) 2317 - rtllib_start_scan_syncro(ieee, 0); 2520 + rtllib_start_scan_syncro(ieee); 2318 2521 2319 2522 /* the network definitively is not here.. create a new cell */ 2320 2523 if (ieee->link_state == MAC80211_NOLINK) { ··· 2323 2526 if (!ieee->wap_set) 2324 2527 eth_random_addr(ieee->current_network.bssid); 2325 2528 2326 - if (ieee->modulation & RTLLIB_CCK_MODULATION) { 2327 - ieee->current_network.rates_len = 4; 2529 + ieee->current_network.rates_len = 4; 2530 + ieee->current_network.rates[0] = 2531 + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; 2532 + ieee->current_network.rates[1] = 2533 + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; 2534 + ieee->current_network.rates[2] = 2535 + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; 2536 + ieee->current_network.rates[3] = 2537 + RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; 2328 2538 2329 - ieee->current_network.rates[0] = 2330 - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_1MB; 2331 - ieee->current_network.rates[1] = 2332 - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_2MB; 2333 - ieee->current_network.rates[2] = 2334 - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_5MB; 2335 - ieee->current_network.rates[3] = 2336 - RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; 2337 - 2338 - } else { 2339 - ieee->current_network.rates_len = 0; 2340 - } 2341 - 2342 - if (ieee->modulation & RTLLIB_OFDM_MODULATION) { 2343 - ieee->current_network.rates_ex_len = 8; 2344 - 2345 - ieee->current_network.rates_ex[0] = 2346 - RTLLIB_OFDM_RATE_6MB; 2347 - ieee->current_network.rates_ex[1] = 2348 - RTLLIB_OFDM_RATE_9MB; 2349 - ieee->current_network.rates_ex[2] = 2350 - RTLLIB_OFDM_RATE_12MB; 2351 - ieee->current_network.rates_ex[3] = 2352 - RTLLIB_OFDM_RATE_18MB; 2353 - ieee->current_network.rates_ex[4] = 2354 - RTLLIB_OFDM_RATE_24MB; 2355 - ieee->current_network.rates_ex[5] = 2356 - RTLLIB_OFDM_RATE_36MB; 2357 - ieee->current_network.rates_ex[6] = 2358 - RTLLIB_OFDM_RATE_48MB; 2359 - ieee->current_network.rates_ex[7] = 2360 - RTLLIB_OFDM_RATE_54MB; 2361 - 2362 - ieee->rate = 108; 2363 - } else { 2364 - ieee->current_network.rates_ex_len = 0; 2365 - ieee->rate = 22; 2366 - } 2539 + ieee->current_network.rates_ex_len = 8; 2540 + ieee->current_network.rates_ex[0] = 2541 + RTLLIB_OFDM_RATE_6MB; 2542 + ieee->current_network.rates_ex[1] = 2543 + RTLLIB_OFDM_RATE_9MB; 2544 + ieee->current_network.rates_ex[2] = 2545 + RTLLIB_OFDM_RATE_12MB; 2546 + ieee->current_network.rates_ex[3] = 2547 + RTLLIB_OFDM_RATE_18MB; 2548 + ieee->current_network.rates_ex[4] = 2549 + RTLLIB_OFDM_RATE_24MB; 2550 + ieee->current_network.rates_ex[5] = 2551 + RTLLIB_OFDM_RATE_36MB; 2552 + ieee->current_network.rates_ex[6] = 2553 + RTLLIB_OFDM_RATE_48MB; 2554 + ieee->current_network.rates_ex[7] = 2555 + RTLLIB_OFDM_RATE_54MB; 2556 + ieee->rate = 108; 2367 2557 2368 2558 ieee->current_network.qos_data.supported = 0; 2369 2559 ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); ··· 2621 2837 case IW_MODE_ADHOC: 2622 2838 rtllib_start_ibss(ieee); 2623 2839 break; 2624 - case IW_MODE_MASTER: 2625 - rtllib_start_master_bss(ieee); 2626 - break; 2627 2840 case IW_MODE_MONITOR: 2628 2841 rtllib_start_monitor_mode(ieee); 2629 2842 break; ··· 2799 3018 2800 3019 crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 2801 3020 encrypt = (ieee->current_network.capability & WLAN_CAPABILITY_PRIVACY) 2802 - || (ieee->host_encrypt && crypt && crypt->ops && 2803 - (strcmp(crypt->ops->name, "R-WEP") == 0)); 3021 + || (crypt && crypt->ops && (strcmp(crypt->ops->name, "R-WEP") == 0)); 2804 3022 2805 3023 /* simply judge */ 2806 3024 if (encrypt && (wpa_ie_len == 0)) {
+5 -12
drivers/staging/rtl8192e/rtllib_softmac_wx.c
··· 51 51 ieee->current_network.channel = fwrq->m; 52 52 ieee->set_chan(ieee->dev, ieee->current_network.channel); 53 53 54 - if (ieee->iw_mode == IW_MODE_ADHOC || 55 - ieee->iw_mode == IW_MODE_MASTER) 54 + if (ieee->iw_mode == IW_MODE_ADHOC) 56 55 if (ieee->link_state == MAC80211_LINKED) { 57 56 rtllib_stop_send_beacons(ieee); 58 57 rtllib_start_send_beacons(ieee); ··· 124 125 125 126 mutex_lock(&ieee->wx_mutex); 126 127 /* use ifconfig hw ether */ 127 - if (ieee->iw_mode == IW_MODE_MASTER) { 128 - ret = -1; 129 - goto out; 130 - } 131 128 132 129 if (temp->sa_family != ARPHRD_ETHER) { 133 130 ret = -EINVAL; ··· 305 310 306 311 mutex_lock(&ieee->wx_mutex); 307 312 if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) { 308 - rtllib_start_scan_syncro(ieee, 0); 313 + rtllib_start_scan_syncro(ieee); 309 314 goto out; 310 315 } 311 316 ··· 334 339 HT_EXTCHNL_OFFSET_NO_EXT); 335 340 } 336 341 337 - rtllib_start_scan_syncro(ieee, 0); 342 + rtllib_start_scan_syncro(ieee); 338 343 339 344 if (b40M) { 340 345 if (chan_offset == HT_EXTCHNL_OFFSET_UPPER) ··· 361 366 ieee->link_detect_info.NumRecvBcnInPeriod = 1; 362 367 ieee->link_detect_info.NumRecvDataInPeriod = 1; 363 368 } 364 - if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) 369 + if (ieee->iw_mode == IW_MODE_ADHOC) 365 370 rtllib_start_send_beacons(ieee); 366 371 367 372 rtllib_wake_all_queues(ieee); ··· 482 487 int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info, 483 488 union iwreq_data *wrqu, char *extra) 484 489 { 485 - const char *b = ieee->modulation & RTLLIB_CCK_MODULATION ? "b" : ""; 486 - const char *g = ieee->modulation & RTLLIB_OFDM_MODULATION ? "g" : ""; 487 490 const char *n = ieee->mode & (WIRELESS_MODE_N_24G) ? "n" : ""; 488 491 489 - scnprintf(wrqu->name, sizeof(wrqu->name), "802.11%s%s%s", b, g, n); 492 + scnprintf(wrqu->name, sizeof(wrqu->name), "802.11bg%s", n); 490 493 return 0; 491 494 } 492 495 EXPORT_SYMBOL(rtllib_wx_get_name);
+1 -4
drivers/staging/rtl8192e/rtllib_tx.c
··· 463 463 } 464 464 if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 465 465 tcb_desc->bUseShortPreamble = true; 466 - if (ieee->iw_mode == IW_MODE_MASTER) 467 - goto NO_PROTECTION; 468 466 return; 469 467 NO_PROTECTION: 470 468 tcb_desc->bRTSEnable = false; ··· 633 635 634 636 skb->priority = rtllib_classify(skb, IsAmsdu); 635 637 crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 636 - encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && 637 - ieee->host_encrypt && crypt && crypt->ops; 638 + encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && crypt && crypt->ops; 638 639 if (!encrypt && ieee->ieee802_1x && 639 640 ieee->drop_unencrypted && ether_type != ETH_P_PAE) { 640 641 stats->tx_dropped++;
+6 -4
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
··· 1121 1121 1122 1122 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ 1123 1123 1124 - if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && 1125 - (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) { 1126 - netdev_dbg(ieee->dev, "decrypt frame error\n"); 1127 - goto rx_dropped; 1124 + if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP)) { 1125 + keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt); 1126 + if (keyidx < 0) { 1127 + netdev_dbg(ieee->dev, "decrypt frame error\n"); 1128 + goto rx_dropped; 1129 + } 1128 1130 } 1129 1131 1130 1132
+1
drivers/staging/rtl8712/os_intfs.c
··· 327 327 mp871xinit(padapter); 328 328 init_default_value(padapter); 329 329 r8712_InitSwLeds(padapter); 330 + mutex_init(&padapter->mutex_start); 330 331 331 332 return 0; 332 333
-1
drivers/staging/rtl8712/usb_intf.c
··· 567 567 if (rtl871x_load_fw(padapter)) 568 568 goto deinit_drv_sw; 569 569 init_completion(&padapter->rx_filter_ready); 570 - mutex_init(&padapter->mutex_start); 571 570 return 0; 572 571 573 572 deinit_drv_sw:
+1 -2
drivers/staging/rtl8723bs/core/rtw_ap.c
··· 1238 1238 struct sta_priv *pstapriv = &padapter->stapriv; 1239 1239 struct wlan_acl_pool *pacl_list = &pstapriv->acl_list; 1240 1240 struct __queue *pacl_node_q = &pacl_list->acl_node_q; 1241 - u8 baddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; /* Baddr is used for clearing acl_list */ 1242 1241 1243 1242 spin_lock_bh(&(pacl_node_q->lock)); 1244 1243 ··· 1247 1248 1248 1249 if ( 1249 1250 !memcmp(paclnode->addr, addr, ETH_ALEN) || 1250 - !memcmp(baddr, addr, ETH_ALEN) 1251 + is_broadcast_ether_addr(addr) 1251 1252 ) { 1252 1253 if (paclnode->valid) { 1253 1254 paclnode->valid = false;
+2 -3
drivers/staging/rtl8723bs/core/rtw_mlme.c
··· 226 226 { 227 227 struct list_head *phead, *plist; 228 228 struct wlan_network *pnetwork = NULL; 229 - u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; 230 229 231 - if (!memcmp(zero_addr, addr, ETH_ALEN)) { 230 + if (is_zero_ether_addr(addr)) { 232 231 pnetwork = NULL; 233 232 goto exit; 234 233 } ··· 2512 2513 struct sta_info *psta; 2513 2514 struct ht_priv *phtpriv; 2514 2515 struct pkt_attrib *pattrib = &pxmitframe->attrib; 2515 - s32 bmcst = IS_MCAST(pattrib->ra); 2516 + s32 bmcst = is_multicast_ether_addr(pattrib->ra); 2516 2517 2517 2518 /* if (bmcst || (padapter->mlmepriv.LinkDetectInfo.bTxBusyTraffic == false)) */ 2518 2519 if (bmcst || (padapter->mlmepriv.LinkDetectInfo.NumTxOkInPeriod < 100))
+2 -4
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
··· 421 421 422 422 static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, union recv_frame *precv_frame) 423 423 { 424 - u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 425 424 u8 *pframe = precv_frame->u.hdr.rx_data; 426 425 427 426 if (ptable->func) { 428 427 /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ 429 428 if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && 430 - memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN)) 429 + !is_broadcast_ether_addr(GetAddr1Ptr(pframe))) 431 430 return; 432 431 433 432 ptable->func(padapter, precv_frame); ··· 438 439 int index; 439 440 struct mlme_handler *ptable; 440 441 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 441 - u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 442 442 u8 *pframe = precv_frame->u.hdr.rx_data; 443 443 struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe)); 444 444 struct dvobj_priv *psdpriv = padapter->dvobj; ··· 448 450 449 451 /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ 450 452 if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && 451 - memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN)) { 453 + !is_broadcast_ether_addr(GetAddr1Ptr(pframe))) { 452 454 return; 453 455 } 454 456
+18 -18
drivers/staging/rtl8723bs/core/rtw_recv.c
··· 317 317 if (prxattrib->encrypt == _TKIP_) { 318 318 /* calculate mic code */ 319 319 if (stainfo) { 320 - if (IS_MCAST(prxattrib->ra)) { 320 + if (is_multicast_ether_addr(prxattrib->ra)) { 321 321 /* mickey =&psecuritypriv->dot118021XGrprxmickey.skey[0]; */ 322 322 /* iv = precvframe->u.hdr.rx_data+prxattrib->hdrlen; */ 323 323 /* rxdata_key_idx =(((iv[3])>>6)&0x3) ; */ ··· 352 352 if (bmic_err == true) { 353 353 /* double check key_index for some timing issue , */ 354 354 /* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */ 355 - if ((IS_MCAST(prxattrib->ra) == true) && (prxattrib->key_index != pmlmeinfo->key_index)) 355 + if ((is_multicast_ether_addr(prxattrib->ra) == true) && (prxattrib->key_index != pmlmeinfo->key_index)) 356 356 brpt_micerror = false; 357 357 358 358 if (prxattrib->bdecrypted && brpt_micerror) 359 - rtw_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra)); 359 + rtw_handle_tkip_mic_err(adapter, (u8)is_multicast_ether_addr(prxattrib->ra)); 360 360 361 361 res = _FAIL; 362 362 363 363 } else { 364 364 /* mic checked ok */ 365 365 if (!psecuritypriv->bcheck_grpkey && 366 - IS_MCAST(prxattrib->ra)) 366 + is_multicast_ether_addr(prxattrib->ra)) 367 367 psecuritypriv->bcheck_grpkey = true; 368 368 } 369 369 } ··· 625 625 626 626 padapter->mlmepriv.LinkDetectInfo.NumRxOkInPeriod++; 627 627 628 - if ((!MacAddr_isBcst(pattrib->dst)) && (!IS_MCAST(pattrib->dst))) 628 + if ((!is_broadcast_ether_addr(pattrib->dst)) && (!is_multicast_ether_addr(pattrib->dst))) 629 629 padapter->mlmepriv.LinkDetectInfo.NumRxUnicastOkInPeriod++; 630 630 631 631 if (sta) ··· 654 654 u8 *mybssid = get_bssid(pmlmepriv); 655 655 u8 *myhwaddr = myid(&adapter->eeprompriv); 656 656 u8 *sta_addr = NULL; 657 - signed int bmcast = IS_MCAST(pattrib->dst); 657 + signed int bmcast = is_multicast_ether_addr(pattrib->dst); 658 658 659 659 if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || 660 660 (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { ··· 670 670 goto exit; 671 671 } 672 672 673 - if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || 674 - !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || 675 - (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { 673 + if (is_zero_ether_addr(pattrib->bssid) || 674 + is_zero_ether_addr(mybssid) || 675 + (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { 676 676 ret = _FAIL; 677 677 goto exit; 678 678 } ··· 690 690 } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { 691 691 if (bmcast) { 692 692 /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ 693 - if (!IS_MCAST(pattrib->bssid)) { 693 + if (!is_multicast_ether_addr(pattrib->bssid)) { 694 694 ret = _FAIL; 695 695 goto exit; 696 696 } ··· 741 741 struct mlme_priv *pmlmepriv = &adapter->mlmepriv; 742 742 u8 *mybssid = get_bssid(pmlmepriv); 743 743 u8 *myhwaddr = myid(&adapter->eeprompriv); 744 - signed int bmcast = IS_MCAST(pattrib->dst); 744 + signed int bmcast = is_multicast_ether_addr(pattrib->dst); 745 745 746 746 if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) && 747 747 (check_fwstate(pmlmepriv, _FW_LINKED) == true || ··· 762 762 763 763 764 764 /* check BSSID */ 765 - if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || 766 - !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || 767 - (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { 765 + if (is_zero_ether_addr(pattrib->bssid) || 766 + is_zero_ether_addr(mybssid) || 767 + (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { 768 768 769 769 if (!bmcast) 770 770 issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); ··· 1329 1329 } 1330 1330 1331 1331 if (pattrib->privacy) { 1332 - GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, IS_MCAST(pattrib->ra)); 1332 + GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, is_multicast_ether_addr(pattrib->ra)); 1333 1333 1334 1334 SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt); 1335 1335 } else { ··· 1354 1354 if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) && 1355 1355 adapter->securitypriv.binstallBIPkey == true) { 1356 1356 /* unicast management frame decrypt */ 1357 - if (pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) && 1357 + if (pattrib->privacy && !(is_multicast_ether_addr(GetAddr1Ptr(ptr))) && 1358 1358 (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION)) { 1359 1359 u8 *mgmt_DATA; 1360 1360 u32 data_len = 0; ··· 1381 1381 kfree(mgmt_DATA); 1382 1382 if (!precv_frame) 1383 1383 goto validate_80211w_fail; 1384 - } else if (IS_MCAST(GetAddr1Ptr(ptr)) && 1384 + } else if (is_multicast_ether_addr(GetAddr1Ptr(ptr)) && 1385 1385 (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC)) { 1386 1386 signed int BIP_ret = _SUCCESS; 1387 1387 /* verify BIP MME IE of broadcast/multicast de-auth/disassoc packet */ ··· 2041 2041 2042 2042 /* check if need to enqueue into uc_swdec_pending_queue*/ 2043 2043 if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && 2044 - !IS_MCAST(prxattrib->ra) && prxattrib->encrypt > 0 && 2044 + !is_multicast_ether_addr(prxattrib->ra) && prxattrib->encrypt > 0 && 2045 2045 (prxattrib->bdecrypted == 0 || psecuritypriv->sw_decrypt == true) && 2046 2046 psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPAPSK && 2047 2047 !psecuritypriv->busetkipkey) {
+4 -4
drivers/staging/rtl8723bs/core/rtw_security.c
··· 486 486 if (pattrib->encrypt == _TKIP_) { 487 487 488 488 { 489 - if (IS_MCAST(pattrib->ra)) 489 + if (is_multicast_ether_addr(pattrib->ra)) 490 490 prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; 491 491 else 492 492 prwskey = pattrib->dot118021x_UncstKey.skey; ··· 554 554 if (prxattrib->encrypt == _TKIP_) { 555 555 stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]); 556 556 if (stainfo) { 557 - if (IS_MCAST(prxattrib->ra)) { 557 + if (is_multicast_ether_addr(prxattrib->ra)) { 558 558 static unsigned long start; 559 559 static u32 no_gkey_bc_cnt; 560 560 static u32 no_gkey_mc_cnt; ··· 1051 1051 1052 1052 /* 4 start to encrypt each fragment */ 1053 1053 if (pattrib->encrypt == _AES_) { 1054 - if (IS_MCAST(pattrib->ra)) 1054 + if (is_multicast_ether_addr(pattrib->ra)) 1055 1055 prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; 1056 1056 else 1057 1057 prwskey = pattrib->dot118021x_UncstKey.skey; ··· 1305 1305 if (prxattrib->encrypt == _AES_) { 1306 1306 stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]); 1307 1307 if (stainfo) { 1308 - if (IS_MCAST(prxattrib->ra)) { 1308 + if (is_multicast_ether_addr(prxattrib->ra)) { 1309 1309 static unsigned long start; 1310 1310 static u32 no_gkey_bc_cnt; 1311 1311 static u32 no_gkey_mc_cnt;
+1 -1
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
··· 471 471 if (!hwaddr) 472 472 return NULL; 473 473 474 - if (IS_MCAST(hwaddr)) 474 + if (is_multicast_ether_addr(hwaddr)) 475 475 addr = bc_addr; 476 476 else 477 477 addr = hwaddr;
+2 -4
drivers/staging/rtl8723bs/core/rtw_wlan_util.c
··· 1779 1779 void rtw_alloc_macid(struct adapter *padapter, struct sta_info *psta) 1780 1780 { 1781 1781 int i; 1782 - u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 1783 1782 struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter); 1784 1783 1785 - if (!memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) 1784 + if (is_broadcast_ether_addr(psta->hwaddr)) 1786 1785 return; 1787 1786 1788 1787 if (!memcmp(psta->hwaddr, myid(&padapter->eeprompriv), ETH_ALEN)) { ··· 1806 1807 1807 1808 void rtw_release_macid(struct adapter *padapter, struct sta_info *psta) 1808 1809 { 1809 - u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 1810 1810 struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter); 1811 1811 1812 - if (!memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) 1812 + if (is_broadcast_ether_addr(psta->hwaddr)) 1813 1813 return; 1814 1814 1815 1815 if (!memcmp(psta->hwaddr, myid(&padapter->eeprompriv), ETH_ALEN))
+6 -6
drivers/staging/rtl8723bs/core/rtw_xmit.c
··· 473 473 signed int res = _SUCCESS; 474 474 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 475 475 struct security_priv *psecuritypriv = &padapter->securitypriv; 476 - signed int bmcast = IS_MCAST(pattrib->ra); 476 + signed int bmcast = is_multicast_ether_addr(pattrib->ra); 477 477 478 478 memset(pattrib->dot118021x_UncstKey.skey, 0, 16); 479 479 memset(pattrib->dot11tkiptxmickey.skey, 0, 16); ··· 691 691 else if (pattrib->dhcp_pkt == 1) 692 692 rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1); 693 693 694 - bmcast = IS_MCAST(pattrib->ra); 694 + bmcast = is_multicast_ether_addr(pattrib->ra); 695 695 696 696 /* get sta_info */ 697 697 if (bmcast) { ··· 765 765 struct xmit_priv *pxmitpriv = &padapter->xmitpriv; 766 766 u8 priority[4] = {0x0, 0x0, 0x0, 0x0}; 767 767 u8 hw_hdr_offset = 0; 768 - signed int bmcst = IS_MCAST(pattrib->ra); 768 + signed int bmcst = is_multicast_ether_addr(pattrib->ra); 769 769 770 770 hw_hdr_offset = TXDESC_OFFSET; 771 771 ··· 1035 1035 1036 1036 u8 *pbuf_start; 1037 1037 1038 - s32 bmcst = IS_MCAST(pattrib->ra); 1038 + s32 bmcst = is_multicast_ether_addr(pattrib->ra); 1039 1039 s32 res = _SUCCESS; 1040 1040 1041 1041 if (!pxmitframe->buf_addr) ··· 1143 1143 u8 subtype; 1144 1144 struct sta_info *psta = NULL; 1145 1145 struct pkt_attrib *pattrib = &pxmitframe->attrib; 1146 - s32 bmcst = IS_MCAST(pattrib->ra); 1146 + s32 bmcst = is_multicast_ether_addr(pattrib->ra); 1147 1147 u8 *BIP_AAD = NULL; 1148 1148 u8 *MGMT_body = NULL; 1149 1149 ··· 2016 2016 struct sta_priv *pstapriv = &padapter->stapriv; 2017 2017 struct pkt_attrib *pattrib = &pxmitframe->attrib; 2018 2018 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 2019 - signed int bmcst = IS_MCAST(pattrib->ra); 2019 + signed int bmcst = is_multicast_ether_addr(pattrib->ra); 2020 2020 bool update_tim = false; 2021 2021 2022 2022 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false)
+1 -1
drivers/staging/rtl8723bs/hal/hal_intf.c
··· 217 217 /* memcpy(pmgntframe->attrib.ra, pwlanhdr->addr1, ETH_ALEN); */ 218 218 219 219 if (padapter->securitypriv.binstallBIPkey == true) { 220 - if (IS_MCAST(pmgntframe->attrib.ra)) { 220 + if (is_multicast_ether_addr(pmgntframe->attrib.ra)) { 221 221 pmgntframe->attrib.encrypt = _BIP_; 222 222 /* pmgntframe->attrib.bswenc = true; */ 223 223 } else {
+2 -2
drivers/staging/rtl8723bs/hal/odm.c
··· 429 429 PSTA_INFO_T pstat = pDM_Odm->pODM_StaInfo[i]; 430 430 431 431 if (IS_STA_VALID(pstat)) { 432 - if (IS_MCAST(pstat->hwaddr)) /* if (psta->mac_id == 1) */ 432 + if (is_multicast_ether_addr(pstat->hwaddr)) /* if (psta->mac_id == 1) */ 433 433 continue; 434 434 435 435 if (true == ODM_RAStateCheck(pDM_Odm, pstat->rssi_stat.UndecoratedSmoothedPWDB, false, &pstat->rssi_level)) { ··· 576 576 for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { 577 577 psta = pDM_Odm->pODM_StaInfo[i]; 578 578 if (IS_STA_VALID(psta)) { 579 - if (IS_MCAST(psta->hwaddr)) /* if (psta->mac_id == 1) */ 579 + if (is_multicast_ether_addr(psta->hwaddr)) /* if (psta->mac_id == 1) */ 580 580 continue; 581 581 582 582 if (psta->rssi_stat.UndecoratedSmoothedPWDB == (-1))
+1 -1
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
··· 2609 2609 pmlmeinfo = &(pmlmeext->mlmext_info); 2610 2610 2611 2611 pattrib = &pxmitframe->attrib; 2612 - bmcst = IS_MCAST(pattrib->ra); 2612 + bmcst = is_multicast_ether_addr(pattrib->ra); 2613 2613 2614 2614 ptxdesc = (struct txdesc_8723b *)pbuf; 2615 2615
-15
drivers/staging/rtl8723bs/include/wifi.h
··· 211 211 212 212 #define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24)) 213 213 214 - #define MacAddr_isBcst(addr) \ 215 - (\ 216 - ((addr[0] == 0xff) && (addr[1] == 0xff) && \ 217 - (addr[2] == 0xff) && (addr[3] == 0xff) && \ 218 - (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ 219 - ) 220 - 221 - static inline int IS_MCAST(unsigned char *da) 222 - { 223 - if ((*da) & 0x01) 224 - return true; 225 - else 226 - return false; 227 - } 228 - 229 214 static inline unsigned char *rtl8723bs_get_ra(unsigned char *pframe) 230 215 { 231 216 unsigned char *ra;
+86 -81
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
··· 95 95 static void rtw_2g_channels_init(struct ieee80211_channel *channels) 96 96 { 97 97 memcpy((void *)channels, (void *)rtw_2ghz_channels, 98 - sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM 98 + sizeof(struct ieee80211_channel) * RTW_2G_CHANNELS_NUM 99 99 ); 100 100 } 101 101 102 102 static void rtw_2g_rates_init(struct ieee80211_rate *rates) 103 103 { 104 104 memcpy(rates, rtw_g_rates, 105 - sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM 105 + sizeof(struct ieee80211_rate) * RTW_G_RATES_NUM 106 106 ); 107 107 } 108 108 ··· 126 126 if (!spt_band) 127 127 goto exit; 128 128 129 - spt_band->channels = (struct ieee80211_channel *)(((u8 *)spt_band)+sizeof(struct ieee80211_supported_band)); 130 - spt_band->bitrates = (struct ieee80211_rate *)(((u8 *)spt_band->channels)+sizeof(struct ieee80211_channel)*n_channels); 129 + spt_band->channels = (struct ieee80211_channel *)(((u8 *)spt_band) + sizeof(struct ieee80211_supported_band)); 130 + spt_band->bitrates = (struct ieee80211_rate *)(((u8 *)spt_band->channels) + sizeof(struct ieee80211_channel) * n_channels); 131 131 spt_band->band = band; 132 132 spt_band->n_channels = n_channels; 133 133 spt_band->n_bitrates = n_bitrates; ··· 247 247 u32 wpsielen = 0; 248 248 u8 *wpsie = NULL; 249 249 250 - wpsie = rtw_get_wps_ie(pnetwork->network.ies+_FIXED_IE_LENGTH_, pnetwork->network.ie_length-_FIXED_IE_LENGTH_, NULL, &wpsielen); 250 + wpsie = rtw_get_wps_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, pnetwork->network.ie_length - _FIXED_IE_LENGTH_, NULL, &wpsielen); 251 251 252 252 if (wpsie && wpsielen > 0) 253 - psr = rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); 253 + psr = rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); 254 254 255 255 if (sr != 0) { 256 256 /* it means under processing WPS */ ··· 266 266 } 267 267 /* spin_unlock_bh(&pwdev_priv->scan_req_lock); */ 268 268 269 - 270 269 channel = pnetwork->network.configuration.ds_config; 271 270 freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); 272 271 ··· 275 276 276 277 /* We've set wiphy's signal_type as CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm) */ 277 278 if (check_fwstate(pmlmepriv, _FW_LINKED) == true && 278 - is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) { 279 - notify_signal = 100*translate_percentage_to_dbm(padapter->recvpriv.signal_strength);/* dbm */ 279 + is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) { 280 + notify_signal = 100 * translate_percentage_to_dbm(padapter->recvpriv.signal_strength);/* dbm */ 280 281 } else { 281 - notify_signal = 100*translate_percentage_to_dbm(pnetwork->network.phy_info.signal_strength);/* dbm */ 282 + notify_signal = 100 * translate_percentage_to_dbm(pnetwork->network.phy_info.signal_strength);/* dbm */ 282 283 } 283 284 284 285 buf = kzalloc(MAX_BSSINFO_LEN, GFP_ATOMIC); ··· 313 314 *((__le64 *)pbuf) = cpu_to_le64(notify_timestamp); 314 315 315 316 bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)buf, 316 - len, notify_signal, GFP_ATOMIC); 317 + len, notify_signal, GFP_ATOMIC); 317 318 318 319 if (unlikely(!bss)) 319 320 goto exit; ··· 345 346 346 347 notify_channel = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq); 347 348 bss = cfg80211_get_bss(padapter->rtw_wdev->wiphy, notify_channel, 348 - pnetwork->mac_address, pnetwork->ssid.ssid, 349 - pnetwork->ssid.ssid_length, 350 - IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); 349 + pnetwork->mac_address, pnetwork->ssid.ssid, 350 + pnetwork->ssid.ssid_length, 351 + IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); 351 352 352 353 cfg80211_put_bss(padapter->rtw_wdev->wiphy, bss); 353 354 ··· 448 449 roam_info.links[0].channel = notify_channel; 449 450 roam_info.links[0].bssid = cur_network->network.mac_address; 450 451 roam_info.req_ie = 451 - pmlmepriv->assoc_req+sizeof(struct ieee80211_hdr_3addr)+2; 452 + pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2; 452 453 roam_info.req_ie_len = 453 - pmlmepriv->assoc_req_len-sizeof(struct ieee80211_hdr_3addr)-2; 454 + pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2; 454 455 roam_info.resp_ie = 455 - pmlmepriv->assoc_rsp+sizeof(struct ieee80211_hdr_3addr)+6; 456 + pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6; 456 457 roam_info.resp_ie_len = 457 - pmlmepriv->assoc_rsp_len-sizeof(struct ieee80211_hdr_3addr)-6; 458 + pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6; 458 459 cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC); 459 460 } else { 460 461 cfg80211_connect_result(padapter->pnetdev, cur_network->network.mac_address 461 - , pmlmepriv->assoc_req+sizeof(struct ieee80211_hdr_3addr)+2 462 - , pmlmepriv->assoc_req_len-sizeof(struct ieee80211_hdr_3addr)-2 463 - , pmlmepriv->assoc_rsp+sizeof(struct ieee80211_hdr_3addr)+6 464 - , pmlmepriv->assoc_rsp_len-sizeof(struct ieee80211_hdr_3addr)-6 462 + , pmlmepriv->assoc_req + sizeof(struct ieee80211_hdr_3addr) + 2 463 + , pmlmepriv->assoc_req_len - sizeof(struct ieee80211_hdr_3addr) - 2 464 + , pmlmepriv->assoc_rsp + sizeof(struct ieee80211_hdr_3addr) + 6 465 + , pmlmepriv->assoc_rsp_len - sizeof(struct ieee80211_hdr_3addr) - 6 465 466 , WLAN_STATUS_SUCCESS, GFP_ATOMIC); 466 467 } 467 468 } ··· 486 487 NULL, 0, true, GFP_ATOMIC); 487 488 } else { 488 489 cfg80211_connect_result(padapter->pnetdev, NULL, NULL, 0, NULL, 0, 489 - WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/); 490 + WLAN_STATUS_UNSPECIFIED_FAILURE, GFP_ATOMIC/*GFP_KERNEL*/); 490 491 } 491 492 } 492 493 } ··· 707 708 param->u.crypt.err = 0; 708 709 param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0'; 709 710 710 - if (param_len < (u32) ((u8 *) param->u.crypt.key - (u8 *) param) + param->u.crypt.key_len) { 711 + if (param_len < (u32)((u8 *)param->u.crypt.key - (u8 *)param) + param->u.crypt.key_len) { 711 712 ret = -EINVAL; 712 713 goto exit; 713 714 } ··· 777 778 psta->ieee8021x_blocked = false; 778 779 779 780 if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || 780 - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 781 + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 781 782 psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; 782 783 } 783 784 ··· 826 827 pbcmc_sta->ieee8021x_blocked = false; 827 828 828 829 if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || 829 - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 830 + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 830 831 pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; 831 832 } 832 833 } ··· 944 945 } 945 946 946 947 static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, 947 - struct net_device *ndev, int link_id, u8 key_index 948 - , bool unicast, bool multicast 949 - ) 948 + struct net_device *ndev, int link_id, 949 + u8 key_index, bool unicast, 950 + bool multicast) 950 951 { 951 952 struct adapter *padapter = rtw_netdev_priv(ndev); 952 953 struct security_priv *psecuritypriv = &padapter->securitypriv; ··· 1018 1019 } 1019 1020 1020 1021 /* for Ad-Hoc/AP mode */ 1021 - if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) 1022 - || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) 1023 - || check_fwstate(pmlmepriv, WIFI_AP_STATE)) 1024 - && check_fwstate(pmlmepriv, _FW_LINKED)) { 1022 + if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || 1023 + check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) || 1024 + check_fwstate(pmlmepriv, WIFI_AP_STATE)) && 1025 + check_fwstate(pmlmepriv, _FW_LINKED)) { 1025 1026 /* TODO: should acquire station info... */ 1026 1027 } 1027 1028 ··· 1121 1122 struct wlan_bssid_ex *select_network = &pnetwork->network; 1122 1123 1123 1124 bss = cfg80211_get_bss(wiphy, NULL/*notify_channel*/, 1124 - select_network->mac_address, select_network->ssid.ssid, 1125 - select_network->ssid.ssid_length, IEEE80211_BSS_TYPE_ANY, 1126 - IEEE80211_PRIVACY_ANY); 1125 + select_network->mac_address, 1126 + select_network->ssid.ssid, 1127 + select_network->ssid.ssid_length, 1128 + IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); 1127 1129 1128 1130 if (bss) { 1129 1131 cfg80211_unlink_bss(wiphy, bss); ··· 1219 1219 spin_unlock_bh(&pwdev_priv->scan_req_lock); 1220 1220 1221 1221 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { 1222 - if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS|_FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) { 1222 + if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS | _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true) { 1223 1223 need_indicate_scan_done = true; 1224 1224 goto check_need_indicate_scan_done; 1225 1225 } ··· 1273 1273 } 1274 1274 1275 1275 /* parsing channels, n_channels */ 1276 - memset(ch, 0, sizeof(struct rtw_ieee80211_channel)*RTW_CHANNEL_SCAN_AMOUNT); 1276 + memset(ch, 0, sizeof(struct rtw_ieee80211_channel) * RTW_CHANNEL_SCAN_AMOUNT); 1277 1277 for (i = 0; i < request->n_channels && i < RTW_CHANNEL_SCAN_AMOUNT; i++) { 1278 1278 ch[i].hw_value = request->channels[i]->hw_value; 1279 1279 ch[i].flags = request->channels[i]->flags; ··· 1287 1287 } else if (request->n_channels <= 4) { 1288 1288 for (j = request->n_channels - 1; j >= 0; j--) 1289 1289 for (i = 0; i < survey_times; i++) 1290 - memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel)); 1290 + memcpy(&ch[j * survey_times + i], &ch[j], sizeof(struct rtw_ieee80211_channel)); 1291 1291 _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch, survey_times * request->n_channels); 1292 1292 } else { 1293 1293 _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, NULL, 0); ··· 1329 1329 } 1330 1330 1331 1331 static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, 1332 - enum nl80211_auth_type sme_auth_type) 1332 + enum nl80211_auth_type sme_auth_type) 1333 1333 { 1334 1334 switch (sme_auth_type) { 1335 1335 case NL80211_AUTHTYPE_AUTOMATIC: ··· 1436 1436 goto exit; 1437 1437 } 1438 1438 1439 - if (ielen > MAX_WPA_IE_LEN+MAX_WPS_IE_LEN+MAX_P2P_IE_LEN) { 1439 + if (ielen > MAX_WPA_IE_LEN + MAX_WPS_IE_LEN + MAX_P2P_IE_LEN) { 1440 1440 ret = -EINVAL; 1441 1441 goto exit; 1442 1442 } ··· 1456 1456 1457 1457 pwpa = rtw_get_wpa_ie(buf, &wpa_ielen, ielen); 1458 1458 if (pwpa && wpa_ielen > 0) { 1459 - if (rtw_parse_wpa_ie(pwpa, wpa_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { 1459 + if (rtw_parse_wpa_ie(pwpa, wpa_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { 1460 1460 padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; 1461 1461 padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; 1462 - memcpy(padapter->securitypriv.supplicant_ie, &pwpa[0], wpa_ielen+2); 1462 + memcpy(padapter->securitypriv.supplicant_ie, &pwpa[0], wpa_ielen + 2); 1463 1463 } 1464 1464 } 1465 1465 1466 1466 pwpa2 = rtw_get_wpa2_ie(buf, &wpa2_ielen, ielen); 1467 1467 if (pwpa2 && wpa2_ielen > 0) { 1468 - if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { 1468 + if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { 1469 1469 padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; 1470 1470 padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK; 1471 - memcpy(padapter->securitypriv.supplicant_ie, &pwpa2[0], wpa2_ielen+2); 1471 + memcpy(padapter->securitypriv.supplicant_ie, &pwpa2[0], wpa2_ielen + 2); 1472 1472 } 1473 1473 } 1474 1474 ··· 1634 1634 } 1635 1635 1636 1636 static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, 1637 - struct cfg80211_connect_params *sme) 1637 + struct cfg80211_connect_params *sme) 1638 1638 { 1639 1639 int ret = 0; 1640 1640 enum ndis_802_11_authentication_mode authmode; ··· 1709 1709 1710 1710 /* For WEP Shared auth */ 1711 1711 if ((psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Shared || 1712 - psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Auto) && sme->key) { 1712 + psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Auto) && sme->key) { 1713 1713 u32 wep_key_idx, wep_key_len, wep_total_len; 1714 1714 struct ndis_802_11_wep *pwep = NULL; 1715 1715 ··· 1807 1807 } 1808 1808 1809 1809 static int cfg80211_rtw_set_txpower(struct wiphy *wiphy, 1810 - struct wireless_dev *wdev, 1811 - enum nl80211_tx_power_setting type, int mbm) 1810 + struct wireless_dev *wdev, 1811 + enum nl80211_tx_power_setting type, int mbm) 1812 1812 { 1813 1813 return 0; 1814 1814 } 1815 1815 1816 1816 static int cfg80211_rtw_get_txpower(struct wiphy *wiphy, 1817 - struct wireless_dev *wdev, 1818 - int *dbm) 1817 + struct wireless_dev *wdev, int *dbm) 1819 1818 { 1820 1819 *dbm = (12); 1821 1820 ··· 1850 1851 u8 index, blInserted = false; 1851 1852 struct adapter *padapter = rtw_netdev_priv(ndev); 1852 1853 struct security_priv *psecuritypriv = &padapter->securitypriv; 1853 - u8 strZeroMacAddress[ETH_ALEN] = { 0x00 }; 1854 1854 1855 - if (!memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN)) 1855 + if (is_zero_ether_addr((u8 *)pmksa->bssid)) 1856 1856 return -EINVAL; 1857 1857 1858 1858 blInserted = false; ··· 1861 1863 if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN)) { 1862 1864 memcpy(psecuritypriv->PMKIDList[index].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); 1863 1865 psecuritypriv->PMKIDList[index].bUsed = true; 1864 - psecuritypriv->PMKIDIndex = index+1; 1866 + psecuritypriv->PMKIDIndex = index + 1; 1865 1867 blInserted = true; 1866 1868 break; 1867 1869 } ··· 2062 2064 _rtw_xmit_entry(skb, padapter->pnetdev); 2063 2065 return NETDEV_TX_OK; 2064 2066 2065 - } else if ((frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE)) == 2066 - (IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_ACTION)) { 2067 + } else if ((frame_control & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == 2068 + (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION)) { 2067 2069 /* only for action frames */ 2068 2070 struct xmit_frame *pmgntframe; 2069 2071 struct pkt_attrib *pattrib; ··· 2172 2174 goto out; 2173 2175 2174 2176 *ndev = pwdev_priv->pmon_ndev = mon_ndev; 2175 - memcpy(pwdev_priv->ifname_mon, name, IFNAMSIZ+1); 2177 + memcpy(pwdev_priv->ifname_mon, name, IFNAMSIZ + 1); 2176 2178 2177 2179 out: 2178 2180 if (ret && mon_wdev) { ··· 2226 2228 } 2227 2229 2228 2230 static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy, 2229 - struct wireless_dev *wdev 2231 + struct wireless_dev *wdev 2230 2232 ) 2231 2233 { 2232 2234 struct net_device *ndev = wdev_to_ndev(wdev); ··· 2266 2268 if (head_len < 24) 2267 2269 return -EINVAL; 2268 2270 2269 - pbuf = rtw_zmalloc(head_len+tail_len); 2271 + pbuf = rtw_zmalloc(head_len + tail_len); 2270 2272 if (!pbuf) 2271 2273 return -ENOMEM; 2272 2274 2273 - memcpy(pbuf, (void *)head+24, head_len-24);/* 24 =beacon header len. */ 2274 - memcpy(pbuf+head_len-24, (void *)tail, tail_len); 2275 + memcpy(pbuf, (void *)head + 24, head_len - 24);/* 24 =beacon header len. */ 2276 + memcpy(pbuf + head_len - 24, (void *)tail, tail_len); 2275 2277 2276 - len = head_len+tail_len-24; 2278 + len = head_len + tail_len - 24; 2277 2279 2278 2280 /* check wps ie if inclued */ 2279 2281 rtw_get_wps_ie(pbuf + _FIXED_IE_LENGTH_, len - _FIXED_IE_LENGTH_, NULL, &wps_ielen); ··· 2293 2295 } 2294 2296 2295 2297 static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, 2296 - struct cfg80211_ap_settings *settings) 2298 + struct cfg80211_ap_settings *settings) 2297 2299 { 2298 2300 int ret = 0; 2299 2301 struct adapter *adapter = rtw_netdev_priv(ndev); 2300 2302 2301 - ret = rtw_add_beacon(adapter, settings->beacon.head, settings->beacon.head_len, 2302 - settings->beacon.tail, settings->beacon.tail_len); 2303 + ret = rtw_add_beacon(adapter, settings->beacon.head, 2304 + settings->beacon.head_len, settings->beacon.tail, 2305 + settings->beacon.tail_len); 2303 2306 2304 2307 adapter->mlmeextpriv.mlmext_info.hidden_ssid_mode = settings->hidden_ssid; 2305 2308 ··· 2317 2318 return ret; 2318 2319 } 2319 2320 2320 - static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev, 2321 - struct cfg80211_beacon_data *info) 2321 + static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, 2322 + struct net_device *ndev, 2323 + struct cfg80211_beacon_data *info) 2322 2324 { 2323 2325 struct adapter *adapter = rtw_netdev_priv(ndev); 2324 2326 ··· 2332 2332 return 0; 2333 2333 } 2334 2334 2335 - static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev, 2336 - const u8 *mac, 2337 - struct station_parameters *params) 2335 + static int cfg80211_rtw_add_station(struct wiphy *wiphy, 2336 + struct net_device *ndev, 2337 + const u8 *mac, 2338 + struct station_parameters *params) 2338 2339 { 2339 2340 return 0; 2340 2341 } ··· 2397 2396 return ret; 2398 2397 } 2399 2398 2400 - static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, 2401 - const u8 *mac, struct station_parameters *params) 2399 + static int cfg80211_rtw_change_station(struct wiphy *wiphy, 2400 + struct net_device *ndev, 2401 + const u8 *mac, 2402 + struct station_parameters *params) 2402 2403 { 2403 2404 return 0; 2404 2405 } ··· 2425 2422 return psta; 2426 2423 } 2427 2424 2428 - static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *ndev, 2429 - int idx, u8 *mac, struct station_info *sinfo) 2425 + static int cfg80211_rtw_dump_station(struct wiphy *wiphy, 2426 + struct net_device *ndev, 2427 + int idx, u8 *mac, 2428 + struct station_info *sinfo) 2430 2429 { 2431 2430 int ret = 0; 2432 2431 struct adapter *padapter = rtw_netdev_priv(ndev); ··· 2450 2445 return ret; 2451 2446 } 2452 2447 2453 - static int cfg80211_rtw_change_bss(struct wiphy *wiphy, struct net_device *ndev, 2454 - struct bss_parameters *params) 2448 + static int cfg80211_rtw_change_bss(struct wiphy *wiphy, 2449 + struct net_device *ndev, 2450 + struct bss_parameters *params) 2455 2451 { 2456 2452 return 0; 2457 2453 } ··· 2535 2529 return ret; 2536 2530 } 2537 2531 2538 - static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, 2539 - struct wireless_dev *wdev, 2540 - struct cfg80211_mgmt_tx_params *params, 2541 - u64 *cookie) 2532 + static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, 2533 + struct cfg80211_mgmt_tx_params *params, 2534 + u64 *cookie) 2542 2535 { 2543 2536 struct net_device *ndev = wdev_to_ndev(wdev); 2544 2537 struct ieee80211_channel *chan = params->chan; ··· 2563 2558 pwdev_priv = adapter_wdev_data(padapter); 2564 2559 2565 2560 /* cookie generation */ 2566 - *cookie = (unsigned long) buf; 2561 + *cookie = (unsigned long)buf; 2567 2562 2568 2563 /* indicate ack before issue frame to avoid racing with rsp frame */ 2569 2564 rtw_cfg80211_mgmt_tx_status(padapter, *cookie, buf, len, ack, GFP_KERNEL);
+58 -103
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
··· 13 13 #include <linux/jiffies.h> 14 14 #include <linux/kernel.h> 15 15 16 - #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV+30) 16 + #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) 17 17 18 18 static int wpa_set_auth_algs(struct net_device *dev, u32 value) 19 19 { ··· 40 40 } 41 41 42 42 return ret; 43 - 44 43 } 45 44 46 45 static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) ··· 79 80 } 80 81 81 82 if (strcmp(param->u.crypt.alg, "WEP") == 0) { 82 - 83 83 padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; 84 84 padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_; 85 85 padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_; ··· 125 127 goto exit; 126 128 } 127 129 128 - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); 130 + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); 129 131 psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; 130 132 rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0, true); 131 133 } ··· 147 149 psta->ieee8021x_blocked = false; 148 150 149 151 if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || 150 - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 152 + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 151 153 psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; 152 154 } 153 155 ··· 156 158 157 159 if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */ 158 160 /* DEBUG_ERR(("\nset key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len)); */ 159 - memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); 160 - memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8); 161 + memcpy(psta->dot11tkiptxmickey.skey, &param->u.crypt.key[16], 8); 162 + memcpy(psta->dot11tkiprxmickey.skey, &param->u.crypt.key[24], 8); 161 163 162 164 padapter->securitypriv.busetkipkey = false; 163 165 /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */ ··· 169 171 memcpy(padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); 170 172 /* only TKIP group key need to install this */ 171 173 if (param->u.crypt.key_len > 16) { 172 - memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8); 173 - memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); 174 + memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &param->u.crypt.key[16], 8); 175 + memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &param->u.crypt.key[24], 8); 174 176 } 175 177 padapter->securitypriv.binstallGrpkey = true; 176 178 ··· 200 202 pbcmc_sta->ieee8021x_blocked = false; 201 203 202 204 if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || 203 - (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 205 + (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { 204 206 pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; 205 207 } 206 208 } ··· 315 317 while (cnt < ielen) { 316 318 eid = buf[cnt]; 317 319 318 - if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&buf[cnt+2], wps_oui, 4))) { 319 - padapter->securitypriv.wps_ie_len = ((buf[cnt+1]+2) < MAX_WPS_IE_LEN) ? (buf[cnt+1]+2):MAX_WPS_IE_LEN; 320 + if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&buf[cnt + 2], wps_oui, 4))) { 321 + padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < MAX_WPS_IE_LEN) ? (buf[cnt + 1] + 2) : MAX_WPS_IE_LEN; 320 322 321 323 memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len); 322 324 323 325 set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); 324 326 325 - cnt += buf[cnt+1]+2; 327 + cnt += buf[cnt + 1] + 2; 326 328 327 329 break; 328 330 } else { 329 - cnt += buf[cnt+1]+2; /* goto next */ 331 + cnt += buf[cnt + 1] + 2; /* goto next */ 330 332 } 331 333 } 332 334 } ··· 334 336 335 337 /* TKIP and AES disallow multicast packets until installing group key */ 336 338 if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_ || 337 - padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || 338 - padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) 339 + padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || 340 + padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) 339 341 /* WPS open need to enable multicast */ 340 342 /* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */ 341 343 rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr); ··· 359 361 360 362 /* ret = ieee80211_wpa_enable(ieee, value); */ 361 363 362 - switch ((value)&0xff) { 364 + switch ((value) & 0xff) { 363 365 case 1: /* WPA */ 364 366 padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK; /* WPA_PSK */ 365 367 padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled; ··· 390 392 * be set. 391 393 */ 392 394 break; 393 - 394 395 } 395 396 case IEEE_PARAM_PRIVACY_INVOKED: 396 397 ··· 423 426 424 427 default: 425 428 426 - 427 - 428 429 ret = -EOPNOTSUPP; 429 430 430 - 431 431 break; 432 - 433 432 } 434 433 435 434 return ret; 436 - 437 435 } 438 436 439 437 static int wpa_mlme(struct net_device *dev, u32 command, u32 reason) ··· 457 465 } 458 466 459 467 return ret; 460 - 461 468 } 462 469 463 470 static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) ··· 479 488 } 480 489 481 490 switch (param->cmd) { 482 - 483 491 case IEEE_CMD_SET_WPA_PARAM: 484 492 ret = wpa_set_param(dev, param->u.wpa_param.name, param->u.wpa_param.value); 485 493 break; ··· 499 509 default: 500 510 ret = -EOPNOTSUPP; 501 511 break; 502 - 503 512 } 504 513 505 514 if (ret == 0 && copy_to_user(p->pointer, param, p->length)) ··· 518 529 struct sta_info *psta = NULL, *pbcmc_sta = NULL; 519 530 struct adapter *padapter = rtw_netdev_priv(dev); 520 531 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 521 - struct security_priv *psecuritypriv = &(padapter->securitypriv); 532 + struct security_priv *psecuritypriv = &padapter->securitypriv; 522 533 struct sta_priv *pstapriv = &padapter->stapriv; 523 534 char *txkey = padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey; 524 535 char *rxkey = padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey; ··· 559 570 goto exit; 560 571 } 561 572 562 - 563 573 if (strcmp(param->u.crypt.alg, "WEP") == 0 && !psta) { 564 574 wep_key_idx = param->u.crypt.idx; 565 575 wep_key_len = param->u.crypt.key_len; ··· 567 579 ret = -EINVAL; 568 580 goto exit; 569 581 } 570 - 571 582 572 583 if (wep_key_len > 0) { 573 584 wep_key_len = wep_key_len <= 5 ? 5 : 13; ··· 578 591 579 592 pwep->key_length = wep_key_len; 580 593 pwep->length = wep_total_len; 581 - 582 594 } 583 595 584 596 pwep->key_index = wep_key_idx; ··· 595 609 psecuritypriv->dot118021XGrpPrivacy = _WEP104_; 596 610 } 597 611 598 - 599 612 psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx; 600 613 601 - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); 614 + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); 602 615 603 616 psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; 604 617 ··· 606 621 /* don't update "psecuritypriv->dot11PrivacyAlgrthm" and */ 607 622 /* psecuritypriv->dot11PrivacyKeyIndex =keyid", but can rtw_set_key to cam */ 608 623 609 - memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->key_material, pwep->key_length); 624 + memcpy(&psecuritypriv->dot11DefKey[wep_key_idx].skey[0], pwep->key_material, pwep->key_length); 610 625 611 626 psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->key_length; 612 627 ··· 614 629 } 615 630 616 631 goto exit; 617 - 618 632 } 619 - 620 633 621 634 if (!psta && check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* group key */ 622 635 if (param->u.crypt.set_tx == 1) { ··· 623 640 624 641 psecuritypriv->dot118021XGrpPrivacy = _WEP40_; 625 642 if (param->u.crypt.key_len == 13) 626 - psecuritypriv->dot118021XGrpPrivacy = _WEP104_; 643 + psecuritypriv->dot118021XGrpPrivacy = _WEP104_; 627 644 628 645 } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { 629 646 psecuritypriv->dot118021XGrpPrivacy = _TKIP_; ··· 632 649 633 650 /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ 634 651 /* set mic key */ 635 - memcpy(txkey, &(param->u.crypt.key[16]), 8); 636 - memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8); 652 + memcpy(txkey, &param->u.crypt.key[16], 8); 653 + memcpy(psecuritypriv->dot118021XGrprxmickey[param->u.crypt.idx].skey, &param->u.crypt.key[24], 8); 637 654 638 655 psecuritypriv->busetkipkey = true; 639 656 640 - } 641 - else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { 657 + } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { 642 658 psecuritypriv->dot118021XGrpPrivacy = _AES_; 643 659 644 660 memcpy(grpkey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len)); ··· 661 679 } 662 680 663 681 goto exit; 664 - 665 682 } 666 683 667 684 if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */ ··· 677 696 678 697 /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ 679 698 /* set mic key */ 680 - memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8); 681 - memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8); 699 + memcpy(psta->dot11tkiptxmickey.skey, &param->u.crypt.key[16], 8); 700 + memcpy(psta->dot11tkiprxmickey.skey, &param->u.crypt.key[24], 8); 682 701 683 702 psecuritypriv->busetkipkey = true; 684 703 685 704 } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { 686 - 687 705 psta->dot118021XPrivacy = _AES_; 688 706 } else { 689 707 psta->dot118021XPrivacy = _NO_PRIVACY_; ··· 706 726 707 727 /* DEBUG_ERR("set key length :param->u.crypt.key_len =%d\n", param->u.crypt.key_len); */ 708 728 /* set mic key */ 709 - memcpy(txkey, &(param->u.crypt.key[16]), 8); 710 - memcpy(rxkey, &(param->u.crypt.key[24]), 8); 729 + memcpy(txkey, &param->u.crypt.key[16], 8); 730 + memcpy(rxkey, &param->u.crypt.key[24], 8); 711 731 712 732 psecuritypriv->busetkipkey = true; 713 733 ··· 740 760 kfree(pwep); 741 761 742 762 return ret; 743 - 744 763 } 745 764 746 765 static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int len) 747 766 { 748 767 int ret = 0; 749 768 struct adapter *padapter = rtw_netdev_priv(dev); 750 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 769 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 751 770 struct sta_priv *pstapriv = &padapter->stapriv; 752 771 unsigned char *pbuf = param->u.bcn_ie.buf; 753 772 ··· 758 779 if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0)) 759 780 pstapriv->max_num_sta = NUM_STA; 760 781 761 - 762 - if (rtw_check_beacon_data(padapter, pbuf, (len-12-2)) == _SUCCESS)/* 12 = param header, 2:no packed */ 782 + if (rtw_check_beacon_data(padapter, pbuf, (len - 12 - 2)) == _SUCCESS)/* 12 = param header, 2:no packed */ 763 783 ret = 0; 764 784 else 765 785 ret = -EINVAL; 766 786 767 - 768 787 return ret; 769 - 770 788 } 771 789 772 790 static void rtw_hostapd_sta_flush(struct net_device *dev) ··· 784 808 int ret = 0; 785 809 struct sta_info *psta = NULL; 786 810 struct adapter *padapter = rtw_netdev_priv(dev); 787 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 811 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 788 812 struct sta_priv *pstapriv = &padapter->stapriv; 789 813 790 - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) 814 + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) 791 815 return -EINVAL; 792 816 793 817 if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && ··· 814 838 815 839 memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16); 816 840 817 - 818 841 /* check wmm cap. */ 819 - if (WLAN_STA_WME&flags) 842 + if (WLAN_STA_WME & flags) 820 843 psta->qos_option = 1; 821 844 else 822 845 psta->qos_option = 0; ··· 824 849 psta->qos_option = 0; 825 850 826 851 /* chec 802.11n ht cap. */ 827 - if (WLAN_STA_HT&flags) { 852 + if (WLAN_STA_HT & flags) { 828 853 psta->htpriv.ht_option = true; 829 854 psta->qos_option = 1; 830 855 memcpy((void *)&psta->htpriv.ht_cap, (void *)&param->u.add_sta.ht_cap, sizeof(struct ieee80211_ht_cap)); ··· 832 857 psta->htpriv.ht_option = false; 833 858 } 834 859 835 - if (pmlmepriv->htpriv.ht_option == false) 860 + if (!pmlmepriv->htpriv.ht_option) 836 861 psta->htpriv.ht_option = false; 837 862 838 863 update_sta_info_apmode(padapter, psta); 839 - 840 864 841 865 } else { 842 866 ret = -ENOMEM; 843 867 } 844 868 845 869 return ret; 846 - 847 870 } 848 871 849 872 static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) ··· 849 876 int ret = 0; 850 877 struct sta_info *psta = NULL; 851 878 struct adapter *padapter = rtw_netdev_priv(dev); 852 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 879 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 853 880 struct sta_priv *pstapriv = &padapter->stapriv; 854 881 855 - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) 882 + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) 856 883 return -EINVAL; 857 884 858 885 if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && ··· 870 897 list_del_init(&psta->asoc_list); 871 898 pstapriv->asoc_list_cnt--; 872 899 updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING); 873 - 874 900 } 875 901 spin_unlock_bh(&pstapriv->asoc_list_lock); 876 902 877 903 associated_clients_update(padapter, updated); 878 904 879 905 psta = NULL; 880 - 881 906 } 882 907 883 908 return ret; 884 - 885 909 } 886 910 887 911 static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *param, int len) ··· 886 916 int ret = 0; 887 917 struct sta_info *psta = NULL; 888 918 struct adapter *padapter = rtw_netdev_priv(dev); 889 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 919 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 890 920 struct sta_priv *pstapriv = &padapter->stapriv; 891 921 struct ieee_param_ex *param_ex = (struct ieee_param_ex *)param; 892 922 struct sta_data *psta_data = (struct sta_data *)param_ex->data; 893 923 894 - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) 924 + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) 895 925 return -EINVAL; 896 926 897 927 if (param_ex->sta_addr[0] == 0xff && param_ex->sta_addr[1] == 0xff && ··· 933 963 psta_data->tx_bytes = psta->sta_stats.tx_bytes; 934 964 psta_data->tx_drops = psta->sta_stats.tx_drops; 935 965 936 - 937 966 } else { 938 967 ret = -1; 939 968 } 940 969 941 970 return ret; 942 - 943 971 } 944 972 945 973 static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) ··· 945 977 int ret = 0; 946 978 struct sta_info *psta = NULL; 947 979 struct adapter *padapter = rtw_netdev_priv(dev); 948 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 980 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 949 981 struct sta_priv *pstapriv = &padapter->stapriv; 950 982 951 - if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) 983 + if (check_fwstate(pmlmepriv, (_FW_LINKED | WIFI_AP_STATE)) != true) 952 984 return -EINVAL; 953 985 954 986 if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && ··· 965 997 966 998 wpa_ie_len = psta->wpa_ie[1]; 967 999 968 - copy_len = ((wpa_ie_len+2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)):(wpa_ie_len+2); 1000 + copy_len = ((wpa_ie_len + 2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)) : (wpa_ie_len + 2); 969 1001 970 1002 param->u.wpa_ie.len = copy_len; 971 1003 ··· 976 1008 } 977 1009 978 1010 return ret; 979 - 980 1011 } 981 1012 982 1013 static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, int len) ··· 983 1016 int ret = 0; 984 1017 unsigned char wps_oui[4] = {0x0, 0x50, 0xf2, 0x04}; 985 1018 struct adapter *padapter = rtw_netdev_priv(dev); 986 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 987 - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); 1019 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1020 + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 988 1021 int ie_len; 989 1022 990 1023 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) 991 1024 return -EINVAL; 992 1025 993 - ie_len = len-12-2;/* 12 = param header, 2:no packed */ 994 - 1026 + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ 995 1027 996 1028 kfree(pmlmepriv->wps_beacon_ie); 997 1029 pmlmepriv->wps_beacon_ie = NULL; ··· 1008 1042 pmlmeext->bstart_bss = true; 1009 1043 } 1010 1044 1011 - 1012 1045 return ret; 1013 - 1014 1046 } 1015 1047 1016 1048 static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *param, int len) 1017 1049 { 1018 1050 int ret = 0; 1019 1051 struct adapter *padapter = rtw_netdev_priv(dev); 1020 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 1052 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1021 1053 int ie_len; 1022 1054 1023 1055 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) 1024 1056 return -EINVAL; 1025 1057 1026 - ie_len = len-12-2;/* 12 = param header, 2:no packed */ 1027 - 1058 + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ 1028 1059 1029 1060 kfree(pmlmepriv->wps_probe_resp_ie); 1030 1061 pmlmepriv->wps_probe_resp_ie = NULL; ··· 1035 1072 memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len); 1036 1073 } 1037 1074 1038 - 1039 1075 return ret; 1040 - 1041 1076 } 1042 1077 1043 1078 static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *param, int len) 1044 1079 { 1045 1080 int ret = 0; 1046 1081 struct adapter *padapter = rtw_netdev_priv(dev); 1047 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 1082 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1048 1083 int ie_len; 1049 1084 1050 1085 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) 1051 1086 return -EINVAL; 1052 1087 1053 - ie_len = len-12-2;/* 12 = param header, 2:no packed */ 1054 - 1088 + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ 1055 1089 1056 1090 kfree(pmlmepriv->wps_assoc_resp_ie); 1057 1091 pmlmepriv->wps_assoc_resp_ie = NULL; ··· 1062 1102 memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len); 1063 1103 } 1064 1104 1065 - 1066 1105 return ret; 1067 - 1068 1106 } 1069 1107 1070 1108 static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, int len) 1071 1109 { 1072 1110 int ret = 0; 1073 1111 struct adapter *adapter = rtw_netdev_priv(dev); 1074 - struct mlme_priv *mlmepriv = &(adapter->mlmepriv); 1075 - struct mlme_ext_priv *mlmeext = &(adapter->mlmeextpriv); 1076 - struct mlme_ext_info *mlmeinfo = &(mlmeext->mlmext_info); 1112 + struct mlme_priv *mlmepriv = &adapter->mlmepriv; 1113 + struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; 1114 + struct mlme_ext_info *mlmeinfo = &mlmeext->mlmext_info; 1077 1115 int ie_len; 1078 1116 u8 *ssid_ie; 1079 1117 char ssid[NDIS_802_11_LENGTH_SSID + 1]; ··· 1086 1128 1087 1129 mlmeinfo->hidden_ssid_mode = ignore_broadcast_ssid = param->u.bcn_ie.reserved[1]; 1088 1130 1089 - ie_len = len-12-2;/* 12 = param header, 2:no packed */ 1131 + ie_len = len - 12 - 2;/* 12 = param header, 2:no packed */ 1090 1132 ssid_ie = rtw_get_ie(param->u.bcn_ie.buf, WLAN_EID_SSID, &ssid_len, ie_len); 1091 1133 1092 1134 if (ssid_ie && ssid_len > 0 && ssid_len <= NDIS_802_11_LENGTH_SSID) { 1093 1135 struct wlan_bssid_ex *pbss_network = &mlmepriv->cur_network.network; 1094 1136 struct wlan_bssid_ex *pbss_network_ext = &mlmeinfo->network; 1095 1137 1096 - memcpy(ssid, ssid_ie+2, ssid_len); 1138 + memcpy(ssid, ssid_ie + 2, ssid_len); 1097 1139 ssid[ssid_len] = 0x0; 1098 1140 1099 1141 memcpy(pbss_network->ssid.ssid, (void *)ssid, ssid_len); ··· 1108 1150 static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *param, int len) 1109 1151 { 1110 1152 struct adapter *padapter = rtw_netdev_priv(dev); 1111 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 1153 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1112 1154 1113 1155 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) 1114 1156 return -EINVAL; ··· 1121 1163 1122 1164 rtw_acl_remove_sta(padapter, param->sta_addr); 1123 1165 return 0; 1124 - 1125 1166 } 1126 1167 1127 1168 static int rtw_ioctl_acl_add_sta(struct net_device *dev, struct ieee_param *param, int len) 1128 1169 { 1129 1170 struct adapter *padapter = rtw_netdev_priv(dev); 1130 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 1171 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1131 1172 1132 1173 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) 1133 1174 return -EINVAL; ··· 1138 1181 } 1139 1182 1140 1183 return rtw_acl_add_sta(padapter, param->sta_addr); 1141 - 1142 1184 } 1143 1185 1144 1186 static int rtw_ioctl_set_macaddr_acl(struct net_device *dev, struct ieee_param *param, int len) 1145 1187 { 1146 1188 int ret = 0; 1147 1189 struct adapter *padapter = rtw_netdev_priv(dev); 1148 - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); 1190 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1149 1191 1150 1192 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) 1151 1193 return -EINVAL; ··· 1161 1205 struct adapter *padapter = rtw_netdev_priv(dev); 1162 1206 1163 1207 /* 1164 - * this function is expect to call in master mode, which allows no power saving 1165 - * so, we just check hw_init_completed 1166 - */ 1208 + * this function is expect to call in master mode, which allows no power saving 1209 + * so, we just check hw_init_completed 1210 + */ 1167 1211 1168 1212 if (!padapter->hw_init_completed) 1169 1213 return -EPERM; ··· 1268 1312 default: 1269 1313 ret = -EOPNOTSUPP; 1270 1314 break; 1271 - 1272 1315 } 1273 1316 1274 1317 if (ret == 0 && copy_to_user(p->pointer, param, p->length))
+1 -1
drivers/staging/rtl8723bs/os_dep/recv_linux.c
··· 101 101 struct sk_buff *pskb2 = NULL; 102 102 struct sta_info *psta = NULL; 103 103 struct sta_priv *pstapriv = &padapter->stapriv; 104 - int bmcast = IS_MCAST(pattrib->dst); 104 + int bmcast = is_multicast_ether_addr(pattrib->dst); 105 105 106 106 if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) { 107 107 if (bmcast) {
+1 -2
drivers/staging/rts5208/sd.c
··· 4501 4501 sd_card->sd_lock_notify = 1; 4502 4502 if (sd_lock_state && 4503 4503 (sd_card->sd_lock_status & SD_LOCK_1BIT_MODE)) { 4504 - sd_card->sd_lock_status |= ( 4505 - SD_UNLOCK_POW_ON | SD_SDR_RST); 4504 + sd_card->sd_lock_status |= (SD_UNLOCK_POW_ON | SD_SDR_RST); 4506 4505 if (CHK_SD(sd_card)) { 4507 4506 retval = reset_sd(chip); 4508 4507 if (retval != STATUS_SUCCESS) {
+1 -1
drivers/staging/sm750fb/ddk750_dvi.c
··· 14 14 static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { 15 15 #ifdef DVI_CTRL_SII164 16 16 { 17 - .init = sii164InitChip, 17 + .init = sii164_init_chip, 18 18 .get_vendor_id = sii164_get_vendor_id, 19 19 .get_device_id = sii164GetDeviceID, 20 20 #ifdef SII164_FULL_FUNCTIONS
+11 -11
drivers/staging/sm750fb/ddk750_sii164.c
··· 72 72 */ 73 73 74 74 /* 75 - * sii164InitChip 75 + * sii164_init_chip 76 76 * This function initialize and detect the DVI controller chip. 77 77 * 78 78 * Input: ··· 118 118 * 0 - Success 119 119 * -1 - Fail. 120 120 */ 121 - long sii164InitChip(unsigned char edge_select, 122 - unsigned char bus_select, 123 - unsigned char dual_edge_clk_select, 124 - unsigned char hsync_enable, 125 - unsigned char vsync_enable, 126 - unsigned char deskew_enable, 127 - unsigned char deskew_setting, 128 - unsigned char continuous_sync_enable, 129 - unsigned char pll_filter_enable, 130 - unsigned char pll_filter_value) 121 + long sii164_init_chip(unsigned char edge_select, 122 + unsigned char bus_select, 123 + unsigned char dual_edge_clk_select, 124 + unsigned char hsync_enable, 125 + unsigned char vsync_enable, 126 + unsigned char deskew_enable, 127 + unsigned char deskew_setting, 128 + unsigned char continuous_sync_enable, 129 + unsigned char pll_filter_enable, 130 + unsigned char pll_filter_value) 131 131 { 132 132 unsigned char config; 133 133
+10 -10
drivers/staging/sm750fb/ddk750_sii164.h
··· 16 16 }; 17 17 18 18 /* Silicon Image SiI164 chip prototype */ 19 - long sii164InitChip(unsigned char edgeSelect, 20 - unsigned char busSelect, 21 - unsigned char dualEdgeClkSelect, 22 - unsigned char hsyncEnable, 23 - unsigned char vsyncEnable, 24 - unsigned char deskewEnable, 25 - unsigned char deskewSetting, 26 - unsigned char continuousSyncEnable, 27 - unsigned char pllFilterEnable, 28 - unsigned char pllFilterValue); 19 + long sii164_init_chip(unsigned char edgeSelect, 20 + unsigned char busSelect, 21 + unsigned char dualEdgeClkSelect, 22 + unsigned char hsyncEnable, 23 + unsigned char vsyncEnable, 24 + unsigned char deskewEnable, 25 + unsigned char deskewSetting, 26 + unsigned char continuousSyncEnable, 27 + unsigned char pllFilterEnable, 28 + unsigned char pllFilterValue); 29 29 30 30 unsigned short sii164_get_vendor_id(void); 31 31 unsigned short sii164GetDeviceID(void);
+44 -48
drivers/staging/vme_user/vme.c
··· 79 79 * Return: Virtual address of allocation on success, NULL on failure. 80 80 */ 81 81 void *vme_alloc_consistent(struct vme_resource *resource, size_t size, 82 - dma_addr_t *dma) 82 + dma_addr_t *dma) 83 83 { 84 84 struct vme_bridge *bridge; 85 85 ··· 119 119 * Free previously allocated block of contiguous memory. 120 120 */ 121 121 void vme_free_consistent(struct vme_resource *resource, size_t size, 122 - void *vaddr, dma_addr_t dma) 122 + void *vaddr, dma_addr_t dma) 123 123 { 124 124 struct vme_bridge *bridge; 125 125 ··· 169 169 switch (resource->type) { 170 170 case VME_MASTER: 171 171 retval = vme_master_get(resource, &enabled, &base, &size, 172 - &aspace, &cycle, &dwidth); 172 + &aspace, &cycle, &dwidth); 173 173 if (retval) 174 174 return 0; 175 175 176 176 return size; 177 177 case VME_SLAVE: 178 178 retval = vme_slave_get(resource, &enabled, &base, &size, 179 - &buf_base, &aspace, &cycle); 179 + &buf_base, &aspace, &cycle); 180 180 if (retval) 181 181 return 0; 182 182 ··· 279 279 * Return: Pointer to VME resource on success, NULL on failure. 280 280 */ 281 281 struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address, 282 - u32 cycle) 282 + u32 cycle) 283 283 { 284 284 struct vme_bridge *bridge; 285 285 struct list_head *slave_pos = NULL; ··· 296 296 /* Loop through slave resources */ 297 297 list_for_each(slave_pos, &bridge->slave_resources) { 298 298 slave_image = list_entry(slave_pos, 299 - struct vme_slave_resource, list); 299 + struct vme_slave_resource, list); 300 300 301 301 if (!slave_image) { 302 302 printk(KERN_ERR "Registered NULL Slave resource\n"); ··· 306 306 /* Find an unlocked and compatible image */ 307 307 mutex_lock(&slave_image->mtx); 308 308 if (((slave_image->address_attr & address) == address) && 309 - ((slave_image->cycle_attr & cycle) == cycle) && 310 - (slave_image->locked == 0)) { 311 - 309 + ((slave_image->cycle_attr & cycle) == cycle) && 310 + (slave_image->locked == 0)) { 312 311 slave_image->locked = 1; 313 312 mutex_unlock(&slave_image->mtx); 314 313 allocated_image = slave_image; ··· 358 359 * returned. 359 360 */ 360 361 int vme_slave_set(struct vme_resource *resource, int enabled, 361 - unsigned long long vme_base, unsigned long long size, 362 - dma_addr_t buf_base, u32 aspace, u32 cycle) 362 + unsigned long long vme_base, unsigned long long size, 363 + dma_addr_t buf_base, u32 aspace, u32 cycle) 363 364 { 364 365 struct vme_bridge *bridge = find_bridge(resource); 365 366 struct vme_slave_resource *image; ··· 378 379 } 379 380 380 381 if (!(((image->address_attr & aspace) == aspace) && 381 - ((image->cycle_attr & cycle) == cycle))) { 382 + ((image->cycle_attr & cycle) == cycle))) { 382 383 printk(KERN_ERR "Invalid attributes\n"); 383 384 return -EINVAL; 384 385 } ··· 408 409 * device or if an invalid resource has been provided. 409 410 */ 410 411 int vme_slave_get(struct vme_resource *resource, int *enabled, 411 - unsigned long long *vme_base, unsigned long long *size, 412 - dma_addr_t *buf_base, u32 *aspace, u32 *cycle) 412 + unsigned long long *vme_base, unsigned long long *size, 413 + dma_addr_t *buf_base, u32 *aspace, u32 *cycle) 413 414 { 414 415 struct vme_bridge *bridge = find_bridge(resource); 415 416 struct vme_slave_resource *image; ··· 447 448 } 448 449 449 450 slave_image = list_entry(resource->entry, struct vme_slave_resource, 450 - list); 451 + list); 451 452 if (!slave_image) { 452 453 printk(KERN_ERR "Can't find slave resource\n"); 453 454 return; ··· 479 480 * Return: Pointer to VME resource on success, NULL on failure. 480 481 */ 481 482 struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address, 482 - u32 cycle, u32 dwidth) 483 + u32 cycle, u32 dwidth) 483 484 { 484 485 struct vme_bridge *bridge; 485 486 struct list_head *master_pos = NULL; ··· 496 497 /* Loop through master resources */ 497 498 list_for_each(master_pos, &bridge->master_resources) { 498 499 master_image = list_entry(master_pos, 499 - struct vme_master_resource, list); 500 + struct vme_master_resource, list); 500 501 501 502 if (!master_image) { 502 503 printk(KERN_WARNING "Registered NULL master resource\n"); ··· 506 507 /* Find an unlocked and compatible image */ 507 508 spin_lock(&master_image->lock); 508 509 if (((master_image->address_attr & address) == address) && 509 - ((master_image->cycle_attr & cycle) == cycle) && 510 - ((master_image->width_attr & dwidth) == dwidth) && 511 - (master_image->locked == 0)) { 512 - 510 + ((master_image->cycle_attr & cycle) == cycle) && 511 + ((master_image->width_attr & dwidth) == dwidth) && 512 + (master_image->locked == 0)) { 513 513 master_image->locked = 1; 514 514 spin_unlock(&master_image->lock); 515 515 allocated_image = master_image; ··· 561 563 * returned. 562 564 */ 563 565 int vme_master_set(struct vme_resource *resource, int enabled, 564 - unsigned long long vme_base, unsigned long long size, u32 aspace, 565 - u32 cycle, u32 dwidth) 566 + unsigned long long vme_base, unsigned long long size, 567 + u32 aspace, u32 cycle, u32 dwidth) 566 568 { 567 569 struct vme_bridge *bridge = find_bridge(resource); 568 570 struct vme_master_resource *image; ··· 581 583 } 582 584 583 585 if (!(((image->address_attr & aspace) == aspace) && 584 - ((image->cycle_attr & cycle) == cycle) && 585 - ((image->width_attr & dwidth) == dwidth))) { 586 + ((image->cycle_attr & cycle) == cycle) && 587 + ((image->width_attr & dwidth) == dwidth))) { 586 588 printk(KERN_WARNING "Invalid attributes\n"); 587 589 return -EINVAL; 588 590 } ··· 612 614 * device or if an invalid resource has been provided. 613 615 */ 614 616 int vme_master_get(struct vme_resource *resource, int *enabled, 615 - unsigned long long *vme_base, unsigned long long *size, u32 *aspace, 616 - u32 *cycle, u32 *dwidth) 617 + unsigned long long *vme_base, unsigned long long *size, 618 + u32 *aspace, u32 *cycle, u32 *dwidth) 617 619 { 618 620 struct vme_bridge *bridge = find_bridge(resource); 619 621 struct vme_master_resource *image; ··· 651 653 * returned. 652 654 */ 653 655 ssize_t vme_master_read(struct vme_resource *resource, void *buf, size_t count, 654 - loff_t offset) 656 + loff_t offset) 655 657 { 656 658 struct vme_bridge *bridge = find_bridge(resource); 657 659 struct vme_master_resource *image; ··· 680 682 count = length - offset; 681 683 682 684 return bridge->master_read(image, buf, count, offset); 683 - 684 685 } 685 686 EXPORT_SYMBOL(vme_master_read); 686 687 ··· 699 702 * returned. 700 703 */ 701 704 ssize_t vme_master_write(struct vme_resource *resource, void *buf, 702 - size_t count, loff_t offset) 705 + size_t count, loff_t offset) 703 706 { 704 707 struct vme_bridge *bridge = find_bridge(resource); 705 708 struct vme_master_resource *image; ··· 751 754 * errors may also be returned. 752 755 */ 753 756 unsigned int vme_master_rmw(struct vme_resource *resource, unsigned int mask, 754 - unsigned int compare, unsigned int swap, loff_t offset) 757 + unsigned int compare, unsigned int swap, loff_t offset) 755 758 { 756 759 struct vme_bridge *bridge = find_bridge(resource); 757 760 struct vme_master_resource *image; ··· 825 828 } 826 829 827 830 master_image = list_entry(resource->entry, struct vme_master_resource, 828 - list); 831 + list); 829 832 if (!master_image) { 830 833 printk(KERN_ERR "Can't find master resource\n"); 831 834 return; ··· 874 877 /* Loop through DMA resources */ 875 878 list_for_each(dma_pos, &bridge->dma_resources) { 876 879 dma_ctrlr = list_entry(dma_pos, 877 - struct vme_dma_resource, list); 880 + struct vme_dma_resource, list); 878 881 if (!dma_ctrlr) { 879 882 printk(KERN_ERR "Registered NULL DMA resource\n"); 880 883 continue; ··· 883 886 /* Find an unlocked and compatible controller */ 884 887 mutex_lock(&dma_ctrlr->mtx); 885 888 if (((dma_ctrlr->route_attr & route) == route) && 886 - (dma_ctrlr->locked == 0)) { 887 - 889 + (dma_ctrlr->locked == 0)) { 888 890 dma_ctrlr->locked = 1; 889 891 mutex_unlock(&dma_ctrlr->mtx); 890 892 allocated_ctrlr = dma_ctrlr; ··· 1041 1045 * Return: Pointer to VME DMA attribute, NULL on failure. 1042 1046 */ 1043 1047 struct vme_dma_attr *vme_dma_vme_attribute(unsigned long long address, 1044 - u32 aspace, u32 cycle, u32 dwidth) 1048 + u32 aspace, u32 cycle, u32 dwidth) 1045 1049 { 1046 1050 struct vme_dma_attr *attributes; 1047 1051 struct vme_dma_vme *vme_attr; ··· 1103 1107 * Hardware specific errors also possible. 1104 1108 */ 1105 1109 int vme_dma_list_add(struct vme_dma_list *list, struct vme_dma_attr *src, 1106 - struct vme_dma_attr *dest, size_t count) 1110 + struct vme_dma_attr *dest, size_t count) 1107 1111 { 1108 1112 struct vme_bridge *bridge = list->parent->parent; 1109 1113 int retval; ··· 1267 1271 } 1268 1272 EXPORT_SYMBOL(vme_bus_error_handler); 1269 1273 1270 - struct vme_error_handler *vme_register_error_handler( 1271 - struct vme_bridge *bridge, u32 aspace, 1272 - unsigned long long address, size_t len) 1274 + struct vme_error_handler *vme_register_error_handler(struct vme_bridge *bridge, u32 aspace, 1275 + unsigned long long address, size_t len) 1273 1276 { 1274 1277 struct vme_error_handler *handler; 1275 1278 ··· 1326 1331 * already in use. Hardware specific errors also possible. 1327 1332 */ 1328 1333 int vme_irq_request(struct vme_dev *vdev, int level, int statid, 1329 - void (*callback)(int, int, void *), 1330 - void *priv_data) 1334 + void (*callback)(int, int, void *), 1335 + void *priv_data) 1331 1336 { 1332 1337 struct vme_bridge *bridge; 1333 1338 ··· 1474 1479 /* Loop through LM resources */ 1475 1480 list_for_each(lm_pos, &bridge->lm_resources) { 1476 1481 lm = list_entry(lm_pos, 1477 - struct vme_lm_resource, list); 1482 + struct vme_lm_resource, list); 1478 1483 if (!lm) { 1479 1484 printk(KERN_ERR "Registered NULL Location Monitor resource\n"); 1480 1485 continue; ··· 1556 1561 * errors may also be returned. 1557 1562 */ 1558 1563 int vme_lm_set(struct vme_resource *resource, unsigned long long lm_base, 1559 - u32 aspace, u32 cycle) 1564 + u32 aspace, u32 cycle) 1560 1565 { 1561 1566 struct vme_bridge *bridge = find_bridge(resource); 1562 1567 struct vme_lm_resource *lm; ··· 1592 1597 * errors may also be returned. 1593 1598 */ 1594 1599 int vme_lm_get(struct vme_resource *resource, unsigned long long *lm_base, 1595 - u32 *aspace, u32 *cycle) 1600 + u32 *aspace, u32 *cycle) 1596 1601 { 1597 1602 struct vme_bridge *bridge = find_bridge(resource); 1598 1603 struct vme_lm_resource *lm; ··· 1629 1634 * errors may also be returned. 1630 1635 */ 1631 1636 int vme_lm_attach(struct vme_resource *resource, int monitor, 1632 - void (*callback)(void *), void *data) 1637 + void (*callback)(void *), void *data) 1633 1638 { 1634 1639 struct vme_bridge *bridge = find_bridge(resource); 1635 1640 struct vme_lm_resource *lm; ··· 1836 1841 /* - Driver Registration --------------------------------------------------- */ 1837 1842 1838 1843 static int __vme_register_driver_bus(struct vme_driver *drv, 1839 - struct vme_bridge *bridge, unsigned int ndevs) 1844 + struct vme_bridge *bridge, 1845 + unsigned int ndevs) 1840 1846 { 1841 1847 int err; 1842 1848 unsigned int i; ··· 1857 1861 vdev->dev.parent = bridge->parent; 1858 1862 vdev->dev.bus = &vme_bus_type; 1859 1863 dev_set_name(&vdev->dev, "%s.%u-%u", drv->name, bridge->num, 1860 - vdev->num); 1864 + vdev->num); 1861 1865 1862 1866 err = device_register(&vdev->dev); 1863 1867 if (err)
+18 -28
drivers/staging/vme_user/vme_bridge.h
··· 128 128 struct mutex irq_mtx; 129 129 130 130 /* Slave Functions */ 131 - int (*slave_get)(struct vme_slave_resource *, int *, 132 - unsigned long long *, unsigned long long *, dma_addr_t *, 133 - u32 *, u32 *); 131 + int (*slave_get)(struct vme_slave_resource *, int *, unsigned long long *, 132 + unsigned long long *, dma_addr_t *, u32 *, u32 *); 134 133 int (*slave_set)(struct vme_slave_resource *, int, unsigned long long, 135 - unsigned long long, dma_addr_t, u32, u32); 134 + unsigned long long, dma_addr_t, u32, u32); 136 135 137 136 /* Master Functions */ 138 - int (*master_get)(struct vme_master_resource *, int *, 139 - unsigned long long *, unsigned long long *, u32 *, u32 *, 140 - u32 *); 141 - int (*master_set)(struct vme_master_resource *, int, 142 - unsigned long long, unsigned long long, u32, u32, u32); 143 - ssize_t (*master_read)(struct vme_master_resource *, void *, size_t, 144 - loff_t); 145 - ssize_t (*master_write)(struct vme_master_resource *, void *, size_t, 146 - loff_t); 137 + int (*master_get)(struct vme_master_resource *, int *, unsigned long long *, 138 + unsigned long long *, u32 *, u32 *, u32 *); 139 + int (*master_set)(struct vme_master_resource *, int, unsigned long long, 140 + unsigned long long, u32, u32, u32); 141 + ssize_t (*master_read)(struct vme_master_resource *, void *, size_t, loff_t); 142 + ssize_t (*master_write)(struct vme_master_resource *, void *, size_t, loff_t); 147 143 unsigned int (*master_rmw)(struct vme_master_resource *, unsigned int, 148 - unsigned int, unsigned int, loff_t); 144 + unsigned int, unsigned int, loff_t); 149 145 150 146 /* DMA Functions */ 151 147 int (*dma_list_add)(struct vme_dma_list *, struct vme_dma_attr *, 152 - struct vme_dma_attr *, size_t); 148 + struct vme_dma_attr *, size_t); 153 149 int (*dma_list_exec)(struct vme_dma_list *); 154 150 int (*dma_list_empty)(struct vme_dma_list *); 155 151 ··· 155 159 156 160 /* Location monitor functions */ 157 161 int (*lm_set)(struct vme_lm_resource *, unsigned long long, u32, u32); 158 - int (*lm_get)(struct vme_lm_resource *, unsigned long long *, u32 *, 159 - u32 *); 160 - int (*lm_attach)(struct vme_lm_resource *, int, 161 - void (*callback)(void *), void *); 162 + int (*lm_get)(struct vme_lm_resource *, unsigned long long *, u32 *, u32 *); 163 + int (*lm_attach)(struct vme_lm_resource *, int, void (*callback)(void *), void *); 162 164 int (*lm_detach)(struct vme_lm_resource *, int); 163 165 164 166 /* CR/CSR space functions */ 165 167 int (*slot_get)(struct vme_bridge *); 166 168 167 169 /* Bridge parent interface */ 168 - void *(*alloc_consistent)(struct device *dev, size_t size, 169 - dma_addr_t *dma); 170 - void (*free_consistent)(struct device *dev, size_t size, 171 - void *vaddr, dma_addr_t dma); 170 + void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *dma); 171 + void (*free_consistent)(struct device *dev, size_t size, void *vaddr, dma_addr_t dma); 172 172 }; 173 173 174 - void vme_bus_error_handler(struct vme_bridge *bridge, 175 - unsigned long long address, int am); 174 + void vme_bus_error_handler(struct vme_bridge *bridge, unsigned long long address, int am); 176 175 void vme_irq_handler(struct vme_bridge *, int, int); 177 176 178 177 struct vme_bridge *vme_init_bridge(struct vme_bridge *); 179 178 int vme_register_bridge(struct vme_bridge *); 180 179 void vme_unregister_bridge(struct vme_bridge *); 181 - struct vme_error_handler *vme_register_error_handler( 182 - struct vme_bridge *bridge, u32 aspace, 183 - unsigned long long address, size_t len); 180 + struct vme_error_handler *vme_register_error_handler(struct vme_bridge *bridge, u32 aspace, 181 + unsigned long long address, size_t len); 184 182 void vme_unregister_error_handler(struct vme_error_handler *handler); 185 183 186 184 #endif /* _VME_BRIDGE_H_ */
+3 -3
drivers/staging/vt6655/baseband.c
··· 499 499 }; 500 500 501 501 #define CB_VT3253B0_INIT_FOR_RFMD 256 502 - static const unsigned char byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = { 502 + static const unsigned char vt3253b0_rfmd[CB_VT3253B0_INIT_FOR_RFMD][2] = { 503 503 {0x00, 0x31}, 504 504 {0x01, 0x00}, 505 505 {0x02, 0x00}, ··· 2005 2005 } else { 2006 2006 for (ii = 0; ii < CB_VT3253B0_INIT_FOR_RFMD; ii++) 2007 2007 result &= bb_write_embedded(priv, 2008 - byVT3253B0_RFMD[ii][0], 2009 - byVT3253B0_RFMD[ii][1]); 2008 + vt3253b0_rfmd[ii][0], 2009 + vt3253b0_rfmd[ii][1]); 2010 2010 2011 2011 for (ii = 0; ii < CB_VT3253B0_AGC_FOR_RFMD2959; ii++) 2012 2012 result &= bb_write_embedded(priv,
+3 -3
drivers/staging/vt6655/srom.c
··· 49 49 * Parameters: 50 50 * In: 51 51 * iobase - I/O base address 52 - * byContntOffset - address of EEPROM 52 + * contnt_offset - address of EEPROM 53 53 * Out: 54 54 * none 55 55 * ··· 57 57 * 58 58 */ 59 59 unsigned char SROMbyReadEmbedded(void __iomem *iobase, 60 - unsigned char byContntOffset) 60 + unsigned char contnt_offset) 61 61 { 62 62 unsigned short wDelay, wNoACK; 63 63 unsigned char byWait; ··· 70 70 iowrite8(byOrg & (~I2MCFG_NORETRY), iobase + MAC_REG_I2MCFG); 71 71 for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) { 72 72 iowrite8(EEP_I2C_DEV_ID, iobase + MAC_REG_I2MTGID); 73 - iowrite8(byContntOffset, iobase + MAC_REG_I2MTGAD); 73 + iowrite8(contnt_offset, iobase + MAC_REG_I2MTGAD); 74 74 75 75 /* issue read command */ 76 76 iowrite8(I2MCSR_EEMR, iobase + MAC_REG_I2MCSR);