old mode 100644new mode 100755.. | .. |
---|
241 | 241 | */ |
---|
242 | 242 | REG_RULE(2484-10, 2484+10, 20, 6, 20, 0), |
---|
243 | 243 | /* IEEE 802.11a, channel 36..64 */ |
---|
244 | | - REG_RULE(5150-10, 5350+10, 80, 6, 20, 0), |
---|
| 244 | + REG_RULE(5150-10, 5350+10, 40, 6, 20, 0), |
---|
245 | 245 | /* IEEE 802.11a, channel 100..165 */ |
---|
246 | | - REG_RULE(5470-10, 5850+10, 80, 6, 20, 0), |
---|
| 246 | + REG_RULE(5470-10, 5850+10, 40, 6, 20, 0), |
---|
247 | 247 | #ifdef WL_6G_BAND |
---|
248 | 248 | REG_RULE(6025-80, 6985+80, 160, 6, 20, 0), |
---|
249 | 249 | REG_RULE(5935-10, 7115+10, 20, 6, 20, 0), |
---|
.. | .. |
---|
475 | 475 | #endif /* WL_CFG80211_P2P_DEV_IF */ |
---|
476 | 476 | static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy, |
---|
477 | 477 | struct net_device *dev, |
---|
478 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
479 | | - int link_id, |
---|
480 | | -#endif |
---|
481 | 478 | u8 key_idx, bool unicast, bool multicast); |
---|
482 | 479 | static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, |
---|
483 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
484 | | - int link_id, |
---|
485 | | -#endif |
---|
486 | 480 | u8 key_idx, bool pairwise, const u8 *mac_addr, |
---|
487 | 481 | struct key_params *params); |
---|
488 | 482 | static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, |
---|
489 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
490 | | - int link_id, |
---|
491 | | -#endif |
---|
492 | 483 | u8 key_idx, bool pairwise, const u8 *mac_addr); |
---|
493 | 484 | static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev, |
---|
494 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
495 | | - int link_id, |
---|
496 | | -#endif |
---|
497 | 485 | u8 key_idx, bool pairwise, const u8 *mac_addr, |
---|
498 | 486 | void *cookie, void (*callback) (void *cookie, |
---|
499 | 487 | struct key_params *params)); |
---|
500 | 488 | static s32 wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy, |
---|
501 | | - struct net_device *dev, |
---|
502 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
503 | | - int link_id, |
---|
504 | | -#endif |
---|
505 | | - u8 key_idx); |
---|
| 489 | + struct net_device *dev, u8 key_idx); |
---|
506 | 490 | #if defined(WL_SUPPORT_BACKPORTED_KPATCHES) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) |
---|
507 | 491 | static s32 wl_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, |
---|
508 | 492 | bcm_struct_cfgdev *cfgdev, u64 cookie); |
---|
.. | .. |
---|
595 | 579 | bcm_struct_cfgdev *cfgdev, const wl_event_msg_t *e, void *data); |
---|
596 | 580 | static s32 wl_bss_connect_done(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
597 | 581 | const wl_event_msg_t *e, void *data, bool completed); |
---|
| 582 | +#ifdef DHD_LOSSLESS_ROAMING |
---|
598 | 583 | static s32 wl_bss_roaming_done(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
599 | 584 | const wl_event_msg_t *e, void *data); |
---|
| 585 | +#endif /* DHD_LOSSLESS_ROAMING */ |
---|
600 | 586 | static s32 wl_notify_mic_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, |
---|
601 | 587 | const wl_event_msg_t *e, void *data); |
---|
602 | 588 | #ifdef BT_WIFI_HANDOVER |
---|
.. | .. |
---|
1089 | 1075 | }; |
---|
1090 | 1076 | #endif /* CFG80211_6G_SUPPORT */ |
---|
1091 | 1077 | |
---|
1092 | | -#ifdef WL_CAP_HE |
---|
1093 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) || defined(CONFIG_6GHZ_BKPORT) |
---|
1094 | | -static struct ieee80211_sband_iftype_data __wl_he_cap = { |
---|
1095 | | - .types_mask = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP), |
---|
1096 | | - .he_cap = { |
---|
1097 | | - .has_he = true, |
---|
1098 | | - .he_cap_elem = { |
---|
1099 | | - .mac_cap_info[0] = (IEEE80211_HE_MAC_CAP0_HTC_HE | |
---|
1100 | | - IEEE80211_HE_MAC_CAP0_TWT_REQ), |
---|
1101 | | - .mac_cap_info[1] = IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US, |
---|
1102 | | - .mac_cap_info[2] = IEEE80211_HE_MAC_CAP2_BSR, |
---|
1103 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)) |
---|
1104 | | - .mac_cap_info[5] = IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX, |
---|
1105 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) */ |
---|
1106 | | - |
---|
1107 | | - .phy_cap_info[0] = |
---|
1108 | | - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | |
---|
1109 | | - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, |
---|
1110 | | - .phy_cap_info[1] = |
---|
1111 | | - IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | |
---|
1112 | | - IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD, |
---|
1113 | | - .phy_cap_info[2] = |
---|
1114 | | - IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US, |
---|
1115 | | - .phy_cap_info[3] = |
---|
1116 | | - IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER, |
---|
1117 | | - .phy_cap_info[4] = |
---|
1118 | | - IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE | |
---|
1119 | | - IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK | |
---|
1120 | | - IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4, |
---|
1121 | | - .phy_cap_info[5] = |
---|
1122 | | - IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2, |
---|
1123 | | - .phy_cap_info[6] = |
---|
1124 | | - IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU | |
---|
1125 | | - IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU | |
---|
1126 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)) |
---|
1127 | | - IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | |
---|
1128 | | - IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB | |
---|
1129 | | -#else |
---|
1130 | | - IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB | |
---|
1131 | | - IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB | |
---|
1132 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) */ |
---|
1133 | | - IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB | |
---|
1134 | | - IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT, |
---|
1135 | | - .phy_cap_info[7] = |
---|
1136 | | - IEEE80211_HE_PHY_CAP7_MAX_NC_1, |
---|
1137 | | - .phy_cap_info[8] = |
---|
1138 | | - IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU | |
---|
1139 | | - IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU, |
---|
1140 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) |
---|
1141 | | - .phy_cap_info[9] = |
---|
1142 | | - IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU | |
---|
1143 | | - IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU, |
---|
1144 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) */ |
---|
1145 | | - }, |
---|
1146 | | - .he_mcs_nss_supp = { |
---|
1147 | | - .rx_mcs_80 = cpu_to_le16(0xfffa), |
---|
1148 | | - .tx_mcs_80 = cpu_to_le16(0xfffa), |
---|
1149 | | - .rx_mcs_160 = cpu_to_le16((0xfffa)), |
---|
1150 | | - .tx_mcs_160 = cpu_to_le16((0xfffa)), |
---|
1151 | | - } |
---|
1152 | | - }, |
---|
1153 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) |
---|
1154 | | - .he_6ghz_capa = {.capa = cpu_to_le16(0x3038)}, |
---|
1155 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) */ |
---|
1156 | | -}; |
---|
1157 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) */ |
---|
1158 | | -#endif /* WL_CAP_HE */ |
---|
1159 | | - |
---|
1160 | 1078 | static struct ieee80211_supported_band __wl_band_2ghz = { |
---|
1161 | 1079 | .band = IEEE80211_BAND_2GHZ, |
---|
1162 | 1080 | .channels = __wl_2ghz_channels, |
---|
1163 | 1081 | .n_channels = ARRAY_SIZE(__wl_2ghz_channels), |
---|
1164 | 1082 | .bitrates = wl_g_rates, |
---|
1165 | | - .n_bitrates = wl_g_rates_size, |
---|
1166 | | -#ifdef WL_CAP_HE |
---|
1167 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) || defined(CONFIG_6GHZ_BKPORT) |
---|
1168 | | - .iftype_data = &__wl_he_cap, |
---|
1169 | | - .n_iftype_data = 1 |
---|
1170 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) */ |
---|
1171 | | -#endif /* WL_CAP_HE */ |
---|
| 1083 | + .n_bitrates = wl_g_rates_size |
---|
1172 | 1084 | }; |
---|
1173 | 1085 | |
---|
1174 | 1086 | static struct ieee80211_supported_band __wl_band_5ghz_a = { |
---|
.. | .. |
---|
1176 | 1088 | .channels = __wl_5ghz_a_channels, |
---|
1177 | 1089 | .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels), |
---|
1178 | 1090 | .bitrates = wl_a_rates, |
---|
1179 | | - .n_bitrates = wl_a_rates_size, |
---|
1180 | | -#ifdef WL_CAP_HE |
---|
1181 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) || defined(CONFIG_6GHZ_BKPORT) |
---|
1182 | | - .iftype_data = &__wl_he_cap, |
---|
1183 | | - .n_iftype_data = 1 |
---|
1184 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) */ |
---|
1185 | | -#endif /* WL_CAP_HE */ |
---|
| 1091 | + .n_bitrates = wl_a_rates_size |
---|
1186 | 1092 | }; |
---|
1187 | 1093 | |
---|
1188 | 1094 | #ifdef CFG80211_6G_SUPPORT |
---|
.. | .. |
---|
1191 | 1097 | .channels = __wl_6ghz_channels, |
---|
1192 | 1098 | .n_channels = ARRAY_SIZE(__wl_6ghz_channels), |
---|
1193 | 1099 | .bitrates = wl_a_rates, |
---|
1194 | | - .n_bitrates = wl_a_rates_size, |
---|
1195 | | -#ifdef WL_CAP_HE |
---|
1196 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) || defined(CONFIG_6GHZ_BKPORT) |
---|
1197 | | - .iftype_data = &__wl_he_cap, |
---|
1198 | | - .n_iftype_data = 1 |
---|
1199 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) */ |
---|
1200 | | -#endif /* WL_CAP_HE */ |
---|
| 1100 | + .n_bitrates = wl_a_rates_size |
---|
1201 | 1101 | }; |
---|
1202 | 1102 | #endif /* CFG80211_6G_SUPPORT */ |
---|
1203 | 1103 | |
---|
.. | .. |
---|
2391 | 2291 | |
---|
2392 | 2292 | WL_ERR(("%s: starts to read %s. Axi error \n", __FUNCTION__, filename)); |
---|
2393 | 2293 | |
---|
2394 | | - fp = dhd_filp_open(filename, O_RDONLY, 0); |
---|
| 2294 | + fp = filp_open(filename, O_RDONLY, 0); |
---|
2395 | 2295 | |
---|
2396 | 2296 | if (IS_ERR(fp) || (fp == NULL)) { |
---|
2397 | 2297 | WL_ERR(("%s: Couldn't read the file, err %ld,File [%s] No previous axi error \n", |
---|
.. | .. |
---|
2399 | 2299 | return ret; |
---|
2400 | 2300 | } |
---|
2401 | 2301 | |
---|
2402 | | - dhd_kernel_read_compat(fp, fp->f_pos, (char *)dhd->axi_err_dump, sizeof(dhd_axi_error_dump_t)); |
---|
2403 | | - dhd_filp_close(fp, NULL); |
---|
| 2302 | + kernel_read_compat(fp, fp->f_pos, (char *)dhd->axi_err_dump, sizeof(dhd_axi_error_dump_t)); |
---|
| 2303 | + filp_close(fp, NULL); |
---|
2404 | 2304 | |
---|
2405 | 2305 | /* Delete axi error info file */ |
---|
2406 | 2306 | if (dhd_file_delete(filename) < 0) { |
---|
.. | .. |
---|
3282 | 3182 | |
---|
3283 | 3183 | if (addr) { |
---|
3284 | 3184 | ifflags |= WL_INTERFACE_MAC_USE; |
---|
3285 | | - if (dhd_conf_legacy_chip_check(cfg->pub)) { |
---|
| 3185 | + if (wl_legacy_chip_check(ndev)) { |
---|
3286 | 3186 | iface.flags = ifflags; |
---|
3287 | 3187 | memcpy(&iface.mac_addr.octet, addr, ETH_ALEN); |
---|
3288 | 3188 | } |
---|
.. | .. |
---|
3295 | 3195 | #endif /* WLEASYMESH */ |
---|
3296 | 3196 | |
---|
3297 | 3197 | /* Pass ver = 0 for fetching the interface_create iovar version */ |
---|
3298 | | - if (dhd_conf_legacy_chip_check(cfg->pub)) { |
---|
| 3198 | + if (wl_legacy_chip_check(ndev)) { |
---|
3299 | 3199 | bzero(&iface_v0, sizeof(iface_v0)); |
---|
3300 | 3200 | iface_v0.ver = WL_INTERFACE_CREATE_VER_0; |
---|
3301 | 3201 | iface_v0.flags = iftype | ifflags; |
---|
.. | .. |
---|
6483 | 6383 | |
---|
6484 | 6384 | if (assoc_info.reassoc) { |
---|
6485 | 6385 | /* Handle roam to same ESS */ |
---|
6486 | | -#ifdef DHD_LOSSLESS_ROAMING |
---|
6487 | | - wl_ext_send_event_msg(dev, WLC_E_ROAM_PREP, WLC_E_STATUS_SUCCESS, WLC_E_REASON_LOW_RSSI); |
---|
6488 | | -#endif |
---|
6489 | 6386 | if ((err = wl_handle_reassoc(cfg, dev, &assoc_info)) != BCME_OK) { |
---|
6490 | 6387 | goto fail; |
---|
6491 | 6388 | } |
---|
.. | .. |
---|
6640 | 6537 | WL_TRACE_HW4(("Aborting the scan! \n")); |
---|
6641 | 6538 | wl_cfgscan_cancel_scan(cfg); |
---|
6642 | 6539 | } |
---|
6643 | | - if (conn_in_progress || connected || |
---|
6644 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(CFG80211_BKPORT_MLO) |
---|
6645 | | - wdev->u.client.ssid_len) |
---|
6646 | | -#else |
---|
6647 | | - wdev->ssid_len) |
---|
6648 | | -#endif /* CFG80211_BKPORT_MLO */ |
---|
6649 | | - { |
---|
6650 | | -#ifdef WL_EXT_IAPSTA |
---|
6651 | | - wl_ext_in4way_sync(dev, 0, WL_EXT_STATUS_PRE_DISCONNECTING, NULL); |
---|
6652 | | -#endif |
---|
| 6540 | + if (conn_in_progress || connected || wdev->ssid_len) { |
---|
6653 | 6541 | scbval.val = reason_code; |
---|
6654 | 6542 | memcpy(&scbval.ea, curbssid, ETHER_ADDR_LEN); |
---|
6655 | 6543 | scbval.val = htod32(scbval.val); |
---|
.. | .. |
---|
6693 | 6581 | * disassoc indicates state mismatch with upper layer. Check for state |
---|
6694 | 6582 | * and issue disconnect indication if required. |
---|
6695 | 6583 | */ |
---|
6696 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(CFG80211_BKPORT_MLO) |
---|
6697 | | - if (wdev->connected || wdev->u.client.ssid_len) |
---|
6698 | | -#else |
---|
6699 | | - if (wdev->current_bss || wdev->ssid_len) |
---|
6700 | | -#endif /* CFG80211_BKPORT_MLO */ |
---|
6701 | | - { |
---|
| 6584 | + |
---|
| 6585 | + if (wdev->current_bss || wdev->ssid_len) { |
---|
6702 | 6586 | WL_INFORM_MEM(("report disconnect event\n")); |
---|
6703 | 6587 | CFG80211_DISCONNECTED(dev, 0, NULL, 0, false, GFP_KERNEL); |
---|
6704 | 6588 | } |
---|
.. | .. |
---|
6803 | 6687 | |
---|
6804 | 6688 | static s32 |
---|
6805 | 6689 | wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev, |
---|
6806 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
6807 | | - int link_id, |
---|
6808 | | -#endif |
---|
6809 | 6690 | u8 key_idx, bool unicast, bool multicast) |
---|
6810 | 6691 | { |
---|
6811 | 6692 | struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); |
---|
.. | .. |
---|
6850 | 6731 | s32 bssidx; |
---|
6851 | 6732 | s32 mode = wl_get_mode_by_netdev(cfg, dev); |
---|
6852 | 6733 | |
---|
6853 | | - WL_MSG(dev->name, "key index (%d) for %pM\n", key_idx, mac_addr); |
---|
| 6734 | + WL_MSG(dev->name, "key index (%d)\n", key_idx); |
---|
6854 | 6735 | if ((bssidx = wl_get_bssidx_by_wdev(cfg, dev->ieee80211_ptr)) < 0) { |
---|
6855 | 6736 | WL_ERR(("Find p2p index from wdev(%p) failed\n", dev->ieee80211_ptr)); |
---|
6856 | 6737 | return BCME_ERROR; |
---|
.. | .. |
---|
7017 | 6898 | |
---|
7018 | 6899 | static s32 |
---|
7019 | 6900 | wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, |
---|
7020 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
7021 | | - int link_id, |
---|
7022 | | -#endif |
---|
7023 | 6901 | u8 key_idx, bool pairwise, const u8 *mac_addr, |
---|
7024 | 6902 | struct key_params *params) |
---|
7025 | 6903 | { |
---|
.. | .. |
---|
7219 | 7097 | |
---|
7220 | 7098 | static s32 |
---|
7221 | 7099 | wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, |
---|
7222 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
7223 | | - int link_id, |
---|
7224 | | -#endif |
---|
7225 | 7100 | u8 key_idx, bool pairwise, const u8 *mac_addr) |
---|
7226 | 7101 | { |
---|
7227 | 7102 | struct wl_wsec_key key; |
---|
.. | .. |
---|
7285 | 7160 | /* NOTE : this function cannot work as is and is never called */ |
---|
7286 | 7161 | static s32 |
---|
7287 | 7162 | wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev, |
---|
7288 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
7289 | | - int link_id, |
---|
7290 | | -#endif |
---|
7291 | 7163 | u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie, |
---|
7292 | 7164 | void (*callback) (void *cookie, struct key_params * params)) |
---|
7293 | 7165 | { |
---|
.. | .. |
---|
7362 | 7234 | |
---|
7363 | 7235 | static s32 |
---|
7364 | 7236 | wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy, |
---|
7365 | | - struct net_device *dev, |
---|
7366 | | -#if defined(CFG80211_BKPORT_MLO) |
---|
7367 | | - int link_id, |
---|
7368 | | -#endif |
---|
7369 | | - u8 key_idx) |
---|
| 7237 | + struct net_device *dev, u8 key_idx) |
---|
7370 | 7238 | { |
---|
7371 | 7239 | #ifdef MFP |
---|
7372 | 7240 | /* Firmware seems to use hard coded index for Group Mgmt Key. |
---|
.. | .. |
---|
10267 | 10135 | chan = &band->channels[idx]; |
---|
10268 | 10136 | /* Setting current channel to the requested channel */ |
---|
10269 | 10137 | if ((err = wl_cfg80211_set_channel(wiphy, ndev, chan, |
---|
10270 | | - NL80211_CHAN_WIDTH_20) < 0)) { |
---|
| 10138 | + NL80211_CHAN_HT20) < 0)) { |
---|
10271 | 10139 | /* |
---|
10272 | 10140 | * FIXME: |
---|
10273 | 10141 | * |
---|
.. | .. |
---|
10349 | 10217 | return err; |
---|
10350 | 10218 | } |
---|
10351 | 10219 | #endif /* WL_SUPPORT_ACS */ |
---|
10352 | | - |
---|
10353 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) |
---|
10354 | | -static int |
---|
10355 | | -wl_cfg80211_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, |
---|
10356 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(CFG80211_BKPORT_MLO) |
---|
10357 | | - unsigned int link_id, |
---|
10358 | | -#endif |
---|
10359 | | - struct cfg80211_chan_def *chandef) |
---|
10360 | | -{ |
---|
10361 | | - struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); |
---|
10362 | | - u32 chanspec = 0; |
---|
10363 | | - int ret = 0; |
---|
10364 | | - |
---|
10365 | | - RETURN_EIO_IF_NOT_UP(cfg); |
---|
10366 | | - if (NULL == wdev->netdev) { |
---|
10367 | | - /* the P2P interface may temporary use wdev without ndev */ |
---|
10368 | | - return -EINVAL; |
---|
10369 | | - } |
---|
10370 | | - |
---|
10371 | | - if ((ret = wldev_iovar_getint(wdev->netdev, "chanspec", (s32 *)&chanspec) != BCME_OK)) { |
---|
10372 | | - return ret; |
---|
10373 | | - } |
---|
10374 | | - if (!chandef || (wl_chspec_chandef(chanspec, chandef, wiphy) != BCME_OK)) { |
---|
10375 | | - return BCME_ERROR; |
---|
10376 | | - } |
---|
10377 | | - return 0; |
---|
10378 | | -} |
---|
10379 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION (3, 6, 0) */ |
---|
10380 | 10220 | |
---|
10381 | 10221 | static struct cfg80211_ops wl_cfg80211_ops = { |
---|
10382 | 10222 | .add_virtual_intf = wl_cfg80211_add_virtual_iface, |
---|
.. | .. |
---|
10475 | 10315 | .update_ft_ies = wl_cfg80211_update_ft_ies, |
---|
10476 | 10316 | #endif /* WLFBT */ |
---|
10477 | 10317 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) */ |
---|
10478 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION (3, 6, 0) |
---|
10479 | | - .get_channel = wl_cfg80211_get_channel, |
---|
10480 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION (3, 6, 0) */ |
---|
10481 | 10318 | }; |
---|
10482 | 10319 | |
---|
10483 | 10320 | s32 wl_mode_to_nl80211_iftype(s32 mode) |
---|
.. | .. |
---|
10516 | 10353 | GCC_DIAGNOSTIC_POP(); |
---|
10517 | 10354 | if (iter->ndev) { |
---|
10518 | 10355 | if (wl_get_drv_status(cfg, AP_CREATED, iter->ndev)) { |
---|
10519 | | - WL_ERR(("AP active. skip coutry ccode change\n")); |
---|
| 10356 | + WL_ERR(("AP active. skip coutry ccode change")); |
---|
10520 | 10357 | return false; |
---|
10521 | 10358 | } |
---|
10522 | 10359 | } |
---|
.. | .. |
---|
10524 | 10361 | |
---|
10525 | 10362 | #ifdef WL_NAN |
---|
10526 | 10363 | if (wl_cfgnan_is_enabled(cfg) && wl_cfgnan_is_dp_active(net)) { |
---|
10527 | | - WL_ERR(("NDP established. skip coutry ccode change\n")); |
---|
| 10364 | + WL_ERR(("NDP established. skip coutry ccode change")); |
---|
10528 | 10365 | return false; |
---|
10529 | 10366 | } |
---|
10530 | 10367 | #endif /* WL_NAN */ |
---|
.. | .. |
---|
11061 | 10898 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) && defined(SUPPORT_RANDOM_MAC_SCAN) */ |
---|
11062 | 10899 | |
---|
11063 | 10900 | #if defined(WL_SAE) || defined(WL_CLIENT_SAE) |
---|
11064 | | - if (dhd_conf_extsae_chip(dhd)) |
---|
| 10901 | + if (wl_extsae_chip(dhd)) |
---|
11065 | 10902 | wdev->wiphy->features |= NL80211_FEATURE_SAE; |
---|
11066 | 10903 | #endif /* WL_SAE || WL_CLIENT_SAE */ |
---|
11067 | 10904 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)) && defined(BCMSUP_4WAY_HANDSHAKE) |
---|
.. | .. |
---|
11078 | 10915 | wiphy_ext_feature_set(wdev->wiphy, NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN); |
---|
11079 | 10916 | wdev->wiphy->features |= NL80211_FEATURE_LOW_PRIORITY_SCAN; |
---|
11080 | 10917 | #endif /* WL_SCAN_TYPE */ |
---|
| 10918 | + |
---|
| 10919 | +#ifdef DHD_PNO_FLAG |
---|
| 10920 | + wiphy_ext_feature_set(wdev->wiphy, NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI); |
---|
| 10921 | +#endif |
---|
11081 | 10922 | |
---|
11082 | 10923 | /* Now we can register wiphy with cfg80211 module */ |
---|
11083 | 10924 | err = wiphy_register(wdev->wiphy); |
---|
.. | .. |
---|
12414 | 12255 | memcpy(&emsg, as->event_msg, sizeof(wl_event_msg_t)); |
---|
12415 | 12256 | ret = wl_ext_in4way_sync(ndev, STA_REASSOC_RETRY, |
---|
12416 | 12257 | WL_EXT_STATUS_RECONNECT, &emsg); |
---|
12417 | | - if (ret == BCME_ERROR) |
---|
| 12258 | + if (ret) |
---|
12418 | 12259 | return 0; |
---|
12419 | 12260 | } |
---|
12420 | 12261 | wl_ext_iapsta_enable_master_if(ndev, FALSE); |
---|
.. | .. |
---|
12570 | 12411 | memcpy(&emsg, as->event_msg, sizeof(wl_event_msg_t)); |
---|
12571 | 12412 | ret = wl_ext_in4way_sync(ndev, STA_REASSOC_RETRY, |
---|
12572 | 12413 | WL_EXT_STATUS_RECONNECT, &emsg); |
---|
12573 | | - if (ret == BCME_BADADDR) { |
---|
12574 | | - u8 *curbssid = NULL; |
---|
12575 | | - curbssid = wl_read_prof(cfg, ndev, WL_PROF_BSSID); |
---|
12576 | | - if (curbssid) |
---|
12577 | | - (void)memcpy_s(as->addr, ETH_ALEN, curbssid, ETH_ALEN); |
---|
12578 | | - } |
---|
12579 | | - else if (ret == BCME_ERROR) |
---|
| 12414 | + if (ret) |
---|
12580 | 12415 | return 0; |
---|
12581 | 12416 | } |
---|
12582 | 12417 | #endif |
---|
.. | .. |
---|
12700 | 12535 | wl_ext_iapsta_restart_master(ndev); |
---|
12701 | 12536 | } |
---|
12702 | 12537 | #endif |
---|
12703 | | - |
---|
12704 | | - if (wl_get_drv_status(cfg, DISCONNECTING, ndev)) { |
---|
12705 | | - /* If DISCONNECTING bit is set, mark locally generated */ |
---|
12706 | | - loc_gen = 1; |
---|
12707 | | - } |
---|
12708 | 12538 | |
---|
12709 | 12539 | CFG80211_DISCONNECTED(ndev, reason, ie_ptr, ie_len, |
---|
12710 | 12540 | loc_gen, GFP_KERNEL); |
---|
.. | .. |
---|
12953 | 12783 | goto exit; |
---|
12954 | 12784 | } |
---|
12955 | 12785 | |
---|
12956 | | -#ifdef WL_ROAM_WAR |
---|
12957 | | - if (event_type == WLC_E_JOIN) |
---|
12958 | | - bzero((u8*)&cfg->roaming_bssid, ETHER_ADDR_LEN); |
---|
12959 | | - else if (wl_get_drv_status(cfg, CONNECTED, ndev)) { |
---|
12960 | | - if (event_type == WLC_E_AUTH && ntoh32(e->status) == WLC_E_STATUS_SUCCESS) |
---|
12961 | | - bcopy(&e->addr, &cfg->roaming_bssid, ETHER_ADDR_LEN); |
---|
12962 | | - else if (event_type == WLC_E_DEAUTH && |
---|
12963 | | - !ETHER_ISNULLADDR(&cfg->roaming_bssid.octet) && |
---|
12964 | | - memcmp(&e->addr, &cfg->roaming_bssid, ETHER_ADDR_LEN)) { |
---|
12965 | | - WL_MSG(ndev->name, "skip WLC_E_DEAUTH(%pM), roaming_bssid %pM\n", |
---|
12966 | | - &e->addr, &cfg->roaming_bssid); |
---|
12967 | | - goto exit; |
---|
12968 | | - } |
---|
12969 | | - } |
---|
12970 | | -#endif /* WL_ROAM_WAR */ |
---|
12971 | | - |
---|
12972 | 12786 | if (wl_get_drv_status(cfg, CONNECTING, ndev)) { |
---|
12973 | 12787 | assoc_state = WL_STATE_ASSOCIATING; |
---|
12974 | 12788 | } else if (wl_get_drv_status(cfg, CONNECTED, ndev)) { |
---|
.. | .. |
---|
13117 | 12931 | ndev = cfgdev_to_wlc_ndev(cfgdev, cfg); |
---|
13118 | 12932 | if (ndev) { |
---|
13119 | 12933 | wdev = ndev->ieee80211_ptr; |
---|
13120 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(CFG80211_BKPORT_MLO) |
---|
13121 | | - wdev->u.client.ssid_len = |
---|
13122 | | - min(ssid->SSID_len, (uint32)DOT11_MAX_SSID_LEN); |
---|
13123 | | - memcpy(wdev->u.client.ssid, ssid->SSID, wdev->u.client.ssid_len); |
---|
13124 | | -#else |
---|
13125 | 12934 | wdev->ssid_len = min(ssid->SSID_len, (uint32)DOT11_MAX_SSID_LEN); |
---|
13126 | 12935 | memcpy(wdev->ssid, ssid->SSID, wdev->ssid_len); |
---|
13127 | | -#endif /* CFG80211_BKPORT_MLO */ |
---|
13128 | 12936 | WL_ERR(("SSID is %s\n", ssid->SSID)); |
---|
13129 | 12937 | wl_update_prof(cfg, ndev, NULL, ssid, WL_PROF_SSID); |
---|
13130 | 12938 | } else { |
---|
.. | .. |
---|
13671 | 13479 | return err; |
---|
13672 | 13480 | } |
---|
13673 | 13481 | |
---|
| 13482 | +#ifdef DHD_LOSSLESS_ROAMING |
---|
13674 | 13483 | static s32 |
---|
13675 | 13484 | wl_bss_roaming_done(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
13676 | 13485 | const wl_event_msg_t *e, void *data) |
---|
.. | .. |
---|
13678 | 13487 | struct wl_connect_info *conn_info = wl_to_conn(cfg); |
---|
13679 | 13488 | s32 err = 0; |
---|
13680 | 13489 | u8 *curbssid; |
---|
13681 | | - chanspec_t *chanspec, cur_chanspec; |
---|
| 13490 | + chanspec_t *chanspec; |
---|
13682 | 13491 | scb_val_t scbval; |
---|
13683 | 13492 | #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)) || \ |
---|
13684 | 13493 | defined(WL_COMPAT_WIRELESS) |
---|
13685 | 13494 | struct wiphy *wiphy = bcmcfg_to_wiphy(cfg); |
---|
13686 | 13495 | struct ieee80211_channel *notify_channel = NULL; |
---|
13687 | 13496 | u32 freq; |
---|
13688 | | - u32 cur_channel, orig_channel; |
---|
| 13497 | + u32 cur_channel, cur_chanspec, orig_channel; |
---|
13689 | 13498 | #endif /* LINUX_VERSION > 2.6.39 || WL_COMPAT_WIRELESS */ |
---|
13690 | 13499 | #if (defined(CONFIG_ARCH_MSM) && defined(CFG80211_ROAMED_API_UNIFIED)) || \ |
---|
13691 | 13500 | (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)) || \ |
---|
.. | .. |
---|
13726 | 13535 | cur_channel = wf_chspec_ctlchan(wl_chspec_driver_to_host(cur_chanspec)); |
---|
13727 | 13536 | orig_channel = wf_chspec_ctlchan(wl_chspec_driver_to_host(*chanspec)); |
---|
13728 | 13537 | if (dhdp->conf->chip != BCM43569_CHIP_ID) { |
---|
13729 | | - if (((orig_channel == cur_channel) && memcmp(ðer_null, &cfg->last_roamed_addr, ETHER_ADDR_LEN)) && |
---|
| 13538 | + if ((orig_channel == cur_channel) && |
---|
13730 | 13539 | ((memcmp(curbssid, &e->addr, ETHER_ADDR_LEN) == 0) || |
---|
13731 | 13540 | (memcmp(&cfg->last_roamed_addr, &e->addr, ETHER_ADDR_LEN) == 0))) { |
---|
13732 | | - WL_INFORM_MEM(("BSS already present, Skipping roamed event to upper layer\n")); |
---|
13733 | | - WL_INFORM_MEM(("orig_chan/cur_chan=%d/%d, addr/curbssid/last_roamed_addr=%pM/%pM/%pM\n", |
---|
13734 | | - orig_channel, cur_channel, |
---|
13735 | | - (const u8*)(&e->addr), curbssid, (const u8*)(&cfg->last_roamed_addr))); |
---|
| 13541 | + WL_DBG(("BSS already present, Skipping roamed event to upper layer\n")); |
---|
13736 | 13542 | goto fail; |
---|
13737 | 13543 | } |
---|
13738 | 13544 | } |
---|
.. | .. |
---|
13766 | 13572 | } |
---|
13767 | 13573 | rssi = dtoh32(scbval.val); |
---|
13768 | 13574 | |
---|
13769 | | - WL_MSG(ndev->name, "%pM(chan=%s-%d/%sMHz) => %pM(chan=%s-%d/%sMHz, rssi: %3d)\n", |
---|
13770 | | - curbssid, |
---|
13771 | | - CHSPEC2BANDSTR(*chanspec), wf_chspec_ctlchan(*chanspec), |
---|
| 13575 | + WL_MSG(ndev->name, "%pM(ch:%3d/%sMHz) => %pM(ch:%3d/%sMHz, rssi: %3d)\n", |
---|
| 13576 | + curbssid, orig_channel, |
---|
13772 | 13577 | CHSPEC_IS20(*chanspec)?"20": |
---|
13773 | 13578 | CHSPEC_IS40(*chanspec)?"40": |
---|
13774 | 13579 | CHSPEC_IS80(*chanspec)?"80": |
---|
13775 | 13580 | CHSPEC_IS160(*chanspec)?"160":"??", |
---|
13776 | | - (const u8*)(&e->addr), |
---|
13777 | | - CHSPEC2BANDSTR(cur_chanspec), wf_chspec_ctlchan(cur_chanspec), |
---|
| 13581 | + (const u8*)(&e->addr), cur_channel, |
---|
13778 | 13582 | CHSPEC_IS20(cur_chanspec)?"20": |
---|
13779 | 13583 | CHSPEC_IS40(cur_chanspec)?"40": |
---|
13780 | 13584 | CHSPEC_IS80(cur_chanspec)?"80": |
---|
.. | .. |
---|
13815 | 13619 | DHD_STATLOG_CTRL(dhdp, ST(REASSOC_INFORM), |
---|
13816 | 13620 | dhd_net2idx(dhdp->info, ndev), 0); |
---|
13817 | 13621 | #ifdef WL_EXT_IAPSTA |
---|
13818 | | - wl_ext_in4way_sync(ndev, 0, WL_EXT_STATUS_ROAMED, NULL); |
---|
| 13622 | + wl_ext_in4way_sync(ndev, 0, WL_EXT_STATUS_CONNECTED, NULL); |
---|
13819 | 13623 | #endif |
---|
13820 | 13624 | |
---|
13821 | 13625 | #if (defined(CONFIG_ARCH_MSM) && defined(CFG80211_ROAMED_API_UNIFIED)) || \ |
---|
13822 | 13626 | (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)) || \ |
---|
13823 | 13627 | defined(WL_FILS_ROAM_OFFLD) || defined(CFG80211_ROAM_API_GE_4_12) |
---|
13824 | 13628 | memset(&roam_info, 0, sizeof(struct cfg80211_roam_info)); |
---|
13825 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(CFG80211_BKPORT_MLO) |
---|
13826 | | - roam_info.links[0].channel = notify_channel; |
---|
13827 | | - roam_info.links[0].bssid = curbssid; |
---|
13828 | | -#else |
---|
13829 | 13629 | roam_info.channel = notify_channel; |
---|
13830 | 13630 | roam_info.bssid = curbssid; |
---|
13831 | | -#endif /* CFG80211_BKPORT_MLO */ |
---|
13832 | 13631 | roam_info.req_ie = conn_info->req_ie; |
---|
13833 | 13632 | roam_info.req_ie_len = conn_info->req_ie_len; |
---|
13834 | 13633 | roam_info.resp_ie = conn_info->resp_ie; |
---|
.. | .. |
---|
13881 | 13680 | return err; |
---|
13882 | 13681 | |
---|
13883 | 13682 | fail: |
---|
13884 | | -#ifdef WL_EXT_IAPSTA |
---|
13885 | | - if (err) |
---|
13886 | | - wl_ext_in4way_sync(ndev, STA_NO_BTC_IN4WAY, WL_EXT_STATUS_DISCONNECTED, NULL); |
---|
13887 | | -#endif |
---|
13888 | 13683 | #ifdef DHD_LOSSLESS_ROAMING |
---|
13889 | 13684 | wl_del_roam_timeout(cfg); |
---|
13890 | 13685 | #endif /* DHD_LOSSLESS_ROAMING */ |
---|
13891 | 13686 | return err; |
---|
13892 | 13687 | } |
---|
| 13688 | +#endif /* DHD_LOSSLESS_ROAMING */ |
---|
13893 | 13689 | |
---|
13894 | 13690 | static bool |
---|
13895 | 13691 | wl_cfg80211_verify_bss(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
.. | .. |
---|
14025 | 13821 | |
---|
14026 | 13822 | resp_params = (struct cfg80211_connect_resp_params *)params; |
---|
14027 | 13823 | resp_params->status = status; |
---|
14028 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(CFG80211_BKPORT_MLO) |
---|
14029 | | - resp_params->links[0].bssid = curbssid; |
---|
14030 | | - resp_params->links[0].bss = CFG80211_GET_BSS(wiphy, NULL, curbssid, |
---|
14031 | | - ssid->SSID, ssid->SSID_len); |
---|
14032 | | -#else |
---|
14033 | 13824 | resp_params->bssid = curbssid; |
---|
14034 | 13825 | resp_params->bss = CFG80211_GET_BSS(wiphy, NULL, curbssid, |
---|
14035 | 13826 | ssid->SSID, ssid->SSID_len); |
---|
14036 | | -#endif |
---|
14037 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(CFG80211_BKPORT_MLO) |
---|
14038 | | - if (!resp_params->links[0].bss) |
---|
14039 | | -#else |
---|
14040 | | - if (!resp_params->bss) |
---|
14041 | | -#endif /* CFG80211_BKPORT_MLO */ |
---|
14042 | | - { |
---|
| 13827 | + if (!resp_params->bss) { |
---|
14043 | 13828 | WL_ERR(("null bss\n")); |
---|
14044 | 13829 | return BCME_ERROR; |
---|
14045 | 13830 | } |
---|
.. | .. |
---|
14149 | 13934 | completed = false; |
---|
14150 | 13935 | sec->auth_assoc_res_status = WLAN_STATUS_UNSPECIFIED_FAILURE; |
---|
14151 | 13936 | } |
---|
14152 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(CFG80211_BKPORT_MLO) |
---|
14153 | | - if (!ndev->ieee80211_ptr->u.client.ssid_len) |
---|
14154 | | -#else |
---|
14155 | | - if (!ndev->ieee80211_ptr->ssid_len) |
---|
14156 | | -#endif /* CFG80211_BKPORT_MLO */ |
---|
14157 | | - { |
---|
| 13937 | + if (!ndev->ieee80211_ptr->ssid_len) { |
---|
14158 | 13938 | /* In certain cases, the delayed cfg80211 work from |
---|
14159 | 13939 | * disconnect context will induce race conditions in |
---|
14160 | 13940 | * which the ssid_len will be cleared, but dhd is in |
---|
.. | .. |
---|
14182 | 13962 | |
---|
14183 | 13963 | if (completed) { |
---|
14184 | 13964 | WL_MSG(ndev->name, "Report connect result - connection succeeded\n"); |
---|
| 13965 | +#ifdef WL_EXT_IAPSTA |
---|
| 13966 | + wl_ext_in4way_sync(ndev, 0, WL_EXT_STATUS_CONNECTED, NULL); |
---|
| 13967 | + wl_ext_iapsta_enable_master_if(ndev, TRUE); |
---|
| 13968 | +#endif |
---|
14185 | 13969 | } else { |
---|
14186 | 13970 | WL_MSG(ndev->name, "Report connect result - connection failed\n"); |
---|
14187 | 13971 | #ifdef WL_EXT_IAPSTA |
---|
.. | .. |
---|
14230 | 14014 | } |
---|
14231 | 14015 | #endif /* WAPI */ |
---|
14232 | 14016 | } |
---|
14233 | | - |
---|
14234 | | -#ifdef WL_EXT_IAPSTA |
---|
14235 | | - if (completed) { |
---|
14236 | | - wl_ext_in4way_sync(ndev, 0, WL_EXT_STATUS_CONNECTED, NULL); |
---|
14237 | | - wl_ext_iapsta_enable_master_if(ndev, TRUE); |
---|
14238 | | - } |
---|
14239 | | -#endif |
---|
14240 | 14017 | |
---|
14241 | 14018 | exit: |
---|
14242 | 14019 | CLR_TS(cfg, conn_start); |
---|
.. | .. |
---|
14847 | 14624 | wl_cfg80211_ccode_evt_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, |
---|
14848 | 14625 | const wl_event_msg_t *event, void *data) |
---|
14849 | 14626 | { |
---|
14850 | | - dhd_pub_t *dhd = cfg->pub; |
---|
14851 | 14627 | s32 err = 0; |
---|
14852 | 14628 | struct wiphy *wiphy = bcmcfg_to_wiphy(cfg); |
---|
14853 | 14629 | char country_str[WLC_CNTRY_BUF_SZ] = { 0 }; |
---|
14854 | 14630 | struct net_device *dev = bcmcfg_to_prmry_ndev(cfg); |
---|
| 14631 | + wl_country_t cspec = {{0}, 0, {0}}; |
---|
14855 | 14632 | |
---|
14856 | 14633 | if (strlcpy(country_str, data, WL_CCODE_LEN + 1) >= WLC_CNTRY_BUF_SZ) { |
---|
14857 | 14634 | return -EINVAL; |
---|
.. | .. |
---|
14864 | 14641 | } |
---|
14865 | 14642 | |
---|
14866 | 14643 | WL_MSG(dev->name, "Updating new country %s\n", country_str); |
---|
14867 | | - dhd_conf_country(dhd, "country", country_str); |
---|
| 14644 | + |
---|
| 14645 | + strlcpy(cspec.country_abbrev, country_str, WL_CCODE_LEN + 1); |
---|
| 14646 | + strlcpy(cspec.ccode, country_str, WL_CCODE_LEN + 1); |
---|
| 14647 | + err = dhd_conf_map_country_list(dhd_get_pub(dev), &cspec); |
---|
| 14648 | + if (err) |
---|
| 14649 | + dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec); |
---|
| 14650 | + err = dhd_conf_set_country(dhd_get_pub(dev), &cspec); |
---|
| 14651 | + if (err < 0) { |
---|
| 14652 | + WL_ERR(("set country for %s as %s rev %d failed\n", |
---|
| 14653 | + country_str, cspec.ccode, cspec.rev)); |
---|
| 14654 | + } |
---|
| 14655 | + dhd_conf_fix_country(dhd_get_pub(dev)); |
---|
14868 | 14656 | |
---|
14869 | 14657 | /* Indicate to upper layer for regdom change */ |
---|
14870 | 14658 | err = wl_update_wiphybands(cfg, true); |
---|
.. | .. |
---|
15010 | 14798 | cfg->evt_handler[WLC_E_BSS_LOAD] = wl_cfg80211_bssload_report_event_handler; |
---|
15011 | 14799 | #endif /* WL_CHAN_UTIL */ |
---|
15012 | 14800 | #ifdef WL_TWT |
---|
15013 | | - cfg->evt_handler[WLC_E_TWT] = wl_notify_twt_event; |
---|
15014 | | -#else |
---|
15015 | | -#ifdef WL_TWT_HAL_IF |
---|
15016 | | - cfg->evt_handler[WLC_E_TWT] = wl_cfgvendor_notify_twt_event; |
---|
15017 | | -#endif /* WL_TWT_HAL_IF */ |
---|
| 14801 | + cfg->evt_handler[WLC_E_TWT_SETUP] = wl_notify_twt_event; |
---|
| 14802 | + cfg->evt_handler[WLC_E_TWT_TEARDOWN] = wl_notify_twt_event; |
---|
| 14803 | + cfg->evt_handler[WLC_E_TWT_INFO_FRM] = wl_notify_twt_event; |
---|
15018 | 14804 | #endif /* WL_TWT */ |
---|
15019 | 14805 | #ifdef WL_CLIENT_SAE |
---|
15020 | 14806 | cfg->evt_handler[WLC_E_JOIN_START] = wl_notify_start_auth; |
---|
.. | .. |
---|
15394 | 15180 | |
---|
15395 | 15181 | wdev = ndev_to_wdev(dev); |
---|
15396 | 15182 | if (!wdev) { |
---|
15397 | | - WL_DBG(("wdev(%s) null. Do nothing\n", dev->name)); |
---|
| 15183 | + WL_ERR(("wdev null. Do nothing\n")); |
---|
15398 | 15184 | return NOTIFY_DONE; |
---|
15399 | 15185 | } |
---|
15400 | 15186 | |
---|
.. | .. |
---|
15901 | 15687 | wl_destroy_event_handler(cfg); |
---|
15902 | 15688 | wl_flush_eq(cfg); |
---|
15903 | 15689 | wl_link_down(cfg); |
---|
| 15690 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 15691 | + cancel_delayed_work_sync(&cfg->sched_scan_stop_work); |
---|
| 15692 | +#endif /* WL_SCHED_SCAN */ |
---|
15904 | 15693 | del_timer_sync(&cfg->scan_timeout); |
---|
15905 | 15694 | #ifdef DHD_LOSSLESS_ROAMING |
---|
15906 | 15695 | del_timer_sync(&cfg->roam_timeout); |
---|
.. | .. |
---|
16167 | 15956 | INIT_WORK(&cfg->wlan_work, wl_cfg80211_work_handler); |
---|
16168 | 15957 | #endif /* DHCP_SCAN_SUPPRESS */ |
---|
16169 | 15958 | |
---|
| 15959 | +#if defined (WL_SCHED_SCAN) && defined (SCHED_SCAN_DELAYED_WORK) |
---|
| 15960 | + INIT_DELAYED_WORK(&cfg->sched_scan_stop_work, wl_cfgscan_sched_scan_stop_work); |
---|
| 15961 | +#endif /* WL_SCHED_SCAN */ |
---|
16170 | 15962 | INIT_DELAYED_WORK(&cfg->pm_enable_work, wl_cfg80211_work_handler); |
---|
16171 | 15963 | INIT_DELAYED_WORK(&cfg->loc.work, wl_cfgscan_listen_complete_work); |
---|
16172 | 15964 | INIT_DELAYED_WORK(&cfg->ap_work, wl_cfg80211_ap_timeout_work); |
---|
.. | .. |
---|
16433 | 16225 | |
---|
16434 | 16226 | #ifdef OEM_ANDROID |
---|
16435 | 16227 | if (cfg->event_workq == NULL) { |
---|
16436 | | - WL_ERR(("Event handler is not created (%s)\n", bcmevent_get_name(event_type))); |
---|
| 16228 | + WL_ERR(("Event handler is not created\n")); |
---|
16437 | 16229 | return; |
---|
16438 | 16230 | } |
---|
16439 | 16231 | #endif /* OEM_ANDROID */ |
---|
.. | .. |
---|
16820 | 16612 | return err; |
---|
16821 | 16613 | } |
---|
16822 | 16614 | |
---|
16823 | | -static int wl_construct_reginfo(struct bcm_cfg80211 *cfg, s32 bw_cap_2g, |
---|
16824 | | - s32 bw_cap_5g, s32 bw_cap_6g) |
---|
| 16615 | +static int wl_construct_reginfo(struct bcm_cfg80211 *cfg, s32 bw_cap) |
---|
16825 | 16616 | { |
---|
16826 | 16617 | struct net_device *dev = bcmcfg_to_prmry_ndev(cfg); |
---|
16827 | 16618 | struct ieee80211_channel *band_chan_arr = NULL; |
---|
.. | .. |
---|
16889 | 16680 | (channel <= CH_MAX_2G_CHANNEL)) { |
---|
16890 | 16681 | band_chan_arr = __wl_2ghz_channels; |
---|
16891 | 16682 | array_size = ARRAYSIZE(__wl_2ghz_channels); |
---|
| 16683 | + ht40_allowed = (bw_cap == WLC_N_BW_40ALL)? true : false; |
---|
16892 | 16684 | } |
---|
16893 | 16685 | #ifdef CFG80211_6G_SUPPORT |
---|
16894 | 16686 | else if (CHSPEC_IS6G(chspec) && (channel >= CH_MIN_6G_CHANNEL) && |
---|
16895 | 16687 | (channel <= CH_MAX_6G_CHANNEL)) { |
---|
16896 | 16688 | band_chan_arr = __wl_6ghz_channels; |
---|
16897 | 16689 | array_size = ARRAYSIZE(__wl_6ghz_channels); |
---|
16898 | | - ht40_allowed = WL_BW_CAP_40MHZ(bw_cap_6g); |
---|
| 16690 | + ht40_allowed = (bw_cap == WLC_N_BW_20ALL)? false : true; |
---|
16899 | 16691 | } |
---|
16900 | 16692 | #endif /* CFG80211_6G_SUPPORT */ |
---|
16901 | 16693 | else if ( |
---|
.. | .. |
---|
16909 | 16701 | (CHSPEC_IS5G(chspec) && channel >= CH_MIN_5G_CHANNEL)) { |
---|
16910 | 16702 | band_chan_arr = __wl_5ghz_a_channels; |
---|
16911 | 16703 | array_size = ARRAYSIZE(__wl_5ghz_a_channels); |
---|
16912 | | - ht40_allowed = WL_BW_CAP_40MHZ(bw_cap_5g); |
---|
| 16704 | + ht40_allowed = (bw_cap == WLC_N_BW_20ALL)? false : true; |
---|
16913 | 16705 | } else { |
---|
16914 | 16706 | WL_ERR(("Invalid channel Sepc. 0x%x.\n", chspec)); |
---|
16915 | 16707 | continue; |
---|
.. | .. |
---|
16917 | 16709 | if (!ht40_allowed && CHSPEC_IS40(chspec)) |
---|
16918 | 16710 | continue; |
---|
16919 | 16711 | for (j = 0; j < array_size; j++) { |
---|
16920 | | - if (band_chan_arr[j].hw_value == wf_chspec_primary20_chspec(chspec)) { |
---|
| 16712 | + if (band_chan_arr[j].hw_value == chspec) { |
---|
16921 | 16713 | break; |
---|
16922 | 16714 | } |
---|
16923 | 16715 | } |
---|
.. | .. |
---|
16932 | 16724 | band_chan_arr[index].center_freq = |
---|
16933 | 16725 | wl_channel_to_frequency(channel, CHSPEC_BAND(chspec)); |
---|
16934 | 16726 | #endif |
---|
16935 | | - band_chan_arr[index].hw_value = wf_chspec_primary20_chspec(chspec); |
---|
| 16727 | + band_chan_arr[index].hw_value = chspec; |
---|
16936 | 16728 | band_chan_arr[index].beacon_found = false; |
---|
16937 | 16729 | band_chan_arr[index].flags &= ~IEEE80211_CHAN_DISABLED; |
---|
16938 | 16730 | |
---|
.. | .. |
---|
16940 | 16732 | /* assuming the order is HT20, HT40 Upper, |
---|
16941 | 16733 | * HT40 lower from chanspecs |
---|
16942 | 16734 | */ |
---|
16943 | | - u32 ht40_flag = |
---|
16944 | | - band_chan_arr[index].flags & IEEE80211_CHAN_NO_HT40; |
---|
| 16735 | + u32 ht40_flag = band_chan_arr[index].flags & IEEE80211_CHAN_NO_HT40; |
---|
16945 | 16736 | if (CHSPEC_SB_UPPER(chspec)) { |
---|
16946 | 16737 | if (ht40_flag == IEEE80211_CHAN_NO_HT40) |
---|
16947 | 16738 | band_chan_arr[index].flags &= |
---|
16948 | 16739 | ~IEEE80211_CHAN_NO_HT40; |
---|
16949 | | - band_chan_arr[index].flags |= |
---|
16950 | | - IEEE80211_CHAN_NO_HT40PLUS; |
---|
| 16740 | + band_chan_arr[index].flags |= IEEE80211_CHAN_NO_HT40PLUS; |
---|
16951 | 16741 | } else { |
---|
16952 | 16742 | /* It should be one of |
---|
16953 | 16743 | * IEEE80211_CHAN_NO_HT40 or IEEE80211_CHAN_NO_HT40PLUS |
---|
.. | .. |
---|
16972 | 16762 | } |
---|
16973 | 16763 | |
---|
16974 | 16764 | } |
---|
16975 | | - |
---|
16976 | | - WL_CHANNEL_COPY_FLAG(__wl_2ghz_channels); |
---|
16977 | | - WL_CHANNEL_COPY_FLAG(__wl_5ghz_a_channels); |
---|
16978 | | -#ifdef CFG80211_6G_SUPPORT |
---|
16979 | | - WL_CHANNEL_COPY_FLAG(__wl_6ghz_channels); |
---|
16980 | | -#endif /* CFG80211_6G_SUPPORT */ |
---|
16981 | 16765 | |
---|
16982 | 16766 | __wl_band_2ghz.n_channels = ARRAYSIZE(__wl_2ghz_channels); |
---|
16983 | 16767 | __wl_band_5ghz_a.n_channels = ARRAYSIZE(__wl_5ghz_a_channels); |
---|
.. | .. |
---|
17017 | 16801 | s32 err = 0; |
---|
17018 | 16802 | s32 index = 0; |
---|
17019 | 16803 | s32 nmode = 0; |
---|
| 16804 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) || defined(CUSTOMER_HW5) |
---|
17020 | 16805 | u32 j = 0; |
---|
17021 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) |
---|
17022 | 16806 | s32 vhtmode = 0; |
---|
17023 | 16807 | s32 txstreams = 0; |
---|
17024 | 16808 | s32 rxstreams = 0; |
---|
.. | .. |
---|
17027 | 16811 | s32 stbc_tx = 0; |
---|
17028 | 16812 | s32 txbf_bfe_cap = 0; |
---|
17029 | 16813 | s32 txbf_bfr_cap = 0; |
---|
17030 | | -#endif |
---|
17031 | | - s32 txchain = 0; |
---|
17032 | | - s32 rxchain = 0; |
---|
17033 | | - s32 bw_cap_2g = 0, bw_cap_5g = 0, bw_cap_6g = 0; |
---|
| 16814 | +#endif /* KERNEL >= 3.6 || CUSTOMER_HW5 */ |
---|
| 16815 | + s32 bw_cap = 0; |
---|
17034 | 16816 | s32 cur_band = -1; |
---|
17035 | 16817 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS] = {NULL, }; |
---|
17036 | 16818 | |
---|
17037 | | - WL_INFORM(("%s: Enter\n", __FUNCTION__)); |
---|
17038 | 16819 | bzero(bandlist, sizeof(bandlist)); |
---|
17039 | 16820 | err = wldev_ioctl_get(dev, WLC_GET_BANDLIST, bandlist, |
---|
17040 | 16821 | sizeof(bandlist)); |
---|
.. | .. |
---|
17054 | 16835 | WL_ERR(("error reading nmode (%d)\n", err)); |
---|
17055 | 16836 | } |
---|
17056 | 16837 | |
---|
17057 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) |
---|
| 16838 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) || defined(CUSTOMER_HW5) |
---|
17058 | 16839 | err = wldev_iovar_getint(dev, "vhtmode", &vhtmode); |
---|
17059 | 16840 | if (unlikely(err)) { |
---|
17060 | 16841 | WL_ERR(("error reading vhtmode (%d)\n", err)); |
---|
.. | .. |
---|
17096 | 16877 | WL_ERR(("error reading txbf_bfr_cap (%d)\n", err)); |
---|
17097 | 16878 | } |
---|
17098 | 16879 | } |
---|
17099 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) */ |
---|
17100 | | - |
---|
17101 | | - err = wldev_iovar_getint(dev, "txchain", &txchain); |
---|
17102 | | - if (unlikely(err)) { |
---|
17103 | | - WL_ERR(("error reading txchain (%d)\n", err)); |
---|
17104 | | - } else if (txchain == 0x03) { |
---|
17105 | | - txchain = 2; |
---|
17106 | | - } else { |
---|
17107 | | - txchain = 1; |
---|
17108 | | - } |
---|
17109 | | - err = wldev_iovar_getint(dev, "rxchain", &rxchain); |
---|
17110 | | - if (unlikely(err)) { |
---|
17111 | | - WL_ERR(("error reading rxchain (%d)\n", err)); |
---|
17112 | | - } else if (rxchain == 0x03) { |
---|
17113 | | - rxchain = 2; |
---|
17114 | | - } else { |
---|
17115 | | - rxchain = 1; |
---|
17116 | | - } |
---|
| 16880 | +#endif /* KERNEL >= 3.6 || CUSTOMER_HW5 */ |
---|
17117 | 16881 | |
---|
17118 | 16882 | /* For nmode and vhtmode check bw cap */ |
---|
17119 | 16883 | if (nmode || |
---|
17120 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) |
---|
| 16884 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) || defined(CUSTOMER_HW5) |
---|
17121 | 16885 | vhtmode || |
---|
17122 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) */ |
---|
| 16886 | +#endif /* KERNEL >= 3.6 || CUSTOMER_HW5 */ |
---|
17123 | 16887 | 0) { |
---|
17124 | | - uint32 value; |
---|
17125 | | - |
---|
17126 | | - value = WLC_BAND_2G; |
---|
17127 | | - err = wldev_iovar_getint(dev, "bw_cap", &value); |
---|
| 16888 | + err = wldev_iovar_getint(dev, "mimo_bw_cap", &bw_cap); |
---|
17128 | 16889 | if (unlikely(err)) { |
---|
17129 | | - WL_ERR(("error get bw_cap 2g (%d)\n", err)); |
---|
| 16890 | + WL_ERR(("error get mimo_bw_cap (%d)\n", err)); |
---|
17130 | 16891 | } |
---|
17131 | | - bw_cap_2g = dtoh32(value); |
---|
17132 | | - value = WLC_BAND_5G; |
---|
17133 | | - err = wldev_iovar_getint(dev, "bw_cap", &value); |
---|
17134 | | - if (unlikely(err)) { |
---|
17135 | | - WL_ERR(("error get bw_cap 5g (%d)\n", err)); |
---|
17136 | | - } |
---|
17137 | | - bw_cap_5g = dtoh32(value); |
---|
17138 | | - value = WLC_BAND_6G; |
---|
17139 | | - err = wldev_iovar_getint(dev, "bw_cap", &value); |
---|
17140 | | - if (unlikely(err)) { |
---|
17141 | | - WL_ERR(("error get bw_cap 6g (%d)\n", err)); |
---|
17142 | | - } |
---|
17143 | | - bw_cap_6g = dtoh32(value); |
---|
17144 | 16892 | } |
---|
17145 | 16893 | |
---|
17146 | 16894 | #ifdef WL_6G_BAND |
---|
17147 | 16895 | wl_is_6g_supported(cfg, bandlist, bandlist[0]); |
---|
17148 | 16896 | #endif /* WL_6G_BAND */ |
---|
17149 | 16897 | |
---|
17150 | | - err = wl_construct_reginfo(cfg, bw_cap_2g, bw_cap_5g, bw_cap_6g); |
---|
| 16898 | + err = wl_construct_reginfo(cfg, bw_cap); |
---|
17151 | 16899 | if (err) { |
---|
17152 | 16900 | WL_ERR(("wl_construct_reginfo() fails err=%d\n", err)); |
---|
17153 | 16901 | if (err != BCME_UNSUPPORTED) |
---|
.. | .. |
---|
17157 | 16905 | wiphy = bcmcfg_to_wiphy(cfg); |
---|
17158 | 16906 | nband = bandlist[0]; |
---|
17159 | 16907 | |
---|
17160 | | - wiphy->available_antennas_tx = txchain; |
---|
17161 | | - wiphy->available_antennas_rx = rxchain; |
---|
17162 | | - |
---|
17163 | 16908 | for (i = 1; i <= nband && i < ARRAYSIZE(bandlist); i++) { |
---|
17164 | 16909 | index = -1; |
---|
17165 | 16910 | |
---|
.. | .. |
---|
17167 | 16912 | bands[IEEE80211_BAND_2GHZ] = |
---|
17168 | 16913 | &__wl_band_2ghz; |
---|
17169 | 16914 | index = IEEE80211_BAND_2GHZ; |
---|
17170 | | - (void)memset_s(bands[index]->ht_cap.mcs.rx_mask, IEEE80211_HT_MCS_MASK_LEN, |
---|
17171 | | - 0, IEEE80211_HT_MCS_MASK_LEN); |
---|
17172 | | - if (nmode && (WL_BW_CAP_40MHZ(bw_cap_2g))) { |
---|
17173 | | - bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40 | |
---|
17174 | | - IEEE80211_HT_CAP_SGI_40; |
---|
17175 | | - bands[index]->ht_cap.mcs.rx_mask[4] = 0x01; |
---|
17176 | | - bands[index]->ht_cap.mcs.rx_highest = |
---|
17177 | | - cpu_to_le16(150 * rxchain); /* Mbps */ |
---|
17178 | | - } else { |
---|
17179 | | - bands[index]->ht_cap.mcs.rx_highest = |
---|
17180 | | - cpu_to_le16(72 * rxchain); /* Mbps */ |
---|
17181 | | - } |
---|
| 16915 | + if (bw_cap == WLC_N_BW_40ALL) |
---|
| 16916 | + bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40; |
---|
17182 | 16917 | } else { |
---|
17183 | 16918 | if (bandlist[i] == WLC_BAND_6G) { |
---|
17184 | 16919 | #ifdef CFG80211_6G_SUPPORT |
---|
.. | .. |
---|
17209 | 16944 | continue; |
---|
17210 | 16945 | } |
---|
17211 | 16946 | |
---|
17212 | | - (void)memset_s(bands[index]->ht_cap.mcs.rx_mask, IEEE80211_HT_MCS_MASK_LEN, |
---|
17213 | | - 0, IEEE80211_HT_MCS_MASK_LEN); |
---|
17214 | | - if (nmode && (WL_BW_CAP_40MHZ(bw_cap_5g))) { |
---|
17215 | | - bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40 | |
---|
17216 | | - IEEE80211_HT_CAP_SGI_40; |
---|
17217 | | - bands[index]->ht_cap.mcs.rx_mask[4] = 0x01; |
---|
17218 | | - bands[index]->ht_cap.mcs.rx_highest = cpu_to_le16(150 * rxchain); |
---|
17219 | | - } else { |
---|
17220 | | - bands[index]->ht_cap.mcs.rx_highest = cpu_to_le16(72 * rxchain); |
---|
17221 | | - } |
---|
| 16947 | + if (nmode && (bw_cap == WLC_N_BW_40ALL || bw_cap == WLC_N_BW_20IN2G_40IN5G)) |
---|
| 16948 | + bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40; |
---|
17222 | 16949 | |
---|
17223 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) |
---|
| 16950 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) || defined(CUSTOMER_HW5) |
---|
17224 | 16951 | /* VHT capabilities. */ |
---|
17225 | 16952 | if (vhtmode) { |
---|
17226 | 16953 | /* Supported */ |
---|
17227 | 16954 | bands[index]->vht_cap.vht_supported = TRUE; |
---|
17228 | | - bands[index]->vht_cap.vht_mcs.tx_highest = |
---|
17229 | | - cpu_to_le16(433 * txstreams); /* Mbps */ |
---|
17230 | | - bands[index]->vht_cap.vht_mcs.rx_highest = |
---|
17231 | | - cpu_to_le16(433 * txstreams); /* Mbps */ |
---|
17232 | 16955 | |
---|
17233 | 16956 | for (j = 1; j <= VHT_CAP_MCS_MAP_NSS_MAX; j++) { |
---|
17234 | 16957 | /* TX stream rates. */ |
---|
.. | .. |
---|
17251 | 16974 | } |
---|
17252 | 16975 | |
---|
17253 | 16976 | /* Capabilities */ |
---|
17254 | | - bands[index]->vht_cap.cap |= IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN |
---|
17255 | | - | IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN; |
---|
17256 | 16977 | /* 80 MHz is mandatory */ |
---|
17257 | 16978 | bands[index]->vht_cap.cap |= |
---|
17258 | 16979 | IEEE80211_VHT_CAP_SHORT_GI_80; |
---|
17259 | 16980 | |
---|
17260 | | - if (WL_BW_CAP_160MHZ(bw_cap_5g)) { |
---|
| 16981 | + if (WL_BW_CAP_160MHZ(bw_cap)) { |
---|
17261 | 16982 | bands[index]->vht_cap.cap |= |
---|
17262 | 16983 | IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; |
---|
17263 | 16984 | bands[index]->vht_cap.cap |= |
---|
.. | .. |
---|
17309 | 17030 | bands[index]->vht_cap.vht_mcs.rx_mcs_map, |
---|
17310 | 17031 | bands[index]->vht_cap.vht_mcs.tx_mcs_map)); |
---|
17311 | 17032 | } |
---|
17312 | | -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) */ |
---|
| 17033 | +#endif /* KERNEL >= 3.6 || CUSTOMER_HW5 */ |
---|
17313 | 17034 | } |
---|
17314 | 17035 | |
---|
17315 | 17036 | if ((index >= 0) && nmode) { |
---|
.. | .. |
---|
17319 | 17040 | bands[index]->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; |
---|
17320 | 17041 | bands[index]->ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16; |
---|
17321 | 17042 | /* An HT shall support all EQM rates for one spatial stream */ |
---|
17322 | | - for (j = 0; j < rxchain; j++) { |
---|
17323 | | - bands[index]->ht_cap.mcs.rx_mask[j] = 0xff; |
---|
17324 | | - } |
---|
17325 | | - bands[index]->ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; |
---|
| 17043 | + bands[index]->ht_cap.mcs.rx_mask[0] = 0xff; |
---|
17326 | 17044 | } |
---|
17327 | 17045 | |
---|
17328 | 17046 | } |
---|
.. | .. |
---|
17407 | 17125 | /* Start the event logging */ |
---|
17408 | 17126 | wl_add_remove_eventmsg(ndev, WLC_E_TRACE, TRUE); |
---|
17409 | 17127 | #endif /* SHOW_LOGTRACE */ |
---|
17410 | | -#if defined(BCMDBUS) |
---|
17411 | | - if (!dhd->dhd_console_ms) |
---|
17412 | | - wl_add_remove_eventmsg(ndev, WLC_E_TRACE, FALSE); |
---|
17413 | | -#endif |
---|
17414 | 17128 | |
---|
17415 | 17129 | (void)memcpy_s(wdev->wiphy->perm_addr, ETHER_ADDR_LEN, |
---|
17416 | 17130 | bcmcfg_to_prmry_ndev(cfg)->perm_addr, ETHER_ADDR_LEN); |
---|
.. | .. |
---|
17567 | 17281 | return err; |
---|
17568 | 17282 | } |
---|
17569 | 17283 | |
---|
17570 | | -#ifdef BCMDBUS |
---|
17571 | | -s32 |
---|
17572 | | -__wl_cfg80211_up_resume(dhd_pub_t *dhd) |
---|
17573 | | -{ |
---|
17574 | | - struct net_device *ndev = dhd_linux_get_primary_netdev(dhd); |
---|
17575 | | - struct bcm_cfg80211 *cfg; |
---|
17576 | | - struct wireless_dev *wdev; |
---|
17577 | | - s32 err = 0; |
---|
17578 | | -#ifdef WL_HOST_BAND_MGMT |
---|
17579 | | - s32 ret = 0; |
---|
17580 | | -#endif /* WL_HOST_BAND_MGMT */ |
---|
17581 | | - u16 wl_iftype = 0; |
---|
17582 | | - u16 wl_mode = 0; |
---|
17583 | | - |
---|
17584 | | - WL_DBG(("In\n")); |
---|
17585 | | - |
---|
17586 | | - if (!ndev) |
---|
17587 | | - return -EINVAL; |
---|
17588 | | - cfg = wl_get_cfg(ndev); |
---|
17589 | | - wdev = ndev->ieee80211_ptr; |
---|
17590 | | - if (!cfg || !wdev) |
---|
17591 | | - return -EINVAL; |
---|
17592 | | - |
---|
17593 | | -#if defined(BCMDONGLEHOST) |
---|
17594 | | - err = dhd_config_dongle(cfg); |
---|
17595 | | - if (unlikely(err)) |
---|
17596 | | - return err; |
---|
17597 | | -#endif /* defined(BCMDONGLEHOST) */ |
---|
17598 | | - |
---|
17599 | | -#ifdef SHOW_LOGTRACE |
---|
17600 | | - /* Start the event logging */ |
---|
17601 | | - wl_add_remove_eventmsg(ndev, WLC_E_TRACE, TRUE); |
---|
17602 | | -#endif /* SHOW_LOGTRACE */ |
---|
17603 | | -#if defined(BCMDBUS) |
---|
17604 | | - if (!dhd->dhd_console_ms) |
---|
17605 | | - wl_add_remove_eventmsg(ndev, WLC_E_TRACE, FALSE); |
---|
17606 | | -#endif |
---|
17607 | | - |
---|
17608 | | - if (cfg80211_to_wl_iftype(wdev->iftype, &wl_iftype, &wl_mode) < 0) { |
---|
17609 | | - return -EINVAL; |
---|
17610 | | - } |
---|
17611 | | - if (!dhd->fw_preinit) { |
---|
17612 | | - err = wl_config_infra(cfg, ndev, wl_iftype); |
---|
17613 | | - if (unlikely(err && err != -EINPROGRESS)) { |
---|
17614 | | - WL_ERR(("wl_config_infra failed\n")); |
---|
17615 | | - if (err == -1) { |
---|
17616 | | - WL_ERR(("return error %d\n", err)); |
---|
17617 | | - return err; |
---|
17618 | | - } |
---|
17619 | | - } |
---|
17620 | | - } |
---|
17621 | | - |
---|
17622 | | -#ifdef WL_HOST_BAND_MGMT |
---|
17623 | | - /* By default the curr_band is initialized to BAND_AUTO */ |
---|
17624 | | - if ((ret = wl_cfg80211_set_band(ndev, WLC_BAND_AUTO)) < 0) { |
---|
17625 | | - if (ret == BCME_UNSUPPORTED) { |
---|
17626 | | - /* Don't fail the initialization, lets just |
---|
17627 | | - * fall back to the original method |
---|
17628 | | - */ |
---|
17629 | | - WL_ERR(("WL_HOST_BAND_MGMT defined, " |
---|
17630 | | - "but roam_band iovar not supported \n")); |
---|
17631 | | - } else { |
---|
17632 | | - WL_ERR(("roam_band failed. ret=%d", ret)); |
---|
17633 | | - err = -1; |
---|
17634 | | - } |
---|
17635 | | - } |
---|
17636 | | -#endif /* WL_HOST_BAND_MGMT */ |
---|
17637 | | - return err; |
---|
17638 | | -} |
---|
17639 | | -#endif /* BCMDBUS */ |
---|
17640 | | - |
---|
17641 | 17284 | static s32 __wl_cfg80211_down(struct bcm_cfg80211 *cfg) |
---|
17642 | 17285 | { |
---|
17643 | 17286 | s32 err = 0; |
---|
.. | .. |
---|
17786 | 17429 | struct wiphy *wiphy = bcmcfg_to_wiphy(cfg); |
---|
17787 | 17430 | struct wireless_dev *wdev = ndev->ieee80211_ptr; |
---|
17788 | 17431 | struct cfg80211_bss *bss = CFG80211_GET_BSS(wiphy, NULL, latest_bssid, |
---|
17789 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(CFG80211_BKPORT_MLO) |
---|
17790 | | - wdev->u.client.ssid, wdev->u.client.ssid_len); |
---|
17791 | | -#else |
---|
17792 | 17432 | wdev->ssid, wdev->ssid_len); |
---|
17793 | | -#endif /* CFG80211_BKPORT_MLO */ |
---|
17794 | 17433 | |
---|
17795 | 17434 | BCM_REFERENCE(bss); |
---|
17796 | 17435 | |
---|
.. | .. |
---|
17949 | 17588 | if (init_roam_cache(cfg, ioctl_version) == 0) { |
---|
17950 | 17589 | /* Enable support for Roam cache */ |
---|
17951 | 17590 | cfg->rcc_enabled = true; |
---|
17952 | | - WL_MSG(net->name, "Roam channel cache enabled\n"); |
---|
| 17591 | + WL_ERR(("Roam channel cache enabled\n")); |
---|
17953 | 17592 | } else { |
---|
17954 | 17593 | WL_ERR(("Failed to enable RCC.\n")); |
---|
17955 | 17594 | } |
---|
.. | .. |
---|
19699 | 19338 | while (ie) { |
---|
19700 | 19339 | if (count >= MAX_VNDR_IE_NUMBER) |
---|
19701 | 19340 | break; |
---|
19702 | | -#ifdef HOSTAPD_EID_EXTENSION_SUPPORT |
---|
19703 | | - if (ie->id == DOT11_MNG_VS_ID || (ie->id == DOT11_MNG_ID_EXT_ID)) |
---|
19704 | | -#else |
---|
19705 | | - if (ie->id == DOT11_MNG_VS_ID) |
---|
19706 | | -#endif |
---|
19707 | | - { |
---|
| 19341 | + if (ie->id == DOT11_MNG_VS_ID || (ie->id == DOT11_MNG_ID_EXT_ID)) { |
---|
19708 | 19342 | vndrie = (const vndr_ie_t *) ie; |
---|
19709 | 19343 | if (ie->id == DOT11_MNG_ID_EXT_ID) { |
---|
19710 | 19344 | /* len should be bigger than sizeof ID extn field at least */ |
---|
.. | .. |
---|
20044 | 19678 | return 0; |
---|
20045 | 19679 | } |
---|
20046 | 19680 | |
---|
20047 | | -#ifdef GET_FW_IE_DATA |
---|
20048 | | -static void |
---|
20049 | | -wl_dump_ie_buf(vndr_ie_buf_t *ie_getbuf) |
---|
20050 | | -{ |
---|
20051 | | - uchar *iebuf; |
---|
20052 | | - uchar *data; |
---|
20053 | | - int tot_ie, pktflag, iecount, datalen; |
---|
20054 | | - vndr_ie_info_t *ie_info; |
---|
20055 | | - vndr_ie_t *ie; |
---|
20056 | | - |
---|
20057 | | - memcpy(&tot_ie, (void *)&ie_getbuf->iecount, sizeof(int)); |
---|
20058 | | - tot_ie = dtoh32(tot_ie); |
---|
20059 | | - iebuf = (uchar *)&ie_getbuf->vndr_ie_list[0]; |
---|
20060 | | - |
---|
20061 | | - printf("-----------------\n"); |
---|
20062 | | - printf("Total IEs %d\n", tot_ie); |
---|
20063 | | - for (iecount = 0; iecount < tot_ie; iecount++) { |
---|
20064 | | - ie_info = (vndr_ie_info_t *) iebuf; |
---|
20065 | | - memcpy(&pktflag, (void *)&ie_info->pktflag, sizeof(uint32)); |
---|
20066 | | - pktflag = dtoh32(pktflag); |
---|
20067 | | - iebuf += sizeof(uint32); |
---|
20068 | | - ie = &ie_info->vndr_ie_data; |
---|
20069 | | - data = &ie->data[0]; |
---|
20070 | | - datalen = ie->len - VNDR_IE_MIN_LEN; |
---|
20071 | | - printf("index=%d, pktflag=0x%x\n", iecount, pktflag); |
---|
20072 | | - prhex("IE", (u8 *)ie, ie->len+VNDR_IE_HDR_LEN); |
---|
20073 | | - |
---|
20074 | | - iebuf += ie->len + VNDR_IE_HDR_LEN; |
---|
20075 | | - } |
---|
20076 | | - printf("-----------------\n"); |
---|
20077 | | - printf("\n"); |
---|
20078 | | -} |
---|
20079 | | -#endif /* GET_FW_IE_DATA */ |
---|
20080 | | - |
---|
20081 | 19681 | static void |
---|
20082 | 19682 | wl_print_fw_ie_data(struct bcm_cfg80211 *cfg, struct net_device *ndev, s32 bssidx) |
---|
20083 | 19683 | { |
---|
.. | .. |
---|
20089 | 19689 | bssidx, &cfg->ioctl_buf_sync); |
---|
20090 | 19690 | if (ret == BCME_OK) { |
---|
20091 | 19691 | ies = (vndr_ie_buf_t *)cfg->ioctl_buf; |
---|
| 19692 | + WL_INFORM_MEM(("FW IE count:%d ", ies->iecount)); |
---|
20092 | 19693 | #ifdef GET_FW_IE_DATA |
---|
20093 | | - wl_dump_ie_buf((vndr_ie_buf_t *)cfg->ioctl_buf); |
---|
20094 | | -#else |
---|
20095 | | - WL_MSG(ndev->name, "FW IE count:%d\n", ies->iecount); |
---|
| 19694 | + if (wl_dbg_level & WL_DBG_DBG) { |
---|
| 19695 | + int i = 0; |
---|
| 19696 | + /* If debug enabled, print each IE */ |
---|
| 19697 | + for (i = 0; i < ies->iecount; i++) { |
---|
| 19698 | + vndr_ie_info_t *info = &ies->vndr_ie_list[i]; |
---|
| 19699 | + WL_DBG_MEM(("pktflag:0x%x\n", info->pktflag)); |
---|
| 19700 | + prhex("IE:", (u8 *)&info->vndr_ie_data, |
---|
| 19701 | + info->vndr_ie_data.len + TLV_HDR_LEN); |
---|
| 19702 | + } |
---|
| 19703 | + } |
---|
20096 | 19704 | #endif /* GET_FW_IE_DATA */ |
---|
20097 | 19705 | } else { |
---|
20098 | 19706 | WL_ERR(("IE retrieval failed! ret:%d\n", ret)); |
---|
.. | .. |
---|
20116 | 19724 | u32 parsed_ie_buf_len = 0; |
---|
20117 | 19725 | struct parsed_vndr_ies old_vndr_ies; |
---|
20118 | 19726 | struct parsed_vndr_ies new_vndr_ies; |
---|
20119 | | - int del_add_cnt = 0; |
---|
20120 | 19727 | s32 i; |
---|
20121 | 19728 | u8 *ptr; |
---|
20122 | 19729 | s32 remained_buf_len; |
---|
.. | .. |
---|
20260 | 19867 | |
---|
20261 | 19868 | curr_ie_buf += del_add_ie_buf_len; |
---|
20262 | 19869 | total_ie_buf_len += del_add_ie_buf_len; |
---|
20263 | | - del_add_cnt++; |
---|
20264 | 19870 | } |
---|
20265 | 19871 | } |
---|
20266 | 19872 | |
---|
.. | .. |
---|
20310 | 19916 | *mgmt_ie_len += vndrie_info->ie_len; |
---|
20311 | 19917 | curr_ie_buf += del_add_ie_buf_len; |
---|
20312 | 19918 | total_ie_buf_len += del_add_ie_buf_len; |
---|
20313 | | - del_add_cnt++; |
---|
20314 | 19919 | } |
---|
20315 | 19920 | } |
---|
20316 | 19921 | |
---|
20317 | 19922 | if (total_ie_buf_len && cfg->ioctl_buf != NULL) { |
---|
20318 | | -#ifdef VNDR_IE_WAR |
---|
20319 | | - curr_ie_buf = g_mgmt_ie_buf; |
---|
20320 | | - for (i=0; i<del_add_cnt; i++) { |
---|
20321 | | - vndr_ie_setbuf_t *vndr_ie_setbuf = (vndr_ie_setbuf_t *)curr_ie_buf; |
---|
20322 | | - u32 curr_ie_buf_len; |
---|
20323 | | - curr_ie_buf_len = |
---|
20324 | | - (u8*)&vndr_ie_setbuf->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.oui[0] - |
---|
20325 | | - (u8*)vndr_ie_setbuf; |
---|
20326 | | - curr_ie_buf_len += vndr_ie_setbuf->vndr_ie_buffer.vndr_ie_list[0].vndr_ie_data.len; |
---|
20327 | | - ret = wldev_iovar_setbuf_bsscfg(ndev, "vndr_ie", curr_ie_buf, |
---|
20328 | | - curr_ie_buf_len, cfg->ioctl_buf, WLC_IOCTL_MAXLEN, |
---|
20329 | | - bssidx, &cfg->ioctl_buf_sync); |
---|
20330 | | - if (ret) |
---|
20331 | | - break; |
---|
20332 | | - curr_ie_buf += curr_ie_buf_len; |
---|
20333 | | - } |
---|
20334 | | -#else |
---|
20335 | | - ret = wldev_iovar_setbuf_bsscfg(ndev, "vndr_ie", g_mgmt_ie_buf, |
---|
| 19923 | + ret = wldev_iovar_setbuf_bsscfg(ndev, "vndr_ie", g_mgmt_ie_buf, |
---|
20336 | 19924 | total_ie_buf_len, cfg->ioctl_buf, WLC_IOCTL_MAXLEN, |
---|
20337 | 19925 | bssidx, &cfg->ioctl_buf_sync); |
---|
20338 | | -#endif |
---|
20339 | 19926 | if (ret) { |
---|
20340 | 19927 | WL_ERR(("vndr_ie set error :%d\n", ret)); |
---|
20341 | 19928 | if (ret == BCME_NOTFOUND) { |
---|