forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/wl_android_ext.c
old mode 100644new mode 100755
....@@ -1,5 +1,4 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
2
-
32 #include <linux/module.h>
43 #include <linux/netdevice.h>
54 #include <net/netlink.h>
....@@ -32,8 +31,6 @@
3231 #ifdef WL_ESCAN
3332 #include <wl_escan.h>
3433 #endif /* WL_ESCAN */
35
-
36
-uint android_msg_level = ANDROID_ERROR_LEVEL | ANDROID_MSG_LEVEL;
3734
3835 #define AEXT_ERROR(name, arg1, args...) \
3936 do { \
....@@ -83,9 +80,6 @@
8380 #define CMD_ROAM_TRIGGER "ROAM_TRIGGER"
8481 #define CMD_PM "PM"
8582 #define CMD_MONITOR "MONITOR"
86
-#ifdef BTC_WAR
87
-#define CMD_BTC_WAR "BTC_WAR"
88
-#endif /* BTC_WAR */
8983 #define CMD_SET_SUSPEND_BCN_LI_DTIM "SET_SUSPEND_BCN_LI_DTIM"
9084 #define CMD_WLMSGLEVEL "WLMSGLEVEL"
9185 #ifdef WL_EXT_IAPSTA
....@@ -323,9 +317,9 @@
323317 }
324318
325319 chanspec_t
326
-wl_ext_chspec_host_to_driver(struct dhd_pub *dhd, chanspec_t chanspec)
320
+wl_ext_chspec_host_to_driver(int ioctl_ver, chanspec_t chanspec)
327321 {
328
- if (dhd->conf->ioctl_ver == 1) {
322
+ if (ioctl_ver == 1) {
329323 chanspec = wl_ext_chspec_to_legacy(chanspec);
330324 if (chanspec == INVCHANSPEC) {
331325 return chanspec;
....@@ -337,7 +331,7 @@
337331 }
338332
339333 static void
340
-wl_ext_ch_to_chanspec(struct dhd_pub *dhd, int ch,
334
+wl_ext_ch_to_chanspec(int ioctl_ver, int ch,
341335 struct wl_join_params *join_params, size_t *join_params_size)
342336 {
343337 chanspec_t chanspec = 0;
....@@ -360,7 +354,7 @@
360354 join_params->params.chanspec_list[0] &= WL_CHANSPEC_CHAN_MASK;
361355 join_params->params.chanspec_list[0] |= chanspec;
362356 join_params->params.chanspec_list[0] =
363
- wl_ext_chspec_host_to_driver(dhd,
357
+ wl_ext_chspec_host_to_driver(ioctl_ver,
364358 join_params->params.chanspec_list[0]);
365359
366360 join_params->params.chanspec_num =
....@@ -405,10 +399,10 @@
405399 }
406400
407401 chanspec_t
408
-wl_ext_chspec_driver_to_host(struct dhd_pub *dhd, chanspec_t chanspec)
402
+wl_ext_chspec_driver_to_host(int ioctl_ver, chanspec_t chanspec)
409403 {
410404 chanspec = dtohchanspec(chanspec);
411
- if (dhd->conf->ioctl_ver == 1) {
405
+ if (ioctl_ver == 1) {
412406 chanspec = wl_ext_chspec_from_legacy(chanspec);
413407 }
414408
....@@ -419,7 +413,7 @@
419413 chanspec_band_t
420414 wl_ext_wlcband_to_chanspec_band(int band)
421415 {
422
- chanspec_band_t chanspec_band = INVCHANSPEC;
416
+ chanspec_band_t chanspec_band = WLC_BAND_INVALID;
423417
424418 switch (band) {
425419 #ifdef WL_6G_BAND
....@@ -434,7 +428,6 @@
434428 chanspec_band = WL_CHANSPEC_BAND_2G;
435429 break;
436430 default:
437
- AEXT_ERROR("wlan", "Invalid Frequency Band\n");
438431 break;
439432 }
440433 return chanspec_band;
....@@ -556,6 +549,28 @@
556549 }
557550 }
558551
552
+int
553
+wl_ext_get_ioctl_ver(struct net_device *dev, int *ioctl_ver)
554
+{
555
+ int ret = 0;
556
+ s32 val = 0;
557
+
558
+ val = 1;
559
+ ret = wl_ext_ioctl(dev, WLC_GET_VERSION, &val, sizeof(val), 0);
560
+ if (ret) {
561
+ return ret;
562
+ }
563
+ val = dtoh32(val);
564
+ if (val != WLC_IOCTL_VERSION && val != 1) {
565
+ AEXT_ERROR(dev->name, "Version mismatch, please upgrade. Got %d, expected %d or 1\n",
566
+ val, WLC_IOCTL_VERSION);
567
+ return BCME_VERSION;
568
+ }
569
+ *ioctl_ver = val;
570
+
571
+ return ret;
572
+}
573
+
559574 void
560575 wl_ext_bss_iovar_war(struct net_device *ndev, s32 *val)
561576 {
....@@ -596,7 +611,6 @@
596611 wl_ext_set_chanspec(struct net_device *dev, struct wl_chan_info *chan_info,
597612 chanspec_t *ret_chspec)
598613 {
599
- struct dhd_pub *dhd = dhd_get_pub(dev);
600614 s32 _chan = chan_info->chan;
601615 chanspec_t chspec = 0;
602616 chanspec_t fw_chspec = 0;
....@@ -609,6 +623,7 @@
609623 u32 bw_cap;
610624 } param = {0, 0};
611625 chanspec_band_t chanspec_band = 0;
626
+ int ioctl_ver;
612627
613628 if ((chan_info->band != WLC_BAND_2G) && (chan_info->band != WLC_BAND_5G) &&
614629 (chan_info->band != WLC_BAND_6G)) {
....@@ -641,7 +656,8 @@
641656 chanspec_band = wl_ext_wlcband_to_chanspec_band(chan_info->band);
642657 chspec = wf_create_chspec_from_primary(chan_info->chan, bw, chanspec_band);
643658 if (wf_chspec_valid(chspec)) {
644
- fw_chspec = wl_ext_chspec_host_to_driver(dhd, chspec);
659
+ wl_ext_get_ioctl_ver(dev, &ioctl_ver);
660
+ fw_chspec = wl_ext_chspec_host_to_driver(ioctl_ver, chspec);
645661 if (fw_chspec != INVCHANSPEC) {
646662 if ((err = wl_ext_iovar_setint(dev, "chanspec", fw_chspec)) == BCME_BADCHAN) {
647663 if (bw == WL_CHANSPEC_BW_80)
....@@ -651,11 +667,8 @@
651667 } else if (err) {
652668 AEXT_ERROR(dev->name, "failed to set chanspec error %d\n", err);
653669 } else
654
- WL_MSG(dev->name, "channel %s-%d(0x%x %sMHz)\n",
655
- CHSPEC2BANDSTR(chspec), chan_info->chan, chspec,
656
- CHSPEC_IS20(chspec)?"20":
657
- CHSPEC_IS40(chspec)?"40":
658
- CHSPEC_IS80(chspec)?"80":"160");
670
+ WL_MSG(dev->name, "channel %s-%d(0x%x)\n",
671
+ CHSPEC2BANDSTR(chspec), chan_info->chan, chspec);
659672 } else {
660673 AEXT_ERROR(dev->name, "failed to convert host chanspec to fw chanspec\n");
661674 err = BCME_ERROR;
....@@ -706,10 +719,6 @@
706719 else if (strnicmp(band, "band=2g", strlen("band=2g")) == 0) {
707720 chan_info.band = WLC_BAND_2G;
708721 }
709
- else if (channel <= CH_MAX_2G_CHANNEL)
710
- chan_info.band = WLC_BAND_2G;
711
- else
712
- chan_info.band = WLC_BAND_5G;
713722
714723 if (channel > 0) {
715724 chan_info.chan = channel;
....@@ -854,30 +863,6 @@
854863 return ret;
855864 }
856865
857
-#ifdef BTC_WAR
858
-extern int btc_war;
859
-static int
860
-wl_ext_btc_war(struct net_device *dev, char *command, int total_len)
861
-{
862
- int user_btc_war = 0;
863
- bool enable = FALSE;
864
-
865
- sscanf(command, "%*s %d", &user_btc_war);
866
-
867
- AEXT_TRACE(dev->name, "btc_war=%d, user_btc_war=%d\n",
868
- btc_war, user_btc_war);
869
-
870
- if (btc_war >= 0) {
871
- btc_war = user_btc_war;
872
- if (btc_war > 0)
873
- enable = TRUE;
874
- wl_ext_btc_config(dev, enable);
875
- }
876
-
877
- return 0;
878
-}
879
-#endif /* BTC_WAR */
880
-
881866 s32
882867 wl_ext_connect(struct net_device *dev, struct wl_conn_info *conn_info)
883868 {
....@@ -888,7 +873,10 @@
888873 s32 err = 0;
889874 u32 chan_cnt = 0;
890875 s8 *iovar_buf = NULL;
876
+ int ioctl_ver = 0;
891877 char sec[64];
878
+
879
+ wl_ext_get_ioctl_ver(dev, &ioctl_ver);
892880
893881 if (dhd->conf->chip == BCM43362_CHIP_ID)
894882 goto set_ssid;
....@@ -945,7 +933,7 @@
945933 ext_join_params->assoc.chanspec_list[0] &= WL_CHANSPEC_CHAN_MASK;
946934 ext_join_params->assoc.chanspec_list[0] |= chspec;
947935 ext_join_params->assoc.chanspec_list[0] =
948
- wl_ext_chspec_host_to_driver(dhd,
936
+ wl_ext_chspec_host_to_driver(ioctl_ver,
949937 ext_join_params->assoc.chanspec_list[0]);
950938 }
951939 ext_join_params->assoc.chanspec_num = htod32(ext_join_params->assoc.chanspec_num);
....@@ -982,7 +970,7 @@
982970 else
983971 memcpy(&join_params.params.bssid, &ether_bcast, ETH_ALEN);
984972
985
- wl_ext_ch_to_chanspec(dhd, conn_info->channel, &join_params, &join_params_size);
973
+ wl_ext_ch_to_chanspec(ioctl_ver, conn_info->channel, &join_params, &join_params_size);
986974 AEXT_TRACE(dev->name, "join_param_size %zu\n", join_params_size);
987975
988976 if (join_params.ssid.SSID_len < IEEE80211_MAX_SSID_LEN) {
....@@ -1099,30 +1087,6 @@
10991087 return FALSE;
11001088 }
11011089
1102
-bool
1103
-wl_ext_passive_chan(struct net_device *dev, struct wl_chan_info *chan_info)
1104
-{
1105
- struct dhd_pub *dhd = dhd_get_pub(dev);
1106
- u32 chanspec;
1107
- s32 ret = BCME_OK;
1108
-
1109
- chanspec = wf_create_chspec_from_primary(chan_info->chan,
1110
- WL_CHANSPEC_BW_20, wl_ext_wlcband_to_chanspec_band(chan_info->band));
1111
-
1112
- chanspec = wl_ext_chspec_host_to_driver(dhd, chanspec);
1113
-
1114
- ret = wldev_iovar_getint(dev, "per_chan_info", &chanspec);
1115
- if (!ret) {
1116
- if (chanspec & WL_CHAN_PASSIVE)
1117
- return TRUE;
1118
- } else {
1119
- if (chan_info->band == WLC_BAND_5G && chan_info->chan >= 52 && chan_info->chan <= 144)
1120
- return TRUE;
1121
- }
1122
-
1123
- return FALSE;
1124
-}
1125
-
11261090 uint16
11271091 wl_ext_get_default_chan(struct net_device *dev,
11281092 uint16 *chan_2g, uint16 *chan_5g, bool nodfs)
....@@ -1153,8 +1117,6 @@
11531117 chan_info.band = WLC_BAND_5G;
11541118 chan_info.chan = chan_tmp;
11551119 if (wl_ext_dfs_chan(&chan_info) && nodfs)
1156
- continue;
1157
- else if (wl_ext_passive_chan(dev, &chan_info))
11581120 continue;
11591121 else
11601122 *chan_5g = chan_tmp;
....@@ -1235,6 +1197,69 @@
12351197
12361198 return ret;
12371199 }
1200
+
1201
+#ifdef WL_CFG80211
1202
+bool
1203
+wl_legacy_chip_check(struct net_device *net)
1204
+{
1205
+ struct dhd_pub *dhd = dhd_get_pub(net);
1206
+ uint chip;
1207
+
1208
+ chip = dhd_conf_get_chip(dhd);
1209
+
1210
+ if (chip == BCM43362_CHIP_ID || chip == BCM4330_CHIP_ID ||
1211
+ chip == BCM4334_CHIP_ID || chip == BCM43340_CHIP_ID ||
1212
+ chip == BCM43341_CHIP_ID || chip == BCM4324_CHIP_ID ||
1213
+ chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID ||
1214
+ chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID ||
1215
+ chip == BCM4371_CHIP_ID ||
1216
+ chip == BCM43430_CHIP_ID ||
1217
+ chip == BCM4345_CHIP_ID || chip == BCM43454_CHIP_ID ||
1218
+ chip == BCM4359_CHIP_ID ||
1219
+ chip == BCM43143_CHIP_ID || chip == BCM43242_CHIP_ID ||
1220
+ chip == BCM43569_CHIP_ID) {
1221
+ return true;
1222
+ }
1223
+
1224
+ return false;
1225
+}
1226
+
1227
+bool
1228
+wl_new_chip_check(struct net_device *net)
1229
+{
1230
+ struct dhd_pub *dhd = dhd_get_pub(net);
1231
+ uint chip;
1232
+
1233
+ chip = dhd_conf_get_chip(dhd);
1234
+
1235
+ if (chip == BCM4359_CHIP_ID || chip == BCM43012_CHIP_ID ||
1236
+ chip == BCM43751_CHIP_ID || chip == BCM43752_CHIP_ID) {
1237
+ return true;
1238
+ }
1239
+
1240
+ return false;
1241
+}
1242
+
1243
+bool
1244
+wl_extsae_chip(struct dhd_pub *dhd)
1245
+{
1246
+ uint chip;
1247
+
1248
+ chip = dhd_conf_get_chip(dhd);
1249
+
1250
+ if (chip == BCM43362_CHIP_ID || chip == BCM4330_CHIP_ID ||
1251
+ chip == BCM4334_CHIP_ID || chip == BCM43340_CHIP_ID ||
1252
+ chip == BCM43341_CHIP_ID || chip == BCM4324_CHIP_ID ||
1253
+ chip == BCM4335_CHIP_ID || chip == BCM4339_CHIP_ID ||
1254
+ chip == BCM4354_CHIP_ID || chip == BCM4356_CHIP_ID ||
1255
+ chip == BCM43143_CHIP_ID || chip == BCM43242_CHIP_ID ||
1256
+ chip == BCM43569_CHIP_ID) {
1257
+ return false;
1258
+ }
1259
+
1260
+ return true;
1261
+}
1262
+#endif
12381263
12391264 #ifdef WLEASYMESH
12401265 #define CMD_EASYMESH "EASYMESH"
....@@ -1450,7 +1475,7 @@
14501475 int total_len)
14511476 {
14521477 struct dhd_pub *dhd = dhd_get_pub(dev);
1453
- wl_mkeep_alive_pkt_v1_t *mkeep_alive_pktp;
1478
+ wl_mkeep_alive_pkt_t *mkeep_alive_pktp;
14541479 int ret = -1, i, ifidx, id, period=-1;
14551480 char *packet = NULL, *buf = NULL;
14561481 int bytes_written = 0;
....@@ -1478,7 +1503,7 @@
14781503 ret = wl_ext_iovar_getbuf(dev, "mkeep_alive", &id, sizeof(id), buf,
14791504 total_len, NULL);
14801505 if (!ret) {
1481
- mkeep_alive_pktp = (wl_mkeep_alive_pkt_v1_t *) buf;
1506
+ mkeep_alive_pktp = (wl_mkeep_alive_pkt_t *) buf;
14821507 bytes_written += snprintf(command+bytes_written, total_len,
14831508 "Id :%d\n"
14841509 "Period (msec) :%d\n"
....@@ -1686,22 +1711,24 @@
16861711 wl_ext_recal(struct net_device *dev, char *data, char *command,
16871712 int total_len)
16881713 {
1689
- struct dhd_pub *dhd = dhd_get_pub(dev);
16901714 int ret = 0, i, nchan, nssid = 0;
1691
- int params_size = WL_SCAN_PARAMS_V1_FIXED_SIZE + WL_NUMCHANNELS * sizeof(uint16);
1692
- wl_scan_params_v1_t *params = NULL;
1715
+ int params_size = WL_SCAN_PARAMS_FIXED_SIZE + WL_NUMCHANNELS * sizeof(uint16);
1716
+ wl_scan_params_t *params = NULL;
1717
+ int ioctl_ver;
16931718 char *p;
16941719
16951720 AEXT_TRACE(dev->name, "Enter\n");
16961721
16971722 if (data) {
16981723 params_size += WL_SCAN_PARAMS_SSID_MAX * sizeof(wlc_ssid_t);
1699
- params = (wl_scan_params_v1_t *) kzalloc(params_size, GFP_KERNEL);
1724
+ params = (wl_scan_params_t *) kzalloc(params_size, GFP_KERNEL);
17001725 if (params == NULL) {
17011726 ret = -ENOMEM;
17021727 goto exit;
17031728 }
17041729 memset(params, 0, params_size);
1730
+
1731
+ wl_ext_get_ioctl_ver(dev, &ioctl_ver);
17051732
17061733 memcpy(&params->bssid, &ether_bcast, ETHER_ADDR_LEN);
17071734 params->bss_type = DOT11_BSSTYPE_ANY;
....@@ -1723,7 +1750,7 @@
17231750 params->home_time = htod32(params->home_time);
17241751
17251752 for (i = 0; i < nchan; i++) {
1726
- wl_ext_chspec_host_to_driver(dhd, params->channel_list[i]);
1753
+ wl_ext_chspec_host_to_driver(ioctl_ver, params->channel_list[i]);
17271754 }
17281755
17291756 p = (char*)params->channel_list + nchan * sizeof(uint16);
....@@ -2500,6 +2527,22 @@
25002527 } csi_list_t;
25012528
25022529 static int
2530
+wl_ether_atoe(const char *a, struct ether_addr *n)
2531
+{
2532
+ char *c = NULL;
2533
+ int i = 0;
2534
+
2535
+ memset(n, 0, ETHER_ADDR_LEN);
2536
+ for (;;) {
2537
+ n->octet[i++] = (uint8)strtoul(a, &c, 16);
2538
+ if (!*c++ || i == ETHER_ADDR_LEN)
2539
+ break;
2540
+ a = c;
2541
+ }
2542
+ return (i == ETHER_ADDR_LEN);
2543
+}
2544
+
2545
+static int
25032546 wl_ext_csi(struct net_device *dev, char *data, char *command, int total_len)
25042547 {
25052548 csi_config_t csi, *csip;
....@@ -2518,7 +2561,7 @@
25182561
25192562 if (data) {
25202563 sscanf(data, "%s %d", mac, &period);
2521
- ret = bcm_ether_atoe(mac, &ea);
2564
+ ret = wl_ether_atoe(mac, &ea);
25222565 if (!ret) {
25232566 AEXT_ERROR(dev->name, "rejecting mac=%s, ret=%d\n", mac, ret);
25242567 goto exit;
....@@ -2616,34 +2659,6 @@
26162659 return bytes_written;
26172660 }
26182661
2619
-static int
2620
-wl_ext_disable_5g_band(struct net_device *dev, char *data, char *command,
2621
- int total_len)
2622
-{
2623
-#ifdef WL_CFG80211
2624
- struct bcm_cfg80211 *cfg = wl_get_cfg(dev);
2625
-#endif
2626
- int ret = -1;
2627
- int val;
2628
-
2629
- if (data) {
2630
- val = (int)simple_strtol(data, NULL, 0);
2631
- ret = wl_ext_iovar_setint(dev, "disable_5g_band", val);
2632
-#ifdef WL_CFG80211
2633
- if (!ret)
2634
- wl_update_wiphybands(cfg, true);
2635
-#endif
2636
- } else {
2637
- ret = wl_ext_iovar_getint(dev, "disable_5g_band", &val);
2638
- if (!ret) {
2639
- ret = snprintf(command, total_len, "%d", val);
2640
- AEXT_TRACE(dev->name, "command result is %s\n", command);
2641
- }
2642
- }
2643
-
2644
- return ret;
2645
-}
2646
-
26472662 typedef int (wl_ext_tpl_parse_t)(struct net_device *dev, char *data, char *command,
26482663 int total_len);
26492664
....@@ -2696,7 +2711,6 @@
26962711 {WLC_GET_VAR, WLC_SET_VAR, "csi", wl_ext_csi},
26972712 #endif /* CSI_SUPPORT */
26982713 {WLC_GET_VAR, WLC_SET_VAR, "country", wl_ext_get_country},
2699
- {WLC_GET_VAR, WLC_SET_VAR, "disable_5g_band", wl_ext_disable_5g_band},
27002714 };
27012715
27022716 /*
....@@ -2838,11 +2852,6 @@
28382852 else if (strnicmp(command, CMD_MONITOR, strlen(CMD_MONITOR)) == 0) {
28392853 *bytes_written = wl_ext_monitor(net, command, total_len);
28402854 }
2841
-#ifdef BTC_WAR
2842
- else if (strnicmp(command, CMD_BTC_WAR, strlen(CMD_BTC_WAR)) == 0) {
2843
- *bytes_written = wl_ext_btc_war(net, command, total_len);
2844
- }
2845
-#endif /* BTC_WAR */
28462855 else if (strnicmp(command, CMD_SET_SUSPEND_BCN_LI_DTIM, strlen(CMD_SET_SUSPEND_BCN_LI_DTIM)) == 0) {
28472856 int bcn_li_dtim;
28482857 bcn_li_dtim = (int)simple_strtol((command + strlen(CMD_SET_SUSPEND_BCN_LI_DTIM) + 1), NULL, 10);
....@@ -2936,7 +2945,7 @@
29362945 return -ENOMEM;
29372946 }
29382947
2939
- err = wldev_iovar_getbuf(dev, "chan_info_list", NULL,
2948
+ err = wl_ext_iovar_getbuf(dev, "chan_info_list", NULL,
29402949 0, list, LOCAL_BUF_LEN, NULL);
29412950 if (err == BCME_UNSUPPORTED) {
29422951 err = wl_ext_iovar_getbuf(dev, "chanspecs", NULL,
....@@ -3049,13 +3058,11 @@
30493058 #if defined(BSSCACHE)
30503059 wl_bss_cache_ctrl_t *bss_cache_ctrl,
30513060 #else
3052
- wl_scan_results_v109_t *bss_list,
3061
+ wl_scan_results_t *bss_list,
30533062 #endif /* BSSCACHE */
3054
- int *best_2g_ch, int *best_5g_ch, int *best_6g_ch)
3063
+ int ioctl_ver, int *best_2g_ch, int *best_5g_ch, int *best_6g_ch)
30553064 {
3056
- struct dhd_pub *dhd = dhd_get_pub(net);
30573065 struct wl_bss_info *bi = NULL; /* must be initialized */
3058
- struct wl_chan_info chan_info;
30593066 s32 i, j;
30603067 #if defined(BSSCACHE)
30613068 wl_bss_cache_t *node;
....@@ -3093,18 +3100,13 @@
30933100 for (i = 0; i < list->count; i++) {
30943101 chspec = list->element[i];
30953102 channel = wf_chspec_ctlchan(chspec);
3096
- chan_info.band = CHSPEC2WLC_BAND(chspec);
3097
- chan_info.chan = channel;
3098
- if (wl_ext_passive_chan(net, &chan_info)) {
3099
- continue;
3100
- }
31013103 if (CHSPEC_IS2G(chspec) && (channel >= CH_MIN_2G_CHANNEL) &&
3102
- (channel <= CH_MAX_2G_CHANNEL)) {
3104
+ (channel <= CH_MAX_2G_CHANNEL)) {
31033105 b_band[channel-1] = 0;
31043106 }
31053107 #ifdef WL_6G_BAND
31063108 else if (CHSPEC_IS6G(chspec) && (channel >= CH_MIN_6G_CHANNEL) &&
3107
- (channel <= CH_MAX_6G_CHANNEL)) {
3109
+ (channel <= CH_MAX_6G_CHANNEL)) {
31083110 if (channel <= 93)
31093111 six_g_band5[(channel-1)/4] = 0;
31103112 else if (channel >= 97 && channel <= 109)
....@@ -3140,9 +3142,9 @@
31403142 #if defined(BSSCACHE)
31413143 bi = node->results.bss_info;
31423144 #else
3143
- bi = bi ? (wl_bss_info_v109_t *)((uintptr)bi + dtoh32(bi->length)) : bss_list->bss_info;
3145
+ bi = bi ? (wl_bss_info_t *)((uintptr)bi + dtoh32(bi->length)) : bss_list->bss_info;
31443146 #endif /* BSSCACHE */
3145
- chanspec = wl_ext_chspec_driver_to_host(dhd, bi->chanspec);
3147
+ chanspec = wl_ext_chspec_driver_to_host(ioctl_ver, bi->chanspec);
31463148 cen_ch = CHSPEC_CHANNEL(bi->chanspec);
31473149 distance = 0;
31483150 if (CHSPEC_IS20(chanspec))
....@@ -3165,25 +3167,25 @@
31653167 else if (CHSPEC_IS6G(chanspec)) {
31663168 distance += distance_6g;
31673169 if (cen_ch <= 93) {
3168
- for (j=0; j<ARRAYSIZE(six_g_band5); j++) {
3170
+ for (j=0; j<ARRAYSIZE(a_band1); j++) {
31693171 if (six_g_band5[j] >= 0 && abs(cen_ch-(93+j*4)) <= distance)
31703172 six_g_band5[j] += 1;
31713173 }
31723174 }
31733175 else if (channel >= 97 && channel <= 109) {
3174
- for (j=0; j<ARRAYSIZE(six_g_band6); j++) {
3176
+ for (j=0; j<ARRAYSIZE(a_band4); j++) {
31753177 if (six_g_band6[j] >= 0 && abs(cen_ch-(97+j*4)) <= distance)
31763178 six_g_band6[j] += 1;
31773179 }
31783180 }
31793181 else if (channel >= 117 && channel <= 181) {
3180
- for (j=0; j<ARRAYSIZE(six_g_band7); j++) {
3182
+ for (j=0; j<ARRAYSIZE(a_band4); j++) {
31813183 if (six_g_band7[j] >= 0 && abs(cen_ch-(117+j*4)) <= distance)
31823184 six_g_band7[j] += 1;
31833185 }
31843186 }
31853187 else if (channel >= 189 && channel <= 221) {
3186
- for (j=0; j<ARRAYSIZE(six_g_band8); j++) {
3188
+ for (j=0; j<ARRAYSIZE(a_band4); j++) {
31873189 if (six_g_band8[j] >= 0 && abs(cen_ch-(189+j*4)) <= distance)
31883190 six_g_band8[j] += 1;
31893191 }
....@@ -3349,7 +3351,7 @@
33493351 memset(reqbuf, 0, CHANSPEC_BUF_SIZE);
33503352
33513353 acs_band = wl_ext_wlcband_to_chanspec_band(band);
3352
- if (acs_band == INVCHANSPEC) {
3354
+ if ((uint32)acs_band == WLC_BAND_INVALID) {
33533355 acs_band = WL_CHANSPEC_BAND_2G;
33543356 }
33553357
....@@ -3755,10 +3757,10 @@
37553757
37563758 void
37573759 wl_update_rssi_cache(wl_rssi_cache_ctrl_t *rssi_cache_ctrl,
3758
- wl_scan_results_v109_t *ss_list)
3760
+ wl_scan_results_t *ss_list)
37593761 {
37603762 wl_rssi_cache_t *node, *prev, *leaf, **rssi_head;
3761
- wl_bss_info_v109_t *bi = NULL;
3763
+ wl_bss_info_t *bi = NULL;
37623764 int i, j, k;
37633765 struct osl_timespec now, timeout;
37643766
....@@ -3784,7 +3786,7 @@
37843786 node = *rssi_head;
37853787 prev = NULL;
37863788 k = 0;
3787
- bi = bi ? (wl_bss_info_v109_t *)((uintptr)bi + dtoh32(bi->length)) : ss_list->bss_info;
3789
+ bi = bi ? (wl_bss_info_t *)((uintptr)bi + dtoh32(bi->length)) : ss_list->bss_info;
37883790 for (;node;) {
37893791 if (!memcmp(&node->BSSID, &bi->BSSID, ETHER_ADDR_LEN)) {
37903792 AEXT_INFO("wlan", "Update %d with BSSID %pM, RSSI=%3d, SSID \"%s\"\n",
....@@ -4110,11 +4112,11 @@
41104112 #if defined(RSSIAVG)
41114113 wl_rssi_cache_ctrl_t *rssi_cache_ctrl,
41124114 #endif /* RSSIAVG */
4113
- wl_scan_results_v109_t *ss_list)
4115
+ wl_scan_results_t *ss_list)
41144116 {
41154117 wl_bss_cache_t *node, *node_target = NULL, *prev, *leaf, **bss_head;
41164118 wl_bss_cache_t *node_rssi_prev = NULL, *node_rssi = NULL;
4117
- wl_bss_info_v109_t *bi = NULL;
4119
+ wl_bss_info_t *bi = NULL;
41184120 int i, k=0, bss_num = 0;
41194121 struct osl_timespec now, timeout;
41204122 int16 rssi_min;
....@@ -4149,7 +4151,7 @@
41494151 prev = NULL;
41504152 node_target = NULL;
41514153 node_rssi_prev = NULL;
4152
- bi = bi ? (wl_bss_info_v109_t *)((uintptr)bi + dtoh32(bi->length)) : ss_list->bss_info;
4154
+ bi = bi ? (wl_bss_info_t *)((uintptr)bi + dtoh32(bi->length)) : ss_list->bss_info;
41534155
41544156 // find the bss with same BSSID
41554157 for (;node;) {