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,22 +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
- chanspec_t chanspec = 0;
676
+ u32 chanspec = 0;
682677 int ctl_chan;
683678
684679 WL_TRACE(("%s: SIOCGIWFREQ\n", dev->name));
685680
686
- DHD_CHECK(dhd, dev);
687
- if ((error = dev_wlc_intvar_get(dev, "chanspec", (s32 *)&chanspec)))
681
+ if ((error = dev_wlc_intvar_get(dev, "chanspec", &chanspec)))
688682 return error;
689
- chanspec = wl_ext_chspec_driver_to_host(dhd, chanspec);
690683 ctl_chan = wf_chspec_ctlchan(chanspec);
691684
692685 /* Return radio channel in channel form */
....@@ -699,7 +692,7 @@
699692 wl_iw_set_mode(
700693 struct net_device *dev,
701694 struct iw_request_info *info,
702
- union iwreq_data *wrqu,
695
+ __u32 *uwrq,
703696 char *extra
704697 )
705698 {
....@@ -716,7 +709,7 @@
716709 wext_info->conn_info.channel = 0;
717710 }
718711
719
- switch (wrqu->mode) {
712
+ switch (*uwrq) {
720713 case IW_MODE_MASTER:
721714 infra = ap = 1;
722715 break;
....@@ -744,7 +737,7 @@
744737 wl_iw_get_mode(
745738 struct net_device *dev,
746739 struct iw_request_info *info,
747
- union iwreq_data *wrqu,
740
+ __u32 *uwrq,
748741 char *extra
749742 )
750743 {
....@@ -758,7 +751,7 @@
758751
759752 infra = dtoh32(infra);
760753 ap = dtoh32(ap);
761
- 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;
762755
763756 return 0;
764757 }
....@@ -767,11 +760,10 @@
767760 wl_iw_get_range(
768761 struct net_device *dev,
769762 struct iw_request_info *info,
770
- union iwreq_data *wrqu,
763
+ struct iw_point *dwrq,
771764 char *extra
772765 )
773766 {
774
- struct iw_point *dwrq = (struct iw_point *)wrqu;
775767 struct iw_range *range = (struct iw_range *) extra;
776768 static int channels[MAXCHANNEL+1];
777769 wl_uint32_list_t *list = (wl_uint32_list_t *) channels;
....@@ -1000,11 +992,10 @@
1000992 wl_iw_set_spy(
1001993 struct net_device *dev,
1002994 struct iw_request_info *info,
1003
- union iwreq_data *wrqu,
995
+ struct iw_point *dwrq,
1004996 char *extra
1005997 )
1006998 {
1007
- struct iw_point *dwrq = (struct iw_point *)wrqu;
1008999 wl_iw_t *iw = IW_DEV_IF(dev);
10091000 struct sockaddr *addr = (struct sockaddr *) extra;
10101001 int i;
....@@ -1026,11 +1017,10 @@
10261017 wl_iw_get_spy(
10271018 struct net_device *dev,
10281019 struct iw_request_info *info,
1029
- union iwreq_data *wrqu,
1020
+ struct iw_point *dwrq,
10301021 char *extra
10311022 )
10321023 {
1033
- struct iw_point *dwrq = (struct iw_point *)wrqu;
10341024 wl_iw_t *iw = IW_DEV_IF(dev);
10351025 struct sockaddr *addr = (struct sockaddr *) extra;
10361026 struct iw_quality *qual = (struct iw_quality *) &addr[iw->spy_num];
....@@ -1056,7 +1046,7 @@
10561046 wl_iw_set_wap(
10571047 struct net_device *dev,
10581048 struct iw_request_info *info,
1059
- union iwreq_data *wrqu,
1049
+ struct sockaddr *awrq,
10601050 char *extra
10611051 )
10621052 {
....@@ -1067,13 +1057,13 @@
10671057 WL_TRACE(("%s: SIOCSIWAP\n", dev->name));
10681058 DHD_CHECK(dhd, dev);
10691059 wext_info = dhd->wext_info;
1070
- if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) {
1060
+ if (awrq->sa_family != ARPHRD_ETHER) {
10711061 WL_ERROR(("Invalid Header...sa_family\n"));
10721062 return -EINVAL;
10731063 }
10741064
10751065 /* Ignore "auto" or "off" */
1076
- 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)) {
10771067 scb_val_t scbval;
10781068 bzero(&scbval, sizeof(scb_val_t));
10791069 WL_MSG(dev->name, "WLC_DISASSOC\n");
....@@ -1086,21 +1076,21 @@
10861076 #endif
10871077 return 0;
10881078 }
1089
- /* 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),
10901080 * eabuf)));
10911081 */
10921082 /* Reassociate to the specified AP */
10931083 if (wext_info)
1094
- 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);
10951085 if (wext_info && wext_info->conn_info.ssid.SSID_len) {
10961086 if ((error = wl_ext_connect(dev, &wext_info->conn_info)))
10971087 return error;
10981088 } else {
1099
- 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))) {
11001090 WL_ERROR(("WLC_REASSOC failed (%d).\n", error));
11011091 return error;
11021092 }
1103
- 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));
11041094 }
11051095 #ifdef WL_EXT_IAPSTA
11061096 wl_ext_in4way_sync_wext(dev, STA_NO_BTC_IN4WAY, WL_EXT_STATUS_CONNECTING, NULL);
....@@ -1113,17 +1103,17 @@
11131103 wl_iw_get_wap(
11141104 struct net_device *dev,
11151105 struct iw_request_info *info,
1116
- union iwreq_data *wrqu,
1106
+ struct sockaddr *awrq,
11171107 char *extra
11181108 )
11191109 {
11201110 WL_TRACE(("%s: SIOCGIWAP\n", dev->name));
11211111
1122
- wrqu->ap_addr.sa_family = ARPHRD_ETHER;
1123
- 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);
11241114
11251115 /* Ignore error (may be down or disassociated) */
1126
- (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);
11271117
11281118 return 0;
11291119 }
....@@ -1133,7 +1123,7 @@
11331123 wl_iw_mlme(
11341124 struct net_device *dev,
11351125 struct iw_request_info *info,
1136
- union iwreq_data *wrqu,
1126
+ struct sockaddr *awrq,
11371127 char *extra
11381128 )
11391129 {
....@@ -1181,15 +1171,14 @@
11811171 wl_iw_get_aplist(
11821172 struct net_device *dev,
11831173 struct iw_request_info *info,
1184
- union iwreq_data *wrqu,
1174
+ struct iw_point *dwrq,
11851175 char *extra
11861176 )
11871177 {
1188
- struct iw_point *dwrq = (struct iw_point *)wrqu;
1189
- wl_scan_results_v109_t *list;
1178
+ wl_scan_results_t *list;
11901179 struct sockaddr *addr = (struct sockaddr *) extra;
11911180 struct iw_quality qual[IW_MAX_AP];
1192
- wl_bss_info_v109_t *bi = NULL;
1181
+ wl_bss_info_t *bi = NULL;
11931182 int error, i;
11941183 uint buflen = dwrq->length;
11951184 int16 rssi;
....@@ -1216,7 +1205,7 @@
12161205 ASSERT(list->version == WL_BSS_INFO_VERSION);
12171206
12181207 for (i = 0, dwrq->length = 0; i < list->count && dwrq->length < IW_MAX_AP; i++) {
1219
- 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;
12201209 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
12211210 buflen));
12221211
....@@ -1258,18 +1247,17 @@
12581247 wl_iw_iscan_get_aplist(
12591248 struct net_device *dev,
12601249 struct iw_request_info *info,
1261
- union iwreq_data *wrqu,
1250
+ struct iw_point *dwrq,
12621251 char *extra
12631252 )
12641253 {
1265
- struct iw_point *dwrq = (struct iw_point *)wrqu;
1266
- wl_scan_results_v109_t *list;
1254
+ wl_scan_results_t *list;
12671255 iscan_buf_t * buf;
12681256 iscan_info_t *iscan;
12691257
12701258 struct sockaddr *addr = (struct sockaddr *) extra;
12711259 struct iw_quality qual[IW_MAX_AP];
1272
- wl_bss_info_v109_t *bi = NULL;
1260
+ wl_bss_info_t *bi = NULL;
12731261 int i;
12741262 int16 rssi;
12751263 struct dhd_pub *dhd = dhd_get_pub(dev);
....@@ -1295,7 +1283,7 @@
12951283
12961284 bi = NULL;
12971285 for (i = 0, dwrq->length = 0; i < list->count && dwrq->length < IW_MAX_AP; i++) {
1298
- 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;
12991287 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
13001288 WLC_IW_ISCAN_MAXLEN));
13011289
....@@ -1377,11 +1365,11 @@
13771365 )
13781366 {
13791367 struct dhd_pub *dhd = dhd_get_pub(dev);
1368
+ wl_wext_info_t *wext_info = NULL;
13801369 wlc_ssid_t ssid;
13811370 #ifdef WL_ESCAN
13821371 wl_scan_info_t scan_info;
13831372 #else
1384
- wl_wext_info_t *wext_info = NULL;
13851373 iscan_info_t *iscan;
13861374 #ifdef WL_EXT_IAPSTA
13871375 int err;
....@@ -1389,6 +1377,7 @@
13891377 #endif
13901378
13911379 DHD_CHECK(dhd, dev);
1380
+ wext_info = dhd->wext_info;
13921381 #ifdef WL_ESCAN
13931382 /* default Broadcast scan */
13941383 memset(&ssid, 0, sizeof(ssid));
....@@ -1409,7 +1398,6 @@
14091398 scan_info.ssid.SSID_len = ssid.SSID_len;
14101399 return wl_escan_set_scan(dev, &scan_info);
14111400 #else
1412
- wext_info = dhd->wext_info;
14131401 iscan = &wext_info->iscan;
14141402 WL_TRACE(("%s: SIOCSIWSCAN iscan=%p\n", dev->name, iscan));
14151403 #ifdef WL_EXT_IAPSTA
....@@ -1544,7 +1532,7 @@
15441532 #endif
15451533 int
15461534 wl_iw_handle_scanresults_ies(char **event_p, char *end,
1547
- struct iw_request_info *info, wl_bss_info_v109_t *bi)
1535
+ struct iw_request_info *info, wl_bss_info_t *bi)
15481536 {
15491537 #if WIRELESS_EXT > 17
15501538 struct iw_event iwe;
....@@ -1608,7 +1596,7 @@
16081596 }
16091597
16101598 #ifdef BCMWAPI_WPI
1611
- ptr = ((uint8 *)bi) + sizeof(wl_bss_info_v109_t);
1599
+ ptr = ((uint8 *)bi) + sizeof(wl_bss_info_t);
16121600 ptr_len = bi->ie_length;
16131601
16141602 while ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_WAPI_ID))) {
....@@ -1651,15 +1639,14 @@
16511639 wl_iw_get_scan(
16521640 struct net_device *dev,
16531641 struct iw_request_info *info,
1654
- union iwreq_data *wrqu,
1642
+ struct iw_point *dwrq,
16551643 char *extra
16561644 )
16571645 {
1658
- struct iw_point *dwrq = (struct iw_point *)wrqu;
16591646 channel_info_t ci;
1660
- wl_scan_results_v109_t *list;
1647
+ wl_scan_results_t *list;
16611648 struct iw_event iwe;
1662
- wl_bss_info_v109_t *bi = NULL;
1649
+ wl_bss_info_t *bi = NULL;
16631650 int error, i, j;
16641651 char *event = extra, *end = extra + dwrq->length, *value;
16651652 uint buflen = dwrq->length;
....@@ -1695,7 +1682,7 @@
16951682 ASSERT(list->version == WL_BSS_INFO_VERSION);
16961683
16971684 for (i = 0; i < list->count && i < IW_MAX_AP; i++) {
1698
- 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;
16991686 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
17001687 buflen));
17011688
....@@ -1782,17 +1769,16 @@
17821769 wl_iw_iscan_get_scan(
17831770 struct net_device *dev,
17841771 struct iw_request_info *info,
1785
- union iwreq_data *wrqu,
1772
+ struct iw_point *dwrq,
17861773 char *extra
17871774 )
17881775 {
1789
- struct iw_point *dwrq = (struct iw_point *)wrqu;
17901776 struct dhd_pub *dhd = dhd_get_pub(dev);
1791
-#ifndef WL_ESCAN
17921777 wl_wext_info_t *wext_info = NULL;
1793
- wl_scan_results_v109_t *list;
1778
+#ifndef WL_ESCAN
1779
+ wl_scan_results_t *list;
17941780 struct iw_event iwe;
1795
- wl_bss_info_v109_t *bi = NULL;
1781
+ wl_bss_info_t *bi = NULL;
17961782 int ii, j;
17971783 int apcnt;
17981784 char *event = extra, *end = extra + dwrq->length, *value;
....@@ -1803,6 +1789,7 @@
18031789 #endif
18041790
18051791 DHD_CHECK(dhd, dev);
1792
+ wext_info = dhd->wext_info;
18061793 #ifdef WL_ESCAN
18071794 return wl_escan_get_scan(dev, info, dwrq, extra);
18081795 #else
....@@ -1811,7 +1798,6 @@
18111798 if (!extra)
18121799 return -EINVAL;
18131800
1814
- wext_info = dhd->wext_info;
18151801 /* use backup if our thread is not successful */
18161802 iscan = &wext_info->iscan;
18171803 if ((!iscan) || (iscan->sysioc_pid < 0)) {
....@@ -1836,7 +1822,7 @@
18361822
18371823 bi = NULL;
18381824 for (ii = 0; ii < list->count && apcnt < IW_MAX_AP; apcnt++, ii++) {
1839
- 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;
18401826 ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
18411827 WLC_IW_ISCAN_MAXLEN));
18421828
....@@ -1933,11 +1919,10 @@
19331919 wl_iw_set_essid(
19341920 struct net_device *dev,
19351921 struct iw_request_info *info,
1936
- union iwreq_data *wrqu,
1922
+ struct iw_point *dwrq,
19371923 char *extra
19381924 )
19391925 {
1940
- struct iw_point *dwrq = (struct iw_point *)wrqu;
19411926 wlc_ssid_t ssid;
19421927 int error;
19431928 struct dhd_pub *dhd = dhd_get_pub(dev);
....@@ -1997,11 +1982,10 @@
19971982 wl_iw_get_essid(
19981983 struct net_device *dev,
19991984 struct iw_request_info *info,
2000
- union iwreq_data *wrqu,
1985
+ struct iw_point *dwrq,
20011986 char *extra
20021987 )
20031988 {
2004
- struct iw_point *dwrq = (struct iw_point *)wrqu;
20051989 wlc_ssid_t ssid;
20061990 int error;
20071991
....@@ -2020,14 +2004,13 @@
20202004 /* Max SSID length check */
20212005 if (ssid.SSID_len > IW_ESSID_MAX_SIZE) {
20222006 ssid.SSID_len = IW_ESSID_MAX_SIZE;
2023
- /* Get the current SSID */
2024
- memcpy(extra, ssid.SSID, ssid.SSID_len);
2025
- /* NULL terminating as length of extra buffer is IW_ESSID_MAX_SIZE ie 32 */
2026
- extra[IW_ESSID_MAX_SIZE-1] = '\0';
2027
- } else {
2028
- /* Get the current SSID */
2029
- memcpy(extra, ssid.SSID, ssid.SSID_len);
20302007 }
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';
20312014
20322015 dwrq->length = ssid.SSID_len;
20332016
....@@ -2040,11 +2023,10 @@
20402023 wl_iw_set_nick(
20412024 struct net_device *dev,
20422025 struct iw_request_info *info,
2043
- union iwreq_data *wrqu,
2026
+ struct iw_point *dwrq,
20442027 char *extra
20452028 )
20462029 {
2047
- struct iw_point *dwrq = (struct iw_point *)wrqu;
20482030 wl_iw_t *iw = IW_DEV_IF(dev);
20492031 WL_TRACE(("%s: SIOCSIWNICKN\n", dev->name));
20502032
....@@ -2065,11 +2047,10 @@
20652047 wl_iw_get_nick(
20662048 struct net_device *dev,
20672049 struct iw_request_info *info,
2068
- union iwreq_data *wrqu,
2050
+ struct iw_point *dwrq,
20692051 char *extra
20702052 )
20712053 {
2072
- struct iw_point *dwrq = (struct iw_point *)wrqu;
20732054 wl_iw_t *iw = IW_DEV_IF(dev);
20742055 WL_TRACE(("%s: SIOCGIWNICKN\n", dev->name));
20752056
....@@ -2085,11 +2066,10 @@
20852066 static int wl_iw_set_rate(
20862067 struct net_device *dev,
20872068 struct iw_request_info *info,
2088
- union iwreq_data *wrqu,
2069
+ struct iw_param *vwrq,
20892070 char *extra
20902071 )
20912072 {
2092
- struct iw_param *vwrq = &wrqu->bitrate;
20932073 wl_rateset_t rateset;
20942074 int error, rate, i, error_bg, error_a;
20952075
....@@ -2152,11 +2132,10 @@
21522132 static int wl_iw_get_rate(
21532133 struct net_device *dev,
21542134 struct iw_request_info *info,
2155
- union iwreq_data *wrqu,
2135
+ struct iw_param *vwrq,
21562136 char *extra
21572137 )
21582138 {
2159
- struct iw_param *vwrq = &wrqu->bitrate;
21602139 int error, rate;
21612140
21622141 WL_TRACE(("%s: SIOCGIWRATE\n", dev->name));
....@@ -2174,11 +2153,10 @@
21742153 wl_iw_set_rts(
21752154 struct net_device *dev,
21762155 struct iw_request_info *info,
2177
- union iwreq_data *wrqu,
2156
+ struct iw_param *vwrq,
21782157 char *extra
21792158 )
21802159 {
2181
- struct iw_param *vwrq = &wrqu->rts;
21822160 int error, rts;
21832161
21842162 WL_TRACE(("%s: SIOCSIWRTS\n", dev->name));
....@@ -2200,11 +2178,10 @@
22002178 wl_iw_get_rts(
22012179 struct net_device *dev,
22022180 struct iw_request_info *info,
2203
- union iwreq_data *wrqu,
2181
+ struct iw_param *vwrq,
22042182 char *extra
22052183 )
22062184 {
2207
- struct iw_param *vwrq = &wrqu->rts;
22082185 int error, rts;
22092186
22102187 WL_TRACE(("%s: SIOCGIWRTS\n", dev->name));
....@@ -2223,11 +2200,10 @@
22232200 wl_iw_set_frag(
22242201 struct net_device *dev,
22252202 struct iw_request_info *info,
2226
- union iwreq_data *wrqu,
2203
+ struct iw_param *vwrq,
22272204 char *extra
22282205 )
22292206 {
2230
- struct iw_param *vwrq = &wrqu->frag;
22312207 int error, frag;
22322208
22332209 WL_TRACE(("%s: SIOCSIWFRAG\n", dev->name));
....@@ -2249,11 +2225,10 @@
22492225 wl_iw_get_frag(
22502226 struct net_device *dev,
22512227 struct iw_request_info *info,
2252
- union iwreq_data *wrqu,
2228
+ struct iw_param *vwrq,
22532229 char *extra
22542230 )
22552231 {
2256
- struct iw_param *vwrq = &wrqu->frag;
22572232 int error, fragthreshold;
22582233
22592234 WL_TRACE(("%s: SIOCGIWFRAG\n", dev->name));
....@@ -2272,11 +2247,10 @@
22722247 wl_iw_set_txpow(
22732248 struct net_device *dev,
22742249 struct iw_request_info *info,
2275
- union iwreq_data *wrqu,
2250
+ struct iw_param *vwrq,
22762251 char *extra
22772252 )
22782253 {
2279
- struct iw_param *vwrq = &wrqu->txpower;
22802254 int error, disable;
22812255 uint16 txpwrmw;
22822256 WL_TRACE(("%s: SIOCSIWTXPOW\n", dev->name));
....@@ -2313,11 +2287,10 @@
23132287 wl_iw_get_txpow(
23142288 struct net_device *dev,
23152289 struct iw_request_info *info,
2316
- union iwreq_data *wrqu,
2290
+ struct iw_param *vwrq,
23172291 char *extra
23182292 )
23192293 {
2320
- struct iw_param *vwrq = &wrqu->txpower;
23212294 int error, disable, txpwrdbm;
23222295 uint8 result;
23232296
....@@ -2342,11 +2315,10 @@
23422315 wl_iw_set_retry(
23432316 struct net_device *dev,
23442317 struct iw_request_info *info,
2345
- union iwreq_data *wrqu,
2318
+ struct iw_param *vwrq,
23462319 char *extra
23472320 )
23482321 {
2349
- struct iw_param *vwrq = &wrqu->retry;
23502322 int error, lrl, srl;
23512323
23522324 WL_TRACE(("%s: SIOCSIWRETRY\n", dev->name));
....@@ -2390,11 +2362,10 @@
23902362 wl_iw_get_retry(
23912363 struct net_device *dev,
23922364 struct iw_request_info *info,
2393
- union iwreq_data *wrqu,
2365
+ struct iw_param *vwrq,
23942366 char *extra
23952367 )
23962368 {
2397
- struct iw_param *vwrq = &wrqu->retry;
23982369 int error, lrl, srl;
23992370
24002371 WL_TRACE(("%s: SIOCGIWRETRY\n", dev->name));
....@@ -2432,11 +2403,10 @@
24322403 wl_iw_set_encode(
24332404 struct net_device *dev,
24342405 struct iw_request_info *info,
2435
- union iwreq_data *wrqu,
2406
+ struct iw_point *dwrq,
24362407 char *extra
24372408 )
24382409 {
2439
- struct iw_point *dwrq = (struct iw_point *)wrqu;
24402410 wl_wsec_key_t key;
24412411 int error, val, wsec;
24422412
....@@ -2522,11 +2492,10 @@
25222492 wl_iw_get_encode(
25232493 struct net_device *dev,
25242494 struct iw_request_info *info,
2525
- union iwreq_data *wrqu,
2495
+ struct iw_point *dwrq,
25262496 char *extra
25272497 )
25282498 {
2529
- struct iw_point *dwrq = (struct iw_point *)wrqu;
25302499 wl_wsec_key_t key;
25312500 int error, val, wsec, auth;
25322501
....@@ -2586,11 +2555,10 @@
25862555 wl_iw_set_power(
25872556 struct net_device *dev,
25882557 struct iw_request_info *info,
2589
- union iwreq_data *wrqu,
2558
+ struct iw_param *vwrq,
25902559 char *extra
25912560 )
25922561 {
2593
- struct iw_param *vwrq = &wrqu->power;
25942562 int error, pm;
25952563
25962564 WL_TRACE(("%s: SIOCSIWPOWER\n", dev->name));
....@@ -2608,11 +2576,10 @@
26082576 wl_iw_get_power(
26092577 struct net_device *dev,
26102578 struct iw_request_info *info,
2611
- union iwreq_data *wrqu,
2579
+ struct iw_param *vwrq,
26122580 char *extra
26132581 )
26142582 {
2615
- struct iw_param *vwrq = &wrqu->power;
26162583 int error, pm;
26172584
26182585 WL_TRACE(("%s: SIOCGIWPOWER\n", dev->name));
....@@ -2632,11 +2599,10 @@
26322599 wl_iw_set_wpaie(
26332600 struct net_device *dev,
26342601 struct iw_request_info *info,
2635
- union iwreq_data *wrqu,
2602
+ struct iw_point *iwp,
26362603 char *extra
26372604 )
26382605 {
2639
- struct iw_point *iwp = (struct iw_point *)wrqu;
26402606 #if defined(BCMWAPI_WPI)
26412607 uchar buf[WLC_IOCTL_SMLEN] = {0};
26422608 uchar *p = buf;
....@@ -2661,11 +2627,10 @@
26612627 wl_iw_get_wpaie(
26622628 struct net_device *dev,
26632629 struct iw_request_info *info,
2664
- union iwreq_data *wrqu,
2630
+ struct iw_point *iwp,
26652631 char *extra
26662632 )
26672633 {
2668
- struct iw_point *iwp = (struct iw_point *)wrqu;
26692634 WL_TRACE(("%s: SIOCGIWGENIE\n", dev->name));
26702635 iwp->length = 64;
26712636 dev_wlc_bufvar_get(dev, "wpaie", extra, iwp->length);
....@@ -2676,11 +2641,10 @@
26762641 wl_iw_set_encodeext(
26772642 struct net_device *dev,
26782643 struct iw_request_info *info,
2679
- union iwreq_data *wrqu,
2644
+ struct iw_point *dwrq,
26802645 char *extra
26812646 )
26822647 {
2683
- struct iw_point *dwrq = (struct iw_point *)wrqu;
26842648 wl_wsec_key_t key;
26852649 int error;
26862650 struct iw_encode_ext *iwe;
....@@ -2829,7 +2793,7 @@
28292793 wl_iw_set_pmksa(
28302794 struct net_device *dev,
28312795 struct iw_request_info *info,
2832
- union iwreq_data *wrqu,
2796
+ struct iw_param *vwrq,
28332797 char *extra
28342798 )
28352799 {
....@@ -2837,7 +2801,7 @@
28372801 struct iw_pmksa *iwpmksa;
28382802 uint i;
28392803 char eabuf[ETHER_ADDR_STR_LEN];
2840
- pmkid_v1_t *pmkid_array = NULL;
2804
+ pmkid_t *pmkid_array = NULL;
28412805 struct dhd_pub *dhd = dhd_get_pub(dev);
28422806 wl_wext_info_t *wext_info = NULL;
28432807
....@@ -2854,7 +2818,7 @@
28542818 bzero((char *)pmk_list, sizeof(struct pmk_list));
28552819 }
28562820 if (iwpmksa->cmd == IW_PMKSA_REMOVE) {
2857
- pmkid_list_v1_t pmkid, *pmkidptr;
2821
+ pmkid_list_t pmkid, *pmkidptr;
28582822 pmkidptr = &pmkid;
28592823 bcopy(&iwpmksa->bssid.sa_data[0], &pmkidptr->pmkid[0].BSSID, ETHER_ADDR_LEN);
28602824 bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID, WPA2_PMKID_LEN);
....@@ -2919,7 +2883,7 @@
29192883 wl_iw_get_encodeext(
29202884 struct net_device *dev,
29212885 struct iw_request_info *info,
2922
- union iwreq_data *wrqu,
2886
+ struct iw_param *vwrq,
29232887 char *extra
29242888 )
29252889 {
....@@ -2931,11 +2895,10 @@
29312895 wl_iw_set_wpaauth(
29322896 struct net_device *dev,
29332897 struct iw_request_info *info,
2934
- union iwreq_data *wrqu,
2898
+ struct iw_param *vwrq,
29352899 char *extra
29362900 )
29372901 {
2938
- struct iw_param *vwrq = &wrqu->param;
29392902 int error = 0;
29402903 int paramid;
29412904 int paramval;
....@@ -3190,11 +3153,10 @@
31903153 wl_iw_get_wpaauth(
31913154 struct net_device *dev,
31923155 struct iw_request_info *info,
3193
- union iwreq_data *wrqu,
3156
+ struct iw_param *vwrq,
31943157 char *extra
31953158 )
31963159 {
3197
- struct iw_param *vwrq = &wrqu->param;
31983160 int error;
31993161 int paramid;
32003162 int paramval = 0;
....@@ -3361,7 +3323,6 @@
33613323 };
33623324
33633325 #if WIRELESS_EXT > 12
3364
-#ifdef CONFIG_WEXT_PRIV
33653326 enum {
33663327 WL_IW_SET_LEDDC = SIOCIWFIRSTPRIV,
33673328 WL_IW_SET_VLANMODE,
....@@ -3397,18 +3358,15 @@
33973358 },
33983359 { 0, 0, 0, { 0 } }
33993360 };
3400
-#endif /* CONFIG_WEXT_PRIV */
34013361
34023362 const struct iw_handler_def wl_iw_handler_def =
34033363 {
34043364 .num_standard = ARRAYSIZE(wl_iw_handler),
3405
- .standard = (const iw_handler *) wl_iw_handler,
3406
-#ifdef CONFIG_WEXT_PRIV
34073365 .num_private = ARRAY_SIZE(wl_iw_priv_handler),
34083366 .num_private_args = ARRAY_SIZE(wl_iw_priv_args),
3367
+ .standard = (const iw_handler *) wl_iw_handler,
34093368 .private = wl_iw_priv_handler,
34103369 .private_args = wl_iw_priv_args,
3411
-#endif /* CONFIG_WEXT_PRIV */
34123370 #if WIRELESS_EXT >= 19
34133371 get_wireless_stats: dhd_get_wireless_stats,
34143372 #endif /* WIRELESS_EXT >= 19 */
....@@ -3893,12 +3851,10 @@
38933851 int rssi;
38943852 scb_val_t scb_val;
38953853 #if WIRELESS_EXT > 11
3896
-#ifdef WL_NAN
38973854 char *cntbuf = NULL;
38983855 wl_cnt_info_t *cntinfo;
38993856 uint16 ver;
39003857 uint32 corerev = 0;
3901
-#endif
39023858 #endif /* WIRELESS_EXT > 11 */
39033859
39043860 phy_noise = 0;
....@@ -3942,7 +3898,6 @@
39423898 #endif /* WIRELESS_EXT > 18 */
39433899
39443900 #if WIRELESS_EXT > 11
3945
-#ifdef WL_NAN
39463901 WL_TRACE(("wl_iw_get_wireless_stats counters\n *****"));
39473902
39483903 cntbuf = kmalloc(MAX_WLIW_IOCTL_LEN, GFP_KERNEL);
....@@ -3963,10 +3918,12 @@
39633918 cntinfo->version = dtoh16(cntinfo->version);
39643919 cntinfo->datalen = dtoh16(cntinfo->datalen);
39653920 ver = cntinfo->version;
3921
+#ifdef WL_NAN
39663922 CHK_CNTBUF_DATALEN(cntbuf, MAX_WLIW_IOCTL_LEN);
3967
- if (ver > WL_CNT_VERSION_XTLV) {
3923
+#endif
3924
+ if (ver > WL_CNT_T_VERSION) {
39683925 WL_TRACE(("\tIncorrect version of counters struct: expected %d; got %d\n",
3969
- WL_CNT_VERSION_XTLV, ver));
3926
+ WL_CNT_T_VERSION, ver));
39703927 res = BCME_VERSION;
39713928 goto done;
39723929 }
....@@ -3982,6 +3939,7 @@
39823939 corerev = dtoh32(revinfo.corerev);
39833940 }
39843941
3942
+#ifdef WL_NAN
39853943 res = wl_cntbuf_to_xtlv_format(NULL, cntinfo, MAX_WLIW_IOCTL_LEN, corerev);
39863944 if (res) {
39873945 WL_ERROR(("wl_cntbuf_to_xtlv_format failed %d\n", res));
....@@ -3997,11 +3955,9 @@
39973955
39983956 done:
39993957 #if WIRELESS_EXT > 11
4000
-#ifdef WL_NAN
40013958 if (cntbuf) {
40023959 kfree(cntbuf);
40033960 }
4004
-#endif
40053961 #endif /* WIRELESS_EXT > 11 */
40063962 return res;
40073963 }
....@@ -4033,7 +3989,7 @@
40333989 }
40343990
40353991 static int
4036
-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)
40373993 {
40383994 int err = 0;
40393995
....@@ -4059,14 +4015,14 @@
40594015 static int
40604016 wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, uint16 action)
40614017 {
4062
- int params_size = (WL_SCAN_PARAMS_V1_FIXED_SIZE + OFFSETOF(wl_iscan_params_v1_t, params));
4063
- 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;
40644020 int err = 0;
40654021
40664022 if (ssid && ssid->SSID_len) {
40674023 params_size += sizeof(wlc_ssid_t);
40684024 }
4069
- params = (wl_iscan_params_v1_t*)kmalloc(params_size, GFP_KERNEL);
4025
+ params = (wl_iscan_params_t*)kmalloc(params_size, GFP_KERNEL);
40704026 if (params == NULL) {
40714027 return -ENOMEM;
40724028 }
....@@ -4080,7 +4036,7 @@
40804036 params->action = htod16(action);
40814037 params->scan_duration = htod16(0);
40824038
4083
- /* params_size += OFFSETOF(wl_iscan_params_v1_t, params); */
4039
+ /* params_size += OFFSETOF(wl_iscan_params_t, params); */
40844040 (void) dev_iw_iovar_setbuf(iscan->dev, "iscan", params, params_size,
40854041 iscan->ioctlbuf, WLC_IOCTL_SMLEN);
40864042 }
....@@ -4096,7 +4052,7 @@
40964052 iscan_buf_t * ptr;
40974053 wl_iscan_results_t * list_buf;
40984054 wl_iscan_results_t list;
4099
- wl_scan_results_v109_t *results;
4055
+ wl_scan_results_t *results;
41004056 uint32 status;
41014057
41024058 /* buffers are allocated on demand */
....@@ -4321,12 +4277,14 @@
43214277 wl_iw_autochannel(struct net_device *dev, char* command, int total_len)
43224278 {
43234279 struct dhd_pub *dhd = dhd_get_pub(dev);
4280
+ wl_wext_info_t *wext_info = NULL;
43244281 int ret = 0;
43254282 #ifdef WL_ESCAN
43264283 int bytes_written = -1;
43274284 #endif
43284285
43294286 DHD_CHECK(dhd, dev);
4287
+ wext_info = dhd->wext_info;
43304288 #ifdef WL_ESCAN
43314289 sscanf(command, "%*s %d", &dhd->escan->autochannel);
43324290 if (dhd->escan->autochannel == 0) {