forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/wl_iw.c
old mode 100644new mode 100755
....@@ -216,8 +216,8 @@
216216 #endif /* !WL_ESCAN */
217217
218218 struct pmk_list {
219
- pmkid_list_v1_t pmkids;
220
- pmkid_v1_t foo[MAXPMKID - 1];
219
+ pmkid_list_t pmkids;
220
+ pmkid_t foo[MAXPMKID - 1];
221221 };
222222
223223 typedef struct wl_wext_info {
....@@ -293,7 +293,7 @@
293293
294294 index = dhd_net2idx(dhd->info, dev);
295295 if (index == DHD_BAD_IF) {
296
- WL_ERROR(("Bad ifidx from %s\n", dev->name));
296
+ WL_ERROR(("Bad ifidx from dev:%p\n", dev));
297297 return -ENODEV;
298298 }
299299 ret = dhd_ioctl_process(dhd, index, &ioc, arg);
....@@ -456,7 +456,6 @@
456456 #endif /* WIRELESS_EXT < 13 */
457457
458458 #if WIRELESS_EXT > 12
459
-#ifdef CONFIG_WEXT_PRIV
460459 static int
461460 wl_iw_set_leddc(
462461 struct net_device *dev,
....@@ -503,7 +502,6 @@
503502 error = dev_wlc_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm));
504503 return error;
505504 }
506
-#endif /* CONFIG_WEXT_PRIV */
507505 #endif /* WIRELESS_EXT > 12 */
508506
509507 int
....@@ -534,7 +532,7 @@
534532 wl_iw_config_commit(
535533 struct net_device *dev,
536534 struct iw_request_info *info,
537
- union iwreq_data *zwrq,
535
+ void *zwrq,
538536 char *extra
539537 )
540538 {
....@@ -618,11 +616,10 @@
618616 wl_iw_set_freq(
619617 struct net_device *dev,
620618 struct iw_request_info *info,
621
- union iwreq_data *wrqu,
619
+ struct iw_freq *fwrq,
622620 char *extra
623621 )
624622 {
625
- struct iw_freq *fwrq = &wrqu->freq;
626623 int error, chan;
627624 uint sf = 0;
628625 struct dhd_pub *dhd = dhd_get_pub(dev);
....@@ -671,24 +668,18 @@
671668 wl_iw_get_freq(
672669 struct net_device *dev,
673670 struct iw_request_info *info,
674
- union iwreq_data *wrqu,
671
+ struct iw_freq *fwrq,
675672 char *extra
676673 )
677674 {
678
- struct dhd_pub *dhd = dhd_get_pub(dev);
679
- struct iw_freq *fwrq = &wrqu->freq;
680675 int error;
681
- u32 val;
682
- chanspec_t chanspec = 0;
676
+ u32 chanspec = 0;
683677 int ctl_chan;
684678
685679 WL_TRACE(("%s: SIOCGIWFREQ\n", dev->name));
686680
687
- DHD_CHECK(dhd, dev);
688
- if ((error = dev_wlc_intvar_get(dev, "chanspec", &val)))
681
+ if ((error = dev_wlc_intvar_get(dev, "chanspec", &chanspec)))
689682 return error;
690
- chanspec = val;
691
- chanspec = wl_ext_chspec_driver_to_host(dhd, chanspec);
692683 ctl_chan = wf_chspec_ctlchan(chanspec);
693684
694685 /* Return radio channel in channel form */
....@@ -701,7 +692,7 @@
701692 wl_iw_set_mode(
702693 struct net_device *dev,
703694 struct iw_request_info *info,
704
- union iwreq_data *wrqu,
695
+ __u32 *uwrq,
705696 char *extra
706697 )
707698 {
....@@ -718,7 +709,7 @@
718709 wext_info->conn_info.channel = 0;
719710 }
720711
721
- switch (wrqu->mode) {
712
+ switch (*uwrq) {
722713 case IW_MODE_MASTER:
723714 infra = ap = 1;
724715 break;
....@@ -746,7 +737,7 @@
746737 wl_iw_get_mode(
747738 struct net_device *dev,
748739 struct iw_request_info *info,
749
- union iwreq_data *wrqu,
740
+ __u32 *uwrq,
750741 char *extra
751742 )
752743 {
....@@ -760,7 +751,7 @@
760751
761752 infra = dtoh32(infra);
762753 ap = dtoh32(ap);
763
- wrqu->mode = infra ? ap ? IW_MODE_MASTER : IW_MODE_INFRA : IW_MODE_ADHOC;
754
+ *uwrq = infra ? ap ? IW_MODE_MASTER : IW_MODE_INFRA : IW_MODE_ADHOC;
764755
765756 return 0;
766757 }
....@@ -769,11 +760,10 @@
769760 wl_iw_get_range(
770761 struct net_device *dev,
771762 struct iw_request_info *info,
772
- union iwreq_data *wrqu,
763
+ struct iw_point *dwrq,
773764 char *extra
774765 )
775766 {
776
- struct iw_point *dwrq = (struct iw_point *)wrqu;
777767 struct iw_range *range = (struct iw_range *) extra;
778768 static int channels[MAXCHANNEL+1];
779769 wl_uint32_list_t *list = (wl_uint32_list_t *) channels;
....@@ -1002,11 +992,10 @@
1002992 wl_iw_set_spy(
1003993 struct net_device *dev,
1004994 struct iw_request_info *info,
1005
- union iwreq_data *wrqu,
995
+ struct iw_point *dwrq,
1006996 char *extra
1007997 )
1008998 {
1009
- struct iw_point *dwrq = (struct iw_point *)wrqu;
1010999 wl_iw_t *iw = IW_DEV_IF(dev);
10111000 struct sockaddr *addr = (struct sockaddr *) extra;
10121001 int i;
....@@ -1028,11 +1017,10 @@
10281017 wl_iw_get_spy(
10291018 struct net_device *dev,
10301019 struct iw_request_info *info,
1031
- union iwreq_data *wrqu,
1020
+ struct iw_point *dwrq,
10321021 char *extra
10331022 )
10341023 {
1035
- struct iw_point *dwrq = (struct iw_point *)wrqu;
10361024 wl_iw_t *iw = IW_DEV_IF(dev);
10371025 struct sockaddr *addr = (struct sockaddr *) extra;
10381026 struct iw_quality *qual = (struct iw_quality *) &addr[iw->spy_num];
....@@ -1058,7 +1046,7 @@
10581046 wl_iw_set_wap(
10591047 struct net_device *dev,
10601048 struct iw_request_info *info,
1061
- union iwreq_data *wrqu,
1049
+ struct sockaddr *awrq,
10621050 char *extra
10631051 )
10641052 {
....@@ -1069,13 +1057,13 @@
10691057 WL_TRACE(("%s: SIOCSIWAP\n", dev->name));
10701058 DHD_CHECK(dhd, dev);
10711059 wext_info = dhd->wext_info;
1072
- if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) {
1060
+ if (awrq->sa_family != ARPHRD_ETHER) {
10731061 WL_ERROR(("Invalid Header...sa_family\n"));
10741062 return -EINVAL;
10751063 }
10761064
10771065 /* Ignore "auto" or "off" */
1078
- if (ETHER_ISBCAST(wrqu->ap_addr.sa_data) || ETHER_ISNULLADDR(wrqu->ap_addr.sa_data)) {
1066
+ if (ETHER_ISBCAST(awrq->sa_data) || ETHER_ISNULLADDR(awrq->sa_data)) {
10791067 scb_val_t scbval;
10801068 bzero(&scbval, sizeof(scb_val_t));
10811069 WL_MSG(dev->name, "WLC_DISASSOC\n");
....@@ -1088,21 +1076,21 @@
10881076 #endif
10891077 return 0;
10901078 }
1091
- /* WL_ASSOC(("Assoc to %s\n", bcm_ether_ntoa((struct ether_addr *)&(wrqu->ap_addr.sa_data),
1079
+ /* WL_ASSOC(("Assoc to %s\n", bcm_ether_ntoa((struct ether_addr *)&(awrq->sa_data),
10921080 * eabuf)));
10931081 */
10941082 /* Reassociate to the specified AP */
10951083 if (wext_info)
1096
- memcpy(&wext_info->conn_info.bssid, wrqu->ap_addr.sa_data, ETHER_ADDR_LEN);
1084
+ memcpy(&wext_info->conn_info.bssid, awrq->sa_data, ETHER_ADDR_LEN);
10971085 if (wext_info && wext_info->conn_info.ssid.SSID_len) {
10981086 if ((error = wl_ext_connect(dev, &wext_info->conn_info)))
10991087 return error;
11001088 } else {
1101
- if ((error = dev_wlc_ioctl(dev, WLC_REASSOC, wrqu->ap_addr.sa_data, ETHER_ADDR_LEN))) {
1089
+ if ((error = dev_wlc_ioctl(dev, WLC_REASSOC, awrq->sa_data, ETHER_ADDR_LEN))) {
11021090 WL_ERROR(("WLC_REASSOC failed (%d).\n", error));
11031091 return error;
11041092 }
1105
- WL_MSG(dev->name, "join BSSID="MACSTR"\n", MAC2STR((u8 *)wrqu->ap_addr.sa_data));
1093
+ WL_MSG(dev->name, "join BSSID="MACSTR"\n", MAC2STR((u8 *)awrq->sa_data));
11061094 }
11071095 #ifdef WL_EXT_IAPSTA
11081096 wl_ext_in4way_sync_wext(dev, STA_NO_BTC_IN4WAY, WL_EXT_STATUS_CONNECTING, NULL);
....@@ -1115,17 +1103,17 @@
11151103 wl_iw_get_wap(
11161104 struct net_device *dev,
11171105 struct iw_request_info *info,
1118
- union iwreq_data *wrqu,
1106
+ struct sockaddr *awrq,
11191107 char *extra
11201108 )
11211109 {
11221110 WL_TRACE(("%s: SIOCGIWAP\n", dev->name));
11231111
1124
- wrqu->ap_addr.sa_family = ARPHRD_ETHER;
1125
- memset(wrqu->ap_addr.sa_data, 0, ETHER_ADDR_LEN);
1112
+ awrq->sa_family = ARPHRD_ETHER;
1113
+ memset(awrq->sa_data, 0, ETHER_ADDR_LEN);
11261114
11271115 /* Ignore error (may be down or disassociated) */
1128
- (void) dev_wlc_ioctl(dev, WLC_GET_BSSID, wrqu->ap_addr.sa_data, ETHER_ADDR_LEN);
1116
+ (void) dev_wlc_ioctl(dev, WLC_GET_BSSID, awrq->sa_data, ETHER_ADDR_LEN);
11291117
11301118 return 0;
11311119 }
....@@ -1135,7 +1123,7 @@
11351123 wl_iw_mlme(
11361124 struct net_device *dev,
11371125 struct iw_request_info *info,
1138
- union iwreq_data *wrqu,
1126
+ struct sockaddr *awrq,
11391127 char *extra
11401128 )
11411129 {
....@@ -1183,15 +1171,14 @@
11831171 wl_iw_get_aplist(
11841172 struct net_device *dev,
11851173 struct iw_request_info *info,
1186
- union iwreq_data *wrqu,
1174
+ struct iw_point *dwrq,
11871175 char *extra
11881176 )
11891177 {
1190
- struct iw_point *dwrq = (struct iw_point *)wrqu;
1191
- wl_scan_results_v109_t *list;
1178
+ wl_scan_results_t *list;
11921179 struct sockaddr *addr = (struct sockaddr *) extra;
11931180 struct iw_quality qual[IW_MAX_AP];
1194
- wl_bss_info_v109_t *bi = NULL;
1181
+ wl_bss_info_t *bi = NULL;
11951182 int error, i;
11961183 uint buflen = dwrq->length;
11971184 int16 rssi;
....@@ -1218,7 +1205,7 @@
12181205 ASSERT(list->version == WL_BSS_INFO_VERSION);
12191206
12201207 for (i = 0, dwrq->length = 0; i < list->count && dwrq->length < IW_MAX_AP; i++) {
1221
- bi = bi ? (wl_bss_info_v109_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
1208
+ bi = bi ? (wl_bss_info_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
12221209 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
12231210 buflen));
12241211
....@@ -1260,18 +1247,17 @@
12601247 wl_iw_iscan_get_aplist(
12611248 struct net_device *dev,
12621249 struct iw_request_info *info,
1263
- union iwreq_data *wrqu,
1250
+ struct iw_point *dwrq,
12641251 char *extra
12651252 )
12661253 {
1267
- struct iw_point *dwrq = (struct iw_point *)wrqu;
1268
- wl_scan_results_v109_t *list;
1254
+ wl_scan_results_t *list;
12691255 iscan_buf_t * buf;
12701256 iscan_info_t *iscan;
12711257
12721258 struct sockaddr *addr = (struct sockaddr *) extra;
12731259 struct iw_quality qual[IW_MAX_AP];
1274
- wl_bss_info_v109_t *bi = NULL;
1260
+ wl_bss_info_t *bi = NULL;
12751261 int i;
12761262 int16 rssi;
12771263 struct dhd_pub *dhd = dhd_get_pub(dev);
....@@ -1297,7 +1283,7 @@
12971283
12981284 bi = NULL;
12991285 for (i = 0, dwrq->length = 0; i < list->count && dwrq->length < IW_MAX_AP; i++) {
1300
- bi = bi ? (wl_bss_info_v109_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
1286
+ bi = bi ? (wl_bss_info_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
13011287 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
13021288 WLC_IW_ISCAN_MAXLEN));
13031289
....@@ -1379,12 +1365,11 @@
13791365 )
13801366 {
13811367 struct dhd_pub *dhd = dhd_get_pub(dev);
1368
+ wl_wext_info_t *wext_info = NULL;
13821369 wlc_ssid_t ssid;
13831370 #ifdef WL_ESCAN
1384
- wl_scan_info_t *scan_info = NULL;
1385
- int err;
1371
+ wl_scan_info_t scan_info;
13861372 #else
1387
- wl_wext_info_t *wext_info = NULL;
13881373 iscan_info_t *iscan;
13891374 #ifdef WL_EXT_IAPSTA
13901375 int err;
....@@ -1392,6 +1377,7 @@
13921377 #endif
13931378
13941379 DHD_CHECK(dhd, dev);
1380
+ wext_info = dhd->wext_info;
13951381 #ifdef WL_ESCAN
13961382 /* default Broadcast scan */
13971383 memset(&ssid, 0, sizeof(ssid));
....@@ -1406,20 +1392,12 @@
14061392 }
14071393 }
14081394 #endif
1409
- scan_info = kmalloc(sizeof(wl_scan_info_t), GFP_KERNEL);
1410
- if (scan_info == NULL) {
1411
- WL_ERROR(("kzalloc failed\n"));
1412
- return -ENOMEM;
1413
- }
1414
- memset(scan_info, 0, sizeof(wl_scan_info_t));
1415
- scan_info->bcast_ssid = TRUE;
1416
- memcpy(scan_info->ssid.SSID, ssid.SSID, ssid.SSID_len);
1417
- scan_info->ssid.SSID_len = ssid.SSID_len;
1418
- err = wl_escan_set_scan(dev, scan_info);
1419
- kfree(scan_info);
1420
- return err;
1395
+ memset(&scan_info, 0, sizeof(wl_scan_info_t));
1396
+ scan_info.bcast_ssid = TRUE;
1397
+ memcpy(scan_info.ssid.SSID, ssid.SSID, ssid.SSID_len);
1398
+ scan_info.ssid.SSID_len = ssid.SSID_len;
1399
+ return wl_escan_set_scan(dev, &scan_info);
14211400 #else
1422
- wext_info = dhd->wext_info;
14231401 iscan = &wext_info->iscan;
14241402 WL_TRACE(("%s: SIOCSIWSCAN iscan=%p\n", dev->name, iscan));
14251403 #ifdef WL_EXT_IAPSTA
....@@ -1554,7 +1532,7 @@
15541532 #endif
15551533 int
15561534 wl_iw_handle_scanresults_ies(char **event_p, char *end,
1557
- struct iw_request_info *info, wl_bss_info_v109_t *bi)
1535
+ struct iw_request_info *info, wl_bss_info_t *bi)
15581536 {
15591537 #if WIRELESS_EXT > 17
15601538 struct iw_event iwe;
....@@ -1618,7 +1596,7 @@
16181596 }
16191597
16201598 #ifdef BCMWAPI_WPI
1621
- ptr = ((uint8 *)bi) + sizeof(wl_bss_info_v109_t);
1599
+ ptr = ((uint8 *)bi) + sizeof(wl_bss_info_t);
16221600 ptr_len = bi->ie_length;
16231601
16241602 while ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_WAPI_ID))) {
....@@ -1661,15 +1639,14 @@
16611639 wl_iw_get_scan(
16621640 struct net_device *dev,
16631641 struct iw_request_info *info,
1664
- union iwreq_data *wrqu,
1642
+ struct iw_point *dwrq,
16651643 char *extra
16661644 )
16671645 {
1668
- struct iw_point *dwrq = (struct iw_point *)wrqu;
16691646 channel_info_t ci;
1670
- wl_scan_results_v109_t *list;
1647
+ wl_scan_results_t *list;
16711648 struct iw_event iwe;
1672
- wl_bss_info_v109_t *bi = NULL;
1649
+ wl_bss_info_t *bi = NULL;
16731650 int error, i, j;
16741651 char *event = extra, *end = extra + dwrq->length, *value;
16751652 uint buflen = dwrq->length;
....@@ -1705,7 +1682,7 @@
17051682 ASSERT(list->version == WL_BSS_INFO_VERSION);
17061683
17071684 for (i = 0; i < list->count && i < IW_MAX_AP; i++) {
1708
- bi = bi ? (wl_bss_info_v109_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
1685
+ bi = bi ? (wl_bss_info_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
17091686 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
17101687 buflen));
17111688
....@@ -1792,17 +1769,16 @@
17921769 wl_iw_iscan_get_scan(
17931770 struct net_device *dev,
17941771 struct iw_request_info *info,
1795
- union iwreq_data *wrqu,
1772
+ struct iw_point *dwrq,
17961773 char *extra
17971774 )
17981775 {
1799
- struct iw_point *dwrq = (struct iw_point *)wrqu;
18001776 struct dhd_pub *dhd = dhd_get_pub(dev);
1801
-#ifndef WL_ESCAN
18021777 wl_wext_info_t *wext_info = NULL;
1803
- wl_scan_results_v109_t *list;
1778
+#ifndef WL_ESCAN
1779
+ wl_scan_results_t *list;
18041780 struct iw_event iwe;
1805
- wl_bss_info_v109_t *bi = NULL;
1781
+ wl_bss_info_t *bi = NULL;
18061782 int ii, j;
18071783 int apcnt;
18081784 char *event = extra, *end = extra + dwrq->length, *value;
....@@ -1813,6 +1789,7 @@
18131789 #endif
18141790
18151791 DHD_CHECK(dhd, dev);
1792
+ wext_info = dhd->wext_info;
18161793 #ifdef WL_ESCAN
18171794 return wl_escan_get_scan(dev, info, dwrq, extra);
18181795 #else
....@@ -1821,7 +1798,6 @@
18211798 if (!extra)
18221799 return -EINVAL;
18231800
1824
- wext_info = dhd->wext_info;
18251801 /* use backup if our thread is not successful */
18261802 iscan = &wext_info->iscan;
18271803 if ((!iscan) || (iscan->sysioc_pid < 0)) {
....@@ -1846,7 +1822,7 @@
18461822
18471823 bi = NULL;
18481824 for (ii = 0; ii < list->count && apcnt < IW_MAX_AP; apcnt++, ii++) {
1849
- bi = bi ? (wl_bss_info_v109_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
1825
+ bi = bi ? (wl_bss_info_t *)((uintptr)bi + dtoh32(bi->length)) : list->bss_info;
18501826 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
18511827 WLC_IW_ISCAN_MAXLEN));
18521828
....@@ -1943,11 +1919,10 @@
19431919 wl_iw_set_essid(
19441920 struct net_device *dev,
19451921 struct iw_request_info *info,
1946
- union iwreq_data *wrqu,
1922
+ struct iw_point *dwrq,
19471923 char *extra
19481924 )
19491925 {
1950
- struct iw_point *dwrq = (struct iw_point *)wrqu;
19511926 wlc_ssid_t ssid;
19521927 int error;
19531928 struct dhd_pub *dhd = dhd_get_pub(dev);
....@@ -2007,11 +1982,10 @@
20071982 wl_iw_get_essid(
20081983 struct net_device *dev,
20091984 struct iw_request_info *info,
2010
- union iwreq_data *wrqu,
1985
+ struct iw_point *dwrq,
20111986 char *extra
20121987 )
20131988 {
2014
- struct iw_point *dwrq = (struct iw_point *)wrqu;
20151989 wlc_ssid_t ssid;
20161990 int error;
20171991
....@@ -2030,14 +2004,13 @@
20302004 /* Max SSID length check */
20312005 if (ssid.SSID_len > IW_ESSID_MAX_SIZE) {
20322006 ssid.SSID_len = IW_ESSID_MAX_SIZE;
2033
- /* Get the current SSID */
2034
- memcpy(extra, ssid.SSID, ssid.SSID_len);
2035
- /* NULL terminating as length of extra buffer is IW_ESSID_MAX_SIZE ie 32 */
2036
- extra[IW_ESSID_MAX_SIZE-1] = '\0';
2037
- } else {
2038
- /* Get the current SSID */
2039
- memcpy(extra, ssid.SSID, ssid.SSID_len);
20402007 }
2008
+
2009
+ /* Get the current SSID */
2010
+ memcpy(extra, ssid.SSID, ssid.SSID_len);
2011
+
2012
+ /* NULL terminating as length of extra buffer is IW_ESSID_MAX_SIZE ie 32 */
2013
+ extra[IW_ESSID_MAX_SIZE] = '\0';
20412014
20422015 dwrq->length = ssid.SSID_len;
20432016
....@@ -2050,11 +2023,10 @@
20502023 wl_iw_set_nick(
20512024 struct net_device *dev,
20522025 struct iw_request_info *info,
2053
- union iwreq_data *wrqu,
2026
+ struct iw_point *dwrq,
20542027 char *extra
20552028 )
20562029 {
2057
- struct iw_point *dwrq = (struct iw_point *)wrqu;
20582030 wl_iw_t *iw = IW_DEV_IF(dev);
20592031 WL_TRACE(("%s: SIOCSIWNICKN\n", dev->name));
20602032
....@@ -2075,11 +2047,10 @@
20752047 wl_iw_get_nick(
20762048 struct net_device *dev,
20772049 struct iw_request_info *info,
2078
- union iwreq_data *wrqu,
2050
+ struct iw_point *dwrq,
20792051 char *extra
20802052 )
20812053 {
2082
- struct iw_point *dwrq = (struct iw_point *)wrqu;
20832054 wl_iw_t *iw = IW_DEV_IF(dev);
20842055 WL_TRACE(("%s: SIOCGIWNICKN\n", dev->name));
20852056
....@@ -2095,11 +2066,10 @@
20952066 static int wl_iw_set_rate(
20962067 struct net_device *dev,
20972068 struct iw_request_info *info,
2098
- union iwreq_data *wrqu,
2069
+ struct iw_param *vwrq,
20992070 char *extra
21002071 )
21012072 {
2102
- struct iw_param *vwrq = &wrqu->bitrate;
21032073 wl_rateset_t rateset;
21042074 int error, rate, i, error_bg, error_a;
21052075
....@@ -2162,11 +2132,10 @@
21622132 static int wl_iw_get_rate(
21632133 struct net_device *dev,
21642134 struct iw_request_info *info,
2165
- union iwreq_data *wrqu,
2135
+ struct iw_param *vwrq,
21662136 char *extra
21672137 )
21682138 {
2169
- struct iw_param *vwrq = &wrqu->bitrate;
21702139 int error, rate;
21712140
21722141 WL_TRACE(("%s: SIOCGIWRATE\n", dev->name));
....@@ -2184,11 +2153,10 @@
21842153 wl_iw_set_rts(
21852154 struct net_device *dev,
21862155 struct iw_request_info *info,
2187
- union iwreq_data *wrqu,
2156
+ struct iw_param *vwrq,
21882157 char *extra
21892158 )
21902159 {
2191
- struct iw_param *vwrq = &wrqu->rts;
21922160 int error, rts;
21932161
21942162 WL_TRACE(("%s: SIOCSIWRTS\n", dev->name));
....@@ -2210,11 +2178,10 @@
22102178 wl_iw_get_rts(
22112179 struct net_device *dev,
22122180 struct iw_request_info *info,
2213
- union iwreq_data *wrqu,
2181
+ struct iw_param *vwrq,
22142182 char *extra
22152183 )
22162184 {
2217
- struct iw_param *vwrq = &wrqu->rts;
22182185 int error, rts;
22192186
22202187 WL_TRACE(("%s: SIOCGIWRTS\n", dev->name));
....@@ -2233,11 +2200,10 @@
22332200 wl_iw_set_frag(
22342201 struct net_device *dev,
22352202 struct iw_request_info *info,
2236
- union iwreq_data *wrqu,
2203
+ struct iw_param *vwrq,
22372204 char *extra
22382205 )
22392206 {
2240
- struct iw_param *vwrq = &wrqu->frag;
22412207 int error, frag;
22422208
22432209 WL_TRACE(("%s: SIOCSIWFRAG\n", dev->name));
....@@ -2259,11 +2225,10 @@
22592225 wl_iw_get_frag(
22602226 struct net_device *dev,
22612227 struct iw_request_info *info,
2262
- union iwreq_data *wrqu,
2228
+ struct iw_param *vwrq,
22632229 char *extra
22642230 )
22652231 {
2266
- struct iw_param *vwrq = &wrqu->frag;
22672232 int error, fragthreshold;
22682233
22692234 WL_TRACE(("%s: SIOCGIWFRAG\n", dev->name));
....@@ -2282,11 +2247,10 @@
22822247 wl_iw_set_txpow(
22832248 struct net_device *dev,
22842249 struct iw_request_info *info,
2285
- union iwreq_data *wrqu,
2250
+ struct iw_param *vwrq,
22862251 char *extra
22872252 )
22882253 {
2289
- struct iw_param *vwrq = &wrqu->txpower;
22902254 int error, disable;
22912255 uint16 txpwrmw;
22922256 WL_TRACE(("%s: SIOCSIWTXPOW\n", dev->name));
....@@ -2323,11 +2287,10 @@
23232287 wl_iw_get_txpow(
23242288 struct net_device *dev,
23252289 struct iw_request_info *info,
2326
- union iwreq_data *wrqu,
2290
+ struct iw_param *vwrq,
23272291 char *extra
23282292 )
23292293 {
2330
- struct iw_param *vwrq = &wrqu->txpower;
23312294 int error, disable, txpwrdbm;
23322295 uint8 result;
23332296
....@@ -2352,11 +2315,10 @@
23522315 wl_iw_set_retry(
23532316 struct net_device *dev,
23542317 struct iw_request_info *info,
2355
- union iwreq_data *wrqu,
2318
+ struct iw_param *vwrq,
23562319 char *extra
23572320 )
23582321 {
2359
- struct iw_param *vwrq = &wrqu->retry;
23602322 int error, lrl, srl;
23612323
23622324 WL_TRACE(("%s: SIOCSIWRETRY\n", dev->name));
....@@ -2400,11 +2362,10 @@
24002362 wl_iw_get_retry(
24012363 struct net_device *dev,
24022364 struct iw_request_info *info,
2403
- union iwreq_data *wrqu,
2365
+ struct iw_param *vwrq,
24042366 char *extra
24052367 )
24062368 {
2407
- struct iw_param *vwrq = &wrqu->retry;
24082369 int error, lrl, srl;
24092370
24102371 WL_TRACE(("%s: SIOCGIWRETRY\n", dev->name));
....@@ -2442,11 +2403,10 @@
24422403 wl_iw_set_encode(
24432404 struct net_device *dev,
24442405 struct iw_request_info *info,
2445
- union iwreq_data *wrqu,
2406
+ struct iw_point *dwrq,
24462407 char *extra
24472408 )
24482409 {
2449
- struct iw_point *dwrq = (struct iw_point *)wrqu;
24502410 wl_wsec_key_t key;
24512411 int error, val, wsec;
24522412
....@@ -2532,11 +2492,10 @@
25322492 wl_iw_get_encode(
25332493 struct net_device *dev,
25342494 struct iw_request_info *info,
2535
- union iwreq_data *wrqu,
2495
+ struct iw_point *dwrq,
25362496 char *extra
25372497 )
25382498 {
2539
- struct iw_point *dwrq = (struct iw_point *)wrqu;
25402499 wl_wsec_key_t key;
25412500 int error, val, wsec, auth;
25422501
....@@ -2596,11 +2555,10 @@
25962555 wl_iw_set_power(
25972556 struct net_device *dev,
25982557 struct iw_request_info *info,
2599
- union iwreq_data *wrqu,
2558
+ struct iw_param *vwrq,
26002559 char *extra
26012560 )
26022561 {
2603
- struct iw_param *vwrq = &wrqu->power;
26042562 int error, pm;
26052563
26062564 WL_TRACE(("%s: SIOCSIWPOWER\n", dev->name));
....@@ -2618,11 +2576,10 @@
26182576 wl_iw_get_power(
26192577 struct net_device *dev,
26202578 struct iw_request_info *info,
2621
- union iwreq_data *wrqu,
2579
+ struct iw_param *vwrq,
26222580 char *extra
26232581 )
26242582 {
2625
- struct iw_param *vwrq = &wrqu->power;
26262583 int error, pm;
26272584
26282585 WL_TRACE(("%s: SIOCGIWPOWER\n", dev->name));
....@@ -2642,11 +2599,10 @@
26422599 wl_iw_set_wpaie(
26432600 struct net_device *dev,
26442601 struct iw_request_info *info,
2645
- union iwreq_data *wrqu,
2602
+ struct iw_point *iwp,
26462603 char *extra
26472604 )
26482605 {
2649
- struct iw_point *iwp = (struct iw_point *)wrqu;
26502606 #if defined(BCMWAPI_WPI)
26512607 uchar buf[WLC_IOCTL_SMLEN] = {0};
26522608 uchar *p = buf;
....@@ -2671,11 +2627,10 @@
26712627 wl_iw_get_wpaie(
26722628 struct net_device *dev,
26732629 struct iw_request_info *info,
2674
- union iwreq_data *wrqu,
2630
+ struct iw_point *iwp,
26752631 char *extra
26762632 )
26772633 {
2678
- struct iw_point *iwp = (struct iw_point *)wrqu;
26792634 WL_TRACE(("%s: SIOCGIWGENIE\n", dev->name));
26802635 iwp->length = 64;
26812636 dev_wlc_bufvar_get(dev, "wpaie", extra, iwp->length);
....@@ -2686,11 +2641,10 @@
26862641 wl_iw_set_encodeext(
26872642 struct net_device *dev,
26882643 struct iw_request_info *info,
2689
- union iwreq_data *wrqu,
2644
+ struct iw_point *dwrq,
26902645 char *extra
26912646 )
26922647 {
2693
- struct iw_point *dwrq = (struct iw_point *)wrqu;
26942648 wl_wsec_key_t key;
26952649 int error;
26962650 struct iw_encode_ext *iwe;
....@@ -2839,7 +2793,7 @@
28392793 wl_iw_set_pmksa(
28402794 struct net_device *dev,
28412795 struct iw_request_info *info,
2842
- union iwreq_data *wrqu,
2796
+ struct iw_param *vwrq,
28432797 char *extra
28442798 )
28452799 {
....@@ -2847,7 +2801,7 @@
28472801 struct iw_pmksa *iwpmksa;
28482802 uint i;
28492803 char eabuf[ETHER_ADDR_STR_LEN];
2850
- pmkid_v1_t *pmkid_array = NULL;
2804
+ pmkid_t *pmkid_array = NULL;
28512805 struct dhd_pub *dhd = dhd_get_pub(dev);
28522806 wl_wext_info_t *wext_info = NULL;
28532807
....@@ -2864,7 +2818,7 @@
28642818 bzero((char *)pmk_list, sizeof(struct pmk_list));
28652819 }
28662820 if (iwpmksa->cmd == IW_PMKSA_REMOVE) {
2867
- pmkid_list_v1_t pmkid, *pmkidptr;
2821
+ pmkid_list_t pmkid, *pmkidptr;
28682822 pmkidptr = &pmkid;
28692823 bcopy(&iwpmksa->bssid.sa_data[0], &pmkidptr->pmkid[0].BSSID, ETHER_ADDR_LEN);
28702824 bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID, WPA2_PMKID_LEN);
....@@ -2929,7 +2883,7 @@
29292883 wl_iw_get_encodeext(
29302884 struct net_device *dev,
29312885 struct iw_request_info *info,
2932
- union iwreq_data *wrqu,
2886
+ struct iw_param *vwrq,
29332887 char *extra
29342888 )
29352889 {
....@@ -2941,11 +2895,10 @@
29412895 wl_iw_set_wpaauth(
29422896 struct net_device *dev,
29432897 struct iw_request_info *info,
2944
- union iwreq_data *wrqu,
2898
+ struct iw_param *vwrq,
29452899 char *extra
29462900 )
29472901 {
2948
- struct iw_param *vwrq = &wrqu->param;
29492902 int error = 0;
29502903 int paramid;
29512904 int paramval;
....@@ -3200,11 +3153,10 @@
32003153 wl_iw_get_wpaauth(
32013154 struct net_device *dev,
32023155 struct iw_request_info *info,
3203
- union iwreq_data *wrqu,
3156
+ struct iw_param *vwrq,
32043157 char *extra
32053158 )
32063159 {
3207
- struct iw_param *vwrq = &wrqu->param;
32083160 int error;
32093161 int paramid;
32103162 int paramval = 0;
....@@ -3371,7 +3323,6 @@
33713323 };
33723324
33733325 #if WIRELESS_EXT > 12
3374
-#ifdef CONFIG_WEXT_PRIV
33753326 enum {
33763327 WL_IW_SET_LEDDC = SIOCIWFIRSTPRIV,
33773328 WL_IW_SET_VLANMODE,
....@@ -3407,18 +3358,15 @@
34073358 },
34083359 { 0, 0, 0, { 0 } }
34093360 };
3410
-#endif /* CONFIG_WEXT_PRIV */
34113361
34123362 const struct iw_handler_def wl_iw_handler_def =
34133363 {
34143364 .num_standard = ARRAYSIZE(wl_iw_handler),
3415
- .standard = (const iw_handler *) wl_iw_handler,
3416
-#ifdef CONFIG_WEXT_PRIV
34173365 .num_private = ARRAY_SIZE(wl_iw_priv_handler),
34183366 .num_private_args = ARRAY_SIZE(wl_iw_priv_args),
3367
+ .standard = (const iw_handler *) wl_iw_handler,
34193368 .private = wl_iw_priv_handler,
34203369 .private_args = wl_iw_priv_args,
3421
-#endif /* CONFIG_WEXT_PRIV */
34223370 #if WIRELESS_EXT >= 19
34233371 get_wireless_stats: dhd_get_wireless_stats,
34243372 #endif /* WIRELESS_EXT >= 19 */
....@@ -3903,12 +3851,10 @@
39033851 int rssi;
39043852 scb_val_t scb_val;
39053853 #if WIRELESS_EXT > 11
3906
-#ifdef WL_NAN
39073854 char *cntbuf = NULL;
39083855 wl_cnt_info_t *cntinfo;
39093856 uint16 ver;
39103857 uint32 corerev = 0;
3911
-#endif
39123858 #endif /* WIRELESS_EXT > 11 */
39133859
39143860 phy_noise = 0;
....@@ -3952,7 +3898,6 @@
39523898 #endif /* WIRELESS_EXT > 18 */
39533899
39543900 #if WIRELESS_EXT > 11
3955
-#ifdef WL_NAN
39563901 WL_TRACE(("wl_iw_get_wireless_stats counters\n *****"));
39573902
39583903 cntbuf = kmalloc(MAX_WLIW_IOCTL_LEN, GFP_KERNEL);
....@@ -3973,10 +3918,12 @@
39733918 cntinfo->version = dtoh16(cntinfo->version);
39743919 cntinfo->datalen = dtoh16(cntinfo->datalen);
39753920 ver = cntinfo->version;
3921
+#ifdef WL_NAN
39763922 CHK_CNTBUF_DATALEN(cntbuf, MAX_WLIW_IOCTL_LEN);
3977
- if (ver > WL_CNT_VERSION_XTLV) {
3923
+#endif
3924
+ if (ver > WL_CNT_T_VERSION) {
39783925 WL_TRACE(("\tIncorrect version of counters struct: expected %d; got %d\n",
3979
- WL_CNT_VERSION_XTLV, ver));
3926
+ WL_CNT_T_VERSION, ver));
39803927 res = BCME_VERSION;
39813928 goto done;
39823929 }
....@@ -3992,6 +3939,7 @@
39923939 corerev = dtoh32(revinfo.corerev);
39933940 }
39943941
3942
+#ifdef WL_NAN
39953943 res = wl_cntbuf_to_xtlv_format(NULL, cntinfo, MAX_WLIW_IOCTL_LEN, corerev);
39963944 if (res) {
39973945 WL_ERROR(("wl_cntbuf_to_xtlv_format failed %d\n", res));
....@@ -4007,11 +3955,9 @@
40073955
40083956 done:
40093957 #if WIRELESS_EXT > 11
4010
-#ifdef WL_NAN
40113958 if (cntbuf) {
40123959 kfree(cntbuf);
40133960 }
4014
-#endif
40153961 #endif /* WIRELESS_EXT > 11 */
40163962 return res;
40173963 }
....@@ -4043,7 +3989,7 @@
40433989 }
40443990
40453991 static int
4046
-wl_iw_iscan_prep(wl_scan_params_v1_t *params, wlc_ssid_t *ssid)
3992
+wl_iw_iscan_prep(wl_scan_params_t *params, wlc_ssid_t *ssid)
40473993 {
40483994 int err = 0;
40493995
....@@ -4069,14 +4015,14 @@
40694015 static int
40704016 wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, uint16 action)
40714017 {
4072
- int params_size = (WL_SCAN_PARAMS_V1_FIXED_SIZE + OFFSETOF(wl_iscan_params_v1_t, params));
4073
- wl_iscan_params_v1_t *params;
4018
+ int params_size = (WL_SCAN_PARAMS_FIXED_SIZE + OFFSETOF(wl_iscan_params_t, params));
4019
+ wl_iscan_params_t *params;
40744020 int err = 0;
40754021
40764022 if (ssid && ssid->SSID_len) {
40774023 params_size += sizeof(wlc_ssid_t);
40784024 }
4079
- params = (wl_iscan_params_v1_t*)kmalloc(params_size, GFP_KERNEL);
4025
+ params = (wl_iscan_params_t*)kmalloc(params_size, GFP_KERNEL);
40804026 if (params == NULL) {
40814027 return -ENOMEM;
40824028 }
....@@ -4090,7 +4036,7 @@
40904036 params->action = htod16(action);
40914037 params->scan_duration = htod16(0);
40924038
4093
- /* params_size += OFFSETOF(wl_iscan_params_v1_t, params); */
4039
+ /* params_size += OFFSETOF(wl_iscan_params_t, params); */
40944040 (void) dev_iw_iovar_setbuf(iscan->dev, "iscan", params, params_size,
40954041 iscan->ioctlbuf, WLC_IOCTL_SMLEN);
40964042 }
....@@ -4106,7 +4052,7 @@
41064052 iscan_buf_t * ptr;
41074053 wl_iscan_results_t * list_buf;
41084054 wl_iscan_results_t list;
4109
- wl_scan_results_v109_t *results;
4055
+ wl_scan_results_t *results;
41104056 uint32 status;
41114057
41124058 /* buffers are allocated on demand */
....@@ -4331,12 +4277,14 @@
43314277 wl_iw_autochannel(struct net_device *dev, char* command, int total_len)
43324278 {
43334279 struct dhd_pub *dhd = dhd_get_pub(dev);
4280
+ wl_wext_info_t *wext_info = NULL;
43344281 int ret = 0;
43354282 #ifdef WL_ESCAN
43364283 int bytes_written = -1;
43374284 #endif
43384285
43394286 DHD_CHECK(dhd, dev);
4287
+ wext_info = dhd->wext_info;
43404288 #ifdef WL_ESCAN
43414289 sscanf(command, "%*s %d", &dhd->escan->autochannel);
43424290 if (dhd->escan->autochannel == 0) {