History

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

Pull staging driver updates from Greg KH: "Here is the large set of staging driver changes for 6.2-rc1. Another round of cleanups for staging drivers with no big additions. Overall more lines were removed than added, always a nice sign, with nothing happening in here other than general coding style cleanups and minor fixes in the drivers. Full, boring, details are in the shortlog. All of these have been in linux-next for a while with no reported problems" * tag 'staging-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (253 commits) vme: Use root_device_register() not underlined version staging: rtl8192e: Fix spelling mistake "ContryIE" -> "CountryIE" vme: Fix error not catched in fake_init() staging: vme_user: remove multiple blank lines staging: r8188eu: use subtype helper in rtw_check_bcn_info staging: r8188eu: use subtype helpers in collect_bss_info staging: r8188eu: remove unused da parameter staging: r8188eu: merge two probereq_p2p functions staging: r8188eu: simplify err handling for unknown station staging: r8188eu: handle the non-ap case first staging: r8188eu: move bBusyTraffic update staging: r8188eu: read reason code from ieee80211_mgmt staging: r8188eu: use ieee80211_mgmt to parse addresses staging: r8188eu: remove a variable staging: r8188eu: simplify error handling for missing station staging: r8188eu: stop beacon processing if kmalloc fails staging: r8188eu: exit if beacon is not from our bss staging: r8188eu: simplify update_sta_support_rate params staging: r8188eu: use ie buffer in update_beacon_info staging: r8188eu: pass only ies to process_p2p_ps_ie ...

Linus Torvalds committed 3 years ago

Commit b83a7082 parents 58bcac1 37aa6b9122 files · +1741 −2789Browse files

Unified · Split

122 files
  1. arch/mips/include/asm/octeon/cvmx.h +2 −2
  2. drivers/staging/emxx_udc/emxx_udc.c +1 −4
  3. drivers/staging/fieldbus/dev_core.c +7 −10
  4. drivers/staging/gdm724x/gdm_tty.c +8 −5
  5. drivers/staging/greybus/tools/loopback_test.c +1 −14
  6. drivers/staging/iio/frequency/ad9834.c +2 −4
  7. drivers/staging/iio/meter/ade7854-i2c.c +2 −3
  8. drivers/staging/ks7010/TODO +3 −0
  9. drivers/staging/ks7010/ks_wlan_net.c +126 −122
  10. drivers/staging/most/dim2/dim2.c +2 −2
  11. drivers/staging/most/dim2/hal.c +2 −2
  12. drivers/staging/most/dim2/hal.h +3 −3
  13. drivers/staging/most/i2c/i2c.c +2 −2
  14. drivers/staging/octeon/ethernet-tx.c +0 −2
  15. drivers/staging/octeon/octeon-stubs.h +1 −1
  16. drivers/staging/olpc_dcon/olpc_dcon.c +2 −2
  17. drivers/staging/r8188eu/core/rtw_ap.c +2 −5
  18. drivers/staging/r8188eu/core/rtw_br_ext.c +62 −64
  19. drivers/staging/r8188eu/core/rtw_cmd.c +14 −20
  20. drivers/staging/r8188eu/core/rtw_ioctl_set.c +2 −4
  21. drivers/staging/r8188eu/core/rtw_led.c +19 −60
  22. drivers/staging/r8188eu/core/rtw_mlme.c +12 −39
  23. drivers/staging/r8188eu/core/rtw_mlme_ext.c +296 −451
  24. drivers/staging/r8188eu/core/rtw_p2p.c +6 −13
  25. drivers/staging/r8188eu/core/rtw_pwrctrl.c +1 −1
  26. drivers/staging/r8188eu/core/rtw_recv.c +12 −15
  27. drivers/staging/r8188eu/core/rtw_security.c +1 −3
  28. drivers/staging/r8188eu/core/rtw_sta_mgt.c +6 −10
  29. drivers/staging/r8188eu/core/rtw_wlan_util.c +16 −20
  30. drivers/staging/r8188eu/core/rtw_xmit.c +20 −34
  31. drivers/staging/r8188eu/hal/HalPhyRf_8188e.c +2 −10
  32. drivers/staging/r8188eu/hal/hal_intf.c +7 −12
  33. drivers/staging/r8188eu/hal/odm_RTL8188E.c +3 −3
  34. drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +2 −6
  35. drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +8 −8
  36. drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +13 −15
  37. drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +1 −2
  38. drivers/staging/r8188eu/include/Hal8188EPhyReg.h +2 −2
  39. drivers/staging/r8188eu/include/drv_types.h +0 −1
  40. drivers/staging/r8188eu/include/odm.h +2 −8
  41. drivers/staging/r8188eu/include/odm_RTL8188E.h +7 −0
  42. drivers/staging/r8188eu/include/odm_types.h +0 −16
  43. drivers/staging/r8188eu/include/osdep_intf.h +3 −3
  44. drivers/staging/r8188eu/include/osdep_service.h +3 −3
  45. drivers/staging/r8188eu/include/rtl8188e_hal.h +3 −4
  46. drivers/staging/r8188eu/include/rtl8188e_spec.h +9 −9
  47. drivers/staging/r8188eu/include/rtw_ap.h +1 −1
  48. drivers/staging/r8188eu/include/rtw_cmd.h +30 −41
  49. drivers/staging/r8188eu/include/rtw_io.h +1 −15
  50. drivers/staging/r8188eu/include/rtw_ioctl_set.h +3 −3
  51. drivers/staging/r8188eu/include/rtw_led.h +0 −3
  52. drivers/staging/r8188eu/include/rtw_mlme.h +11 −18
  53. drivers/staging/r8188eu/include/rtw_mlme_ext.h +14 −44
  54. drivers/staging/r8188eu/include/rtw_recv.h +2 −2
  55. drivers/staging/r8188eu/include/rtw_xmit.h +2 −2
  56. drivers/staging/r8188eu/include/sta_info.h +9 −9
  57. drivers/staging/r8188eu/include/wifi.h +6 −71
  58. drivers/staging/r8188eu/include/wlan_bssdef.h +0 −51
  59. drivers/staging/r8188eu/os_dep/ioctl_linux.c +10 −18
  60. drivers/staging/r8188eu/os_dep/os_intfs.c +15 −26
  61. drivers/staging/rtl8192e/TODO +17 −1
  62. drivers/staging/rtl8192e/rtl8192e/r8190P_def.h +0 −15
  63. drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +22 −33
  64. drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +23 −27
  65. drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +20 −23
  66. drivers/staging/rtl8192e/rtl8192e/rtl_core.c +84 −107
  67. drivers/staging/rtl8192e/rtl8192e/rtl_core.h +5 −31
  68. drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +59 −64
  69. drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +5 −5
  70. drivers/staging/rtl8192e/rtl8192e/rtl_eeprom.c +1 −1
  71. drivers/staging/rtl8192e/rtl8192e/rtl_ps.c +39 −56
  72. drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +45 −49
  73. drivers/staging/rtl8192e/rtl819x_BAProc.c +18 −20
  74. drivers/staging/rtl8192e/rtl819x_HT.h +1 −1
  75. drivers/staging/rtl8192e/rtl819x_HTProc.c +201 −204
  76. drivers/staging/rtl8192e/rtl819x_Qos.h +0 −7
  77. drivers/staging/rtl8192e/rtl819x_TSProc.c +1 −1
  78. drivers/staging/rtl8192e/rtllib.h +22 −29
  79. drivers/staging/rtl8192e/rtllib_crypt_tkip.c +16 −36
  80. drivers/staging/rtl8192e/rtllib_crypt_wep.c +0 −8
  81. drivers/staging/rtl8192e/rtllib_module.c +4 −4
  82. drivers/staging/rtl8192e/rtllib_rx.c +19 −19
  83. drivers/staging/rtl8192e/rtllib_softmac.c +86 −87
  84. drivers/staging/rtl8192e/rtllib_softmac_wx.c +9 −10
  85. drivers/staging/rtl8192e/rtllib_tx.c +57 −63
  86. drivers/staging/rtl8192e/rtllib_wx.c +3 −3
  87. drivers/staging/rtl8192u/TODO +16 −0
  88. drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 −64
  89. drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +0 −6
  90. drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +0 −3
  91. drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +4 −2
  92. drivers/staging/rtl8712/os_intfs.c +22 −5
  93. drivers/staging/rtl8712/recv_osdep.h +4 −4
  94. drivers/staging/rtl8712/rtl8712_recv.c +4 −3
  95. drivers/staging/rtl8712/rtl8712_xmit.c +1 −2
  96. drivers/staging/rtl8712/rtl871x_recv.c +9 −7
  97. drivers/staging/rtl8723bs/core/rtw_efuse.c +1 −1
  98. drivers/staging/rtl8723bs/core/rtw_ieee80211.c +6 −6
  99. drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +9 −8
  100. drivers/staging/rtl8723bs/core/rtw_mlme.c +14 −16
  101. drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1 −1
  102. drivers/staging/rtl8723bs/core/rtw_recv.c +3 −3
  103. drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +1 −1
  104. drivers/staging/rtl8723bs/core/rtw_wlan_util.c +4 −8
  105. drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c +10 −11
  106. drivers/staging/rtl8723bs/hal/odm.h +3 −9
  107. drivers/staging/rtl8723bs/hal/odm_DIG.c +1 −4
  108. drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +1 −1
  109. drivers/staging/rts5208/sd.c +2 −1
  110. drivers/staging/sm750fb/Kconfig +1 −1
  111. drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +15 −15
  112. drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +9 −9
  113. drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h +3 −3
  114. drivers/staging/vme_user/vme.h +0 −2
  115. drivers/staging/vme_user/vme_fake.c +3 −6
  116. drivers/staging/vme_user/vme_tsi148.c +1 −6
  117. drivers/staging/vme_user/vme_tsi148.h +0 −7
  118. drivers/staging/vt6655/rxtx.c +18 −18
  119. drivers/staging/wlan-ng/TODO +16 −0
  120. drivers/staging/wlan-ng/p80211mgmt.h +0 −301
  121. drivers/staging/wlan-ng/p80211netdev.c +0 −22
  122. drivers/staging/wlan-ng/p80211types.h +0 −6
arch/mips/include/asm/octeon/cvmx.h+2−2
@@ -154,13 +154,13 @@ static inline uint64_t cvmx_build_bits(uint64_t high_bit, · 153 unmodified lines
154154
155155 /**
156156 * Convert a memory pointer (void*) into a hardware compatible
157− * memory address (uint64_t). Octeon hardware widgets don't
157+ * memory address (phys_addr_t). Octeon hardware widgets don't
158158 * understand logical addresses.
159159 *
160160 * @ptr: C style memory pointer
161161 * Returns Hardware physical address
162162 */
163−static inline uint64_t cvmx_ptr_to_phys(void *ptr)
163+static inline phys_addr_t cvmx_ptr_to_phys(void *ptr)
164164 {
165165 if (sizeof(void *) == 8) {
166166 /*
drivers/staging/emxx_udc/emxx_udc.c+1−4
@@ -1004,10 +1004,7 @@ static int _nbu2ss_in_dma(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep, · 1003 unmodified lines
10041004 /* MAX Packet Size */
10051005 mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & EPN_MPKT;
10061006
1007− if ((DMA_MAX_COUNT * mpkt) < length)
1008− i_write_length = DMA_MAX_COUNT * mpkt;
1009− else
1010− i_write_length = length;
1007+ i_write_length = min(DMA_MAX_COUNT * mpkt, length);
10111008
10121009 /*------------------------------------------------------------*/
10131010 /* Number of transmission packets */
drivers/staging/fieldbus/dev_core.c+7−10
@@ -28,7 +28,7 @@ static ssize_t online_show(struct device *dev, struct device_attribute *attr, · 27 unmodified lines
2828 {
2929 struct fieldbus_dev *fb = dev_get_drvdata(dev);
3030
31− return sprintf(buf, "%d\n", !!fb->online);
31+ return sysfs_emit(buf, "%d\n", !!fb->online);
3232 }
3333 static DEVICE_ATTR_RO(online);
3434
@@ -39,7 +39,7 @@ static ssize_t enabled_show(struct device *dev, struct device_attribute *attr, · 4 unmodified lines
3939
4040 if (!fb->enable_get)
4141 return -EINVAL;
42− return sprintf(buf, "%d\n", !!fb->enable_get(fb));
42+ return sysfs_emit(buf, "%d\n", !!fb->enable_get(fb));
4343 }
4444
4545 static ssize_t enabled_store(struct device *dev, struct device_attribute *attr,
@@ -66,11 +66,8 @@ static ssize_t card_name_show(struct device *dev, struct device_attribute *attr, · 20 unmodified lines
6666 {
6767 struct fieldbus_dev *fb = dev_get_drvdata(dev);
6868
69− /*
70− * card_name was provided by child driver, could potentially be long.
71− * protect against buffer overrun.
72− */
73− return snprintf(buf, PAGE_SIZE, "%s\n", fb->card_name);
69+ /* card_name was provided by child driver. */
70+ return sysfs_emit(buf, "%s\n", fb->card_name);
7471 }
7572 static DEVICE_ATTR_RO(card_name);
7673
@@ -79,7 +76,7 @@ static ssize_t read_area_size_show(struct device *dev, · 2 unmodified lines
7976 {
8077 struct fieldbus_dev *fb = dev_get_drvdata(dev);
8178
82− return sprintf(buf, "%zu\n", fb->read_area_sz);
79+ return sysfs_emit(buf, "%zu\n", fb->read_area_sz);
8380 }
8481 static DEVICE_ATTR_RO(read_area_size);
8582
@@ -88,7 +85,7 @@ static ssize_t write_area_size_show(struct device *dev, · 2 unmodified lines
8885 {
8986 struct fieldbus_dev *fb = dev_get_drvdata(dev);
9087
91− return sprintf(buf, "%zu\n", fb->write_area_sz);
88+ return sysfs_emit(buf, "%zu\n", fb->write_area_sz);
9289 }
9390 static DEVICE_ATTR_RO(write_area_size);
9491
@@ -116,7 +113,7 @@ static ssize_t fieldbus_type_show(struct device *dev, · 21 unmodified lines
116113 break;
117114 }
118115
119− return sprintf(buf, "%s\n", t);
116+ return sysfs_emit(buf, "%s\n", t);
120117 }
121118 static DEVICE_ATTR_RO(fieldbus_type);
122119
drivers/staging/gdm724x/gdm_tty.c+8−5
@@ -21,7 +21,10 @@ · 20 unmodified lines
2121
2222 #define MUX_TX_MAX_SIZE 2048
2323
24−#define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count)
24+static inline bool gdm_tty_ready(struct gdm *gdm)
25+{
26+ return gdm && gdm->tty_dev && gdm->port.count;
27+}
2528
2629 static struct tty_driver *gdm_driver[TTY_MAX_COUNT];
2730 static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR];
@@ -113,7 +116,7 @@ static int gdm_tty_recv_complete(void *data, · 85 unmodified lines
113116 {
114117 struct gdm *gdm = tty_dev->gdm[index];
115118
116− if (!GDM_TTY_READY(gdm)) {
119+ if (!gdm_tty_ready(gdm)) {
117120 if (complete == RECV_PACKET_PROCESS_COMPLETE)
118121 gdm->tty_dev->recv_func(gdm->tty_dev->priv_dev,
119122 gdm_tty_recv_complete);
@@ -140,7 +143,7 @@ static void gdm_tty_send_complete(void *arg) · 20 unmodified lines
140143 {
141144 struct gdm *gdm = arg;
142145
143− if (!GDM_TTY_READY(gdm))
146+ if (!gdm_tty_ready(gdm))
144147 return;
145148
146149 tty_port_tty_wakeup(&gdm->port);
@@ -154,7 +157,7 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf, · 7 unmodified lines
154157 int sent_len = 0;
155158 int sending_len = 0;
156159
157− if (!GDM_TTY_READY(gdm))
160+ if (!gdm_tty_ready(gdm))
158161 return -ENODEV;
159162
160163 if (!len)
@@ -181,7 +184,7 @@ static unsigned int gdm_tty_write_room(struct tty_struct *tty) · 20 unmodified lines
181184 {
182185 struct gdm *gdm = tty->driver_data;
183186
184− if (!GDM_TTY_READY(gdm))
187+ if (!gdm_tty_ready(gdm))
185188 return 0;
186189
187190 return WRITE_SIZE;
drivers/staging/greybus/tools/loopback_test.c+1−14
@@ -239,7 +239,6 @@ static void show_loopback_devices(struct loopback_test *t) · 238 unmodified lines
239239
240240 for (i = 0; i < t->device_count; i++)
241241 printf("device[%d] = %s\n", i, t->devices[i].name);
242−
243242 }
244243
245244 int open_sysfs(const char *sys_pfx, const char *node, int flags)
@@ -274,7 +273,6 @@ float read_sysfs_float_fd(int fd, const char *sys_pfx, const char *node) · 28 unmodified lines
274273 char buf[SYSFS_MAX_INT];
275274
276275 if (read(fd, buf, sizeof(buf)) < 0) {
277−
278276 fprintf(stderr, "unable to read from %s%s %s\n", sys_pfx, node,
279277 strerror(errno));
280278 close(fd);
@@ -367,7 +365,6 @@ static int get_results(struct loopback_test *t) · 86 unmodified lines
367365 r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min;
368366 r->gbphy_firmware_latency_jitter =
369367 r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min;
370−
371368 }
372369
373370 /*calculate the aggregate results of all enabled devices */
@@ -407,7 +404,6 @@ static int get_results(struct loopback_test *t) · 33 unmodified lines
407404 r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min;
408405 r->gbphy_firmware_latency_jitter =
409406 r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min;
410−
411407 }
412408
413409 return 0;
@@ -536,7 +532,6 @@ static int log_results(struct loopback_test *t) · 122 unmodified lines
536532 fprintf(stderr, "unable to open %s for appending\n", file_name);
537533 abort();
538534 }
539−
540535 }
541536 for (i = 0; i < t->device_count; i++) {
542537 if (!device_enabled(t, i))
@@ -550,10 +545,8 @@ static int log_results(struct loopback_test *t) · 7 unmodified lines
550545 if (ret == -1)
551546 fprintf(stderr, "unable to write %d bytes to csv.\n", len);
552547 }
553−
554548 }
555549
556−
557550 if (t->aggregate_output) {
558551 len = format_output(t, &t->aggregate_results, "aggregate",
559552 data, sizeof(data), &tm);
@@ -675,6 +668,7 @@ err: · 115 unmodified lines
675668 static int close_poll_files(struct loopback_test *t)
676669 {
677670 int i;
671+
678672 for (i = 0; i < t->poll_count; i++)
679673 close(t->fds[i].fd);
680674
@@ -740,7 +734,6 @@ static int wait_for_complete(struct loopback_test *t) · 59 unmodified lines
740734 ts = &t->poll_timeout;
741735
742736 while (1) {
743−
744737 ret = ppoll(t->fds, t->poll_count, ts, &mask_old);
745738 if (ret <= 0) {
746739 stop_tests(t);
@@ -780,7 +773,6 @@ static void prepare_devices(struct loopback_test *t) · 33 unmodified lines
780773 if (t->stop_all || device_enabled(t, i))
781774 write_sysfs_val(t->devices[i].sysfs_entry, "type", 0);
782775
783−
784776 for (i = 0; i < t->device_count; i++) {
785777 if (!device_enabled(t, i))
786778 continue;
@@ -823,7 +815,6 @@ static int start(struct loopback_test *t) · 36 unmodified lines
823815 return 0;
824816 }
825817
826−
827818 void loopback_run(struct loopback_test *t)
828819 {
829820 int i;
@@ -852,7 +843,6 @@ void loopback_run(struct loopback_test *t) · 22 unmodified lines
852843 if (ret)
853844 goto err;
854845
855−
856846 get_results(t);
857847
858848 log_results(t);
@@ -861,7 +851,6 @@ void loopback_run(struct loopback_test *t) · 2 unmodified lines
861851
862852 err:
863853 printf("Error running test\n");
864− return;
865854 }
866855
867856 static int sanity_check(struct loopback_test *t)
@@ -881,10 +870,8 @@ static int sanity_check(struct loopback_test *t) · 13 unmodified lines
881870 fprintf(stderr, "Bad device mask %x\n", (1 << i));
882871 return -1;
883872 }
884−
885873 }
886874
887−
888875 return 0;
889876 }
890877
drivers/staging/iio/frequency/ad9834.c+2−4
@@ -331,11 +331,9 @@ static IIO_DEV_ATTR_PHASE(0, 1, 0200, NULL, ad9834_write, AD9834_REG_PHASE1); · 330 unmodified lines
331331 static IIO_DEV_ATTR_PHASESYMBOL(0, 0200, NULL, ad9834_write, AD9834_PSEL);
332332 static IIO_CONST_ATTR_PHASE_SCALE(0, "0.0015339808"); /* 2PI/2^12 rad*/
333333
334−static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL,
335− ad9834_write, AD9834_PIN_SW);
334+static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL, ad9834_write, AD9834_PIN_SW);
336335 static IIO_DEV_ATTR_OUT_ENABLE(0, 0200, NULL, ad9834_write, AD9834_RESET);
337−static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL,
338− ad9834_write, AD9834_OPBITEN);
336+static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL, ad9834_write, AD9834_OPBITEN);
339337 static IIO_DEV_ATTR_OUT_WAVETYPE(0, 0, ad9834_store_wavetype, 0);
340338 static IIO_DEV_ATTR_OUT_WAVETYPE(0, 1, ad9834_store_wavetype, 1);
341339
drivers/staging/iio/meter/ade7854-i2c.c+2−3
@@ -109,8 +109,7 @@ unlock: · 108 unmodified lines
109109 return ret;
110110 }
111111
112−static int ade7854_i2c_probe(struct i2c_client *client,
113− const struct i2c_device_id *id)
112+static int ade7854_i2c_probe(struct i2c_client *client)
114113 {
115114 struct ade7854_state *st;
116115 struct iio_dev *indio_dev;
@@ -141,7 +140,7 @@ static struct i2c_driver ade7854_i2c_driver = { · 24 unmodified lines
141140 .driver = {
142141 .name = "ade7854",
143142 },
144− .probe = ade7854_i2c_probe,
143+ .probe_new = ade7854_i2c_probe,
145144 .id_table = ade7854_id,
146145 };
147146 module_i2c_driver(ade7854_i2c_driver);
drivers/staging/ks7010/TODO+3−0
@@ -27,6 +27,9 @@ Now the TODOs: · 26 unmodified lines
2727 - fix the 'card removal' event when card is inserted when booting
2828 - check what other upstream wireless mechanisms can be used instead of the
2929 custom ones here
30+- Switch to use LIB80211.
31+- Switch to use MAC80211.
32+- Switch to use CFG80211.
3033
3134 Please send any patches to:
3235 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_wlan_net.c+126−122
@@ -1763,8 +1763,8 @@ static struct iw_statistics *ks_get_wireless_stats(struct net_device *dev) · 1762 unmodified lines
17631763 }
17641764
17651765 static int ks_wlan_set_stop_request(struct net_device *dev,
1766− struct iw_request_info *info, __u32 *uwrq,
1767− char *extra)
1766+ struct iw_request_info *info,
1767+ union iwreq_data *uwrq, char *extra)
17681768 {
17691769 struct ks_wlan_private *priv = netdev_priv(dev);
17701770
@@ -1772,7 +1772,7 @@ static int ks_wlan_set_stop_request(struct net_device *dev, · 1 unmodified line
17721772 return -EPERM;
17731773
17741774 /* for SLEEP MODE */
1775− if (!(*uwrq))
1775+ if (!(uwrq->mode))
17761776 return -EINVAL;
17771777
17781778 hostif_sme_enqueue(priv, SME_STOP_REQUEST);
@@ -1786,7 +1786,9 @@ static int ks_wlan_set_mlme(struct net_device *dev, · 7 unmodified lines
17861786 {
17871787 struct ks_wlan_private *priv = netdev_priv(dev);
17881788 struct iw_mlme *mlme = (struct iw_mlme *)extra;
1789− __u32 mode = 1;
1789+ union iwreq_data uwrq;
1790+
1791+ uwrq.mode = 1;
17901792
17911793 if (priv->sleep_mode == SLP_SLEEP)
17921794 return -EPERM;
@@ -1799,13 +1801,14 @@ static int ks_wlan_set_mlme(struct net_device *dev, · 6 unmodified lines
17991801 mlme->reason_code == WLAN_REASON_MIC_FAILURE)
18001802 return 0;
18011803
1802− return ks_wlan_set_stop_request(dev, NULL, &mode, NULL);
1804+ return ks_wlan_set_stop_request(dev, NULL, &uwrq, NULL);
18031805 }
18041806
18051807 static int ks_wlan_get_firmware_version(struct net_device *dev,
18061808 struct iw_request_info *info,
1807− struct iw_point *dwrq, char *extra)
1809+ union iwreq_data *uwrq, char *extra)
18081810 {
1811+ struct iw_point *dwrq = &uwrq->data;
18091812 struct ks_wlan_private *priv = netdev_priv(dev);
18101813
18111814 dwrq->length = priv->version_size + 1;
@@ -1814,8 +1817,8 @@ static int ks_wlan_get_firmware_version(struct net_device *dev, · 2 unmodified lines
18141817 }
18151818
18161819 static int ks_wlan_set_preamble(struct net_device *dev,
1817− struct iw_request_info *info, __u32 *uwrq,
1818− char *extra)
1820+ struct iw_request_info *info,
1821+ union iwreq_data *uwrq, char *extra)
18191822 {
18201823 struct ks_wlan_private *priv = netdev_priv(dev);
18211824
@@ -1823,17 +1826,17 @@ static int ks_wlan_set_preamble(struct net_device *dev, · 1 unmodified line
18231826 return -EPERM;
18241827
18251828 /* for SLEEP MODE */
1826− if (*uwrq != LONG_PREAMBLE && *uwrq != SHORT_PREAMBLE)
1829+ if (uwrq->mode != LONG_PREAMBLE && uwrq->mode != SHORT_PREAMBLE)
18271830 return -EINVAL;
18281831
1829− priv->reg.preamble = *uwrq;
1832+ priv->reg.preamble = uwrq->mode;
18301833 priv->need_commit |= SME_MODE_SET;
18311834 return -EINPROGRESS; /* Call commit handler */
18321835 }
18331836
18341837 static int ks_wlan_get_preamble(struct net_device *dev,
1835− struct iw_request_info *info, __u32 *uwrq,
1836− char *extra)
1838+ struct iw_request_info *info,
1839+ union iwreq_data *uwrq, char *extra)
18371840 {
18381841 struct ks_wlan_private *priv = netdev_priv(dev);
18391842
@@ -1841,37 +1844,37 @@ static int ks_wlan_get_preamble(struct net_device *dev, · 1 unmodified line
18411844 return -EPERM;
18421845
18431846 /* for SLEEP MODE */
1844− *uwrq = priv->reg.preamble;
1847+ uwrq->mode = priv->reg.preamble;
18451848 return 0;
18461849 }
18471850
18481851 static int ks_wlan_set_power_mgmt(struct net_device *dev,
1849− struct iw_request_info *info, __u32 *uwrq,
1850− char *extra)
1852+ struct iw_request_info *info,
1853+ union iwreq_data *uwrq, char *extra)
18511854 {
18521855 struct ks_wlan_private *priv = netdev_priv(dev);
18531856
18541857 if (priv->sleep_mode == SLP_SLEEP)
18551858 return -EPERM;
18561859
1857− if (*uwrq != POWER_MGMT_ACTIVE &&
1858− *uwrq != POWER_MGMT_SAVE1 &&
1859− *uwrq != POWER_MGMT_SAVE2)
1860+ if (uwrq->mode != POWER_MGMT_ACTIVE &&
1861+ uwrq->mode != POWER_MGMT_SAVE1 &&
1862+ uwrq->mode != POWER_MGMT_SAVE2)
18601863 return -EINVAL;
18611864
1862− if ((*uwrq == POWER_MGMT_SAVE1 || *uwrq == POWER_MGMT_SAVE2) &&
1865+ if ((uwrq->mode == POWER_MGMT_SAVE1 || uwrq->mode == POWER_MGMT_SAVE2) &&
18631866 (priv->reg.operation_mode != MODE_INFRASTRUCTURE))
18641867 return -EINVAL;
18651868
1866− priv->reg.power_mgmt = *uwrq;
1869+ priv->reg.power_mgmt = uwrq->mode;
18671870 hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
18681871
18691872 return 0;
18701873 }
18711874
18721875 static int ks_wlan_get_power_mgmt(struct net_device *dev,
1873− struct iw_request_info *info, __u32 *uwrq,
1874− char *extra)
1876+ struct iw_request_info *info,
1877+ union iwreq_data *uwrq, char *extra)
18751878 {
18761879 struct ks_wlan_private *priv = netdev_priv(dev);
18771880
@@ -1879,13 +1882,13 @@ static int ks_wlan_get_power_mgmt(struct net_device *dev, · 1 unmodified line
18791882 return -EPERM;
18801883
18811884 /* for SLEEP MODE */
1882− *uwrq = priv->reg.power_mgmt;
1885+ uwrq->mode = priv->reg.power_mgmt;
18831886 return 0;
18841887 }
18851888
18861889 static int ks_wlan_set_scan_type(struct net_device *dev,
1887− struct iw_request_info *info, __u32 *uwrq,
1888− char *extra)
1890+ struct iw_request_info *info,
1891+ union iwreq_data *uwrq, char *extra)
18891892 {
18901893 struct ks_wlan_private *priv = netdev_priv(dev);
18911894
@@ -1893,39 +1896,39 @@ static int ks_wlan_set_scan_type(struct net_device *dev, · 1 unmodified line
18931896 return -EPERM;
18941897 /* for SLEEP MODE */
18951898
1896− if (*uwrq != ACTIVE_SCAN && *uwrq != PASSIVE_SCAN)
1899+ if (uwrq->mode != ACTIVE_SCAN && uwrq->mode != PASSIVE_SCAN)
18971900 return -EINVAL;
18981901
1899− priv->reg.scan_type = *uwrq;
1902+ priv->reg.scan_type = uwrq->mode;
19001903 return 0;
19011904 }
19021905
19031906 static int ks_wlan_get_scan_type(struct net_device *dev,
1904− struct iw_request_info *info, __u32 *uwrq,
1905− char *extra)
1907+ struct iw_request_info *info,
1908+ union iwreq_data *uwrq, char *extra)
19061909 {
19071910 struct ks_wlan_private *priv = netdev_priv(dev);
19081911
19091912 if (priv->sleep_mode == SLP_SLEEP)
19101913 return -EPERM;
19111914 /* for SLEEP MODE */
1912− *uwrq = priv->reg.scan_type;
1915+ uwrq->mode = priv->reg.scan_type;
19131916 return 0;
19141917 }
19151918
19161919 static int ks_wlan_set_beacon_lost(struct net_device *dev,
1917− struct iw_request_info *info, __u32 *uwrq,
1918− char *extra)
1920+ struct iw_request_info *info,
1921+ union iwreq_data *uwrq, char *extra)
19191922 {
19201923 struct ks_wlan_private *priv = netdev_priv(dev);
19211924
19221925 if (priv->sleep_mode == SLP_SLEEP)
19231926 return -EPERM;
19241927 /* for SLEEP MODE */
1925− if (*uwrq > BEACON_LOST_COUNT_MAX)
1928+ if (uwrq->mode > BEACON_LOST_COUNT_MAX)
19261929 return -EINVAL;
19271930
1928− priv->reg.beacon_lost_count = *uwrq;
1931+ priv->reg.beacon_lost_count = uwrq->mode;
19291932
19301933 if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
19311934 priv->need_commit |= SME_MODE_SET;
@@ -1936,101 +1939,101 @@ static int ks_wlan_set_beacon_lost(struct net_device *dev, · 4 unmodified lines
19361939 }
19371940
19381941 static int ks_wlan_get_beacon_lost(struct net_device *dev,
1939− struct iw_request_info *info, __u32 *uwrq,
1940− char *extra)
1942+ struct iw_request_info *info,
1943+ union iwreq_data *uwrq, char *extra)
19411944 {
19421945 struct ks_wlan_private *priv = netdev_priv(dev);
19431946
19441947 if (priv->sleep_mode == SLP_SLEEP)
19451948 return -EPERM;
19461949 /* for SLEEP MODE */
1947− *uwrq = priv->reg.beacon_lost_count;
1950+ uwrq->mode = priv->reg.beacon_lost_count;
19481951 return 0;
19491952 }
19501953
19511954 static int ks_wlan_set_phy_type(struct net_device *dev,
1952− struct iw_request_info *info, __u32 *uwrq,
1953− char *extra)
1955+ struct iw_request_info *info,
1956+ union iwreq_data *uwrq, char *extra)
19541957 {
19551958 struct ks_wlan_private *priv = netdev_priv(dev);
19561959
19571960 if (priv->sleep_mode == SLP_SLEEP)
19581961 return -EPERM;
19591962
1960− if (*uwrq != D_11B_ONLY_MODE &&
1961− *uwrq != D_11G_ONLY_MODE &&
1962− *uwrq != D_11BG_COMPATIBLE_MODE)
1963+ if (uwrq->mode != D_11B_ONLY_MODE &&
1964+ uwrq->mode != D_11G_ONLY_MODE &&
1965+ uwrq->mode != D_11BG_COMPATIBLE_MODE)
19631966 return -EINVAL;
19641967
19651968 /* for SLEEP MODE */
1966− priv->reg.phy_type = *uwrq;
1969+ priv->reg.phy_type = uwrq->mode;
19671970 priv->need_commit |= SME_MODE_SET;
19681971 return -EINPROGRESS; /* Call commit handler */
19691972 }
19701973
19711974 static int ks_wlan_get_phy_type(struct net_device *dev,
1972− struct iw_request_info *info, __u32 *uwrq,
1973− char *extra)
1975+ struct iw_request_info *info,
1976+ union iwreq_data *uwrq, char *extra)
19741977 {
19751978 struct ks_wlan_private *priv = netdev_priv(dev);
19761979
19771980 if (priv->sleep_mode == SLP_SLEEP)
19781981 return -EPERM;
19791982 /* for SLEEP MODE */
1980− *uwrq = priv->reg.phy_type;
1983+ uwrq->mode = priv->reg.phy_type;
19811984 return 0;
19821985 }
19831986
19841987 static int ks_wlan_set_cts_mode(struct net_device *dev,
1985− struct iw_request_info *info, __u32 *uwrq,
1986− char *extra)
1988+ struct iw_request_info *info,
1989+ union iwreq_data *uwrq, char *extra)
19871990 {
19881991 struct ks_wlan_private *priv = netdev_priv(dev);
19891992
19901993 if (priv->sleep_mode == SLP_SLEEP)
19911994 return -EPERM;
19921995 /* for SLEEP MODE */
1993− if (*uwrq != CTS_MODE_FALSE && *uwrq != CTS_MODE_TRUE)
1996+ if (uwrq->mode != CTS_MODE_FALSE && uwrq->mode != CTS_MODE_TRUE)
19941997 return -EINVAL;
19951998
1996− priv->reg.cts_mode = (*uwrq == CTS_MODE_FALSE) ? *uwrq :
1999+ priv->reg.cts_mode = (uwrq->mode == CTS_MODE_FALSE) ? uwrq->mode :
19972000 (priv->reg.phy_type == D_11G_ONLY_MODE ||
19982001 priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) ?
1999− *uwrq : !*uwrq;
2002+ uwrq->mode : !uwrq->mode;
20002003
20012004 priv->need_commit |= SME_MODE_SET;
20022005 return -EINPROGRESS; /* Call commit handler */
20032006 }
20042007
20052008 static int ks_wlan_get_cts_mode(struct net_device *dev,
2006− struct iw_request_info *info, __u32 *uwrq,
2007− char *extra)
2009+ struct iw_request_info *info,
2010+ union iwreq_data *uwrq, char *extra)
20082011 {
20092012 struct ks_wlan_private *priv = netdev_priv(dev);
20102013
20112014 if (priv->sleep_mode == SLP_SLEEP)
20122015 return -EPERM;
20132016 /* for SLEEP MODE */
2014− *uwrq = priv->reg.cts_mode;
2017+ uwrq->mode = priv->reg.cts_mode;
20152018 return 0;
20162019 }
20172020
20182021 static int ks_wlan_set_sleep_mode(struct net_device *dev,
20192022 struct iw_request_info *info,
2020− __u32 *uwrq, char *extra)
2023+ union iwreq_data *uwrq, char *extra)
20212024 {
20222025 struct ks_wlan_private *priv = netdev_priv(dev);
20232026
2024− if (*uwrq != SLP_SLEEP &&
2025− *uwrq != SLP_ACTIVE) {
2026− netdev_err(dev, "SET_SLEEP_MODE %d error\n", *uwrq);
2027+ if (uwrq->mode != SLP_SLEEP &&
2028+ uwrq->mode != SLP_ACTIVE) {
2029+ netdev_err(dev, "SET_SLEEP_MODE %d error\n", uwrq->mode);
20272030 return -EINVAL;
20282031 }
20292032
2030− priv->sleep_mode = *uwrq;
2033+ priv->sleep_mode = uwrq->mode;
20312034 netdev_info(dev, "SET_SLEEP_MODE %d\n", priv->sleep_mode);
20322035
2033− if (*uwrq == SLP_SLEEP)
2036+ if (uwrq->mode == SLP_SLEEP)
20342037 hostif_sme_enqueue(priv, SME_STOP_REQUEST);
20352038
20362039 hostif_sme_enqueue(priv, SME_SLEEP_REQUEST);
@@ -2040,52 +2043,53 @@ static int ks_wlan_set_sleep_mode(struct net_device *dev, · 3 unmodified lines
20402043
20412044 static int ks_wlan_get_sleep_mode(struct net_device *dev,
20422045 struct iw_request_info *info,
2043− __u32 *uwrq, char *extra)
2046+ union iwreq_data *uwrq, char *extra)
20442047 {
20452048 struct ks_wlan_private *priv = netdev_priv(dev);
20462049
2047− *uwrq = priv->sleep_mode;
2050+ uwrq->mode = priv->sleep_mode;
20482051
20492052 return 0;
20502053 }
20512054
20522055 static int ks_wlan_set_wps_enable(struct net_device *dev,
2053− struct iw_request_info *info, __u32 *uwrq,
2054− char *extra)
2056+ struct iw_request_info *info,
2057+ union iwreq_data *uwrq, char *extra)
20552058 {
20562059 struct ks_wlan_private *priv = netdev_priv(dev);
20572060
20582061 if (priv->sleep_mode == SLP_SLEEP)
20592062 return -EPERM;
20602063 /* for SLEEP MODE */
2061− if (*uwrq != 0 && *uwrq != 1)
2064+ if (uwrq->mode != 0 && uwrq->mode != 1)
20622065 return -EINVAL;
20632066
2064− priv->wps.wps_enabled = *uwrq;
2067+ priv->wps.wps_enabled = uwrq->mode;
20652068 hostif_sme_enqueue(priv, SME_WPS_ENABLE_REQUEST);
20662069
20672070 return 0;
20682071 }
20692072
20702073 static int ks_wlan_get_wps_enable(struct net_device *dev,
2071− struct iw_request_info *info, __u32 *uwrq,
2072− char *extra)
2074+ struct iw_request_info *info,
2075+ union iwreq_data *uwrq, char *extra)
20732076 {
20742077 struct ks_wlan_private *priv = netdev_priv(dev);
20752078
20762079 if (priv->sleep_mode == SLP_SLEEP)
20772080 return -EPERM;
20782081 /* for SLEEP MODE */
2079− *uwrq = priv->wps.wps_enabled;
2080− netdev_info(dev, "return=%d\n", *uwrq);
2082+ uwrq->mode = priv->wps.wps_enabled;
2083+ netdev_info(dev, "return=%d\n", uwrq->mode);
20812084
20822085 return 0;
20832086 }
20842087
20852088 static int ks_wlan_set_wps_probe_req(struct net_device *dev,
20862089 struct iw_request_info *info,
2087− struct iw_point *dwrq, char *extra)
2090+ union iwreq_data *uwrq, char *extra)
20882091 {
2092+ struct iw_point *dwrq = &uwrq->data;
20892093 u8 *p = extra;
20902094 unsigned char len;
20912095 struct ks_wlan_private *priv = netdev_priv(dev);
@@ -2114,76 +2118,76 @@ static int ks_wlan_set_wps_probe_req(struct net_device *dev, · 22 unmodified lines
21142118 }
21152119
21162120 static int ks_wlan_set_tx_gain(struct net_device *dev,
2117− struct iw_request_info *info, __u32 *uwrq,
2118− char *extra)
2121+ struct iw_request_info *info,
2122+ union iwreq_data *uwrq, char *extra)
21192123 {
21202124 struct ks_wlan_private *priv = netdev_priv(dev);
21212125
21222126 if (priv->sleep_mode == SLP_SLEEP)
21232127 return -EPERM;
21242128 /* for SLEEP MODE */
2125− if (*uwrq > 0xFF)
2129+ if (uwrq->mode > 0xFF)
21262130 return -EINVAL;
21272131
2128− priv->gain.tx_gain = (u8)*uwrq;
2132+ priv->gain.tx_gain = (u8)uwrq->mode;
21292133 priv->gain.tx_mode = (priv->gain.tx_gain < 0xFF) ? 1 : 0;
21302134 hostif_sme_enqueue(priv, SME_SET_GAIN);
21312135 return 0;
21322136 }
21332137
21342138 static int ks_wlan_get_tx_gain(struct net_device *dev,
2135− struct iw_request_info *info, __u32 *uwrq,
2136− char *extra)
2139+ struct iw_request_info *info,
2140+ union iwreq_data *uwrq, char *extra)
21372141 {
21382142 struct ks_wlan_private *priv = netdev_priv(dev);
21392143
21402144 if (priv->sleep_mode == SLP_SLEEP)
21412145 return -EPERM;
21422146 /* for SLEEP MODE */
2143− *uwrq = priv->gain.tx_gain;
2147+ uwrq->mode = priv->gain.tx_gain;
21442148 hostif_sme_enqueue(priv, SME_GET_GAIN);
21452149 return 0;
21462150 }
21472151
21482152 static int ks_wlan_set_rx_gain(struct net_device *dev,
2149− struct iw_request_info *info, __u32 *uwrq,
2150− char *extra)
2153+ struct iw_request_info *info,
2154+ union iwreq_data *uwrq, char *extra)
21512155 {
21522156 struct ks_wlan_private *priv = netdev_priv(dev);
21532157
21542158 if (priv->sleep_mode == SLP_SLEEP)
21552159 return -EPERM;
21562160 /* for SLEEP MODE */
2157− if (*uwrq > 0xFF)
2161+ if (uwrq->mode > 0xFF)
21582162 return -EINVAL;
21592163
2160− priv->gain.rx_gain = (u8)*uwrq;
2164+ priv->gain.rx_gain = (u8)uwrq->mode;
21612165 priv->gain.rx_mode = (priv->gain.rx_gain < 0xFF) ? 1 : 0;
21622166 hostif_sme_enqueue(priv, SME_SET_GAIN);
21632167 return 0;
21642168 }
21652169
21662170 static int ks_wlan_get_rx_gain(struct net_device *dev,
2167− struct iw_request_info *info, __u32 *uwrq,
2168− char *extra)
2171+ struct iw_request_info *info,
2172+ union iwreq_data *uwrq, char *extra)
21692173 {
21702174 struct ks_wlan_private *priv = netdev_priv(dev);
21712175
21722176 if (priv->sleep_mode == SLP_SLEEP)
21732177 return -EPERM;
21742178 /* for SLEEP MODE */
2175− *uwrq = priv->gain.rx_gain;
2179+ uwrq->mode = priv->gain.rx_gain;
21762180 hostif_sme_enqueue(priv, SME_GET_GAIN);
21772181 return 0;
21782182 }
21792183
21802184 static int ks_wlan_get_eeprom_cksum(struct net_device *dev,
2181− struct iw_request_info *info, __u32 *uwrq,
2182− char *extra)
2185+ struct iw_request_info *info,
2186+ union iwreq_data *uwrq, char *extra)
21832187 {
21842188 struct ks_wlan_private *priv = netdev_priv(dev);
21852189
2186− *uwrq = priv->eeprom_checksum;
2190+ uwrq->mode = priv->eeprom_checksum;
21872191 return 0;
21882192 }
21892193
@@ -2302,7 +2306,7 @@ static void print_hif_event(struct net_device *dev, int event) · 112 unmodified lines
23022306
23032307 /* get host command history */
23042308 static int ks_wlan_hostt(struct net_device *dev, struct iw_request_info *info,
2305− __u32 *uwrq, char *extra)
2309+ union iwreq_data *uwrq, char *extra)
23062310 {
23072311 int i, event;
23082312 struct ks_wlan_private *priv = netdev_priv(dev);
@@ -2409,38 +2413,38 @@ static const iw_handler ks_wlan_handler[] = { · 100 unmodified lines
24092413
24102414 /* private_handler */
24112415 static const iw_handler ks_wlan_private_handler[] = {
2412− (iw_handler)NULL, /* 0 */
2413− (iw_handler)NULL, /* 1, KS_WLAN_GET_DRIVER_VERSION */
2414− (iw_handler)NULL, /* 2 */
2415− (iw_handler)ks_wlan_get_firmware_version,/* 3 KS_WLAN_GET_FIRM_VERSION */
2416− (iw_handler)ks_wlan_set_wps_enable, /* 4 KS_WLAN_SET_WPS_ENABLE */
2417− (iw_handler)ks_wlan_get_wps_enable, /* 5 KS_WLAN_GET_WPS_ENABLE */
2418− (iw_handler)ks_wlan_set_wps_probe_req, /* 6 KS_WLAN_SET_WPS_PROBE_REQ */
2419− (iw_handler)ks_wlan_get_eeprom_cksum, /* 7 KS_WLAN_GET_CONNECT */
2420− (iw_handler)ks_wlan_set_preamble, /* 8 KS_WLAN_SET_PREAMBLE */
2421− (iw_handler)ks_wlan_get_preamble, /* 9 KS_WLAN_GET_PREAMBLE */
2422− (iw_handler)ks_wlan_set_power_mgmt, /* 10 KS_WLAN_SET_POWER_SAVE */
2423− (iw_handler)ks_wlan_get_power_mgmt, /* 11 KS_WLAN_GET_POWER_SAVE */
2424− (iw_handler)ks_wlan_set_scan_type, /* 12 KS_WLAN_SET_SCAN_TYPE */
2425− (iw_handler)ks_wlan_get_scan_type, /* 13 KS_WLAN_GET_SCAN_TYPE */
2426− (iw_handler)ks_wlan_set_rx_gain, /* 14 KS_WLAN_SET_RX_GAIN */
2427− (iw_handler)ks_wlan_get_rx_gain, /* 15 KS_WLAN_GET_RX_GAIN */
2428− (iw_handler)ks_wlan_hostt, /* 16 KS_WLAN_HOSTT */
2429− (iw_handler)NULL, /* 17 */
2430− (iw_handler)ks_wlan_set_beacon_lost, /* 18 KS_WLAN_SET_BECAN_LOST */
2431− (iw_handler)ks_wlan_get_beacon_lost, /* 19 KS_WLAN_GET_BECAN_LOST */
2432− (iw_handler)ks_wlan_set_tx_gain, /* 20 KS_WLAN_SET_TX_GAIN */
2433− (iw_handler)ks_wlan_get_tx_gain, /* 21 KS_WLAN_GET_TX_GAIN */
2434− (iw_handler)ks_wlan_set_phy_type, /* 22 KS_WLAN_SET_PHY_TYPE */
2435− (iw_handler)ks_wlan_get_phy_type, /* 23 KS_WLAN_GET_PHY_TYPE */
2436− (iw_handler)ks_wlan_set_cts_mode, /* 24 KS_WLAN_SET_CTS_MODE */
2437− (iw_handler)ks_wlan_get_cts_mode, /* 25 KS_WLAN_GET_CTS_MODE */
2438− (iw_handler)NULL, /* 26 */
2439− (iw_handler)NULL, /* 27 */
2440− (iw_handler)ks_wlan_set_sleep_mode, /* 28 KS_WLAN_SET_SLEEP_MODE */
2441− (iw_handler)ks_wlan_get_sleep_mode, /* 29 KS_WLAN_GET_SLEEP_MODE */
2442− (iw_handler)NULL, /* 30 */
2443− (iw_handler)NULL, /* 31 */
2416+ NULL, /* 0 */
2417+ NULL, /* 1, KS_WLAN_GET_DRIVER_VERSION */
2418+ NULL, /* 2 */
2419+ ks_wlan_get_firmware_version, /* 3 KS_WLAN_GET_FIRM_VERSION */
2420+ ks_wlan_set_wps_enable, /* 4 KS_WLAN_SET_WPS_ENABLE */
2421+ ks_wlan_get_wps_enable, /* 5 KS_WLAN_GET_WPS_ENABLE */
2422+ ks_wlan_set_wps_probe_req, /* 6 KS_WLAN_SET_WPS_PROBE_REQ */
2423+ ks_wlan_get_eeprom_cksum, /* 7 KS_WLAN_GET_CONNECT */
2424+ ks_wlan_set_preamble, /* 8 KS_WLAN_SET_PREAMBLE */
2425+ ks_wlan_get_preamble, /* 9 KS_WLAN_GET_PREAMBLE */
2426+ ks_wlan_set_power_mgmt, /* 10 KS_WLAN_SET_POWER_SAVE */
2427+ ks_wlan_get_power_mgmt, /* 11 KS_WLAN_GET_POWER_SAVE */
2428+ ks_wlan_set_scan_type, /* 12 KS_WLAN_SET_SCAN_TYPE */
2429+ ks_wlan_get_scan_type, /* 13 KS_WLAN_GET_SCAN_TYPE */
2430+ ks_wlan_set_rx_gain, /* 14 KS_WLAN_SET_RX_GAIN */
2431+ ks_wlan_get_rx_gain, /* 15 KS_WLAN_GET_RX_GAIN */
2432+ ks_wlan_hostt, /* 16 KS_WLAN_HOSTT */
2433+ NULL, /* 17 */
2434+ ks_wlan_set_beacon_lost, /* 18 KS_WLAN_SET_BECAN_LOST */
2435+ ks_wlan_get_beacon_lost, /* 19 KS_WLAN_GET_BECAN_LOST */
2436+ ks_wlan_set_tx_gain, /* 20 KS_WLAN_SET_TX_GAIN */
2437+ ks_wlan_get_tx_gain, /* 21 KS_WLAN_GET_TX_GAIN */
2438+ ks_wlan_set_phy_type, /* 22 KS_WLAN_SET_PHY_TYPE */
2439+ ks_wlan_get_phy_type, /* 23 KS_WLAN_GET_PHY_TYPE */
2440+ ks_wlan_set_cts_mode, /* 24 KS_WLAN_SET_CTS_MODE */
2441+ ks_wlan_get_cts_mode, /* 25 KS_WLAN_GET_CTS_MODE */
2442+ NULL, /* 26 */
2443+ NULL, /* 27 */
2444+ ks_wlan_set_sleep_mode, /* 28 KS_WLAN_SET_SLEEP_MODE */
2445+ ks_wlan_get_sleep_mode, /* 29 KS_WLAN_GET_SLEEP_MODE */
2446+ NULL, /* 30 */
2447+ NULL, /* 31 */
24442448 };
24452449
24462450 static const struct iw_handler_def ks_wlan_handler_def = {
@@ -2461,7 +2465,7 @@ static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq, · 14 unmodified lines
24612465
24622466 switch (cmd) {
24632467 case SIOCIWFIRSTPRIV + 20: /* KS_WLAN_SET_STOP_REQ */
2464− ret = ks_wlan_set_stop_request(dev, NULL, &wrq->u.mode, NULL);
2468+ ret = ks_wlan_set_stop_request(dev, NULL, &wrq->u, NULL);
24652469 break;
24662470 // All other calls are currently unsupported
24672471 default:
drivers/staging/most/dim2/dim2.c+2−2
@@ -161,7 +161,7 @@ static int try_start_dim_transfer(struct hdm_channel *hdm_ch) · 160 unmodified lines
161161 struct list_head *head = &hdm_ch->pending_list;
162162 struct mbo *mbo;
163163 unsigned long flags;
164− struct dim_ch_state_t st;
164+ struct dim_ch_state st;
165165
166166 BUG_ON(!hdm_ch);
167167 BUG_ON(!hdm_ch->is_initialized);
@@ -259,7 +259,7 @@ static void retrieve_netinfo(struct dim2_hdm *dev, struct mbo *mbo) · 91 unmodified lines
259259 static void service_done_flag(struct dim2_hdm *dev, int ch_idx)
260260 {
261261 struct hdm_channel *hdm_ch = dev->hch + ch_idx;
262− struct dim_ch_state_t st;
262+ struct dim_ch_state st;
263263 struct list_head *head;
264264 struct mbo *mbo;
265265 int done_buffers;
drivers/staging/most/dim2/hal.c+2−2
@@ -943,8 +943,8 @@ u8 dim_service_channel(struct dim_channel *ch) · 942 unmodified lines
943943 return channel_service(ch);
944944 }
945945
946−struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch,
947− struct dim_ch_state_t *state_ptr)
946+struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch,
947+ struct dim_ch_state *state_ptr)
948948 {
949949 if (!ch || !state_ptr)
950950 return NULL;
drivers/staging/most/dim2/hal.h+3−3
@@ -27,7 +27,7 @@ enum mlb_clk_speed { · 26 unmodified lines
2727 CLK_8192FS = 7,
2828 };
2929
30−struct dim_ch_state_t {
30+struct dim_ch_state {
3131 bool ready; /* Shows readiness to enqueue next buffer */
3232 u16 done_buffers; /* Number of completed buffers */
3333 };
@@ -87,8 +87,8 @@ void dim_service_ahb_int_irq(struct dim_channel *const *channels); · 53 unmodified lines
8787
8888 u8 dim_service_channel(struct dim_channel *ch);
8989
90−struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch,
91− struct dim_ch_state_t *state_ptr);
90+struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch,
91+ struct dim_ch_state *state_ptr);
9292
9393 u16 dim_dbr_space(struct dim_channel *ch);
9494
drivers/staging/most/i2c/i2c.c+2−2
@@ -284,7 +284,7 @@ static irqreturn_t most_irq_handler(int irq, void *_dev) · 283 unmodified lines
284284 *
285285 * Register the i2c client device as a MOST interface
286286 */
287−static int i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
287+static int i2c_probe(struct i2c_client *client)
288288 {
289289 struct hdm_i2c *dev;
290290 int ret, i;
@@ -359,7 +359,7 @@ static struct i2c_driver i2c_driver = { · 68 unmodified lines
359359 .driver = {
360360 .name = "hdm_i2c",
361361 },
362− .probe = i2c_probe,
362+ .probe_new = i2c_probe,
363363 .remove = i2c_remove,
364364 .id_table = i2c_id,
365365 };
drivers/staging/octeon/ethernet-tx.c+0−2
@@ -73,7 +73,6 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev) · 72 unmodified lines
7373 {
7474 int skb_to_free;
7575 int qos, queues_per_port;
76− int total_freed = 0;
7776 int total_remaining = 0;
7877 unsigned long flags;
7978 struct octeon_ethernet *priv = netdev_priv(dev);
@@ -87,7 +86,6 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev) · 7 unmodified lines
8786 MAX_SKB_TO_FREE);
8887 skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
8988 priv->fau + qos * 4);
90− total_freed += skb_to_free;
9189 if (skb_to_free > 0) {
9290 struct sk_buff *to_free_list = NULL;
9391
drivers/staging/octeon/octeon-stubs.h+1−1
@@ -1212,7 +1212,7 @@ static inline void *cvmx_phys_to_ptr(uint64_t physical_address) · 1211 unmodified lines
12121212 return (void *)(uintptr_t)(physical_address);
12131213 }
12141214
1215−static inline uint64_t cvmx_ptr_to_phys(void *ptr)
1215+static inline phys_addr_t cvmx_ptr_to_phys(void *ptr)
12161216 {
12171217 return (unsigned long)ptr;
12181218 }
drivers/staging/olpc_dcon/olpc_dcon.c+2−2
@@ -579,7 +579,7 @@ static int dcon_detect(struct i2c_client *client, struct i2c_board_info *info) · 578 unmodified lines
579579 return 0;
580580 }
581581
582−static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
582+static int dcon_probe(struct i2c_client *client)
583583 {
584584 struct dcon_priv *dcon;
585585 int rc, i, j;
@@ -779,7 +779,7 @@ static struct i2c_driver dcon_driver = { · 193 unmodified lines
779779 },
780780 .class = I2C_CLASS_DDC | I2C_CLASS_HWMON,
781781 .id_table = dcon_idtable,
782− .probe = dcon_probe,
782+ .probe_new = dcon_probe,
783783 .remove = dcon_remove,
784784 .detect = dcon_detect,
785785 .address_list = normal_i2c,
drivers/staging/r8188eu/core/rtw_ap.c+2−5
@@ -1017,10 +1017,9 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, · 1016 unmodified lines
10171017 return beacon_updated;
10181018 }
10191019
1020−int rtw_sta_flush(struct adapter *padapter)
1020+void rtw_sta_flush(struct adapter *padapter)
10211021 {
10221022 struct list_head *phead, *plist;
1023− int ret = 0;
10241023 struct sta_info *psta = NULL;
10251024 struct sta_priv *pstapriv = &padapter->stapriv;
10261025 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -1028,7 +1027,7 @@ int rtw_sta_flush(struct adapter *padapter) · 1 unmodified line
10281027 u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
10291028
10301029 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
1031− return ret;
1030+ return;
10321031
10331032 spin_lock_bh(&pstapriv->asoc_list_lock);
10341033 phead = &pstapriv->asoc_list;
@@ -1050,8 +1049,6 @@ int rtw_sta_flush(struct adapter *padapter) · 15 unmodified lines
10501049 issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING);
10511050
10521051 associated_clients_update(padapter, true);
1053−
1054− return ret;
10551052 }
10561053
10571054 /* called > TSR LEVEL for USB or SDIO Interface*/
drivers/staging/r8188eu/core/rtw_br_ext.c+62−64
@@ -50,17 +50,17 @@ · 49 unmodified lines
5050 static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
5151 {
5252 unsigned char *cur_ptr, *start_ptr;
53− unsigned short tagLen, tagType;
53+ unsigned short tag_len, tag_type;
5454
5555 start_ptr = (unsigned char *)ph->tag;
5656 cur_ptr = (unsigned char *)ph->tag;
5757 while ((cur_ptr - start_ptr) < ntohs(ph->length)) {
5858 /* prevent un-alignment access */
59− tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
60− tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
61− if (tagType == type)
59+ tag_type = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
60+ tag_len = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
61+ if (tag_type == type)
6262 return cur_ptr;
63− cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen;
63+ cur_ptr = cur_ptr + TAG_HDR_LEN + tag_len;
6464 }
6565 return NULL;
6666 }
@@ -111,32 +111,32 @@ static int __nat25_has_expired(struct nat25_network_db_entry *fdb) · 44 unmodified lines
111111 return 0;
112112 }
113113
114−static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
115− unsigned int *ipAddr)
114+static void __nat25_generate_ipv4_network_addr(unsigned char *addr,
115+ unsigned int *ip_addr)
116116 {
117− memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
117+ memset(addr, 0, MAX_NETWORK_ADDR_LEN);
118118
119− networkAddr[0] = NAT25_IPV4;
120− memcpy(networkAddr + 7, (unsigned char *)ipAddr, 4);
119+ addr[0] = NAT25_IPV4;
120+ memcpy(addr + 7, (unsigned char *)ip_addr, 4);
121121 }
122122
123−static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
123+static void __nat25_generate_pppoe_network_addr(unsigned char *addr,
124124 unsigned char *ac_mac, __be16 *sid)
125125 {
126− memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
126+ memset(addr, 0, MAX_NETWORK_ADDR_LEN);
127127
128− networkAddr[0] = NAT25_PPPOE;
129− memcpy(networkAddr + 1, (unsigned char *)sid, 2);
130− memcpy(networkAddr + 3, (unsigned char *)ac_mac, 6);
128+ addr[0] = NAT25_PPPOE;
129+ memcpy(addr + 1, (unsigned char *)sid, 2);
130+ memcpy(addr + 3, (unsigned char *)ac_mac, 6);
131131 }
132132
133−static void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr,
134− unsigned int *ipAddr)
133+static void __nat25_generate_ipv6_network_addr(unsigned char *addr,
134+ unsigned int *ip_addr)
135135 {
136− memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
136+ memset(addr, 0, MAX_NETWORK_ADDR_LEN);
137137
138− networkAddr[0] = NAT25_IPV6;
139− memcpy(networkAddr + 1, (unsigned char *)ipAddr, 16);
138+ addr[0] = NAT25_IPV6;
139+ memcpy(addr + 1, (unsigned char *)ip_addr, 16);
140140 }
141141
142142 static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b)
@@ -200,40 +200,40 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char · 57 unmodified lines
200200 return 0;
201201 }
202202
203−static int __nat25_network_hash(unsigned char *networkAddr)
203+static int __nat25_network_hash(unsigned char *addr)
204204 {
205− if (networkAddr[0] == NAT25_IPV4) {
205+ if (addr[0] == NAT25_IPV4) {
206206 unsigned long x;
207207
208− x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
208+ x = addr[7] ^ addr[8] ^ addr[9] ^ addr[10];
209209
210210 return x & (NAT25_HASH_SIZE - 1);
211− } else if (networkAddr[0] == NAT25_IPX) {
211+ } else if (addr[0] == NAT25_IPX) {
212212 unsigned long x;
213213
214− x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^
215− networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
214+ x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^
215+ addr[6] ^ addr[7] ^ addr[8] ^ addr[9] ^ addr[10];
216216
217217 return x & (NAT25_HASH_SIZE - 1);
218− } else if (networkAddr[0] == NAT25_APPLE) {
218+ } else if (addr[0] == NAT25_APPLE) {
219219 unsigned long x;
220220
221− x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3];
221+ x = addr[1] ^ addr[2] ^ addr[3];
222222
223223 return x & (NAT25_HASH_SIZE - 1);
224− } else if (networkAddr[0] == NAT25_PPPOE) {
224+ } else if (addr[0] == NAT25_PPPOE) {
225225 unsigned long x;
226226
227− x = networkAddr[0] ^ networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ networkAddr[6] ^ networkAddr[7] ^ networkAddr[8];
227+ x = addr[0] ^ addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^
228+ addr[5] ^ addr[6] ^ addr[7] ^ addr[8];
228229
229230 return x & (NAT25_HASH_SIZE - 1);
230− } else if (networkAddr[0] == NAT25_IPV6) {
231+ } else if (addr[0] == NAT25_IPV6) {
231232 unsigned long x;
232233
233− x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^
234− networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^
235− networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^
236− networkAddr[16];
234+ x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^ addr[6] ^
235+ addr[7] ^ addr[8] ^ addr[9] ^ addr[10] ^ addr[11] ^ addr[12] ^
236+ addr[13] ^ addr[14] ^ addr[15] ^ addr[16];
237237
238238 return x & (NAT25_HASH_SIZE - 1);
239239 } else {
@@ -241,7 +241,7 @@ static int __nat25_network_hash(unsigned char *networkAddr) · 1 unmodified line
241241 int i;
242242
243243 for (i = 0; i < MAX_NETWORK_ADDR_LEN; i++)
244− x ^= networkAddr[i];
244+ x ^= addr[i];
245245
246246 return x & (NAT25_HASH_SIZE - 1);
247247 }
@@ -269,17 +269,17 @@ static void __network_hash_unlink(struct nat25_network_db_entry *ent) · 21 unmodified lines
269269 }
270270
271271 static void __nat25_db_network_insert(struct adapter *priv,
272− unsigned char *macAddr, unsigned char *networkAddr)
272+ unsigned char *mac_addr, unsigned char *addr)
273273 {
274274 struct nat25_network_db_entry *db;
275275 int hash;
276276
277277 spin_lock_bh(&priv->br_ext_lock);
278− hash = __nat25_network_hash(networkAddr);
278+ hash = __nat25_network_hash(addr);
279279 db = priv->nethash[hash];
280280 while (db) {
281− if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
282− memcpy(db->macAddr, macAddr, ETH_ALEN);
281+ if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN)) {
282+ memcpy(db->macAddr, mac_addr, ETH_ALEN);
283283 db->ageing_timer = jiffies;
284284 spin_unlock_bh(&priv->br_ext_lock);
285285 return;
@@ -291,8 +291,8 @@ static void __nat25_db_network_insert(struct adapter *priv, · 5 unmodified lines
291291 spin_unlock_bh(&priv->br_ext_lock);
292292 return;
293293 }
294− memcpy(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN);
295− memcpy(db->macAddr, macAddr, ETH_ALEN);
294+ memcpy(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN);
295+ memcpy(db->macAddr, mac_addr, ETH_ALEN);
296296 atomic_set(&db->use_count, 1);
297297 db->ageing_timer = jiffies;
298298
@@ -366,7 +366,7 @@ void nat25_db_expire(struct adapter *priv) · 67 unmodified lines
366366 int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
367367 {
368368 unsigned short protocol;
369− unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
369+ unsigned char addr[MAX_NETWORK_ADDR_LEN];
370370 unsigned int tmp;
371371
372372 if (!skb)
@@ -395,9 +395,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 22 unmodified lines
395395 if (iph->saddr == 0)
396396 return 0;
397397 tmp = be32_to_cpu(iph->saddr);
398− __nat25_generate_ipv4_network_addr(networkAddr, &tmp);
398+ __nat25_generate_ipv4_network_addr(addr, &tmp);
399399 /* record source IP address and , source mac address into db */
400− __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
400+ __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
401401 return 0;
402402 default:
403403 return -1;
@@ -421,8 +421,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 17 unmodified lines
421421 memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN);
422422 arp_ptr += arp->ar_hln;
423423 sender = (unsigned int *)arp_ptr;
424− __nat25_generate_ipv4_network_addr(networkAddr, sender);
425− __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
424+ __nat25_generate_ipv4_network_addr(addr, sender);
425+ __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
426426 return 0;
427427 default:
428428 return -1;
@@ -495,9 +495,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 66 unmodified lines
495495 return -1;
496496 }
497497 } else { /* session phase */
498− __nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid);
498+ __nat25_generate_pppoe_network_addr(addr, skb->data, &ph->sid);
499499
500− __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
500+ __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
501501
502502 if (!priv->ethBrExtInfo.addPPPoETag &&
503503 priv->pppoe_connection_in_progress &&
@@ -548,8 +548,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) · 44 unmodified lines
548548 return -1;
549549 case NAT25_INSERT:
550550 if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) {
551− __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr);
552− __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
551+ __nat25_generate_ipv6_network_addr(addr, (unsigned int *)&iph->saddr);
552+ __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
553553
554554 if (iph->nexthdr == IPPROTO_ICMPV6 &&
555555 skb->len > (ETH_HLEN + sizeof(*iph) + 4)) {
@@ -606,17 +606,16 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) · 50 unmodified lines
606606 if (!priv->ethBrExtInfo.dhcp_bcst_disable) {
607607 __be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN));
608608
609− if (protocol == __constant_htons(ETH_P_IP)) { /* IP */
609+ if (protocol == htons(ETH_P_IP)) { /* IP */
610610 struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN);
611611
612612 if (iph->protocol == IPPROTO_UDP) { /* UDP */
613− struct udphdr *udph = (struct udphdr *)((size_t)iph + (iph->ihl << 2));
613+ struct udphdr *udph = (void *)iph + (iph->ihl << 2);
614614
615− if ((udph->source == __constant_htons(CLIENT_PORT)) &&
616− (udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */
617− struct dhcpMessage *dhcph =
618− (struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr));
619− u32 cookie = be32_to_cpu((__be32)dhcph->cookie);
615+ if ((udph->source == htons(CLIENT_PORT)) &&
616+ (udph->dest == htons(SERVER_PORT))) { /* DHCP request */
617+ struct dhcpMessage *dhcph = (void *)udph + sizeof(struct udphdr);
618+ u32 cookie = be32_to_cpu(dhcph->cookie);
620619
621620 if (cookie == DHCP_MAGIC) { /* match magic word */
622621 if (!(dhcph->flags & htons(BROADCAST_FLAG))) {
@@ -639,19 +638,18 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb) · 16 unmodified lines
639638 }
640639 }
641640
642−void *scdb_findEntry(struct adapter *priv, unsigned char *ipAddr)
641+void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr)
643642 {
644− unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
643+ unsigned char addr[MAX_NETWORK_ADDR_LEN];
645644 struct nat25_network_db_entry *db;
646645 int hash;
647646
648− __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr);
649− hash = __nat25_network_hash(networkAddr);
647+ __nat25_generate_ipv4_network_addr(addr, (unsigned int *)ip_addr);
648+ hash = __nat25_network_hash(addr);
650649 db = priv->nethash[hash];
651650 while (db) {
652− if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
651+ if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN))
653652 return (void *)db;
654− }
655653
656654 db = db->next_hash;
657655 }
drivers/staging/r8188eu/core/rtw_cmd.c+14−20
@@ -54,7 +54,7 @@ exit: · 53 unmodified lines
5454 return _SUCCESS;
5555 }
5656
57−u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
57+int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
5858 {
5959 init_completion(&pcmdpriv->enqueue_cmd);
6060 /* sema_init(&(pcmdpriv->cmd_done_sema), 0); */
@@ -71,7 +71,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) · 10 unmodified lines
7171 GFP_KERNEL);
7272
7373 if (!pcmdpriv->cmd_allocated_buf)
74− return _FAIL;
74+ return -ENOMEM;
7575
7676 pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1));
7777
@@ -79,7 +79,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) · 1 unmodified line
7979
8080 if (!pcmdpriv->rsp_allocated_buf) {
8181 kfree(pcmdpriv->cmd_allocated_buf);
82− return _FAIL;
82+ return -ENOMEM;
8383 }
8484
8585 pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3);
@@ -87,13 +87,11 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) · 1 unmodified line
8787 pcmdpriv->cmd_done_cnt = 0;
8888 pcmdpriv->rsp_cnt = 0;
8989
90− return _SUCCESS;
90+ return 0;
9191 }
9292
93−u32 rtw_init_evt_priv(struct evt_priv *pevtpriv)
93+int rtw_init_evt_priv(struct evt_priv *pevtpriv)
9494 {
95− u32 res = _SUCCESS;
96−
9795 /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
9896 atomic_set(&pevtpriv->event_seq, 0);
9997
@@ -101,9 +99,9 @@ u32 rtw_init_evt_priv(struct evt_priv *pevtpriv) · 1 unmodified line
10199 pevtpriv->c2h_wk_alive = false;
102100 pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
103101 if (!pevtpriv->c2h_queue)
104− res = _FAIL;
102+ return -ENOMEM;
105103
106− return res;
104+ return 0;
107105 }
108106
109107 void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
@@ -342,33 +340,29 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, · 232 unmodified lines
342340 return res;
343341 }
344342
345−u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset)
343+int rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset)
346344 {
347345 struct cmd_obj *ph2c;
348346 struct setdatarate_parm *pbsetdataratepara;
349347 struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
350− u8 res = _SUCCESS;
351348
352349 ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC);
353− if (!ph2c) {
354− res = _FAIL;
355− goto exit;
356− }
350+ if (!ph2c)
351+ return -ENOMEM;
357352
358353 pbsetdataratepara = kzalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC);
359354 if (!pbsetdataratepara) {
360355 kfree(ph2c);
361− res = _FAIL;
362− goto exit;
356+ return -ENOMEM;
363357 }
364358
365359 init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate));
366360 pbsetdataratepara->mac_id = 5;
367361 memcpy(pbsetdataratepara->datarates, rateset, NumRates);
368− res = rtw_enqueue_cmd(pcmdpriv, ph2c);
369−exit:
362+ if (rtw_enqueue_cmd(pcmdpriv, ph2c) == _FAIL)
363+ return -EPERM;
370364
371− return res;
365+ return 0;
372366 }
373367
374368 void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
drivers/staging/r8188eu/core/rtw_ioctl_set.c+2−4
@@ -287,7 +287,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, · 286 unmodified lines
287287
288288 if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
289289 if (check_fwstate(pmlmepriv, _FW_LINKED))
290− rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not */
290+ rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
291291 }
292292
293293 *pold_state = networktype;
@@ -314,7 +314,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, · 20 unmodified lines
314314 return true;
315315 }
316316
317−u8 rtw_set_802_11_disassociate(struct adapter *padapter)
317+void rtw_set_802_11_disassociate(struct adapter *padapter)
318318 {
319319 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
320320
@@ -328,8 +328,6 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter) · 7 unmodified lines
328328 }
329329
330330 spin_unlock_bh(&pmlmepriv->lock);
331−
332− return true;
333331 }
334332
335333 u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
drivers/staging/r8188eu/core/rtw_led.c+19−60
@@ -26,47 +26,32 @@ static void ResetLedStatus(struct led_priv *pLed) · 25 unmodified lines
2626
2727 pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */
2828
29− pLed->bLedLinkBlinkInProgress = false;
3029 pLed->bLedScanBlinkInProgress = false;
3130 }
3231
33−static void SwLedOn(struct adapter *padapter, struct led_priv *pLed)
32+static void SwLedOn(struct led_priv *pLed)
3433 {
35− u8 LedCfg;
36− int res;
34+ struct adapter *padapter = container_of(pLed, struct adapter, ledpriv);
3735
3836 if (padapter->bDriverStopped)
3937 return;
4038
41− res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);
42− if (res)
39+ if (rtw_write8(padapter, REG_LEDCFG2, BIT(5)) != _SUCCESS)
4340 return;
4441
45− rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0xf0) | BIT(5) | BIT(6)); /* SW control led0 on. */
4642 pLed->bLedOn = true;
4743 }
4844
49−static void SwLedOff(struct adapter *padapter, struct led_priv *pLed)
45+static void SwLedOff(struct led_priv *pLed)
5046 {
51− u8 LedCfg;
52− int res;
47+ struct adapter *padapter = container_of(pLed, struct adapter, ledpriv);
5348
5449 if (padapter->bDriverStopped)
55− goto exit;
56−
57− res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */
58− if (res)
59− goto exit;
50+ return;
6051
61− LedCfg &= 0x90; /* Set to software control. */
62− rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3)));
63− res = rtw_read8(padapter, REG_MAC_PINMUX_CFG, &LedCfg);
64− if (res)
65− goto exit;
52+ if (rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)) != _SUCCESS)
53+ return;
6654
67− LedCfg &= 0xFE;
68− rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
69−exit:
7055 pLed->bLedOn = false;
7156 }
7257
@@ -74,19 +59,19 @@ static void blink_work(struct work_struct *work) · 1 unmodified line
7459 {
7560 struct delayed_work *dwork = to_delayed_work(work);
7661 struct led_priv *pLed = container_of(dwork, struct led_priv, blink_work);
77− struct adapter *padapter = pLed->padapter;
62+ struct adapter *padapter = container_of(pLed, struct adapter, ledpriv);
7863 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
7964
8065 if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) {
81− SwLedOff(padapter, pLed);
66+ SwLedOff(pLed);
8267 ResetLedStatus(pLed);
8368 return;
8469 }
8570
8671 if (pLed->bLedOn)
87− SwLedOff(padapter, pLed);
72+ SwLedOff(pLed);
8873 else
89− SwLedOn(padapter, pLed);
74+ SwLedOn(pLed);
9075
9176 switch (pLed->CurrLedState) {
9277 case LED_BLINK_SLOWLY:
@@ -96,26 +81,10 @@ static void blink_work(struct work_struct *work) · 3 unmodified lines
9681 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
9782 break;
9883 case LED_BLINK_SCAN:
99− pLed->BlinkTimes--;
100− if (pLed->BlinkTimes == 0) {
101− if (check_fwstate(pmlmepriv, _FW_LINKED)) {
102− pLed->bLedLinkBlinkInProgress = true;
103− pLed->CurrLedState = LED_BLINK_NORMAL;
104− schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
105− } else {
106− pLed->CurrLedState = LED_BLINK_SLOWLY;
107− schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
108− }
109− pLed->bLedScanBlinkInProgress = false;
110− } else {
111− schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL);
112− }
113− break;
11484 case LED_BLINK_TXRX:
11585 pLed->BlinkTimes--;
11686 if (pLed->BlinkTimes == 0) {
11787 if (check_fwstate(pmlmepriv, _FW_LINKED)) {
118− pLed->bLedLinkBlinkInProgress = true;
11988 pLed->CurrLedState = LED_BLINK_NORMAL;
12089 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
12190 } else {
@@ -123,8 +92,11 @@ static void blink_work(struct work_struct *work) · 1 unmodified line
12392 schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
12493 }
12594 pLed->bLedBlinkInProgress = false;
95+ pLed->bLedScanBlinkInProgress = false;
12696 } else {
127− schedule_delayed_work(&pLed->blink_work, LED_BLINK_FASTER_INTVL);
97+ schedule_delayed_work(&pLed->blink_work,
98+ pLed->CurrLedState == LED_BLINK_SCAN ?
99+ LED_BLINK_SCAN_INTVL : LED_BLINK_FASTER_INTVL);
128100 }
129101 break;
130102 case LED_BLINK_WPS:
@@ -132,7 +104,6 @@ static void blink_work(struct work_struct *work) · 1 unmodified line
132104 break;
133105 case LED_BLINK_WPS_STOP: /* WPS success */
134106 if (!pLed->bLedOn) {
135− pLed->bLedLinkBlinkInProgress = true;
136107 pLed->CurrLedState = LED_BLINK_NORMAL;
137108 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
138109
@@ -150,7 +121,6 @@ void rtl8188eu_InitSwLeds(struct adapter *padapter) · 11 unmodified lines
150121 {
151122 struct led_priv *pledpriv = &padapter->ledpriv;
152123
153− pledpriv->padapter = padapter;
154124 ResetLedStatus(pledpriv);
155125 INIT_DELAYED_WORK(&pledpriv->blink_work, blink_work);
156126 }
@@ -161,7 +131,7 @@ void rtl8188eu_DeInitSwLeds(struct adapter *padapter) · 4 unmodified lines
161131
162132 cancel_delayed_work_sync(&ledpriv->blink_work);
163133 ResetLedStatus(ledpriv);
164− SwLedOff(padapter, ledpriv);
134+ SwLedOff(ledpriv);
165135 }
166136
167137 void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
@@ -170,8 +140,7 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 2 unmodified lines
170140 struct registry_priv *registry_par;
171141 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
172142
173− if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) ||
174− (!padapter->hw_init_completed))
143+ if (!padapter->hw_init_completed)
175144 return;
176145
177146 if (!pLed->bRegUseLed)
@@ -189,23 +158,18 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 11 unmodified lines
189158
190159 cancel_delayed_work(&pLed->blink_work);
191160
192− pLed->bLedLinkBlinkInProgress = false;
193161 pLed->bLedBlinkInProgress = false;
194162
195163 pLed->CurrLedState = LED_BLINK_SLOWLY;
196164 schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
197165 break;
198166 case LED_CTL_LINK:
199− if (!pLed->bLedLinkBlinkInProgress)
200− return;
201−
202167 if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
203168 return;
204169
205170 cancel_delayed_work(&pLed->blink_work);
206171
207172 pLed->bLedBlinkInProgress = false;
208− pLed->bLedLinkBlinkInProgress = true;
209173
210174 pLed->CurrLedState = LED_BLINK_NORMAL;
211175 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
@@ -222,7 +186,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 10 unmodified lines
222186
223187 cancel_delayed_work(&pLed->blink_work);
224188
225− pLed->bLedLinkBlinkInProgress = false;
226189 pLed->bLedBlinkInProgress = false;
227190 pLed->bLedScanBlinkInProgress = true;
228191
@@ -240,7 +203,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 11 unmodified lines
240203
241204 cancel_delayed_work(&pLed->blink_work);
242205
243− pLed->bLedLinkBlinkInProgress = false;
244206 pLed->bLedBlinkInProgress = true;
245207
246208 pLed->CurrLedState = LED_BLINK_TXRX;
@@ -253,7 +215,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 6 unmodified lines
253215
254216 cancel_delayed_work(&pLed->blink_work);
255217
256− pLed->bLedLinkBlinkInProgress = false;
257218 pLed->bLedBlinkInProgress = false;
258219 pLed->bLedScanBlinkInProgress = false;
259220 pLed->bLedWPSBlinkInProgress = true;
@@ -263,7 +224,6 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 3 unmodified lines
263224 case LED_CTL_STOP_WPS:
264225 cancel_delayed_work(&pLed->blink_work);
265226
266− pLed->bLedLinkBlinkInProgress = false;
267227 pLed->bLedBlinkInProgress = false;
268228 pLed->bLedScanBlinkInProgress = false;
269229 pLed->bLedWPSBlinkInProgress = true;
@@ -283,12 +243,11 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) · 13 unmodified lines
283243 break;
284244 case LED_CTL_POWER_OFF:
285245 pLed->CurrLedState = RTW_LED_OFF;
286− pLed->bLedLinkBlinkInProgress = false;
287246 pLed->bLedBlinkInProgress = false;
288247 pLed->bLedWPSBlinkInProgress = false;
289248 pLed->bLedScanBlinkInProgress = false;
290249 cancel_delayed_work(&pLed->blink_work);
291− SwLedOff(padapter, pLed);
250+ SwLedOff(pLed);
292251 break;
293252 default:
294253 break;
drivers/staging/r8188eu/core/rtw_mlme.c+12−39
@@ -76,19 +76,6 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor · 75 unmodified lines
7676 spin_unlock_bh(&free_queue->lock);
7777 }
7878
79−void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork)
80−{
81− struct __queue *free_queue = &pmlmepriv->free_bss_pool;
82−
83− if (!pnetwork)
84− return;
85− if (pnetwork->fixed)
86− return;
87− list_del_init(&pnetwork->list);
88− list_add_tail(&pnetwork->list, get_list_head(free_queue));
89− pmlmepriv->num_of_scanned--;
90−}
91−
9279 /*
9380 return the wlan_network with the matching addr
9481
@@ -224,7 +211,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) · 129 unmodified lines
224211 u8 *pbuf;
225212 struct wlan_network *pnetwork;
226213 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
227− int res = _SUCCESS;
228214
229215 /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
230216
@@ -245,10 +231,9 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) · 14 unmodified lines
245231
246232 pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network)));
247233
248− if (!pbuf) {
249− res = _FAIL;
250− goto exit;
251− }
234+ if (!pbuf)
235+ return -ENOMEM;
236+
252237 pmlmepriv->free_bss_buf = pbuf;
253238
254239 pnetwork = (struct wlan_network *)pbuf;
@@ -265,9 +250,7 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) · 10 unmodified lines
265250
266251 rtw_init_mlme_timer(padapter);
267252
268−exit:
269−
270− return res;
253+ return 0;
271254 }
272255
273256 void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
@@ -311,9 +294,15 @@ exit: · 37 unmodified lines
311294 static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv,
312295 struct wlan_network *pnetwork)
313296 {
297+ struct __queue *free_queue = &pmlmepriv->free_bss_pool;
314298
315− _rtw_free_network_nolock(pmlmepriv, pnetwork);
316−
299+ if (!pnetwork)
300+ return;
301+ if (pnetwork->fixed)
302+ return;
303+ list_del_init(&pnetwork->list);
304+ list_add_tail(&pnetwork->list, get_list_head(free_queue));
305+ pmlmepriv->num_of_scanned--;
317306 }
318307
319308 void rtw_free_network_queue(struct adapter *dev, u8 isfreeall)
@@ -1823,22 +1812,6 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter) · 1503 unmodified lines
18231812
18241813 pdev_network->Rssi = 0;
18251814
1826− switch (pregistrypriv->wireless_mode) {
1827− case WIRELESS_11B:
1828− pdev_network->NetworkTypeInUse = (Ndis802_11DS);
1829− break;
1830− case WIRELESS_11G:
1831− case WIRELESS_11BG:
1832− case WIRELESS_11_24N:
1833− case WIRELESS_11G_24N:
1834− case WIRELESS_11BG_24N:
1835− pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24);
1836− break;
1837− default:
1838− /* TODO */
1839− break;
1840− }
1841−
18421815 pdev_network->Configuration.DSConfig = (pregistrypriv->channel);
18431816
18441817 if (cur_network->network.InfrastructureMode == Ndis802_11IBSS)
drivers/staging/r8188eu/core/rtw_mlme_ext.c+296−451
@@ -12,24 +12,6 @@ · 11 unmodified lines
1212 #include "../include/rtl8188e_xmit.h"
1313 #include "../include/rtl8188e_dm.h"
1414
15−/* response function for each management frame subtype, do not reorder */
16−static mlme_handler mlme_sta_tbl[] = {
17− OnAssocReq,
18− OnAssocRsp,
19− OnAssocReq,
20− OnAssocRsp,
21− OnProbeReq,
22− OnProbeRsp,
23− NULL,
24− NULL,
25− OnBeacon,
26− NULL,
27− OnDisassoc,
28− OnAuthClient,
29− OnDeAuth,
30− OnAction,
31−};
32−
3315 static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
3416
3517 /**************************************************
@@ -137,7 +119,7 @@ static struct rt_channel_plan_map RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = { · 101 unmodified lines
137119 {0x03}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */
138120 };
139121
140−static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; /* use the conbination for max channel numbers */
122+static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; /* use the combination for max channel numbers */
141123
142124 /*
143125 * Search the @param channel_num in given @param channel_set
@@ -393,47 +375,6 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext) · 249 unmodified lines
393375 }
394376 }
395377
396−void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
397−{
398− int index;
399− mlme_handler fct;
400− struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
401− struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data;
402− struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, hdr->addr2);
403−
404− if (!ieee80211_is_mgmt(hdr->frame_control))
405− return;
406−
407− /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
408− if (memcmp(hdr->addr1, myid(&padapter->eeprompriv), ETH_ALEN) &&
409− !is_broadcast_ether_addr(hdr->addr1))
410− return;
411−
412− index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4;
413− if (index >= ARRAY_SIZE(mlme_sta_tbl))
414− return;
415− fct = mlme_sta_tbl[index];
416−
417− if (psta) {
418− if (ieee80211_has_retry(hdr->frame_control)) {
419− if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum)
420− /* drop the duplicate management frame */
421− return;
422− }
423− psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num;
424− }
425−
426− if (ieee80211_is_auth(hdr->frame_control)) {
427− if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
428− fct = OnAuth;
429− else
430− fct = OnAuthClient;
431− }
432−
433− if (fct)
434− fct(padapter, precv_frame);
435−}
436−
437378 static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da)
438379 {
439380 bool response = true;
@@ -448,21 +389,6 @@ static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) · 8 unmodified lines
448389 return _SUCCESS;
449390 }
450391
451−static void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe)
452−{
453− u8 *pIE;
454− __le32 *pbuf;
455−
456− pIE = pframe + sizeof(struct ieee80211_hdr_3addr);
457− pbuf = (__le32 *)pIE;
458−
459− pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1));
460−
461− pmlmeext->TSFValue = pmlmeext->TSFValue << 32;
462−
463− pmlmeext->TSFValue |= le32_to_cpu(*pbuf);
464−}
465−
466392 static void correct_TSF(struct adapter *padapter)
467393 {
468394 u8 reg;
@@ -506,7 +432,7 @@ Following are the callback functions for each subtype of the management frames · 37 unmodified lines
506432
507433 *****************************************************************************/
508434
509−unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame)
435+static void OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame)
510436 {
511437 unsigned int ielen;
512438 unsigned char *p;
@@ -540,17 +466,17 @@ unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame · 27 unmodified lines
540466 report_survey_event(padapter, precv_frame);
541467 p2p_listen_state_process(padapter, get_sa(pframe));
542468
543− return _SUCCESS;
469+ return;
544470 }
545471 }
546472 }
547473
548474 if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
549− return _SUCCESS;
475+ return;
550476
551477 if (!check_fwstate(pmlmepriv, _FW_LINKED) &&
552478 !check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE))
553− return _SUCCESS;
479+ return;
554480
555481 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ielen,
556482 len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_);
@@ -562,7 +488,7 @@ unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame · 5 unmodified lines
562488
563489 if ((ielen != 0 && memcmp((void *)(p + 2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength)) ||
564490 (ielen == 0 && pmlmeinfo->hidden_ssid_mode))
565− return _SUCCESS;
491+ return;
566492
567493 _issue_probersp:
568494
@@ -571,10 +497,9 @@ _issue_probersp: · 2 unmodified lines
571497 check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)))
572498 issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq);
573499 }
574− return _SUCCESS;
575500 }
576501
577−unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame)
502+static void OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame)
578503 {
579504 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
580505 struct wifidirect_info *pwdinfo = &padapter->wdinfo;
@@ -596,7 +521,7 @@ unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame · 15 unmodified lines
596521 }
597522 }
598523 }
599− return _SUCCESS;
524+ return;
600525 } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
601526 if (pwdinfo->nego_req_info.benable) {
602527 if (!memcmp(pwdinfo->nego_req_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN)) {
@@ -614,14 +539,13 @@ unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame · 11 unmodified lines
614539 }
615540 if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
616541 report_survey_event(padapter, precv_frame);
617− return _SUCCESS;
542+ return;
618543 }
619−
620− return _SUCCESS;
621544 }
622545
623−unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)
546+static void OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)
624547 {
548+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
625549 int cam_idx;
626550 struct sta_info *psta;
627551 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -631,86 +555,86 @@ unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame) · 3 unmodified lines
631555 u8 *pframe = precv_frame->rx_data;
632556 uint len = precv_frame->len;
633557 struct wlan_bssid_ex *pbss;
634− int ret = _SUCCESS;
558+ u8 *ie_ptr;
559+ u32 ie_len;
560+
561+ ie_ptr = (u8 *)&mgmt->u.beacon.variable;
562+ if (precv_frame->len < offsetof(struct ieee80211_mgmt, u.beacon.variable))
563+ return;
564+ ie_len = precv_frame->len - offsetof(struct ieee80211_mgmt, u.beacon.variable);
635565
636566 if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
637567 report_survey_event(padapter, precv_frame);
638− return _SUCCESS;
568+ return;
639569 }
640570
641− if (!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) {
642− if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
643− /* we should update current network before auth, or some IE is wrong */
644− pbss = kmalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
645− if (pbss) {
646− if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) {
647− update_network(&pmlmepriv->cur_network.network, pbss, padapter, true);
648− rtw_get_bcn_info(&pmlmepriv->cur_network);
649− }
650− kfree(pbss);
651− }
571+ if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))
572+ return;
652573
653− /* check the vendor of the assoc AP */
654− pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr));
574+ if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
575+ /* we should update current network before auth, or some IE is wrong */
576+ pbss = kmalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
577+ if (!pbss)
578+ return;
655579
656− /* update TSF Value */
657− update_TSF(pmlmeext, pframe);
580+ if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) {
581+ update_network(&pmlmepriv->cur_network.network, pbss, padapter, true);
582+ rtw_get_bcn_info(&pmlmepriv->cur_network);
583+ }
584+ kfree(pbss);
658585
659− /* start auth */
660− start_clnt_auth(padapter);
586+ /* check the vendor of the assoc AP */
587+ pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr));
661588
662− return _SUCCESS;
589+ pmlmeext->TSFValue = le64_to_cpu(mgmt->u.beacon.timestamp);
590+
591+ /* start auth */
592+ start_clnt_auth(padapter);
593+
594+ return;
595+ }
596+
597+ if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
598+ psta = rtw_get_stainfo(pstapriv, mgmt->sa);
599+ if (!psta)
600+ return;
601+
602+ if (rtw_check_bcn_info(padapter, pframe, len) != _SUCCESS) {
603+ receive_disconnect(padapter, pmlmeinfo->network.MacAddress, 0);
604+ return;
663605 }
606+ /* update WMM, ERP in the beacon */
607+ /* todo: the timer is used instead of the number of the beacon received */
608+ if ((sta_rx_pkts(psta) & 0xf) == 0)
609+ update_beacon_info(padapter, ie_ptr, ie_len, psta);
610+ process_p2p_ps_ie(padapter, ie_ptr, ie_len);
611+ } else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
612+ psta = rtw_get_stainfo(pstapriv, mgmt->sa);
613+ if (psta) {
614+ /* update WMM, ERP in the beacon */
615+ /* todo: the timer is used instead of the number of the beacon received */
616+ if ((sta_rx_pkts(psta) & 0xf) == 0)
617+ update_beacon_info(padapter, ie_ptr, ie_len, psta);
618+ } else {
619+ /* allocate a new CAM entry for IBSS station */
620+ cam_idx = allocate_fw_sta_entry(padapter);
621+ if (cam_idx == NUM_STA)
622+ return;
664623
665− if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
666− psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
667− if (psta) {
668− ret = rtw_check_bcn_info(padapter, pframe, len);
669− if (!ret) {
670− receive_disconnect(padapter,
671− pmlmeinfo->network.MacAddress, 0);
672− return _SUCCESS;
673− }
674− /* update WMM, ERP in the beacon */
675− /* todo: the timer is used instead of the number of the beacon received */
676− if ((sta_rx_pkts(psta) & 0xf) == 0)
677− update_beacon_info(padapter, pframe, len, psta);
678− process_p2p_ps_ie(padapter, (pframe + WLAN_HDR_A3_LEN), (len - WLAN_HDR_A3_LEN));
624+ /* get supported rate */
625+ if (update_sta_support_rate(padapter, ie_ptr, ie_len, cam_idx) == _FAIL) {
626+ pmlmeinfo->FW_sta_info[cam_idx].status = 0;
627+ return;
679628 }
680− } else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
681− psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
682− if (psta) {
683− /* update WMM, ERP in the beacon */
684− /* todo: the timer is used instead of the number of the beacon received */
685− if ((sta_rx_pkts(psta) & 0xf) == 0)
686− update_beacon_info(padapter, pframe, len, psta);
687− } else {
688− /* allocate a new CAM entry for IBSS station */
689− cam_idx = allocate_fw_sta_entry(padapter);
690− if (cam_idx == NUM_STA)
691− goto _END_ONBEACON_;
692−
693− /* get supported rate */
694− if (update_sta_support_rate(padapter, (pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_), (len - WLAN_HDR_A3_LEN - _BEACON_IE_OFFSET_), cam_idx) == _FAIL) {
695− pmlmeinfo->FW_sta_info[cam_idx].status = 0;
696− goto _END_ONBEACON_;
697− }
698629
699− /* update TSF Value */
700− update_TSF(pmlmeext, pframe);
630+ pmlmeext->TSFValue = le64_to_cpu(mgmt->u.beacon.timestamp);
701631
702− /* report sta add event */
703− report_add_sta_event(padapter, GetAddr2Ptr(pframe), cam_idx);
704− }
632+ report_add_sta_event(padapter, mgmt->sa, cam_idx);
705633 }
706634 }
707−
708−_END_ONBEACON_:
709−
710− return _SUCCESS;
711635 }
712636
713−unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
637+static void OnAuth(struct adapter *padapter, struct recv_frame *precv_frame)
714638 {
715639 unsigned int auth_mode, ie_len;
716640 u16 seq;
@@ -727,7 +651,7 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) · 10 unmodified lines
727651 uint len = precv_frame->len;
728652
729653 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
730− return _FAIL;
654+ return;
731655
732656 sa = GetAddr2Ptr(pframe);
733657
@@ -843,7 +767,7 @@ unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) · 109 unmodified lines
843767 if (pstat->state & WIFI_FW_AUTH_SUCCESS)
844768 pstat->auth_seq = 0;
845769
846− return _SUCCESS;
770+ return;
847771
848772 auth_fail:
849773
@@ -856,27 +780,26 @@ auth_fail: · 6 unmodified lines
856780 memcpy(pstat->hwaddr, sa, 6);
857781
858782 issue_auth(padapter, pstat, (unsigned short)status);
859− return _FAIL;
860783 }
861784
862−unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame)
785+static void OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame)
863786 {
864787 unsigned int seq, len, status, offset;
865788 unsigned char *p;
866− unsigned int go2asoc = 0;
867789 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
868790 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
791+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data;
869792 u8 *pframe = precv_frame->rx_data;
870793 uint pkt_len = precv_frame->len;
871794
872795 /* check A1 matches or not */
873− if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN))
874− return _SUCCESS;
796+ if (memcmp(myid(&padapter->eeprompriv), ieee80211_get_DA(hdr), ETH_ALEN))
797+ return;
875798
876799 if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE))
877− return _SUCCESS;
800+ return;
878801
879− offset = (GetPrivacy(pframe)) ? 4 : 0;
802+ offset = ieee80211_has_protected(hdr->frame_control) ? 4 : 0;
880803
881804 seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 2));
882805 status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4));
@@ -890,7 +813,7 @@ unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fra · 7 unmodified lines
890813 }
891814
892815 set_link_timer(pmlmeext, 1);
893− goto authclnt_fail;
816+ return;
894817 }
895818
896819 if (seq == 2) {
@@ -900,34 +823,22 @@ unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fra · 3 unmodified lines
900823 pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_);
901824
902825 if (!p)
903− goto authclnt_fail;
826+ return;
904827
905828 memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len);
906829 pmlmeinfo->auth_seq = 3;
907830 issue_auth(padapter, NULL, 0);
908831 set_link_timer(pmlmeext, REAUTH_TO);
909832
910− return _SUCCESS;
833+ return;
911834 } else {
912835 /* open system */
913− go2asoc = 1;
836+ start_clnt_assoc(padapter);
914837 }
915838 } else if (seq == 4) {
916839 if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)
917− go2asoc = 1;
918− else
919− goto authclnt_fail;
920− } else {
921− /* this is also illegal */
922− goto authclnt_fail;
840+ start_clnt_assoc(padapter);
923841 }
924−
925− if (go2asoc) {
926− start_clnt_assoc(padapter);
927− return _SUCCESS;
928− }
929−authclnt_fail:
930− return _FAIL;
931842 }
932843
933844 static void UpdateBrateTbl(u8 *mbrate)
@@ -970,7 +881,7 @@ static void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen) · 36 unmodified lines
970881 }
971882 }
972883
973−unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame)
884+static void OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame)
974885 {
975886 u16 capab_info;
976887 struct rtw_ieee802_11_elems elems;
@@ -996,7 +907,7 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame · 19 unmodified lines
996907 u32 p2pielen = 0;
997908
998909 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
999− return _FAIL;
910+ return;
1000911
1001912 frame_type = GetFrameSubType(pframe);
1002913 if (frame_type == WIFI_ASSOCREQ)
@@ -1005,7 +916,7 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame · 2 unmodified lines
1005916 ie_offset = _REASOCREQ_IE_OFFSET_;
1006917
1007918 if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset)
1008− return _FAIL;
919+ return;
1009920
1010921 pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
1011922 if (pstat == (struct sta_info *)NULL) {
@@ -1359,13 +1270,13 @@ unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame · 347 unmodified lines
13591270 report_add_sta_event(padapter, pstat->hwaddr, pstat->aid);
13601271 }
13611272
1362− return _SUCCESS;
1273+ return;
13631274
13641275 asoc_class2_error:
13651276
13661277 issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status);
13671278
1368− return _FAIL;
1279+ return;
13691280
13701281 OnAssocReqFail:
13711282
@@ -1375,10 +1286,10 @@ OnAssocReqFail: · 3 unmodified lines
13751286 else
13761287 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP);
13771288
1378− return _FAIL;
1289+ return;
13791290 }
13801291
1381−unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame)
1292+static void OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame)
13821293 {
13831294 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
13841295 uint i;
@@ -1392,13 +1303,13 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame · 7 unmodified lines
13921303
13931304 /* check A1 matches or not */
13941305 if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))
1395− return _SUCCESS;
1306+ return;
13961307
13971308 if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE)))
1398− return _SUCCESS;
1309+ return;
13991310
14001311 if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)
1401− return _SUCCESS;
1312+ return;
14021313
14031314 _cancel_timer_ex(&pmlmeext->link_timer);
14041315
@@ -1451,163 +1362,143 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame · 46 unmodified lines
14511362
14521363 report_assoc_result:
14531364 report_join_res(padapter, res);
1454−
1455− return _SUCCESS;
14561365 }
14571366
1458−unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
1367+static void OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
14591368 {
1369+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
14601370 unsigned short reason;
14611371 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
14621372 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
14631373 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
1464− u8 *pframe = precv_frame->rx_data;
14651374 struct wifidirect_info *pwdinfo = &padapter->wdinfo;
14661375
1467− /* check A3 */
1468− if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)))
1469− return _SUCCESS;
1376+ if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))
1377+ return;
14701378
14711379 if (pwdinfo->rx_invitereq_info.scan_op_ch_only) {
14721380 _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey);
14731381 _set_timer(&pwdinfo->reset_ch_sitesurvey, 10);
14741382 }
14751383
1476− reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN));
1384+ reason = le16_to_cpu(mgmt->u.disassoc.reason_code);
14771385
14781386 if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
14791387 struct sta_info *psta;
14801388 struct sta_priv *pstapriv = &padapter->stapriv;
1389+ u8 updated = 0;
14811390
1482− psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
1483− if (psta) {
1484− u8 updated = 0;
1485−
1486− spin_lock_bh(&pstapriv->asoc_list_lock);
1487− if (!list_empty(&psta->asoc_list)) {
1488− list_del_init(&psta->asoc_list);
1489− pstapriv->asoc_list_cnt--;
1490− updated = ap_free_sta(padapter, psta, false, reason);
1491− }
1492− spin_unlock_bh(&pstapriv->asoc_list_lock);
1391+ psta = rtw_get_stainfo(pstapriv, mgmt->sa);
1392+ if (!psta)
1393+ return;
14931394
1494− associated_clients_update(padapter, updated);
1395+ spin_lock_bh(&pstapriv->asoc_list_lock);
1396+ if (!list_empty(&psta->asoc_list)) {
1397+ list_del_init(&psta->asoc_list);
1398+ pstapriv->asoc_list_cnt--;
1399+ updated = ap_free_sta(padapter, psta, false, reason);
14951400 }
1401+ spin_unlock_bh(&pstapriv->asoc_list_lock);
14961402
1497− return _SUCCESS;
1403+ associated_clients_update(padapter, updated);
14981404 } else {
1499− int ignore_received_deauth = 0;
1405+ bool ignore_received_deauth = false;
15001406
15011407 /* Before sending the auth frame to start the STA/GC mode connection with AP/GO,
15021408 * we will send the deauth first.
15031409 * However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth.
15041410 * Added the following code to avoid this case.
15051411 */
1506− if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
1507− (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
1412+ if (pmlmeinfo->state & (WIFI_FW_AUTH_STATE | WIFI_FW_ASSOC_STATE)) {
15081413 if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) {
1509− ignore_received_deauth = 1;
1414+ ignore_received_deauth = true;
15101415 } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) {
15111416 // TODO: 802.11r
1512− ignore_received_deauth = 1;
1417+ ignore_received_deauth = true;
15131418 }
15141419 }
15151420
15161421 if (!ignore_received_deauth)
1517− receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
1422+ receive_disconnect(padapter, mgmt->bssid, reason);
1423+
1424+ pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
15181425 }
1519− pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
1520− return _SUCCESS;
15211426 }
15221427
1523−unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame)
1428+static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame)
15241429 {
1430+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
15251431 u16 reason;
15261432 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
15271433 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
15281434 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
1529− u8 *pframe = precv_frame->rx_data;
15301435 struct wifidirect_info *pwdinfo = &padapter->wdinfo;
1436+ struct sta_info *psta;
1437+ struct sta_priv *pstapriv = &padapter->stapriv;
1438+ u8 updated = 0;
15311439
1532− /* check A3 */
1533− if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)))
1534− return _SUCCESS;
1440+ if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))
1441+ return;
15351442
15361443 if (pwdinfo->rx_invitereq_info.scan_op_ch_only) {
15371444 _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey);
15381445 _set_timer(&pwdinfo->reset_ch_sitesurvey, 10);
15391446 }
15401447
1541− reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN));
1542−
1543− if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
1544− struct sta_info *psta;
1545− struct sta_priv *pstapriv = &padapter->stapriv;
1546−
1547− psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
1548− if (psta) {
1549− u8 updated = 0;
1448+ reason = le16_to_cpu(mgmt->u.disassoc.reason_code);
15501449
1551− spin_lock_bh(&pstapriv->asoc_list_lock);
1552− if (!list_empty(&psta->asoc_list)) {
1553− list_del_init(&psta->asoc_list);
1554− pstapriv->asoc_list_cnt--;
1555− updated = ap_free_sta(padapter, psta, false, reason);
1556− }
1557− spin_unlock_bh(&pstapriv->asoc_list_lock);
1450+ if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
1451+ receive_disconnect(padapter, mgmt->bssid, reason);
1452+ pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
1453+ return;
1454+ }
15581455
1559− associated_clients_update(padapter, updated);
1560− }
1456+ psta = rtw_get_stainfo(pstapriv, mgmt->sa);
1457+ if (!psta)
1458+ return;
15611459
1562− return _SUCCESS;
1563− } else {
1564− receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
1460+ spin_lock_bh(&pstapriv->asoc_list_lock);
1461+ if (!list_empty(&psta->asoc_list)) {
1462+ list_del_init(&psta->asoc_list);
1463+ pstapriv->asoc_list_cnt--;
1464+ updated = ap_free_sta(padapter, psta, false, reason);
15651465 }
1566− pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
1567− return _SUCCESS;
1466+ spin_unlock_bh(&pstapriv->asoc_list_lock);
1467+
1468+ associated_clients_update(padapter, updated);
15681469 }
15691470
1570−unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame)
1471+static void OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame)
15711472 {
15721473 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
15731474 struct sta_info *psta = NULL;
15741475 struct recv_reorder_ctrl *preorder_ctrl;
1575− unsigned char *frame_body;
15761476 unsigned short tid;
15771477 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
15781478 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
1579− u8 *pframe = precv_frame->rx_data;
15801479 struct sta_priv *pstapriv = &padapter->stapriv;
1581− /* check RA matches or not */
1582− if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */
1583− return _SUCCESS;
15841480
15851481 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
15861482 if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
1587− return _SUCCESS;
1483+ return;
15881484
15891485 psta = rtw_get_stainfo(pstapriv, mgmt->sa);
1590−
15911486 if (!psta)
1592− return _SUCCESS;
1593−
1594− frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
1487+ return;
15951488
15961489 if (!pmlmeinfo->HT_enable)
1597− return _SUCCESS;
1490+ return;
15981491 /* All union members start with an action code, it's ok to use addba_req. */
15991492 switch (mgmt->u.action.u.addba_req.action_code) {
16001493 case WLAN_ACTION_ADDBA_REQ:
1601− memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request));
16021494 tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_req.capab),
16031495 IEEE80211_ADDBA_PARAM_TID_MASK);
16041496 preorder_ctrl = &psta->recvreorder_ctrl[tid];
16051497 preorder_ctrl->indicate_seq = 0xffff;
16061498 preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq;
1607−
16081499 issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP,
16091500 pmlmeinfo->bAcceptAddbaReq ?
1610− WLAN_STATUS_SUCCESS : WLAN_STATUS_REQUEST_DECLINED);
1501+ WLAN_STATUS_SUCCESS : WLAN_STATUS_REQUEST_DECLINED, mgmt);
16111502 break;
16121503 case WLAN_ACTION_ADDBA_RESP:
16131504 tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_resp.capab),
@@ -1636,8 +1527,6 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr · 22 unmodified lines
16361527 default:
16371528 break;
16381529 }
1639−
1640− return _SUCCESS;
16411530 }
16421531
16431532 static int get_reg_classes_full_count(struct p2p_channels *channel_list)
@@ -1754,7 +1643,7 @@ void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr) · 110 unmodified lines
17541643 p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */
17551644
17561645 /* Commented by Albert 20110306 */
1757− /* According to the P2P Specification, the group negoitation request frame should contain 9 P2P attributes */
1646+ /* According to the P2P Specification, the group negotiation request frame should contain 9 P2P attributes */
17581647 /* 1. P2P Capability */
17591648 /* 2. Group Owner Intent */
17601649 /* 3. Configuration Timeout */
@@ -2109,7 +1998,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8 *raddr, u8 *frame · 348 unmodified lines
21091998 p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */
21101999
21112000 /* Commented by Albert 20100908 */
2112− /* According to the P2P Specification, the group negoitation response frame should contain 9 P2P attributes */
2001+ /* According to the P2P Specification, the group negotiation response frame should contain 9 P2P attributes */
21132002 /* 1. Status */
21142003 /* 2. P2P Capability */
21152004 /* 3. Group Owner Intent */
@@ -2405,7 +2294,7 @@ static void issue_p2p_GO_confirm(struct adapter *padapter, u8 *raddr, u8 result) · 289 unmodified lines
24052294 p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */
24062295
24072296 /* Commented by Albert 20110306 */
2408− /* According to the P2P Specification, the group negoitation request frame should contain 5 P2P attributes */
2297+ /* According to the P2P Specification, the group negotiation request frame should contain 5 P2P attributes */
24092298 /* 1. Status */
24102299 /* 2. P2P Capability */
24112300 /* 3. Operating Channel */
@@ -3294,9 +3183,8 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da) · 882 unmodified lines
32943183 dump_mgntframe(padapter, pmgntframe);
32953184 }
32963185
3297−static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack)
3186+inline void issue_probereq_p2p(struct adapter *padapter)
32983187 {
3299− int ret = _FAIL;
33003188 struct xmit_frame *pmgntframe;
33013189 struct pkt_attrib *pattrib;
33023190 unsigned char *pframe;
@@ -3312,7 +3200,7 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) · 9 unmodified lines
33123200
33133201 pmgntframe = alloc_mgtxmitframe(pxmitpriv);
33143202 if (!pmgntframe)
3315− goto exit;
3203+ return;
33163204
33173205 /* update attribute */
33183206 pattrib = &pmgntframe->attrib;
@@ -3328,20 +3216,16 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) · 9 unmodified lines
33283216 fctrl = &pwlanhdr->frame_control;
33293217 *(fctrl) = 0;
33303218
3331− if (da) {
3332− memcpy(pwlanhdr->addr1, da, ETH_ALEN);
3333− memcpy(pwlanhdr->addr3, da, ETH_ALEN);
3219+ if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) {
3220+ /* This two flags will be set when this is only the P2P client mode. */
3221+ memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN);
3222+ memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN);
33343223 } else {
3335− if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) {
3336− /* This two flags will be set when this is only the P2P client mode. */
3337− memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN);
3338− memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN);
3339− } else {
3340− /* broadcast probe request frame */
3341− eth_broadcast_addr(pwlanhdr->addr1);
3342− eth_broadcast_addr(pwlanhdr->addr3);
3343− }
3224+ /* broadcast probe request frame */
3225+ eth_broadcast_addr(pwlanhdr->addr1);
3226+ eth_broadcast_addr(pwlanhdr->addr3);
33443227 }
3228+
33453229 memcpy(pwlanhdr->addr2, mac, ETH_ALEN);
33463230
33473231 SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
@@ -3567,23 +3451,10 @@ static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) · 219 unmodified lines
35673451
35683452 pattrib->last_txcmdsz = pattrib->pktlen;
35693453
3570− if (wait_ack) {
3571− ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe);
3572− } else {
3573− dump_mgntframe(padapter, pmgntframe);
3574− ret = _SUCCESS;
3575− }
3576−
3577−exit:
3578− return ret;
3579−}
3580−
3581−inline void issue_probereq_p2p(struct adapter *adapter, u8 *da)
3582−{
3583− _issue_probereq_p2p(adapter, da, false);
3454+ dump_mgntframe(padapter, pmgntframe);
35843455 }
35853456
3586−static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token)
3457+static s32 rtw_action_public_decache(struct recv_frame *recv_frame, u8 token)
35873458 {
35883459 struct adapter *adapter = recv_frame->adapter;
35893460 struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv;
@@ -3592,21 +3463,13 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) · 2 unmodified lines
35923463 (recv_frame->attrib.frag_num & 0xf);
35933464
35943465 if (GetRetry(frame)) {
3595− if (token >= 0) {
3596− if ((seq_ctrl == mlmeext->action_public_rxseq) &&
3597− (token == mlmeext->action_public_dialog_token))
3598− return _FAIL;
3599− } else {
3600− if (seq_ctrl == mlmeext->action_public_rxseq)
3601− return _FAIL;
3602− }
3466+ if ((seq_ctrl == mlmeext->action_public_rxseq) &&
3467+ (token == mlmeext->action_public_dialog_token))
3468+ return _FAIL;
36033469 }
36043470
36053471 mlmeext->action_public_rxseq = seq_ctrl;
3606−
3607− if (token >= 0)
3608− mlmeext->action_public_dialog_token = token;
3609−
3472+ mlmeext->action_public_dialog_token = token;
36103473 return _SUCCESS;
36113474 }
36123475
@@ -3872,110 +3735,64 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) · 259 unmodified lines
38723735 return _SUCCESS;
38733736 }
38743737
3875−static unsigned int on_action_public_vendor(struct recv_frame *precv_frame)
3738+static void on_action_public_vendor(struct recv_frame *precv_frame)
38763739 {
3877− unsigned int ret = _FAIL;
38783740 u8 *pframe = precv_frame->rx_data;
38793741 u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
38803742
3881− if (!memcmp(frame_body + 2, P2P_OUI, 4)) {
3882− ret = on_action_public_p2p(precv_frame);
3883− }
3884−
3885− return ret;
3743+ if (!memcmp(frame_body + 2, P2P_OUI, 4))
3744+ on_action_public_p2p(precv_frame);
38863745 }
38873746
3888−static unsigned int on_action_public_default(struct recv_frame *precv_frame)
3747+static void on_action_public_default(struct recv_frame *precv_frame)
38893748 {
3890− unsigned int ret = _FAIL;
38913749 u8 *pframe = precv_frame->rx_data;
38923750 u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
38933751 u8 token;
38943752
38953753 token = frame_body[2];
38963754
3897− if (rtw_action_public_decache(precv_frame, token) == _FAIL)
3898− goto exit;
3899−
3900− ret = _SUCCESS;
3901−
3902−exit:
3903− return ret;
3755+ rtw_action_public_decache(precv_frame, token);
39043756 }
39053757
3906−unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv_frame)
3758+static void on_action_public(struct adapter *padapter, struct recv_frame *precv_frame)
39073759 {
3908− unsigned int ret = _FAIL;
3909− u8 *pframe = precv_frame->rx_data;
3910− u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr);
3911− u8 category, action;
3912−
3913− /* check RA matches or not */
3914− if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))
3915− goto exit;
3916−
3917− category = frame_body[0];
3918− if (category != WLAN_CATEGORY_PUBLIC)
3919− goto exit;
3920−
3921− action = frame_body[1];
3922− switch (action) {
3923− case ACT_PUBLIC_VENDOR:
3924− ret = on_action_public_vendor(precv_frame);
3925− break;
3926− default:
3927− ret = on_action_public_default(precv_frame);
3928− break;
3929− }
3760+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
39303761
3931−exit:
3932− return ret;
3762+ /* All members of the action enum start with action_code. */
3763+ if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC)
3764+ on_action_public_vendor(precv_frame);
3765+ else
3766+ on_action_public_default(precv_frame);
39333767 }
39343768
3935−unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame)
3769+static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame)
39363770 {
39373771 u8 *frame_body;
3938− u8 category, OUI_Subtype;
3772+ u8 OUI_Subtype;
39393773 u8 *pframe = precv_frame->rx_data;
39403774 uint len = precv_frame->len;
39413775 struct wifidirect_info *pwdinfo = &padapter->wdinfo;
39423776
3943− /* check RA matches or not */
3944− if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */
3945− return _SUCCESS;
3946−
39473777 frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));
39483778
3949− category = frame_body[0];
3950− if (category != RTW_WLAN_CATEGORY_P2P)
3951− return _SUCCESS;
3952−
39533779 if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI)
3954− return _SUCCESS;
3780+ return;
39553781
39563782 len -= sizeof(struct ieee80211_hdr_3addr);
39573783 OUI_Subtype = frame_body[5];
39583784
3959− switch (OUI_Subtype) {
3960− case P2P_NOTICE_OF_ABSENCE:
3961− break;
3962− case P2P_PRESENCE_REQUEST:
3785+ if (OUI_Subtype == P2P_PRESENCE_REQUEST)
39633786 process_p2p_presence_req(pwdinfo, pframe, len);
3964− break;
3965− case P2P_PRESENCE_RESPONSE:
3966− break;
3967− case P2P_GO_DISC_REQUEST:
3968− break;
3969− default:
3970− break;
3971− }
3972− return _SUCCESS;
39733787 }
39743788
3975−unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame)
3789+static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame)
39763790 {
39773791 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
39783792
3793+ if (!ether_addr_equal(myid(&padapter->eeprompriv), mgmt->da))
3794+ return;
3795+
39793796 switch (mgmt->u.action.category) {
39803797 case WLAN_CATEGORY_BACK:
39813798 OnAction_back(padapter, precv_frame);
@@ -3987,7 +3804,6 @@ unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame) · 5 unmodified lines
39873804 OnAction_p2p(padapter, precv_frame);
39883805 break;
39893806 }
3990− return _SUCCESS;
39913807 }
39923808
39933809 struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv)
@@ -4011,9 +3827,66 @@ struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv) · 17 unmodified lines
40113827 return pmgntframe;
40123828 }
40133829
3830+void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame)
3831+{
3832+ mlme_handler mlme_sta_tbl[] = {
3833+ OnAssocReq,
3834+ OnAssocRsp,
3835+ OnAssocReq,
3836+ OnAssocRsp,
3837+ OnProbeReq,
3838+ OnProbeRsp,
3839+ NULL,
3840+ NULL,
3841+ OnBeacon,
3842+ NULL,
3843+ OnDisassoc,
3844+ OnAuthClient,
3845+ OnDeAuth,
3846+ OnAction,
3847+ };
3848+ int index;
3849+ mlme_handler fct;
3850+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
3851+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data;
3852+ struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, hdr->addr2);
3853+
3854+ if (!ieee80211_is_mgmt(hdr->frame_control))
3855+ return;
3856+
3857+ /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
3858+ if (memcmp(hdr->addr1, myid(&padapter->eeprompriv), ETH_ALEN) &&
3859+ !is_broadcast_ether_addr(hdr->addr1))
3860+ return;
3861+
3862+ index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4;
3863+ if (index >= ARRAY_SIZE(mlme_sta_tbl))
3864+ return;
3865+ fct = mlme_sta_tbl[index];
3866+
3867+ if (psta) {
3868+ if (ieee80211_has_retry(hdr->frame_control)) {
3869+ if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum)
3870+ /* drop the duplicate management frame */
3871+ return;
3872+ }
3873+ psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num;
3874+ }
3875+
3876+ if (ieee80211_is_auth(hdr->frame_control)) {
3877+ if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
3878+ fct = OnAuth;
3879+ else
3880+ fct = OnAuthClient;
3881+ }
3882+
3883+ if (fct)
3884+ fct(padapter, precv_frame);
3885+}
3886+
40143887 /****************************************************************************
40153888
4016−Following are some TX fuctions for WiFi MLME
3889+Following are some TX functions for WiFi MLME
40173890
40183891 *****************************************************************************/
40193892
@@ -4059,9 +3932,6 @@ void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattri · 39 unmodified lines
40593932
40603933 void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe)
40613934 {
4062− if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
4063− return;
4064−
40653935 rtl8188eu_mgnt_xmit(padapter, pmgntframe);
40663936 }
40673937
@@ -4091,9 +3961,6 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg · 23 unmodified lines
40913961 u32 timeout_ms = 500;/* 500ms */
40923962 struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
40933963
4094− if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
4095− return -1;
4096−
40973964 mutex_lock(&pxmitpriv->ack_tx_mutex);
40983965 pxmitpriv->ack_tx = true;
40993966
@@ -4588,34 +4455,19 @@ inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps · 488 unmodified lines
45884455 _issue_probereq(padapter, pssid, da, false);
45894456 }
45904457
4591−int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da,
4592− int try_cnt, int wait_ms)
4458+void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da)
45934459 {
4594− int ret;
4595− int i = 0;
4596−
4597− do {
4598− ret = _issue_probereq(padapter, pssid, da, wait_ms > 0);
4599−
4600− i++;
4460+ int i;
46014461
4602− if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
4462+ for (i = 0; i < 3; i++) {
4463+ if (_issue_probereq(padapter, pssid, da, true) == _FAIL)
4464+ msleep(1);
4465+ else
46034466 break;
4604−
4605− if (i < try_cnt && wait_ms > 0 && ret == _FAIL)
4606− msleep(wait_ms);
4607−
4608− } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0)));
4609−
4610− if (ret != _FAIL) {
4611− ret = _SUCCESS;
4612− goto exit;
46134467 }
4614−exit:
4615− return ret;
46164468 }
46174469
4618−/* if psta == NULL, indiate we are station(client) now... */
4470+/* if psta == NULL, indicate we are station (client) now... */
46194471 void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status)
46204472 {
46214473 struct xmit_frame *pmgntframe;
@@ -5014,7 +4866,7 @@ void issue_assocreq(struct adapter *padapter) · 392 unmodified lines
50144866 if (!padapter->registrypriv.wifi_spec) {
50154867 /* Commented by Kurt 20110629 */
50164868 /* In some older APs, WPS handshake */
5017− /* would be fail if we append vender extensions informations to AP */
4869+ /* would be fail if we append vendor extension information to AP */
50184870 if (!memcmp(pIE->data, WPS_OUI, 4))
50194871 pIE->Length = 14;
50204872 }
@@ -5169,7 +5021,7 @@ exit: · 148 unmodified lines
51695021 kfree(pmlmepriv->assoc_req);
51705022 }
51715023
5172−/* when wait_ack is ture, this function shoule be called at process context */
5024+/* when wait_ack is true, this function should be called at process context */
51735025 static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack)
51745026 {
51755027 int ret = _FAIL;
@@ -5238,7 +5090,7 @@ exit: · 62 unmodified lines
52385090 return ret;
52395091 }
52405092
5241−/* when wait_ms > 0 , this function shoule be called at process context */
5093+/* when wait_ms > 0, this function should be called at process context */
52425094 /* da == NULL for station mode */
52435095 int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms)
52445096 {
@@ -5247,7 +5099,7 @@ int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int pow · 2 unmodified lines
52475099 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
52485100 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
52495101
5250− /* da == NULL, assum it's null data for sta to ap*/
5102+ /* da == NULL, assume it's null data for sta to ap*/
52515103 if (!da)
52525104 da = get_my_bssid(&pmlmeinfo->network);
52535105
@@ -5271,7 +5123,7 @@ exit: · 17 unmodified lines
52715123 return ret;
52725124 }
52735125
5274−/* when wait_ack is ture, this function shoule be called at process context */
5126+/* when wait_ack is true, this function should be called at process context */
52755127 static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack)
52765128 {
52775129 int ret = _FAIL;
@@ -5344,7 +5196,7 @@ exit: · 66 unmodified lines
53445196 return ret;
53455197 }
53465198
5347−/* when wait_ms > 0 , this function shoule be called at process context */
5199+/* when wait_ms > 0 , this function should be called at process context */
53485200 /* da == NULL for station mode */
53495201 int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms)
53505202 {
@@ -5353,7 +5205,7 @@ int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int · 2 unmodified lines
53535205 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
53545206 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
53555207
5356− /* da == NULL, assum it's null data for sta to ap*/
5208+ /* da == NULL, assume it's null data for sta to ap*/
53575209 if (!da)
53585210 da = get_my_bssid(&pmlmeinfo->network);
53595211
@@ -5471,7 +5323,8 @@ exit: · 111 unmodified lines
54715323 return ret;
54725324 }
54735325
5474−void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, u16 status)
5326+void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action,
5327+ u16 status, struct ieee80211_mgmt *mgmt_req)
54755328 {
54765329 u16 start_seq;
54775330 u16 BA_starting_seqctrl = 0;
@@ -5540,13 +5393,13 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, · 62 unmodified lines
55405393 break;
55415394 case WLAN_ACTION_ADDBA_RESP:
55425395 mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP;
5543− mgmt->u.action.u.addba_resp.dialog_token = pmlmeinfo->ADDBA_req.dialog_token;
5396+ mgmt->u.action.u.addba_resp.dialog_token = mgmt_req->u.action.u.addba_req.dialog_token;
55445397 mgmt->u.action.u.addba_resp.status = cpu_to_le16(status);
5545− capab = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f;
5398+ capab = le16_to_cpu(mgmt_req->u.action.u.addba_req.capab) & 0x3f;
55465399 capab |= u16_encode_bits(64, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK);
55475400 capab |= u16_encode_bits(pregpriv->ampdu_amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK);
55485401 mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab);
5549− mgmt->u.action.u.addba_resp.timeout = pmlmeinfo->ADDBA_req.BA_timeout_value;
5402+ mgmt->u.action.u.addba_resp.timeout = mgmt_req->u.action.u.addba_req.timeout;
55505403 pattrib->pktlen = offsetofend(struct ieee80211_mgmt, u.action.u.addba_resp.timeout);
55515404 break;
55525405 case WLAN_ACTION_DELBA:
@@ -5714,7 +5567,8 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) · 161 unmodified lines
57145567 if (initiator == 0) { /* recipient */
57155568 for (tid = 0; tid < MAXTID; tid++) {
57165569 if (psta->recvreorder_ctrl[tid].enable) {
5717− issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
5570+ issue_action_BA(padapter, addr, WLAN_ACTION_DELBA,
5571+ (((tid << 1) | initiator) & 0x1F), NULL);
57185572 psta->recvreorder_ctrl[tid].enable = false;
57195573 psta->recvreorder_ctrl[tid].indicate_seq = 0xffff;
57205574 }
@@ -5722,7 +5576,8 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr) · 1 unmodified line
57225576 } else if (initiator == 1) { /* originator */
57235577 for (tid = 0; tid < MAXTID; tid++) {
57245578 if (psta->htpriv.agg_enable_bitmap & BIT(tid)) {
5725− issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
5579+ issue_action_BA(padapter, addr, WLAN_ACTION_DELBA,
5580+ (((tid << 1) | initiator) & 0x1F), NULL);
57265581 psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
57275582 psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
57285583 }
@@ -5885,7 +5740,7 @@ static void rtw_set_opmode(struct adapter *adapter, u8 mode) · 156 unmodified lines
58855740
58865741 /****************************************************************************
58875742
5888−Following are some utitity fuctions for WiFi MLME
5743+Following are some utility functions for WiFi MLME
58895744
58905745 *****************************************************************************/
58915746
@@ -5937,7 +5792,7 @@ void rtw_mlme_site_survey_done(struct adapter *adapter) · 45 unmodified lines
59375792 int res;
59385793 u8 reg;
59395794
5940− if ((is_client_associated_to_ap(adapter)) ||
5795+ if ((r8188eu_is_client_associated_to_ap(adapter)) ||
59415796 ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) {
59425797 /* enable to rx data frame */
59435798 rtw_write16(adapter, REG_RXFLTMAP2, 0xFFFF);
@@ -6008,9 +5863,9 @@ void site_survey(struct adapter *padapter) · 64 unmodified lines
60085863 if (ScanType == SCAN_ACTIVE) { /* obey the channel plan setting... */
60095864 if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) ||
60105865 rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) {
6011− issue_probereq_p2p(padapter, NULL);
6012− issue_probereq_p2p(padapter, NULL);
6013− issue_probereq_p2p(padapter, NULL);
5866+ issue_probereq_p2p(padapter);
5867+ issue_probereq_p2p(padapter);
5868+ issue_probereq_p2p(padapter);
60145869 } else {
60155870 int i;
60165871 for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) {
@@ -6058,7 +5913,7 @@ void site_survey(struct adapter *padapter) · 41 unmodified lines
60585913 } else {
60595914 /* 20100721:Interrupt scan operation here. */
60605915 /* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */
6061− /* It compares the scan result and select beter one to do connection. */
5916+ /* It compares the scan result and selects a better one to do connection. */
60625917 if (AntDivBeforeLink8188E(padapter)) {
60635918 pmlmeext->sitesurvey_res.bss_cnt = 0;
60645919 pmlmeext->sitesurvey_res.channel_idx = -1;
@@ -6088,7 +5943,7 @@ void site_survey(struct adapter *padapter) · 23 unmodified lines
60885943 Restore_DM_Func_Flag(padapter);
60895944 /* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */
60905945
6091− if (is_client_associated_to_ap(padapter))
5946+ if (r8188eu_is_client_associated_to_ap(padapter))
60925947 issue_nulldata(padapter, NULL, 0, 3, 500);
60935948
60945949 rtw_mlme_site_survey_done(padapter);
@@ -6108,10 +5963,11 @@ void site_survey(struct adapter *padapter) · 13 unmodified lines
61085963 /* collect bss info from Beacon and Probe request/response frames. */
61095964 u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid)
61105965 {
5966+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
61115967 int i;
61125968 u32 len;
61135969 u8 *p;
6114− u16 val16, subtype;
5970+ u16 val16;
61155971 u8 *pframe = precv_frame->rx_data;
61165972 u32 packet_len = precv_frame->len;
61175973 u8 ie_offset;
@@ -6127,23 +5983,18 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st · 9 unmodified lines
61275983
61285984 memset(bssid, 0, sizeof(struct wlan_bssid_ex));
61295985
6130− subtype = GetFrameSubType(pframe);
6131−
6132− if (subtype == WIFI_BEACON) {
5986+ if (ieee80211_is_beacon(mgmt->frame_control)) {
61335987 bssid->Reserved[0] = 1;
61345988 ie_offset = _BEACON_IE_OFFSET_;
5989+ } else if (ieee80211_is_probe_req(mgmt->frame_control)) {
5990+ ie_offset = _PROBEREQ_IE_OFFSET_;
5991+ bssid->Reserved[0] = 2;
5992+ } else if (ieee80211_is_probe_resp(mgmt->frame_control)) {
5993+ ie_offset = _PROBERSP_IE_OFFSET_;
5994+ bssid->Reserved[0] = 3;
61355995 } else {
6136− /* FIXME : more type */
6137− if (subtype == WIFI_PROBEREQ) {
6138− ie_offset = _PROBEREQ_IE_OFFSET_;
6139− bssid->Reserved[0] = 2;
6140− } else if (subtype == WIFI_PROBERSP) {
6141− ie_offset = _PROBERSP_IE_OFFSET_;
6142− bssid->Reserved[0] = 3;
6143− } else {
6144− bssid->Reserved[0] = 0;
6145− ie_offset = _FIXED_IE_LENGTH_;
6146− }
5996+ bssid->Reserved[0] = 0;
5997+ ie_offset = _FIXED_IE_LENGTH_;
61475998 }
61485999
61496000 bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
@@ -6191,9 +6042,6 @@ u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, st · 41 unmodified lines
61916042 memcpy(bssid->SupportedRates + i, (p + 2), len);
61926043 }
61936044
6194− /* todo: */
6195− bssid->NetworkTypeInUse = Ndis802_11OFDM24;
6196−
61976045 if (bssid->IELength < 12)
61986046 return _FAIL;
61996047
@@ -6328,7 +6176,7 @@ void start_create_ibss(struct adapter *padapter) · 128 unmodified lines
63286176 /* update wireless mode */
63296177 update_wireless_mode(padapter);
63306178
6331− /* udpate capability */
6179+ /* update capability */
63326180 caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork);
63336181 update_capinfo(padapter, caps);
63346182 if (caps & cap_IBSS) {/* adhoc master */
@@ -6378,7 +6226,7 @@ void start_clnt_join(struct adapter *padapter) · 43 unmodified lines
63786226 /* update wireless mode */
63796227 update_wireless_mode(padapter);
63806228
6381− /* udpate capability */
6229+ /* update capability */
63826230 caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork);
63836231 update_capinfo(padapter, caps);
63846232 if (caps & cap_ESS) {
@@ -6756,9 +6604,6 @@ void report_join_res(struct adapter *padapter, int res) · 371 unmodified lines
67566604 pcmd_obj->cmdsz = cmdsz;
67576605 pcmd_obj->parmbuf = pevtcmd;
67586606
6759− pcmd_obj->rsp = NULL;
6760− pcmd_obj->rspsz = 0;
6761−
67626607 pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd);
67636608 pc2h_evt_hdr->len = sizeof(struct joinbss_event);
67646609 pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss);
@@ -6972,7 +6817,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res) · 207 unmodified lines
69726817 /* BCN interval */
69736818 rtw_write16(padapter, REG_BCN_INTERVAL, pmlmeinfo->bcn_interval);
69746819
6975− /* udpate capability */
6820+ /* update capability */
69766821 update_capinfo(padapter, pmlmeinfo->capability);
69776822
69786823 /* WMM, Update EDCA param */
@@ -7064,7 +6909,7 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter) · 85 unmodified lines
70646909 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
70656910 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
70666911
7067− if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) {
6912+ if (r8188eu_is_client_associated_to_ap(padapter) || r8188eu_is_ibss_empty(padapter)) {
70686913 mlme_disconnect(padapter);
70696914 rtw_set_bssid(padapter, null_addr);
70706915
@@ -7137,7 +6982,7 @@ void linked_status_chk(struct adapter *padapter) · 66 unmodified lines
71376982
71386983 rtl8188e_sreset_linked_status_check(padapter);
71396984
7140− if (is_client_associated_to_ap(padapter)) {
6985+ if (r8188eu_is_client_associated_to_ap(padapter)) {
71416986 /* linked infrastructure client mode */
71426987
71436988 int tx_chk = _SUCCESS, rx_chk = _SUCCESS;
@@ -7165,7 +7010,7 @@ void linked_status_chk(struct adapter *padapter) · 21 unmodified lines
71657010 }
71667011
71677012 if (rx_chk != _SUCCESS)
7168− issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3, 1);
7013+ issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr);
71697014
71707015 if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) {
71717016 tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1);
@@ -7209,7 +7054,7 @@ void linked_status_chk(struct adapter *padapter) · 37 unmodified lines
72097054 pmlmeinfo->link_count = 0;
72107055 }
72117056 } /* end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) */
7212− } else if (is_client_associated_to_ibss(padapter)) {
7057+ } else if (r8188eu_is_client_associated_to_ibss(padapter)) {
72137058 /* linked IBSS mode */
72147059 /* for each assoc list entry to check the rx pkt counter */
72157060 for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) {
@@ -7527,7 +7372,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf) · 311 unmodified lines
75277372 u8 val8;
75287373 int res;
75297374
7530− if (is_client_associated_to_ap(padapter))
7375+ if (r8188eu_is_client_associated_to_ap(padapter))
75317376 issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms / 100, 100);
75327377
75337378 mlme_disconnect(padapter);
@@ -7639,7 +7484,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf) · 105 unmodified lines
76397484 pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode;
76407485
76417486 /* issue null data if associating to the AP */
7642− if (is_client_associated_to_ap(padapter)) {
7487+ if (r8188eu_is_client_associated_to_ap(padapter)) {
76437488 pmlmeext->sitesurvey_res.state = SCAN_TXNULL;
76447489
76457490 issue_nulldata(padapter, NULL, 1, 3, 500);
@@ -7783,7 +7628,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf) · 137 unmodified lines
77837628
77847629 if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) ||
77857630 ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) {
7786− issue_action_BA(padapter, pparm->addr, WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid);
7631+ issue_action_BA(padapter, pparm->addr, WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid, NULL);
77877632 _set_timer(&psta->addba_retry_timer, ADDBA_TO);
77887633 } else {
77897634 psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid);
drivers/staging/r8188eu/core/rtw_p2p.c+6−13
@@ -1453,7 +1453,7 @@ static void pre_tx_invitereq_handler(struct adapter *padapter) · 1452 unmodified lines
14531453
14541454 set_channel_bwmode(padapter, pwdinfo->invitereq_info.peer_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
14551455 rtw_mlme_under_site_survey(padapter);
1456− issue_probereq_p2p(padapter, NULL);
1456+ issue_probereq_p2p(padapter);
14571457 _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
14581458
14591459 }
@@ -1464,7 +1464,7 @@ static void pre_tx_provdisc_handler(struct adapter *padapter) · 4 unmodified lines
14641464
14651465 set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
14661466 rtw_mlme_under_site_survey(padapter);
1467− issue_probereq_p2p(padapter, NULL);
1467+ issue_probereq_p2p(padapter);
14681468 _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
14691469
14701470 }
@@ -1475,7 +1475,7 @@ static void pre_tx_negoreq_handler(struct adapter *padapter) · 4 unmodified lines
14751475
14761476 set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
14771477 rtw_mlme_under_site_survey(padapter);
1478− issue_probereq_p2p(padapter, NULL);
1478+ issue_probereq_p2p(padapter);
14791479 _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
14801480
14811481 }
@@ -1505,8 +1505,6 @@ void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType) · 23 unmodified lines
15051505
15061506 void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
15071507 {
1508− u8 *ies;
1509− u32 ies_len;
15101508 u8 *p2p_ie;
15111509 u32 p2p_ielen = 0;
15121510 u8 noa_attr[MAX_P2P_IE_LEN] = { 0x00 };/* NoA length should be n*(13) + 2 */
@@ -1518,13 +1516,8 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) · 5 unmodified lines
15181516
15191517 if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
15201518 return;
1521− if (IELength <= _BEACON_IE_OFFSET_)
1522− return;
15231519
1524− ies = IEs + _BEACON_IE_OFFSET_;
1525− ies_len = IELength - _BEACON_IE_OFFSET_;
1526−
1527− p2p_ie = rtw_get_p2p_ie(ies, ies_len, NULL, &p2p_ielen);
1520+ p2p_ie = rtw_get_p2p_ie(IEs, IELength, NULL, &p2p_ielen);
15281521
15291522 while (p2p_ie) {
15301523 find_p2p = true;
@@ -1579,7 +1572,7 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) · 48 unmodified lines
15791572 }
15801573
15811574 /* Get the next P2P IE */
1582− p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen);
1575+ p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, IELength - (p2p_ie - IEs + p2p_ielen), NULL, &p2p_ielen);
15831576 }
15841577
15851578 if (find_p2p) {
@@ -1732,7 +1725,7 @@ static void pre_tx_scan_timer_process(struct timer_list *t) · 146 unmodified lines
17321725 if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) {
17331726 if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */
17341727 p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK);
1735− /* issue_probereq_p2p(adapter, NULL); */
1728+ /* issue_probereq_p2p(adapter); */
17361729 /* _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); */
17371730 }
17381731 } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
drivers/staging/r8188eu/core/rtw_pwrctrl.c+1−1
@@ -273,7 +273,7 @@ static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms) · 272 unmodified lines
273273 err = -1;
274274 break;
275275 }
276− msleep(1);
276+ mdelay(1);
277277 }
278278
279279 return err;
drivers/staging/r8188eu/core/rtw_recv.c+12−15
@@ -779,9 +779,8 @@ static int ap2sta_data_frame( · 778 unmodified lines
779779 }
780780
781781 /* check BSSID */
782− if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
783− !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
784− (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
782+ if (is_zero_ether_addr(pattrib->bssid) || is_zero_ether_addr(mybssid) ||
783+ (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
785784 if (!bmcast)
786785 issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
787786
@@ -972,7 +971,7 @@ static void validate_recv_ctrl_frame(struct adapter *padapter, · 184 unmodified lines
972971 if (psta->sleepq_len == 0) {
973972 pstapriv->tim_bitmap &= ~BIT(psta->aid);
974973
975− /* upate BCN for TIM IE */
974+ /* update BCN for TIM IE */
976975 /* update_BCNTIM(padapter); */
977976 update_beacon(padapter, _TIM_IE_, NULL, false);
978977 }
@@ -986,7 +985,7 @@ static void validate_recv_ctrl_frame(struct adapter *padapter, · 7 unmodified lines
986985
987986 pstapriv->tim_bitmap &= ~BIT(psta->aid);
988987
989− /* upate BCN for TIM IE */
988+ /* update BCN for TIM IE */
990989 /* update_BCNTIM(padapter); */
991990 update_beacon(padapter, _TIM_IE_, NULL, false);
992991 }
@@ -1032,7 +1031,6 @@ static int validate_recv_data_frame(struct adapter *adapter, · 39 unmodified lines
10321031 struct recv_frame *precv_frame)
10331032 {
10341033 struct sta_info *psta = NULL;
1035− u8 *ptr = precv_frame->rx_data;
10361034 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data;
10371035 struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
10381036 struct security_priv *psecuritypriv = &adapter->securitypriv;
@@ -1065,18 +1063,18 @@ static int validate_recv_data_frame(struct adapter *adapter, · 26 unmodified lines
10651063 if (!psta)
10661064 return _FAIL;
10671065
1068− /* psta->rssi = prxcmd->rssi; */
1069− /* psta->signal_quality = prxcmd->sq; */
10701066 precv_frame->psta = psta;
10711067
10721068 pattrib->amsdu = 0;
10731069 pattrib->ack_policy = 0;
10741070 /* parsing QC field */
10751071 if (pattrib->qos) {
1072+ struct ieee80211_qos_hdr *qos_hdr = (struct ieee80211_qos_hdr *)hdr;
1073+
10761074 pattrib->priority = ieee80211_get_tid(hdr);
1077− pattrib->ack_policy = GetAckpolicy((ptr + 24));
1078− pattrib->amsdu = GetAMsdu((ptr + 24));
1079− pattrib->hdrlen = 26;
1075+ pattrib->ack_policy = GetAckpolicy(&qos_hdr->qos_ctrl);
1076+ pattrib->amsdu = GetAMsdu(&qos_hdr->qos_ctrl);
1077+ pattrib->hdrlen = sizeof(*qos_hdr);
10801078
10811079 if (pattrib->priority != 0 && pattrib->priority != 3)
10821080 adapter->recvpriv.bIsAnyNonBEPkts = true;
@@ -1415,7 +1413,6 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe) · 332 unmodified lines
14151413
14161414 struct recv_priv *precvpriv = &padapter->recvpriv;
14171415 struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;
1418− int ret = _SUCCESS;
14191416
14201417 nr_subframes = 0;
14211418
@@ -1513,7 +1510,7 @@ exit: · 91 unmodified lines
15131510 prframe->len = 0;
15141511 rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */
15151512
1516− return ret;
1513+ return _SUCCESS;
15171514 }
15181515
15191516 static bool check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
@@ -1984,13 +1981,13 @@ static void rtw_signal_stat_timer_hdl(struct timer_list *t) · 464 unmodified lines
19841981 } else {
19851982 if (recvpriv->signal_strength_data.update_req == 0) {/* update_req is clear, means we got rx */
19861983 avg_signal_strength = recvpriv->signal_strength_data.avg_val;
1987− /* after avg_vals are accquired, we can re-stat the signal values */
1984+ /* after avg_vals are acquired, we can re-stat the signal values */
19881985 recvpriv->signal_strength_data.update_req = 1;
19891986 }
19901987
19911988 if (recvpriv->signal_qual_data.update_req == 0) {/* update_req is clear, means we got rx */
19921989 avg_signal_qual = recvpriv->signal_qual_data.avg_val;
1993− /* after avg_vals are accquired, we can re-stat the signal values */
1990+ /* after avg_vals are acquired, we can re-stat the signal values */
19941991 recvpriv->signal_qual_data.update_req = 1;
19951992 }
19961993
drivers/staging/r8188eu/core/rtw_security.c+1−3
@@ -954,7 +954,7 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out) · 953 unmodified lines
954954
955955 }
956956
957−static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen)
957+static void aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen)
958958 {
959959 uint qc_exists, a4_exists, i, j, payload_remainder,
960960 num_blocks, payload_index;
@@ -1083,8 +1083,6 @@ static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) · 122 unmodified lines
10831083 bitwise_xor(aes_out, padded_buffer, chain_buffer);
10841084 for (j = 0; j < 8; j++)
10851085 pframe[payload_index++] = chain_buffer[j];
1086−
1087− return _SUCCESS;
10881086 }
10891087
10901088 u32 rtw_aes_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe)
drivers/staging/r8188eu/core/rtw_sta_mgt.c+6−10
@@ -45,7 +45,7 @@ static void _rtw_init_stainfo(struct sta_info *psta) · 44 unmodified lines
4545 psta->keep_alive_trycnt = 0;
4646 }
4747
48−u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
48+int _rtw_init_sta_priv(struct sta_priv *pstapriv)
4949 {
5050 struct sta_info *psta;
5151 s32 i;
@@ -53,7 +53,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) · 1 unmodified line
5353 pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4);
5454
5555 if (!pstapriv->pallocated_stainfo_buf)
56− return _FAIL;
56+ return -ENOMEM;
5757
5858 pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
5959 ((size_t)(pstapriv->pallocated_stainfo_buf) & 3);
@@ -93,7 +93,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) · 33 unmodified lines
9393 pstapriv->expire_to = 3; /* 3*2 = 6 sec */
9494 pstapriv->max_num_sta = NUM_STA;
9595
96− return _SUCCESS;
96+ return 0;
9797 }
9898
9999 inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
@@ -242,7 +242,7 @@ exit: · 142 unmodified lines
242242 }
243243
244244 /* using pstapriv->sta_hash_lock to protect */
245−u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
245+void rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
246246 {
247247 int i;
248248 struct __queue *pfree_sta_queue;
@@ -252,7 +252,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) · 3 unmodified lines
252252 struct sta_priv *pstapriv = &padapter->stapriv;
253253
254254 if (!psta)
255− goto exit;
255+ return;
256256
257257 pfree_sta_queue = &pstapriv->free_sta_queue;
258258
@@ -356,10 +356,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) · 97 unmodified lines
356356 spin_lock_bh(&pfree_sta_queue->lock);
357357 list_add_tail(&psta->list, get_list_head(pfree_sta_queue));
358358 spin_unlock_bh(&pfree_sta_queue->lock);
359−
360−exit:
361−
362− return _SUCCESS;
363359 }
364360
365361 /* free all stainfo which in sta_hash[all] */
@@ -404,7 +400,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) · 38 unmodified lines
404400 if (!hwaddr)
405401 return NULL;
406402
407− if (IS_MCAST(hwaddr))
403+ if (is_multicast_ether_addr(hwaddr))
408404 addr = bc_addr;
409405 else
410406 addr = hwaddr;
drivers/staging/r8188eu/core/rtw_wlan_util.c+16−20
@@ -331,35 +331,35 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss) · 330 unmodified lines
331331 return le16_to_cpu(val);
332332 }
333333
334−int is_client_associated_to_ap(struct adapter *padapter)
334+bool r8188eu_is_client_associated_to_ap(struct adapter *padapter)
335335 {
336336 struct mlme_ext_priv *pmlmeext;
337337 struct mlme_ext_info *pmlmeinfo;
338338
339339 if (!padapter)
340− return _FAIL;
340+ return false;
341341
342342 pmlmeext = &padapter->mlmeextpriv;
343343 pmlmeinfo = &pmlmeext->mlmext_info;
344344
345345 if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE))
346346 return true;
347− else
348− return _FAIL;
347+
348+ return false;
349349 }
350350
351−int is_client_associated_to_ibss(struct adapter *padapter)
351+bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter)
352352 {
353353 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
354354 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
355355
356356 if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE))
357357 return true;
358− else
359− return _FAIL;
358+
359+ return false;
360360 }
361361
362−int is_IBSS_empty(struct adapter *padapter)
362+bool r8188eu_is_ibss_empty(struct adapter *padapter)
363363 {
364364 unsigned int i;
365365 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -367,7 +367,7 @@ int is_IBSS_empty(struct adapter *padapter) · 1 unmodified line
367367
368368 for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) {
369369 if (pmlmeinfo->FW_sta_info[i].status == 1)
370− return _FAIL;
370+ return false;
371371 }
372372 return true;
373373 }
@@ -874,9 +874,10 @@ void VCS_update(struct adapter *padapter, struct sta_info *psta) · 500 unmodified lines
874874
875875 int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
876876 {
877+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)pframe;
877878 unsigned int len;
878879 unsigned char *p;
879− unsigned short val16, subtype;
880+ unsigned short val16;
880881 struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network;
881882 /* u8 wpa_ie[255], rsn_ie[255]; */
882883 u16 wpa_len = 0, rsn_len = 0;
@@ -893,7 +894,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) · 10 unmodified lines
893894 unsigned short ht_cap_info;
894895 unsigned char ht_info_infos_0;
895896
896− if (!is_client_associated_to_ap(Adapter))
897+ if (!r8188eu_is_client_associated_to_ap(Adapter))
897898 return true;
898899
899900 len = packet_len - sizeof(struct ieee80211_hdr_3addr);
@@ -908,9 +909,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) · 8 unmodified lines
908909 if (!bssid)
909910 return _FAIL;
910911
911− subtype = GetFrameSubType(pframe) >> 4;
912−
913− if (subtype == WIFI_BEACON)
912+ if (ieee80211_is_beacon(mgmt->frame_control))
914913 bssid->Reserved[0] = 1;
915914
916915 bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;
@@ -1035,16 +1034,13 @@ _mismatch: · 118 unmodified lines
10351034 return _FAIL;
10361035 }
10371036
1038−void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta)
1037+void update_beacon_info(struct adapter *padapter, u8 *ie_ptr, uint ie_len, struct sta_info *psta)
10391038 {
10401039 unsigned int i;
1041− unsigned int len;
10421040 struct ndis_802_11_var_ie *pIE;
10431041
1044− len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN);
1045−
1046− for (i = 0; i < len;) {
1047− pIE = (struct ndis_802_11_var_ie *)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i);
1042+ for (i = 0; i < ie_len;) {
1043+ pIE = (struct ndis_802_11_var_ie *)(ie_ptr + i);
10481044
10491045 switch (pIE->ElementID) {
10501046 case _HT_EXTRA_INFO_IE_: /* HT info */
drivers/staging/r8188eu/core/rtw_xmit.c+20−34
@@ -38,7 +38,7 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *px · 37 unmodified lines
3838 {
3939 pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
4040 if (!pxmitbuf->pallocated_buf)
41− return _FAIL;
41+ return -ENOMEM;
4242
4343 pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
4444 pxmitbuf->dma_transfer_addr = 0;
@@ -46,10 +46,10 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *px · 1 unmodified line
4646 pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL);
4747 if (!pxmitbuf->pxmit_urb) {
4848 kfree(pxmitbuf->pallocated_buf);
49− return _FAIL;
49+ return -ENOMEM;
5050 }
5151
52− return _SUCCESS;
52+ return 0;
5353 }
5454
5555 static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf,
@@ -59,12 +59,11 @@ static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *px · 3 unmodified lines
5959 kfree(pxmitbuf->pallocated_buf);
6060 }
6161
62−s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
62+int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
6363 {
6464 int i;
6565 struct xmit_buf *pxmitbuf;
6666 struct xmit_frame *pxframe;
67− int res = _SUCCESS;
6867 u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
6968 u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
7069
@@ -97,7 +96,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 26 unmodified lines
9796
9897 if (!pxmitpriv->pallocated_frame_buf) {
9998 pxmitpriv->pxmit_frame_buf = NULL;
100− res = _FAIL;
10199 goto exit;
102100 }
103101 pxmitpriv->pxmit_frame_buf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_frame_buf), 4);
@@ -132,10 +130,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 28 unmodified lines
132130
133131 pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
134132
135− if (!pxmitpriv->pallocated_xmitbuf) {
136− res = _FAIL;
133+ if (!pxmitpriv->pallocated_xmitbuf)
137134 goto free_frame_buf;
138− }
139135
140136 pxmitpriv->pxmitbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmitbuf), 4);
141137 /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */
@@ -151,11 +147,9 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 9 unmodified lines
151147 pxmitbuf->ext_tag = false;
152148
153149 /* Tx buf allocation may fail sometimes, so sleep and retry. */
154− res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
155− if (res == _FAIL) {
150+ if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) {
156151 msleep(10);
157− res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
158− if (res == _FAIL)
152+ if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)))
159153 goto free_xmitbuf;
160154 }
161155
@@ -172,10 +166,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 10 unmodified lines
172166
173167 pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
174168
175− if (!pxmitpriv->pallocated_xmit_extbuf) {
176− res = _FAIL;
169+ if (!pxmitpriv->pallocated_xmit_extbuf)
177170 goto free_xmitbuf;
178− }
179171
180172 pxmitpriv->pxmit_extbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4);
181173
@@ -188,11 +180,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 6 unmodified lines
188180 pxmitbuf->padapter = padapter;
189181 pxmitbuf->ext_tag = true;
190182
191− res = rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ);
192− if (res == _FAIL) {
193− res = _FAIL;
183+ if (rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ))
194184 goto free_xmit_extbuf;
195− }
196185
197186 list_add_tail(&pxmitbuf->list, &pxmitpriv->free_xmit_extbuf_queue.queue);
198187 pxmitbuf++;
@@ -200,10 +189,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 1 unmodified line
200189
201190 pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf;
202191
203− if (rtw_alloc_hwxmits(padapter)) {
204− res = _FAIL;
192+ if (rtw_alloc_hwxmits(padapter))
205193 goto free_xmit_extbuf;
206− }
207194
208195 rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
209196
@@ -226,7 +213,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) · 16 unmodified lines
226213
227214 rtl8188eu_init_xmit_priv(padapter);
228215
229− return _SUCCESS;
216+ return 0;
230217
231218 free_xmit_extbuf:
232219 pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
@@ -246,7 +233,7 @@ free_xmitbuf: · 13 unmodified lines
246233 free_frame_buf:
247234 vfree(pxmitpriv->pallocated_frame_buf);
248235 exit:
249− return res;
236+ return -ENOMEM;
250237 }
251238
252239 static void rtw_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
@@ -476,8 +463,7 @@ static uint rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen) · 223 unmodified lines
476463 {
477464 uint len;
478465
479− len = rtw_remainder_len(pfile);
480− len = (rlen > len) ? len : rlen;
466+ len = min(rtw_remainder_len(pfile), rlen);
481467
482468 if (rmem)
483469 skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len);
@@ -1622,14 +1608,14 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 1138 unmodified lines
16221608 spin_lock_bh(&padapter->br_ext_lock);
16231609 if (!(skb->data[0] & 1) && br_port &&
16241610 memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) &&
1625− *((__be16 *)(skb->data + ETH_ALEN * 2)) != __constant_htons(ETH_P_8021Q) &&
1626− *((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP) &&
1611+ *((__be16 *)(skb->data + ETH_ALEN * 2)) != htons(ETH_P_8021Q) &&
1612+ *((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP) &&
16271613 !memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN) && padapter->scdb_entry) {
16281614 memcpy(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN);
16291615 padapter->scdb_entry->ageing_timer = jiffies;
16301616 spin_unlock_bh(&padapter->br_ext_lock);
16311617 } else {
1632− if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_8021Q)) {
1618+ if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_8021Q)) {
16331619 is_vlan_tag = 1;
16341620 vlan_hdr = *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2));
16351621 for (i = 0; i < 6; i++)
@@ -1637,10 +1623,10 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 1 unmodified line
16371623 skb_pull(skb, 4);
16381624 }
16391625 if (!memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) &&
1640− (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)))
1626+ (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP)))
16411627 memcpy(padapter->br_ip, skb->data + WLAN_ETHHDR_LEN + 12, 4);
16421628
1643− if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)) {
1629+ if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP)) {
16441630 if (memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN)) {
16451631 padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter,
16461632 skb->data + WLAN_ETHHDR_LEN + 12);
@@ -1669,7 +1655,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 22 unmodified lines
16691655 skb_push(skb, 4);
16701656 for (i = 0; i < 6; i++)
16711657 *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2));
1672− *((__be16 *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q);
1658+ *((__be16 *)(skb->data + ETH_ALEN * 2)) = htons(ETH_P_8021Q);
16731659 *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr;
16741660 }
16751661
@@ -1708,7 +1694,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) · 32 unmodified lines
17081694 skb_push(skb, 4);
17091695 for (i = 0; i < 6; i++)
17101696 *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2));
1711− *((__be16 *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q);
1697+ *((__be16 *)(skb->data + ETH_ALEN * 2)) = htons(ETH_P_8021Q);
17121698 *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr;
17131699 }
17141700 }
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c+2−10
@@ -69,7 +69,7 @@ void ODM_TxPwrTrackAdjust88E(struct odm_dm_struct *dm_odm, u8 Type,/* 0 = OFDM, · 68 unmodified lines
6969 /*-----------------------------------------------------------------------------
7070 * Function: odm_TxPwrTrackSetPwr88E()
7171 *
72− * Overview: 88E change all channel tx power accordign to flag.
72+ * Overview: 88E change all channel tx power according to flag.
7373 * OFDM & CCK are all different.
7474 *
7575 * Input: NONE
@@ -583,7 +583,7 @@ static bool phy_SimularityCompare_8188E( · 507 unmodified lines
583583 tmp2 = resulta[c2][i];
584584 }
585585
586− diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1);
586+ diff = abs(tmp1 - tmp2);
587587
588588 if (diff > MAX_TOLERANCE) {
589589 if ((i == 2 || i == 6) && !sim_bitmap) {
@@ -882,14 +882,6 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery) · 292 unmodified lines
882882 if (RegE94 != 0)
883883 patha_fill_iqk(adapt, pathaok, result, final_candidate, (RegEA4 == 0));
884884
885−/* To Fix BSOD when final_candidate is 0xff */
886−/* by sherry 20120321 */
887− if (final_candidate < 4) {
888− for (i = 0; i < IQK_Matrix_REG_NUM; i++)
889− dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][i] = result[final_candidate][i];
890− dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.bIQKDone = true;
891− }
892−
893885 _PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9);
894886 }
895887
drivers/staging/r8188eu/hal/hal_intf.c+7−12
@@ -6,24 +6,19 @@ · 5 unmodified lines
66 #include "../include/drv_types.h"
77 #include "../include/hal_intf.h"
88
9−uint rtw_hal_init(struct adapter *adapt)
9+uint rtw_hal_init(struct adapter *adapt)
1010 {
11− uint status = _SUCCESS;
12−
1311 adapt->hw_init_completed = false;
1412
15− status = rtl8188eu_hal_init(adapt);
13+ if (rtl8188eu_hal_init(adapt) != _SUCCESS)
14+ return _FAIL;
1615
17− if (status == _SUCCESS) {
18− adapt->hw_init_completed = true;
16+ adapt->hw_init_completed = true;
1917
20− if (adapt->registrypriv.notch_filter == 1)
21− hal_notch_filter_8188e(adapt, 1);
22− } else {
23− adapt->hw_init_completed = false;
24− }
18+ if (adapt->registrypriv.notch_filter == 1)
19+ hal_notch_filter_8188e(adapt, 1);
2520
26− return status;
21+ return _SUCCESS;
2722 }
2823
2924 uint rtw_hal_deinit(struct adapter *adapt)
drivers/staging/r8188eu/hal/odm_RTL8188E.c+3−3
@@ -194,12 +194,12 @@ static void odm_HWAntDiv(struct odm_dm_struct *dm_odm) · 193 unmodified lines
194194 for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) {
195195 pEntry = dm_odm->pODM_StaInfo[i];
196196 if (IS_STA_VALID(pEntry)) {
197− /* 2 Caculate RSSI per Antenna */
197+ /* 2 Calculate RSSI per Antenna */
198198 Main_RSSI = (dm_fat_tbl->MainAnt_Cnt[i] != 0) ? (dm_fat_tbl->MainAnt_Sum[i] / dm_fat_tbl->MainAnt_Cnt[i]) : 0;
199199 Aux_RSSI = (dm_fat_tbl->AuxAnt_Cnt[i] != 0) ? (dm_fat_tbl->AuxAnt_Sum[i] / dm_fat_tbl->AuxAnt_Cnt[i]) : 0;
200200 TargetAnt = (Main_RSSI >= Aux_RSSI) ? MAIN_ANT : AUX_ANT;
201201 /* 2 Select MaxRSSI for DIG */
202− LocalMaxRSSI = (Main_RSSI > Aux_RSSI) ? Main_RSSI : Aux_RSSI;
202+ LocalMaxRSSI = max(Main_RSSI, Aux_RSSI);
203203 if ((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40))
204204 AntDivMaxRSSI = LocalMaxRSSI;
205205 if (LocalMaxRSSI > MaxRSSI)
@@ -211,7 +211,7 @@ static void odm_HWAntDiv(struct odm_dm_struct *dm_odm) · 5 unmodified lines
211211 else if ((dm_fat_tbl->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0))
212212 Aux_RSSI = Main_RSSI;
213213
214− LocalMinRSSI = (Main_RSSI > Aux_RSSI) ? Aux_RSSI : Main_RSSI;
214+ LocalMinRSSI = min(Main_RSSI, Aux_RSSI);
215215 if (LocalMinRSSI < MinRSSI) {
216216 MinRSSI = LocalMinRSSI;
217217 RxIdleAnt = TargetAnt;
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c+2−6
@@ -355,7 +355,7 @@ void rtl8188e_EfusePowerSwitch(struct adapter *pAdapter, u8 PwrState) · 354 unmodified lines
355355 if (PwrState) {
356356 rtw_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON);
357357
358− /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), defualt valid */
358+ /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), default valid */
359359 res = rtw_read16(pAdapter, REG_SYS_ISO_CTRL, &tmpV16);
360360 if (res)
361361 return;
@@ -676,11 +676,7 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy) · 314 unmodified lines
676676 return status;
677677 }
678678
679−void
680−Hal_EfuseParseIDCode88E(
681− struct adapter *padapter,
682− u8 *hwinfo
683− )
679+void Hal_EfuseParseIDCode88E(struct adapter *padapter, u8 *hwinfo)
684680 {
685681 struct eeprom_priv *pEEPROM = &padapter->eeprompriv;
686682 struct net_device *netdev = padapter->pnetdev;
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c+8−8
@@ -23,7 +23,7 @@ static u32 phy_calculate_bit_shift(u32 bitmask) · 22 unmodified lines
2323 /**
2424 * Function: PHY_QueryBBReg
2525 *
26−* OverView: Read "sepcific bits" from BB register
26+* Overview: Read "sepcific bits" from BB register
2727 *
2828 * Input:
2929 * struct adapter *Adapter,
@@ -56,7 +56,7 @@ rtl8188e_PHY_QueryBBReg( · 26 unmodified lines
5656 /**
5757 * Function: PHY_SetBBReg
5858 *
59−* OverView: Write "Specific bits" to BB register (page 8~)
59+* Overview: Write "Specific bits" to BB register (page 8~)
6060 *
6161 * Input:
6262 * struct adapter *Adapter,
@@ -94,7 +94,7 @@ void rtl8188e_PHY_SetBBReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask, u3 · 31 unmodified lines
9494 /**
9595 * Function: phy_RFSerialRead
9696 *
97−* OverView: Read regster from RF chips
97+* Overview: Read register from RF chips
9898 *
9999 * Input:
100100 * struct adapter *Adapter,
@@ -160,7 +160,7 @@ phy_RFSerialRead( · 59 unmodified lines
160160 /**
161161 * Function: phy_RFSerialWrite
162162 *
163−* OverView: Write data to RF register (page 8~)
163+* Overview: Write data to RF register (page 8~)
164164 *
165165 * Input:
166166 * struct adapter *Adapter,
@@ -235,7 +235,7 @@ phy_RFSerialWrite( · 68 unmodified lines
235235 /**
236236 * Function: PHY_QueryRFReg
237237 *
238−* OverView: Query "Specific bits" to RF register (page 8~)
238+* Overview: Query "Specific bits" to RF register (page 8~)
239239 *
240240 * Input:
241241 * struct adapter *Adapter,
@@ -261,7 +261,7 @@ u32 rtl8188e_PHY_QueryRFReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask) · 19 unmodified lines
261261 /**
262262 * Function: PHY_SetRFReg
263263 *
264−* OverView: Write "Specific bits" to RF register (page 8~)
264+* Overview: Write "Specific bits" to RF register (page 8~)
265265 *
266266 * Input:
267267 * struct adapter *Adapter,
@@ -335,7 +335,7 @@ s32 PHY_MACConfig8188E(struct adapter *Adapter) · 67 unmodified lines
335335 /**
336336 * Function: phy_InitBBRFRegisterDefinition
337337 *
338−* OverView: Initialize Register definition offset for Radio Path A/B/C/D
338+* Overview: Initialize Register definition offset for Radio Path A/B/C/D
339339 *
340340 * Input:
341341 * struct adapter *Adapter,
@@ -363,7 +363,7 @@ phy_InitBBRFRegisterDefinition( · 21 unmodified lines
363363 /* RF Interface (Output and) Enable */
364364 pHalData->PHYRegDef.rfintfe = rFPGA0_XA_RFInterfaceOE; /* 16 MSBs if read 32-bit from 0x860 (16-bit for 0x862) */
365365
366− /* Addr of LSSI. Wirte RF register by driver */
366+ /* Addr of LSSI. Write RF register by driver */
367367 pHalData->PHYRegDef.rf3wireOffset = rFPGA0_XA_LSSIParameter; /* LSSI Parameter */
368368
369369 /* RF parameter */
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c+13−15
@@ -66,28 +66,25 @@ void update_recvframe_attrib_88e(struct recv_frame *precvframe, struct recv_stat · 65 unmodified lines
6666
6767 if (pattrib->pkt_rpt_type == NORMAL_RX) {
6868 pattrib->pkt_len = le32_to_cpu(prxstat->rxdw0) & 0x00003fff;
69+ pattrib->icv_err = (le32_to_cpu(prxstat->rxdw0) >> 15) & 0x1;
6970 pattrib->drvinfo_sz = ((le32_to_cpu(prxstat->rxdw0) >> 16) & 0xf) * 8;
70−
71+ pattrib->encrypt = (u8)((le32_to_cpu(prxstat->rxdw0) >> 20) & 0x7);
72+ pattrib->qos = (le32_to_cpu(prxstat->rxdw0) >> 23) & 0x1;
73+ pattrib->shift_sz = (le32_to_cpu(prxstat->rxdw0) >> 24) & 0x3;
7174 pattrib->physt = (le32_to_cpu(prxstat->rxdw0) >> 26) & 0x1;
72−
7375 pattrib->bdecrypted = (le32_to_cpu(prxstat->rxdw0) & BIT(27)) ? 0 : 1;
74− pattrib->encrypt = (le32_to_cpu(prxstat->rxdw0) >> 20) & 0x7;
7576
76− pattrib->qos = (le32_to_cpu(prxstat->rxdw0) >> 23) & 0x1;
7777 pattrib->priority = (le32_to_cpu(prxstat->rxdw1) >> 8) & 0xf;
78−
7978 pattrib->amsdu = (le32_to_cpu(prxstat->rxdw1) >> 13) & 0x1;
79+ pattrib->mdata = (le32_to_cpu(prxstat->rxdw1) >> 26) & 0x1;
80+ pattrib->mfrag = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1;
8081
8182 pattrib->seq_num = le32_to_cpu(prxstat->rxdw2) & 0x00000fff;
8283 pattrib->frag_num = (le32_to_cpu(prxstat->rxdw2) >> 12) & 0xf;
83− pattrib->mfrag = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1;
84− pattrib->mdata = (le32_to_cpu(prxstat->rxdw1) >> 26) & 0x1;
8584
8685 pattrib->mcs_rate = le32_to_cpu(prxstat->rxdw3) & 0x3f;
8786 pattrib->rxht = (le32_to_cpu(prxstat->rxdw3) >> 6) & 0x1;
8887
89− pattrib->icv_err = (le32_to_cpu(prxstat->rxdw0) >> 15) & 0x1;
90− pattrib->shift_sz = (le32_to_cpu(prxstat->rxdw0) >> 24) & 0x3;
9188 } else if (pattrib->pkt_rpt_type == TX_REPORT1) { /* CCX */
9289 pattrib->pkt_len = TX_RPT1_PKT_LEN;
9390 } else if (pattrib->pkt_rpt_type == TX_REPORT2) {
@@ -108,33 +105,34 @@ void update_recvframe_attrib_88e(struct recv_frame *precvframe, struct recv_stat · 14 unmodified lines
108105 */
109106 void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat *pphy_status)
110107 {
108+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precvframe->rx_data;
111109 struct adapter *padapter = precvframe->adapter;
112110 struct rx_pkt_attrib *pattrib = &precvframe->attrib;
113111 struct hal_data_8188e *pHalData = &padapter->haldata;
114112 struct phy_info *pPHYInfo = &pattrib->phy_info;
115113 u8 *wlanhdr = precvframe->rx_data;
116− __le16 fc = *(__le16 *)wlanhdr;
117114 struct odm_per_pkt_info pkt_info;
118115 u8 *sa = NULL;
119116 struct sta_priv *pstapriv;
120117 struct sta_info *psta;
121118
122− pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(fc)) &&
119+ pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(hdr->frame_control)) &&
123120 !pattrib->icv_err && !pattrib->crc_err &&
124121 !memcmp(get_hdr_bssid(wlanhdr),
125122 get_bssid(&padapter->mlmepriv), ETH_ALEN));
126123
127124 pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
128− (!memcmp(get_da(wlanhdr),
129− myid(&padapter->eeprompriv), ETH_ALEN));
125+ ether_addr_equal(ieee80211_get_DA(hdr),
126+ myid(&padapter->eeprompriv));
130127
131− pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc);
128+ pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID &&
129+ ieee80211_is_beacon(hdr->frame_control);
132130 if (pkt_info.bPacketBeacon) {
133131 if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE))
134132 sa = padapter->mlmepriv.cur_network.network.MacAddress;
135133 /* to do Ad-hoc */
136134 } else {
137− sa = get_sa(wlanhdr);
135+ sa = ieee80211_get_SA(hdr);
138136 }
139137
140138 pstapriv = &padapter->stapriv;
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c+1−2
@@ -149,7 +149,6 @@ static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *pdw) · 148 unmodified lines
149149
150150 static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt)
151151 {
152− int pull = 0;
153152 uint qsel;
154153 u8 data_rate, pwr_status, offset;
155154 struct adapter *adapt = pxmitframe->padapter;
@@ -295,7 +294,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag · 139 unmodified lines
295294 ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id);
296295
297296 rtl8188eu_cal_txdesc_chksum(ptxdesc);
298− return pull;
297+ return 0;
299298 }
300299
301300 /* for non-agg data frame or management frame */
drivers/staging/r8188eu/include/Hal8188EPhyReg.h+2−2
@@ -92,7 +92,7 @@ · 91 unmodified lines
9292 #define rFPGA0_AdDaClockEn 0x888
9393 #define rFPGA0_AnalogParameter4 0x88c
9494
95−#define rFPGA0_XA_LSSIReadBack 0x8a0 /* Tranceiver LSSI Readback */
95+#define rFPGA0_XA_LSSIReadBack 0x8a0 /* Transceiver LSSI Readback */
9696 #define rFPGA0_XB_LSSIReadBack 0x8a4
9797 #define rFPGA0_XC_LSSIReadBack 0x8a8
9898 #define rFPGA0_XD_LSSIReadBack 0x8ac
@@ -167,7 +167,7 @@ · 68 unmodified lines
167167
168168 /* RxIQ DC offset, Rx digital filter, DC notch filter */
169169 #define rOFDM0_XARxAFE 0xc10
170−#define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imblance matrix */
170+#define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imbalance matrix */
171171 #define rOFDM0_XBRxAFE 0xc18
172172 #define rOFDM0_XBRxIQImbalance 0xc1c
173173 #define rOFDM0_XCRxAFE 0xc20
drivers/staging/r8188eu/include/drv_types.h+0−1
@@ -167,7 +167,6 @@ struct adapter { · 166 unmodified lines
167167
168168 s32 bDriverStopped;
169169 s32 bSurpriseRemoved;
170− s32 bCardDisableWOHSM;
171170
172171 u8 hw_init_completed;
173172 s8 signal_strength;
drivers/staging/r8188eu/include/odm.h+2−8
@@ -80,7 +80,6 @@ struct odm_rate_adapt { · 79 unmodified lines
8080 #define HP_THERMAL_NUM 8
8181
8282 #define AVG_THERMAL_NUM 8
83−#define IQK_Matrix_REG_NUM 8
8483
8584 struct odm_phy_dbg_info {
8685 /* ODM Write,debug info */
@@ -119,7 +118,8 @@ enum odm_ability_def { · 32 unmodified lines
119118 ODM_BB_PWR_TRA = BIT(8),
120119 };
121120
122−# define ODM_ITRF_USB 0x2
121+#define ODM_ITRF_USB 0x2
122+#define ODM_CE 0x04
123123
124124 /* ODM_CMNINFO_WM_MODE */
125125 enum odm_wireless_mode {
@@ -163,11 +163,6 @@ struct odm_ra_info { · 37 unmodified lines
163163 u8 PTSmoothFactor;
164164 };
165165
166−struct ijk_matrix_regs_set {
167− bool bIQKDone;
168− s32 Value[1][IQK_Matrix_REG_NUM];
169−};
170−
171166 struct odm_rf_cal {
172167 /* for tx power tracking */
173168 u32 RegA24; /* for TempCCK */
@@ -205,7 +200,6 @@ struct odm_rf_cal { · 31 unmodified lines
205200
206201 u8 ThermalValue_HP[HP_THERMAL_NUM];
207202 u8 ThermalValue_HP_index;
208− struct ijk_matrix_regs_set IQKMatrixRegSetting;
209203
210204 u8 Delta_IQK;
211205 u8 Delta_LCK;
drivers/staging/r8188eu/include/odm_RTL8188E.h+7−0
@@ -11,6 +11,13 @@ · 10 unmodified lines
1111 #define MAIN_ANT_CGCS_RX 0
1212 #define AUX_ANT_CGCS_RX 1
1313
14+#define SET_TX_DESC_ANTSEL_A_88E(__ptxdesc, __value) \
15+ le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(24))
16+#define SET_TX_DESC_ANTSEL_B_88E(__ptxdesc, __value) \
17+ le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(25))
18+#define SET_TX_DESC_ANTSEL_C_88E(__ptxdesc, __value) \
19+ le32p_replace_bits((__le32 *)(__ptxdesc + 28), __value, BIT(29))
20+
1421 void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *pDM_Odm);
1522
1623 void ODM_AntennaDiversity_88E(struct odm_dm_struct *pDM_Odm);
drivers/staging/r8188eu/include/odm_types.h+0−16
@@ -1,16 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2−/* Copyright(c) 2007 - 2011 Realtek Corporation. */
3−
4−#ifndef __ODM_TYPES_H__
5−#define __ODM_TYPES_H__
6−
7−#define ODM_CE 0x04 /* BIT(2) */
8−
9−#define SET_TX_DESC_ANTSEL_A_88E(__ptxdesc, __value) \
10− le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(24))
11−#define SET_TX_DESC_ANTSEL_B_88E(__ptxdesc, __value) \
12− le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(25))
13−#define SET_TX_DESC_ANTSEL_C_88E(__ptxdesc, __value) \
14− le32p_replace_bits((__le32 *)(__ptxdesc + 28), __value, BIT(29))
15−
16−#endif /* __ODM_TYPES_H__ */
drivers/staging/r8188eu/include/osdep_intf.h+3−3
@@ -43,10 +43,10 @@ int netdev_open(struct net_device *pnetdev); · 42 unmodified lines
4343 int netdev_close(struct net_device *pnetdev);
4444
4545 u8 rtw_init_drv_sw(struct adapter *padapter);
46−u8 rtw_free_drv_sw(struct adapter *padapter);
47−u8 rtw_reset_drv_sw(struct adapter *padapter);
46+void rtw_free_drv_sw(struct adapter *padapter);
47+void rtw_reset_drv_sw(struct adapter *padapter);
4848
49−u32 rtw_start_drv_threads(struct adapter *padapter);
49+int rtw_start_drv_threads(struct adapter *padapter);
5050 void rtw_stop_drv_threads (struct adapter *padapter);
5151 void rtw_cancel_all_timer(struct adapter *padapter);
5252
drivers/staging/r8188eu/include/osdep_service.h+3−3
@@ -53,7 +53,7 @@ static inline struct list_head *get_list_head(struct __queue *queue) · 52 unmodified lines
5353 return (&(queue->queue));
5454 }
5555
56−static inline void _set_timer(struct timer_list *ptimer,u32 delay_time)
56+static inline void _set_timer(struct timer_list *ptimer, u32 delay_time)
5757 {
5858 mod_timer(ptimer, jiffies + msecs_to_jiffies(delay_time));
5959 }
@@ -66,7 +66,7 @@ static inline int rtw_netif_queue_stopped(struct net_device *pnetdev) · 6 unmodified lines
6666 netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3));
6767 }
6868
69−extern int RTW_STATUS_CODE(int error_code);
69+int RTW_STATUS_CODE(int error_code);
7070
7171 void *rtw_malloc2d(int h, int w, int size);
7272
@@ -108,7 +108,7 @@ void rtw_free_netdev(struct net_device *netdev); · 35 unmodified lines
108108 #define FUNC_ADPT_FMT "%s(%s)"
109109 #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
110110
111−#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)),(sig), 1)
111+#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)), (sig), 1)
112112
113113 /* Macros for handling unaligned memory accesses */
114114
drivers/staging/r8188eu/include/rtl8188e_hal.h+3−4
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 #include "rtl8188e_xmit.h"
1515 #include "rtl8188e_cmd.h"
1616 #include "rtw_efuse.h"
17−#include "odm_types.h"
1817 #include "odm.h"
1918 #include "odm_HWConfig.h"
2019 #include "odm_RegDefine11N.h"
@@ -88,7 +87,7 @@ struct txpowerinfo24g { · 67 unmodified lines
8887 /* 9bytes + 1byt + 5bytes and pre 1byte. */
8988 /* For worst case: */
9089 /* | 2byte|----8bytes----|1byte|--7bytes--| 92D */
91−/* PG data exclude header, dummy 7 bytes frome CP test and reserved 1byte. */
90+/* PG data exclude header, dummy 7 bytes from CP test and reserved 1byte. */
9291 #define EFUSE_OOB_PROTECT_BYTES_88E 18
9392
9493 #define EFUSE_PROTECT_BYTES_BANK 16
@@ -165,9 +164,9 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *hwinfo, · 70 unmodified lines
165164
166165 void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo,
167166 bool AutoLoadFail);
168−void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter,u8 *PROMContent,
167+void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent,
169168 bool AutoLoadFail);
170−void Hal_ReadThermalMeter_88E(struct adapter * dapter, u8 *PROMContent,
169+void Hal_ReadThermalMeter_88E(struct adapter *padapter, u8 *PROMContent,
171170 bool AutoloadFail);
172171 void Hal_EfuseParseXtal_8188E(struct adapter *pAdapter, u8 *hwinfo,
173172 bool AutoLoadFail);
drivers/staging/r8188eu/include/rtl8188e_spec.h+9−9
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 #ifndef __RTL8188E_SPEC_H__
55 #define __RTL8188E_SPEC_H__
66
7−/* 8192C Regsiter offset definition */
7+/* 8192C Register offset definition */
88
99 #define HAL_PS_TIMER_INT_DELAY 50 /* 50 microseconds */
1010 #define HAL_92C_NAV_UPPER_UNIT 128 /* micro-second */
@@ -674,7 +674,7 @@ Current IOREG MAP · 663 unmodified lines
674674
675675 #define REG_USB_HRPWM 0xFE58
676676 #define REG_USB_HCPWM 0xFE57
677−/* 8192C Regsiter Bit and Content definition */
677+/* 8192C Register Bit and Content definition */
678678 /* 0x0000h ~ 0x00FFh System Configuration */
679679
680680 /* 2 SYS_ISO_CTRL */
@@ -900,12 +900,12 @@ Current IOREG MAP · 219 unmodified lines
900900 #define HQSEL_HIQ BIT(5)
901901
902902 /* For normal driver, 0x10C */
903−#define _TXDMA_HIQ_MAP(x) (((x)&0x3) << 14)
904−#define _TXDMA_MGQ_MAP(x) (((x)&0x3) << 12)
905−#define _TXDMA_BKQ_MAP(x) (((x)&0x3) << 10)
906−#define _TXDMA_BEQ_MAP(x) (((x)&0x3) << 8 )
907−#define _TXDMA_VIQ_MAP(x) (((x)&0x3) << 6 )
908−#define _TXDMA_VOQ_MAP(x) (((x)&0x3) << 4 )
903+#define _TXDMA_HIQ_MAP(x) (((x) & 0x3) << 14)
904+#define _TXDMA_MGQ_MAP(x) (((x) & 0x3) << 12)
905+#define _TXDMA_BKQ_MAP(x) (((x) & 0x3) << 10)
906+#define _TXDMA_BEQ_MAP(x) (((x) & 0x3) << 8)
907+#define _TXDMA_VIQ_MAP(x) (((x) & 0x3) << 6)
908+#define _TXDMA_VOQ_MAP(x) (((x) & 0x3) << 4)
909909
910910 #define QUEUE_LOW 1
911911 #define QUEUE_NORMAL 2
@@ -1135,7 +1135,7 @@ Current IOREG MAP · 223 unmodified lines
11351135 #define EEPROM_Default_CrystalCap_88E 0x20
11361136 #define EEPROM_Default_ThermalMeter_88E 0x18
11371137
1138−/* New EFUSE deafult value */
1138+/* New EFUSE default value */
11391139 #define EEPROM_DEFAULT_24G_INDEX 0x2D
11401140 #define EEPROM_DEFAULT_24G_HT20_DIFF 0X02
11411141 #define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04
drivers/staging/r8188eu/include/rtw_ap.h+1−1
@@ -26,7 +26,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta); · 25 unmodified lines
2626 void sta_info_update(struct adapter *padapter, struct sta_info *psta);
2727 u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
2828 bool active, u16 reason);
29−int rtw_sta_flush(struct adapter *padapter);
29+void rtw_sta_flush(struct adapter *padapter);
3030 void start_ap_mode(struct adapter *padapter);
3131 void stop_ap_mode(struct adapter *padapter);
3232 void update_bmc_sta(struct adapter *padapter);
drivers/staging/r8188eu/include/rtw_cmd.h+30−41
@@ -6,15 +6,10 @@ · 5 unmodified lines
66
77 #include "wlan_bssdef.h"
88 #include "rtw_rf.h"
9−#include "rtw_led.h"
10−
11−#define C2H_MEM_SZ (16*1024)
129
1310 #include "osdep_service.h"
1411 #include "ieee80211.h" /* <ieee80211/ieee80211.h> */
1512
16−#define FREE_CMDOBJ_SZ 128
17−
1813 #define MAX_CMDSZ 1024
1914 #define MAX_RSPSZ 512
2015 #define MAX_EVTSZ 1024
@@ -82,10 +77,10 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd); · 61 unmodified lines
8277
8378 int rtw_cmd_thread(void *context);
8479
85−u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
80+int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
8681 void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv);
8782
88−u32 rtw_init_evt_priv(struct evt_priv *pevtpriv);
83+int rtw_init_evt_priv(struct evt_priv *pevtpriv);
8984 void rtw_free_evt_priv(struct evt_priv *pevtpriv);
9085 void rtw_evt_notify_isr(struct evt_priv *pevtpriv);
9186 u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType);
@@ -445,8 +440,7 @@ struct getrfintfs_parm { · 353 unmodified lines
445440 u8 rfintfs;
446441 };
447442
448−struct Tx_Beacon_param
449−{
443+struct Tx_Beacon_param {
450444 struct wlan_bssid_ex network;
451445 };
452446
@@ -455,7 +449,7 @@ struct Tx_Beacon_param · 2 unmodified lines
455449
456450 mac[0] == 0
457451 ==> CMD mode, return H2C_SUCCESS.
458− The following condition must be ture under CMD mode
452+ The following condition must be true under CMD mode
459453 mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0;
460454 s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7;
461455 s2 == (b1 << 8 | b0);
@@ -508,7 +502,7 @@ struct drvextra_cmd_parm { · 46 unmodified lines
508502 unsigned char *pbuf;
509503 };
510504
511−/*------------------- Below are used for RF/BB tunning ---------------------*/
505+/*------------------- Below are used for RF/BB tuning ---------------------*/
512506
513507 struct setantenna_parm {
514508 u8 tx_antset;
@@ -592,14 +586,14 @@ struct setratable_parm { · 77 unmodified lines
592586 };
593587
594588 struct getratable_parm {
595− uint rsvd;
589+ uint rsvd;
596590 };
597591
598592 struct getratable_rsp {
599− u8 ss_ForceUp[NumRates];
600− u8 ss_ULevel[NumRates];
601− u8 ss_DLevel[NumRates];
602− u8 count_judge[NumRates];
593+ u8 ss_ForceUp[NumRates];
594+ u8 ss_ULevel[NumRates];
595+ u8 ss_DLevel[NumRates];
596+ u8 count_judge[NumRates];
603597 };
604598
605599 /* to get TX,RX retry count */
@@ -682,26 +676,22 @@ struct set_ch_parm { · 76 unmodified lines
682676 };
683677
684678 /*H2C Handler index: 59 */
685−struct SetChannelPlan_param
686−{
679+struct SetChannelPlan_param {
687680 u8 channel_plan;
688681 };
689682
690683 /*H2C Handler index: 60 */
691−struct LedBlink_param
692−{
684+struct LedBlink_param {
693685 struct LED_871x *pLed;
694686 };
695687
696688 /*H2C Handler index: 61 */
697−struct SetChannelSwitch_param
698−{
689+struct SetChannelSwitch_param {
699690 u8 new_ch_no;
700691 };
701692
702693 /*H2C Handler index: 62 */
703−struct TDLSoption_param
704−{
694+struct TDLSoption_param {
705695 u8 addr[ETH_ALEN];
706696 u8 option;
707697 };
@@ -730,31 +720,31 @@ Result: · 22 unmodified lines
730720 #define H2C_CMD_OVERFLOW 0x06
731721 #define H2C_RESERVED 0x07
732722
733−u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num);
734−u8 rtw_createbss_cmd(struct adapter *padapter);
723+u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num);
724+u8 rtw_createbss_cmd(struct adapter *padapter);
735725 u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key);
736726 u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue);
737−u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork);
727+u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork);
738728 u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue);
739−u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype);
740−u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset);
741−u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode);
729+u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype);
730+int rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset);
731+u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode);
742732
743−u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset,u8 *pval);
744−u8 rtw_setfwdig_cmd(struct adapter*padapter, u8 type);
745−u8 rtw_setfwra_cmd(struct adapter*padapter, u8 type);
733+u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset, u8 *pval);
734+u8 rtw_setfwdig_cmd(struct adapter *padapter, u8 type);
735+u8 rtw_setfwra_cmd(struct adapter *padapter, u8 type);
746736
747−u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr);
737+u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr);
748738
749739 u8 rtw_dynamic_chk_wk_cmd(struct adapter *adapter);
750740
751−u8 rtw_lps_ctrl_wk_cmd(struct adapter*padapter, u8 lps_ctrl_type, u8 enqueue);
752−u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime);
741+u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue);
742+u8 rtw_rpt_timer_cfg_cmd(struct adapter *padapter, u16 minRptTime);
753743
754− u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue);
755−u8 rtw_ps_cmd(struct adapter*padapter);
744+u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue);
745+u8 rtw_ps_cmd(struct adapter *padapter);
756746
757−u8 rtw_chk_hi_queue_cmd(struct adapter*padapter);
747+u8 rtw_chk_hi_queue_cmd(struct adapter *padapter);
758748
759749 u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan);
760750
@@ -859,8 +849,7 @@ enum rtw_h2c_cmd { · 98 unmodified lines
859849 #define _SetRFReg_CMD_ _Write_RFREG_CMD_
860850
861851 #ifdef _RTW_CMD_C_
862−static struct _cmd_callback rtw_cmd_callback[] =
863−{
852+static struct _cmd_callback rtw_cmd_callback[] = {
864853 {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
865854 {GEN_CMD_CODE(_Write_MACREG), NULL},
866855 {GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback},
drivers/staging/r8188eu/include/rtw_io.h+1−15
@@ -209,7 +209,7 @@ struct io_priv { · 208 unmodified lines
209209 };
210210
211211 uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
212−void sync_ioreq_enqueue(struct io_req *preq,struct io_queue *ioqueue);
212+void sync_ioreq_enqueue(struct io_req *preq, struct io_queue *ioqueue);
213213 uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue);
214214 uint free_ioreq(struct io_req *preq, struct io_queue *pio_queue);
215215 struct io_req *alloc_ioreq(struct io_queue *pio_q);
@@ -285,18 +285,4 @@ void bus_sync_io(struct io_queue *pio_q); · 69 unmodified lines
285285 u32 _ioreq2rwmem(struct io_queue *pio_q);
286286 void dev_power_down(struct adapter *Adapter, u8 bpwrup);
287287
288−#define PlatformEFIOWrite1Byte(_a,_b,_c) \
289− rtw_write8(_a,_b,_c)
290−#define PlatformEFIOWrite2Byte(_a,_b,_c) \
291− rtw_write16(_a,_b,_c)
292−#define PlatformEFIOWrite4Byte(_a,_b,_c) \
293− rtw_write32(_a,_b,_c)
294−
295−#define PlatformEFIORead1Byte(_a,_b) \
296− rtw_read8(_a,_b)
297−#define PlatformEFIORead2Byte(_a,_b) \
298− rtw_read16(_a,_b)
299−#define PlatformEFIORead4Byte(_a,_b) \
300− rtw_read32(_a,_b)
301−
302288 #endif /* _RTL8711_IO_H_ */
drivers/staging/r8188eu/include/rtw_ioctl_set.h+3−3
@@ -10,10 +10,10 @@ typedef u8 NDIS_802_11_PMKID_VALUE[16]; · 9 unmodified lines
1010
1111 u8 rtw_set_802_11_authentication_mode(struct adapter *adapt,
1212 enum ndis_802_11_auth_mode authmode);
13−u8 rtw_set_802_11_bssid(struct adapter*adapter, u8 *bssid);
13+u8 rtw_set_802_11_bssid(struct adapter *adapter, u8 *bssid);
1414 u8 rtw_set_802_11_add_wep(struct adapter *adapter, struct ndis_802_11_wep *wep);
15−u8 rtw_set_802_11_disassociate(struct adapter *adapter);
16−u8 rtw_set_802_11_bssid_list_scan(struct adapter*adapter,
15+void rtw_set_802_11_disassociate(struct adapter *adapter);
16+u8 rtw_set_802_11_bssid_list_scan(struct adapter *adapter,
1717 struct ndis_802_11_ssid *pssid,
1818 int ssid_max_num);
1919 u8 rtw_set_802_11_infrastructure_mode(struct adapter *adapter,
drivers/staging/r8188eu/include/rtw_led.h+0−3
@@ -33,8 +33,6 @@ enum LED_STATE_871x { · 32 unmodified lines
3333 };
3434
3535 struct led_priv {
36− struct adapter *padapter;
37−
3836 bool bRegUseLed;
3937
4038 enum LED_STATE_871x CurrLedState; /* Current LED state. */
@@ -47,7 +45,6 @@ struct led_priv { · 6 unmodified lines
4745
4846 u32 BlinkTimes; /* Number of times to toggle led state for blinking. */
4947
50− bool bLedLinkBlinkInProgress;
5148 bool bLedScanBlinkInProgress;
5249 struct delayed_work blink_work;
5350 };
drivers/staging/r8188eu/include/rtw_mlme.h+11−18
@@ -101,17 +101,17 @@ struct rt_link_detect { · 100 unmodified lines
101101
102102 struct profile_info {
103103 u8 ssidlen;
104− u8 ssid[ WLAN_SSID_MAXLEN ];
105− u8 peermac[ ETH_ALEN ];
104+ u8 ssid[WLAN_SSID_MAXLEN];
105+ u8 peermac[ETH_ALEN];
106106 };
107107
108108 struct tx_invite_req_info {
109109 u8 token;
110110 u8 benable;
111− u8 go_ssid[ WLAN_SSID_MAXLEN ];
111+ u8 go_ssid[WLAN_SSID_MAXLEN];
112112 u8 ssidlen;
113− u8 go_bssid[ ETH_ALEN ];
114− u8 peer_macaddr[ ETH_ALEN ];
113+ u8 go_bssid[ETH_ALEN];
114+ u8 peer_macaddr[ETH_ALEN];
115115 u8 operating_ch; /* This information will be set by using the
116116 * p2p_set op_ch=x */
117117 u8 peer_ch; /* The listen channel for peer P2P device */
@@ -154,9 +154,9 @@ struct tx_nego_req_info { · 36 unmodified lines
154154 };
155155
156156 struct group_id_info {
157− u8 go_device_addr[ ETH_ALEN ]; /* The GO's device address of
157+ u8 go_device_addr[ETH_ALEN]; /* The GO's device address of
158158 * this P2P group */
159− u8 ssid[ WLAN_SSID_MAXLEN ]; /* The SSID of this P2P group */
159+ u8 ssid[WLAN_SSID_MAXLEN]; /* The SSID of this P2P group */
160160 };
161161
162162 struct scan_limit_info {
@@ -443,11 +443,6 @@ static inline bool check_fwstate(struct mlme_priv *pmlmepriv, int state) · 280 unmodified lines
443443 return false;
444444 }
445445
446−static inline int get_fwstate(struct mlme_priv *pmlmepriv)
447−{
448− return pmlmepriv->fw_state;
449−}
450−
451446 /*
452447 * No Limit on the calling context,
453448 * therefore set it to be the critical section...
@@ -459,7 +454,7 @@ static inline void set_fwstate(struct mlme_priv *pmlmepriv, int state) · 5 unmodified lines
459454 {
460455 pmlmepriv->fw_state |= state;
461456 /* FOR HW integration */
462− if (_FW_UNDER_SURVEY==state)
457+ if (_FW_UNDER_SURVEY == state)
463458 pmlmepriv->bScanInProcess = true;
464459 }
465460
@@ -467,7 +462,7 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state) · 1 unmodified line
467462 {
468463 pmlmepriv->fw_state &= ~state;
469464 /* FOR HW integration */
470− if (_FW_UNDER_SURVEY==state)
465+ if (_FW_UNDER_SURVEY == state)
471466 pmlmepriv->bScanInProcess = false;
472467 }
473468
@@ -528,7 +523,7 @@ void rtw_indicate_scan_done(struct adapter *padapter); · 54 unmodified lines
528523 int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
529524 uint in_len);
530525 int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
531− uint in_len, uint initial_out_len);
526+ uint in_len, uint initial_out_len);
532527 void rtw_init_registrypriv_dev_network(struct adapter *adapter);
533528
534529 void rtw_update_registrypriv_dev_network(struct adapter *adapter);
@@ -544,10 +539,8 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv); · 9 unmodified lines
544539
545540 void _rtw_free_network(struct mlme_priv *pmlmepriv,
546541 struct wlan_network *pnetwork, u8 isfreeall);
547−void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv,
548− struct wlan_network *pnetwork);
549542
550−struct wlan_network* _rtw_find_network(struct __queue *scanned_queue, u8 *addr);
543+struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr);
551544
552545 void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall);
553546
drivers/staging/r8188eu/include/rtw_mlme_ext.h+14−44
@@ -184,7 +184,7 @@ enum SCAN_STATE { · 183 unmodified lines
184184 SCAN_STATE_MAX,
185185 };
186186
187−typedef unsigned int (*mlme_handler)(struct adapter *adapt, struct recv_frame *frame);
187+typedef void (*mlme_handler)(struct adapter *adapt, struct recv_frame *frame);
188188
189189 struct ss_res {
190190 int state;
@@ -285,7 +285,6 @@ struct mlme_ext_info { · 94 unmodified lines
285285 u8 bwmode_updated;
286286 u8 hidden_ssid_mode;
287287
288− struct ADDBA_request ADDBA_req;
289288 struct WMM_para_element WMM_param;
290289 struct HT_caps_element HT_caps;
291290 struct HT_info_element HT_info;
@@ -388,7 +387,7 @@ struct mlme_ext_priv { · 96 unmodified lines
388387 void init_mlme_ext_priv(struct adapter *adapter);
389388 int init_hw_mlme_ext(struct adapter *padapter);
390389 void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext);
391−extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
390+struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
392391
393392 unsigned char networktype_to_raid(unsigned char network_type);
394393 u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len);
@@ -432,9 +431,9 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src, · 37 unmodified lines
432431 u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
433432 u16 get_beacon_interval(struct wlan_bssid_ex *bss);
434433
435−int is_client_associated_to_ap(struct adapter *padapter);
436−int is_client_associated_to_ibss(struct adapter *padapter);
437−int is_IBSS_empty(struct adapter *padapter);
434+bool r8188eu_is_client_associated_to_ap(struct adapter *padapter);
435+bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter);
436+bool r8188eu_is_ibss_empty(struct adapter *padapter);
438437
439438 unsigned char check_assoc_AP(u8 *pframe, uint len);
440439
@@ -448,8 +447,7 @@ void HTOnAssocRsp(struct adapter *padapter); · 7 unmodified lines
448447 void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE);
449448 void VCS_update(struct adapter *padapter, struct sta_info *psta);
450449
451−void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len,
452− struct sta_info *psta);
450+void update_beacon_info(struct adapter *padapter, u8 *ie_ptr, uint ie_len, struct sta_info *psta);
453451 int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len);
454452 void update_IOT_info(struct adapter *padapter);
455453 void update_capinfo(struct adapter *adapter, u16 updatecap);
@@ -479,11 +477,11 @@ void report_survey_event(struct adapter *padapter, struct recv_frame *precv_fram · 23 unmodified lines
479477 void report_surveydone_event(struct adapter *padapter);
480478 void report_del_sta_event(struct adapter *padapter,
481479 unsigned char *addr, unsigned short reason);
482−void report_add_sta_event(struct adapter *padapter, unsigned char* addr,
480+void report_add_sta_event(struct adapter *padapter, unsigned char *addr,
483481 int cam_idx);
484482
485483 void beacon_timing_control(struct adapter *padapter);
486−extern u8 set_tx_beacon_cmd(struct adapter*padapter);
484+u8 set_tx_beacon_cmd(struct adapter *padapter);
487485 unsigned int setup_beacon_frame(struct adapter *padapter,
488486 unsigned char *beacon_frame);
489487 void update_mgnt_tx_rate(struct adapter *padapter, u8 rate);
@@ -499,10 +497,10 @@ void issue_probersp_p2p(struct adapter *padapter, unsigned char *da); · 9 unmodified lines
499497 void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid,
500498 u8 ussidlen, u8 *pdev_raddr);
501499 void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr);
502−void issue_probereq_p2p(struct adapter *padapter, u8 *da);
500+void issue_probereq_p2p(struct adapter *padapter);
503501 void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr,
504502 u8 dialogToken, u8 success);
505−void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr);
503+void issue_p2p_invitation_request(struct adapter *padapter, u8 *raddr);
506504 void issue_beacon(struct adapter *padapter, int timeout_ms);
507505 void issue_probersp(struct adapter *padapter, unsigned char *da,
508506 u8 is_valid_p2p_probereq);
@@ -513,8 +511,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, · 4 unmodified lines
513511 unsigned short status);
514512 void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid,
515513 u8 *da);
516−s32 issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid,
517− u8* da, int try_cnt, int wait_ms);
514+void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da);
518515 int issue_nulldata(struct adapter *padapter, unsigned char *da,
519516 unsigned int power_mode, int try_cnt, int wait_ms);
520517 int issue_qos_nulldata(struct adapter *padapter, unsigned char *da,
@@ -523,7 +520,8 @@ int issue_deauth(struct adapter *padapter, unsigned char *da, · 2 unmodified lines
523520 unsigned short reason);
524521 int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason,
525522 int try_cnt, int wait_ms);
526−void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, u16 status);
523+void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action,
524+ u16 status, struct ieee80211_mgmt *mgmt_req);
527525 unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr);
528526 unsigned int send_beacon(struct adapter *padapter);
529527 bool get_beacon_valid_bit(struct adapter *adapter);
@@ -536,34 +534,6 @@ void start_clnt_auth(struct adapter *padapter); · 6 unmodified lines
536534 void start_clnt_join(struct adapter *padapter);
537535 void start_create_ibss(struct adapter *padapter);
538536
539−unsigned int OnAssocReq(struct adapter *padapter,
540− struct recv_frame *precv_frame);
541−unsigned int OnAssocRsp(struct adapter *padapter,
542− struct recv_frame *precv_frame);
543−unsigned int OnProbeReq(struct adapter *padapter,
544− struct recv_frame *precv_frame);
545−unsigned int OnProbeRsp(struct adapter *padapter,
546− struct recv_frame *precv_frame);
547−unsigned int OnBeacon(struct adapter *padapter,
548− struct recv_frame *precv_frame);
549−unsigned int OnDisassoc(struct adapter *padapter,
550− struct recv_frame *precv_frame);
551−unsigned int OnAuth(struct adapter *padapter,
552− struct recv_frame *precv_frame);
553−unsigned int OnAuthClient(struct adapter *padapter,
554− struct recv_frame *precv_frame);
555−unsigned int OnDeAuth(struct adapter *padapter,
556− struct recv_frame *precv_frame);
557−unsigned int OnAction(struct adapter *padapter,
558− struct recv_frame *precv_frame);
559−
560−unsigned int OnAction_back(struct adapter *padapter,
561− struct recv_frame *precv_frame);
562−unsigned int on_action_public(struct adapter *padapter,
563− struct recv_frame *precv_frame);
564−unsigned int OnAction_p2p(struct adapter *padapter,
565− struct recv_frame *precv_frame);
566−
567537 void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res);
568538 void mlmeext_sta_del_event_callback(struct adapter *padapter);
569539 void mlmeext_sta_add_event_callback(struct adapter *padapter,
@@ -729,7 +699,7 @@ enum rtw_c2h_event { · 159 unmodified lines
729699 GEN_EVT_CODE(_Survey), /*8*/
730700 GEN_EVT_CODE(_SurveyDone), /*9*/
731701
732− GEN_EVT_CODE(_JoinBss) , /*10*/
702+ GEN_EVT_CODE(_JoinBss), /*10*/
733703 GEN_EVT_CODE(_AddSTA),
734704 GEN_EVT_CODE(_DelSTA),
735705 GEN_EVT_CODE(_AtimDone),
drivers/staging/r8188eu/include/rtw_recv.h+2−2
@@ -92,7 +92,7 @@ struct rx_pkt_attrib { · 91 unmodified lines
9292 u8 privacy; /* in frame_ctrl field */
9393 u8 bdecrypted;
9494 u8 encrypt; /* when 0 indicate no encrypt. when non-zero,
95− * indicate the encrypt algorith */
95+ * indicate the encrypt algorithm */
9696 u8 iv_len;
9797 u8 icv_len;
9898 u8 crc_err;
@@ -175,7 +175,7 @@ struct recv_priv { · 76 unmodified lines
175175 u8 *precv_buf; /* 4 alignment */
176176 struct __queue free_recv_buf_queue;
177177 u32 free_recv_buf_queue_cnt;
178− /* For display the phy informatiom */
178+ /* For display the phy information */
179179 u8 is_signal_dbg; /* for debug */
180180 u8 signal_strength_dbg; /* for debug */
181181 s8 rssi;
drivers/staging/r8188eu/include/rtw_xmit.h+2−2
@@ -116,7 +116,7 @@ struct pkt_attrib { · 115 unmodified lines
116116 u32 last_txcmdsz;
117117 u8 nr_frags;
118118 u8 encrypt; /* when 0 indicate no encrypt. when non-zero,
119− * indicate the encrypt algorith */
119+ * indicate the encrypt algorithm */
120120 u8 iv_len;
121121 u8 icv_len;
122122 u8 iv[18];
@@ -351,7 +351,7 @@ s32 rtw_txframes_pending(struct adapter *padapter); · 228 unmodified lines
351351 s32 rtw_txframes_sta_ac_pending(struct adapter *padapter,
352352 struct pkt_attrib *pattrib);
353353 void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry);
354−s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter);
354+int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter);
355355 void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv);
356356 int rtw_alloc_hwxmits(struct adapter *padapter);
357357 void rtw_free_hwxmits(struct adapter *padapter);
drivers/staging/r8188eu/include/sta_info.h+9−9
@@ -295,19 +295,19 @@ static inline u32 wifi_mac_hash(u8 *mac) · 294 unmodified lines
295295 return x;
296296 }
297297
298−extern u32 _rtw_init_sta_priv(struct sta_priv *pstapriv);
299−extern void _rtw_free_sta_priv(struct sta_priv *pstapriv);
298+int _rtw_init_sta_priv(struct sta_priv *pstapriv);
299+void _rtw_free_sta_priv(struct sta_priv *pstapriv);
300300
301301 #define stainfo_offset_valid(offset) (offset < NUM_STA && offset >= 0)
302302 int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta);
303303 struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int off);
304304
305−extern struct sta_info *rtw_alloc_stainfo(struct sta_priv *stapriv, u8 *hwaddr);
306−extern u32 rtw_free_stainfo(struct adapter *adapt, struct sta_info *psta);
307−extern void rtw_free_all_stainfo(struct adapter *adapt);
308−extern struct sta_info *rtw_get_stainfo(struct sta_priv *stapriv, u8 *hwaddr);
309−extern u32 rtw_init_bcmc_stainfo(struct adapter *adapt);
310−extern struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter);
311−extern u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr);
305+struct sta_info *rtw_alloc_stainfo(struct sta_priv *stapriv, u8 *hwaddr);
306+void rtw_free_stainfo(struct adapter *adapt, struct sta_info *psta);
307+void rtw_free_all_stainfo(struct adapter *adapt);
308+struct sta_info *rtw_get_stainfo(struct sta_priv *stapriv, u8 *hwaddr);
309+u32 rtw_init_bcmc_stainfo(struct adapter *adapt);
310+struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter);
311+u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr);
312312
313313 #endif /* _STA_INFO_H_ */
drivers/staging/r8188eu/include/wifi.h+6−71
@@ -140,7 +140,6 @@ enum WIFI_REG_DOMAIN { · 139 unmodified lines
140140 #define _PWRMGT_ BIT(12)
141141 #define _MORE_DATA_ BIT(13)
142142 #define _PRIVACY_ BIT(14)
143−#define _ORDER_ BIT(15)
144143
145144 #define SetToDs(pbuf) \
146145 *(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_)
@@ -171,9 +170,6 @@ enum WIFI_REG_DOMAIN { · 24 unmodified lines
171170 #define SetPrivacy(pbuf) \
172171 *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_)
173172
174−#define GetPrivacy(pbuf) \
175− (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0)
176−
177173 #define GetFrameType(pbuf) \
178174 (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2)))
179175
@@ -187,17 +183,6 @@ enum WIFI_REG_DOMAIN { · 7 unmodified lines
187183 *(__le16 *)(pbuf) |= cpu_to_le16(type); \
188184 } while (0)
189185
190−#define GetTupleCache(pbuf) \
191− (cpu_to_le16(*(unsigned short *)((size_t)(pbuf) + 22)))
192−
193−#define SetFragNum(pbuf, num) \
194− do { \
195− *(unsigned short *)((size_t)(pbuf) + 22) = \
196− ((*(unsigned short *)((size_t)(pbuf) + 22)) & \
197− le16_to_cpu(~(0x000f))) | \
198− cpu_to_le16(0x0f & (num)); \
199− } while (0)
200−
201186 #define SetSeqNum(pbuf, num) \
202187 do { \
203188 *(__le16 *)((size_t)(pbuf) + 22) = \
@@ -221,13 +206,6 @@ enum WIFI_REG_DOMAIN { · 17 unmodified lines
221206
222207 #define GetAMsdu(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 7) & 0x1)
223208
224−#define SetAMsdu(pbuf, amsdu) \
225− *(__le16 *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7)
226−
227−#define GetTid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + \
228− (((GetToDs(pbuf)<<1) | GetFrDs(pbuf)) == 3 ? \
229− 30 : 24))) & 0x000f)
230−
231209 #define GetAddr1Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 4))
232210
233211 #define GetAddr2Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 10))
@@ -236,33 +214,6 @@ enum WIFI_REG_DOMAIN { · 2 unmodified lines
236214
237215 #define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24))
238216
239−static inline bool IS_MCAST(unsigned char *da)
240−{
241− return (*da) & 0x01;
242−}
243−
244−static inline unsigned char *get_da(unsigned char *pframe)
245−{
246− unsigned char *da;
247− unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
248−
249− switch (to_fr_ds) {
250− case 0x00: /* ToDs=0, FromDs=0 */
251− da = GetAddr1Ptr(pframe);
252− break;
253− case 0x01: /* ToDs=0, FromDs=1 */
254− da = GetAddr1Ptr(pframe);
255− break;
256− case 0x02: /* ToDs=1, FromDs=0 */
257− da = GetAddr3Ptr(pframe);
258− break;
259− default: /* ToDs=1, FromDs=1 */
260− da = GetAddr3Ptr(pframe);
261− break;
262− }
263− return da;
264−}
265−
266217 static inline unsigned char *get_sa(unsigned char *pframe)
267218 {
268219 unsigned char *sa;
@@ -415,14 +366,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe) · 146 unmodified lines
415366 Below is the definition for 802.11n
416367 ------------------------------------------------------------------------------*/
417368
418−#define SetOrderBit(pbuf) \
419− do { \
420− *(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \
421− } while (0)
422−
423−#define GetOrderBit(pbuf) \
424− (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
425−
426369 /**
427370 * struct rtw_ieee80211_bar - HT Block Ack Request
428371 *
@@ -484,14 +427,6 @@ struct WMM_para_element { · 55 unmodified lines
484427 struct AC_param ac_param[4];
485428 } __packed;
486429
487−struct ADDBA_request {
488− unsigned char action_code;
489− unsigned char dialog_token;
490− __le16 BA_para_set;
491− __le16 BA_timeout_value;
492− __le16 BA_starting_seqctrl;
493−} __packed;
494−
495430 #define MAX_AMPDU_FACTOR_64K 3
496431
497432 /* Spatial Multiplexing Power Save Modes */
@@ -701,7 +636,7 @@ struct ADDBA_request { · 203 unmodified lines
701636
702637 #define P2P_WILDCARD_SSID_LEN 7
703638
704−/* default value, used when: (1)p2p disabed or (2)p2p enabled
639+/* default value, used when: (1)p2p disabled or (2)p2p enabled
705640 * but only do 1 scan phase */
706641 #define P2P_FINDPHASE_EX_NONE 0
707642 /* used when p2p enabled and want to do 1 scan phase and
@@ -766,11 +701,11 @@ enum P2P_STATE { · 58 unmodified lines
766701 P2P_STATE_TX_PROVISION_DIS_REQ = 6,
767702 P2P_STATE_RX_PROVISION_DIS_RSP = 7,
768703 P2P_STATE_RX_PROVISION_DIS_REQ = 8,
769− /* Doing the group owner negoitation handshake */
704+ /* Doing the group owner negotiation handshake */
770705 P2P_STATE_GONEGO_ING = 9,
771− /* finish the group negoitation handshake with success */
706+ /* finish the group negotiation handshake with success */
772707 P2P_STATE_GONEGO_OK = 10,
773− /* finish the group negoitation handshake with failure */
708+ /* finish the group negotiation handshake with failure */
774709 P2P_STATE_GONEGO_FAIL = 11,
775710 /* receiving the P2P Inviation request and match with the profile. */
776711 P2P_STATE_RECV_INVITE_REQ_MATCH = 12,
@@ -790,9 +725,9 @@ enum P2P_STATE { · 13 unmodified lines
790725 P2P_STATE_RECV_INVITE_REQ_JOIN = 19,
791726 /* recveing the P2P Inviation response with failure */
792727 P2P_STATE_RX_INVITE_RESP_FAIL = 20,
793− /* receiving p2p negoitation response with information is not available */
728+ /* receiving p2p negotiation response with information is not available */
794729 P2P_STATE_RX_INFOR_NOREADY = 21,
795− /* sending p2p negoitation response with information is not available */
730+ /* sending p2p negotiation response with information is not available */
796731 P2P_STATE_TX_INFOR_NOREADY = 22,
797732 };
798733
drivers/staging/r8188eu/include/wlan_bssdef.h+0−51
@@ -17,14 +17,6 @@ struct ndis_802_11_ssid { · 16 unmodified lines
1717 u8 Ssid[32];
1818 };
1919
20−enum NDIS_802_11_NETWORK_TYPE {
21− Ndis802_11FH,
22− Ndis802_11DS,
23− Ndis802_11OFDM5,
24− Ndis802_11OFDM24,
25− Ndis802_11NetworkTypeMax /* dummy upper bound */
26−};
27−
2820 struct ndis_802_11_config_fh {
2921 u32 Length; /* Length of structure */
3022 u32 HopPattern; /* As defined by 802.11, MSB set */
@@ -185,20 +177,6 @@ struct ndis_802_11_status_ind { · 154 unmodified lines
185177 /* MIC check time, 60 seconds. */
186178 #define MIC_CHECK_TIME 60000000
187179
188−struct ndis_802_11_auth_evt {
189− struct ndis_802_11_status_ind Status;
190− struct ndis_802_11_auth_req Request[1];
191−};
192−
193−struct ndis_802_11_test {
194− u32 Length;
195− u32 Type;
196− union {
197− struct ndis_802_11_auth_evt AuthenticationEvent;
198− NDIS_802_11_RSSI RssiTrigger;
199− } tt;
200−};
201−
202180 #ifndef Ndis802_11APMode
203181 #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
204182 #endif
@@ -233,7 +211,6 @@ struct wlan_bssid_ex { · 28 unmodified lines
233211 struct ndis_802_11_ssid Ssid;
234212 u32 Privacy;
235213 NDIS_802_11_RSSI Rssi;/* in dBM,raw data ,get from PHY) */
236− enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
237214 struct ndis_802_11_config Configuration;
238215 enum ndis_802_11_network_infra InfrastructureMode;
239216 unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
@@ -288,34 +265,6 @@ enum UAPSD_MAX_SP { · 48 unmodified lines
288265 #define NUM_PRE_AUTH_KEY 16
289266 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
290267
291−/*
292−* WPA2
293−*/
294−
295−struct pmkid_candidate {
296− unsigned char BSSID[ETH_ALEN];
297− u32 Flags;
298−};
299−
300−struct ndis_802_11_pmkid_list {
301− u32 Version; /* Version of the structure */
302− u32 NumCandidates; /* No. of pmkid candidates */
303− struct pmkid_candidate CandidateList[1];
304−};
305−
306−struct ndis_802_11_auth_encrypt {
307− enum ndis_802_11_auth_mode AuthModeSupported;
308− enum ndis_802_11_wep_status EncryptStatusSupported;
309−};
310−
311−struct ndis_802_11_cap {
312− u32 Length;
313− u32 Version;
314− u32 NoOfPMKIDs;
315− u32 NoOfAuthEncryptPairsSupported;
316− struct ndis_802_11_auth_encrypt AuthenticationEncryptionSupported[1];
317−};
318−
319268 u8 key_2char2num(u8 hch, u8 lch);
320269 u8 key_char2num(u8 ch);
321270 u8 str_2char2num(u8 hch, u8 lch);
drivers/staging/r8188eu/os_dep/ioctl_linux.c+10−18
@@ -1011,7 +1011,6 @@ static int rtw_wx_set_mlme(struct net_device *dev, · 1010 unmodified lines
10111011 struct iw_request_info *info,
10121012 union iwreq_data *wrqu, char *extra)
10131013 {
1014− int ret = 0;
10151014 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
10161015 struct iw_mlme *mlme = (struct iw_mlme *)extra;
10171016
@@ -1020,17 +1019,15 @@ static int rtw_wx_set_mlme(struct net_device *dev, · 2 unmodified lines
10201019
10211020 switch (mlme->cmd) {
10221021 case IW_MLME_DEAUTH:
1023− if (!rtw_set_802_11_disassociate(padapter))
1024− ret = -1;
1022+ rtw_set_802_11_disassociate(padapter);
10251023 break;
10261024 case IW_MLME_DISASSOC:
1027− if (!rtw_set_802_11_disassociate(padapter))
1028− ret = -1;
1025+ rtw_set_802_11_disassociate(padapter);
10291026 break;
10301027 default:
10311028 return -EOPNOTSUPP;
10321029 }
1033− return ret;
1030+ return 0;
10341031 }
10351032
10361033 static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
@@ -1340,7 +1337,7 @@ static int rtw_wx_set_rate(struct net_device *dev, · 303 unmodified lines
13401337 struct iw_request_info *a,
13411338 union iwreq_data *wrqu, char *extra)
13421339 {
1343− int i, ret = 0;
1340+ int i;
13441341 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
13451342 u8 datarates[NumRates];
13461343 u32 target_rate = wrqu->bitrate.value;
@@ -1408,10 +1405,7 @@ set_rate: · 61 unmodified lines
14081405 }
14091406 }
14101407
1411− if (rtw_setdatarate_cmd(padapter, datarates) != _SUCCESS)
1412− ret = -1;
1413−
1414− return ret;
1408+ return rtw_setdatarate_cmd(padapter, datarates);
14151409 }
14161410
14171411 static int rtw_wx_get_rate(struct net_device *dev,
@@ -2647,7 +2641,7 @@ static int rtw_p2p_connect(struct net_device *dev, · 1229 unmodified lines
26472641 u32 peer_channel = 0;
26482642
26492643 /* Commented by Albert 20110304 */
2650− /* The input data contains two informations. */
2644+ /* The input data contains two information. */
26512645 /* 1. First information is the MAC address which wants to formate with */
26522646 /* 2. Second information is the WPS PINCode or "pbc" string for push button method */
26532647 /* Format: 00:E0:4C:00:00:05 */
@@ -2721,7 +2715,7 @@ static void rtw_p2p_invite_req(struct net_device *dev, · 67 unmodified lines
27212715 uint p2pielen = 0, attr_contentlen = 0;
27222716 struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info;
27232717
2724− /* The input data contains two informations. */
2718+ /* The input data contains two information items. */
27252719 /* 1. First information is the P2P device address which you want to send to. */
27262720 /* 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. */
27272721 /* Command line sample: iwpriv wlan0 p2p_set invite ="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */
@@ -2845,7 +2839,7 @@ static void rtw_p2p_prov_disc(struct net_device *dev, · 117 unmodified lines
28452839 u8 *p2pie;
28462840 uint p2pielen = 0, attr_contentlen = 0;
28472841
2848− /* The input data contains two informations. */
2842+ /* The input data contains two information items. */
28492843 /* 1. First information is the MAC address which wants to issue the provisioning discovery request frame. */
28502844 /* 2. Second information is the WPS configuration method which wants to discovery */
28512845 /* Format: 00:E0:4C:00:00:05_display */
@@ -2979,8 +2973,6 @@ static int rtw_p2p_set(struct net_device *dev, · 127 unmodified lines
29792973 struct iw_request_info *info,
29802974 union iwreq_data *wrqu, char *extra)
29812975 {
2982− int ret = 0;
2983−
29842976 if (!memcmp(extra, "enable =", 7)) {
29852977 rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]);
29862978 } else if (!memcmp(extra, "setDN =", 6)) {
@@ -3027,7 +3019,7 @@ static int rtw_p2p_set(struct net_device *dev, · 40 unmodified lines
30273019 rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]);
30283020 }
30293021
3030− return ret;
3022+ return 0;
30313023 }
30323024
30333025 static int rtw_p2p_get2(struct net_device *dev,
@@ -3568,7 +3560,7 @@ static int rtw_wx_set_priv(struct net_device *dev, · 534 unmodified lines
35683560
35693561 if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
35703562 (!memcmp(&probereq_wpsie[2], wps_oui, 4))) {
3571− cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len;
3563+ cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN);
35723564
35733565 pmlmepriv->wps_probe_req_ie_len = 0;
35743566 kfree(pmlmepriv->wps_probe_req_ie);
drivers/staging/r8188eu/os_dep/os_intfs.c+15−26
@@ -363,18 +363,16 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter) · 362 unmodified lines
363363 return pnetdev;
364364 }
365365
366−u32 rtw_start_drv_threads(struct adapter *padapter)
366+int rtw_start_drv_threads(struct adapter *padapter)
367367 {
368− u32 _status = _SUCCESS;
369−
370368 padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD");
371369 if (IS_ERR(padapter->cmdThread))
372− _status = _FAIL;
373− else
374− /* wait for rtw_cmd_thread() to start running */
375− wait_for_completion(&padapter->cmdpriv.start_cmd_thread);
370+ return PTR_ERR(padapter->cmdThread);
376371
377− return _status;
372+ /* wait for rtw_cmd_thread() to start running */
373+ wait_for_completion(&padapter->cmdpriv.start_cmd_thread);
374+
375+ return 0;
378376 }
379377
380378 void rtw_stop_drv_threads(struct adapter *padapter)
@@ -407,7 +405,7 @@ static void rtw_init_default_value(struct adapter *padapter) · 26 unmodified lines
407405 pmlmepriv->htpriv.ampdu_enable = false;/* set to disabled */
408406
409407 /* security_priv */
410− psecuritypriv->binstallGrpkey = _FAIL;
408+ psecuritypriv->binstallGrpkey = false;
411409 psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt;
412410 psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt;
413411 psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
@@ -433,7 +431,7 @@ static void rtw_init_default_value(struct adapter *padapter) · 19 unmodified lines
433431 padapter->bShowGetP2PState = 1;
434432 }
435433
436−u8 rtw_reset_drv_sw(struct adapter *padapter)
434+void rtw_reset_drv_sw(struct adapter *padapter)
437435 {
438436 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
439437
@@ -455,25 +453,23 @@ u8 rtw_reset_drv_sw(struct adapter *padapter) · 15 unmodified lines
455453 padapter->mlmeextpriv.sitesurvey_res.state = SCAN_DISABLE;
456454
457455 rtw_set_signal_stat_timer(&padapter->recvpriv);
458−
459− return _SUCCESS;
460456 }
461457
462458 u8 rtw_init_drv_sw(struct adapter *padapter)
463459 {
464− if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
460+ if (rtw_init_cmd_priv(&padapter->cmdpriv)) {
465461 dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_cmd_priv failed\n");
466462 return _FAIL;
467463 }
468464
469465 padapter->cmdpriv.padapter = padapter;
470466
471− if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
467+ if (rtw_init_evt_priv(&padapter->evtpriv)) {
472468 dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_evt_priv failed\n");
473469 goto free_cmd_priv;
474470 }
475471
476− if (rtw_init_mlme_priv(padapter) == _FAIL) {
472+ if (rtw_init_mlme_priv(padapter)) {
477473 dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_mlme_priv failed\n");
478474 goto free_evt_priv;
479475 }
@@ -484,7 +480,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) · 4 unmodified lines
484480
485481 init_mlme_ext_priv(padapter);
486482
487− if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) {
483+ if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter)) {
488484 dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_xmit_priv failed\n");
489485 goto free_mlme_ext;
490486 }
@@ -494,7 +490,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) · 3 unmodified lines
494490 goto free_xmit_priv;
495491 }
496492
497− if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
493+ if (_rtw_init_sta_priv(&padapter->stapriv)) {
498494 dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_sta_priv failed\n");
499495 goto free_recv_priv;
500496 }
@@ -550,7 +546,7 @@ void rtw_cancel_all_timer(struct adapter *padapter) · 49 unmodified lines
550546 _cancel_timer_ex(&padapter->recvpriv.signal_stat_timer);
551547 }
552548
553−u8 rtw_free_drv_sw(struct adapter *padapter)
549+void rtw_free_drv_sw(struct adapter *padapter)
554550 {
555551 /* we can call rtw_p2p_enable here, but: */
556552 /* 1. rtw_p2p_enable may have IO operation */
@@ -587,8 +583,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter) · 30 unmodified lines
587583 /* clear pbuddystruct adapter to avoid access wrong pointer. */
588584 if (padapter->pbuddy_adapter)
589585 padapter->pbuddy_adapter->pbuddy_adapter = NULL;
590−
591− return _SUCCESS;
592586 }
593587
594588 void netdev_br_init(struct net_device *netdev)
@@ -624,7 +618,6 @@ static int _netdev_open(struct net_device *pnetdev) · 29 unmodified lines
624618 if (!padapter->bup) {
625619 padapter->bDriverStopped = false;
626620 padapter->bSurpriseRemoved = false;
627− padapter->bCardDisableWOHSM = false;
628621
629622 status = rtw_hal_init(padapter);
630623 if (status == _FAIL)
@@ -632,8 +625,7 @@ static int _netdev_open(struct net_device *pnetdev) · 1 unmodified line
632625
633626 netdev_dbg(pnetdev, "MAC Address = %pM\n", pnetdev->dev_addr);
634627
635− status = rtw_start_drv_threads(padapter);
636− if (status == _FAIL) {
628+ if (rtw_start_drv_threads(padapter)) {
637629 pr_info("Initialize driver software resource Failed!\n");
638630 goto netdev_open_error;
639631 }
@@ -690,7 +682,6 @@ static int ips_netdrv_open(struct adapter *padapter) · 50 unmodified lines
690682
691683 padapter->bDriverStopped = false;
692684 padapter->bSurpriseRemoved = false;
693− padapter->bCardDisableWOHSM = false;
694685
695686 status = rtw_hal_init(padapter);
696687 if (status == _FAIL)
@@ -722,13 +713,11 @@ int rtw_ips_pwr_up(struct adapter *padapter) · 25 unmodified lines
722713
723714 void rtw_ips_pwr_down(struct adapter *padapter)
724715 {
725− padapter->bCardDisableWOHSM = true;
726716 padapter->net_closed = true;
727717
728718 rtw_led_control(padapter, LED_CTL_POWER_OFF);
729719
730720 rtw_ips_dev_unload(padapter);
731− padapter->bCardDisableWOHSM = false;
732721 }
733722
734723 static void rtw_fifo_cleanup(struct adapter *adapter)
drivers/staging/rtl8192e/TODO+17−1
@@ -1,2 +1,18 @@
1−* merge into drivers/net/wireless/rtllib/rtl8192e
1+To-do list:
2+
3+* merge into drivers/net/wireless/realtek/rtlwifi/rtl8192*
24 * clean up function naming
5+* Correct the coding style according to Linux guidelines; please read the document
6+ at https://www.kernel.org/doc/html/latest/process/coding-style.html.
7+* Remove unnecessary debugging/printing macros; for those that are still needed
8+ use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()).
9+* Remove dead code such as unusued functions, variables, fields, etc..
10+* Use in-kernel API and remove unnecessary wrappers where possible.
11+* Fix bugs due to code that sleeps in atomic context.
12+* Remove the HAL layer and migrate its functionality into the relevant parts of
13+ the driver.
14+* Switch to use LIB80211.
15+* Switch to use MAC80211.
16+* Switch to use CFG80211.
17+* Improve the error handling of various functions, particularly those that use
18+ existing kernel APIs.
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h+0−15
@@ -154,21 +154,6 @@ struct tx_fwinfo_8190pci { · 153 unmodified lines
154154
155155 };
156156
157−struct log_int_8190 {
158− u32 nIMR_COMDOK;
159− u32 nIMR_MGNTDOK;
160− u32 nIMR_HIGH;
161− u32 nIMR_VODOK;
162− u32 nIMR_VIDOK;
163− u32 nIMR_BEDOK;
164− u32 nIMR_BKDOK;
165− u32 nIMR_ROK;
166− u32 nIMR_RCOK;
167− u32 nIMR_TBDOK;
168− u32 nIMR_BDOK;
169− u32 nIMR_RXFOVW;
170−};
171−
172157 struct phy_ofdm_rx_status_rxsc_sgien_exintfflag {
173158 u8 reserved:4;
174159 u8 rxsc:2;
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c+22−33
@@ -224,8 +224,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) · 223 unmodified lines
224224 u8 acm = pAciAifsn->f.acm;
225225 u8 AcmCtrl = rtl92e_readb(dev, AcmHwCtrl);
226226
227− AcmCtrl = AcmCtrl | ((priv->AcmMethod == 2) ? 0x0 : 0x1);
228−
229227 if (acm) {
230228 switch (eACI) {
231229 case AC0_BE:
@@ -474,10 +472,10 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev) · 242 unmodified lines
474472
475473 priv->rf_chip = RF_8256;
476474
477− if (priv->RegChannelPlan == 0xf)
475+ if (priv->reg_chnl_plan == 0xf)
478476 priv->ChannelPlan = priv->eeprom_ChannelPlan;
479477 else
480− priv->ChannelPlan = priv->RegChannelPlan;
478+ priv->ChannelPlan = priv->reg_chnl_plan;
481479
482480 if (priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304)
483481 priv->CustomerID = RT_CID_DLINK;
@@ -503,7 +501,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev) · 19 unmodified lines
503501 priv->ChannelPlan = 0x0;
504502 break;
505503 case EEPROM_CID_Nettronix:
506− priv->ScanDelay = 100;
507504 priv->CustomerID = RT_CID_Nettronix;
508505 break;
509506 case EEPROM_CID_Pronet:
@@ -618,15 +615,12 @@ bool rtl92e_start_adapter(struct net_device *dev) · 108 unmodified lines
618615 start:
619616 rtl92e_reset_desc_ring(dev);
620617 priv->Rf_Mode = RF_OP_By_SW_3wire;
621− if (priv->ResetProgress == RESET_TYPE_NORESET) {
618+ if (priv->rst_progress == RESET_TYPE_NORESET) {
622619 rtl92e_writeb(dev, ANAPAR, 0x37);
623620 mdelay(500);
624621 }
625622 priv->pFirmware->status = FW_STATUS_0_INIT;
626623
627− if (priv->RegRfOff)
628− priv->rtllib->rf_power_state = rf_off;
629−
630624 ulRegRead = rtl92e_readl(dev, CPU_GEN);
631625 if (priv->pFirmware->status == FW_STATUS_0_INIT)
632626 ulRegRead |= CPU_GEN_SYSTEM_RESET;
@@ -654,7 +648,7 @@ start: · 21 unmodified lines
654648 }
655649
656650 priv->LoopbackMode = RTL819X_NO_LOOPBACK;
657− if (priv->ResetProgress == RESET_TYPE_NORESET) {
651+ if (priv->rst_progress == RESET_TYPE_NORESET) {
658652 ulRegRead = rtl92e_readl(dev, CPU_GEN);
659653 if (priv->LoopbackMode == RTL819X_NO_LOOPBACK)
660654 ulRegRead = (ulRegRead & CPU_GEN_NO_LOOPBACK_MSK) |
@@ -703,7 +697,7 @@ start: · 42 unmodified lines
703697
704698 rtl92e_writeb(dev, ACK_TIMEOUT, 0x30);
705699
706− if (priv->ResetProgress == RESET_TYPE_NORESET)
700+ if (priv->rst_progress == RESET_TYPE_NORESET)
707701 rtl92e_set_wireless_mode(dev, priv->rtllib->mode);
708702 rtl92e_cam_reset(dev);
709703 {
@@ -743,7 +737,7 @@ start: · 33 unmodified lines
743737 }
744738 }
745739
746− if (priv->ResetProgress == RESET_TYPE_NORESET) {
740+ if (priv->rst_progress == RESET_TYPE_NORESET) {
747741 rtStatus = rtl92e_config_phy(dev);
748742 if (!rtStatus) {
749743 netdev_info(dev, "RF Config failed\n");
@@ -756,9 +750,7 @@ start: · 6 unmodified lines
756750
757751 rtl92e_writeb(dev, 0x87, 0x0);
758752
759− if (priv->RegRfOff) {
760− rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_SW);
761− } else if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) {
753+ if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) {
762754 rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason);
763755 } else if (priv->rtllib->rf_off_reason >= RF_CHANGE_BY_IPS) {
764756 rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason);
@@ -772,7 +764,7 @@ start: · 7 unmodified lines
772764 else
773765 priv->Rf_Mode = RF_OP_By_SW_3wire;
774766
775− if (priv->ResetProgress == RESET_TYPE_NORESET) {
767+ if (priv->rst_progress == RESET_TYPE_NORESET) {
776768 rtl92e_dm_init_txpower_tracking(dev);
777769
778770 if (priv->IC_Cut >= IC_VersionCut_D) {
@@ -801,7 +793,7 @@ start: · 22 unmodified lines
801793 }
802794 priv->CCKPresentAttentuation_40Mdefault = 0;
803795 priv->CCKPresentAttentuation_difference = 0;
804− priv->CCKPresentAttentuation =
796+ priv->cck_present_attn =
805797 priv->CCKPresentAttentuation_20Mdefault;
806798 priv->btxpower_tracking = false;
807799 }
@@ -865,7 +857,7 @@ void rtl92e_link_change(struct net_device *dev) · 57 unmodified lines
865857
866858 reg = rtl92e_readl(dev, RCR);
867859 if (priv->rtllib->state == RTLLIB_LINKED) {
868− if (ieee->IntelPromiscuousModeInfo.bPromiscuousOn)
860+ if (ieee->intel_promiscuous_md_info.promiscuous_on)
869861 ;
870862 else
871863 priv->ReceiveConfig = reg |= RCR_CBSSID;
@@ -1112,9 +1104,8 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, · 240 unmodified lines
11121104 if (cb_desc->bHwSec) {
11131105 static u8 tmp;
11141106
1115− if (!tmp) {
1107+ if (!tmp)
11161108 tmp = 1;
1117− }
11181109 switch (priv->rtllib->pairwise_key_type) {
11191110 case KEY_TYPE_WEP40:
11201111 case KEY_TYPE_WEP104:
@@ -1143,8 +1134,8 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc, · 22 unmodified lines
11431134 cb_desc->priority);
11441135 pdesc->TxFWInfoSize = sizeof(struct tx_fwinfo_8190pci);
11451136
1146− pdesc->DISFB = cb_desc->bTxDisableRateFallBack;
1147− pdesc->USERATE = cb_desc->bTxUseDriverAssingedRate;
1137+ pdesc->DISFB = cb_desc->tx_dis_rate_fallback;
1138+ pdesc->USERATE = cb_desc->tx_use_drv_assinged_rate;
11481139
11491140 pdesc->FirstSeg = 1;
11501141 pdesc->LastSeg = 1;
@@ -1935,7 +1926,7 @@ void rtl92e_stop_adapter(struct net_device *dev, bool reset) · 784 unmodified lines
19351926 if (!reset) {
19361927 mdelay(150);
19371928
1938− priv->bHwRfOffAction = 2;
1929+ priv->hw_rf_off_action = 2;
19391930
19401931 if (!priv->rtllib->bSupportRemoteWakeUp) {
19411932 rtl92e_set_rf_off(dev);
@@ -1955,8 +1946,6 @@ void rtl92e_stop_adapter(struct net_device *dev, bool reset) · 13 unmodified lines
19551946
19561947 for (i = 0; i < MAX_QUEUE_SIZE; i++)
19571948 skb_queue_purge(&priv->rtllib->skb_waitQ[i]);
1958− for (i = 0; i < MAX_QUEUE_SIZE; i++)
1959− skb_queue_purge(&priv->rtllib->skb_aggQ[i]);
19601949
19611950 skb_queue_purge(&priv->skb_queue);
19621951 }
@@ -1965,7 +1954,7 @@ void rtl92e_update_ratr_table(struct net_device *dev) · 2 unmodified lines
19651954 {
19661955 struct r8192_priv *priv = rtllib_priv(dev);
19671956 struct rtllib_device *ieee = priv->rtllib;
1968− u8 *pMcsRate = ieee->dot11HTOperationalRateSet;
1957+ u8 *pMcsRate = ieee->dot11ht_oper_rate_set;
19691958 u32 ratr_value = 0;
19701959 u16 rate_config = 0;
19711960 u8 rate_index = 0;
@@ -1985,7 +1974,7 @@ void rtl92e_update_ratr_table(struct net_device *dev) · 13 unmodified lines
19851974 break;
19861975 case IEEE_N_24G:
19871976 case IEEE_N_5G:
1988− if (ieee->pHTInfo->peer_mimo_ps == 0) {
1977+ if (ieee->ht_info->peer_mimo_ps == 0) {
19891978 ratr_value &= 0x0007F007;
19901979 } else {
19911980 if (priv->rf_type == RF_1T2R)
@@ -1998,11 +1987,11 @@ void rtl92e_update_ratr_table(struct net_device *dev) · 6 unmodified lines
19981987 break;
19991988 }
20001989 ratr_value &= 0x0FFFFFFF;
2001− if (ieee->pHTInfo->cur_tx_bw40mhz &&
2002− ieee->pHTInfo->bCurShortGI40MHz)
1990+ if (ieee->ht_info->cur_tx_bw40mhz &&
1991+ ieee->ht_info->bCurShortGI40MHz)
20031992 ratr_value |= 0x80000000;
2004− else if (!ieee->pHTInfo->cur_tx_bw40mhz &&
2005− ieee->pHTInfo->bCurShortGI20MHz)
1993+ else if (!ieee->ht_info->cur_tx_bw40mhz &&
1994+ ieee->ht_info->bCurShortGI20MHz)
20061995 ratr_value |= 0x80000000;
20071996 rtl92e_writel(dev, RATR0+rate_index*4, ratr_value);
20081997 rtl92e_writeb(dev, UFWP, 1);
@@ -2136,7 +2125,7 @@ bool rtl92e_is_rx_stuck(struct net_device *dev) · 127 unmodified lines
21362125
21372126 SlotIndex = (priv->SilentResetRxSlotIndex++)%SilentResetRxSoltNum;
21382127
2139− if (priv->RxCounter == RegRxCounter) {
2128+ if (priv->rx_ctr == RegRxCounter) {
21402129 priv->SilentResetRxStuckEvent[SlotIndex] = 1;
21412130
21422131 for (i = 0; i < SilentResetRxSoltNum; i++)
@@ -2154,7 +2143,7 @@ bool rtl92e_is_rx_stuck(struct net_device *dev) · 11 unmodified lines
21542143 priv->SilentResetRxStuckEvent[SlotIndex] = 0;
21552144 }
21562145
2157− priv->RxCounter = RegRxCounter;
2146+ priv->rx_ctr = RegRxCounter;
21582147
21592148 return bStuck;
21602149 }
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c+23−27
@@ -522,9 +522,8 @@ static bool _rtl92e_bb_config_para_file(struct net_device *dev) · 521 unmodified lines
522522 rtStatus = rtl92e_check_bb_and_rf(dev,
523523 (enum hw90_block)eCheckItem,
524524 (enum rf90_radio_path)0);
525− if (!rtStatus) {
525+ if (!rtStatus)
526526 return rtStatus;
527− }
528527 }
529528 rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0);
530529 _rtl92e_phy_config_bb(dev, BaseBand_Config_PHY_REG);
@@ -1009,16 +1008,16 @@ static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev) · 478 unmodified lines
10091008
10101009 switch (priv->CurrentChannelBW) {
10111010 case HT_CHANNEL_WIDTH_20:
1012− priv->CCKPresentAttentuation =
1011+ priv->cck_present_attn =
10131012 priv->CCKPresentAttentuation_20Mdefault +
10141013 priv->CCKPresentAttentuation_difference;
10151014
1016− if (priv->CCKPresentAttentuation >
1015+ if (priv->cck_present_attn >
10171016 (CCKTxBBGainTableLength-1))
1018− priv->CCKPresentAttentuation =
1017+ priv->cck_present_attn =
10191018 CCKTxBBGainTableLength-1;
1020− if (priv->CCKPresentAttentuation < 0)
1021− priv->CCKPresentAttentuation = 0;
1019+ if (priv->cck_present_attn < 0)
1020+ priv->cck_present_attn = 0;
10221021
10231022 if (priv->rtllib->current_network.channel == 14 &&
10241023 !priv->bcck_in_ch14) {
@@ -1034,16 +1033,16 @@ static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev) · 9 unmodified lines
10341033 break;
10351034
10361035 case HT_CHANNEL_WIDTH_20_40:
1037− priv->CCKPresentAttentuation =
1036+ priv->cck_present_attn =
10381037 priv->CCKPresentAttentuation_40Mdefault +
10391038 priv->CCKPresentAttentuation_difference;
10401039
1041− if (priv->CCKPresentAttentuation >
1040+ if (priv->cck_present_attn >
10421041 (CCKTxBBGainTableLength - 1))
1043− priv->CCKPresentAttentuation =
1042+ priv->cck_present_attn =
10441043 CCKTxBBGainTableLength-1;
1045− if (priv->CCKPresentAttentuation < 0)
1046− priv->CCKPresentAttentuation = 0;
1044+ if (priv->cck_present_attn < 0)
1045+ priv->cck_present_attn = 0;
10471046
10481047 if (priv->rtllib->current_network.channel == 14 &&
10491048 !priv->bcck_in_ch14) {
@@ -1304,8 +1303,8 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 254 unmodified lines
13041303 enum rt_rf_power_state rf_power_state)
13051304 {
13061305 struct r8192_priv *priv = rtllib_priv(dev);
1307− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
1308− (&(priv->rtllib->PowerSaveControl));
1306+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
1307+ (&priv->rtllib->pwr_save_ctrl);
13091308 bool bResult = true;
13101309 u8 i = 0, QueueID = 0;
13111310 struct rtl8192_tx_ring *ring = NULL;
@@ -1319,13 +1318,12 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 7 unmodified lines
13191318 switch (rf_power_state) {
13201319 case rf_on:
13211320 if ((priv->rtllib->rf_power_state == rf_off) &&
1322− RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
1321+ RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) {
13231322 bool rtstatus;
13241323 u32 InitilizeCount = 3;
13251324
13261325 do {
13271326 InitilizeCount--;
1328− priv->RegRfOff = false;
13291327 rtstatus = rtl92e_enable_nic(dev);
13301328 } while (!rtstatus && (InitilizeCount > 0));
13311329
@@ -1337,14 +1335,14 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 5 unmodified lines
13371335 return false;
13381336 }
13391337
1340− RT_CLEAR_PS_LEVEL(pPSC,
1338+ RT_CLEAR_PS_LEVEL(psc,
13411339 RT_RF_OFF_LEVL_HALT_NIC);
13421340 } else {
13431341 rtl92e_writeb(dev, ANAPAR, 0x37);
13441342 mdelay(1);
13451343 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1,
13461344 0x4, 0x1);
1347− priv->bHwRfOffAction = 0;
1345+ priv->hw_rf_off_action = 0;
13481346
13491347 rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE,
13501348 BIT4, 0x1);
@@ -1379,9 +1377,8 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 28 unmodified lines
13791377 i++;
13801378 }
13811379
1382− if (i >= MAX_DOZE_WAITING_TIMES_9x) {
1380+ if (i >= MAX_DOZE_WAITING_TIMES_9x)
13831381 break;
1384− }
13851382 }
13861383 rtl92e_set_rf_off(dev);
13871384 break;
@@ -1398,16 +1395,15 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, · 10 unmodified lines
13981395 i++;
13991396 }
14001397
1401− if (i >= MAX_DOZE_WAITING_TIMES_9x) {
1398+ if (i >= MAX_DOZE_WAITING_TIMES_9x)
14021399 break;
1403− }
14041400 }
14051401
1406− if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC &&
1407− !RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
1402+ if (psc->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC &&
1403+ !RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) {
14081404 rtl92e_disable_nic(dev);
1409− RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
1410− } else if (!(pPSC->RegRfPsLevel &
1405+ RT_SET_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
1406+ } else if (!(psc->RegRfPsLevel &
14111407 RT_RF_OFF_LEVL_HALT_NIC)) {
14121408 rtl92e_set_rf_off(dev);
14131409 }
@@ -1454,7 +1450,7 @@ bool rtl92e_set_rf_power_state(struct net_device *dev, · 40 unmodified lines
14541450 bool bResult = false;
14551451
14561452 if (rf_power_state == priv->rtllib->rf_power_state &&
1457− priv->bHwRfOffAction == 0) {
1453+ priv->hw_rf_off_action == 0) {
14581454 return bResult;
14591455 }
14601456
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c+20−23
@@ -17,7 +17,7 @@ void rtl92e_cam_reset(struct net_device *dev) · 16 unmodified lines
1717 {
1818 u32 ulcommand = 0;
1919
20− ulcommand |= BIT31|BIT30;
20+ ulcommand |= BIT31 | BIT30;
2121 rtl92e_writel(dev, RWCAM, ulcommand);
2222 }
2323
@@ -40,9 +40,8 @@ void rtl92e_enable_hw_security_config(struct net_device *dev) · 16 unmodified lines
4040 SECR_value |= SCR_TxUseDK;
4141 }
4242
43−
4443 ieee->hwsec_active = 1;
45− if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
44+ if ((ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
4645 ieee->hwsec_active = 0;
4746 SECR_value &= ~SCR_RxDecEnable;
4847 }
@@ -81,17 +80,15 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, · 32 unmodified lines
8180 enum rt_rf_power_state rt_state;
8281
8382 rt_state = priv->rtllib->rf_power_state;
84− if (priv->rtllib->PowerSaveControl.bInactivePs) {
85− if (rt_state == rf_off) {
86− if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
87− netdev_warn(dev, "%s(): RF is OFF.\n",
88− __func__);
89− return;
90− }
91− mutex_lock(&priv->rtllib->ips_mutex);
92− rtl92e_ips_leave(dev);
93− mutex_unlock(&priv->rtllib->ips_mutex);
83+ if (rt_state == rf_off) {
84+ if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
85+ netdev_warn(dev, "%s(): RF is OFF.\n",
86+ __func__);
87+ return;
9488 }
89+ mutex_lock(&priv->rtllib->ips_mutex);
90+ rtl92e_ips_leave(dev);
91+ mutex_unlock(&priv->rtllib->ips_mutex);
9592 }
9693 priv->rtllib->is_set_key = true;
9794 if (EntryNo >= TOTAL_CAM_ENTRY) {
@@ -100,33 +97,33 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, · 2 unmodified lines
10097 }
10198
10299 if (DefaultKey)
103− usConfig |= BIT15 | (KeyType<<2);
100+ usConfig |= BIT15 | (KeyType << 2);
104101 else
105− usConfig |= BIT15 | (KeyType<<2) | KeyIndex;
102+ usConfig |= BIT15 | (KeyType << 2) | KeyIndex;
106103
107104
108105 for (i = 0; i < CAM_CONTENT_COUNT; i++) {
109106 TargetCommand = i + CAM_CONTENT_COUNT * EntryNo;
110− TargetCommand |= BIT31|BIT16;
107+ TargetCommand |= BIT31 | BIT16;
111108
112109 if (i == 0) {
113− TargetContent = (u32)(*(MacAddr+0)) << 16 |
114− (u32)(*(MacAddr+1)) << 24 |
110+ TargetContent = (u32)(*(MacAddr + 0)) << 16 |
111+ (u32)(*(MacAddr + 1)) << 24 |
115112 (u32)usConfig;
116113
117114 rtl92e_writel(dev, WCAMI, TargetContent);
118115 rtl92e_writel(dev, RWCAM, TargetCommand);
119116 } else if (i == 1) {
120− TargetContent = (u32)(*(MacAddr+2)) |
121− (u32)(*(MacAddr+3)) << 8 |
122− (u32)(*(MacAddr+4)) << 16 |
123− (u32)(*(MacAddr+5)) << 24;
117+ TargetContent = (u32)(*(MacAddr + 2)) |
118+ (u32)(*(MacAddr + 3)) << 8 |
119+ (u32)(*(MacAddr + 4)) << 16 |
120+ (u32)(*(MacAddr + 5)) << 24;
124121 rtl92e_writel(dev, WCAMI, TargetContent);
125122 rtl92e_writel(dev, RWCAM, TargetCommand);
126123 } else {
127124 if (KeyContent != NULL) {
128125 rtl92e_writel(dev, WCAMI,
129− (u32)(*(KeyContent+i-2)));
126+ (u32)(*(KeyContent + i - 2)));
130127 rtl92e_writel(dev, RWCAM, TargetCommand);
131128 udelay(100);
132129 }
drivers/staging/rtl8192e/rtl8192e/rtl_core.c+84−107
@@ -307,7 +307,7 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap) · 306 unmodified lines
307307 u8 cur_slot_time = priv->slot_time;
308308
309309 if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) &&
310− (!priv->rtllib->pHTInfo->current_rt2rt_long_slot_time)) {
310+ (!priv->rtllib->ht_info->current_rt2rt_long_slot_time)) {
311311 if (cur_slot_time != SHORT_SLOT_TIME) {
312312 slot_time_val = SHORT_SLOT_TIME;
313313 priv->rtllib->SetHwRegHandler(dev,
@@ -339,10 +339,10 @@ static void _rtl92e_update_beacon(void *data) · 25 unmodified lines
339339 struct rtllib_device *ieee = priv->rtllib;
340340 struct rtllib_network *net = &ieee->current_network;
341341
342− if (ieee->pHTInfo->bCurrentHTSupport)
342+ if (ieee->ht_info->bCurrentHTSupport)
343343 HT_update_self_and_peer_setting(ieee, net);
344− ieee->pHTInfo->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time;
345− ieee->pHTInfo->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode;
344+ ieee->ht_info->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time;
345+ ieee->ht_info->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode;
346346 _rtl92e_update_cap(dev, net->capability);
347347 }
348348
@@ -494,8 +494,8 @@ static void _rtl92e_prepare_beacon(struct tasklet_struct *t) · 145 unmodified lines
494494 tcb_desc->queue_index = BEACON_QUEUE;
495495 tcb_desc->data_rate = 2;
496496 tcb_desc->RATRIndex = 7;
497− tcb_desc->bTxDisableRateFallBack = 1;
498− tcb_desc->bTxUseDriverAssingedRate = 1;
497+ tcb_desc->tx_dis_rate_fallback = 1;
498+ tcb_desc->tx_use_drv_assinged_rate = 1;
499499 skb_push(pnewskb, priv->rtllib->tx_headroom);
500500
501501 pdesc = &ring->desc[0];
@@ -607,13 +607,13 @@ static void _rtl92e_refresh_support_rate(struct r8192_priv *priv) · 105 unmodified lines
607607
608608 if (ieee->mode == WIRELESS_MODE_N_24G ||
609609 ieee->mode == WIRELESS_MODE_N_5G) {
610− memcpy(ieee->Regdot11HTOperationalRateSet,
611− ieee->RegHTSuppRateSet, 16);
612− memcpy(ieee->Regdot11TxHTOperationalRateSet,
613− ieee->RegHTSuppRateSet, 16);
610+ memcpy(ieee->reg_dot11ht_oper_rate_set,
611+ ieee->reg_ht_supp_rate_set, 16);
612+ memcpy(ieee->reg_dot11tx_ht_oper_rate_set,
613+ ieee->reg_ht_supp_rate_set, 16);
614614
615615 } else {
616− memset(ieee->Regdot11HTOperationalRateSet, 0, 16);
616+ memset(ieee->reg_dot11ht_oper_rate_set, 0, 16);
617617 }
618618 }
619619
@@ -642,19 +642,19 @@ static u8 _rtl92e_get_supported_wireless_mode(struct net_device *dev) · 22 unmodified lines
642642 void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
643643 {
644644 struct r8192_priv *priv = rtllib_priv(dev);
645− u8 bSupportMode = _rtl92e_get_supported_wireless_mode(dev);
645+ u8 support_mode = _rtl92e_get_supported_wireless_mode(dev);
646646
647647 if ((wireless_mode == WIRELESS_MODE_AUTO) ||
648− ((wireless_mode & bSupportMode) == 0)) {
649− if (bSupportMode & WIRELESS_MODE_N_24G) {
648+ ((wireless_mode & support_mode) == 0)) {
649+ if (support_mode & WIRELESS_MODE_N_24G) {
650650 wireless_mode = WIRELESS_MODE_N_24G;
651− } else if (bSupportMode & WIRELESS_MODE_N_5G) {
651+ } else if (support_mode & WIRELESS_MODE_N_5G) {
652652 wireless_mode = WIRELESS_MODE_N_5G;
653− } else if ((bSupportMode & WIRELESS_MODE_A)) {
653+ } else if ((support_mode & WIRELESS_MODE_A)) {
654654 wireless_mode = WIRELESS_MODE_A;
655− } else if ((bSupportMode & WIRELESS_MODE_G)) {
655+ } else if ((support_mode & WIRELESS_MODE_G)) {
656656 wireless_mode = WIRELESS_MODE_G;
657− } else if ((bSupportMode & WIRELESS_MODE_B)) {
657+ } else if ((support_mode & WIRELESS_MODE_B)) {
658658 wireless_mode = WIRELESS_MODE_B;
659659 } else {
660660 netdev_info(dev,
@@ -672,9 +672,9 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) · 11 unmodified lines
672672
673673 if ((wireless_mode == WIRELESS_MODE_N_24G) ||
674674 (wireless_mode == WIRELESS_MODE_N_5G)) {
675− priv->rtllib->pHTInfo->bEnableHT = 1;
675+ priv->rtllib->ht_info->enable_ht = 1;
676676 } else {
677− priv->rtllib->pHTInfo->bEnableHT = 0;
677+ priv->rtllib->ht_info->enable_ht = 0;
678678 }
679679 _rtl92e_refresh_support_rate(priv);
680680 }
@@ -682,11 +682,10 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) · 1 unmodified line
682682 static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
683683 {
684684 struct r8192_priv *priv = rtllib_priv(dev);
685− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
686− (&priv->rtllib->PowerSaveControl);
685+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
686+ (&priv->rtllib->pwr_save_ctrl);
687687 bool init_status;
688688
689− priv->bDriverIsGoingToUnload = false;
690689 priv->bdisable_nic = false;
691690
692691 priv->up = 1;
@@ -701,7 +700,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) · 8 unmodified lines
701700 return -1;
702701 }
703702
704− RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
703+ RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
705704 priv->bfirst_init = false;
706705
707706 if (priv->polling_timer_on == 0)
@@ -724,7 +723,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) · 16 unmodified lines
724723 {
725724 struct r8192_priv *priv = rtllib_priv(dev);
726725 unsigned long flags = 0;
727− u8 RFInProgressTimeOut = 0;
726+ u8 rf_in_progress_timeout = 0;
728727
729728 if (priv->up == 0)
730729 return -1;
@@ -735,7 +734,6 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) · 4 unmodified lines
735734 if (priv->rtllib->state == RTLLIB_LINKED)
736735 rtl92e_leisure_ps_leave(dev);
737736
738− priv->bDriverIsGoingToUnload = true;
739737 priv->up = 0;
740738 priv->rtllib->ieee_up = 0;
741739 priv->bfirst_after_down = true;
@@ -757,12 +755,12 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) · 15 unmodified lines
757755 spin_lock_irqsave(&priv->rf_ps_lock, flags);
758756 while (priv->rf_change_in_progress) {
759757 spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
760− if (RFInProgressTimeOut > 100) {
758+ if (rf_in_progress_timeout > 100) {
761759 spin_lock_irqsave(&priv->rf_ps_lock, flags);
762760 break;
763761 }
764762 mdelay(1);
765− RFInProgressTimeOut++;
763+ rf_in_progress_timeout++;
766764 spin_lock_irqsave(&priv->rf_ps_lock, flags);
767765 }
768766 priv->rf_change_in_progress = true;
@@ -821,10 +819,10 @@ static void _rtl92e_init_priv_handler(struct net_device *dev) · 52 unmodified lines
821819 static void _rtl92e_init_priv_constant(struct net_device *dev)
822820 {
823821 struct r8192_priv *priv = rtllib_priv(dev);
824− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
825− &priv->rtllib->PowerSaveControl;
822+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
823+ &priv->rtllib->pwr_save_ctrl;
826824
827− pPSC->RegMaxLPSAwakeIntvl = 5;
825+ psc->reg_max_lps_awake_intvl = 5;
828826 }
829827
830828 static void _rtl92e_init_priv_variable(struct net_device *dev)
@@ -832,15 +830,12 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 1 unmodified line
832830 struct r8192_priv *priv = rtllib_priv(dev);
833831 u8 i;
834832
835− priv->AcmMethod = eAcmWay2_SW;
836833 priv->dot11_current_preamble_mode = PREAMBLE_AUTO;
837834 priv->rtllib->status = 0;
838835 priv->polling_timer_on = 0;
839836 priv->up_first_time = 1;
840837 priv->blinked_ingpio = false;
841− priv->bDriverIsGoingToUnload = false;
842838 priv->being_init_adapter = false;
843− priv->initialized_at_probe = false;
844839 priv->bdisable_nic = false;
845840 priv->bfirst_init = false;
846841 priv->txringcount = 64;
@@ -848,12 +843,12 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 1 unmodified line
848843 priv->rxringcount = MAX_RX_COUNT;
849844 priv->irq_enabled = 0;
850845 priv->chan = 1;
851− priv->RegChannelPlan = 0xf;
846+ priv->reg_chnl_plan = 0xf;
852847 priv->rtllib->mode = WIRELESS_MODE_AUTO;
853848 priv->rtllib->iw_mode = IW_MODE_INFRA;
854− priv->rtllib->bNetPromiscuousMode = false;
855− priv->rtllib->IntelPromiscuousModeInfo.bPromiscuousOn = false;
856− priv->rtllib->IntelPromiscuousModeInfo.bFilterSourceStationFrame =
849+ priv->rtllib->net_promiscuous_md = false;
850+ priv->rtllib->intel_promiscuous_md_info.promiscuous_on = false;
851+ priv->rtllib->intel_promiscuous_md_info.fltr_src_sta_frame =
857852 false;
858853 priv->rtllib->ieee_up = 0;
859854 priv->retry_rts = DEFAULT_RETRY_RTS;
@@ -864,32 +859,21 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 4 unmodified lines
864859 priv->promisc = (dev->flags & IFF_PROMISC) ? 1 : 0;
865860 priv->bcck_in_ch14 = false;
866861 priv->bfsync_processing = false;
867− priv->CCKPresentAttentuation = 0;
862+ priv->cck_present_attn = 0;
868863 priv->rfa_txpowertrackingindex = 0;
869864 priv->rfc_txpowertrackingindex = 0;
870865 priv->CckPwEnl = 6;
871− priv->ScanDelay = 50;
872− priv->ResetProgress = RESET_TYPE_NORESET;
873− priv->bForcedSilentReset = false;
874− priv->bDisableNormalResetCheck = false;
866+ priv->rst_progress = RESET_TYPE_NORESET;
875867 priv->force_reset = false;
876868 memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32);
877−
878− memset(&priv->InterruptLog, 0, sizeof(struct log_int_8190));
879− priv->RxCounter = 0;
869+ priv->rx_ctr = 0;
880870 priv->rtllib->wx_set_enc = 0;
881871 priv->hw_radio_off = false;
882− priv->RegRfOff = false;
883− priv->isRFOff = false;
884− priv->bInPowerSaveMode = false;
885872 priv->rtllib->rf_off_reason = 0;
886873 priv->rf_change_in_progress = false;
887− priv->bHwRfOffAction = 0;
874+ priv->hw_rf_off_action = 0;
888875 priv->SetRFPowerStateInProgress = false;
889− priv->rtllib->PowerSaveControl.bInactivePs = true;
890− priv->rtllib->PowerSaveControl.bIPSModeBackup = false;
891− priv->rtllib->PowerSaveControl.bLeisurePs = true;
892− priv->rtllib->PowerSaveControl.bFwCtrlLPS = false;
876+ priv->rtllib->pwr_save_ctrl.bLeisurePs = true;
893877 priv->rtllib->LPSDelayCnt = 0;
894878 priv->rtllib->sta_sleep = LPS_IS_WAKE;
895879 priv->rtllib->rf_power_state = rf_on;
@@ -916,8 +900,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) · 20 unmodified lines
916900
917901 for (i = 0; i < MAX_QUEUE_SIZE; i++)
918902 skb_queue_head_init(&priv->rtllib->skb_waitQ[i]);
919− for (i = 0; i < MAX_QUEUE_SIZE; i++)
920− skb_queue_head_init(&priv->rtllib->skb_aggQ[i]);
921903 }
922904
923905 static void _rtl92e_init_priv_lock(struct r8192_priv *priv)
@@ -1147,8 +1129,8 @@ static void _rtl92e_if_silent_reset(struct net_device *dev) · 223 unmodified lines
11471129 struct rtllib_device *ieee = priv->rtllib;
11481130 unsigned long flag;
11491131
1150− if (priv->ResetProgress == RESET_TYPE_NORESET) {
1151− priv->ResetProgress = RESET_TYPE_SILENT;
1132+ if (priv->rst_progress == RESET_TYPE_NORESET) {
1133+ priv->rst_progress = RESET_TYPE_SILENT;
11521134
11531135 spin_lock_irqsave(&priv->rf_ps_lock, flag);
11541136 if (priv->rf_change_in_progress) {
@@ -1245,10 +1227,8 @@ RESET_START: · 90 unmodified lines
12451227 rtl92e_cam_restore(dev);
12461228 rtl92e_dm_restore_state(dev);
12471229 END:
1248− priv->ResetProgress = RESET_TYPE_NORESET;
1230+ priv->rst_progress = RESET_TYPE_NORESET;
12491231 priv->reset_count++;
1250−
1251− priv->bForcedSilentReset = false;
12521232 priv->bResetInProgress = false;
12531233
12541234 rtl92e_writeb(dev, UFWP, 1);
@@ -1264,15 +1244,15 @@ static void _rtl92e_update_rxcounts(struct r8192_priv *priv, u32 *TotalRxBcnNum, · 9 unmodified lines
12641244 *TotalRxBcnNum = 0;
12651245 *TotalRxDataNum = 0;
12661246
1267− SlotIndex = (priv->rtllib->LinkDetectInfo.SlotIndex++) %
1268− (priv->rtllib->LinkDetectInfo.SlotNum);
1269− priv->rtllib->LinkDetectInfo.RxBcnNum[SlotIndex] =
1270− priv->rtllib->LinkDetectInfo.NumRecvBcnInPeriod;
1271− priv->rtllib->LinkDetectInfo.RxDataNum[SlotIndex] =
1272− priv->rtllib->LinkDetectInfo.NumRecvDataInPeriod;
1273− for (i = 0; i < priv->rtllib->LinkDetectInfo.SlotNum; i++) {
1274− *TotalRxBcnNum += priv->rtllib->LinkDetectInfo.RxBcnNum[i];
1275− *TotalRxDataNum += priv->rtllib->LinkDetectInfo.RxDataNum[i];
1247+ SlotIndex = (priv->rtllib->link_detect_info.SlotIndex++) %
1248+ (priv->rtllib->link_detect_info.SlotNum);
1249+ priv->rtllib->link_detect_info.RxBcnNum[SlotIndex] =
1250+ priv->rtllib->link_detect_info.NumRecvBcnInPeriod;
1251+ priv->rtllib->link_detect_info.RxDataNum[SlotIndex] =
1252+ priv->rtllib->link_detect_info.NumRecvDataInPeriod;
1253+ for (i = 0; i < priv->rtllib->link_detect_info.SlotNum; i++) {
1254+ *TotalRxBcnNum += priv->rtllib->link_detect_info.RxBcnNum[i];
1255+ *TotalRxDataNum += priv->rtllib->link_detect_info.RxDataNum[i];
12761256 }
12771257 }
12781258
@@ -1285,8 +1265,8 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 6 unmodified lines
12851265 enum reset_type ResetType = RESET_TYPE_NORESET;
12861266 static u8 check_reset_cnt;
12871267 unsigned long flags;
1288− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
1289− (&priv->rtllib->PowerSaveControl);
1268+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
1269+ (&priv->rtllib->pwr_save_ctrl);
12901270 bool bBusyTraffic = false;
12911271 bool bHigherBusyTraffic = false;
12921272 bool bHigherBusyRxTraffic = false;
@@ -1309,31 +1289,31 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 16 unmodified lines
13091289 RTLLIB_NOLINK) &&
13101290 (ieee->rf_power_state == rf_on) && !ieee->is_set_key &&
13111291 (!ieee->proto_stoppping) && !ieee->wx_set_enc) {
1312− if ((ieee->PowerSaveControl.ReturnPoint ==
1292+ if ((ieee->pwr_save_ctrl.ReturnPoint ==
13131293 IPS_CALLBACK_NONE) &&
1314− (!ieee->bNetPromiscuousMode)) {
1294+ (!ieee->net_promiscuous_md)) {
13151295 rtl92e_ips_enter(dev);
13161296 }
13171297 }
13181298 }
13191299 if ((ieee->state == RTLLIB_LINKED) && (ieee->iw_mode ==
1320− IW_MODE_INFRA) && (!ieee->bNetPromiscuousMode)) {
1321− if (ieee->LinkDetectInfo.NumRxOkInPeriod > 100 ||
1322− ieee->LinkDetectInfo.NumTxOkInPeriod > 100)
1300+ IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) {
1301+ if (ieee->link_detect_info.NumRxOkInPeriod > 100 ||
1302+ ieee->link_detect_info.NumTxOkInPeriod > 100)
13231303 bBusyTraffic = true;
13241304
1325− if (ieee->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
1326− ieee->LinkDetectInfo.NumTxOkInPeriod > 4000) {
1305+ if (ieee->link_detect_info.NumRxOkInPeriod > 4000 ||
1306+ ieee->link_detect_info.NumTxOkInPeriod > 4000) {
13271307 bHigherBusyTraffic = true;
1328− if (ieee->LinkDetectInfo.NumRxOkInPeriod > 5000)
1308+ if (ieee->link_detect_info.NumRxOkInPeriod > 5000)
13291309 bHigherBusyRxTraffic = true;
13301310 else
13311311 bHigherBusyRxTraffic = false;
13321312 }
13331313
1334− if (((ieee->LinkDetectInfo.NumRxUnicastOkInPeriod +
1335− ieee->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
1336− (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2))
1314+ if (((ieee->link_detect_info.NumRxUnicastOkInPeriod +
1315+ ieee->link_detect_info.NumTxOkInPeriod) > 8) ||
1316+ (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2))
13371317 bEnterPS = false;
13381318 else
13391319 bEnterPS = true;
@@ -1350,13 +1330,13 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 10 unmodified lines
13501330 rtl92e_leisure_ps_leave(dev);
13511331 }
13521332
1353− ieee->LinkDetectInfo.NumRxOkInPeriod = 0;
1354− ieee->LinkDetectInfo.NumTxOkInPeriod = 0;
1355− ieee->LinkDetectInfo.NumRxUnicastOkInPeriod = 0;
1356− ieee->LinkDetectInfo.bBusyTraffic = bBusyTraffic;
1333+ ieee->link_detect_info.NumRxOkInPeriod = 0;
1334+ ieee->link_detect_info.NumTxOkInPeriod = 0;
1335+ ieee->link_detect_info.NumRxUnicastOkInPeriod = 0;
1336+ ieee->link_detect_info.bBusyTraffic = bBusyTraffic;
13571337
1358− ieee->LinkDetectInfo.bHigherBusyTraffic = bHigherBusyTraffic;
1359− ieee->LinkDetectInfo.bHigherBusyRxTraffic = bHigherBusyRxTraffic;
1338+ ieee->link_detect_info.bHigherBusyTraffic = bHigherBusyTraffic;
1339+ ieee->link_detect_info.bHigherBusyRxTraffic = bHigherBusyRxTraffic;
13601340
13611341 if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) {
13621342 u32 TotalRxBcnNum = 0;
@@ -1397,28 +1377,26 @@ static void _rtl92e_watchdog_wq_cb(void *data) · 34 unmodified lines
13971377
13981378 priv->check_roaming_cnt = 0;
13991379 }
1400− ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
1401− ieee->LinkDetectInfo.NumRecvDataInPeriod = 0;
1380+ ieee->link_detect_info.NumRecvBcnInPeriod = 0;
1381+ ieee->link_detect_info.NumRecvDataInPeriod = 0;
14021382 }
14031383
14041384 spin_lock_irqsave(&priv->tx_lock, flags);
14051385 if ((check_reset_cnt++ >= 3) && (!ieee->is_roaming) &&
1406− (!priv->rf_change_in_progress) && (!pPSC->bSwRfProcessing)) {
1386+ (!priv->rf_change_in_progress) && (!psc->bSwRfProcessing)) {
14071387 ResetType = _rtl92e_if_check_reset(dev);
14081388 check_reset_cnt = 3;
14091389 }
14101390 spin_unlock_irqrestore(&priv->tx_lock, flags);
14111391
1412− if (!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) {
1413− priv->ResetProgress = RESET_TYPE_NORMAL;
1392+ if (ResetType == RESET_TYPE_NORMAL) {
1393+ priv->rst_progress = RESET_TYPE_NORMAL;
14141394 return;
14151395 }
14161396
1417− if (((priv->force_reset) || (!priv->bDisableNormalResetCheck &&
1418− ResetType == RESET_TYPE_SILENT)))
1397+ if ((priv->force_reset || ResetType == RESET_TYPE_SILENT))
14191398 _rtl92e_if_silent_reset(dev);
14201399 priv->force_reset = false;
1421− priv->bForcedSilentReset = false;
14221400 priv->bResetInProgress = false;
14231401 }
14241402
@@ -1554,8 +1532,8 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) · 129 unmodified lines
15541532 }
15551533
15561534 tcb_desc->RATRIndex = 7;
1557− tcb_desc->bTxDisableRateFallBack = 1;
1558− tcb_desc->bTxUseDriverAssingedRate = 1;
1535+ tcb_desc->tx_dis_rate_fallback = 1;
1536+ tcb_desc->tx_use_drv_assinged_rate = 1;
15591537 tcb_desc->bTxEnableFwCalcDur = 1;
15601538 skb_push(skb, priv->rtllib->tx_headroom);
15611539 ret = _rtl92e_tx(dev, skb);
@@ -2205,7 +2183,6 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev) · 643 unmodified lines
22052183
22062184 if (inta & IMR_ROK) {
22072185 priv->stats.rxint++;
2208− priv->InterruptLog.nIMR_ROK++;
22092186 tasklet_schedule(&priv->irq_rx_tasklet);
22102187 }
22112188
@@ -2229,25 +2206,25 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev) · 17 unmodified lines
22292206
22302207 if (inta & IMR_BKDOK) {
22312208 priv->stats.txbkokint++;
2232− priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2209+ priv->rtllib->link_detect_info.NumTxOkInPeriod++;
22332210 _rtl92e_tx_isr(dev, BK_QUEUE);
22342211 }
22352212
22362213 if (inta & IMR_BEDOK) {
22372214 priv->stats.txbeokint++;
2238− priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2215+ priv->rtllib->link_detect_info.NumTxOkInPeriod++;
22392216 _rtl92e_tx_isr(dev, BE_QUEUE);
22402217 }
22412218
22422219 if (inta & IMR_VIDOK) {
22432220 priv->stats.txviokint++;
2244− priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2221+ priv->rtllib->link_detect_info.NumTxOkInPeriod++;
22452222 _rtl92e_tx_isr(dev, VI_QUEUE);
22462223 }
22472224
22482225 if (inta & IMR_VODOK) {
22492226 priv->stats.txvookint++;
2250− priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
2227+ priv->rtllib->link_detect_info.NumTxOkInPeriod++;
22512228 _rtl92e_tx_isr(dev, VO_QUEUE);
22522229 }
22532230
@@ -2437,8 +2414,8 @@ bool rtl92e_enable_nic(struct net_device *dev) · 183 unmodified lines
24372414 {
24382415 bool init_status = true;
24392416 struct r8192_priv *priv = rtllib_priv(dev);
2440− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
2441− (&priv->rtllib->PowerSaveControl);
2417+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
2418+ (&priv->rtllib->pwr_save_ctrl);
24422419
24432420 if (!priv->up) {
24442421 netdev_warn(dev, "%s(): Driver is already down!\n", __func__);
@@ -2453,7 +2430,7 @@ bool rtl92e_enable_nic(struct net_device *dev) · 8 unmodified lines
24532430 priv->bdisable_nic = false;
24542431 return false;
24552432 }
2456− RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
2433+ RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
24572434 priv->bfirst_init = false;
24582435
24592436 rtl92e_irq_enable(dev);
drivers/staging/rtl8192e/rtl8192e/rtl_core.h+5−31
@@ -234,15 +234,6 @@ struct rt_stats { · 233 unmodified lines
234234 u32 CurrentShowTxate;
235235 };
236236
237−struct channel_access_setting {
238− u16 SIFS_Timer;
239− u16 DIFS_Timer;
240− u16 SlotTimeTimer;
241− u16 EIFS_Timer;
242− u16 CWminIndex;
243− u16 CWmaxIndex;
244−};
245−
246237 struct init_gain {
247238 u8 xaagccore1;
248239 u8 xbagccore1;
@@ -309,9 +300,7 @@ struct r8192_priv { · 60 unmodified lines
309300
310301 bool bfirst_init;
311302 bool bfirst_after_down;
312− bool initialized_at_probe;
313303 bool being_init_adapter;
314− bool bDriverIsGoingToUnload;
315304
316305 int irq;
317306 short irq_enabled;
@@ -323,16 +312,11 @@ struct r8192_priv { · 5 unmodified lines
323312 struct delayed_work txpower_tracking_wq;
324313 struct delayed_work rfpath_check_wq;
325314 struct delayed_work gpio_change_rf_wq;
326−
327− struct channel_access_setting ChannelAccessSetting;
328−
329315 struct rtl819x_ops *ops;
330316 struct rtllib_device *rtllib;
331317
332318 struct work_struct reset_wq;
333319
334− struct log_int_8190 InterruptLog;
335−
336320 enum rt_customer_id CustomerID;
337321
338322
@@ -341,8 +325,6 @@ struct r8192_priv { · 2 unmodified lines
341325 struct bb_reg_definition PHYRegDef[4];
342326 struct rate_adaptive rate_adaptive;
343327
344− enum acm_method AcmMethod;
345−
346328 struct rt_firmware *pFirmware;
347329 enum rtl819x_loopback LoopbackMode;
348330
@@ -410,8 +392,6 @@ struct r8192_priv { · 61 unmodified lines
410392 short chan;
411393 short sens;
412394 short max_sens;
413−
414− u8 ScanDelay;
415395 bool ps_force;
416396
417397 u32 irq_mask[2];
@@ -470,13 +450,9 @@ struct r8192_priv { · 52 unmodified lines
470450
471451 bool bTXPowerDataReadFromEEPORM;
472452
473− u16 RegChannelPlan;
453+ u16 reg_chnl_plan;
474454 u16 ChannelPlan;
475−
476− bool RegRfOff;
477− bool isRFOff;
478− bool bInPowerSaveMode;
479− u8 bHwRfOffAction;
455+ u8 hw_rf_off_action;
480456
481457 bool rf_change_in_progress;
482458 bool SetRFPowerStateInProgress;
@@ -490,7 +466,7 @@ struct r8192_priv { · 7 unmodified lines
490466 u8 CCKPresentAttentuation_20Mdefault;
491467 u8 CCKPresentAttentuation_40Mdefault;
492468 s8 CCKPresentAttentuation_difference;
493− s8 CCKPresentAttentuation;
469+ s8 cck_present_attn;
494470 long undecorated_smoothed_pwdb;
495471
496472 u32 MCSTxPowerLevelOriginalOffset[6];
@@ -543,11 +519,9 @@ struct r8192_priv { · 46 unmodified lines
543519
544520 u32 reset_count;
545521
546− enum reset_type ResetProgress;
547− bool bForcedSilentReset;
548− bool bDisableNormalResetCheck;
522+ enum reset_type rst_progress;
549523 u16 TxCounter;
550− u16 RxCounter;
524+ u16 rx_ctr;
551525 bool bResetInProgress;
552526 bool force_reset;
553527 bool force_lps;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c+59−64
@@ -267,10 +267,8 @@ static void _rtl92e_dm_check_ac_dc_power(struct net_device *dev) · 266 unmodified lines
267267 "PATH=/usr/bin:/bin",
268268 NULL};
269269
270− if (priv->ResetProgress == RESET_TYPE_SILENT) {
270+ if (priv->rst_progress == RESET_TYPE_SILENT)
271271 return;
272− }
273−
274272 if (priv->rtllib->state != RTLLIB_LINKED)
275273 return;
276274 call_usermodehelper(ac_dc_script, argv, envp, UMH_WAIT_PROC);
@@ -323,16 +321,15 @@ void rtl92e_init_adaptive_rate(struct net_device *dev) · 46 unmodified lines
323321 static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
324322 {
325323 struct r8192_priv *priv = rtllib_priv(dev);
326− struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo;
324+ struct rt_hi_throughput *ht_info = priv->rtllib->ht_info;
327325 struct rate_adaptive *pra = &priv->rate_adaptive;
328326 u32 currentRATR, targetRATR = 0;
329327 u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0;
330328 bool bshort_gi_enabled = false;
331329 static u8 ping_rssi_state;
332330
333− if (!priv->up) {
331+ if (!priv->up)
334332 return;
335− }
336333
337334 if (pra->rate_adaptive_disabled)
338335 return;
@@ -343,10 +340,10 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) · 4 unmodified lines
343340
344341 if (priv->rtllib->state == RTLLIB_LINKED) {
345342
346− bshort_gi_enabled = (pHTInfo->cur_tx_bw40mhz &&
347− pHTInfo->bCurShortGI40MHz) ||
348− (!pHTInfo->cur_tx_bw40mhz &&
349− pHTInfo->bCurShortGI20MHz);
343+ bshort_gi_enabled = (ht_info->cur_tx_bw40mhz &&
344+ ht_info->bCurShortGI40MHz) ||
345+ (!ht_info->cur_tx_bw40mhz &&
346+ ht_info->bCurShortGI20MHz);
350347
351348 pra->upper_rssi_threshold_ratr =
352349 (pra->upper_rssi_threshold_ratr & (~BIT31)) |
@@ -631,9 +628,9 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) · 278 unmodified lines
631628
632629 for (j = 0; j <= 30; j++) {
633630
634− tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING;
635− tx_cmd.Length = 4;
636− tx_cmd.Value = Value;
631+ tx_cmd.op = TXCMD_SET_TX_PWR_TRACKING;
632+ tx_cmd.length = 4;
633+ tx_cmd.value = Value;
637634 rtl92e_send_cmd_pkt(dev, DESC_PACKET_TYPE_NORMAL, (u8 *)&tx_cmd,
638635 sizeof(struct dcmd_txcmd));
639636 mdelay(1);
@@ -719,21 +716,21 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) · 79 unmodified lines
719716 }
720717
721718 if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
722− priv->CCKPresentAttentuation =
719+ priv->cck_present_attn =
723720 priv->CCKPresentAttentuation_20Mdefault +
724721 priv->CCKPresentAttentuation_difference;
725722 else
726− priv->CCKPresentAttentuation =
723+ priv->cck_present_attn =
727724 priv->CCKPresentAttentuation_40Mdefault +
728725 priv->CCKPresentAttentuation_difference;
729726
730− if (priv->CCKPresentAttentuation > (CCKTxBBGainTableLength-1))
731− priv->CCKPresentAttentuation = CCKTxBBGainTableLength-1;
732− if (priv->CCKPresentAttentuation < 0)
733− priv->CCKPresentAttentuation = 0;
727+ if (priv->cck_present_attn > (CCKTxBBGainTableLength-1))
728+ priv->cck_present_attn = CCKTxBBGainTableLength-1;
729+ if (priv->cck_present_attn < 0)
730+ priv->cck_present_attn = 0;
734731
735− if (priv->CCKPresentAttentuation > -1 &&
736− priv->CCKPresentAttentuation < CCKTxBBGainTableLength) {
732+ if (priv->cck_present_attn > -1 &&
733+ priv->cck_present_attn < CCKTxBBGainTableLength) {
737734 if (priv->rtllib->current_network.channel == 14 &&
738735 !priv->bcck_in_ch14) {
739736 priv->bcck_in_ch14 = true;
@@ -777,9 +774,8 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) · 37 unmodified lines
777774 tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance,
778775 bMaskDWord);
779776 for (i = 0; i < OFDM_Table_Length; i++) {
780− if (tmpRegA == OFDMSwingTable[i]) {
777+ if (tmpRegA == OFDMSwingTable[i])
781778 priv->OFDM_index[0] = i;
782− }
783779 }
784780
785781 TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2);
@@ -967,7 +963,7 @@ static void _rtl92e_dm_cck_tx_power_adjust_tssi(struct net_device *dev, · 181 unmodified lines
967963 {
968964 u32 TempVal;
969965 struct r8192_priv *priv = rtllib_priv(dev);
970− u8 attenuation = priv->CCKPresentAttentuation;
966+ u8 attenuation = priv->cck_present_attn;
971967
972968 TempVal = 0;
973969 if (!bInCH14) {
@@ -1066,9 +1062,8 @@ void rtl92e_dm_restore_state(struct net_device *dev) · 92 unmodified lines
10661062 u32 reg_ratr = priv->rate_adaptive.last_ratr;
10671063 u32 ratr_value;
10681064
1069− if (!priv->up) {
1065+ if (!priv->up)
10701066 return;
1071− }
10721067
10731068 if (priv->rate_adaptive.rate_adaptive_disabled)
10741069 return;
@@ -1143,8 +1138,8 @@ static void _rtl92e_dm_dig_init(struct net_device *dev) · 68 unmodified lines
11431138
11441139 dm_digtable.dig_state = DM_STA_DIG_MAX;
11451140 dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX;
1146− dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT;
1147− dm_digtable.PreSTAConnectState = DIG_STA_DISCONNECT;
1141+ dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT;
1142+ dm_digtable.pre_sta_connect_state = DIG_STA_DISCONNECT;
11481143
11491144 dm_digtable.rssi_low_thresh = DM_DIG_THRESH_LOW;
11501145 dm_digtable.rssi_high_thresh = DM_DIG_THRESH_HIGH;
@@ -1212,9 +1207,9 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) · 61 unmodified lines
12121207 }
12131208
12141209 if (priv->rtllib->state == RTLLIB_LINKED)
1215− dm_digtable.CurSTAConnectState = DIG_STA_CONNECT;
1210+ dm_digtable.cur_sta_connect_state = DIG_STA_CONNECT;
12161211 else
1217− dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT;
1212+ dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT;
12181213
12191214
12201215 dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb;
@@ -1223,7 +1218,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev) · 2 unmodified lines
12231218 _rtl92e_dm_cs_ratio(dev);
12241219 if (dm_digtable.dig_algorithm_switch)
12251220 dm_digtable.dig_algorithm_switch = 0;
1226− dm_digtable.PreSTAConnectState = dm_digtable.CurSTAConnectState;
1221+ dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state;
12271222
12281223 }
12291224
@@ -1373,8 +1368,8 @@ static void _rtl92e_dm_initial_gain(struct net_device *dev) · 143 unmodified lines
13731368 return;
13741369 }
13751370
1376− if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) {
1377− if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) {
1371+ if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
1372+ if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) {
13781373 long gain_range = dm_digtable.rssi_val + 10 -
13791374 dm_digtable.backoff_val;
13801375 gain_range = clamp_t(long, gain_range,
@@ -1424,8 +1419,8 @@ static void _rtl92e_dm_pd_th(struct net_device *dev) · 43 unmodified lines
14241419 reset_cnt = 0;
14251420 }
14261421
1427− if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) {
1428− if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) {
1422+ if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
1423+ if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) {
14291424 if (dm_digtable.rssi_val >=
14301425 dm_digtable.rssi_high_power_highthresh)
14311426 dm_digtable.curpd_thstate =
@@ -1492,8 +1487,8 @@ static void _rtl92e_dm_cs_ratio(struct net_device *dev) · 60 unmodified lines
14921487 reset_cnt = 0;
14931488 }
14941489
1495− if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) {
1496− if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) {
1490+ if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) {
1491+ if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) {
14971492 if (dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh)
14981493 dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER;
14991494 else if (dm_digtable.rssi_val >= dm_digtable.rssi_high_thresh)
@@ -1537,7 +1532,7 @@ void rtl92e_dm_init_edca_turbo(struct net_device *dev) · 37 unmodified lines
15371532 static void _rtl92e_dm_check_edca_turbo(struct net_device *dev)
15381533 {
15391534 struct r8192_priv *priv = rtllib_priv(dev);
1540− struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo;
1535+ struct rt_hi_throughput *ht_info = priv->rtllib->ht_info;
15411536
15421537 static unsigned long lastTxOkCnt;
15431538 static unsigned long lastRxOkCnt;
@@ -1548,18 +1543,18 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) · 4 unmodified lines
15481543 goto dm_CheckEdcaTurbo_EXIT;
15491544 if (priv->rtllib->state != RTLLIB_LINKED)
15501545 goto dm_CheckEdcaTurbo_EXIT;
1551− if (priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO)
1546+ if (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO)
15521547 goto dm_CheckEdcaTurbo_EXIT;
15531548
15541549 if (!priv->rtllib->bis_any_nonbepkts) {
15551550 curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt;
15561551 curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt;
1557− if (pHTInfo->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) {
1552+ if (ht_info->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) {
15581553 if (curTxOkCnt > 4*curRxOkCnt) {
15591554 if (priv->bis_cur_rdlstate ||
15601555 !priv->bcurrent_turbo_EDCA) {
15611556 rtl92e_writel(dev, EDCAPARA_BE,
1562− edca_setting_UL[pHTInfo->IOTPeer]);
1557+ edca_setting_UL[ht_info->IOTPeer]);
15631558 priv->bis_cur_rdlstate = false;
15641559 }
15651560 } else {
@@ -1567,10 +1562,10 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) · 1 unmodified line
15671562 !priv->bcurrent_turbo_EDCA) {
15681563 if (priv->rtllib->mode == WIRELESS_MODE_G)
15691564 rtl92e_writel(dev, EDCAPARA_BE,
1570− edca_setting_DL_GMode[pHTInfo->IOTPeer]);
1565+ edca_setting_DL_GMode[ht_info->IOTPeer]);
15711566 else
15721567 rtl92e_writel(dev, EDCAPARA_BE,
1573− edca_setting_DL[pHTInfo->IOTPeer]);
1568+ edca_setting_DL[ht_info->IOTPeer]);
15741569 priv->bis_cur_rdlstate = true;
15751570 }
15761571 }
@@ -1581,17 +1576,17 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) · 4 unmodified lines
15811576 !priv->bcurrent_turbo_EDCA) {
15821577 if (priv->rtllib->mode == WIRELESS_MODE_G)
15831578 rtl92e_writel(dev, EDCAPARA_BE,
1584− edca_setting_DL_GMode[pHTInfo->IOTPeer]);
1579+ edca_setting_DL_GMode[ht_info->IOTPeer]);
15851580 else
15861581 rtl92e_writel(dev, EDCAPARA_BE,
1587− edca_setting_DL[pHTInfo->IOTPeer]);
1582+ edca_setting_DL[ht_info->IOTPeer]);
15881583 priv->bis_cur_rdlstate = true;
15891584 }
15901585 } else {
15911586 if (priv->bis_cur_rdlstate ||
15921587 !priv->bcurrent_turbo_EDCA) {
15931588 rtl92e_writel(dev, EDCAPARA_BE,
1594− edca_setting_UL[pHTInfo->IOTPeer]);
1589+ edca_setting_UL[ht_info->IOTPeer]);
15951590 priv->bis_cur_rdlstate = false;
15961591 }
15971592
@@ -1626,23 +1621,23 @@ static void _rtl92e_dm_init_cts_to_self(struct net_device *dev) · 28 unmodified lines
16261621 static void _rtl92e_dm_cts_to_self(struct net_device *dev)
16271622 {
16281623 struct r8192_priv *priv = rtllib_priv((struct net_device *)dev);
1629− struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo;
1624+ struct rt_hi_throughput *ht_info = priv->rtllib->ht_info;
16301625 static unsigned long lastTxOkCnt;
16311626 static unsigned long lastRxOkCnt;
16321627 unsigned long curTxOkCnt = 0;
16331628 unsigned long curRxOkCnt = 0;
16341629
16351630 if (!priv->rtllib->bCTSToSelfEnable) {
1636− pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF;
1631+ ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF;
16371632 return;
16381633 }
1639− if (pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) {
1634+ if (ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) {
16401635 curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt;
16411636 curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt;
16421637 if (curRxOkCnt > 4*curTxOkCnt)
1643− pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF;
1638+ ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF;
16441639 else
1645− pHTInfo->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF;
1640+ ht_info->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF;
16461641
16471642 lastTxOkCnt = priv->stats.txbytesunicast;
16481643 lastRxOkCnt = priv->stats.rxbytesunicast;
@@ -1653,10 +1648,10 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev) · 4 unmodified lines
16531648 static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev)
16541649 {
16551650 struct r8192_priv *priv = rtllib_priv((struct net_device *)dev);
1656− struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo;
1651+ struct rt_hi_throughput *ht_info = priv->rtllib->ht_info;
16571652
1658− pHTInfo->bWAIotBroadcom = false;
1659− pHTInfo->WAIotTH = WAIotTHVal;
1653+ ht_info->bWAIotBroadcom = false;
1654+ ht_info->WAIotTH = WAIotTHVal;
16601655 }
16611656
16621657 static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
@@ -1698,7 +1693,7 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data) · 35 unmodified lines
16981693
16991694 if (bActuallySet) {
17001695 mdelay(1000);
1701− priv->bHwRfOffAction = 1;
1696+ priv->hw_rf_off_action = 1;
17021697 rtl92e_set_rf_state(dev, rf_power_state_to_set, RF_CHANGE_BY_HW);
17031698 if (priv->hw_radio_off)
17041699 argv[1] = "RFOFF";
@@ -1997,7 +1992,7 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t) · 292 unmodified lines
19971992
19981993 if (priv->rtllib->state == RTLLIB_LINKED &&
19991994 priv->rtllib->bfsync_enable &&
2000− (priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_CDD_FSYNC)) {
1995+ (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_CDD_FSYNC)) {
20011996 u32 rate_bitmap;
20021997
20031998 for (rate_index = 0; rate_index <= 27; rate_index++) {
@@ -2126,8 +2121,8 @@ static void _rtl92e_dm_end_sw_fsync(struct net_device *dev) · 122 unmodified lines
21262121 static void _rtl92e_dm_start_sw_fsync(struct net_device *dev)
21272122 {
21282123 struct r8192_priv *priv = rtllib_priv(dev);
2129− u32 rateIndex;
2130− u32 rateBitmap;
2124+ u32 rate_index;
2125+ u32 rate_bitmap;
21312126
21322127 priv->rate_record = 0;
21332128 priv->ContinueDiffCount = 0;
@@ -2141,12 +2136,12 @@ static void _rtl92e_dm_start_sw_fsync(struct net_device *dev) · 7 unmodified lines
21412136 priv->rtllib->fsync_firstdiff_ratethreshold = 200;
21422137 priv->rtllib->fsync_seconddiff_ratethreshold = 200;
21432138 }
2144− for (rateIndex = 0; rateIndex <= 27; rateIndex++) {
2145− rateBitmap = 1 << rateIndex;
2146− if (priv->rtllib->fsync_rate_bitmap & rateBitmap)
2139+ for (rate_index = 0; rate_index <= 27; rate_index++) {
2140+ rate_bitmap = 1 << rate_index;
2141+ if (priv->rtllib->fsync_rate_bitmap & rate_bitmap)
21472142 priv->rate_record +=
21482143 priv->stats.received_rate_histogram[1]
2149− [rateIndex];
2144+ [rate_index];
21502145 }
21512146 if (timer_pending(&priv->fsync_timer))
21522147 del_timer_sync(&priv->fsync_timer);
@@ -2168,7 +2163,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev) · 15 unmodified lines
21682163 static u32 reset_cnt;
21692164
21702165 if (priv->rtllib->state == RTLLIB_LINKED &&
2171− priv->rtllib->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) {
2166+ priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) {
21722167 if (priv->rtllib->bfsync_enable == 0) {
21732168 switch (priv->rtllib->fsync_state) {
21742169 case Default_Fsync:
@@ -2293,7 +2288,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev) · 118 unmodified lines
22932288 priv->bDynamicTxLowPower = false;
22942289 return;
22952290 }
2296− if ((priv->rtllib->pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) &&
2291+ if ((priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) &&
22972292 (priv->rtllib->mode == IEEE_G)) {
22982293 txhipower_threshold = TX_POWER_ATHEROAP_THRESH_HIGH;
22992294 txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h+5−5
@@ -66,8 +66,8 @@ struct dig_t { · 65 unmodified lines
6666
6767 u8 dig_state;
6868 u8 dig_highpwr_state;
69− u8 CurSTAConnectState;
70− u8 PreSTAConnectState;
69+ u8 cur_sta_connect_state;
70+ u8 pre_sta_connect_state;
7171
7272 u8 curpd_thstate;
7373 u8 prepd_thstate;
@@ -152,9 +152,9 @@ enum dm_cck_rx_path_method { · 78 unmodified lines
152152
153153
154154 struct dcmd_txcmd {
155− u32 Op;
156− u32 Length;
157− u32 Value;
155+ u32 op;
156+ u32 length;
157+ u32 value;
158158 };
159159 /*------------------------------Define structure----------------------------*/
160160
drivers/staging/rtl8192e/rtl8192e/rtl_eeprom.c+1−1
@@ -79,6 +79,6 @@ u32 rtl92e_eeprom_read(struct net_device *dev, u32 addr) · 78 unmodified lines
7979 ret = _rtl92e_eeprom_xfer(dev, (addr & 0x3F) | (0x6 << 6), 9);
8080
8181 rtl92e_writeb(dev, EPROM_CMD,
82− (EPROM_CMD_NORMAL<<EPROM_CMD_OPERATING_MODE_SHIFT));
82+ (EPROM_CMD_NORMAL << EPROM_CMD_OPERATING_MODE_SHIFT));
8383 return ret;
8484 }
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c+39−56
@@ -100,50 +100,43 @@ void rtl92e_enter_sleep(struct net_device *dev, u64 time) · 99 unmodified lines
100100 static void _rtl92e_ps_update_rf_state(struct net_device *dev)
101101 {
102102 struct r8192_priv *priv = rtllib_priv(dev);
103− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
104− &(priv->rtllib->PowerSaveControl);
103+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
104+ &priv->rtllib->pwr_save_ctrl;
105105
106− pPSC->bSwRfProcessing = true;
107− rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
106+ psc->bSwRfProcessing = true;
107+ rtl92e_set_rf_state(dev, psc->eInactivePowerState, RF_CHANGE_BY_IPS);
108108
109− pPSC->bSwRfProcessing = false;
109+ psc->bSwRfProcessing = false;
110110 }
111111
112112 void rtl92e_ips_enter(struct net_device *dev)
113113 {
114114 struct r8192_priv *priv = rtllib_priv(dev);
115− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
116− &(priv->rtllib->PowerSaveControl);
115+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
116+ &priv->rtllib->pwr_save_ctrl;
117117 enum rt_rf_power_state rt_state;
118118
119− if (pPSC->bInactivePs) {
120− rt_state = priv->rtllib->rf_power_state;
121− if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
122− (priv->rtllib->state != RTLLIB_LINKED) &&
123− (priv->rtllib->iw_mode != IW_MODE_MASTER)) {
124− pPSC->eInactivePowerState = rf_off;
125− priv->isRFOff = true;
126− priv->bInPowerSaveMode = true;
127− _rtl92e_ps_update_rf_state(dev);
128− }
119+ rt_state = priv->rtllib->rf_power_state;
120+ if (rt_state == rf_on && !psc->bSwRfProcessing &&
121+ (priv->rtllib->state != RTLLIB_LINKED) &&
122+ (priv->rtllib->iw_mode != IW_MODE_MASTER)) {
123+ psc->eInactivePowerState = rf_off;
124+ _rtl92e_ps_update_rf_state(dev);
129125 }
130126 }
131127
132128 void rtl92e_ips_leave(struct net_device *dev)
133129 {
134130 struct r8192_priv *priv = rtllib_priv(dev);
135− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
136− &(priv->rtllib->PowerSaveControl);
131+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
132+ &priv->rtllib->pwr_save_ctrl;
137133 enum rt_rf_power_state rt_state;
138134
139− if (pPSC->bInactivePs) {
140− rt_state = priv->rtllib->rf_power_state;
141− if (rt_state != rf_on && !pPSC->bSwRfProcessing &&
142− priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
143− pPSC->eInactivePowerState = rf_on;
144− priv->bInPowerSaveMode = false;
145− _rtl92e_ps_update_rf_state(dev);
146− }
135+ rt_state = priv->rtllib->rf_power_state;
136+ if (rt_state != rf_on && !psc->bSwRfProcessing &&
137+ priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
138+ psc->eInactivePowerState = rf_on;
139+ _rtl92e_ps_update_rf_state(dev);
147140 }
148141 }
149142
@@ -165,18 +158,15 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev) · 15 unmodified lines
165158 enum rt_rf_power_state rt_state;
166159
167160 rt_state = priv->rtllib->rf_power_state;
168−
169− if (priv->rtllib->PowerSaveControl.bInactivePs) {
170− if (rt_state == rf_off) {
171− if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
172− netdev_warn(dev, "%s(): RF is OFF.\n",
173− __func__);
174− return;
175− }
176− netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n",
161+ if (rt_state == rf_off) {
162+ if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
163+ netdev_warn(dev, "%s(): RF is OFF.\n",
177164 __func__);
178− schedule_work(&priv->rtllib->ips_leave_wq);
165+ return;
179166 }
167+ netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n",
168+ __func__);
169+ schedule_work(&priv->rtllib->ips_leave_wq);
180170 }
181171 }
182172
@@ -216,8 +206,8 @@ static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode) · 33 unmodified lines
216206 void rtl92e_leisure_ps_enter(struct net_device *dev)
217207 {
218208 struct r8192_priv *priv = rtllib_priv(dev);
219− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
220− &(priv->rtllib->PowerSaveControl);
209+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
210+ &priv->rtllib->pwr_save_ctrl;
221211
222212 if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) &&
223213 (priv->rtllib->state == RTLLIB_LINKED))
@@ -225,38 +215,31 @@ void rtl92e_leisure_ps_enter(struct net_device *dev) · 1 unmodified line
225215 (priv->rtllib->iw_mode == IW_MODE_MASTER))
226216 return;
227217
228− if (pPSC->bLeisurePs) {
229− if (pPSC->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {
218+ if (psc->bLeisurePs) {
219+ if (psc->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {
230220
231221 if (priv->rtllib->ps == RTLLIB_PS_DISABLED) {
232− if (!pPSC->bFwCtrlLPS) {
233− if (priv->rtllib->SetFwCmdHandler)
234− priv->rtllib->SetFwCmdHandler(
235− dev, FW_CMD_LPS_ENTER);
236− }
222+ if (priv->rtllib->SetFwCmdHandler)
223+ priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_ENTER);
237224 _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST |
238225 RTLLIB_PS_UNICAST);
239226 }
240227 } else
241− pPSC->LpsIdleCount++;
228+ psc->LpsIdleCount++;
242229 }
243230 }
244231
245232 void rtl92e_leisure_ps_leave(struct net_device *dev)
246233 {
247234 struct r8192_priv *priv = rtllib_priv(dev);
248− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
249− &(priv->rtllib->PowerSaveControl);
235+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
236+ &priv->rtllib->pwr_save_ctrl;
250237
251− if (pPSC->bLeisurePs) {
238+ if (psc->bLeisurePs) {
252239 if (priv->rtllib->ps != RTLLIB_PS_DISABLED) {
253240 _rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED);
254−
255− if (!pPSC->bFwCtrlLPS) {
256− if (priv->rtllib->SetFwCmdHandler)
257− priv->rtllib->SetFwCmdHandler(dev,
258− FW_CMD_LPS_LEAVE);
259− }
241+ if (priv->rtllib->SetFwCmdHandler)
242+ priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_LEAVE);
260243 }
261244 }
262245 }
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c+45−49
@@ -159,21 +159,21 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev, · 158 unmodified lines
159159 union iwreq_data *wrqu, char *extra)
160160 {
161161 struct r8192_priv *priv = rtllib_priv(dev);
162− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
163− (&priv->rtllib->PowerSaveControl);
162+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
163+ (&priv->rtllib->pwr_save_ctrl);
164164 struct rtllib_device *ieee = priv->rtllib;
165165
166166 mutex_lock(&priv->wx_mutex);
167167
168168 if (*extra || priv->force_lps) {
169169 priv->ps_force = false;
170− pPSC->bLeisurePs = true;
170+ psc->bLeisurePs = true;
171171 } else {
172172 if (priv->rtllib->state == RTLLIB_LINKED)
173173 rtl92e_leisure_ps_leave(dev);
174174
175175 priv->ps_force = true;
176− pPSC->bLeisurePs = false;
176+ psc->bLeisurePs = false;
177177 ieee->ps = *extra;
178178 }
179179
@@ -188,15 +188,15 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev, · 8 unmodified lines
188188 char *extra)
189189 {
190190 struct r8192_priv *priv = rtllib_priv(dev);
191− struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
192− (&priv->rtllib->PowerSaveControl);
191+ struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
192+ (&priv->rtllib->pwr_save_ctrl);
193193
194194 mutex_lock(&priv->wx_mutex);
195195
196196 netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n",
197197 __func__, *extra);
198198
199− pPSC->RegMaxLPSAwakeIntvl = *extra;
199+ psc->reg_max_lps_awake_intvl = *extra;
200200 mutex_unlock(&priv->wx_mutex);
201201 return 0;
202202 }
@@ -251,23 +251,21 @@ static int _rtl92e_wx_set_mode(struct net_device *dev, · 48 unmodified lines
251251 rt_state = priv->rtllib->rf_power_state;
252252 mutex_lock(&priv->wx_mutex);
253253 if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR ||
254− ieee->bNetPromiscuousMode) {
255− if (priv->rtllib->PowerSaveControl.bInactivePs) {
256− if (rt_state == rf_off) {
257− if (priv->rtllib->rf_off_reason >
258− RF_CHANGE_BY_IPS) {
259− netdev_warn(dev, "%s(): RF is OFF.\n",
260− __func__);
261− mutex_unlock(&priv->wx_mutex);
262− return -1;
263− }
264− netdev_info(dev,
265− "=========>%s(): rtl92e_ips_leave\n",
254+ ieee->net_promiscuous_md) {
255+ if (rt_state == rf_off) {
256+ if (priv->rtllib->rf_off_reason >
257+ RF_CHANGE_BY_IPS) {
258+ netdev_warn(dev, "%s(): RF is OFF.\n",
266259 __func__);
267− mutex_lock(&priv->rtllib->ips_mutex);
268− rtl92e_ips_leave(dev);
269− mutex_unlock(&priv->rtllib->ips_mutex);
260+ mutex_unlock(&priv->wx_mutex);
261+ return -1;
270262 }
263+ netdev_info(dev,
264+ "=========>%s(): rtl92e_ips_leave\n",
265+ __func__);
266+ mutex_lock(&priv->rtllib->ips_mutex);
267+ rtl92e_ips_leave(dev);
268+ mutex_unlock(&priv->rtllib->ips_mutex);
271269 }
272270 }
273271 ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b);
@@ -395,7 +393,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, · 121 unmodified lines
395393 rt_state = priv->rtllib->rf_power_state;
396394 if (!priv->up)
397395 return -ENETDOWN;
398− if (priv->rtllib->LinkDetectInfo.bBusyTraffic == true)
396+ if (priv->rtllib->link_detect_info.bBusyTraffic == true)
399397 return -EAGAIN;
400398
401399 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
@@ -414,19 +412,17 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, · 12 unmodified lines
414412 priv->rtllib->FirstIe_InScan = true;
415413
416414 if (priv->rtllib->state != RTLLIB_LINKED) {
417− if (priv->rtllib->PowerSaveControl.bInactivePs) {
418− if (rt_state == rf_off) {
419− if (priv->rtllib->rf_off_reason >
420− RF_CHANGE_BY_IPS) {
421− netdev_warn(dev, "%s(): RF is OFF.\n",
422− __func__);
423− mutex_unlock(&priv->wx_mutex);
424− return -1;
425− }
426− mutex_lock(&priv->rtllib->ips_mutex);
427− rtl92e_ips_leave(dev);
428− mutex_unlock(&priv->rtllib->ips_mutex);
415+ if (rt_state == rf_off) {
416+ if (priv->rtllib->rf_off_reason >
417+ RF_CHANGE_BY_IPS) {
418+ netdev_warn(dev, "%s(): RF is OFF.\n",
419+ __func__);
420+ mutex_unlock(&priv->wx_mutex);
421+ return -1;
429422 }
423+ mutex_lock(&priv->rtllib->ips_mutex);
424+ rtl92e_ips_leave(dev);
425+ mutex_unlock(&priv->rtllib->ips_mutex);
430426 }
431427 rtllib_stop_scan(priv->rtllib);
432428 if (priv->rtllib->LedControlHandler)
@@ -919,7 +915,7 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev, · 486 unmodified lines
919915 key, 0);
920916 } else {
921917 if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) &&
922− ieee->pHTInfo->bCurrentHTSupport)
918+ ieee->ht_info->bCurrentHTSupport)
923919 rtl92e_writeb(dev, 0x173, 1);
924920 rtl92e_set_key(dev, 4, idx, alg,
925921 (u8 *)ieee->ap_mac_addr, 0, key);
@@ -1018,29 +1014,29 @@ static int _rtl92e_wx_set_promisc_mode(struct net_device *dev, · 92 unmodified lines
10181014 u32 info_buf[3];
10191015
10201016 u32 oid;
1021− u32 bPromiscuousOn;
1022− u32 bFilterSourceStationFrame;
1017+ u32 promiscuous_on;
1018+ u32 fltr_src_sta_frame;
10231019
10241020 if (copy_from_user(info_buf, wrqu->data.pointer, sizeof(info_buf)))
10251021 return -EFAULT;
10261022
10271023 oid = info_buf[0];
1028− bPromiscuousOn = info_buf[1];
1029− bFilterSourceStationFrame = info_buf[2];
1024+ promiscuous_on = info_buf[1];
1025+ fltr_src_sta_frame = info_buf[2];
10301026
10311027 if (oid == OID_RT_INTEL_PROMISCUOUS_MODE) {
1032− ieee->IntelPromiscuousModeInfo.bPromiscuousOn =
1033− (bPromiscuousOn) ? (true) : (false);
1034− ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame =
1035− (bFilterSourceStationFrame) ? (true) : (false);
1036− (bPromiscuousOn) ?
1028+ ieee->intel_promiscuous_md_info.promiscuous_on =
1029+ (promiscuous_on) ? (true) : (false);
1030+ ieee->intel_promiscuous_md_info.fltr_src_sta_frame =
1031+ (fltr_src_sta_frame) ? (true) : (false);
1032+ (promiscuous_on) ?
10371033 (rtllib_EnableIntelPromiscuousMode(dev, false)) :
10381034 (rtllib_DisableIntelPromiscuousMode(dev, false));
10391035
10401036 netdev_info(dev,
10411037 "=======>%s(), on = %d, filter src sta = %d\n",
1042− __func__, bPromiscuousOn,
1043− bFilterSourceStationFrame);
1038+ __func__, promiscuous_on,
1039+ fltr_src_sta_frame);
10441040 } else {
10451041 return -1;
10461042 }
@@ -1058,8 +1054,8 @@ static int _rtl92e_wx_get_promisc_mode(struct net_device *dev, · 11 unmodified lines
10581054 mutex_lock(&priv->wx_mutex);
10591055
10601056 snprintf(extra, 45, "PromiscuousMode:%d, FilterSrcSTAFrame:%d",
1061− ieee->IntelPromiscuousModeInfo.bPromiscuousOn,
1062− ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame);
1057+ ieee->intel_promiscuous_md_info.promiscuous_on,
1058+ ieee->intel_promiscuous_md_info.fltr_src_sta_frame);
10631059 wrqu->data.length = strlen(extra) + 1;
10641060
10651061 mutex_unlock(&priv->wx_mutex);
drivers/staging/rtl8192e/rtl819x_BAProc.c+18−20
@@ -62,6 +62,7 @@ void ResetBaEntry(struct ba_record *pBA) · 61 unmodified lines
6262 pBA->dialog_token = 0;
6363 pBA->ba_start_seq_ctrl.short_data = 0;
6464 }
65+
6566 static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
6667 struct ba_record *pBA,
6768 u16 StatusCode, u8 type)
@@ -111,7 +112,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, · 43 unmodified lines
111112 tag += 2;
112113
113114 if (type == ACT_ADDBAREQ) {
114− memcpy(tag, (u8 *)&(pBA->ba_start_seq_ctrl), 2);
115+ memcpy(tag, (u8 *)&pBA->ba_start_seq_ctrl, 2);
115116 tag += 2;
116117 }
117118
@@ -159,7 +160,6 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, · 41 unmodified lines
159160 *tag++ = ACT_CAT_BA;
160161 *tag++ = ACT_DELBA;
161162
162−
163163 put_unaligned_le16(DelbaParamSet.short_data, tag);
164164 tag += 2;
165165
@@ -180,11 +180,10 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, · 14 unmodified lines
180180
181181 skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ);
182182
183− if (skb) {
183+ if (skb)
184184 softmac_mgmt_xmit(skb, ieee);
185− } else {
185+ else
186186 netdev_dbg(ieee->dev, "Failed to generate ADDBAReq packet.\n");
187− }
188187 }
189188
190189 static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst,
@@ -245,17 +244,17 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) · 54 unmodified lines
245244 pBaStartSeqCtrl = (union sequence_control *)(req + 7);
246245
247246 if (!ieee->current_network.qos_data.active ||
248− !ieee->pHTInfo->bCurrentHTSupport ||
249− (ieee->pHTInfo->iot_action & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
247+ !ieee->ht_info->bCurrentHTSupport ||
248+ (ieee->ht_info->iot_action & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
250249 rc = ADDBA_STATUS_REFUSED;
251250 netdev_warn(ieee->dev,
252251 "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n",
253252 ieee->current_network.qos_data.active,
254− ieee->pHTInfo->bCurrentHTSupport);
253+ ieee->ht_info->bCurrentHTSupport);
255254 goto OnADDBAReq_Fail;
256255 }
257− if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst,
258− (u8)(pBaParamSet->field.tid), RX_DIR, true)) {
256+ if (!GetTs(ieee, (struct ts_common_info **)&pTS, dst,
257+ (u8)(pBaParamSet->field.tid), RX_DIR, true)) {
259258 rc = ADDBA_STATUS_REFUSED;
260259 netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__);
261260 goto OnADDBAReq_Fail;
@@ -278,7 +277,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) · 16 unmodified lines
278277 pBA->ba_start_seq_ctrl = *pBaStartSeqCtrl;
279278
280279 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev) ||
281− (ieee->pHTInfo->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT))
280+ (ieee->ht_info->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT))
282281 pBA->ba_param_set.field.buffer_size = 1;
283282 else
284283 pBA->ba_param_set.field.buffer_size = 32;
@@ -327,18 +326,18 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) · 42 unmodified lines
327326 pBaTimeoutVal = (u16 *)(tag + 7);
328327
329328 if (!ieee->current_network.qos_data.active ||
330− !ieee->pHTInfo->bCurrentHTSupport ||
331− !ieee->pHTInfo->bCurrentAMPDUEnable) {
329+ !ieee->ht_info->bCurrentHTSupport ||
330+ !ieee->ht_info->bCurrentAMPDUEnable) {
332331 netdev_warn(ieee->dev,
333332 "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n",
334333 ieee->current_network.qos_data.active,
335− ieee->pHTInfo->bCurrentHTSupport,
336− ieee->pHTInfo->bCurrentAMPDUEnable);
334+ ieee->ht_info->bCurrentHTSupport,
335+ ieee->ht_info->bCurrentAMPDUEnable);
337336 ReasonCode = DELBA_REASON_UNKNOWN_BA;
338337 goto OnADDBARsp_Reject;
339338 }
340339
341− if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst,
340+ if (!GetTs(ieee, (struct ts_common_info **)&pTS, dst,
342341 (u8)(pBaParamSet->field.tid), TX_DIR, false)) {
343342 netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__);
344343 ReasonCode = DELBA_REASON_UNKNOWN_BA;
@@ -375,7 +374,6 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb) · 30 unmodified lines
375374 goto OnADDBARsp_Reject;
376375 }
377376
378−
379377 pAdmittedBA->dialog_token = *pDialogToken;
380378 pAdmittedBA->ba_timeout_value = *pBaTimeoutVal;
381379 pAdmittedBA->ba_start_seq_ctrl = pPendingBA->ba_start_seq_ctrl;
@@ -415,11 +413,11 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) · 33 unmodified lines
415413 }
416414
417415 if (!ieee->current_network.qos_data.active ||
418− !ieee->pHTInfo->bCurrentHTSupport) {
416+ !ieee->ht_info->bCurrentHTSupport) {
419417 netdev_warn(ieee->dev,
420418 "received DELBA while QOS or HT is not supported(%d, %d)\n",
421419 ieee->current_network. qos_data.active,
422− ieee->pHTInfo->bCurrentHTSupport);
420+ ieee->ht_info->bCurrentHTSupport);
423421 return -1;
424422 }
425423
@@ -435,7 +433,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb) · 9 unmodified lines
435433 struct rx_ts_record *pRxTs;
436434
437435 if (!GetTs(ieee, (struct ts_common_info **)&pRxTs, dst,
438− (u8)pDelBaParamSet->field.tid, RX_DIR, false)) {
436+ (u8)pDelBaParamSet->field.tid, RX_DIR, false)) {
439437 netdev_warn(ieee->dev,
440438 "%s(): can't get TS for RXTS. dst:%pM TID:%d\n",
441439 __func__, dst,
drivers/staging/rtl8192e/rtl819x_HT.h+1−1
@@ -96,7 +96,7 @@ enum ht_aggre_mode { · 95 unmodified lines
9696
9797
9898 struct rt_hi_throughput {
99− u8 bEnableHT;
99+ u8 enable_ht;
100100 u8 bCurrentHTSupport;
101101
102102 u8 bRegBW40MHz;
drivers/staging/rtl8192e/rtl819x_HTProc.c+201−204
@@ -69,47 +69,48 @@ static u8 LINKSYS_MARVELL_4400N[3] = {0x00, 0x14, 0xa4}; · 68 unmodified lines
6969
7070 void HTUpdateDefaultSetting(struct rtllib_device *ieee)
7171 {
72− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
73− pHTInfo->bRegShortGI20MHz = 1;
74− pHTInfo->bRegShortGI40MHz = 1;
72+ struct rt_hi_throughput *ht_info = ieee->ht_info;
7573
76− pHTInfo->bRegBW40MHz = 1;
74+ ht_info->bRegShortGI20MHz = 1;
75+ ht_info->bRegShortGI40MHz = 1;
7776
78− if (pHTInfo->bRegBW40MHz)
79− pHTInfo->bRegSuppCCK = 1;
77+ ht_info->bRegBW40MHz = 1;
78+
79+ if (ht_info->bRegBW40MHz)
80+ ht_info->bRegSuppCCK = 1;
8081 else
81− pHTInfo->bRegSuppCCK = true;
82+ ht_info->bRegSuppCCK = true;
8283
83− pHTInfo->nAMSDU_MaxSize = 7935UL;
84− pHTInfo->bAMSDU_Support = 0;
84+ ht_info->nAMSDU_MaxSize = 7935UL;
85+ ht_info->bAMSDU_Support = 0;
8586
86− pHTInfo->bAMPDUEnable = 1;
87− pHTInfo->AMPDU_Factor = 2;
88− pHTInfo->MPDU_Density = 0;
87+ ht_info->bAMPDUEnable = 1;
88+ ht_info->AMPDU_Factor = 2;
89+ ht_info->MPDU_Density = 0;
8990
90− pHTInfo->self_mimo_ps = 3;
91− if (pHTInfo->self_mimo_ps == 2)
92− pHTInfo->self_mimo_ps = 3;
93− ieee->bTxDisableRateFallBack = 0;
94− ieee->bTxUseDriverAssingedRate = 0;
91+ ht_info->self_mimo_ps = 3;
92+ if (ht_info->self_mimo_ps == 2)
93+ ht_info->self_mimo_ps = 3;
94+ ieee->tx_dis_rate_fallback = 0;
95+ ieee->tx_use_drv_assinged_rate = 0;
9596
9697 ieee->bTxEnableFwCalcDur = 1;
9798
98− pHTInfo->reg_rt2rt_aggregation = 1;
99+ ht_info->reg_rt2rt_aggregation = 1;
99100
100− pHTInfo->reg_rx_reorder_enable = 1;
101− pHTInfo->rx_reorder_win_size = 64;
102− pHTInfo->rx_reorder_pending_time = 30;
101+ ht_info->reg_rx_reorder_enable = 1;
102+ ht_info->rx_reorder_win_size = 64;
103+ ht_info->rx_reorder_pending_time = 30;
103104 }
104105
105106 static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate)
106107 {
107− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
108+ struct rt_hi_throughput *ht_info = ieee->ht_info;
108109
109− u8 is40MHz = (pHTInfo->bCurBW40MHz) ? 1 : 0;
110− u8 isShortGI = (pHTInfo->bCurBW40MHz) ?
111− ((pHTInfo->bCurShortGI40MHz) ? 1 : 0) :
112− ((pHTInfo->bCurShortGI20MHz) ? 1 : 0);
110+ u8 is40MHz = (ht_info->bCurBW40MHz) ? 1 : 0;
111+ u8 isShortGI = (ht_info->bCurBW40MHz) ?
112+ ((ht_info->bCurShortGI40MHz) ? 1 : 0) :
113+ ((ht_info->bCurShortGI20MHz) ? 1 : 0);
113114 return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)];
114115 }
115116
@@ -151,8 +152,8 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee) · 35 unmodified lines
151152 (net->ralink_cap_exist))
152153 retValue = true;
153154 else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
154− !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
155− !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
155+ !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
156+ !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
156157 (net->broadcom_cap_exist))
157158 retValue = true;
158159 else if (net->bssht.bd_rt2rt_aggregation)
@@ -165,45 +166,45 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee) · 6 unmodified lines
165166
166167 static void HTIOTPeerDetermine(struct rtllib_device *ieee)
167168 {
168− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
169+ struct rt_hi_throughput *ht_info = ieee->ht_info;
169170 struct rtllib_network *net = &ieee->current_network;
170171
171172 if (net->bssht.bd_rt2rt_aggregation) {
172− pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK;
173+ ht_info->IOTPeer = HT_IOT_PEER_REALTEK;
173174 if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_92SE)
174− pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK_92SE;
175+ ht_info->IOTPeer = HT_IOT_PEER_REALTEK_92SE;
175176 if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_SOFTAP)
176− pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
177+ ht_info->IOTPeer = HT_IOT_PEER_92U_SOFTAP;
177178 } else if (net->broadcom_cap_exist) {
178− pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
179+ ht_info->IOTPeer = HT_IOT_PEER_BROADCOM;
179180 } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
180181 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
181182 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) {
182− pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
183+ ht_info->IOTPeer = HT_IOT_PEER_BROADCOM;
183184 } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) ||
184185 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) ||
185186 (memcmp(net->bssid, PCI_RALINK, 3) == 0) ||
186187 (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) ||
187188 (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) ||
188189 net->ralink_cap_exist) {
189− pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
190+ ht_info->IOTPeer = HT_IOT_PEER_RALINK;
190191 } else if ((net->atheros_cap_exist) ||
191192 (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) ||
192193 (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) {
193− pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
194+ ht_info->IOTPeer = HT_IOT_PEER_ATHEROS;
194195 } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) ||
195196 net->cisco_cap_exist) {
196− pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
197+ ht_info->IOTPeer = HT_IOT_PEER_CISCO;
197198 } else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) ||
198199 net->marvell_cap_exist) {
199− pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL;
200+ ht_info->IOTPeer = HT_IOT_PEER_MARVELL;
200201 } else if (net->airgo_cap_exist) {
201− pHTInfo->IOTPeer = HT_IOT_PEER_AIRGO;
202+ ht_info->IOTPeer = HT_IOT_PEER_AIRGO;
202203 } else {
203− pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN;
204+ ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN;
204205 }
205206
206− netdev_dbg(ieee->dev, "IOTPEER: %x\n", pHTInfo->IOTPeer);
207+ netdev_dbg(ieee->dev, "IOTPEER: %x\n", ht_info->IOTPeer);
207208 }
208209
209210 static u8 HTIOTActIsDisableMCS14(struct rtllib_device *ieee, u8 *PeerMacAddr)
@@ -232,7 +233,7 @@ static u8 HTIOTActIsMgntUseCCK6M(struct rtllib_device *ieee, · 22 unmodified lines
232233 {
233234 u8 retValue = 0;
234235
235− if (ieee->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM)
236+ if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM)
236237 retValue = 1;
237238
238239 return retValue;
@@ -242,49 +243,49 @@ static u8 HTIOTActIsCCDFsync(struct rtllib_device *ieee) · 3 unmodified lines
242243 {
243244 u8 retValue = 0;
244245
245− if (ieee->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM)
246+ if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM)
246247 retValue = 1;
247248 return retValue;
248249 }
249250
250251 static void HTIOTActDetermineRaFunc(struct rtllib_device *ieee, bool bPeerRx2ss)
251252 {
252− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
253+ struct rt_hi_throughput *ht_info = ieee->ht_info;
253254
254− pHTInfo->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL;
255+ ht_info->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL;
255256
256− if (pHTInfo->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss)
257− pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R;
257+ if (ht_info->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss)
258+ ht_info->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R;
258259
259− if (pHTInfo->iot_action & HT_IOT_ACT_AMSDU_ENABLE)
260− pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU;
260+ if (ht_info->iot_action & HT_IOT_ACT_AMSDU_ENABLE)
261+ ht_info->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU;
261262 }
262263
263−void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo)
264+void HTResetIOTSetting(struct rt_hi_throughput *ht_info)
264265 {
265− pHTInfo->iot_action = 0;
266− pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN;
267− pHTInfo->iot_ra_func = 0;
266+ ht_info->iot_action = 0;
267+ ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN;
268+ ht_info->iot_ra_func = 0;
268269 }
269270
270271 void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,
271272 u8 *len, u8 IsEncrypt, bool bAssoc)
272273 {
273− struct rt_hi_throughput *pHT = ieee->pHTInfo;
274+ struct rt_hi_throughput *pHT = ieee->ht_info;
274275 struct ht_capab_ele *pCapELE = NULL;
275276
276277 if (!posHTCap || !pHT) {
277278 netdev_warn(ieee->dev,
278− "%s(): posHTCap and pHTInfo are null\n", __func__);
279+ "%s(): posHTCap and ht_info are null\n", __func__);
279280 return;
280281 }
281282 memset(posHTCap, 0, *len);
282283
283284 if ((bAssoc) && (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)) {
284− u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};
285+ static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 };
285286
286287 memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap));
287− pCapELE = (struct ht_capab_ele *)&(posHTCap[4]);
288+ pCapELE = (struct ht_capab_ele *)&posHTCap[4];
288289 *len = 30 + 2;
289290 } else {
290291 pCapELE = (struct ht_capab_ele *)posHTCap;
@@ -322,7 +323,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, · 31 unmodified lines
322323 pCapELE->MPDUDensity = 0;
323324 }
324325
325− memcpy(pCapELE->MCS, ieee->Regdot11HTOperationalRateSet, 16);
326+ memcpy(pCapELE->MCS, ieee->reg_dot11ht_oper_rate_set, 16);
326327 memset(&pCapELE->ExtHTCapInfo, 0, 2);
327328 memset(pCapELE->TxBFCap, 0, 4);
328329
@@ -351,7 +352,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, · 22 unmodified lines
351352 void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,
352353 u8 *len, u8 IsEncrypt)
353354 {
354− struct rt_hi_throughput *pHT = ieee->pHTInfo;
355+ struct rt_hi_throughput *pHT = ieee->ht_info;
355356 struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo;
356357
357358 if (!posHTInfo || !pHTInfoEle) {
@@ -488,7 +489,7 @@ static u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS, · 130 unmodified lines
488489 u8 i;
489490
490491 for (i = 0; i <= 15; i++)
491− pOperateMCS[i] = ieee->Regdot11TxHTOperationalRateSet[i] &
492+ pOperateMCS[i] = ieee->reg_dot11tx_ht_oper_rate_set[i] &
492493 pSupportMCS[i];
493494
494495 HT_PickMCSRate(ieee, pOperateMCS);
@@ -508,163 +509,159 @@ void HTSetConnectBwMode(struct rtllib_device *ieee, · 13 unmodified lines
508509
509510 void HTOnAssocRsp(struct rtllib_device *ieee)
510511 {
511− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
512+ struct rt_hi_throughput *ht_info = ieee->ht_info;
512513 struct ht_capab_ele *pPeerHTCap = NULL;
513514 struct ht_info_ele *pPeerHTInfo = NULL;
514515 u16 nMaxAMSDUSize = 0;
515516 u8 *pMcsFilter = NULL;
516517
517− static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33};
518− static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34};
518+ static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 };
519+ static const u8 EWC11NHTInfo[] = { 0x00, 0x90, 0x4c, 0x34 };
519520
520− if (!pHTInfo->bCurrentHTSupport) {
521+ if (!ht_info->bCurrentHTSupport) {
521522 netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__);
522523 return;
523524 }
524525 netdev_dbg(ieee->dev, "%s(): HT_ENABLE\n", __func__);
525526
526− if (!memcmp(pHTInfo->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap)))
527− pPeerHTCap = (struct ht_capab_ele *)(&pHTInfo->PeerHTCapBuf[4]);
527+ if (!memcmp(ht_info->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap)))
528+ pPeerHTCap = (struct ht_capab_ele *)(&ht_info->PeerHTCapBuf[4]);
528529 else
529− pPeerHTCap = (struct ht_capab_ele *)(pHTInfo->PeerHTCapBuf);
530+ pPeerHTCap = (struct ht_capab_ele *)(ht_info->PeerHTCapBuf);
530531
531− if (!memcmp(pHTInfo->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo)))
532+ if (!memcmp(ht_info->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo)))
532533 pPeerHTInfo = (struct ht_info_ele *)
533− (&pHTInfo->PeerHTInfoBuf[4]);
534+ (&ht_info->PeerHTInfoBuf[4]);
534535 else
535− pPeerHTInfo = (struct ht_info_ele *)(pHTInfo->PeerHTInfoBuf);
536+ pPeerHTInfo = (struct ht_info_ele *)(ht_info->PeerHTInfoBuf);
536537
537538 #ifdef VERBOSE_DEBUG
538539 print_hex_dump_bytes("%s: ", __func__, DUMP_PREFIX_NONE,
539540 pPeerHTCap, sizeof(struct ht_capab_ele));
540541 #endif
541542 HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth),
542− (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset));
543− pHTInfo->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ?
543+ (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset));
544+ ht_info->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ?
544545 true : false);
545546
546− pHTInfo->bCurShortGI20MHz = ((pHTInfo->bRegShortGI20MHz) ?
547+ ht_info->bCurShortGI20MHz = ((ht_info->bRegShortGI20MHz) ?
547548 ((pPeerHTCap->ShortGI20Mhz == 1) ?
548549 true : false) : false);
549− pHTInfo->bCurShortGI40MHz = ((pHTInfo->bRegShortGI40MHz) ?
550+ ht_info->bCurShortGI40MHz = ((ht_info->bRegShortGI40MHz) ?
550551 ((pPeerHTCap->ShortGI40Mhz == 1) ?
551552 true : false) : false);
552553
553− pHTInfo->bCurSuppCCK = ((pHTInfo->bRegSuppCCK) ?
554+ ht_info->bCurSuppCCK = ((ht_info->bRegSuppCCK) ?
554555 ((pPeerHTCap->DssCCk == 1) ? true :
555556 false) : false);
556557
557− pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support;
558+ ht_info->bCurrent_AMSDU_Support = ht_info->bAMSDU_Support;
558559
559560 nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935;
560561
561− if (pHTInfo->nAMSDU_MaxSize > nMaxAMSDUSize)
562− pHTInfo->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize;
562+ if (ht_info->nAMSDU_MaxSize > nMaxAMSDUSize)
563+ ht_info->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize;
563564 else
564− pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize;
565+ ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize;
565566
566− pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable;
567+ ht_info->bCurrentAMPDUEnable = ht_info->bAMPDUEnable;
567568 if (ieee->rtllib_ap_sec_type &&
568− (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) {
569− if ((pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) ||
570− (pHTInfo->IOTPeer == HT_IOT_PEER_UNKNOWN))
571− pHTInfo->bCurrentAMPDUEnable = false;
569+ (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) {
570+ if ((ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) ||
571+ (ht_info->IOTPeer == HT_IOT_PEER_UNKNOWN))
572+ ht_info->bCurrentAMPDUEnable = false;
572573 }
573574
574− if (!pHTInfo->reg_rt2rt_aggregation) {
575− if (pHTInfo->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor)
576− pHTInfo->CurrentAMPDUFactor =
575+ if (!ht_info->reg_rt2rt_aggregation) {
576+ if (ht_info->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor)
577+ ht_info->CurrentAMPDUFactor =
577578 pPeerHTCap->MaxRxAMPDUFactor;
578579 else
579− pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
580+ ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor;
580581
581582 } else {
582583 if (ieee->current_network.bssht.bd_rt2rt_aggregation) {
583584 if (ieee->pairwise_key_type != KEY_TYPE_NA)
584− pHTInfo->CurrentAMPDUFactor =
585+ ht_info->CurrentAMPDUFactor =
585586 pPeerHTCap->MaxRxAMPDUFactor;
586587 else
587− pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_64K;
588+ ht_info->CurrentAMPDUFactor = HT_AGG_SIZE_64K;
588589 } else {
589− if (pPeerHTCap->MaxRxAMPDUFactor < HT_AGG_SIZE_32K)
590− pHTInfo->CurrentAMPDUFactor =
591− pPeerHTCap->MaxRxAMPDUFactor;
592− else
593− pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_32K;
590+ ht_info->CurrentAMPDUFactor = min_t(u32, pPeerHTCap->MaxRxAMPDUFactor,
591+ HT_AGG_SIZE_32K);
594592 }
595593 }
596− if (pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity)
597− pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density;
598− else
599− pHTInfo->current_mpdu_density = pPeerHTCap->MPDUDensity;
600− if (pHTInfo->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) {
601− pHTInfo->bCurrentAMPDUEnable = false;
602− pHTInfo->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE;
594+ ht_info->current_mpdu_density = max_t(u8, ht_info->MPDU_Density,
595+ pPeerHTCap->MPDUDensity);
596+ if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) {
597+ ht_info->bCurrentAMPDUEnable = false;
598+ ht_info->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE;
603599 }
604− pHTInfo->cur_rx_reorder_enable = pHTInfo->reg_rx_reorder_enable;
600+ ht_info->cur_rx_reorder_enable = ht_info->reg_rx_reorder_enable;
605601
606602 if (pPeerHTCap->MCS[0] == 0)
607603 pPeerHTCap->MCS[0] = 0xff;
608604
609605 HTIOTActDetermineRaFunc(ieee, ((pPeerHTCap->MCS[1]) != 0));
610606
611− HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11HTOperationalRateSet);
607+ HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11ht_oper_rate_set);
612608
613− pHTInfo->peer_mimo_ps = pPeerHTCap->MimoPwrSave;
614− if (pHTInfo->peer_mimo_ps == MIMO_PS_STATIC)
609+ ht_info->peer_mimo_ps = pPeerHTCap->MimoPwrSave;
610+ if (ht_info->peer_mimo_ps == MIMO_PS_STATIC)
615611 pMcsFilter = MCS_FILTER_1SS;
616612 else
617613 pMcsFilter = MCS_FILTER_ALL;
618614 ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee,
619− ieee->dot11HTOperationalRateSet, pMcsFilter);
615+ ieee->dot11ht_oper_rate_set,
616+ pMcsFilter);
620617 ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate;
621618
622− pHTInfo->current_op_mode = pPeerHTInfo->OptMode;
619+ ht_info->current_op_mode = pPeerHTInfo->OptMode;
623620 }
624621
625622 void HTInitializeHTInfo(struct rtllib_device *ieee)
626623 {
627− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
624+ struct rt_hi_throughput *ht_info = ieee->ht_info;
628625
629− pHTInfo->bCurrentHTSupport = false;
626+ ht_info->bCurrentHTSupport = false;
630627
631− pHTInfo->bCurBW40MHz = false;
632− pHTInfo->cur_tx_bw40mhz = false;
628+ ht_info->bCurBW40MHz = false;
629+ ht_info->cur_tx_bw40mhz = false;
633630
634− pHTInfo->bCurShortGI20MHz = false;
635− pHTInfo->bCurShortGI40MHz = false;
636− pHTInfo->forced_short_gi = false;
631+ ht_info->bCurShortGI20MHz = false;
632+ ht_info->bCurShortGI40MHz = false;
633+ ht_info->forced_short_gi = false;
637634
638− pHTInfo->bCurSuppCCK = true;
635+ ht_info->bCurSuppCCK = true;
639636
640− pHTInfo->bCurrent_AMSDU_Support = false;
641− pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize;
642− pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density;
643− pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
637+ ht_info->bCurrent_AMSDU_Support = false;
638+ ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize;
639+ ht_info->current_mpdu_density = ht_info->MPDU_Density;
640+ ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor;
644641
645− memset((void *)(&(pHTInfo->SelfHTCap)), 0,
646− sizeof(pHTInfo->SelfHTCap));
647− memset((void *)(&(pHTInfo->SelfHTInfo)), 0,
648− sizeof(pHTInfo->SelfHTInfo));
649− memset((void *)(&(pHTInfo->PeerHTCapBuf)), 0,
650− sizeof(pHTInfo->PeerHTCapBuf));
651− memset((void *)(&(pHTInfo->PeerHTInfoBuf)), 0,
652− sizeof(pHTInfo->PeerHTInfoBuf));
642+ memset((void *)(&ht_info->SelfHTCap), 0,
643+ sizeof(ht_info->SelfHTCap));
644+ memset((void *)(&ht_info->SelfHTInfo), 0,
645+ sizeof(ht_info->SelfHTInfo));
646+ memset((void *)(&ht_info->PeerHTCapBuf), 0,
647+ sizeof(ht_info->PeerHTCapBuf));
648+ memset((void *)(&ht_info->PeerHTInfoBuf), 0,
649+ sizeof(ht_info->PeerHTInfoBuf));
653650
654− pHTInfo->sw_bw_in_progress = false;
651+ ht_info->sw_bw_in_progress = false;
655652
656− pHTInfo->ePeerHTSpecVer = HT_SPEC_VER_IEEE;
653+ ht_info->ePeerHTSpecVer = HT_SPEC_VER_IEEE;
657654
658− pHTInfo->current_rt2rt_aggregation = false;
659− pHTInfo->current_rt2rt_long_slot_time = false;
660− pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0;
655+ ht_info->current_rt2rt_aggregation = false;
656+ ht_info->current_rt2rt_long_slot_time = false;
657+ ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0;
661658
662− pHTInfo->IOTPeer = 0;
663− pHTInfo->iot_action = 0;
664− pHTInfo->iot_ra_func = 0;
659+ ht_info->IOTPeer = 0;
660+ ht_info->iot_action = 0;
661+ ht_info->iot_ra_func = 0;
665662
666663 {
667− u8 *RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]);
664+ u8 *RegHTSuppRateSets = &ieee->reg_ht_supp_rate_set[0];
668665
669666 RegHTSuppRateSets[0] = 0xFF;
670667 RegHTSuppRateSets[1] = 0xFF;
@@ -690,130 +687,130 @@ void HTInitializeBssDesc(struct bss_ht *pBssHT) · 19 unmodified lines
690687 void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee,
691688 struct rtllib_network *pNetwork)
692689 {
693− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
690+ struct rt_hi_throughput *ht_info = ieee->ht_info;
694691 u8 bIOTAction = 0;
695692
696− /* unmark bEnableHT flag here is the same reason why unmarked in
693+ /* unmark enable_ht flag here is the same reason why unmarked in
697694 * function rtllib_softmac_new_net. WB 2008.09.10
698695 */
699696 if (pNetwork->bssht.bd_support_ht) {
700− pHTInfo->bCurrentHTSupport = true;
701− pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver;
697+ ht_info->bCurrentHTSupport = true;
698+ ht_info->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver;
702699
703700 if (pNetwork->bssht.bd_ht_cap_len > 0 &&
704− pNetwork->bssht.bd_ht_cap_len <= sizeof(pHTInfo->PeerHTCapBuf))
705− memcpy(pHTInfo->PeerHTCapBuf,
701+ pNetwork->bssht.bd_ht_cap_len <= sizeof(ht_info->PeerHTCapBuf))
702+ memcpy(ht_info->PeerHTCapBuf,
706703 pNetwork->bssht.bd_ht_cap_buf,
707704 pNetwork->bssht.bd_ht_cap_len);
708705
709706 if (pNetwork->bssht.bd_ht_info_len > 0 &&
710707 pNetwork->bssht.bd_ht_info_len <=
711− sizeof(pHTInfo->PeerHTInfoBuf))
712− memcpy(pHTInfo->PeerHTInfoBuf,
708+ sizeof(ht_info->PeerHTInfoBuf))
709+ memcpy(ht_info->PeerHTInfoBuf,
713710 pNetwork->bssht.bd_ht_info_buf,
714711 pNetwork->bssht.bd_ht_info_len);
715712
716− if (pHTInfo->reg_rt2rt_aggregation) {
717− pHTInfo->current_rt2rt_aggregation =
713+ if (ht_info->reg_rt2rt_aggregation) {
714+ ht_info->current_rt2rt_aggregation =
718715 pNetwork->bssht.bd_rt2rt_aggregation;
719− pHTInfo->current_rt2rt_long_slot_time =
716+ ht_info->current_rt2rt_long_slot_time =
720717 pNetwork->bssht.bd_rt2rt_long_slot_time;
721− pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode;
718+ ht_info->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode;
722719 } else {
723− pHTInfo->current_rt2rt_aggregation = false;
724− pHTInfo->current_rt2rt_long_slot_time = false;
725− pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0;
720+ ht_info->current_rt2rt_aggregation = false;
721+ ht_info->current_rt2rt_long_slot_time = false;
722+ ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0;
726723 }
727724
728725 HTIOTPeerDetermine(ieee);
729726
730− pHTInfo->iot_action = 0;
727+ ht_info->iot_action = 0;
731728 bIOTAction = HTIOTActIsDisableMCS14(ieee, pNetwork->bssid);
732729 if (bIOTAction)
733− pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS14;
730+ ht_info->iot_action |= HT_IOT_ACT_DISABLE_MCS14;
734731
735732 bIOTAction = HTIOTActIsDisableMCS15(ieee);
736733 if (bIOTAction)
737− pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS15;
734+ ht_info->iot_action |= HT_IOT_ACT_DISABLE_MCS15;
738735
739736 bIOTAction = HTIOTActIsDisableMCSTwoSpatialStream(ieee);
740737 if (bIOTAction)
741− pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_ALL_2SS;
738+ ht_info->iot_action |= HT_IOT_ACT_DISABLE_ALL_2SS;
742739
743740 bIOTAction = HTIOTActIsDisableEDCATurbo(ieee, pNetwork->bssid);
744741 if (bIOTAction)
745− pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_EDCA_TURBO;
742+ ht_info->iot_action |= HT_IOT_ACT_DISABLE_EDCA_TURBO;
746743
747744 bIOTAction = HTIOTActIsMgntUseCCK6M(ieee, pNetwork);
748745 if (bIOTAction)
749− pHTInfo->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M;
746+ ht_info->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M;
750747 bIOTAction = HTIOTActIsCCDFsync(ieee);
751748 if (bIOTAction)
752− pHTInfo->iot_action |= HT_IOT_ACT_CDD_FSYNC;
749+ ht_info->iot_action |= HT_IOT_ACT_CDD_FSYNC;
753750 } else {
754− pHTInfo->bCurrentHTSupport = false;
755− pHTInfo->current_rt2rt_aggregation = false;
756− pHTInfo->current_rt2rt_long_slot_time = false;
757− pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0;
751+ ht_info->bCurrentHTSupport = false;
752+ ht_info->current_rt2rt_aggregation = false;
753+ ht_info->current_rt2rt_long_slot_time = false;
754+ ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0;
758755
759− pHTInfo->iot_action = 0;
760− pHTInfo->iot_ra_func = 0;
756+ ht_info->iot_action = 0;
757+ ht_info->iot_ra_func = 0;
761758 }
762759 }
763760
764761 void HT_update_self_and_peer_setting(struct rtllib_device *ieee,
765762 struct rtllib_network *pNetwork)
766763 {
767− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
764+ struct rt_hi_throughput *ht_info = ieee->ht_info;
768765 struct ht_info_ele *pPeerHTInfo =
769766 (struct ht_info_ele *)pNetwork->bssht.bd_ht_info_buf;
770767
771− if (pHTInfo->bCurrentHTSupport) {
768+ if (ht_info->bCurrentHTSupport) {
772769 if (pNetwork->bssht.bd_ht_info_len != 0)
773− pHTInfo->current_op_mode = pPeerHTInfo->OptMode;
770+ ht_info->current_op_mode = pPeerHTInfo->OptMode;
774771 }
775772 }
776773 EXPORT_SYMBOL(HT_update_self_and_peer_setting);
777774
778775 void HTUseDefaultSetting(struct rtllib_device *ieee)
779776 {
780− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
777+ struct rt_hi_throughput *ht_info = ieee->ht_info;
781778
782− if (pHTInfo->bEnableHT) {
783− pHTInfo->bCurrentHTSupport = true;
784− pHTInfo->bCurSuppCCK = pHTInfo->bRegSuppCCK;
779+ if (ht_info->enable_ht) {
780+ ht_info->bCurrentHTSupport = true;
781+ ht_info->bCurSuppCCK = ht_info->bRegSuppCCK;
785782
786− pHTInfo->bCurBW40MHz = pHTInfo->bRegBW40MHz;
787− pHTInfo->bCurShortGI20MHz = pHTInfo->bRegShortGI20MHz;
783+ ht_info->bCurBW40MHz = ht_info->bRegBW40MHz;
784+ ht_info->bCurShortGI20MHz = ht_info->bRegShortGI20MHz;
788785
789− pHTInfo->bCurShortGI40MHz = pHTInfo->bRegShortGI40MHz;
786+ ht_info->bCurShortGI40MHz = ht_info->bRegShortGI40MHz;
790787
791788 if (ieee->iw_mode == IW_MODE_ADHOC)
792789 ieee->current_network.qos_data.active =
793790 ieee->current_network.qos_data.supported;
794− pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support;
795− pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize;
791+ ht_info->bCurrent_AMSDU_Support = ht_info->bAMSDU_Support;
792+ ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize;
796793
797− pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable;
798− pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
794+ ht_info->bCurrentAMPDUEnable = ht_info->bAMPDUEnable;
795+ ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor;
799796
800− pHTInfo->current_mpdu_density = pHTInfo->current_mpdu_density;
797+ ht_info->current_mpdu_density = ht_info->current_mpdu_density;
801798
802− HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet,
803− ieee->dot11HTOperationalRateSet);
799+ HTFilterMCSRate(ieee, ieee->reg_dot11tx_ht_oper_rate_set,
800+ ieee->dot11ht_oper_rate_set);
804801 ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee,
805− ieee->dot11HTOperationalRateSet,
806− MCS_FILTER_ALL);
802+ ieee->dot11ht_oper_rate_set,
803+ MCS_FILTER_ALL);
807804 ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate;
808805
809806 } else {
810− pHTInfo->bCurrentHTSupport = false;
807+ ht_info->bCurrentHTSupport = false;
811808 }
812809 }
813810
814811 u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame)
815812 {
816− if (ieee->pHTInfo->bCurrentHTSupport) {
813+ if (ieee->ht_info->bCurrentHTSupport) {
817814 if ((IsQoSDataFrame(pFrame) && Frame_Order(pFrame)) == 1) {
818815 netdev_dbg(ieee->dev, "HT CONTROL FILED EXIST!!\n");
819816 return true;
@@ -824,13 +821,13 @@ u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame) · 4 unmodified lines
824821
825822 static void HTSetConnectBwModeCallback(struct rtllib_device *ieee)
826823 {
827− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
824+ struct rt_hi_throughput *ht_info = ieee->ht_info;
828825
829− if (pHTInfo->bCurBW40MHz) {
830− if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER)
826+ if (ht_info->bCurBW40MHz) {
827+ if (ht_info->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER)
831828 ieee->set_chan(ieee->dev,
832829 ieee->current_network.channel + 2);
833− else if (pHTInfo->CurSTAExtChnlOffset ==
830+ else if (ht_info->CurSTAExtChnlOffset ==
834831 HT_EXTCHNL_OFFSET_LOWER)
835832 ieee->set_chan(ieee->dev,
836833 ieee->current_network.channel - 2);
@@ -839,29 +836,29 @@ static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) · 2 unmodified lines
839836 ieee->current_network.channel);
840837
841838 ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40,
842− pHTInfo->CurSTAExtChnlOffset);
839+ ht_info->CurSTAExtChnlOffset);
843840 } else {
844841 ieee->set_chan(ieee->dev, ieee->current_network.channel);
845842 ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20,
846843 HT_EXTCHNL_OFFSET_NO_EXT);
847844 }
848845
849− pHTInfo->sw_bw_in_progress = false;
846+ ht_info->sw_bw_in_progress = false;
850847 }
851848
852849 void HTSetConnectBwMode(struct rtllib_device *ieee,
853850 enum ht_channel_width bandwidth,
854851 enum ht_extchnl_offset Offset)
855852 {
856− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
853+ struct rt_hi_throughput *ht_info = ieee->ht_info;
857854
858− if (!pHTInfo->bRegBW40MHz)
855+ if (!ht_info->bRegBW40MHz)
859856 return;
860857
861858 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
862859 bandwidth = HT_CHANNEL_WIDTH_20;
863860
864− if (pHTInfo->sw_bw_in_progress) {
861+ if (ht_info->sw_bw_in_progress) {
865862 pr_info("%s: sw_bw_in_progress!!\n", __func__);
866863 return;
867864 }
@@ -871,21 +868,21 @@ void HTSetConnectBwMode(struct rtllib_device *ieee, · 3 unmodified lines
871868 Offset = HT_EXTCHNL_OFFSET_NO_EXT;
872869 if (Offset == HT_EXTCHNL_OFFSET_UPPER ||
873870 Offset == HT_EXTCHNL_OFFSET_LOWER) {
874− pHTInfo->bCurBW40MHz = true;
875− pHTInfo->CurSTAExtChnlOffset = Offset;
871+ ht_info->bCurBW40MHz = true;
872+ ht_info->CurSTAExtChnlOffset = Offset;
876873 } else {
877− pHTInfo->bCurBW40MHz = false;
878− pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT;
874+ ht_info->bCurBW40MHz = false;
875+ ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT;
879876 }
880877 } else {
881− pHTInfo->bCurBW40MHz = false;
882− pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT;
878+ ht_info->bCurBW40MHz = false;
879+ ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT;
883880 }
884881
885− netdev_dbg(ieee->dev, "%s():pHTInfo->bCurBW40MHz:%x\n", __func__,
886− pHTInfo->bCurBW40MHz);
882+ netdev_dbg(ieee->dev, "%s():ht_info->bCurBW40MHz:%x\n", __func__,
883+ ht_info->bCurBW40MHz);
887884
888− pHTInfo->sw_bw_in_progress = true;
885+ ht_info->sw_bw_in_progress = true;
889886
890887 HTSetConnectBwModeCallback(ieee);
891888 }
drivers/staging/rtl8192e/rtl819x_Qos.h+0−7
@@ -97,13 +97,6 @@ enum direction_value { · 96 unmodified lines
9797 DIR_BI_DIR = 3,
9898 };
9999
100−enum acm_method {
101− eAcmWay0_SwAndHw = 0,
102− eAcmWay1_HW = 1,
103− eAcmWay2_SW = 2,
104−};
105−
106−
107100 struct acm {
108101 u64 UsedTime;
109102 u64 MediumTime;
drivers/staging/rtl8192e/rtl819x_TSProc.c+1−1
@@ -83,7 +83,7 @@ static void RxPktPendingTimeout(struct timer_list *t) · 82 unmodified lines
8383 if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) {
8484 pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq;
8585 mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies +
86− msecs_to_jiffies(ieee->pHTInfo->rx_reorder_pending_time)
86+ msecs_to_jiffies(ieee->ht_info->rx_reorder_pending_time)
8787 );
8888 }
8989 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
drivers/staging/rtl8192e/rtllib.h+22−29
@@ -111,11 +111,11 @@ static inline void *netdev_priv_rsl(struct net_device *dev) · 110 unmodified lines
111111 #define SUPPORT_CKIP_MIC 0x08
112112 #define SUPPORT_CKIP_PK 0x10
113113 #define RT_RF_OFF_LEVL_HALT_NIC BIT3
114−#define RT_IN_PS_LEVEL(pPSC, _PS_FLAG) \
115− ((pPSC->CurPsLevel & _PS_FLAG) ? true : false)
116−#define RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG) \
117− (pPSC->CurPsLevel &= (~(_PS_FLAG)))
118−#define RT_SET_PS_LEVEL(pPSC, _PS_FLAG) (pPSC->CurPsLevel |= _PS_FLAG)
114+#define RT_IN_PS_LEVEL(psc, _PS_FLAG) \
115+ ((psc->CurPsLevel & _PS_FLAG) ? true : false)
116+#define RT_CLEAR_PS_LEVEL(psc, _PS_FLAG) \
117+ (psc->CurPsLevel &= (~(_PS_FLAG)))
118+#define RT_SET_PS_LEVEL(psc, _PS_FLAG) (psc->CurPsLevel |= _PS_FLAG)
119119
120120 /* defined for skb cb field */
121121 /* At most 28 byte */
@@ -126,8 +126,8 @@ struct cb_desc { · 4 unmodified lines
126126 u8 bFirstSeg:1;
127127 u8 bLastSeg:1;
128128 u8 bEncrypt:1;
129− u8 bTxDisableRateFallBack:1;
130− u8 bTxUseDriverAssingedRate:1;
129+ u8 tx_dis_rate_fallback:1;
130+ u8 tx_use_drv_assinged_rate:1;
131131 u8 bHwSec:1;
132132
133133 u8 nStuckCount;
@@ -1250,23 +1250,17 @@ enum rt_rf_power_state { · 1116 unmodified lines
12501250 };
12511251
12521252 struct rt_pwr_save_ctrl {
1253−
1254− bool bInactivePs;
1255− bool bIPSModeBackup;
12561253 bool bSwRfProcessing;
12571254 enum rt_rf_power_state eInactivePowerState;
12581255 enum ips_callback_function ReturnPoint;
12591256
12601257 bool bLeisurePs;
12611258 u8 LpsIdleCount;
1262− u8 RegMaxLPSAwakeIntvl;
1259+ u8 reg_max_lps_awake_intvl;
12631260 u8 LPSAwakeIntvl;
12641261
12651262 u32 CurPsLevel;
12661263 u32 RegRfPsLevel;
1267−
1268− bool bFwCtrlLPS;
1269−
12701264 };
12711265
12721266 #define RT_RF_CHANGE_SOURCE u32
@@ -1390,8 +1384,8 @@ struct rt_pmkid_list { · 117 unmodified lines
13901384 };
13911385
13921386 struct rt_intel_promisc_mode {
1393− bool bPromiscuousOn;
1394− bool bFilterSourceStationFrame;
1387+ bool promiscuous_on;
1388+ bool fltr_src_sta_frame;
13951389 };
13961390
13971391
@@ -1438,17 +1432,17 @@ struct rtllib_device { · 40 unmodified lines
14381432 RT_RF_CHANGE_SOURCE rf_off_reason;
14391433 bool is_set_key;
14401434 bool wx_set_enc;
1441− struct rt_hi_throughput *pHTInfo;
1435+ struct rt_hi_throughput *ht_info;
14421436
14431437 spinlock_t reorder_spinlock;
1444− u8 Regdot11HTOperationalRateSet[16];
1445− u8 Regdot11TxHTOperationalRateSet[16];
1446− u8 dot11HTOperationalRateSet[16];
1447− u8 RegHTSuppRateSet[16];
1438+ u8 reg_dot11ht_oper_rate_set[16];
1439+ u8 reg_dot11tx_ht_oper_rate_set[16];
1440+ u8 dot11ht_oper_rate_set[16];
1441+ u8 reg_ht_supp_rate_set[16];
14481442 u8 HTCurrentOperaRate;
14491443 u8 HTHighestOperaRate;
1450− u8 bTxDisableRateFallBack;
1451− u8 bTxUseDriverAssingedRate;
1444+ u8 tx_dis_rate_fallback;
1445+ u8 tx_use_drv_assinged_rate;
14521446 u8 bTxEnableFwCalcDur;
14531447 atomic_t atm_swbw;
14541448
@@ -1476,8 +1470,8 @@ struct rtllib_device { · 21 unmodified lines
14761470 int scan_age;
14771471
14781472 int iw_mode; /* operating mode (IW_MODE_*) */
1479− bool bNetPromiscuousMode;
1480− struct rt_intel_promisc_mode IntelPromiscuousModeInfo;
1473+ bool net_promiscuous_md;
1474+ struct rt_intel_promisc_mode intel_promiscuous_md_info;
14811475
14821476 spinlock_t lock;
14831477 spinlock_t wpax_suitlist_lock;
@@ -1630,7 +1624,6 @@ struct rtllib_device { · 146 unmodified lines
16301624 int mgmt_queue_tail;
16311625 u8 AsocRetryCount;
16321626 struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE];
1633− struct sk_buff_head skb_aggQ[MAX_QUEUE_SIZE];
16341627
16351628 bool bdynamic_txpower_enable;
16361629
@@ -1649,9 +1642,9 @@ struct rtllib_device { · 12 unmodified lines
16491642 struct bandwidth_autoswitch bandwidth_auto_switch;
16501643 bool FwRWRF;
16511644
1652− struct rt_link_detect LinkDetectInfo;
1645+ struct rt_link_detect link_detect_info;
16531646 bool bIsAggregateFrame;
1654− struct rt_pwr_save_ctrl PowerSaveControl;
1647+ struct rt_pwr_save_ctrl pwr_save_ctrl;
16551648
16561649 /* used if IEEE_SOFTMAC_TX_QUEUE is set */
16571650 struct tx_pending tx_pending;
@@ -2095,7 +2088,7 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet, · 437 unmodified lines
20952088 extern u8 MCS_FILTER_ALL[];
20962089 extern u16 MCS_DATA_RATE[2][2][77];
20972090 u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);
2098−void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo);
2091+void HTResetIOTSetting(struct rt_hi_throughput *ht_info);
20992092 bool IsHTHalfNmodeAPs(struct rtllib_device *ieee);
21002093 u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate);
21012094 int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb);
drivers/staging/rtl8192e/rtllib_crypt_tkip.c+16−36
@@ -62,7 +62,7 @@ static void *rtllib_tkip_init(int key_idx) · 61 unmodified lines
6262 return NULL;
6363
6464 priv = kzalloc(sizeof(*priv), GFP_ATOMIC);
65− if (priv == NULL)
65+ if (!priv)
6666 goto fail;
6767 priv->key_idx = key_idx;
6868
@@ -91,7 +91,6 @@ fail: · 22 unmodified lines
9191 return NULL;
9292 }
9393
94−
9594 static void rtllib_tkip_deinit(void *priv)
9695 {
9796 struct rtllib_tkip_data *_priv = priv;
@@ -103,49 +102,41 @@ static void rtllib_tkip_deinit(void *priv) · 5 unmodified lines
103102 kfree_sensitive(priv);
104103 }
105104
106−
107105 static inline u16 RotR1(u16 val)
108106 {
109107 return (val >> 1) | (val << 15);
110108 }
111109
112−
113110 static inline u8 Lo8(u16 val)
114111 {
115112 return val & 0xff;
116113 }
117114
118−
119115 static inline u8 Hi8(u16 val)
120116 {
121117 return val >> 8;
122118 }
123119
124−
125120 static inline u16 Lo16(u32 val)
126121 {
127122 return val & 0xffff;
128123 }
129124
130−
131125 static inline u16 Hi16(u32 val)
132126 {
133127 return val >> 16;
134128 }
135129
136−
137130 static inline u16 Mk16(u8 hi, u8 lo)
138131 {
139132 return lo | (hi << 8);
140133 }
141134
142−
143135 static inline u16 Mk16_le(u16 *v)
144136 {
145137 return *v;
146138 }
147139
148−
149140 static const u16 Sbox[256] = {
150141 0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154,
151142 0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A,
@@ -181,17 +172,14 @@ static const u16 Sbox[256] = { · 29 unmodified lines
181172 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A,
182173 };
183174
184−
185175 static inline u16 _S_(u16 v)
186176 {
187177 u16 t = Sbox[Hi8(v)];
188178 return Sbox[Lo8(v)] ^ ((t << 8) | (t >> 8));
189179 }
190180
191−
192181 #define PHASE1_LOOP_COUNT 8
193182
194−
195183 static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32)
196184 {
197185 int i, j;
@@ -213,7 +201,6 @@ static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32) · 15 unmodified lines
213201 }
214202 }
215203
216−
217204 static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
218205 u16 IV16)
219206 {
@@ -263,7 +250,6 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK, · 43 unmodified lines
263250 #endif
264251 }
265252
266−
267253 static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
268254 {
269255 struct rtllib_tkip_data *tkey = priv;
@@ -285,14 +271,14 @@ static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) · 15 unmodified lines
285271 if (!tcb_desc->bHwSec) {
286272 if (!tkey->tx_phase1_done) {
287273 tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2,
288− tkey->tx_iv32);
274+ tkey->tx_iv32);
289275 tkey->tx_phase1_done = 1;
290276 }
291277 tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak,
292278 tkey->tx_iv16);
293− } else
279+ } else {
294280 tkey->tx_phase1_done = 1;
295−
281+ }
296282
297283 len = skb->len - hdr_len;
298284 pos = skb_push(skb, 8);
@@ -336,8 +322,6 @@ static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) · 37 unmodified lines
336322 if (!tcb_desc->bHwSec)
337323 return ret;
338324 return 0;
339−
340−
341325 }
342326
343327 static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
@@ -389,8 +373,8 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 45 unmodified lines
389373
390374 if (!tcb_desc->bHwSec || (skb->cb[0] == 1)) {
391375 if ((iv32 < tkey->rx_iv32 ||
392− (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) &&
393− tkey->initialized) {
376+ (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) &&
377+ tkey->initialized) {
394378 if (net_ratelimit()) {
395379 netdev_dbg(skb->dev,
396380 "Replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n",
@@ -436,7 +420,6 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 39 unmodified lines
436420 tkey->dot11RSNAStatsTKIPICVErrors++;
437421 return -5;
438422 }
439−
440423 }
441424
442425 /* Update real counters only after Michael MIC verification has
@@ -453,7 +436,6 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 10 unmodified lines
453436 return keyidx;
454437 }
455438
456−
457439 static int michael_mic(struct crypto_shash *tfm_michael, u8 *key, u8 *hdr,
458440 u8 *data, size_t data_len, u8 *mic)
459441 {
@@ -506,12 +488,15 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) · 46 unmodified lines
506488 break;
507489 }
508490
509− hdr[12] = 0; /* priority */
491+ /* priority */
492+ hdr[12] = 0;
510493
511− hdr[13] = hdr[14] = hdr[15] = 0; /* reserved */
494+ /* reserved */
495+ hdr[13] = 0;
496+ hdr[14] = 0;
497+ hdr[15] = 0;
512498 }
513499
514−
515500 static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv)
516501 {
517502 struct rtllib_tkip_data *tkey = priv;
@@ -533,13 +518,12 @@ static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) · 15 unmodified lines
533518 tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
534519 pos = skb_put(skb, 8);
535520 if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr,
536− skb->data + hdr_len, skb->len - 8 - hdr_len, pos))
521+ skb->data + hdr_len, skb->len - 8 - hdr_len, pos))
537522 return -1;
538523
539524 return 0;
540525 }
541526
542−
543527 static void rtllib_michael_mic_failure(struct net_device *dev,
544528 struct rtllib_hdr_4addr *hdr,
545529 int keyidx)
@@ -609,7 +593,6 @@ static int rtllib_michael_mic_verify(struct sk_buff *skb, int keyidx, · 63 unmodified lines
609593 return 0;
610594 }
611595
612−
613596 static int rtllib_tkip_set_key(void *key, int len, u8 *seq, void *priv)
614597 {
615598 struct rtllib_tkip_data *tkey = priv;
@@ -632,15 +615,15 @@ static int rtllib_tkip_set_key(void *key, int len, u8 *seq, void *priv) · 16 unmodified lines
632615 (seq[3] << 8) | seq[2];
633616 tkey->rx_iv16 = (seq[1] << 8) | seq[0];
634617 }
635− } else if (len == 0)
618+ } else if (len == 0) {
636619 tkey->key_set = 0;
637− else
620+ } else {
638621 return -1;
622+ }
639623
640624 return 0;
641625 }
642626
643−
644627 static int rtllib_tkip_get_key(void *key, int len, u8 *seq, void *priv)
645628 {
646629 struct rtllib_tkip_data *tkey = priv;
@@ -671,7 +654,6 @@ static int rtllib_tkip_get_key(void *key, int len, u8 *seq, void *priv) · 24 unmodified lines
671654 return TKIP_KEY_LEN;
672655 }
673656
674−
675657 static void rtllib_tkip_print_stats(struct seq_file *m, void *priv)
676658 {
677659 struct rtllib_tkip_data *tkip = priv;
@@ -713,13 +695,11 @@ static struct lib80211_crypto_ops rtllib_crypt_tkip = { · 35 unmodified lines
713695 .owner = THIS_MODULE,
714696 };
715697
716−
717698 static int __init rtllib_crypto_tkip_init(void)
718699 {
719700 return lib80211_register_crypto_ops(&rtllib_crypt_tkip);
720701 }
721702
722−
723703 static void __exit rtllib_crypto_tkip_exit(void)
724704 {
725705 lib80211_unregister_crypto_ops(&rtllib_crypt_tkip);
drivers/staging/rtl8192e/rtllib_crypt_wep.c+0−8
@@ -27,7 +27,6 @@ struct prism2_wep_data { · 26 unmodified lines
2727 struct arc4_ctx tx_ctx_arc4;
2828 };
2929
30−
3130 static void *prism2_wep_init(int keyidx)
3231 {
3332 struct prism2_wep_data *priv;
@@ -46,7 +45,6 @@ static void *prism2_wep_init(int keyidx) · 12 unmodified lines
4645 return priv;
4746 }
4847
49−
5048 static void prism2_wep_deinit(void *priv)
5149 {
5250 kfree_sensitive(priv);
@@ -120,7 +118,6 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) · 67 unmodified lines
120118 return 0;
121119 }
122120
123−
124121 /* Perform WEP decryption on given struct buffer. Buffer includes whole WEP
125122 * part of the frame: IV (4 bytes), encrypted payload (including SNAP header),
126123 * ICV (4 bytes). len includes both IV and ICV.
@@ -180,7 +177,6 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv) · 53 unmodified lines
180177 return 0;
181178 }
182179
183−
184180 static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv)
185181 {
186182 struct prism2_wep_data *wep = priv;
@@ -194,7 +190,6 @@ static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv) · 7 unmodified lines
194190 return 0;
195191 }
196192
197−
198193 static int prism2_wep_get_key(void *key, int len, u8 *seq, void *priv)
199194 {
200195 struct prism2_wep_data *wep = priv;
@@ -207,7 +202,6 @@ static int prism2_wep_get_key(void *key, int len, u8 *seq, void *priv) · 6 unmodified lines
207202 return wep->key_len;
208203 }
209204
210−
211205 static void prism2_wep_print_stats(struct seq_file *m, void *priv)
212206 {
213207 struct prism2_wep_data *wep = priv;
@@ -231,13 +225,11 @@ static struct lib80211_crypto_ops rtllib_crypt_wep = { · 17 unmodified lines
231225 .owner = THIS_MODULE,
232226 };
233227
234−
235228 static int __init rtllib_crypto_wep_init(void)
236229 {
237230 return lib80211_register_crypto_ops(&rtllib_crypt_wep);
238231 }
239232
240−
241233 static void __exit rtllib_crypto_wep_exit(void)
242234 {
243235 lib80211_unregister_crypto_ops(&rtllib_crypt_wep);
drivers/staging/rtl8192e/rtllib_module.c+4−4
@@ -107,7 +107,7 @@ struct net_device *alloc_rtllib(int sizeof_priv) · 106 unmodified lines
107107 spin_lock_init(&ieee->lock);
108108 spin_lock_init(&ieee->wpax_suitlist_lock);
109109 spin_lock_init(&ieee->reorder_spinlock);
110− atomic_set(&(ieee->atm_swbw), 0);
110+ atomic_set(&ieee->atm_swbw, 0);
111111
112112 /* SAM FIXME */
113113 lib80211_crypt_info_init(&ieee->crypt_info, "RTLLIB", &ieee->lock);
@@ -125,8 +125,8 @@ struct net_device *alloc_rtllib(int sizeof_priv) · 11 unmodified lines
125125 if (err)
126126 goto free_crypt_info;
127127
128− ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
129− if (!ieee->pHTInfo)
128+ ieee->ht_info = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
129+ if (!ieee->ht_info)
130130 goto free_softmac;
131131
132132 HTUpdateDefaultSetting(ieee);
@@ -160,7 +160,7 @@ void free_rtllib(struct net_device *dev) · 27 unmodified lines
160160 struct rtllib_device *ieee = (struct rtllib_device *)
161161 netdev_priv_rsl(dev);
162162
163− kfree(ieee->pHTInfo);
163+ kfree(ieee->ht_info);
164164 rtllib_softmac_free(ieee);
165165
166166 lib80211_crypt_info_free(&ieee->crypt_info);
drivers/staging/rtl8192e/rtllib_rx.c+19−19
@@ -567,9 +567,9 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, · 566 unmodified lines
567567 struct rtllib_rxb *prxb,
568568 struct rx_ts_record *pTS, u16 SeqNum)
569569 {
570− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
570+ struct rt_hi_throughput *ht_info = ieee->ht_info;
571571 struct rx_reorder_entry *pReorderEntry = NULL;
572− u8 WinSize = pHTInfo->rx_reorder_win_size;
572+ u8 WinSize = ht_info->rx_reorder_win_size;
573573 u16 WinEnd = 0;
574574 u8 index = 0;
575575 bool bMatchWinStart = false, bPktInBuf = false;
@@ -591,7 +591,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, · 15 unmodified lines
591591 netdev_dbg(ieee->dev,
592592 "Packet Drop! IndicateSeq: %d, NewSeq: %d\n",
593593 pTS->rx_indicate_seq, SeqNum);
594− pHTInfo->rx_reorder_drop_counter++;
594+ ht_info->rx_reorder_drop_counter++;
595595 {
596596 int i;
597597
@@ -755,7 +755,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee, · 157 unmodified lines
755755 netdev_dbg(ieee->dev, "%s(): SET rx timeout timer\n", __func__);
756756 pTS->rx_timeout_indicate_seq = pTS->rx_indicate_seq;
757757 mod_timer(&pTS->rx_pkt_pending_timer, jiffies +
758− msecs_to_jiffies(pHTInfo->rx_reorder_pending_time));
758+ msecs_to_jiffies(ht_info->rx_reorder_pending_time));
759759 }
760760 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
761761 }
@@ -924,7 +924,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee, · 162 unmodified lines
924924 sc = le16_to_cpu(hdr->seq_ctl);
925925 frag = WLAN_GET_SEQ_FRAG(sc);
926926
927− if (!ieee->pHTInfo->cur_rx_reorder_enable ||
927+ if (!ieee->ht_info->cur_rx_reorder_enable ||
928928 !ieee->current_network.qos_data.active ||
929929 !IsDataFrame(skb->data) ||
930930 IsLegacyDataFrame(skb->data)) {
@@ -999,8 +999,8 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc, · 68 unmodified lines
999999 }
10001000
10011001 /* Filter packets sent by an STA that will be forwarded by AP */
1002− if (ieee->IntelPromiscuousModeInfo.bPromiscuousOn &&
1003− ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame) {
1002+ if (ieee->intel_promiscuous_md_info.promiscuous_on &&
1003+ ieee->intel_promiscuous_md_info.fltr_src_sta_frame) {
10041004 if ((fc & RTLLIB_FCTL_TODS) && !(fc & RTLLIB_FCTL_FROMDS) &&
10051005 !ether_addr_equal(dst, ieee->current_network.bssid) &&
10061006 ether_addr_equal(bssid, ieee->current_network.bssid)) {
@@ -1011,7 +1011,7 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc, · 4 unmodified lines
10111011 /* Nullfunc frames may have PS-bit set, so they must be passed to
10121012 * hostap_handle_sta_rx() before being dropped here.
10131013 */
1014− if (!ieee->IntelPromiscuousModeInfo.bPromiscuousOn) {
1014+ if (!ieee->intel_promiscuous_md_info.promiscuous_on) {
10151015 if (stype != RTLLIB_STYPE_DATA &&
10161016 stype != RTLLIB_STYPE_DATA_CFACK &&
10171017 stype != RTLLIB_STYPE_DATA_CFPOLL &&
@@ -1211,9 +1211,9 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast, · 193 unmodified lines
12111211 if (unicast) {
12121212
12131213 if (ieee->state == RTLLIB_LINKED) {
1214− if (((ieee->LinkDetectInfo.NumRxUnicastOkInPeriod +
1215− ieee->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
1216− (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) {
1214+ if (((ieee->link_detect_info.NumRxUnicastOkInPeriod +
1215+ ieee->link_detect_info.NumTxOkInPeriod) > 8) ||
1216+ (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) {
12171217 if (ieee->LeisurePSLeave)
12181218 ieee->LeisurePSLeave(ieee->dev);
12191219 }
@@ -1317,7 +1317,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, · 97 unmodified lines
13171317 multicast = is_multicast_ether_addr(hdr->addr1);
13181318 unicast = !multicast;
13191319 if (unicast && !ether_addr_equal(dev->dev_addr, hdr->addr1)) {
1320− if (ieee->bNetPromiscuousMode)
1320+ if (ieee->net_promiscuous_md)
13211321 bToOtherSTA = true;
13221322 else
13231323 goto rx_dropped;
@@ -1355,8 +1355,8 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, · 31 unmodified lines
13551355
13561356 /* Update statstics for AP roaming */
13571357 if (!bToOtherSTA) {
1358− ieee->LinkDetectInfo.NumRecvDataInPeriod++;
1359− ieee->LinkDetectInfo.NumRxOkInPeriod++;
1358+ ieee->link_detect_info.NumRecvDataInPeriod++;
1359+ ieee->link_detect_info.NumRxOkInPeriod++;
13601360 }
13611361
13621362 /* Data frame - extract src/dst addresses */
@@ -1437,12 +1437,12 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, · 74 unmodified lines
14371437 else
14381438 nr_subframes = 1;
14391439 if (unicast)
1440− ieee->LinkDetectInfo.NumRxUnicastOkInPeriod += nr_subframes;
1440+ ieee->link_detect_info.NumRxUnicastOkInPeriod += nr_subframes;
14411441 rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes);
14421442 }
14431443
14441444 /* Indicate packets to upper layer or Rx Reorder */
1445− if (!ieee->pHTInfo->cur_rx_reorder_enable || pTS == NULL || bToOtherSTA)
1445+ if (!ieee->ht_info->cur_rx_reorder_enable || pTS == NULL || bToOtherSTA)
14461446 rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src);
14471447 else
14481448 RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum);
@@ -1489,9 +1489,9 @@ static int rtllib_rx_Monitor(struct rtllib_device *ieee, struct sk_buff *skb, · 40 unmodified lines
14891489 hdrlen += 4;
14901490 }
14911491
1492− rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen);
14931492 ieee->stats.rx_packets++;
14941493 ieee->stats.rx_bytes += skb->len;
1494+ rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen);
14951495
14961496 return 1;
14971497 }
@@ -1776,7 +1776,7 @@ static inline void rtllib_extract_country_ie( · 278 unmodified lines
17761776 if (rtllib_act_scanning(ieee, false) &&
17771777 ieee->FirstIe_InScan)
17781778 netdev_info(ieee->dev,
1779− "Received beacon ContryIE, SSID: <%s>\n",
1779+ "Received beacon CountryIE, SSID: <%s>\n",
17801780 network->ssid);
17811781 dot11d_update_country(ieee, addr2,
17821782 info_element->len,
@@ -2620,7 +2620,7 @@ static inline void rtllib_process_probe_response( · 837 unmodified lines
26202620 }
26212621 if (is_beacon(frame_ctl)) {
26222622 if (ieee->state >= RTLLIB_LINKED)
2623− ieee->LinkDetectInfo.NumRecvBcnInPeriod++;
2623+ ieee->link_detect_info.NumRecvBcnInPeriod++;
26242624 }
26252625 }
26262626 list_for_each_entry(target, &ieee->network_list, list) {
drivers/staging/rtl8192e/rtllib_softmac.c+86−87
@@ -148,8 +148,7 @@ static void init_mgmt_queue(struct rtllib_device *ieee) · 147 unmodified lines
148148 }
149149
150150
151−u8
152−MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee)
151+u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee)
153152 {
154153 u16 i;
155154 u8 QueryRate = 0;
@@ -177,10 +176,10 @@ MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) · 21 unmodified lines
177176
178177 static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee)
179178 {
180− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
179+ struct rt_hi_throughput *ht_info = ieee->ht_info;
181180 u8 rate;
182181
183− if (pHTInfo->iot_action & HT_IOT_ACT_MGNT_USE_CCK_6M)
182+ if (ht_info->iot_action & HT_IOT_ACT_MGNT_USE_CCK_6M)
184183 rate = 0x0c;
185184 else
186185 rate = ieee->basic_rate & 0x7f;
@@ -188,7 +187,7 @@ static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) · 1 unmodified line
188187 if (rate == 0) {
189188 if (ieee->mode == IEEE_A ||
190189 ieee->mode == IEEE_N_5G ||
191− (ieee->mode == IEEE_N_24G && !pHTInfo->bCurSuppCCK))
190+ (ieee->mode == IEEE_N_24G && !ht_info->bCurSuppCCK))
192191 rate = 0x0c;
193192 else
194193 rate = 0x02;
@@ -221,8 +220,8 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) · 26 unmodified lines
221220
222221 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee);
223222 tcb_desc->RATRIndex = 7;
224− tcb_desc->bTxDisableRateFallBack = 1;
225− tcb_desc->bTxUseDriverAssingedRate = 1;
223+ tcb_desc->tx_dis_rate_fallback = 1;
224+ tcb_desc->tx_use_drv_assinged_rate = 1;
226225 if (single) {
227226 if (ieee->queue_stop) {
228227 enqueue_mgmt(ieee, skb);
@@ -299,8 +298,8 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, · 70 unmodified lines
299298
300299 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee);
301300 tcb_desc->RATRIndex = 7;
302− tcb_desc->bTxDisableRateFallBack = 1;
303− tcb_desc->bTxUseDriverAssingedRate = 1;
301+ tcb_desc->tx_dis_rate_fallback = 1;
302+ tcb_desc->tx_use_drv_assinged_rate = 1;
304303 if (single) {
305304 if (type != RTLLIB_FTYPE_CTL) {
306305 header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@@ -446,7 +445,7 @@ void rtllib_EnableIntelPromiscuousMode(struct net_device *dev, · 139 unmodified lines
446445 ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID,
447446 (u8 *)&bFilterOutNonAssociatedBSSID);
448447
449− ieee->bNetPromiscuousMode = true;
448+ ieee->net_promiscuous_md = true;
450449 }
451450 EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode);
452451
@@ -467,7 +466,7 @@ void rtllib_DisableIntelPromiscuousMode(struct net_device *dev, · 14 unmodified lines
467466 ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID,
468467 (u8 *)&bFilterOutNonAssociatedBSSID);
469468
470− ieee->bNetPromiscuousMode = false;
469+ ieee->net_promiscuous_md = false;
471470 }
472471 EXPORT_SYMBOL(rtllib_DisableIntelPromiscuousMode);
473472
@@ -830,7 +829,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, · 356 unmodified lines
830829 u8 tmp_ht_cap_len = 0;
831830 u8 *tmp_ht_info_buf = NULL;
832831 u8 tmp_ht_info_len = 0;
833− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
832+ struct rt_hi_throughput *ht_info = ieee->ht_info;
834833 u8 *tmp_generic_ie_buf = NULL;
835834 u8 tmp_generic_ie_len = 0;
836835
@@ -844,7 +843,7 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, · 7 unmodified lines
844843
845844 if ((ieee->current_network.mode == IEEE_G) ||
846845 (ieee->current_network.mode == IEEE_N_24G &&
847− ieee->pHTInfo->bCurSuppCCK)) {
846+ ieee->ht_info->bCurSuppCCK)) {
848847 erp_len = 3;
849848 erpinfo_content = 0;
850849 if (ieee->current_network.buseprotection)
@@ -855,20 +854,20 @@ static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, · 4 unmodified lines
855854 crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx];
856855 encrypt = ieee->host_encrypt && crypt && crypt->ops &&
857856 ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len));
858− if (ieee->pHTInfo->bCurrentHTSupport) {
859− tmp_ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap);
860− tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
861− tmp_ht_info_buf = (u8 *)&(ieee->pHTInfo->SelfHTInfo);
862− tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo);
857+ if (ieee->ht_info->bCurrentHTSupport) {
858+ tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap);
859+ tmp_ht_cap_len = sizeof(ieee->ht_info->SelfHTCap);
860+ tmp_ht_info_buf = (u8 *)&(ieee->ht_info->SelfHTInfo);
861+ tmp_ht_info_len = sizeof(ieee->ht_info->SelfHTInfo);
863862 HTConstructCapabilityElement(ieee, tmp_ht_cap_buf,
864863 &tmp_ht_cap_len, encrypt, false);
865864 HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len,
866865 encrypt);
867866
868− if (pHTInfo->reg_rt2rt_aggregation) {
869− tmp_generic_ie_buf = ieee->pHTInfo->sz_rt2rt_agg_buf;
867+ if (ht_info->reg_rt2rt_aggregation) {
868+ tmp_generic_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf;
870869 tmp_generic_ie_len =
871− sizeof(ieee->pHTInfo->sz_rt2rt_agg_buf);
870+ sizeof(ieee->ht_info->sz_rt2rt_agg_buf);
872871 HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf,
873872 &tmp_generic_ie_len);
874873 }
@@ -1180,19 +1179,19 @@ rtllib_association_req(struct rtllib_network *beacon, · 305 unmodified lines
11801179 if ((ieee->rtllib_ap_sec_type &&
11811180 (ieee->rtllib_ap_sec_type(ieee) & SEC_ALG_TKIP)) ||
11821181 ieee->bForcedBgMode) {
1183− ieee->pHTInfo->bEnableHT = 0;
1182+ ieee->ht_info->enable_ht = 0;
11841183 ieee->mode = WIRELESS_MODE_G;
11851184 }
11861185
1187− if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
1188− ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap);
1189− ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
1186+ if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) {
1187+ ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap);
1188+ ht_cap_len = sizeof(ieee->ht_info->SelfHTCap);
11901189 HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len,
11911190 encrypt, true);
1192− if (ieee->pHTInfo->current_rt2rt_aggregation) {
1193− realtek_ie_buf = ieee->pHTInfo->sz_rt2rt_agg_buf;
1191+ if (ieee->ht_info->current_rt2rt_aggregation) {
1192+ realtek_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf;
11941193 realtek_ie_len =
1195− sizeof(ieee->pHTInfo->sz_rt2rt_agg_buf);
1194+ sizeof(ieee->ht_info->sz_rt2rt_agg_buf);
11961195 HTConstructRT2RTAggElement(ieee, realtek_ie_buf,
11971196 &realtek_ie_len);
11981197 }
@@ -1325,8 +1324,8 @@ rtllib_association_req(struct rtllib_network *beacon, · 126 unmodified lines
13251324 memcpy(tag, osCcxVerNum.Octet, osCcxVerNum.Length);
13261325 tag += osCcxVerNum.Length;
13271326 }
1328− if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
1329− if (ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC) {
1327+ if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) {
1328+ if (ieee->ht_info->ePeerHTSpecVer != HT_SPEC_VER_EWC) {
13301329 tag = skb_put(skb, ht_cap_len);
13311330 *tag++ = MFIE_TYPE_HT_CAP;
13321331 *tag++ = ht_cap_len - 2;
@@ -1359,8 +1358,8 @@ rtllib_association_req(struct rtllib_network *beacon, · 26 unmodified lines
13591358 rtllib_TURBO_Info(ieee, &tag);
13601359 }
13611360
1362− if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
1363− if (ieee->pHTInfo->ePeerHTSpecVer == HT_SPEC_VER_EWC) {
1361+ if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) {
1362+ if (ieee->ht_info->ePeerHTSpecVer == HT_SPEC_VER_EWC) {
13641363 tag = skb_put(skb, ht_cap_len);
13651364 *tag++ = MFIE_TYPE_GENERIC;
13661365 *tag++ = ht_cap_len - 2;
@@ -1368,7 +1367,7 @@ rtllib_association_req(struct rtllib_network *beacon, · 1 unmodified line
13681367 tag += ht_cap_len - 2;
13691368 }
13701369
1371− if (ieee->pHTInfo->current_rt2rt_aggregation) {
1370+ if (ieee->ht_info->current_rt2rt_aggregation) {
13721371 tag = skb_put(skb, realtek_ie_len);
13731372 *tag++ = MFIE_TYPE_GENERIC;
13741373 *tag++ = realtek_ie_len - 2;
@@ -1505,7 +1504,7 @@ static void rtllib_associate_complete_wq(void *data) · 130 unmodified lines
15051504 container_of_work_rsl(data,
15061505 struct rtllib_device,
15071506 associate_complete_wq);
1508− struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl);
1507+ struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl;
15091508
15101509 netdev_info(ieee->dev, "Associated successfully with %pM\n",
15111510 ieee->current_network.bssid);
@@ -1525,25 +1524,25 @@ static void rtllib_associate_complete_wq(void *data) · 13 unmodified lines
15251524 ieee->SetWirelessMode(ieee->dev, IEEE_B);
15261525 netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate);
15271526 }
1528− if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
1527+ if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) {
15291528 netdev_info(ieee->dev, "Successfully associated, ht enabled\n");
15301529 HTOnAssocRsp(ieee);
15311530 } else {
15321531 netdev_info(ieee->dev,
15331532 "Successfully associated, ht not enabled(%d, %d)\n",
1534− ieee->pHTInfo->bCurrentHTSupport,
1535− ieee->pHTInfo->bEnableHT);
1536− memset(ieee->dot11HTOperationalRateSet, 0, 16);
1533+ ieee->ht_info->bCurrentHTSupport,
1534+ ieee->ht_info->enable_ht);
1535+ memset(ieee->dot11ht_oper_rate_set, 0, 16);
15371536 }
1538− ieee->LinkDetectInfo.SlotNum = 2 * (1 +
1537+ ieee->link_detect_info.SlotNum = 2 * (1 +
15391538 ieee->current_network.beacon_interval /
15401539 500);
1541− if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 ||
1542− ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) {
1543− ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
1544− ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
1540+ if (ieee->link_detect_info.NumRecvBcnInPeriod == 0 ||
1541+ ieee->link_detect_info.NumRecvDataInPeriod == 0) {
1542+ ieee->link_detect_info.NumRecvBcnInPeriod = 1;
1543+ ieee->link_detect_info.NumRecvDataInPeriod = 1;
15451544 }
1546− pPSC->LpsIdleCount = 0;
1545+ psc->LpsIdleCount = 0;
15471546 ieee->link_change(ieee->dev);
15481547
15491548 if (ieee->is_silent_reset) {
@@ -1685,7 +1684,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 135 unmodified lines
16851684 ieee->current_network.ssid,
16861685 ieee->current_network.channel,
16871686 ieee->current_network.qos_data.supported,
1688− ieee->pHTInfo->bEnableHT,
1687+ ieee->ht_info->enable_ht,
16891688 ieee->current_network.bssht.bd_support_ht,
16901689 ieee->current_network.mode,
16911690 ieee->current_network.flags);
@@ -1694,7 +1693,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 2 unmodified lines
16941693 !(ieee->softmac_features & IEEE_SOFTMAC_SCAN))
16951694 rtllib_stop_scan_syncro(ieee);
16961695
1697− HTResetIOTSetting(ieee->pHTInfo);
1696+ HTResetIOTSetting(ieee->ht_info);
16981697 ieee->wmm_acm = 0;
16991698 if (ieee->iw_mode == IW_MODE_INFRA) {
17001699 /* Join the network for the first time */
@@ -1704,7 +1703,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 3 unmodified lines
17041703 HTResetSelfAndSavePeerSetting(ieee,
17051704 &(ieee->current_network));
17061705 else
1707− ieee->pHTInfo->bCurrentHTSupport =
1706+ ieee->ht_info->bCurrentHTSupport =
17081707 false;
17091708
17101709 ieee->state = RTLLIB_ASSOCIATING;
@@ -1729,7 +1728,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, · 18 unmodified lines
17291728 netdev_info(ieee->dev,
17301729 "Using B rates\n");
17311730 }
1732− memset(ieee->dot11HTOperationalRateSet, 0, 16);
1731+ memset(ieee->dot11ht_oper_rate_set, 0, 16);
17331732 ieee->state = RTLLIB_LINKED;
17341733 }
17351734 }
@@ -1894,7 +1893,7 @@ static inline u16 assoc_parse(struct rtllib_device *ieee, struct sk_buff *skb, · 158 unmodified lines
18941893 ((ieee->mode == IEEE_G) &&
18951894 (ieee->current_network.mode == IEEE_N_24G) &&
18961895 (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) {
1897− ieee->pHTInfo->iot_action |= HT_IOT_ACT_PURE_N_MODE;
1896+ ieee->ht_info->iot_action |= HT_IOT_ACT_PURE_N_MODE;
18981897 } else {
18991898 ieee->AsocRetryCount = 0;
19001899 }
@@ -1961,7 +1960,7 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) · 60 unmodified lines
19611960 {
19621961 int timeout;
19631962 u8 dtim;
1964− struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl);
1963+ struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl;
19651964
19661965 if (ieee->LPSDelayCnt) {
19671966 ieee->LPSDelayCnt--;
@@ -1991,21 +1990,21 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) · 23 unmodified lines
19911990
19921991 if (time) {
19931992 if (ieee->bAwakePktSent) {
1994− pPSC->LPSAwakeIntvl = 1;
1993+ psc->LPSAwakeIntvl = 1;
19951994 } else {
19961995 u8 MaxPeriod = 1;
19971996
1998− if (pPSC->LPSAwakeIntvl == 0)
1999− pPSC->LPSAwakeIntvl = 1;
2000− if (pPSC->RegMaxLPSAwakeIntvl == 0)
1997+ if (psc->LPSAwakeIntvl == 0)
1998+ psc->LPSAwakeIntvl = 1;
1999+ if (psc->reg_max_lps_awake_intvl == 0)
20012000 MaxPeriod = 1;
2002− else if (pPSC->RegMaxLPSAwakeIntvl == 0xFF)
2001+ else if (psc->reg_max_lps_awake_intvl == 0xFF)
20032002 MaxPeriod = ieee->current_network.dtim_period;
20042003 else
2005− MaxPeriod = pPSC->RegMaxLPSAwakeIntvl;
2006− pPSC->LPSAwakeIntvl = (pPSC->LPSAwakeIntvl >=
2004+ MaxPeriod = psc->reg_max_lps_awake_intvl;
2005+ psc->LPSAwakeIntvl = (psc->LPSAwakeIntvl >=
20072006 MaxPeriod) ? MaxPeriod :
2008− (pPSC->LPSAwakeIntvl + 1);
2007+ (psc->LPSAwakeIntvl + 1);
20092008 }
20102009 {
20112010 u8 LPSAwakeIntvl_tmp = 0;
@@ -2013,23 +2012,23 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) · 1 unmodified line
20132012 u8 count = ieee->current_network.tim.tim_count;
20142013
20152014 if (count == 0) {
2016− if (pPSC->LPSAwakeIntvl > period)
2015+ if (psc->LPSAwakeIntvl > period)
20172016 LPSAwakeIntvl_tmp = period +
2018− (pPSC->LPSAwakeIntvl -
2017+ (psc->LPSAwakeIntvl -
20192018 period) -
2020− ((pPSC->LPSAwakeIntvl-period) %
2019+ ((psc->LPSAwakeIntvl-period) %
20212020 period);
20222021 else
2023− LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl;
2022+ LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl;
20242023
20252024 } else {
2026− if (pPSC->LPSAwakeIntvl >
2025+ if (psc->LPSAwakeIntvl >
20272026 ieee->current_network.tim.tim_count)
20282027 LPSAwakeIntvl_tmp = count +
2029− (pPSC->LPSAwakeIntvl - count) -
2030− ((pPSC->LPSAwakeIntvl-count)%period);
2028+ (psc->LPSAwakeIntvl - count) -
2029+ ((psc->LPSAwakeIntvl-count)%period);
20312030 else
2032− LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl;
2031+ LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl;
20332032 }
20342033
20352034 *time = ieee->current_network.last_dtim_sta_time
@@ -2101,7 +2100,7 @@ static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl) · 65 unmodified lines
21012100 {
21022101 if (ieee->sta_sleep == LPS_IS_WAKE) {
21032102 if (nl) {
2104− if (ieee->pHTInfo->iot_action &
2103+ if (ieee->ht_info->iot_action &
21052104 HT_IOT_ACT_NULL_DATA_POWER_SAVING) {
21062105 ieee->ack_tx_to_ieee = 1;
21072106 rtllib_sta_ps_send_null_frame(ieee, 0);
@@ -2117,7 +2116,7 @@ static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl) · 9 unmodified lines
21172116 if (ieee->sta_sleep == LPS_IS_SLEEP)
21182117 ieee->sta_wake_up(ieee->dev);
21192118 if (nl) {
2120− if (ieee->pHTInfo->iot_action &
2119+ if (ieee->ht_info->iot_action &
21212120 HT_IOT_ACT_NULL_DATA_POWER_SAVING) {
21222121 ieee->ack_tx_to_ieee = 1;
21232122 rtllib_sta_ps_send_null_frame(ieee, 0);
@@ -2152,7 +2151,7 @@ void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success) · 28 unmodified lines
21522151
21532152 if ((ieee->sta_sleep == LPS_IS_WAKE) && !success) {
21542153 spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
2155− if (ieee->pHTInfo->iot_action &
2154+ if (ieee->ht_info->iot_action &
21562155 HT_IOT_ACT_NULL_DATA_POWER_SAVING)
21572156 rtllib_sta_ps_send_null_frame(ieee, 0);
21582157 else
@@ -2236,10 +2235,10 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, · 77 unmodified lines
22362235 kfree(network);
22372236 return 1;
22382237 }
2239− memcpy(ieee->pHTInfo->PeerHTCapBuf,
2238+ memcpy(ieee->ht_info->PeerHTCapBuf,
22402239 network->bssht.bd_ht_cap_buf,
22412240 network->bssht.bd_ht_cap_len);
2242− memcpy(ieee->pHTInfo->PeerHTInfoBuf,
2241+ memcpy(ieee->ht_info->PeerHTInfoBuf,
22432242 network->bssht.bd_ht_info_buf,
22442243 network->bssht.bd_ht_info_len);
22452244 if (ieee->handle_assoc_response != NULL)
@@ -2296,7 +2295,7 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) · 50 unmodified lines
22962295 if (ieee->open_wep || !challenge) {
22972296 ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED;
22982297 ieee->softmac_stats.rx_auth_rs_ok++;
2299− if (!(ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE)) {
2298+ if (!(ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE)) {
23002299 if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) {
23012300 if (IsHTHalfNmodeAPs(ieee)) {
23022301 bSupportNmode = true;
@@ -2370,7 +2369,7 @@ rtllib_rx_deauth(struct rtllib_device *ieee, struct sk_buff *skb) · 67 unmodified lines
23702369 ieee->state = RTLLIB_ASSOCIATING;
23712370 ieee->softmac_stats.reassoc++;
23722371 ieee->is_roaming = true;
2373− ieee->LinkDetectInfo.bBusyTraffic = false;
2372+ ieee->link_detect_info.bBusyTraffic = false;
23742373 rtllib_disassociate(ieee);
23752374 RemovePeerTS(ieee, header->addr2);
23762375 if (ieee->LedControlHandler != NULL)
@@ -2670,7 +2669,7 @@ static void rtllib_start_ibss_wq(void *data) · 293 unmodified lines
26702669 if ((ieee->mode == IEEE_N_24G) || (ieee->mode == IEEE_N_5G))
26712670 HTUseDefaultSetting(ieee);
26722671 else
2673− ieee->pHTInfo->bCurrentHTSupport = false;
2672+ ieee->ht_info->bCurrentHTSupport = false;
26742673
26752674 ieee->SetHwRegHandler(ieee->dev, HW_VAR_MEDIA_STATUS,
26762675 (u8 *)(&ieee->state));
@@ -2964,13 +2963,13 @@ int rtllib_softmac_init(struct rtllib_device *ieee) · 287 unmodified lines
29642963 if (!ieee->dot11d_info)
29652964 return -ENOMEM;
29662965
2967− ieee->LinkDetectInfo.SlotIndex = 0;
2968− ieee->LinkDetectInfo.SlotNum = 2;
2969− ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
2970− ieee->LinkDetectInfo.NumRecvDataInPeriod = 0;
2971− ieee->LinkDetectInfo.NumTxOkInPeriod = 0;
2972− ieee->LinkDetectInfo.NumRxOkInPeriod = 0;
2973− ieee->LinkDetectInfo.NumRxUnicastOkInPeriod = 0;
2966+ ieee->link_detect_info.SlotIndex = 0;
2967+ ieee->link_detect_info.SlotNum = 2;
2968+ ieee->link_detect_info.NumRecvBcnInPeriod = 0;
2969+ ieee->link_detect_info.NumRecvDataInPeriod = 0;
2970+ ieee->link_detect_info.NumTxOkInPeriod = 0;
2971+ ieee->link_detect_info.NumRxOkInPeriod = 0;
2972+ ieee->link_detect_info.NumRxUnicastOkInPeriod = 0;
29742973 ieee->bIsAggregateFrame = false;
29752974 ieee->assoc_id = 0;
29762975 ieee->queue_stop = 0;
@@ -2985,13 +2984,13 @@ int rtllib_softmac_init(struct rtllib_device *ieee) · 8 unmodified lines
29852984 ieee->ps = RTLLIB_PS_DISABLED;
29862985 ieee->sta_sleep = LPS_IS_WAKE;
29872986
2988− ieee->Regdot11HTOperationalRateSet[0] = 0xff;
2989− ieee->Regdot11HTOperationalRateSet[1] = 0xff;
2990− ieee->Regdot11HTOperationalRateSet[4] = 0x01;
2987+ ieee->reg_dot11ht_oper_rate_set[0] = 0xff;
2988+ ieee->reg_dot11ht_oper_rate_set[1] = 0xff;
2989+ ieee->reg_dot11ht_oper_rate_set[4] = 0x01;
29912990
2992− ieee->Regdot11TxHTOperationalRateSet[0] = 0xff;
2993− ieee->Regdot11TxHTOperationalRateSet[1] = 0xff;
2994− ieee->Regdot11TxHTOperationalRateSet[4] = 0x01;
2991+ ieee->reg_dot11tx_ht_oper_rate_set[0] = 0xff;
2992+ ieee->reg_dot11tx_ht_oper_rate_set[1] = 0xff;
2993+ ieee->reg_dot11tx_ht_oper_rate_set[4] = 0x01;
29952994
29962995 ieee->FirstIe_InScan = false;
29972996 ieee->actscanning = false;
drivers/staging/rtl8192e/rtllib_softmac_wx.c+9−10
@@ -359,11 +359,11 @@ void rtllib_wx_sync_scan_wq(void *data) · 358 unmodified lines
359359 if (ieee->ScanOperationBackupHandler)
360360 ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP);
361361
362− if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT &&
363− ieee->pHTInfo->bCurBW40MHz) {
362+ if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht &&
363+ ieee->ht_info->bCurBW40MHz) {
364364 b40M = 1;
365− chan_offset = ieee->pHTInfo->CurSTAExtChnlOffset;
366− bandwidth = (enum ht_channel_width)ieee->pHTInfo->bCurBW40MHz;
365+ chan_offset = ieee->ht_info->CurSTAExtChnlOffset;
366+ bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz;
367367 ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20,
368368 HT_EXTCHNL_OFFSET_NO_EXT);
369369 }
@@ -391,10 +391,10 @@ void rtllib_wx_sync_scan_wq(void *data) · 21 unmodified lines
391391 /* Notify AP that I wake up again */
392392 rtllib_sta_ps_send_null_frame(ieee, 0);
393393
394− if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 ||
395− ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) {
396− ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
397− ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
394+ if (ieee->link_detect_info.NumRecvBcnInPeriod == 0 ||
395+ ieee->link_detect_info.NumRecvDataInPeriod == 0) {
396+ ieee->link_detect_info.NumRecvBcnInPeriod = 1;
397+ ieee->link_detect_info.NumRecvDataInPeriod = 1;
398398 }
399399
400400 if (ieee->data_hard_resume)
@@ -564,9 +564,8 @@ int rtllib_wx_set_power(struct rtllib_device *ieee, · 163 unmodified lines
564564 ieee->ps = RTLLIB_PS_DISABLED;
565565 goto exit;
566566 }
567− if (wrqu->power.flags & IW_POWER_TIMEOUT) {
567+ if (wrqu->power.flags & IW_POWER_TIMEOUT)
568568 ieee->ps_timeout = wrqu->power.value / 1000;
569− }
570569
571570 if (wrqu->power.flags & IW_POWER_PERIOD)
572571 ieee->ps_period = wrqu->power.value / 1000;
drivers/staging/rtl8192e/rtllib_tx.c+57−63
@@ -191,7 +191,6 @@ int rtllib_encrypt_fragment(struct rtllib_device *ieee, struct sk_buff *frag, · 190 unmodified lines
191191 return 0;
192192 }
193193
194−
195194 void rtllib_txb_free(struct rtllib_txb *txb)
196195 {
197196 if (unlikely(!txb))
@@ -267,14 +266,14 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, · 69 unmodified lines
267266 struct sk_buff *skb,
268267 struct cb_desc *tcb_desc)
269268 {
270− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
269+ struct rt_hi_throughput *ht_info = ieee->ht_info;
271270 struct tx_ts_record *pTxTs = NULL;
272271 struct rtllib_hdr_1addr *hdr = (struct rtllib_hdr_1addr *)skb->data;
273272
274273 if (rtllib_act_scanning(ieee, false))
275274 return;
276275
277− if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT)
276+ if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht)
278277 return;
279278 if (!IsQoSDataFrame(skb->data))
280279 return;
@@ -284,14 +283,14 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, · 3 unmodified lines
284283 if (tcb_desc->bdhcp || ieee->CntAfterLink < 2)
285284 return;
286285
287− if (pHTInfo->iot_action & HT_IOT_ACT_TX_NO_AGGREGATION)
286+ if (ht_info->iot_action & HT_IOT_ACT_TX_NO_AGGREGATION)
288287 return;
289288
290289 if (!ieee->GetNmodeSupportBySecCfg(ieee->dev))
291290 return;
292− if (pHTInfo->bCurrentAMPDUEnable) {
291+ if (ht_info->bCurrentAMPDUEnable) {
293292 if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1,
294− skb->priority, TX_DIR, true)) {
293+ skb->priority, TX_DIR, true)) {
295294 netdev_info(ieee->dev, "%s: can't get TS\n", __func__);
296295 return;
297296 }
@@ -307,26 +306,26 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, · 9 unmodified lines
307306 goto FORCED_AGG_SETTING;
308307 } else if (!pTxTs->bUsingBa) {
309308 if (SN_LESS(pTxTs->TxAdmittedBARecord.ba_start_seq_ctrl.field.seq_num,
310− (pTxTs->TxCurSeq+1)%4096))
309+ (pTxTs->TxCurSeq + 1) % 4096))
311310 pTxTs->bUsingBa = true;
312311 else
313312 goto FORCED_AGG_SETTING;
314313 }
315314 if (ieee->iw_mode == IW_MODE_INFRA) {
316315 tcb_desc->bAMPDUEnable = true;
317− tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor;
318− tcb_desc->ampdu_density = pHTInfo->current_mpdu_density;
316+ tcb_desc->ampdu_factor = ht_info->CurrentAMPDUFactor;
317+ tcb_desc->ampdu_density = ht_info->current_mpdu_density;
319318 }
320319 }
321320 FORCED_AGG_SETTING:
322− switch (pHTInfo->ForcedAMPDUMode) {
321+ switch (ht_info->ForcedAMPDUMode) {
323322 case HT_AGG_AUTO:
324323 break;
325324
326325 case HT_AGG_FORCE_ENABLE:
327326 tcb_desc->bAMPDUEnable = true;
328− tcb_desc->ampdu_density = pHTInfo->forced_mpdu_density;
329− tcb_desc->ampdu_factor = pHTInfo->forced_ampdu_factor;
327+ tcb_desc->ampdu_density = ht_info->forced_mpdu_density;
328+ tcb_desc->ampdu_factor = ht_info->forced_ampdu_factor;
330329 break;
331330
332331 case HT_AGG_FORCE_DISABLE:
@@ -351,32 +350,32 @@ static void rtllib_query_ShortPreambleMode(struct rtllib_device *ieee, · 18 unmodified lines
351350 static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee,
352351 struct cb_desc *tcb_desc)
353352 {
354− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
353+ struct rt_hi_throughput *ht_info = ieee->ht_info;
355354
356355 tcb_desc->bUseShortGI = false;
357356
358− if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT)
357+ if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht)
359358 return;
360359
361− if (pHTInfo->forced_short_gi) {
360+ if (ht_info->forced_short_gi) {
362361 tcb_desc->bUseShortGI = true;
363362 return;
364363 }
365364
366− if (pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI40MHz)
365+ if (ht_info->bCurBW40MHz && ht_info->bCurShortGI40MHz)
367366 tcb_desc->bUseShortGI = true;
368− else if (!pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI20MHz)
367+ else if (!ht_info->bCurBW40MHz && ht_info->bCurShortGI20MHz)
369368 tcb_desc->bUseShortGI = true;
370369 }
371370
372371 static void rtllib_query_BandwidthMode(struct rtllib_device *ieee,
373372 struct cb_desc *tcb_desc)
374373 {
375− struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
374+ struct rt_hi_throughput *ht_info = ieee->ht_info;
376375
377376 tcb_desc->bPacketBW = false;
378377
379− if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT)
378+ if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht)
380379 return;
381380
382381 if (tcb_desc->bMulticast || tcb_desc->bBroadcast)
@@ -384,7 +383,7 @@ static void rtllib_query_BandwidthMode(struct rtllib_device *ieee, · 1 unmodified line
384383
385384 if ((tcb_desc->data_rate & 0x80) == 0)
386385 return;
387− if (pHTInfo->bCurBW40MHz && pHTInfo->cur_tx_bw40mhz &&
386+ if (ht_info->bCurBW40MHz && ht_info->cur_tx_bw40mhz &&
388387 !ieee->bandwidth_auto_switch.bforced_tx20Mhz)
389388 tcb_desc->bPacketBW = true;
390389 }
@@ -393,7 +392,7 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 2 unmodified lines
393392 struct cb_desc *tcb_desc,
394393 struct sk_buff *skb)
395394 {
396− struct rt_hi_throughput *pHTInfo;
395+ struct rt_hi_throughput *ht_info;
397396
398397 tcb_desc->bRTSSTBC = false;
399398 tcb_desc->bRTSUseShortGI = false;
@@ -404,7 +403,7 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 4 unmodified lines
404403 if (tcb_desc->bBroadcast || tcb_desc->bMulticast)
405404 return;
406405
407− if (is_broadcast_ether_addr(skb->data+16))
406+ if (is_broadcast_ether_addr(skb->data + 16))
408407 return;
409408
410409 if (ieee->mode < IEEE_N_24G) {
@@ -419,15 +418,15 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 8 unmodified lines
419418 return;
420419 }
421420
422− pHTInfo = ieee->pHTInfo;
421+ ht_info = ieee->ht_info;
423422
424423 while (true) {
425− if (pHTInfo->iot_action & HT_IOT_ACT_FORCED_CTS2SELF) {
424+ if (ht_info->iot_action & HT_IOT_ACT_FORCED_CTS2SELF) {
426425 tcb_desc->bCTSEnable = true;
427426 tcb_desc->rts_rate = MGN_24M;
428427 tcb_desc->bRTSEnable = true;
429428 break;
430− } else if (pHTInfo->iot_action & (HT_IOT_ACT_FORCED_RTS |
429+ } else if (ht_info->iot_action & (HT_IOT_ACT_FORCED_RTS |
431430 HT_IOT_ACT_PURE_N_MODE)) {
432431 tcb_desc->bRTSEnable = true;
433432 tcb_desc->rts_rate = MGN_24M;
@@ -439,12 +438,12 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee, · 5 unmodified lines
439438 tcb_desc->rts_rate = MGN_24M;
440439 break;
441440 }
442− if (pHTInfo->bCurrentHTSupport && pHTInfo->bEnableHT) {
443− u8 HTOpMode = pHTInfo->current_op_mode;
441+ if (ht_info->bCurrentHTSupport && ht_info->enable_ht) {
442+ u8 HTOpMode = ht_info->current_op_mode;
444443
445− if ((pHTInfo->bCurBW40MHz && (HTOpMode == 2 ||
446− HTOpMode == 3)) ||
447− (!pHTInfo->bCurBW40MHz && HTOpMode == 3)) {
444+ if ((ht_info->bCurBW40MHz && (HTOpMode == 2 ||
445+ HTOpMode == 3)) ||
446+ (!ht_info->bCurBW40MHz && HTOpMode == 3)) {
448447 tcb_desc->rts_rate = MGN_24M;
449448 tcb_desc->bRTSEnable = true;
450449 break;
@@ -475,17 +474,16 @@ NO_PROTECTION: · 24 unmodified lines
475474 tcb_desc->bRTSBW = false;
476475 }
477476
478−
479477 static void rtllib_txrate_selectmode(struct rtllib_device *ieee,
480478 struct cb_desc *tcb_desc)
481479 {
482− if (ieee->bTxDisableRateFallBack)
483− tcb_desc->bTxDisableRateFallBack = true;
480+ if (ieee->tx_dis_rate_fallback)
481+ tcb_desc->tx_dis_rate_fallback = true;
484482
485− if (ieee->bTxUseDriverAssingedRate)
486− tcb_desc->bTxUseDriverAssingedRate = true;
487− if (!tcb_desc->bTxDisableRateFallBack ||
488− !tcb_desc->bTxUseDriverAssingedRate) {
483+ if (ieee->tx_use_drv_assinged_rate)
484+ tcb_desc->tx_use_drv_assinged_rate = true;
485+ if (!tcb_desc->tx_dis_rate_fallback ||
486+ !tcb_desc->tx_use_drv_assinged_rate) {
489487 if (ieee->iw_mode == IW_MODE_INFRA ||
490488 ieee->iw_mode == IW_MODE_ADHOC)
491489 tcb_desc->RATRIndex = 0;
@@ -503,10 +501,10 @@ static u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb, · 11 unmodified lines
503501 struct tx_ts_record *pTS = NULL;
504502
505503 if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst,
506− skb->priority, TX_DIR, true))
504+ skb->priority, TX_DIR, true))
507505 return 0;
508506 seqnum = pTS->TxCurSeq;
509− pTS->TxCurSeq = (pTS->TxCurSeq+1)%4096;
507+ pTS->TxCurSeq = (pTS->TxCurSeq + 1) % 4096;
510508 return seqnum;
511509 }
512510 return 0;
@@ -582,7 +580,6 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 69 unmodified lines
582580 goto success;
583581 }
584582
585−
586583 if (likely(ieee->raw_tx == 0)) {
587584 if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
588585 netdev_warn(ieee->dev, "skb too small (%d).\n",
@@ -614,14 +611,14 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 25 unmodified lines
614611 if (skb->len > 282) {
615612 if (ether_type == ETH_P_IP) {
616613 const struct iphdr *ip = (struct iphdr *)
617− ((u8 *)skb->data+14);
614+ ((u8 *)skb->data + 14);
618615 if (ip->protocol == IPPROTO_UDP) {
619616 struct udphdr *udp;
620617
621618 udp = (struct udphdr *)((u8 *)ip +
622619 (ip->ihl << 2));
623620 if (((((u8 *)udp)[1] == 68) &&
624− (((u8 *)udp)[3] == 67)) ||
621+ (((u8 *)udp)[3] == 67)) ||
625622 ((((u8 *)udp)[1] == 67) &&
626623 (((u8 *)udp)[3] == 68))) {
627624 bdhcp = true;
@@ -715,11 +712,11 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 87 unmodified lines
715712 /* in case we are a client verify acm is not set for this ac */
716713 while (unlikely(ieee->wmm_acm & (0x01 << skb->priority))) {
717714 netdev_info(ieee->dev, "skb->priority = %x\n",
718− skb->priority);
715+ skb->priority);
719716 if (wme_downgrade_ac(skb))
720717 break;
721718 netdev_info(ieee->dev, "converted skb->priority = %x\n",
722− skb->priority);
719+ skb->priority);
723720 }
724721
725722 qos_ctl |= skb->priority;
@@ -805,8 +802,8 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 79 unmodified lines
805802 * MOREFRAGS bit to the frame control
806803 */
807804 if (i != nr_frags - 1) {
808− frag_hdr->frame_ctl = cpu_to_le16(
809− fc | RTLLIB_FCTL_MOREFRAGS);
805+ frag_hdr->frame_ctl = cpu_to_le16(fc |
806+ RTLLIB_FCTL_MOREFRAGS);
810807 bytes = bytes_per_frag;
811808
812809 } else {
@@ -816,18 +813,18 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 3 unmodified lines
816813 if ((qos_activated) && (!bIsMulticast)) {
817814 frag_hdr->seq_ctl =
818815 cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag,
819− header.addr1));
816+ header.addr1));
820817 frag_hdr->seq_ctl =
821− cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctl)<<4 | i);
818+ cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctl) << 4 | i);
822819 } else {
823820 frag_hdr->seq_ctl =
824− cpu_to_le16(ieee->seq_ctrl[0]<<4 | i);
821+ cpu_to_le16(ieee->seq_ctrl[0] << 4 | i);
825822 }
826823 /* Put a SNAP header on the first fragment */
827824 if (i == 0) {
828− rtllib_put_snap(
829− skb_put(skb_frag, SNAP_SIZE +
830− sizeof(u16)), ether_type);
825+ rtllib_put_snap(skb_put(skb_frag,
826+ SNAP_SIZE +
827+ sizeof(u16)), ether_type);
831828 bytes -= SNAP_SIZE + sizeof(u16);
832829 }
833830
@@ -885,19 +882,18 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 51 unmodified lines
885882 tcb_desc->priority = skb->priority;
886883
887884 if (ether_type == ETH_P_PAE) {
888− if (ieee->pHTInfo->iot_action &
885+ if (ieee->ht_info->iot_action &
889886 HT_IOT_ACT_WA_IOT_Broadcom) {
890887 tcb_desc->data_rate =
891888 MgntQuery_TxRateExcludeCCKRates(ieee);
892− tcb_desc->bTxDisableRateFallBack = false;
889+ tcb_desc->tx_dis_rate_fallback = false;
893890 } else {
894891 tcb_desc->data_rate = ieee->basic_rate;
895− tcb_desc->bTxDisableRateFallBack = 1;
892+ tcb_desc->tx_dis_rate_fallback = 1;
896893 }
897894
898−
899895 tcb_desc->RATRIndex = 7;
900− tcb_desc->bTxUseDriverAssingedRate = 1;
896+ tcb_desc->tx_use_drv_assinged_rate = 1;
901897 } else {
902898 if (is_multicast_ether_addr(header.addr1))
903899 tcb_desc->bMulticast = 1;
@@ -910,19 +906,18 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 6 unmodified lines
910906 tcb_desc->data_rate = rtllib_current_rate(ieee);
911907
912908 if (bdhcp) {
913− if (ieee->pHTInfo->iot_action &
909+ if (ieee->ht_info->iot_action &
914910 HT_IOT_ACT_WA_IOT_Broadcom) {
915911 tcb_desc->data_rate =
916912 MgntQuery_TxRateExcludeCCKRates(ieee);
917− tcb_desc->bTxDisableRateFallBack = false;
913+ tcb_desc->tx_dis_rate_fallback = false;
918914 } else {
919915 tcb_desc->data_rate = MGN_1M;
920− tcb_desc->bTxDisableRateFallBack = 1;
916+ tcb_desc->tx_dis_rate_fallback = 1;
921917 }
922918
923−
924919 tcb_desc->RATRIndex = 7;
925− tcb_desc->bTxUseDriverAssingedRate = 1;
920+ tcb_desc->tx_use_drv_assinged_rate = 1;
926921 tcb_desc->bdhcp = 1;
927922 }
928923
@@ -959,7 +954,6 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) · 30 unmodified lines
959954 netif_stop_queue(dev);
960955 stats->tx_errors++;
961956 return 1;
962−
963957 }
964958
965959 netdev_tx_t rtllib_xmit(struct sk_buff *skb, struct net_device *dev)
drivers/staging/rtl8192e/rtllib_wx.c+3−3
@@ -217,7 +217,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee, · 216 unmodified lines
217217 p = custom;
218218 p += scnprintf(p, MAX_CUSTOM_LEN - (p - custom),
219219 " Last beacon: %lums ago",
220− (jiffies - network->last_scanned) / (HZ / 100));
220+ (100 * (jiffies - network->last_scanned)) / HZ);
221221 iwe.u.data.length = p - custom;
222222 if (iwe.u.data.length)
223223 start = iwe_stream_add_point_rsl(info, start, stop,
@@ -258,8 +258,8 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee, · 34 unmodified lines
258258 escape_essid(network->ssid,
259259 network->ssid_len),
260260 network->bssid,
261− (jiffies - network->last_scanned) /
262− (HZ / 100));
261+ (100 * (jiffies - network->last_scanned)) /
262+ HZ);
263263 }
264264
265265 spin_unlock_irqrestore(&ieee->lock, flags);
drivers/staging/rtl8192u/TODO+16−0
@@ -0,0 +1,16 @@
1+To-do list:
2+
3+* Correct the coding style according to Linux guidelines; please read the document
4+ at https://www.kernel.org/doc/html/latest/process/coding-style.html.
5+* Remove unnecessary debugging/printing macros; for those that are still needed
6+ use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()).
7+* Remove dead code such as unusued functions, variables, fields, etc..
8+* Use in-kernel API and remove unnecessary wrappers where possible.
9+* Fix bugs due to code that sleeps in atomic context.
10+* Remove the HAL layer and migrate its functionality into the relevant parts of
11+ the driver.
12+* Switch to use LIB80211.
13+* Switch to use MAC80211.
14+* Switch to use CFG80211.
15+* Improve the error handling of various functions, particularly those that use
16+ existing kernel APIs.
drivers/staging/rtl8192u/ieee80211/ieee80211.h+0−64
@@ -223,73 +223,10 @@ struct cb_desc { · 222 unmodified lines
223223 #define MAX_IE_LEN 0xff
224224
225225 // added for kernel conflict
226−#define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl
227−#define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl
228−#define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl
229−#define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl
230−#define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl
231−#define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl
232−
233−#define ieee80211_ccmp_null ieee80211_ccmp_null_rsl
234−
235−#define ieee80211_tkip_null ieee80211_tkip_null_rsl
236−
237−#define free_ieee80211 free_ieee80211_rsl
238−#define alloc_ieee80211 alloc_ieee80211_rsl
239−
240−#define ieee80211_rx ieee80211_rx_rsl
241−#define ieee80211_rx_mgt ieee80211_rx_mgt_rsl
242−
243−#define ieee80211_get_beacon ieee80211_get_beacon_rsl
244226 #define ieee80211_wake_queue ieee80211_wake_queue_rsl
245227 #define ieee80211_stop_queue ieee80211_stop_queue_rsl
246−#define ieee80211_reset_queue ieee80211_reset_queue_rsl
247−#define ieee80211_softmac_stop_protocol ieee80211_softmac_stop_protocol_rsl
248−#define ieee80211_softmac_start_protocol ieee80211_softmac_start_protocol_rsl
249−#define ieee80211_is_shortslot ieee80211_is_shortslot_rsl
250−#define ieee80211_is_54g ieee80211_is_54g_rsl
251−#define ieee80211_wpa_supplicant_ioctl ieee80211_wpa_supplicant_ioctl_rsl
252−#define ieee80211_ps_tx_ack ieee80211_ps_tx_ack_rsl
253−#define ieee80211_softmac_xmit ieee80211_softmac_xmit_rsl
254−#define ieee80211_stop_send_beacons ieee80211_stop_send_beacons_rsl
255228 #define notify_wx_assoc_event notify_wx_assoc_event_rsl
256229 #define SendDisassociation SendDisassociation_rsl
257−#define ieee80211_disassociate ieee80211_disassociate_rsl
258−#define ieee80211_start_send_beacons ieee80211_start_send_beacons_rsl
259−#define ieee80211_stop_scan ieee80211_stop_scan_rsl
260−#define ieee80211_send_probe_requests ieee80211_send_probe_requests_rsl
261−#define ieee80211_softmac_scan_syncro ieee80211_softmac_scan_syncro_rsl
262−#define ieee80211_start_scan_syncro ieee80211_start_scan_syncro_rsl
263−
264−#define ieee80211_wx_get_essid ieee80211_wx_get_essid_rsl
265−#define ieee80211_wx_set_essid ieee80211_wx_set_essid_rsl
266−#define ieee80211_wx_set_rate ieee80211_wx_set_rate_rsl
267−#define ieee80211_wx_get_rate ieee80211_wx_get_rate_rsl
268−#define ieee80211_wx_set_wap ieee80211_wx_set_wap_rsl
269−#define ieee80211_wx_get_wap ieee80211_wx_get_wap_rsl
270−#define ieee80211_wx_set_mode ieee80211_wx_set_mode_rsl
271−#define ieee80211_wx_get_mode ieee80211_wx_get_mode_rsl
272−#define ieee80211_wx_set_scan ieee80211_wx_set_scan_rsl
273−#define ieee80211_wx_get_freq ieee80211_wx_get_freq_rsl
274−#define ieee80211_wx_set_freq ieee80211_wx_set_freq_rsl
275−#define ieee80211_wx_set_rawtx ieee80211_wx_set_rawtx_rsl
276−#define ieee80211_wx_get_name ieee80211_wx_get_name_rsl
277−#define ieee80211_wx_set_power ieee80211_wx_set_power_rsl
278−#define ieee80211_wx_get_power ieee80211_wx_get_power_rsl
279−#define ieee80211_wlan_frequencies ieee80211_wlan_frequencies_rsl
280−#define ieee80211_wx_set_rts ieee80211_wx_set_rts_rsl
281−#define ieee80211_wx_get_rts ieee80211_wx_get_rts_rsl
282−
283−#define ieee80211_txb_free ieee80211_txb_free_rsl
284−
285−#define ieee80211_wx_set_gen_ie ieee80211_wx_set_gen_ie_rsl
286−#define ieee80211_wx_get_scan ieee80211_wx_get_scan_rsl
287−#define ieee80211_wx_set_encode ieee80211_wx_set_encode_rsl
288−#define ieee80211_wx_get_encode ieee80211_wx_get_encode_rsl
289−#define ieee80211_wx_set_mlme ieee80211_wx_set_mlme_rsl
290−#define ieee80211_wx_set_auth ieee80211_wx_set_auth_rsl
291−#define ieee80211_wx_set_encode_ext ieee80211_wx_set_encode_ext_rsl
292−#define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl
293230
294231
295232 struct ieee_param {
@@ -2256,7 +2193,6 @@ void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success); · 1960 unmodified lines
22562193 void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee);
22572194
22582195 /* ieee80211_crypt_ccmp&tkip&wep.c */
2259−void ieee80211_tkip_null(void);
22602196
22612197 int ieee80211_crypto_init(void);
22622198 void ieee80211_crypto_deinit(void);
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c+0−6
@@ -716,9 +716,3 @@ void ieee80211_crypto_tkip_exit(void) · 715 unmodified lines
716716 {
717717 ieee80211_unregister_crypto_ops(&ieee80211_crypt_tkip);
718718 }
719−
720−void ieee80211_tkip_null(void)
721−{
722−// printk("============>%s()\n", __func__);
723− return;
724−}
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c+0−3
@@ -159,9 +159,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) · 158 unmodified lines
159159 ieee->last_packet_time[i] = 0;
160160 }
161161
162−/* These function were added to load crypte module autoly */
163− ieee80211_tkip_null();
164−
165162 return dev;
166163
167164 failed:
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c+4−2
@@ -951,9 +951,11 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, · 950 unmodified lines
951951 #endif
952952
953953 if (ieee->iw_mode == IW_MODE_MONITOR) {
954+ unsigned int len = skb->len;
955+
954956 ieee80211_monitor_rx(ieee, skb, rx_stats);
955957 stats->rx_packets++;
956− stats->rx_bytes += skb->len;
958+ stats->rx_bytes += len;
957959 return 1;
958960 }
959961
@@ -1806,7 +1808,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, · 846 unmodified lines
18061808 info_element->data[0] == 0x00 &&
18071809 info_element->data[1] == 0x13 &&
18081810 info_element->data[2] == 0x74)) {
1809− netdev_dbg(ieee->dev, "========> athros AP is exist\n");
1811+ netdev_dbg(ieee->dev, "========> Atheros AP exists\n");
18101812 network->atheros_cap_exist = true;
18111813 } else
18121814 network->atheros_cap_exist = false;
drivers/staging/rtl8712/os_intfs.c+22−5
@@ -304,25 +304,42 @@ int r8712_init_drv_sw(struct _adapter *padapter) · 303 unmodified lines
304304 padapter->cmdpriv.padapter = padapter;
305305 ret = r8712_init_evt_priv(&padapter->evtpriv);
306306 if (ret)
307− return ret;
307+ goto free_cmd;
308308 ret = r8712_init_mlme_priv(padapter);
309309 if (ret)
310− return ret;
311− _r8712_init_xmit_priv(&padapter->xmitpriv, padapter);
312− _r8712_init_recv_priv(&padapter->recvpriv, padapter);
310+ goto free_evt;
311+ ret = _r8712_init_xmit_priv(&padapter->xmitpriv, padapter);
312+ if (ret)
313+ goto free_mlme;
314+ ret = _r8712_init_recv_priv(&padapter->recvpriv, padapter);
315+ if (ret)
316+ goto free_xmit;
313317 memset((unsigned char *)&padapter->securitypriv, 0,
314318 sizeof(struct security_priv));
315319 timer_setup(&padapter->securitypriv.tkip_timer,
316320 r8712_use_tkipkey_handler, 0);
317321 ret = _r8712_init_sta_priv(&padapter->stapriv);
318322 if (ret)
319− return ret;
323+ goto free_recv;
320324 padapter->stapriv.padapter = padapter;
321325 r8712_init_bcmc_stainfo(padapter);
322326 r8712_init_pwrctrl_priv(padapter);
323327 mp871xinit(padapter);
324328 init_default_value(padapter);
325329 r8712_InitSwLeds(padapter);
330+
331+ return 0;
332+
333+free_recv:
334+ _r8712_free_recv_priv(&padapter->recvpriv);
335+free_xmit:
336+ _free_xmit_priv(&padapter->xmitpriv);
337+free_mlme:
338+ r8712_free_mlme_priv(&padapter->mlmepriv);
339+free_evt:
340+ r8712_free_evt_priv(&padapter->evtpriv);
341+free_cmd:
342+ r8712_free_cmd_priv(&padapter->cmdpriv);
326343 return ret;
327344 }
328345
drivers/staging/rtl8712/recv_osdep.h+4−4
@@ -18,15 +18,15 @@ · 17 unmodified lines
1818 #include "drv_types.h"
1919 #include <linux/skbuff.h>
2020
21−void _r8712_init_recv_priv(struct recv_priv *precvpriv,
22− struct _adapter *padapter);
21+int _r8712_init_recv_priv(struct recv_priv *precvpriv,
22+ struct _adapter *padapter);
2323 void _r8712_free_recv_priv(struct recv_priv *precvpriv);
2424 void r8712_recv_entry(union recv_frame *precv_frame);
2525 void r8712_recv_indicatepkt(struct _adapter *adapter,
2626 union recv_frame *precv_frame);
2727 void r8712_handle_tkip_mic_err(struct _adapter *padapter, u8 bgroup);
28−void r8712_init_recv_priv(struct recv_priv *precvpriv,
29− struct _adapter *padapter);
28+int r8712_init_recv_priv(struct recv_priv *precvpriv,
29+ struct _adapter *padapter);
3030 void r8712_free_recv_priv(struct recv_priv *precvpriv);
3131 void r8712_os_recv_resource_alloc(struct _adapter *padapter,
3232 union recv_frame *precvframe);
drivers/staging/rtl8712/rtl8712_recv.c+4−3
@@ -30,8 +30,8 @@ · 29 unmodified lines
3030
3131 static void recv_tasklet(struct tasklet_struct *t);
3232
33−void r8712_init_recv_priv(struct recv_priv *precvpriv,
34− struct _adapter *padapter)
33+int r8712_init_recv_priv(struct recv_priv *precvpriv,
34+ struct _adapter *padapter)
3535 {
3636 int i;
3737 struct recv_buf *precvbuf;
@@ -44,7 +44,7 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv, · 6 unmodified lines
4444 precvpriv->pallocated_recv_buf =
4545 kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC);
4646 if (!precvpriv->pallocated_recv_buf)
47− return;
47+ return -ENOMEM;
4848 precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 -
4949 ((addr_t)(precvpriv->pallocated_recv_buf) & 3);
5050 precvbuf = (struct recv_buf *)precvpriv->precv_buf;
@@ -75,6 +75,7 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv, · 24 unmodified lines
7575 }
7676 pskb = NULL;
7777 }
78+ return 0;
7879 }
7980
8081 void r8712_free_recv_priv(struct recv_priv *precvpriv)
drivers/staging/rtl8712/rtl8712_xmit.c+1−2
@@ -601,7 +601,7 @@ int r8712_xmitframe_complete(struct _adapter *padapter, · 600 unmodified lines
601601 #ifdef CONFIG_R8712_TX_AGGR
602602 struct xmit_frame *p2ndxmitframe = NULL;
603603 #else
604− int res = _SUCCESS, xcnt = 0;
604+ int res = _SUCCESS;
605605 #endif
606606
607607 phwxmits = pxmitpriv->hwxmits;
@@ -673,7 +673,6 @@ int r8712_xmitframe_complete(struct _adapter *padapter, · 65 unmodified lines
673673 dump_xframe(padapter, pxmitframe);
674674 else
675675 r8712_free_xmitframe_ex(pxmitpriv, pxmitframe);
676− xcnt++;
677676 #endif
678677
679678 } else { /* pxmitframe == NULL && p2ndxmitframe == NULL */
drivers/staging/rtl8712/rtl871x_recv.c+9−7
@@ -17,9 +17,7 @@ · 16 unmodified lines
1717 #define _RTL871X_RECV_C_
1818
1919 #include <linux/ip.h>
20−#include <linux/slab.h>
2120 #include <linux/if_ether.h>
22−#include <linux/kmemleak.h>
2321 #include <linux/etherdevice.h>
2422 #include <linux/ieee80211.h>
2523 #include <net/cfg80211.h>
@@ -44,9 +42,10 @@ void _r8712_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) · 18 unmodified lines
4442 _init_queue(&psta_recvpriv->defrag_q);
4543 }
4644
47−void _r8712_init_recv_priv(struct recv_priv *precvpriv,
48− struct _adapter *padapter)
45+int _r8712_init_recv_priv(struct recv_priv *precvpriv,
46+ struct _adapter *padapter)
4947 {
48+ int ret;
5049 sint i;
5150 union recv_frame *precvframe;
5251
@@ -60,8 +59,7 @@ void _r8712_init_recv_priv(struct recv_priv *precvpriv, · 7 unmodified lines
6059 sizeof(union recv_frame) + RXFRAME_ALIGN_SZ,
6160 GFP_ATOMIC);
6261 if (!precvpriv->pallocated_frame_buf)
63− return;
64− kmemleak_not_leak(precvpriv->pallocated_frame_buf);
62+ return -ENOMEM;
6563 precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf +
6664 RXFRAME_ALIGN_SZ -
6765 ((addr_t)(precvpriv->pallocated_frame_buf) &
@@ -76,7 +74,11 @@ void _r8712_init_recv_priv(struct recv_priv *precvpriv, · 8 unmodified lines
7674 precvframe++;
7775 }
7876 precvpriv->rx_pending_cnt = 1;
79− r8712_init_recv_priv(precvpriv, padapter);
77+ ret = r8712_init_recv_priv(precvpriv, padapter);
78+ if (ret)
79+ kfree(precvpriv->pallocated_frame_buf);
80+
81+ return ret;
8082 }
8183
8284 void _r8712_free_recv_priv(struct recv_priv *precvpriv)
drivers/staging/rtl8723bs/core/rtw_efuse.c+1−1
@@ -282,7 +282,7 @@ u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoT · 281 unmodified lines
282282 {
283283 u8 tmpidx = 0;
284284 u8 bResult = false;
285− u32 efuseValue = 0;
285+ u32 efuseValue;
286286
287287 if (bPseudoTest)
288288 return Efuse_Write1ByteToFakeContent(addr, data);
drivers/staging/rtl8723bs/core/rtw_ieee80211.c+6−6
@@ -1063,18 +1063,18 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork) · 1062 unmodified lines
10631063 /* parsing HT_CAP_IE */
10641064 p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_CAPABILITY, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_);
10651065 if (p && len > 0) {
1066− pht_cap = (struct ieee80211_ht_cap *)(p + 2);
1067− pnetwork->bcn_info.ht_cap_info = le16_to_cpu(pht_cap->cap_info);
1066+ pht_cap = (struct ieee80211_ht_cap *)(p + 2);
1067+ pnetwork->bcn_info.ht_cap_info = le16_to_cpu(pht_cap->cap_info);
10681068 } else {
1069− pnetwork->bcn_info.ht_cap_info = 0;
1069+ pnetwork->bcn_info.ht_cap_info = 0;
10701070 }
10711071 /* parsing HT_INFO_IE */
10721072 p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_);
10731073 if (p && len > 0) {
1074− pht_info = (struct HT_info_element *)(p + 2);
1075− pnetwork->bcn_info.ht_info_infos_0 = pht_info->infos[0];
1074+ pht_info = (struct HT_info_element *)(p + 2);
1075+ pnetwork->bcn_info.ht_info_infos_0 = pht_info->infos[0];
10761076 } else {
1077− pnetwork->bcn_info.ht_info_infos_0 = 0;
1077+ pnetwork->bcn_info.ht_info_infos_0 = 0;
10781078 }
10791079 }
10801080
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c+9−8
@@ -78,6 +78,7 @@ u8 rtw_do_join(struct adapter *padapter) · 77 unmodified lines
7878 goto exit;
7979 } else {
8080 int select_ret;
81+
8182 spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
8283 select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv);
8384 if (select_ret == _SUCCESS) {
@@ -159,7 +160,7 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid) · 75 unmodified lines
159160 if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
160161 if ((pmlmepriv->assoc_ssid.ssid_length == ssid->ssid_length) &&
161162 (!memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, ssid->ssid_length))) {
162− if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) {
163+ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) {
163164 if (rtw_is_same_ibss(padapter, pnetwork) == false) {
164165 /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */
165166 rtw_disassoc_cmd(padapter, 0, true);
@@ -311,7 +312,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, · 145 unmodified lines
311312 if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
312313 if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
313314 rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
314− }
315+ }
315316
316317 *pold_state = networktype;
317318
@@ -367,7 +368,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter) · 49 unmodified lines
367368
368369 u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
369370 {
370− struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
371+ struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
371372 u8 res = true;
372373
373374 if (!padapter) {
@@ -462,11 +463,11 @@ exit: · 88 unmodified lines
462463 }
463464
464465 /*
465−* rtw_get_cur_max_rate -
466−* @adapter: pointer to struct adapter structure
467−*
468−* Return 0 or 100Kbps
469−*/
466+ * rtw_get_cur_max_rate -
467+ * @adapter: pointer to struct adapter structure
468+ *
469+ * Return 0 or 100Kbps
470+ */
470471 u16 rtw_get_cur_max_rate(struct adapter *adapter)
471472 {
472473 int i = 0;
drivers/staging/rtl8723bs/core/rtw_mlme.c+14−16
@@ -389,7 +389,7 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea · 388 unmodified lines
389389 __le16 tmps, tmpd;
390390
391391 if (rtw_bug_check(dst, src, &s_cap, &d_cap) == false)
392− return false;
392+ return false;
393393
394394 memcpy((u8 *)&tmps, rtw_get_capability_from_ie(src->ies), 2);
395395 memcpy((u8 *)&tmpd, rtw_get_capability_from_ie(dst->ies), 2);
@@ -669,7 +669,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor · 273 unmodified lines
669669 uint ie_len = 0;
670670
671671 if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0))
672− bselected = false;
672+ bselected = false;
673673
674674 if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) {
675675 p = rtw_get_ie(pnetwork->network.ies + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));
@@ -795,7 +795,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) · 119 unmodified lines
795795 pmlmepriv->to_join = false;
796796 s_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv);
797797 if (s_ret == _SUCCESS) {
798− _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
798+ _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
799799 } else if (s_ret == 2) {/* there is no need to wait for join */
800800 _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
801801 rtw_indicate_connect(adapter);
@@ -2010,8 +2010,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ · 1208 unmodified lines
20102010
20112011 if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { /* WMM element ID and OUI */
20122012 for (j = i; j < i + 9; j++) {
2013− out_ie[ielength] = in_ie[j];
2014− ielength++;
2013+ out_ie[ielength] = in_ie[j];
2014+ ielength++;
20152015 }
20162016 out_ie[initial_out_len + 1] = 0x07;
20172017 out_ie[initial_out_len + 6] = 0x00;
@@ -2064,15 +2064,13 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie · 46 unmodified lines
20642064
20652065 if (ie[13] <= 20) {
20662066 /* The RSN IE didn't include the PMK ID, append the PMK information */
2067− ie[ie_len] = 1;
2068− ie_len++;
2069− ie[ie_len] = 0; /* PMKID count = 0x0100 */
2070− ie_len++;
2071− memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
2072−
2073− ie_len += 16;
2074− ie[13] += 18;/* PMKID length = 2+16 */
2075−
2067+ ie[ie_len] = 1;
2068+ ie_len++;
2069+ ie[ie_len] = 0; /* PMKID count = 0x0100 */
2070+ ie_len++;
2071+ memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
2072+ ie_len += 16;
2073+ ie[13] += 18;/* PMKID length = 2+16 */
20762074 }
20772075 return ie_len;
20782076 }
@@ -2091,9 +2089,9 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u · 12 unmodified lines
20912089 memcpy(out_ie, in_ie, 12);
20922090 ielength = 12;
20932091 if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK))
2094− authmode = WLAN_EID_VENDOR_SPECIFIC;
2092+ authmode = WLAN_EID_VENDOR_SPECIFIC;
20952093 if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK))
2096− authmode = WLAN_EID_RSN;
2094+ authmode = WLAN_EID_RSN;
20972095
20982096 if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
20992097 memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c+1−1
@@ -5447,7 +5447,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf) · 5446 unmodified lines
54475447 u8 val8;
54485448
54495449 if (is_client_associated_to_ap(padapter))
5450− issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100);
5450+ issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100);
54515451
54525452 if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) {
54535453 /* Stop BCN */
drivers/staging/rtl8723bs/core/rtw_recv.c+3−3
@@ -161,7 +161,7 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_ · 160 unmodified lines
161161
162162 if (padapter) {
163163 if (pfree_recv_queue == &precvpriv->free_recv_queue)
164− precvpriv->free_recvframe_cnt++;
164+ precvpriv->free_recvframe_cnt++;
165165 }
166166 spin_unlock_bh(&pfree_recv_queue->lock);
167167 return _SUCCESS;
@@ -691,8 +691,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame * · 523 unmodified lines
691691 if (bmcast) {
692692 /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */
693693 if (!IS_MCAST(pattrib->bssid)) {
694− ret = _FAIL;
695− goto exit;
694+ ret = _FAIL;
695+ goto exit;
696696 }
697697 } else { /* not mc-frame */
698698 /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c+1−1
@@ -551,7 +551,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) · 550 unmodified lines
551551 else if (pacl_list->mode == 2)/* deny unless in accept list */
552552 res = match;
553553 else
554− res = true;
554+ res = true;
555555
556556 return res;
557557 }
drivers/staging/rtl8723bs/core/rtw_wlan_util.c+4−8
@@ -986,15 +986,11 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE) · 985 unmodified lines
986986 pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]);
987987 } else {
988988 /* modify from fw by Thomas 2010/11/17 */
989− if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3))
990− max_AMPDU_len = (pIE->data[i] & 0x3);
991− else
992− max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3);
989+ max_AMPDU_len = min(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3,
990+ pIE->data[i] & 0x3);
993991
994− if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (pIE->data[i] & 0x1c))
995− min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c);
996− else
997− min_MPDU_spacing = (pIE->data[i] & 0x1c);
992+ min_MPDU_spacing = max(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c,
993+ pIE->data[i] & 0x1c);
998994
999995 pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing;
1000996 }
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c+10−11
@@ -244,8 +244,8 @@ void ODM_TxPwrTrackSetPwr_8723B( · 243 unmodified lines
244244 Final_CCK_Swing_Index = 0;
245245
246246 setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
247− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
248− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
247+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0],
248+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]);
249249
250250 setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index);
251251
@@ -257,8 +257,8 @@ void ODM_TxPwrTrackSetPwr_8723B( · 5 unmodified lines
257257 pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit_OFDM;
258258
259259 setIqkMatrix_8723B(pDM_Odm, PwrTrackingLimit_OFDM, RFPath,
260− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
261− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
260+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0],
261+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]);
262262
263263 pDM_Odm->Modify_TxAGC_Flag_PathA = true;
264264 PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
@@ -267,16 +267,16 @@ void ODM_TxPwrTrackSetPwr_8723B( · 2 unmodified lines
267267 pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index;
268268
269269 setIqkMatrix_8723B(pDM_Odm, 0, RFPath,
270− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
271− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
270+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0],
271+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]);
272272
273273 pDM_Odm->Modify_TxAGC_Flag_PathA = true;
274274 PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM);
275275 PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7);
276276 } else {
277277 setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath,
278− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0],
279− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]);
278+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0],
279+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]);
280280
281281 if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */
282282 pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0;
@@ -1759,9 +1759,8 @@ void PHY_IQCalibrate_8723B( · 1476 unmodified lines
17591759 /* To Fix BSOD when final_candidate is 0xff */
17601760 /* by sherry 20120321 */
17611761 if (final_candidate < 4) {
1762− for (i = 0; i < IQK_Matrix_REG_NUM; i++)
1763− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i];
1764− pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true;
1762+ for (i = 0; i < IQK_MATRIX_REG_NUM; i++)
1763+ pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[0][i] = result[final_candidate][i];
17651764 }
17661765
17671766 _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9);
drivers/staging/rtl8723bs/hal/odm.h+3−9
@@ -193,8 +193,8 @@ struct odm_rate_adaptive { · 192 unmodified lines
193193 #define HP_THERMAL_NUM 8
194194
195195 #define AVG_THERMAL_NUM 8
196−#define IQK_Matrix_REG_NUM 8
197−#define IQK_Matrix_Settings_NUM 14 /* Channels_2_4G_NUM */
196+#define IQK_MATRIX_REG_NUM 8
197+#define IQK_MATRIX_SETTINGS_NUM 14 /* Channels_2_4G_NUM */
198198
199199 #define DM_Type_ByFW 0
200200 #define DM_Type_ByDriver 1
@@ -479,12 +479,6 @@ enum odm_type_alna_e { /* tag_ODM_TYPE_ALNA_Definition */ · 278 unmodified lines
479479 TYPE_ALNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0)
480480 };
481481
482−struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */
483− bool bIQKDone;
484− s32 Value[3][IQK_Matrix_REG_NUM];
485− bool bBWIqkResultSaved[3];
486−};
487−
488482 /* Remove PATHDIV_PARA struct to odm_PathDiv.h */
489483
490484 struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */
@@ -530,7 +524,7 @@ struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ · 39 unmodified lines
530524
531525 u8 ThermalValue_HP[HP_THERMAL_NUM];
532526 u8 ThermalValue_HP_index;
533− struct iqk_matrix_regs_setting IQKMatrixRegSetting[IQK_Matrix_Settings_NUM];
527+ s32 iqk_matrix_regs_setting_value[IQK_MATRIX_SETTINGS_NUM][IQK_MATRIX_REG_NUM];
534528 bool bNeedIQK;
535529 bool bIQKInProgress;
536530 u8 Delta_IQK;
drivers/staging/rtl8723bs/hal/odm_DIG.c+1−4
@@ -598,10 +598,7 @@ void odm_DIGbyRSSI_LPS(void *pDM_VOID) · 597 unmodified lines
598598 /* Lower bound checking */
599599
600600 /* RSSI Lower bound check */
601− if ((pDM_Odm->RSSI_Min-10) > DM_DIG_MIN_NIC)
602− RSSI_Lower = pDM_Odm->RSSI_Min-10;
603− else
604− RSSI_Lower = DM_DIG_MIN_NIC;
601+ RSSI_Lower = max(pDM_Odm->RSSI_Min - 10, DM_DIG_MIN_NIC);
605602
606603 /* Upper and Lower Bound checking */
607604 if (CurrentIGI > DM_DIG_MAX_NIC)
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c+1−1
@@ -1551,7 +1551,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel · 1550 unmodified lines
15511551
15521552 wps_ie = rtw_get_wps_ie(buf, ielen, NULL, &wps_ielen);
15531553 if (wps_ie && wps_ielen > 0) {
1554− padapter->securitypriv.wps_ie_len = wps_ielen < MAX_WPS_IE_LEN ? wps_ielen : MAX_WPS_IE_LEN;
1554+ padapter->securitypriv.wps_ie_len = min_t(uint, wps_ielen, MAX_WPS_IE_LEN);
15551555 memcpy(padapter->securitypriv.wps_ie, wps_ie, padapter->securitypriv.wps_ie_len);
15561556 set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS);
15571557 } else {
drivers/staging/rts5208/sd.c+2−1
@@ -4506,7 +4506,8 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip) · 4505 unmodified lines
45064506 if (CHK_SD(sd_card)) {
45074507 retval = reset_sd(chip);
45084508 if (retval != STATUS_SUCCESS) {
4509− sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST);
4509+ sd_card->sd_lock_status &=
4510+ ~(SD_UNLOCK_POW_ON | SD_SDR_RST);
45104511 goto sd_execute_write_cmd_failed;
45114512 }
45124513 }
drivers/staging/sm750fb/Kconfig+1−1
@@ -9,7 +9,7 @@ config FB_SM750 · 8 unmodified lines
99 select VIDEO_NOMODESET
1010 help
1111 Frame buffer driver for the Silicon Motion SM750 chip
12− with 2D accelearion and dual head support.
12+ with 2D acceleration and dual head support.
1313
1414 This driver is also available as a module. The module will be
1515 called sm750fb. If you want to compile it as a module, say M
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c+15−15
@@ -87,21 +87,21 @@ static struct mmal_fmt formats[] = { · 86 unmodified lines
8787 .depth = 12,
8888 .mmal_component = COMP_CAMERA,
8989 .ybbp = 1,
90− .remove_padding = 1,
90+ .remove_padding = true,
9191 }, {
9292 .fourcc = V4L2_PIX_FMT_YUYV,
9393 .mmal = MMAL_ENCODING_YUYV,
9494 .depth = 16,
9595 .mmal_component = COMP_CAMERA,
9696 .ybbp = 2,
97− .remove_padding = 0,
97+ .remove_padding = false,
9898 }, {
9999 .fourcc = V4L2_PIX_FMT_RGB24,
100100 .mmal = MMAL_ENCODING_RGB24,
101101 .depth = 24,
102102 .mmal_component = COMP_CAMERA,
103103 .ybbp = 3,
104− .remove_padding = 0,
104+ .remove_padding = false,
105105 }, {
106106 .fourcc = V4L2_PIX_FMT_JPEG,
107107 .flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -109,7 +109,7 @@ static struct mmal_fmt formats[] = { · 1 unmodified line
109109 .depth = 8,
110110 .mmal_component = COMP_IMAGE_ENCODE,
111111 .ybbp = 0,
112− .remove_padding = 0,
112+ .remove_padding = false,
113113 }, {
114114 .fourcc = V4L2_PIX_FMT_H264,
115115 .flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -117,7 +117,7 @@ static struct mmal_fmt formats[] = { · 1 unmodified line
117117 .depth = 8,
118118 .mmal_component = COMP_VIDEO_ENCODE,
119119 .ybbp = 0,
120− .remove_padding = 0,
120+ .remove_padding = false,
121121 }, {
122122 .fourcc = V4L2_PIX_FMT_MJPEG,
123123 .flags = V4L2_FMT_FLAG_COMPRESSED,
@@ -125,63 +125,63 @@ static struct mmal_fmt formats[] = { · 1 unmodified line
125125 .depth = 8,
126126 .mmal_component = COMP_VIDEO_ENCODE,
127127 .ybbp = 0,
128− .remove_padding = 0,
128+ .remove_padding = false,
129129 }, {
130130 .fourcc = V4L2_PIX_FMT_YVYU,
131131 .mmal = MMAL_ENCODING_YVYU,
132132 .depth = 16,
133133 .mmal_component = COMP_CAMERA,
134134 .ybbp = 2,
135− .remove_padding = 0,
135+ .remove_padding = false,
136136 }, {
137137 .fourcc = V4L2_PIX_FMT_VYUY,
138138 .mmal = MMAL_ENCODING_VYUY,
139139 .depth = 16,
140140 .mmal_component = COMP_CAMERA,
141141 .ybbp = 2,
142− .remove_padding = 0,
142+ .remove_padding = false,
143143 }, {
144144 .fourcc = V4L2_PIX_FMT_UYVY,
145145 .mmal = MMAL_ENCODING_UYVY,
146146 .depth = 16,
147147 .mmal_component = COMP_CAMERA,
148148 .ybbp = 2,
149− .remove_padding = 0,
149+ .remove_padding = false,
150150 }, {
151151 .fourcc = V4L2_PIX_FMT_NV12,
152152 .mmal = MMAL_ENCODING_NV12,
153153 .depth = 12,
154154 .mmal_component = COMP_CAMERA,
155155 .ybbp = 1,
156− .remove_padding = 1,
156+ .remove_padding = true,
157157 }, {
158158 .fourcc = V4L2_PIX_FMT_BGR24,
159159 .mmal = MMAL_ENCODING_BGR24,
160160 .depth = 24,
161161 .mmal_component = COMP_CAMERA,
162162 .ybbp = 3,
163− .remove_padding = 0,
163+ .remove_padding = false,
164164 }, {
165165 .fourcc = V4L2_PIX_FMT_YVU420,
166166 .mmal = MMAL_ENCODING_YV12,
167167 .depth = 12,
168168 .mmal_component = COMP_CAMERA,
169169 .ybbp = 1,
170− .remove_padding = 1,
170+ .remove_padding = true,
171171 }, {
172172 .fourcc = V4L2_PIX_FMT_NV21,
173173 .mmal = MMAL_ENCODING_NV21,
174174 .depth = 12,
175175 .mmal_component = COMP_CAMERA,
176176 .ybbp = 1,
177− .remove_padding = 1,
177+ .remove_padding = true,
178178 }, {
179179 .fourcc = V4L2_PIX_FMT_BGR32,
180180 .mmal = MMAL_ENCODING_BGRA,
181181 .depth = 32,
182182 .mmal_component = COMP_CAMERA,
183183 .ybbp = 4,
184− .remove_padding = 0,
184+ .remove_padding = false,
185185 },
186186 };
187187
@@ -1147,7 +1147,7 @@ static int mmal_setup_components(struct bcm2835_mmal_dev *dev, · 959 unmodified lines
11471147 struct vchiq_mmal_port *port = NULL, *camera_port = NULL;
11481148 struct vchiq_mmal_component *encode_component = NULL;
11491149 struct mmal_fmt *mfmt = get_format(f);
1150− u32 remove_padding;
1150+ bool remove_padding;
11511151
11521152 if (!mfmt)
11531153 return -EINVAL;
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c+9−9
@@ -863,9 +863,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance, · 862 unmodified lines
863863 goto release_msg;
864864
865865 if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
866− port->enabled = 0;
866+ port->enabled = false;
867867 else
868− port->enabled = 1;
868+ port->enabled = true;
869869
870870 /* copy the values out of the message */
871871 port->handle = rmsg->u.port_info_get_reply.port_handle;
@@ -1304,7 +1304,7 @@ static int port_disable(struct vchiq_mmal_instance *instance, · 432 unmodified lines
13041304 if (!port->enabled)
13051305 return 0;
13061306
1307− port->enabled = 0;
1307+ port->enabled = false;
13081308
13091309 ret = port_action_port(instance, port,
13101310 MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
@@ -1359,7 +1359,7 @@ static int port_enable(struct vchiq_mmal_instance *instance, · 48 unmodified lines
13591359 if (ret)
13601360 goto done;
13611361
1362− port->enabled = 1;
1362+ port->enabled = true;
13631363
13641364 if (port->buffer_cb) {
13651365 /* send buffer headers to videocore */
@@ -1531,7 +1531,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, · 165 unmodified lines
15311531 pr_err("failed disconnecting src port\n");
15321532 goto release_unlock;
15331533 }
1534− src->connected->enabled = 0;
1534+ src->connected->enabled = false;
15351535 src->connected = NULL;
15361536 }
15371537
@@ -1648,7 +1648,7 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance, · 110 unmodified lines
16481648 for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
16491649 if (!instance->component[idx].in_use) {
16501650 component = &instance->component[idx];
1651− component->in_use = 1;
1651+ component->in_use = true;
16521652 break;
16531653 }
16541654 }
@@ -1724,7 +1724,7 @@ release_component: · 69 unmodified lines
17241724 destroy_component(instance, component);
17251725 unlock:
17261726 if (component)
1727− component->in_use = 0;
1727+ component->in_use = false;
17281728 mutex_unlock(&instance->vchiq_mutex);
17291729
17301730 return ret;
@@ -1747,7 +1747,7 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance, · 16 unmodified lines
17471747
17481748 ret = destroy_component(instance, component);
17491749
1750− component->in_use = 0;
1750+ component->in_use = false;
17511751
17521752 mutex_unlock(&instance->vchiq_mutex);
17531753
@@ -1799,7 +1799,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance, · 45 unmodified lines
17991799
18001800 ret = disable_component(instance, component);
18011801 if (ret == 0)
1802− component->enabled = 0;
1802+ component->enabled = false;
18031803
18041804 mutex_unlock(&instance->vchiq_mutex);
18051805
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h+3−3
@@ -48,7 +48,7 @@ typedef void (*vchiq_mmal_buffer_cb)( · 47 unmodified lines
4848 int status, struct mmal_buffer *buffer);
4949
5050 struct vchiq_mmal_port {
51− u32 enabled:1;
51+ bool enabled;
5252 u32 handle;
5353 u32 type; /* port type, cached to use on port info set */
5454 u32 index; /* port index, cached to use on port info set */
@@ -82,8 +82,8 @@ struct vchiq_mmal_port { · 27 unmodified lines
8282 };
8383
8484 struct vchiq_mmal_component {
85− u32 in_use:1;
86− u32 enabled:1;
85+ bool in_use;
86+ bool enabled;
8787 u32 handle; /* VideoCore handle for component */
8888 u32 inputs; /* Number of input ports */
8989 u32 outputs; /* Number of output ports */
drivers/staging/vme_user/vme.h+0−2
@@ -27,7 +27,6 @@ enum vme_resource_type { · 26 unmodified lines
2727 #define VME_A64_MAX 0x10000000000000000ULL
2828 #define VME_CRCSR_MAX 0x1000000ULL
2929
30−
3130 /* VME Cycle Types */
3231 #define VME_SCT 0x1
3332 #define VME_BLT 0x2
@@ -185,6 +184,5 @@ int vme_bus_num(struct vme_dev *); · 151 unmodified lines
185184 int vme_register_driver(struct vme_driver *, unsigned int);
186185 void vme_unregister_driver(struct vme_driver *);
187186
188−
189187 #endif /* _VME_H_ */
190188
drivers/staging/vme_user/vme_fake.c+3−6
@@ -356,7 +356,6 @@ static int __fake_master_get(struct vme_master_resource *image, int *enabled, · 355 unmodified lines
356356 return 0;
357357 }
358358
359−
360359 static int fake_master_get(struct vme_master_resource *image, int *enabled,
361360 unsigned long long *vme_base, unsigned long long *size,
362361 u32 *aspace, u32 *cycle, u32 *dwidth)
@@ -373,7 +372,6 @@ static int fake_master_get(struct vme_master_resource *image, int *enabled, · 10 unmodified lines
373372 return retval;
374373 }
375374
376−
377375 static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr,
378376 u32 aspace, u32 cycle)
379377 {
@@ -1060,7 +1058,6 @@ static void fake_crcsr_exit(struct vme_bridge *fake_bridge) · 680 unmodified lines
10601058 kfree(bridge->crcsr_kernel);
10611059 }
10621060
1063−
10641061 static int __init fake_init(void)
10651062 {
10661063 int retval, i;
@@ -1072,7 +1069,9 @@ static int __init fake_init(void) · 5 unmodified lines
10721069 struct vme_lm_resource *lm;
10731070
10741071 /* We need a fake parent device */
1075− vme_root = __root_device_register("vme", THIS_MODULE);
1072+ vme_root = root_device_register("vme");
1073+ if (IS_ERR(vme_root))
1074+ return PTR_ERR(vme_root);
10761075
10771076 /* If we want to support more than one bridge at some point, we need to
10781077 * dynamically allocate this so we get one per device.
@@ -1238,7 +1237,6 @@ err_struct: · 159 unmodified lines
12381237
12391238 }
12401239
1241−
12421240 static void __exit fake_exit(void)
12431241 {
12441242 struct list_head *pos = NULL;
@@ -1294,7 +1292,6 @@ static void __exit fake_exit(void) · 49 unmodified lines
12941292 root_device_unregister(vme_root);
12951293 }
12961294
1297−
12981295 MODULE_PARM_DESC(geoid, "Set geographical addressing");
12991296 module_param(geoid, int, 0);
13001297
drivers/staging/vme_user/vme_tsi148.c+1−6
@@ -34,7 +34,6 @@ · 33 unmodified lines
3434 static int tsi148_probe(struct pci_dev *, const struct pci_device_id *);
3535 static void tsi148_remove(struct pci_dev *);
3636
37−
3837 /* Module parameter */
3938 static bool err_chk;
4039 static int geoid;
@@ -673,7 +672,6 @@ static int tsi148_slave_get(struct vme_slave_resource *image, int *enabled, · 632 unmodified lines
673672 /* Need granularity before we set the size */
674673 *size = (unsigned long long)((vme_bound - *vme_base) + granularity);
675674
676−
677675 if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160)
678676 *cycle |= VME_2eSST160;
679677 if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267)
@@ -1142,7 +1140,6 @@ static int __tsi148_master_get(struct vme_master_resource *image, int *enabled, · 462 unmodified lines
11421140 return 0;
11431141 }
11441142
1145−
11461143 static int tsi148_master_get(struct vme_master_resource *image, int *enabled,
11471144 unsigned long long *vme_base, unsigned long long *size, u32 *aspace,
11481145 u32 *cycle, u32 *dwidth)
@@ -1244,7 +1241,6 @@ out: · 95 unmodified lines
12441241 return retval;
12451242 }
12461243
1247−
12481244 static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
12491245 size_t count, loff_t offset)
12501246 {
@@ -1751,6 +1747,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *list, · 500 unmodified lines
17511747 return 0;
17521748
17531749 err_dma:
1750+ list_del(&entry->list);
17541751 err_dest:
17551752 err_source:
17561753 err_align:
@@ -1999,7 +1996,6 @@ static int tsi148_lm_get(struct vme_lm_resource *lm, · 242 unmodified lines
19991996 if ((lm_ctl & TSI148_LCSR_LMAT_AS_M) == TSI148_LCSR_LMAT_AS_A64)
20001997 *aspace |= VME_A64;
20011998
2002−
20031999 if (lm_ctl & TSI148_LCSR_LMAT_SUPR)
20042000 *cycle |= VME_SUPER;
20052001 if (lm_ctl & TSI148_LCSR_LMAT_NPRIV)
@@ -2550,7 +2546,6 @@ static void tsi148_remove(struct pci_dev *pdev) · 544 unmodified lines
25502546
25512547 bridge = tsi148_bridge->driver_priv;
25522548
2553−
25542549 dev_dbg(&pdev->dev, "Driver is being unloaded.\n");
25552550
25562551 /*
drivers/staging/vme_user/vme_tsi148.h+0−7
@@ -87,7 +87,6 @@ struct tsi148_dma_entry { · 86 unmodified lines
8787 * Control and Status Registers
8888 */
8989
90−
9190 /*
9291 * Command/Status Registers (CRG + $004)
9392 */
@@ -342,7 +341,6 @@ static const int TSI148_LCSR_VIACK[8] = { 0, TSI148_LCSR_VIACK1, · 248 unmodified lines
342341 #define TSI148_LCSR_IT7_ITOFL 0x3F4
343342 #define TSI148_LCSR_IT7_ITAT 0x3F8
344343
345−
346344 #define TSI148_LCSR_IT0 0x300
347345 #define TSI148_LCSR_IT1 0x320
348346 #define TSI148_LCSR_IT2 0x340
@@ -464,7 +462,6 @@ static const int TSI148_LCSR_IT[8] = { TSI148_LCSR_IT0, TSI148_LCSR_IT1, · 115 unmodified lines
464462 #define TSI148_LCSR_DMA0 0x500
465463 #define TSI148_LCSR_DMA1 0x580
466464
467−
468465 static const int TSI148_LCSR_DMA[TSI148_MAX_DMA] = { TSI148_LCSR_DMA0,
469466 TSI148_LCSR_DMA1 };
470467
@@ -532,9 +529,6 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, · 61 unmodified lines
532529 #define TSI148_CSRBSR 0xFF8
533530 #define TSI148_CBAR 0xFFC
534531
535−
536−
537−
538532 /*
539533 * TSI148 Register Bit Definitions
540534 */
@@ -828,7 +822,6 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, · 287 unmodified lines
828822 #define TSI148_LCSR_VEAT_AM_M (0x3F<<8) /* Address Mode Mask */
829823 #define TSI148_LCSR_VEAT_XAM_M (0xFF<<0) /* Master AMode Mask */
830824
831−
832825 /*
833826 * VMEbus PCI Error Diagnostics PCI/X Attributes Register CRG + $280
834827 */
drivers/staging/vt6655/rxtx.c+18−18
@@ -54,17 +54,17 @@ · 53 unmodified lines
5454 */
5555 #define CRITICAL_PACKET_LEN 256
5656
57−static const unsigned short wTimeStampOff[2][MAX_RATE] = {
57+static const unsigned short time_stamp_off[2][MAX_RATE] = {
5858 {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, /* Long Preamble */
5959 {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23}, /* Short Preamble */
6060 };
6161
62−static const unsigned short wFB_Opt0[2][5] = {
62+static const unsigned short fb_opt0[2][5] = {
6363 {RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */
6464 {RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */
6565 };
6666
67−static const unsigned short wFB_Opt1[2][5] = {
67+static const unsigned short fb_opt1[2][5] = {
6868 {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, /* fallback_rate0 */
6969 {RATE_6M, RATE_6M, RATE_12M, RATE_12M, RATE_18M}, /* fallback_rate1 */
7070 };
@@ -142,7 +142,7 @@ s_uFillDataHead( · 71 unmodified lines
142142
143143 static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
144144 {
145− return cpu_to_le16(wTimeStampOff[priv->preamble_type % 2]
145+ return cpu_to_le16(time_stamp_off[priv->preamble_type % 2]
146146 [rate % MAX_RATE]);
147147 }
148148
@@ -310,9 +310,9 @@ s_uGetDataDuration( · 161 unmodified lines
310310 wRate -= RATE_18M;
311311
312312 if (byFBOption == AUTO_FB_0)
313− wRate = wFB_Opt0[FB_RATE0][wRate];
313+ wRate = fb_opt0[FB_RATE0][wRate];
314314 else
315− wRate = wFB_Opt1[FB_RATE0][wRate];
315+ wRate = fb_opt1[FB_RATE0][wRate];
316316
317317 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType,
318318 len, wRate, bNeedAck);
@@ -365,52 +365,52 @@ s_uGetRTSCTSDuration( · 46 unmodified lines
365365 case RTSDUR_BA_F0: /* RTSDuration_ba_f0 */
366366 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate);
367367 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
368− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
368+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
369369 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
370− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
370+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
371371
372372 break;
373373
374374 case RTSDUR_AA_F0: /* RTSDuration_aa_f0 */
375375 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate);
376376 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
377− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
377+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
378378 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
379− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
379+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
380380
381381 break;
382382
383383 case RTSDUR_BA_F1: /* RTSDuration_ba_f1 */
384384 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate);
385385 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
386− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
386+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
387387 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
388− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
388+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
389389
390390 break;
391391
392392 case RTSDUR_AA_F1: /* RTSDuration_aa_f1 */
393393 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate);
394394 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
395− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
395+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
396396 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
397− uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
397+ uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
398398
399399 break;
400400
401401 case CTSDUR_BA_F0: /* CTSDuration_ba_f0 */
402402 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
403− uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
403+ uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
404404 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
405− uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
405+ uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
406406
407407 break;
408408
409409 case CTSDUR_BA_F1: /* CTSDuration_ba_f1 */
410410 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
411− uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
411+ uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
412412 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
413− uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
413+ uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
414414
415415 break;
416416
drivers/staging/wlan-ng/TODO+16−0
@@ -0,0 +1,16 @@
1+To-do list:
2+
3+* Correct the coding style according to Linux guidelines; please read the document
4+ at https://www.kernel.org/doc/html/latest/process/coding-style.html.
5+* Remove unnecessary debugging/printing macros; for those that are still needed
6+ use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()).
7+* Remove dead code such as unusued functions, variables, fields, etc..
8+* Use in-kernel API and remove unnecessary wrappers where possible.
9+* Fix bugs due to code that sleeps in atomic context.
10+* Remove the HAL layer and migrate its functionality into the relevant parts of
11+ the driver.
12+* Switch to use LIB80211.
13+* Switch to use MAC80211.
14+* Switch to use CFG80211.
15+* Improve the error handling of various functions, particularly those that use
16+ existing kernel APIs.
drivers/staging/wlan-ng/p80211mgmt.h+0−301
@@ -217,305 +217,4 @@ · 216 unmodified lines
217217 #define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6)
218218 #define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7)
219219
220−/*-- Information Element Types --------------------*/
221−/* prototype structure, all IEs start with these members */
222−
223−struct wlan_ie {
224− u8 eid;
225− u8 len;
226−} __packed;
227−
228−/*-- Service Set Identity (SSID) -----------------*/
229−struct wlan_ie_ssid {
230− u8 eid;
231− u8 len;
232− u8 ssid[1]; /* may be zero, ptrs may overlap */
233−} __packed;
234−
235−/*-- Supported Rates -----------------------------*/
236−struct wlan_ie_supp_rates {
237− u8 eid;
238− u8 len;
239− u8 rates[1]; /* had better be at LEAST one! */
240−} __packed;
241−
242−/*-- FH Parameter Set ----------------------------*/
243−struct wlan_ie_fh_parms {
244− u8 eid;
245− u8 len;
246− u16 dwell;
247− u8 hopset;
248− u8 hoppattern;
249− u8 hopindex;
250−} __packed;
251−
252−/*-- DS Parameter Set ----------------------------*/
253−struct wlan_ie_ds_parms {
254− u8 eid;
255− u8 len;
256− u8 curr_ch;
257−} __packed;
258−
259−/*-- CF Parameter Set ----------------------------*/
260−
261−struct wlan_ie_cf_parms {
262− u8 eid;
263− u8 len;
264− u8 cfp_cnt;
265− u8 cfp_period;
266− u16 cfp_maxdur;
267− u16 cfp_durremaining;
268−} __packed;
269−
270−/*-- TIM ------------------------------------------*/
271−struct wlan_ie_tim {
272− u8 eid;
273− u8 len;
274− u8 dtim_cnt;
275− u8 dtim_period;
276− u8 bitmap_ctl;
277− u8 virt_bm[1];
278−} __packed;
279−
280−/*-- IBSS Parameter Set ---------------------------*/
281−struct wlan_ie_ibss_parms {
282− u8 eid;
283− u8 len;
284− u16 atim_win;
285−} __packed;
286−
287−/*-- Challenge Text ------------------------------*/
288−struct wlan_ie_challenge {
289− u8 eid;
290− u8 len;
291− u8 challenge[1];
292−} __packed;
293−
294−/*-------------------------------------------------*/
295−/* Frame Types */
296−
297−/* prototype structure, all mgmt frame types will start with these members */
298−struct wlan_fr_mgmt {
299− u16 type;
300− u16 len; /* DOES NOT include CRC !!!! */
301− u8 *buf;
302− struct p80211_hdr *hdr;
303− /* used for target specific data, skb in Linux */
304− void *priv;
305− /*-- fixed fields -----------*/
306− /*-- info elements ----------*/
307−};
308−
309−/*-- Beacon ---------------------------------------*/
310−struct wlan_fr_beacon {
311− u16 type;
312− u16 len;
313− u8 *buf;
314− struct p80211_hdr *hdr;
315− /* used for target specific data, skb in Linux */
316− void *priv;
317− /*-- fixed fields -----------*/
318− u64 *ts;
319− u16 *bcn_int;
320− u16 *cap_info;
321− /*-- info elements ----------*/
322− struct wlan_ie_ssid *ssid;
323− struct wlan_ie_supp_rates *supp_rates;
324− struct wlan_ie_fh_parms *fh_parms;
325− struct wlan_ie_ds_parms *ds_parms;
326− struct wlan_ie_cf_parms *cf_parms;
327− struct wlan_ie_ibss_parms *ibss_parms;
328− struct wlan_ie_tim *tim;
329−
330−};
331−
332−/*-- IBSS ATIM ------------------------------------*/
333−struct wlan_fr_ibssatim {
334− u16 type;
335− u16 len;
336− u8 *buf;
337− struct p80211_hdr *hdr;
338− /* used for target specific data, skb in Linux */
339− void *priv;
340−
341− /*-- fixed fields -----------*/
342− /*-- info elements ----------*/
343−
344− /* this frame type has a null body */
345−
346−};
347−
348−/*-- Disassociation -------------------------------*/
349−struct wlan_fr_disassoc {
350− u16 type;
351− u16 len;
352− u8 *buf;
353− struct p80211_hdr *hdr;
354− /* used for target specific data, skb in Linux */
355− void *priv;
356− /*-- fixed fields -----------*/
357− u16 *reason;
358−
359− /*-- info elements ----------*/
360−
361−};
362−
363−/*-- Association Request --------------------------*/
364−struct wlan_fr_assocreq {
365− u16 type;
366− u16 len;
367− u8 *buf;
368− struct p80211_hdr *hdr;
369− /* used for target specific data, skb in Linux */
370− void *priv;
371− /*-- fixed fields -----------*/
372− u16 *cap_info;
373− u16 *listen_int;
374− /*-- info elements ----------*/
375− struct wlan_ie_ssid *ssid;
376− struct wlan_ie_supp_rates *supp_rates;
377−
378−};
379−
380−/*-- Association Response -------------------------*/
381−struct wlan_fr_assocresp {
382− u16 type;
383− u16 len;
384− u8 *buf;
385− struct p80211_hdr *hdr;
386− /* used for target specific data, skb in Linux */
387− void *priv;
388− /*-- fixed fields -----------*/
389− u16 *cap_info;
390− u16 *status;
391− u16 *aid;
392− /*-- info elements ----------*/
393− struct wlan_ie_supp_rates *supp_rates;
394−
395−};
396−
397−/*-- Reassociation Request ------------------------*/
398−struct wlan_fr_reassocreq {
399− u16 type;
400− u16 len;
401− u8 *buf;
402− struct p80211_hdr *hdr;
403− /* used for target specific data, skb in Linux */
404− void *priv;
405− /*-- fixed fields -----------*/
406− u16 *cap_info;
407− u16 *listen_int;
408− u8 *curr_ap;
409− /*-- info elements ----------*/
410− struct wlan_ie_ssid *ssid;
411− struct wlan_ie_supp_rates *supp_rates;
412−
413−};
414−
415−/*-- Reassociation Response -----------------------*/
416−struct wlan_fr_reassocresp {
417− u16 type;
418− u16 len;
419− u8 *buf;
420− struct p80211_hdr *hdr;
421− /* used for target specific data, skb in Linux */
422− void *priv;
423− /*-- fixed fields -----------*/
424− u16 *cap_info;
425− u16 *status;
426− u16 *aid;
427− /*-- info elements ----------*/
428− struct wlan_ie_supp_rates *supp_rates;
429−
430−};
431−
432−/*-- Probe Request --------------------------------*/
433−struct wlan_fr_probereq {
434− u16 type;
435− u16 len;
436− u8 *buf;
437− struct p80211_hdr *hdr;
438− /* used for target specific data, skb in Linux */
439− void *priv;
440− /*-- fixed fields -----------*/
441− /*-- info elements ----------*/
442− struct wlan_ie_ssid *ssid;
443− struct wlan_ie_supp_rates *supp_rates;
444−
445−};
446−
447−/*-- Probe Response -------------------------------*/
448−struct wlan_fr_proberesp {
449− u16 type;
450− u16 len;
451− u8 *buf;
452− struct p80211_hdr *hdr;
453− /* used for target specific data, skb in Linux */
454− void *priv;
455− /*-- fixed fields -----------*/
456− u64 *ts;
457− u16 *bcn_int;
458− u16 *cap_info;
459− /*-- info elements ----------*/
460− struct wlan_ie_ssid *ssid;
461− struct wlan_ie_supp_rates *supp_rates;
462− struct wlan_ie_fh_parms *fh_parms;
463− struct wlan_ie_ds_parms *ds_parms;
464− struct wlan_ie_cf_parms *cf_parms;
465− struct wlan_ie_ibss_parms *ibss_parms;
466−};
467−
468−/*-- Authentication -------------------------------*/
469−struct wlan_fr_authen {
470− u16 type;
471− u16 len;
472− u8 *buf;
473− struct p80211_hdr *hdr;
474− /* used for target specific data, skb in Linux */
475− void *priv;
476− /*-- fixed fields -----------*/
477− u16 *auth_alg;
478− u16 *auth_seq;
479− u16 *status;
480− /*-- info elements ----------*/
481− struct wlan_ie_challenge *challenge;
482−
483−};
484−
485−/*-- Deauthenication -----------------------------*/
486−struct wlan_fr_deauthen {
487− u16 type;
488− u16 len;
489− u8 *buf;
490− struct p80211_hdr *hdr;
491− /* used for target specific data, skb in Linux */
492− void *priv;
493− /*-- fixed fields -----------*/
494− u16 *reason;
495−
496− /*-- info elements ----------*/
497−
498−};
499−
500−void wlan_mgmt_encode_beacon(struct wlan_fr_beacon *f);
501−void wlan_mgmt_decode_beacon(struct wlan_fr_beacon *f);
502−void wlan_mgmt_encode_disassoc(struct wlan_fr_disassoc *f);
503−void wlan_mgmt_decode_disassoc(struct wlan_fr_disassoc *f);
504−void wlan_mgmt_encode_assocreq(struct wlan_fr_assocreq *f);
505−void wlan_mgmt_decode_assocreq(struct wlan_fr_assocreq *f);
506−void wlan_mgmt_encode_assocresp(struct wlan_fr_assocresp *f);
507−void wlan_mgmt_decode_assocresp(struct wlan_fr_assocresp *f);
508−void wlan_mgmt_encode_reassocreq(struct wlan_fr_reassocreq *f);
509−void wlan_mgmt_decode_reassocreq(struct wlan_fr_reassocreq *f);
510−void wlan_mgmt_encode_reassocresp(struct wlan_fr_reassocresp *f);
511−void wlan_mgmt_decode_reassocresp(struct wlan_fr_reassocresp *f);
512−void wlan_mgmt_encode_probereq(struct wlan_fr_probereq *f);
513−void wlan_mgmt_decode_probereq(struct wlan_fr_probereq *f);
514−void wlan_mgmt_encode_proberesp(struct wlan_fr_proberesp *f);
515−void wlan_mgmt_decode_proberesp(struct wlan_fr_proberesp *f);
516−void wlan_mgmt_encode_authen(struct wlan_fr_authen *f);
517−void wlan_mgmt_decode_authen(struct wlan_fr_authen *f);
518−void wlan_mgmt_encode_deauthen(struct wlan_fr_deauthen *f);
519−void wlan_mgmt_decode_deauthen(struct wlan_fr_deauthen *f);
520−
521220 #endif /* _P80211MGMT_H */
drivers/staging/wlan-ng/p80211netdev.c+0−22
@@ -881,55 +881,42 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc) · 880 unmodified lines
881881 wlandev->rx.mgmt++;
882882 switch (fstype) {
883883 case WLAN_FSTYPE_ASSOCREQ:
884− /* printk("assocreq"); */
885884 wlandev->rx.assocreq++;
886885 break;
887886 case WLAN_FSTYPE_ASSOCRESP:
888− /* printk("assocresp"); */
889887 wlandev->rx.assocresp++;
890888 break;
891889 case WLAN_FSTYPE_REASSOCREQ:
892− /* printk("reassocreq"); */
893890 wlandev->rx.reassocreq++;
894891 break;
895892 case WLAN_FSTYPE_REASSOCRESP:
896− /* printk("reassocresp"); */
897893 wlandev->rx.reassocresp++;
898894 break;
899895 case WLAN_FSTYPE_PROBEREQ:
900− /* printk("probereq"); */
901896 wlandev->rx.probereq++;
902897 break;
903898 case WLAN_FSTYPE_PROBERESP:
904− /* printk("proberesp"); */
905899 wlandev->rx.proberesp++;
906900 break;
907901 case WLAN_FSTYPE_BEACON:
908− /* printk("beacon"); */
909902 wlandev->rx.beacon++;
910903 break;
911904 case WLAN_FSTYPE_ATIM:
912− /* printk("atim"); */
913905 wlandev->rx.atim++;
914906 break;
915907 case WLAN_FSTYPE_DISASSOC:
916− /* printk("disassoc"); */
917908 wlandev->rx.disassoc++;
918909 break;
919910 case WLAN_FSTYPE_AUTHEN:
920− /* printk("authen"); */
921911 wlandev->rx.authen++;
922912 break;
923913 case WLAN_FSTYPE_DEAUTHEN:
924− /* printk("deauthen"); */
925914 wlandev->rx.deauthen++;
926915 break;
927916 default:
928− /* printk("unknown"); */
929917 wlandev->rx.mgmt_unknown++;
930918 break;
931919 }
932− /* printk("\n"); */
933920 drop = 2;
934921 break;
935922
@@ -943,35 +930,27 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc) · 7 unmodified lines
943930 wlandev->rx.ctl++;
944931 switch (fstype) {
945932 case WLAN_FSTYPE_PSPOLL:
946− /* printk("pspoll"); */
947933 wlandev->rx.pspoll++;
948934 break;
949935 case WLAN_FSTYPE_RTS:
950− /* printk("rts"); */
951936 wlandev->rx.rts++;
952937 break;
953938 case WLAN_FSTYPE_CTS:
954− /* printk("cts"); */
955939 wlandev->rx.cts++;
956940 break;
957941 case WLAN_FSTYPE_ACK:
958− /* printk("ack"); */
959942 wlandev->rx.ack++;
960943 break;
961944 case WLAN_FSTYPE_CFEND:
962− /* printk("cfend"); */
963945 wlandev->rx.cfend++;
964946 break;
965947 case WLAN_FSTYPE_CFENDCFACK:
966− /* printk("cfendcfack"); */
967948 wlandev->rx.cfendcfack++;
968949 break;
969950 default:
970− /* printk("unknown"); */
971951 wlandev->rx.ctl_unknown++;
972952 break;
973953 }
974− /* printk("\n"); */
975954 drop = 2;
976955 break;
977956
@@ -1007,7 +986,6 @@ static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc) · 29 unmodified lines
1007986 wlandev->rx.cfack_cfpoll++;
1008987 break;
1009988 default:
1010− /* printk("unknown"); */
1011989 wlandev->rx.data_unknown++;
1012990 break;
1013991 }
drivers/staging/wlan-ng/p80211types.h+0−6
@@ -231,12 +231,6 @@ struct p80211pstr32 { · 230 unmodified lines
231231 u8 data[MAXLEN_PSTR32];
232232 } __packed;
233233
234−/* MAC address array */
235−struct p80211macarray {
236− u32 cnt;
237− u8 data[1][MAXLEN_PSTR6];
238−} __packed;
239−
240234 /* prototype template */
241235 struct p80211item {
242236 u32 did;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t