Lines Matching +full:tlv +full:- +full:layout
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2011-2020 NXP
21 /* Memory needed to store a max sized Channel List TLV for a firmware scan */
30 /* Memory needed to store a max number/size WildCard SSID TLV for a firmware
72 _mwifiex_dbg(priv->adapter, log_level, in _dbg_security_flags()
75 bss_desc->bcn_wpa_ie ? in _dbg_security_flags()
76 bss_desc->bcn_wpa_ie->vend_hdr.element_id : 0, in _dbg_security_flags()
77 bss_desc->bcn_rsn_ie ? in _dbg_security_flags()
78 bss_desc->bcn_rsn_ie->ieee_hdr.element_id : 0, in _dbg_security_flags()
79 priv->sec_info.wep_enabled ? "e" : "d", in _dbg_security_flags()
80 priv->sec_info.wpa_enabled ? "e" : "d", in _dbg_security_flags()
81 priv->sec_info.wpa2_enabled ? "e" : "d", in _dbg_security_flags()
82 priv->sec_info.encryption_mode, in _dbg_security_flags()
83 bss_desc->privacy); in _dbg_security_flags()
91 return (ie && ie->ieee_hdr.element_id == key); in has_ieee_hdr()
97 return (ie && ie->vend_hdr.element_id == key); in has_vendor_hdr()
111 count = iebody->ptk_cnt[0]; in mwifiex_search_oui_in_ie()
118 if (!memcmp(iebody->ptk_body, oui, sizeof(iebody->ptk_body))) in mwifiex_search_oui_in_ie()
121 --count; in mwifiex_search_oui_in_ie()
124 sizeof(iebody->ptk_body)); in mwifiex_search_oui_in_ie()
145 if (has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN)) { in mwifiex_is_rsn_oui_present()
147 (((u8 *) bss_desc->bcn_rsn_ie->data) + in mwifiex_is_rsn_oui_present()
171 if (has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC)) { in mwifiex_is_wpa_oui_present()
172 iebody = (struct ie_body *)((u8 *)bss_desc->bcn_wpa_ie->data + in mwifiex_is_wpa_oui_present()
190 if (priv->sec_info.wapi_enabled && in mwifiex_is_bss_wapi()
191 has_ieee_hdr(bss_desc->bcn_wapi_ie, WLAN_EID_BSS_AC_ACCESS_DELAY)) in mwifiex_is_bss_wapi()
204 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_no_sec()
205 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_no_sec()
206 !has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) && in mwifiex_is_bss_no_sec()
207 !has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) && in mwifiex_is_bss_no_sec()
208 !priv->sec_info.encryption_mode && !bss_desc->privacy) { in mwifiex_is_bss_no_sec()
222 if (priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_static_wep()
223 !priv->sec_info.wpa2_enabled && bss_desc->privacy) { in mwifiex_is_bss_static_wep()
237 if (!priv->sec_info.wep_enabled && priv->sec_info.wpa_enabled && in mwifiex_is_bss_wpa()
238 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_wpa()
239 has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) in mwifiex_is_bss_wpa()
242 * LinkSys WRT54G && bss_desc->privacy in mwifiex_is_bss_wpa()
259 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_wpa2()
260 priv->sec_info.wpa2_enabled && in mwifiex_is_bss_wpa2()
261 has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN)) { in mwifiex_is_bss_wpa2()
264 * LinkSys WRT54G && bss_desc->privacy in mwifiex_is_bss_wpa2()
280 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_adhoc_aes()
281 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_adhoc_aes()
282 !has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) && in mwifiex_is_bss_adhoc_aes()
283 !has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) && in mwifiex_is_bss_adhoc_aes()
284 !priv->sec_info.encryption_mode && bss_desc->privacy) { in mwifiex_is_bss_adhoc_aes()
298 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_dynamic_wep()
299 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_dynamic_wep()
300 !has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) && in mwifiex_is_bss_dynamic_wep()
301 !has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) && in mwifiex_is_bss_dynamic_wep()
302 priv->sec_info.encryption_mode && bss_desc->privacy) { in mwifiex_is_bss_dynamic_wep()
313 * WEP WPA WPA2 ad-hoc encrypt Network
320 * 0 0 0 1 NONE 1 0 0 yes Ad-hoc AES
331 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_is_network_compatible()
333 bss_desc->disable_11n = false; in mwifiex_is_network_compatible()
336 if (priv->media_connected && in mwifiex_is_network_compatible()
337 (priv->bss_mode == NL80211_IFTYPE_STATION) && in mwifiex_is_network_compatible()
338 (bss_desc->bss_mode == NL80211_IFTYPE_STATION)) in mwifiex_is_network_compatible()
341 if (priv->wps.session_enable) { in mwifiex_is_network_compatible()
347 if (bss_desc->chan_sw_ie_present) { in mwifiex_is_network_compatible()
350 return -1; in mwifiex_is_network_compatible()
359 if (bss_desc->bss_mode == mode) { in mwifiex_is_network_compatible()
367 bss_desc->disable_11n = true; in mwifiex_is_network_compatible()
371 if (((priv->adapter->config_bands & BAND_GN || in mwifiex_is_network_compatible()
372 priv->adapter->config_bands & BAND_AN) && in mwifiex_is_network_compatible()
373 bss_desc->bcn_ht_cap) && in mwifiex_is_network_compatible()
382 bss_desc->disable_11n = true; in mwifiex_is_network_compatible()
384 return -1; in mwifiex_is_network_compatible()
390 if (((priv->adapter->config_bands & BAND_GN || in mwifiex_is_network_compatible()
391 priv->adapter->config_bands & BAND_AN) && in mwifiex_is_network_compatible()
392 bss_desc->bcn_ht_cap) && in mwifiex_is_network_compatible()
401 bss_desc->disable_11n = true; in mwifiex_is_network_compatible()
403 return -1; in mwifiex_is_network_compatible()
408 /* Ad-hoc AES enabled */ in mwifiex_is_network_compatible()
417 return -1; in mwifiex_is_network_compatible()
421 return -1; in mwifiex_is_network_compatible()
442 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_create_channel_list()
447 if (!priv->wdev.wiphy->bands[band]) in mwifiex_scan_create_channel_list()
450 sband = priv->wdev.wiphy->bands[band]; in mwifiex_scan_create_channel_list()
452 for (i = 0; (i < sband->n_channels) ; i++) { in mwifiex_scan_create_channel_list()
453 ch = &sband->channels[i]; in mwifiex_scan_create_channel_list()
454 if (ch->flags & IEEE80211_CHAN_DISABLED) in mwifiex_scan_create_channel_list()
459 user_scan_in->chan_list[0].scan_time) in mwifiex_scan_create_channel_list()
461 cpu_to_le16((u16) user_scan_in-> in mwifiex_scan_create_channel_list()
463 else if ((ch->flags & IEEE80211_CHAN_NO_IR) || in mwifiex_scan_create_channel_list()
464 (ch->flags & IEEE80211_CHAN_RADAR)) in mwifiex_scan_create_channel_list()
466 cpu_to_le16(adapter->passive_scan_time); in mwifiex_scan_create_channel_list()
469 cpu_to_le16(adapter->active_scan_time); in mwifiex_scan_create_channel_list()
471 if (ch->flags & IEEE80211_CHAN_NO_IR) in mwifiex_scan_create_channel_list()
479 (u32) ch->hw_value; in mwifiex_scan_create_channel_list()
485 !((ch->flags & IEEE80211_CHAN_NO_IR) || in mwifiex_scan_create_channel_list()
486 (ch->flags & IEEE80211_CHAN_RADAR))) in mwifiex_scan_create_channel_list()
488 cpu_to_le16(adapter->specific_scan_time); in mwifiex_scan_create_channel_list()
497 /* This function creates a channel list tlv for bgscan config, based
510 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_bgscan_create_channel_list()
514 if (!priv->wdev.wiphy->bands[band]) in mwifiex_bgscan_create_channel_list()
517 sband = priv->wdev.wiphy->bands[band]; in mwifiex_bgscan_create_channel_list()
519 for (i = 0; (i < sband->n_channels) ; i++) { in mwifiex_bgscan_create_channel_list()
520 ch = &sband->channels[i]; in mwifiex_bgscan_create_channel_list()
521 if (ch->flags & IEEE80211_CHAN_DISABLED) in mwifiex_bgscan_create_channel_list()
525 if (bgscan_cfg_in->chan_list[0].scan_time) in mwifiex_bgscan_create_channel_list()
527 cpu_to_le16((u16)bgscan_cfg_in-> in mwifiex_bgscan_create_channel_list()
529 else if (ch->flags & IEEE80211_CHAN_NO_IR) in mwifiex_bgscan_create_channel_list()
531 cpu_to_le16(adapter->passive_scan_time); in mwifiex_bgscan_create_channel_list()
534 cpu_to_le16(adapter-> in mwifiex_bgscan_create_channel_list()
537 if (ch->flags & IEEE80211_CHAN_NO_IR) in mwifiex_bgscan_create_channel_list()
545 (u32)ch->hw_value; in mwifiex_bgscan_create_channel_list()
552 /* This function appends rate TLV to scan config command. */
564 tlv_pos = (u8 *)scan_cfg_out->tlv_buf + scan_cfg_out->tlv_buf_len; in mwifiex_append_rate_tlv()
566 if (priv->scan_request) in mwifiex_append_rate_tlv()
572 mwifiex_dbg(priv->adapter, CMD, in mwifiex_append_rate_tlv()
576 rates_tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES); in mwifiex_append_rate_tlv()
577 rates_tlv->header.len = cpu_to_le16((u16) rates_size); in mwifiex_append_rate_tlv()
578 memcpy(rates_tlv->rates, rates, rates_size); in mwifiex_append_rate_tlv()
579 scan_cfg_out->tlv_buf_len += sizeof(rates_tlv->header) + rates_size; in mwifiex_append_rate_tlv()
589 * with any requested TLVs. This function splits the channel TLV into maximum
590 * channels supported per scan lists and sends the portion of the channel TLV,
601 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_channel_list()
610 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_scan_channel_list()
613 return -1; in mwifiex_scan_channel_list()
619 chan_tlv_out->header.type = cpu_to_le16(TLV_TYPE_CHANLIST); in mwifiex_scan_channel_list()
628 while (tmp_chan_list->chan_number) { in mwifiex_scan_channel_list()
633 chan_tlv_out->header.len = 0; in mwifiex_scan_channel_list()
637 * Construct the Channel TLV for the scan command. Continue to in mwifiex_scan_channel_list()
639 * - the tlv_idx hits the maximum configured per scan command in mwifiex_scan_channel_list()
640 * - the next channel to insert is 0 (end of desired channel in mwifiex_scan_channel_list()
642 * - done_early is set (controlling individual scanning of in mwifiex_scan_channel_list()
646 tmp_chan_list->chan_number && !done_early) { in mwifiex_scan_channel_list()
648 if (tmp_chan_list->chan_number == priv->csa_chan) { in mwifiex_scan_channel_list()
653 radio_type = tmp_chan_list->radio_type; in mwifiex_scan_channel_list()
654 mwifiex_dbg(priv->adapter, INFO, in mwifiex_scan_channel_list()
657 tmp_chan_list->chan_number, in mwifiex_scan_channel_list()
658 tmp_chan_list->radio_type, in mwifiex_scan_channel_list()
659 tmp_chan_list->chan_scan_mode_bitmap in mwifiex_scan_channel_list()
661 (tmp_chan_list->chan_scan_mode_bitmap in mwifiex_scan_channel_list()
663 le16_to_cpu(tmp_chan_list->max_scan_time)); in mwifiex_scan_channel_list()
665 /* Copy the current channel TLV to the command being in mwifiex_scan_channel_list()
667 memcpy(&chan_tlv_out->chan_scan_param[tlv_idx], in mwifiex_scan_channel_list()
669 sizeof(*chan_tlv_out->chan_scan_param)); in mwifiex_scan_channel_list()
671 /* Increment the TLV header length by the size in mwifiex_scan_channel_list()
673 le16_unaligned_add_cpu(&chan_tlv_out->header.len, in mwifiex_scan_channel_list()
674 sizeof(*chan_tlv_out->chan_scan_param)); in mwifiex_scan_channel_list()
677 * The tlv buffer length is set to the number of bytes in mwifiex_scan_channel_list()
678 * of the between the channel tlv pointer and the start in mwifiex_scan_channel_list()
679 * of the tlv buffer. This compensates for any TLVs in mwifiex_scan_channel_list()
682 scan_cfg_out->tlv_buf_len = (u32) ((u8 *) chan_tlv_out - in mwifiex_scan_channel_list()
683 scan_cfg_out->tlv_buf); in mwifiex_scan_channel_list()
685 /* Add the size of the channel tlv header and the data in mwifiex_scan_channel_list()
687 scan_cfg_out->tlv_buf_len += in mwifiex_scan_channel_list()
688 (sizeof(chan_tlv_out->header) in mwifiex_scan_channel_list()
689 + le16_to_cpu(chan_tlv_out->header.len)); in mwifiex_scan_channel_list()
691 /* Increment the index to the channel tlv we are in mwifiex_scan_channel_list()
697 le16_to_cpu(tmp_chan_list->max_scan_time); in mwifiex_scan_channel_list()
705 (tmp_chan_list->chan_number == 1 || in mwifiex_scan_channel_list()
706 tmp_chan_list->chan_number == 6 || in mwifiex_scan_channel_list()
707 tmp_chan_list->chan_number == 11)) in mwifiex_scan_channel_list()
718 (tmp_chan_list->chan_number == 1 || in mwifiex_scan_channel_list()
719 tmp_chan_list->chan_number == 6 || in mwifiex_scan_channel_list()
720 tmp_chan_list->chan_number == 11)) in mwifiex_scan_channel_list()
727 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_scan_channel_list()
732 ret = -1; in mwifiex_scan_channel_list()
741 if (priv->adapter->ext_scan) in mwifiex_scan_channel_list()
751 * scan_cfg_out->buf is overwritten with new one. in mwifiex_scan_channel_list()
753 scan_cfg_out->tlv_buf_len -= in mwifiex_scan_channel_list()
763 return -1; in mwifiex_scan_channel_list()
780 * - SSID filter
781 * - BSSID filter
782 * - Number of Probes to be sent
783 * - Channel list
797 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_config_scan()
821 scan_cfg_out->tlv_buf_len = 0; in mwifiex_config_scan()
823 /* Running tlv pointer. Assigned to chan_list_out at end of function in mwifiex_config_scan()
826 tlv_pos = scan_cfg_out->tlv_buf; in mwifiex_config_scan()
828 /* Initialize the scan as un-filtered; the flag is later set to TRUE in mwifiex_config_scan()
847 scan_cfg_out->bss_mode = in mwifiex_config_scan()
848 (u8)(user_scan_in->bss_mode ?: adapter->scan_mode); in mwifiex_config_scan()
852 num_probes = user_scan_in->num_probes ?: adapter->scan_probes; in mwifiex_config_scan()
856 * if non-zero. If not set, it will remain disabled in mwifiex_config_scan()
859 memcpy(scan_cfg_out->specific_bssid, in mwifiex_config_scan()
860 user_scan_in->specific_bssid, in mwifiex_config_scan()
861 sizeof(scan_cfg_out->specific_bssid)); in mwifiex_config_scan()
863 memcpy(tmpaddr, scan_cfg_out->specific_bssid, ETH_ALEN); in mwifiex_config_scan()
865 if (adapter->ext_scan && in mwifiex_config_scan()
869 bssid_tlv->header.type = cpu_to_le16(TLV_TYPE_BSSID); in mwifiex_config_scan()
870 bssid_tlv->header.len = cpu_to_le16(ETH_ALEN); in mwifiex_config_scan()
871 memcpy(bssid_tlv->bssid, user_scan_in->specific_bssid, in mwifiex_config_scan()
876 for (i = 0; i < user_scan_in->num_ssids; i++) { in mwifiex_config_scan()
877 ssid_len = user_scan_in->ssid_list[i].ssid_len; in mwifiex_config_scan()
882 wildcard_ssid_tlv->header.type = in mwifiex_config_scan()
884 wildcard_ssid_tlv->header.len = cpu_to_le16( in mwifiex_config_scan()
885 (u16) (ssid_len + sizeof(wildcard_ssid_tlv-> in mwifiex_config_scan()
895 wildcard_ssid_tlv->max_ssid_length = 0; in mwifiex_config_scan()
897 wildcard_ssid_tlv->max_ssid_length = in mwifiex_config_scan()
900 if (!memcmp(user_scan_in->ssid_list[i].ssid, in mwifiex_config_scan()
901 "DIRECT-", 7)) in mwifiex_config_scan()
902 wildcard_ssid_tlv->max_ssid_length = 0xfe; in mwifiex_config_scan()
904 memcpy(wildcard_ssid_tlv->ssid, in mwifiex_config_scan()
905 user_scan_in->ssid_list[i].ssid, ssid_len); in mwifiex_config_scan()
907 tlv_pos += (sizeof(wildcard_ssid_tlv->header) in mwifiex_config_scan()
908 + le16_to_cpu(wildcard_ssid_tlv->header.len)); in mwifiex_config_scan()
912 i, wildcard_ssid_tlv->ssid, in mwifiex_config_scan()
913 wildcard_ssid_tlv->max_ssid_length); in mwifiex_config_scan()
919 if (!ssid_len && wildcard_ssid_tlv->max_ssid_length) in mwifiex_config_scan()
929 memcpy(tmpaddr, scan_cfg_out->specific_bssid, ETH_ALEN); in mwifiex_config_scan()
934 if (user_scan_in->scan_chan_gap) { in mwifiex_config_scan()
937 user_scan_in->scan_chan_gap); in mwifiex_config_scan()
942 chan_gap_tlv->header.type = in mwifiex_config_scan()
944 chan_gap_tlv->header.len = in mwifiex_config_scan()
945 cpu_to_le16(sizeof(chan_gap_tlv->chan_gap)); in mwifiex_config_scan()
946 chan_gap_tlv->chan_gap = in mwifiex_config_scan()
947 cpu_to_le16((user_scan_in->scan_chan_gap)); in mwifiex_config_scan()
952 if (!is_zero_ether_addr(user_scan_in->random_mac)) { in mwifiex_config_scan()
954 random_mac_tlv->header.type = in mwifiex_config_scan()
956 random_mac_tlv->header.len = in mwifiex_config_scan()
957 cpu_to_le16(sizeof(random_mac_tlv->mac)); in mwifiex_config_scan()
958 ether_addr_copy(random_mac_tlv->mac, in mwifiex_config_scan()
959 user_scan_in->random_mac); in mwifiex_config_scan()
964 scan_cfg_out->bss_mode = (u8) adapter->scan_mode; in mwifiex_config_scan()
965 num_probes = adapter->scan_probes; in mwifiex_config_scan()
975 if (!priv->media_connected) in mwifiex_config_scan()
982 if (adapter->ext_scan) { in mwifiex_config_scan()
984 bss_mode->header.type = cpu_to_le16(TLV_TYPE_BSS_MODE); in mwifiex_config_scan()
985 bss_mode->header.len = cpu_to_le16(sizeof(bss_mode->bss_mode)); in mwifiex_config_scan()
986 bss_mode->bss_mode = scan_cfg_out->bss_mode; in mwifiex_config_scan()
987 tlv_pos += sizeof(bss_mode->header) + in mwifiex_config_scan()
988 le16_to_cpu(bss_mode->header.len); in mwifiex_config_scan()
992 add tlv */ in mwifiex_config_scan()
1000 num_probes_tlv->header.type = cpu_to_le16(TLV_TYPE_NUMPROBES); in mwifiex_config_scan()
1001 num_probes_tlv->header.len = in mwifiex_config_scan()
1002 cpu_to_le16(sizeof(num_probes_tlv->num_probes)); in mwifiex_config_scan()
1003 num_probes_tlv->num_probes = cpu_to_le16((u16) num_probes); in mwifiex_config_scan()
1005 tlv_pos += sizeof(num_probes_tlv->header) + in mwifiex_config_scan()
1006 le16_to_cpu(num_probes_tlv->header.len); in mwifiex_config_scan()
1010 if (ISSUPP_11NENABLED(priv->adapter->fw_cap_info) && in mwifiex_config_scan()
1011 (priv->adapter->config_bands & BAND_GN || in mwifiex_config_scan()
1012 priv->adapter->config_bands & BAND_AN)) { in mwifiex_config_scan()
1015 ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY); in mwifiex_config_scan()
1016 ht_cap->header.len = in mwifiex_config_scan()
1019 mwifiex_band_to_radio_type(priv->adapter->config_bands); in mwifiex_config_scan()
1020 mwifiex_fill_cap_info(priv, radio_type, &ht_cap->ht_cap); in mwifiex_config_scan()
1024 /* Append vendor specific IE TLV */ in mwifiex_config_scan()
1028 * Set the output for the channel TLV to the address in the tlv buffer in mwifiex_config_scan()
1036 if (user_scan_in && user_scan_in->chan_list[0].chan_number) { in mwifiex_config_scan()
1043 user_scan_in->chan_list[chan_idx].chan_number; in mwifiex_config_scan()
1046 channel = user_scan_in->chan_list[chan_idx].chan_number; in mwifiex_config_scan()
1050 user_scan_in->chan_list[chan_idx].radio_type; in mwifiex_config_scan()
1053 scan_type = user_scan_in->chan_list[chan_idx].scan_type; in mwifiex_config_scan()
1066 if (user_scan_in->chan_list[chan_idx].scan_time) { in mwifiex_config_scan()
1067 scan_dur = (u16) user_scan_in-> in mwifiex_config_scan()
1071 scan_dur = adapter->passive_scan_time; in mwifiex_config_scan()
1073 scan_dur = adapter->specific_scan_time; in mwifiex_config_scan()
1075 scan_dur = adapter->active_scan_time; in mwifiex_config_scan()
1086 (user_scan_in->chan_list[0].chan_number == in mwifiex_config_scan()
1087 priv->curr_bss_params.bss_descriptor.channel)) { in mwifiex_config_scan()
1113 struct mwifiex_ie_types_data *tlv, in mwifiex_ret_802_11_scan_get_tlv_ptrs() argument
1122 current_tlv = tlv; in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1132 tlv_type = le16_to_cpu(current_tlv->header.type); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1133 tlv_len = le16_to_cpu(current_tlv->header.len); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1135 if (sizeof(tlv->header) + tlv_len > tlv_buf_left) { in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1137 "SCAN_RESP: TLV buffer corrupt\n"); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1146 "timestamp TLV, len = %d\n", in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1153 "band list TLV, len = %d\n", in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1159 "SCAN_RESP: unhandled TLV = %d\n", in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1170 tlv_buf_left -= (sizeof(tlv->header) + tlv_len); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1172 (struct mwifiex_ie_types_data *) (current_tlv->data + in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1204 current_ptr = bss_entry->beacon_buf; in mwifiex_update_bss_desc_with_ie()
1205 bytes_left = bss_entry->beacon_buf_size; in mwifiex_update_bss_desc_with_ie()
1217 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1222 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1223 bss_entry->ssid.ssid_len = element_len; in mwifiex_update_bss_desc_with_ie()
1224 memcpy(bss_entry->ssid.ssid, (current_ptr + 2), in mwifiex_update_bss_desc_with_ie()
1227 "info: InterpretIE: ssid: %-32s\n", in mwifiex_update_bss_desc_with_ie()
1228 bss_entry->ssid.ssid); in mwifiex_update_bss_desc_with_ie()
1233 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1234 memcpy(bss_entry->data_rates, current_ptr + 2, in mwifiex_update_bss_desc_with_ie()
1236 memcpy(bss_entry->supported_rates, current_ptr + 2, in mwifiex_update_bss_desc_with_ie()
1244 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1247 memcpy(&bss_entry->phy_param_set.fh_param_set, in mwifiex_update_bss_desc_with_ie()
1254 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1258 bss_entry->channel = ds_param_set->current_chan; in mwifiex_update_bss_desc_with_ie()
1260 memcpy(&bss_entry->phy_param_set.ds_param_set, in mwifiex_update_bss_desc_with_ie()
1267 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1270 memcpy(&bss_entry->ss_param_set.cf_param_set, in mwifiex_update_bss_desc_with_ie()
1277 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1281 memcpy(&bss_entry->ss_param_set.ibss_param_set, in mwifiex_update_bss_desc_with_ie()
1288 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1289 bss_entry->erp_flags = *(current_ptr + 2); in mwifiex_update_bss_desc_with_ie()
1294 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1295 bss_entry->local_constraint = *(current_ptr + 2); in mwifiex_update_bss_desc_with_ie()
1296 bss_entry->sensed_11h = true; in mwifiex_update_bss_desc_with_ie()
1300 bss_entry->chan_sw_ie_present = true; in mwifiex_update_bss_desc_with_ie()
1305 bss_entry->sensed_11h = true; in mwifiex_update_bss_desc_with_ie()
1319 (MWIFIEX_SUPPORTED_RATES - in mwifiex_update_bss_desc_with_ie()
1324 rate = (u8 *) bss_entry->data_rates; in mwifiex_update_bss_desc_with_ie()
1328 rate = (u8 *) bss_entry->supported_rates; in mwifiex_update_bss_desc_with_ie()
1338 /* 802.11 requires at least 3-byte OUI. */ in mwifiex_update_bss_desc_with_ie()
1339 if (element_len < sizeof(vendor_ie->vend_hdr.oui.oui)) in mwifiex_update_bss_desc_with_ie()
1340 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1346 if (!memcmp(&vendor_ie->vend_hdr.oui, wpa_oui, in mwifiex_update_bss_desc_with_ie()
1348 bss_entry->bcn_wpa_ie = in mwifiex_update_bss_desc_with_ie()
1351 bss_entry->wpa_offset = (u16) in mwifiex_update_bss_desc_with_ie()
1352 (current_ptr - bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1353 } else if (!memcmp(&vendor_ie->vend_hdr.oui, wmm_oui, in mwifiex_update_bss_desc_with_ie()
1364 memcpy((u8 *) &bss_entry->wmm_ie, in mwifiex_update_bss_desc_with_ie()
1369 bss_entry->bcn_rsn_ie = in mwifiex_update_bss_desc_with_ie()
1371 bss_entry->rsn_offset = (u16) (current_ptr - in mwifiex_update_bss_desc_with_ie()
1372 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1375 bss_entry->bcn_rsnx_ie = in mwifiex_update_bss_desc_with_ie()
1377 bss_entry->rsnx_offset = in mwifiex_update_bss_desc_with_ie()
1378 (u16)(current_ptr - bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1381 bss_entry->bcn_wapi_ie = in mwifiex_update_bss_desc_with_ie()
1383 bss_entry->wapi_offset = (u16) (current_ptr - in mwifiex_update_bss_desc_with_ie()
1384 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1387 bss_entry->bcn_ht_cap = (struct ieee80211_ht_cap *) in mwifiex_update_bss_desc_with_ie()
1390 bss_entry->ht_cap_offset = (u16) (current_ptr + in mwifiex_update_bss_desc_with_ie()
1391 sizeof(struct ieee_types_header) - in mwifiex_update_bss_desc_with_ie()
1392 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1395 bss_entry->bcn_ht_oper = in mwifiex_update_bss_desc_with_ie()
1398 bss_entry->ht_info_offset = (u16) (current_ptr + in mwifiex_update_bss_desc_with_ie()
1399 sizeof(struct ieee_types_header) - in mwifiex_update_bss_desc_with_ie()
1400 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1403 bss_entry->disable_11ac = false; in mwifiex_update_bss_desc_with_ie()
1404 bss_entry->bcn_vht_cap = in mwifiex_update_bss_desc_with_ie()
1407 bss_entry->vht_cap_offset = in mwifiex_update_bss_desc_with_ie()
1408 (u16)((u8 *)bss_entry->bcn_vht_cap - in mwifiex_update_bss_desc_with_ie()
1409 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1412 bss_entry->bcn_vht_oper = in mwifiex_update_bss_desc_with_ie()
1415 bss_entry->vht_info_offset = in mwifiex_update_bss_desc_with_ie()
1416 (u16)((u8 *)bss_entry->bcn_vht_oper - in mwifiex_update_bss_desc_with_ie()
1417 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1420 bss_entry->bcn_bss_co_2040 = current_ptr; in mwifiex_update_bss_desc_with_ie()
1421 bss_entry->bss_co_2040_offset = in mwifiex_update_bss_desc_with_ie()
1422 (u16) (current_ptr - bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1425 bss_entry->bcn_ext_cap = current_ptr; in mwifiex_update_bss_desc_with_ie()
1426 bss_entry->ext_cap_offset = in mwifiex_update_bss_desc_with_ie()
1427 (u16) (current_ptr - bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1430 bss_entry->oper_mode = (void *)current_ptr; in mwifiex_update_bss_desc_with_ie()
1431 bss_entry->oper_mode_offset = in mwifiex_update_bss_desc_with_ie()
1432 (u16)((u8 *)bss_entry->oper_mode - in mwifiex_update_bss_desc_with_ie()
1433 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1440 bytes_left -= total_ie_len; in mwifiex_update_bss_desc_with_ie()
1474 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_networks()
1483 if (adapter->scan_processing) { in mwifiex_scan_networks()
1486 return -EBUSY; in mwifiex_scan_networks()
1489 if (priv->scan_block) { in mwifiex_scan_networks()
1492 return -EBUSY; in mwifiex_scan_networks()
1495 if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags) || in mwifiex_scan_networks()
1496 test_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags)) { in mwifiex_scan_networks()
1499 return -EFAULT; in mwifiex_scan_networks()
1502 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1503 adapter->scan_processing = true; in mwifiex_scan_networks()
1504 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1509 ret = -ENOMEM; in mwifiex_scan_networks()
1518 ret = -ENOMEM; in mwifiex_scan_networks()
1522 mwifiex_config_scan(priv, user_scan_in, &scan_cfg_out->config, in mwifiex_scan_networks()
1527 &scan_cfg_out->config, chan_list_out, in mwifiex_scan_networks()
1532 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_scan_networks()
1533 if (!list_empty(&adapter->scan_pending_q)) { in mwifiex_scan_networks()
1534 cmd_node = list_first_entry(&adapter->scan_pending_q, in mwifiex_scan_networks()
1536 list_del(&cmd_node->list); in mwifiex_scan_networks()
1537 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_scan_networks()
1539 queue_work(adapter->workqueue, &adapter->main_work); in mwifiex_scan_networks()
1542 if (!priv->scan_request) { in mwifiex_scan_networks()
1548 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_scan_networks()
1556 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1557 adapter->scan_processing = false; in mwifiex_scan_networks()
1558 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1573 * Preparation also includes -
1574 * - Setting command ID, and proper size
1575 * - Ensuring correct endian-ness
1580 struct host_cmd_ds_802_11_scan *scan_cmd = &cmd->params.scan; in mwifiex_cmd_802_11_scan()
1583 scan_cmd->bss_mode = scan_cfg->bss_mode; in mwifiex_cmd_802_11_scan()
1584 memcpy(scan_cmd->bssid, scan_cfg->specific_bssid, in mwifiex_cmd_802_11_scan()
1585 sizeof(scan_cmd->bssid)); in mwifiex_cmd_802_11_scan()
1586 memcpy(scan_cmd->tlv_buffer, scan_cfg->tlv_buf, scan_cfg->tlv_buf_len); in mwifiex_cmd_802_11_scan()
1588 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SCAN); in mwifiex_cmd_802_11_scan()
1590 /* Size is equal to the sizeof(fixed portions) + the TLV len + header */ in mwifiex_cmd_802_11_scan()
1591 cmd->size = cpu_to_le16((u16) (sizeof(scan_cmd->bss_mode) in mwifiex_cmd_802_11_scan()
1592 + sizeof(scan_cmd->bssid) in mwifiex_cmd_802_11_scan()
1593 + scan_cfg->tlv_buf_len + S_DS_GEN)); in mwifiex_cmd_802_11_scan()
1605 int ret = -1; in mwifiex_check_network_compatibility()
1608 return -1; in mwifiex_check_network_compatibility()
1610 if ((mwifiex_get_cfp(priv, (u8) bss_desc->bss_band, in mwifiex_check_network_compatibility()
1611 (u16) bss_desc->channel, 0))) { in mwifiex_check_network_compatibility()
1612 switch (priv->bss_mode) { in mwifiex_check_network_compatibility()
1616 priv->bss_mode); in mwifiex_check_network_compatibility()
1618 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_check_network_compatibility()
1634 for (idx = 0; idx < ssid->ssid_len; idx++) { in mwifiex_is_hidden_ssid()
1635 if (ssid->ssid[idx]) in mwifiex_is_hidden_ssid()
1655 return -ENOMEM; in mwifiex_save_hidden_ssid_channels()
1661 if (mwifiex_is_hidden_ssid(&bss_desc->ssid)) { in mwifiex_save_hidden_ssid_channels()
1662 mwifiex_dbg(priv->adapter, INFO, "found hidden SSID\n"); in mwifiex_save_hidden_ssid_channels()
1664 if (priv->hidden_chan[chid].chan_number == in mwifiex_save_hidden_ssid_channels()
1665 bss->channel->hw_value) in mwifiex_save_hidden_ssid_channels()
1668 if (!priv->hidden_chan[chid].chan_number) { in mwifiex_save_hidden_ssid_channels()
1669 priv->hidden_chan[chid].chan_number = in mwifiex_save_hidden_ssid_channels()
1670 bss->channel->hw_value; in mwifiex_save_hidden_ssid_channels()
1671 priv->hidden_chan[chid].radio_type = in mwifiex_save_hidden_ssid_channels()
1672 bss->channel->band; in mwifiex_save_hidden_ssid_channels()
1673 priv->hidden_chan[chid].scan_type = in mwifiex_save_hidden_ssid_channels()
1684 kfree(bss_desc->beacon_buf); in mwifiex_save_hidden_ssid_channels()
1698 return -ENOMEM; in mwifiex_update_curr_bss_params()
1708 spin_lock_bh(&priv->curr_bcn_buf_lock); in mwifiex_update_curr_bss_params()
1710 memcpy(&priv->curr_bss_params.bss_descriptor, bss_desc, in mwifiex_update_curr_bss_params()
1711 sizeof(priv->curr_bss_params.bss_descriptor)); in mwifiex_update_curr_bss_params()
1717 spin_unlock_bh(&priv->curr_bcn_buf_lock); in mwifiex_update_curr_bss_params()
1723 kfree(bss_desc->beacon_buf); in mwifiex_update_curr_bss_params()
1733 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_parse_single_response_buf()
1754 *bytes_left -= sizeof(beacon_size); in mwifiex_parse_single_response_buf()
1761 return -EFAULT; in mwifiex_parse_single_response_buf()
1771 *bytes_left -= beacon_size; in mwifiex_parse_single_response_buf()
1782 return -EFAULT; in mwifiex_parse_single_response_buf()
1787 curr_bcn_bytes -= ETH_ALEN; in mwifiex_parse_single_response_buf()
1791 rssi = (-rssi) * 100; /* Convert dBm to mBm */ in mwifiex_parse_single_response_buf()
1793 curr_bcn_bytes -= sizeof(u8); in mwifiex_parse_single_response_buf()
1802 curr_bcn_bytes -= sizeof(*bcn_param); in mwifiex_parse_single_response_buf()
1804 timestamp = le64_to_cpu(bcn_param->timestamp); in mwifiex_parse_single_response_buf()
1805 beacon_period = le16_to_cpu(bcn_param->beacon_period); in mwifiex_parse_single_response_buf()
1807 cap_info_bitmap = le16_to_cpu(bcn_param->cap_info_bitmap); in mwifiex_parse_single_response_buf()
1828 return -EFAULT; in mwifiex_parse_single_response_buf()
1837 curr_bcn_bytes -= element_len + in mwifiex_parse_single_response_buf()
1846 if (channel == priv->csa_chan) { in mwifiex_parse_single_response_buf()
1859 freq = cfp ? cfp->freq : 0; in mwifiex_parse_single_response_buf()
1861 chan = ieee80211_get_channel(priv->wdev.wiphy, freq); in mwifiex_parse_single_response_buf()
1863 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { in mwifiex_parse_single_response_buf()
1864 bss = cfg80211_inform_bss(priv->wdev.wiphy, in mwifiex_parse_single_response_buf()
1870 bss_priv = (struct mwifiex_bss_priv *)bss->priv; in mwifiex_parse_single_response_buf()
1871 bss_priv->band = band; in mwifiex_parse_single_response_buf()
1872 bss_priv->fw_tsf = fw_tsf; in mwifiex_parse_single_response_buf()
1873 if (priv->media_connected && in mwifiex_parse_single_response_buf()
1874 !memcmp(bssid, priv->curr_bss_params. in mwifiex_parse_single_response_buf()
1880 if ((chan->flags & IEEE80211_CHAN_RADAR) || in mwifiex_parse_single_response_buf()
1881 (chan->flags & IEEE80211_CHAN_NO_IR)) { in mwifiex_parse_single_response_buf()
1889 cfg80211_put_bss(priv->wdev.wiphy, bss); in mwifiex_parse_single_response_buf()
1901 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_complete_scan()
1903 adapter->survey_idx = 0; in mwifiex_complete_scan()
1904 if (adapter->curr_cmd->wait_q_enabled) { in mwifiex_complete_scan()
1905 adapter->cmd_wait_q.status = 0; in mwifiex_complete_scan()
1906 if (!priv->scan_request) { in mwifiex_complete_scan()
1909 mwifiex_complete_cmd(adapter, adapter->curr_cmd); in mwifiex_complete_scan()
1921 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_active_scan_req_for_passive_chan()
1925 if (adapter->active_scan_triggered || !priv->scan_request || in mwifiex_active_scan_req_for_passive_chan()
1926 priv->scan_aborting) { in mwifiex_active_scan_req_for_passive_chan()
1927 adapter->active_scan_triggered = false; in mwifiex_active_scan_req_for_passive_chan()
1931 if (!priv->hidden_chan[0].chan_number) { in mwifiex_active_scan_req_for_passive_chan()
1938 return -ENOMEM; in mwifiex_active_scan_req_for_passive_chan()
1941 if (!priv->hidden_chan[id].chan_number) in mwifiex_active_scan_req_for_passive_chan()
1943 memcpy(&user_scan_cfg->chan_list[id], in mwifiex_active_scan_req_for_passive_chan()
1944 &priv->hidden_chan[id], in mwifiex_active_scan_req_for_passive_chan()
1948 adapter->active_scan_triggered = true; in mwifiex_active_scan_req_for_passive_chan()
1949 if (priv->scan_request->flags & NL80211_SCAN_FLAG_RANDOM_ADDR) in mwifiex_active_scan_req_for_passive_chan()
1950 ether_addr_copy(user_scan_cfg->random_mac, in mwifiex_active_scan_req_for_passive_chan()
1951 priv->scan_request->mac_addr); in mwifiex_active_scan_req_for_passive_chan()
1952 user_scan_cfg->num_ssids = priv->scan_request->n_ssids; in mwifiex_active_scan_req_for_passive_chan()
1953 user_scan_cfg->ssid_list = priv->scan_request->ssids; in mwifiex_active_scan_req_for_passive_chan()
1958 memset(&priv->hidden_chan, 0, sizeof(priv->hidden_chan)); in mwifiex_active_scan_req_for_passive_chan()
1961 dev_err(priv->adapter->dev, "scan failed: %d\n", ret); in mwifiex_active_scan_req_for_passive_chan()
1969 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_check_next_scan_command()
1972 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
1973 if (list_empty(&adapter->scan_pending_q)) { in mwifiex_check_next_scan_command()
1974 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
1976 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
1977 adapter->scan_processing = false; in mwifiex_check_next_scan_command()
1978 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
1982 if (!adapter->ext_scan) in mwifiex_check_next_scan_command()
1985 if (priv->scan_request) { in mwifiex_check_next_scan_command()
1992 cfg80211_scan_done(priv->scan_request, &info); in mwifiex_check_next_scan_command()
1993 priv->scan_request = NULL; in mwifiex_check_next_scan_command()
1994 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
1996 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
2000 } else if ((priv->scan_aborting && !priv->scan_request) || in mwifiex_check_next_scan_command()
2001 priv->scan_block) { in mwifiex_check_next_scan_command()
2002 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
2006 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
2007 adapter->scan_processing = false; in mwifiex_check_next_scan_command()
2008 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
2010 if (!adapter->active_scan_triggered) { in mwifiex_check_next_scan_command()
2011 if (priv->scan_request) { in mwifiex_check_next_scan_command()
2018 cfg80211_scan_done(priv->scan_request, &info); in mwifiex_check_next_scan_command()
2019 priv->scan_request = NULL; in mwifiex_check_next_scan_command()
2020 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
2022 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
2031 cmd_node = list_first_entry(&adapter->scan_pending_q, in mwifiex_check_next_scan_command()
2033 list_del(&cmd_node->list); in mwifiex_check_next_scan_command()
2034 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
2048 if (adapter->scan_processing) { in mwifiex_cancel_scan()
2049 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_cancel_scan()
2050 adapter->scan_processing = false; in mwifiex_cancel_scan()
2051 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_cancel_scan()
2052 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_cancel_scan()
2053 priv = adapter->priv[i]; in mwifiex_cancel_scan()
2054 if (priv->scan_request) { in mwifiex_cancel_scan()
2061 cfg80211_scan_done(priv->scan_request, &info); in mwifiex_cancel_scan()
2062 priv->scan_request = NULL; in mwifiex_cancel_scan()
2063 priv->scan_aborting = false; in mwifiex_cancel_scan()
2073 * memory layout:
2075 * .-------------------------------------------------------------.
2077 * .-------------------------------------------------------------.
2079 * .-------------------------------------------------------------.
2081 * .-------------------------------------------------------------.
2083 * .-------------------------------------------------------------.
2084 * | TLV data (variable, size calculated using Header->Size, |
2086 * .-------------------------------------------------------------.
2092 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_802_11_scan()
2109 is_bgscan_resp = (le16_to_cpu(resp->command) in mwifiex_ret_802_11_scan()
2112 scan_rsp = &resp->params.bg_scan_query_resp.scan_resp; in mwifiex_ret_802_11_scan()
2114 scan_rsp = &resp->params.scan_resp; in mwifiex_ret_802_11_scan()
2117 if (scan_rsp->number_of_sets > MWIFIEX_MAX_AP) { in mwifiex_ret_802_11_scan()
2120 scan_rsp->number_of_sets); in mwifiex_ret_802_11_scan()
2121 ret = -1; in mwifiex_ret_802_11_scan()
2128 bytes_left = le16_to_cpu(scan_rsp->bss_descript_size); in mwifiex_ret_802_11_scan()
2133 scan_resp_size = le16_to_cpu(resp->size); in mwifiex_ret_802_11_scan()
2137 scan_rsp->number_of_sets); in mwifiex_ret_802_11_scan()
2139 bss_info = scan_rsp->bss_desc_and_tlv_buffer; in mwifiex_ret_802_11_scan()
2142 * The size of the TLV buffer is equal to the entire command response in mwifiex_ret_802_11_scan()
2147 tlv_buf_size = scan_resp_size - (bytes_left in mwifiex_ret_802_11_scan()
2148 + sizeof(scan_rsp->bss_descript_size) in mwifiex_ret_802_11_scan()
2149 + sizeof(scan_rsp->number_of_sets) in mwifiex_ret_802_11_scan()
2152 tlv_data = (struct mwifiex_ie_types_data *) (scan_rsp-> in mwifiex_ret_802_11_scan()
2156 /* Search the TLV buffer space in the scan response for any valid in mwifiex_ret_802_11_scan()
2163 /* Search the TLV buffer space in the scan response for any valid in mwifiex_ret_802_11_scan()
2171 if (priv->wdev.wiphy->wowlan_config) in mwifiex_ret_802_11_scan()
2172 nd_config = priv->wdev.wiphy->wowlan_config->nd_config; in mwifiex_ret_802_11_scan()
2176 adapter->nd_info = in mwifiex_ret_802_11_scan()
2177 kzalloc(struct_size(adapter->nd_info, matches, in mwifiex_ret_802_11_scan()
2178 scan_rsp->number_of_sets), in mwifiex_ret_802_11_scan()
2181 if (adapter->nd_info) in mwifiex_ret_802_11_scan()
2182 adapter->nd_info->n_matches = scan_rsp->number_of_sets; in mwifiex_ret_802_11_scan()
2185 for (idx = 0; idx < scan_rsp->number_of_sets && bytes_left; idx++) { in mwifiex_ret_802_11_scan()
2187 * If the TSF TLV was appended to the scan results, save this in mwifiex_ret_802_11_scan()
2193 memcpy(&fw_tsf, &tsf_tlv->tsf_data[idx * TSF_DATA_SIZE], in mwifiex_ret_802_11_scan()
2197 chan_band = &chan_band_tlv->chan_band_param[idx]; in mwifiex_ret_802_11_scan()
2198 radio_type = &chan_band->radio_type; in mwifiex_ret_802_11_scan()
2203 if (chan_band_tlv && adapter->nd_info) { in mwifiex_ret_802_11_scan()
2204 adapter->nd_info->matches[idx] = in mwifiex_ret_802_11_scan()
2208 pmatch = adapter->nd_info->matches[idx]; in mwifiex_ret_802_11_scan()
2211 pmatch->n_channels = 1; in mwifiex_ret_802_11_scan()
2212 pmatch->channels[0] = chan_band->chan_number; in mwifiex_ret_802_11_scan()
2240 struct host_cmd_ds_802_11_scan_ext *ext_scan = &cmd->params.ext_scan; in mwifiex_cmd_802_11_scan_ext()
2243 memcpy(ext_scan->tlv_buffer, scan_cfg->tlv_buf, scan_cfg->tlv_buf_len); in mwifiex_cmd_802_11_scan_ext()
2245 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SCAN_EXT); in mwifiex_cmd_802_11_scan_ext()
2247 /* Size is equal to the sizeof(fixed portions) + the TLV len + header */ in mwifiex_cmd_802_11_scan_ext()
2248 cmd->size = cpu_to_le16((u16)(sizeof(ext_scan->reserved) in mwifiex_cmd_802_11_scan_ext()
2249 + scan_cfg->tlv_buf_len + S_DS_GEN)); in mwifiex_cmd_802_11_scan_ext()
2262 &cmd->params.bg_scan_config; in mwifiex_cmd_802_11_bg_scan_config()
2264 u8 *tlv_pos = bgscan_config->tlv; in mwifiex_cmd_802_11_bg_scan_config()
2276 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_BG_SCAN_CONFIG); in mwifiex_cmd_802_11_bg_scan_config()
2277 cmd->size = cpu_to_le16(sizeof(*bgscan_config) + S_DS_GEN); in mwifiex_cmd_802_11_bg_scan_config()
2279 bgscan_config->action = cpu_to_le16(bgscan_cfg_in->action); in mwifiex_cmd_802_11_bg_scan_config()
2280 bgscan_config->enable = bgscan_cfg_in->enable; in mwifiex_cmd_802_11_bg_scan_config()
2281 bgscan_config->bss_type = bgscan_cfg_in->bss_type; in mwifiex_cmd_802_11_bg_scan_config()
2282 bgscan_config->scan_interval = in mwifiex_cmd_802_11_bg_scan_config()
2283 cpu_to_le32(bgscan_cfg_in->scan_interval); in mwifiex_cmd_802_11_bg_scan_config()
2284 bgscan_config->report_condition = in mwifiex_cmd_802_11_bg_scan_config()
2285 cpu_to_le32(bgscan_cfg_in->report_condition); in mwifiex_cmd_802_11_bg_scan_config()
2288 if (!bgscan_config->enable) in mwifiex_cmd_802_11_bg_scan_config()
2291 bgscan_config->chan_per_scan = bgscan_cfg_in->chan_per_scan; in mwifiex_cmd_802_11_bg_scan_config()
2293 num_probes = (bgscan_cfg_in->num_probes ? bgscan_cfg_in-> in mwifiex_cmd_802_11_bg_scan_config()
2294 num_probes : priv->adapter->scan_probes); in mwifiex_cmd_802_11_bg_scan_config()
2298 num_probes_tlv->header.type = cpu_to_le16(TLV_TYPE_NUMPROBES); in mwifiex_cmd_802_11_bg_scan_config()
2299 num_probes_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2300 cpu_to_le16(sizeof(num_probes_tlv->num_probes)); in mwifiex_cmd_802_11_bg_scan_config()
2301 num_probes_tlv->num_probes = cpu_to_le16((u16)num_probes); in mwifiex_cmd_802_11_bg_scan_config()
2303 tlv_pos += sizeof(num_probes_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2304 le16_to_cpu(num_probes_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2307 if (bgscan_cfg_in->repeat_count) { in mwifiex_cmd_802_11_bg_scan_config()
2310 repeat_count_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2312 repeat_count_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2313 cpu_to_le16(sizeof(repeat_count_tlv->repeat_count)); in mwifiex_cmd_802_11_bg_scan_config()
2314 repeat_count_tlv->repeat_count = in mwifiex_cmd_802_11_bg_scan_config()
2315 cpu_to_le16(bgscan_cfg_in->repeat_count); in mwifiex_cmd_802_11_bg_scan_config()
2317 tlv_pos += sizeof(repeat_count_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2318 le16_to_cpu(repeat_count_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2321 if (bgscan_cfg_in->rssi_threshold) { in mwifiex_cmd_802_11_bg_scan_config()
2324 rssi_threshold_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2326 rssi_threshold_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2327 cpu_to_le16(sizeof(rssi_threshold_tlv->rssi_threshold)); in mwifiex_cmd_802_11_bg_scan_config()
2328 rssi_threshold_tlv->rssi_threshold = in mwifiex_cmd_802_11_bg_scan_config()
2329 cpu_to_le16(bgscan_cfg_in->rssi_threshold); in mwifiex_cmd_802_11_bg_scan_config()
2331 tlv_pos += sizeof(rssi_threshold_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2332 le16_to_cpu(rssi_threshold_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2335 for (i = 0; i < bgscan_cfg_in->num_ssids; i++) { in mwifiex_cmd_802_11_bg_scan_config()
2336 ssid_len = bgscan_cfg_in->ssid_list[i].ssid.ssid_len; in mwifiex_cmd_802_11_bg_scan_config()
2340 wildcard_ssid_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2342 wildcard_ssid_tlv->header.len = cpu_to_le16( in mwifiex_cmd_802_11_bg_scan_config()
2343 (u16)(ssid_len + sizeof(wildcard_ssid_tlv-> in mwifiex_cmd_802_11_bg_scan_config()
2352 wildcard_ssid_tlv->max_ssid_length = 0; in mwifiex_cmd_802_11_bg_scan_config()
2354 wildcard_ssid_tlv->max_ssid_length = in mwifiex_cmd_802_11_bg_scan_config()
2357 memcpy(wildcard_ssid_tlv->ssid, in mwifiex_cmd_802_11_bg_scan_config()
2358 bgscan_cfg_in->ssid_list[i].ssid.ssid, ssid_len); in mwifiex_cmd_802_11_bg_scan_config()
2360 tlv_pos += (sizeof(wildcard_ssid_tlv->header) in mwifiex_cmd_802_11_bg_scan_config()
2361 + le16_to_cpu(wildcard_ssid_tlv->header.len)); in mwifiex_cmd_802_11_bg_scan_config()
2366 if (bgscan_cfg_in->chan_list[0].chan_number) { in mwifiex_cmd_802_11_bg_scan_config()
2367 dev_dbg(priv->adapter->dev, "info: bgscan: Using supplied channel list\n"); in mwifiex_cmd_802_11_bg_scan_config()
2369 chan_list_tlv->header.type = cpu_to_le16(TLV_TYPE_CHANLIST); in mwifiex_cmd_802_11_bg_scan_config()
2373 bgscan_cfg_in->chan_list[chan_idx].chan_number; in mwifiex_cmd_802_11_bg_scan_config()
2375 temp_chan = &chan_list_tlv->chan_scan_param[chan_idx]; in mwifiex_cmd_802_11_bg_scan_config()
2377 /* Increment the TLV header length by size appended */ in mwifiex_cmd_802_11_bg_scan_config()
2378 le16_unaligned_add_cpu(&chan_list_tlv->header.len, in mwifiex_cmd_802_11_bg_scan_config()
2379 sizeof(*chan_list_tlv->chan_scan_param)); in mwifiex_cmd_802_11_bg_scan_config()
2381 temp_chan->chan_number = in mwifiex_cmd_802_11_bg_scan_config()
2382 bgscan_cfg_in->chan_list[chan_idx].chan_number; in mwifiex_cmd_802_11_bg_scan_config()
2383 temp_chan->radio_type = in mwifiex_cmd_802_11_bg_scan_config()
2384 bgscan_cfg_in->chan_list[chan_idx].radio_type; in mwifiex_cmd_802_11_bg_scan_config()
2387 bgscan_cfg_in->chan_list[chan_idx].scan_type; in mwifiex_cmd_802_11_bg_scan_config()
2390 temp_chan->chan_scan_mode_bitmap in mwifiex_cmd_802_11_bg_scan_config()
2393 temp_chan->chan_scan_mode_bitmap in mwifiex_cmd_802_11_bg_scan_config()
2396 if (bgscan_cfg_in->chan_list[chan_idx].scan_time) { in mwifiex_cmd_802_11_bg_scan_config()
2397 scan_dur = (u16)bgscan_cfg_in-> in mwifiex_cmd_802_11_bg_scan_config()
2402 priv->adapter->passive_scan_time : in mwifiex_cmd_802_11_bg_scan_config()
2403 priv->adapter->specific_scan_time; in mwifiex_cmd_802_11_bg_scan_config()
2406 temp_chan->min_scan_time = cpu_to_le16(scan_dur); in mwifiex_cmd_802_11_bg_scan_config()
2407 temp_chan->max_scan_time = cpu_to_le16(scan_dur); in mwifiex_cmd_802_11_bg_scan_config()
2410 dev_dbg(priv->adapter->dev, in mwifiex_cmd_802_11_bg_scan_config()
2414 chan_list_tlv-> in mwifiex_cmd_802_11_bg_scan_config()
2416 le16_unaligned_add_cpu(&chan_list_tlv->header.len, in mwifiex_cmd_802_11_bg_scan_config()
2418 sizeof(*chan_list_tlv->chan_scan_param)); in mwifiex_cmd_802_11_bg_scan_config()
2421 tlv_pos += (sizeof(chan_list_tlv->header) in mwifiex_cmd_802_11_bg_scan_config()
2422 + le16_to_cpu(chan_list_tlv->header.len)); in mwifiex_cmd_802_11_bg_scan_config()
2424 if (bgscan_cfg_in->start_later) { in mwifiex_cmd_802_11_bg_scan_config()
2427 start_later_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2429 start_later_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2430 cpu_to_le16(sizeof(start_later_tlv->start_later)); in mwifiex_cmd_802_11_bg_scan_config()
2431 start_later_tlv->start_later = in mwifiex_cmd_802_11_bg_scan_config()
2432 cpu_to_le16(bgscan_cfg_in->start_later); in mwifiex_cmd_802_11_bg_scan_config()
2434 tlv_pos += sizeof(start_later_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2435 le16_to_cpu(start_later_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2438 /* Append vendor specific IE TLV */ in mwifiex_cmd_802_11_bg_scan_config()
2441 le16_unaligned_add_cpu(&cmd->size, tlv_pos - bgscan_config->tlv); in mwifiex_cmd_802_11_bg_scan_config()
2450 if (!priv->sched_scanning) { in mwifiex_stop_bg_scan()
2451 dev_dbg(priv->adapter->dev, "bgscan already stopped!\n"); in mwifiex_stop_bg_scan()
2457 return -ENOMEM; in mwifiex_stop_bg_scan()
2459 bgscan_cfg->bss_type = MWIFIEX_BSS_MODE_INFRA; in mwifiex_stop_bg_scan()
2460 bgscan_cfg->action = MWIFIEX_BGSCAN_ACT_SET; in mwifiex_stop_bg_scan()
2461 bgscan_cfg->enable = false; in mwifiex_stop_bg_scan()
2466 return -EFAULT; in mwifiex_stop_bg_scan()
2470 priv->sched_scanning = false; in mwifiex_stop_bg_scan()
2479 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_update_chan_statistics()
2486 num_chan = le16_to_cpu(tlv_stat->header.len) / in mwifiex_update_chan_statistics()
2490 if (adapter->survey_idx >= adapter->num_in_chan_stats) { in mwifiex_update_chan_statistics()
2493 adapter->num_in_chan_stats); in mwifiex_update_chan_statistics()
2496 chan_stats.chan_num = fw_chan_stats->chan_num; in mwifiex_update_chan_statistics()
2497 chan_stats.bandcfg = fw_chan_stats->bandcfg; in mwifiex_update_chan_statistics()
2498 chan_stats.flags = fw_chan_stats->flags; in mwifiex_update_chan_statistics()
2499 chan_stats.noise = fw_chan_stats->noise; in mwifiex_update_chan_statistics()
2500 chan_stats.total_bss = le16_to_cpu(fw_chan_stats->total_bss); in mwifiex_update_chan_statistics()
2502 le16_to_cpu(fw_chan_stats->cca_scan_dur); in mwifiex_update_chan_statistics()
2504 le16_to_cpu(fw_chan_stats->cca_busy_dur); in mwifiex_update_chan_statistics()
2512 memcpy(&adapter->chan_stats[adapter->survey_idx++], &chan_stats, in mwifiex_update_chan_statistics()
2522 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_802_11_scan_ext()
2524 struct mwifiex_ie_types_header *tlv; in mwifiex_ret_802_11_scan_ext() local
2534 ext_scan_resp = &resp->params.ext_scan; in mwifiex_ret_802_11_scan_ext()
2536 tlv = (void *)ext_scan_resp->tlv_buffer; in mwifiex_ret_802_11_scan_ext()
2537 buf_left = le16_to_cpu(resp->size) - (sizeof(*ext_scan_resp) + S_DS_GEN); in mwifiex_ret_802_11_scan_ext()
2540 type = le16_to_cpu(tlv->type); in mwifiex_ret_802_11_scan_ext()
2541 len = le16_to_cpu(tlv->len); in mwifiex_ret_802_11_scan_ext()
2551 tlv_stat = (void *)tlv; in mwifiex_ret_802_11_scan_ext()
2558 buf_left -= len + sizeof(struct mwifiex_ie_types_header); in mwifiex_ret_802_11_scan_ext()
2559 tlv = (void *)((u8 *)tlv + len + in mwifiex_ret_802_11_scan_ext()
2563 spin_lock_bh(&adapter->cmd_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2564 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2565 if (list_empty(&adapter->scan_pending_q)) { in mwifiex_ret_802_11_scan_ext()
2567 list_for_each_entry(cmd_node, &adapter->cmd_pending_q, list) { in mwifiex_ret_802_11_scan_ext()
2568 cmd_ptr = (void *)cmd_node->cmd_skb->data; in mwifiex_ret_802_11_scan_ext()
2569 if (le16_to_cpu(cmd_ptr->command) == in mwifiex_ret_802_11_scan_ext()
2578 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2579 spin_unlock_bh(&adapter->cmd_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2594 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_handle_event_ext_scan_report()
2598 struct mwifiex_ie_types_data *tlv; in mwifiex_handle_event_ext_scan_report() local
2605 u8 num_of_set = event_scan->num_of_set; in mwifiex_handle_event_ext_scan_report()
2607 u16 scan_resp_size = le16_to_cpu(event_scan->buf_size); in mwifiex_handle_event_ext_scan_report()
2613 ret = -1; in mwifiex_handle_event_ext_scan_report()
2625 tlv = (struct mwifiex_ie_types_data *)scan_resp; in mwifiex_handle_event_ext_scan_report()
2628 type = le16_to_cpu(tlv->header.type); in mwifiex_handle_event_ext_scan_report()
2629 len = le16_to_cpu(tlv->header.len); in mwifiex_handle_event_ext_scan_report()
2632 "EXT_SCAN: Error bytes left < TLV length\n"); in mwifiex_handle_event_ext_scan_report()
2639 /* BSS response TLV with beacon or probe response buffer in mwifiex_handle_event_ext_scan_report()
2645 bss_info = (u8 *)tlv; in mwifiex_handle_event_ext_scan_report()
2646 scan_rsp_tlv = (struct mwifiex_ie_types_bss_scan_rsp *)tlv; in mwifiex_handle_event_ext_scan_report()
2647 tlv = (struct mwifiex_ie_types_data *)(tlv->data + len); in mwifiex_handle_event_ext_scan_report()
2648 bytes_left_for_tlv -= in mwifiex_handle_event_ext_scan_report()
2653 le16_to_cpu(tlv->header.type) != TLV_TYPE_BSS_SCAN_RSP) { in mwifiex_handle_event_ext_scan_report()
2654 type = le16_to_cpu(tlv->header.type); in mwifiex_handle_event_ext_scan_report()
2655 len = le16_to_cpu(tlv->header.len); in mwifiex_handle_event_ext_scan_report()
2659 "EXT_SCAN: Error in processing TLV,\t" in mwifiex_handle_event_ext_scan_report()
2660 "bytes left < TLV length\n"); in mwifiex_handle_event_ext_scan_report()
2668 (struct mwifiex_ie_types_bss_scan_info *)tlv; in mwifiex_handle_event_ext_scan_report()
2670 sizeof(struct mwifiex_ie_types_bss_scan_info) - in mwifiex_handle_event_ext_scan_report()
2679 tlv = (struct mwifiex_ie_types_data *)(tlv->data + len); in mwifiex_handle_event_ext_scan_report()
2680 bytes_left -= in mwifiex_handle_event_ext_scan_report()
2682 bytes_left_for_tlv -= in mwifiex_handle_event_ext_scan_report()
2695 bytes_left -= sizeof(u16); in mwifiex_handle_event_ext_scan_report()
2698 rssi = (s32)(s16)(le16_to_cpu(scan_info_tlv->rssi)); in mwifiex_handle_event_ext_scan_report()
2702 fw_tsf = le64_to_cpu(scan_info_tlv->tsf); in mwifiex_handle_event_ext_scan_report()
2703 radio_type = &scan_info_tlv->radio_type; in mwifiex_handle_event_ext_scan_report()
2715 if (!event_scan->more_event) in mwifiex_handle_event_ext_scan_report()
2724 * Preparation includes -
2725 * - Setting command ID and proper size
2726 * - Setting background scan flush parameter
2727 * - Ensuring correct endian-ness
2732 &cmd->params.bg_scan_query; in mwifiex_cmd_802_11_bg_scan_query()
2734 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_BG_SCAN_QUERY); in mwifiex_cmd_802_11_bg_scan_query()
2735 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_bg_scan_query) in mwifiex_cmd_802_11_bg_scan_query()
2738 bg_query->flush = 1; in mwifiex_cmd_802_11_bg_scan_query()
2750 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_queue_scan_cmd()
2752 cmd_node->wait_q_enabled = true; in mwifiex_queue_scan_cmd()
2753 cmd_node->condition = &adapter->scan_wait_q_woken; in mwifiex_queue_scan_cmd()
2754 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_queue_scan_cmd()
2755 list_add_tail(&cmd_node->list, &adapter->scan_pending_q); in mwifiex_queue_scan_cmd()
2756 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_queue_scan_cmd()
2766 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_specific_ssid()
2770 if (adapter->scan_processing) { in mwifiex_scan_specific_ssid()
2773 return -EBUSY; in mwifiex_scan_specific_ssid()
2776 if (priv->scan_block) { in mwifiex_scan_specific_ssid()
2779 return -EBUSY; in mwifiex_scan_specific_ssid()
2784 return -ENOMEM; in mwifiex_scan_specific_ssid()
2786 scan_cfg->ssid_list = req_ssid; in mwifiex_scan_specific_ssid()
2787 scan_cfg->num_ssids = 1; in mwifiex_scan_specific_ssid()
2809 if (mutex_lock_interruptible(&priv->async_mutex)) { in mwifiex_request_scan()
2810 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_request_scan()
2813 return -1; in mwifiex_request_scan()
2816 priv->adapter->scan_wait_q_woken = false; in mwifiex_request_scan()
2818 if (req_ssid && req_ssid->ssid_len != 0) in mwifiex_request_scan()
2825 mutex_unlock(&priv->async_mutex); in mwifiex_request_scan()
2831 * This function appends the vendor specific IE TLV to a buffer.
2847 * the selected(scan/assoc/adhoc) IE as TLV to the command in mwifiex_cmd_append_vsie_tlv()
2850 if (priv->vs_ie[id].mask & vsie_mask) { in mwifiex_cmd_append_vsie_tlv()
2854 vs_param_set->header.type = in mwifiex_cmd_append_vsie_tlv()
2856 vs_param_set->header.len = in mwifiex_cmd_append_vsie_tlv()
2857 cpu_to_le16((((u16) priv->vs_ie[id].ie[1]) in mwifiex_cmd_append_vsie_tlv()
2859 if (le16_to_cpu(vs_param_set->header.len) > in mwifiex_cmd_append_vsie_tlv()
2861 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_cmd_append_vsie_tlv()
2866 memcpy(vs_param_set->ie, priv->vs_ie[id].ie, in mwifiex_cmd_append_vsie_tlv()
2867 le16_to_cpu(vs_param_set->header.len)); in mwifiex_cmd_append_vsie_tlv()
2868 *buffer += le16_to_cpu(vs_param_set->header.len) + in mwifiex_cmd_append_vsie_tlv()
2870 ret_len += le16_to_cpu(vs_param_set->header.len) + in mwifiex_cmd_append_vsie_tlv()
2883 * - The current ssid was not found somehow in the last scan.
2884 * - The current ssid was the last entry of the scan table and overloaded.
2890 &priv->curr_bss_params.bss_descriptor; in mwifiex_save_curr_bcn()
2892 if (!curr_bss->beacon_buf_size) in mwifiex_save_curr_bcn()
2896 if (!priv->curr_bcn_buf || in mwifiex_save_curr_bcn()
2897 priv->curr_bcn_size != curr_bss->beacon_buf_size) { in mwifiex_save_curr_bcn()
2898 priv->curr_bcn_size = curr_bss->beacon_buf_size; in mwifiex_save_curr_bcn()
2900 kfree(priv->curr_bcn_buf); in mwifiex_save_curr_bcn()
2901 priv->curr_bcn_buf = kmalloc(curr_bss->beacon_buf_size, in mwifiex_save_curr_bcn()
2903 if (!priv->curr_bcn_buf) in mwifiex_save_curr_bcn()
2907 memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf, in mwifiex_save_curr_bcn()
2908 curr_bss->beacon_buf_size); in mwifiex_save_curr_bcn()
2909 mwifiex_dbg(priv->adapter, INFO, in mwifiex_save_curr_bcn()
2911 priv->curr_bcn_size); in mwifiex_save_curr_bcn()
2913 curr_bss->beacon_buf = priv->curr_bcn_buf; in mwifiex_save_curr_bcn()
2916 if (curr_bss->bcn_wpa_ie) in mwifiex_save_curr_bcn()
2917 curr_bss->bcn_wpa_ie = in mwifiex_save_curr_bcn()
2919 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2920 curr_bss->wpa_offset); in mwifiex_save_curr_bcn()
2922 if (curr_bss->bcn_rsn_ie) in mwifiex_save_curr_bcn()
2923 curr_bss->bcn_rsn_ie = (struct ieee_types_generic *) in mwifiex_save_curr_bcn()
2924 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2925 curr_bss->rsn_offset); in mwifiex_save_curr_bcn()
2927 if (curr_bss->bcn_ht_cap) in mwifiex_save_curr_bcn()
2928 curr_bss->bcn_ht_cap = (struct ieee80211_ht_cap *) in mwifiex_save_curr_bcn()
2929 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2930 curr_bss->ht_cap_offset); in mwifiex_save_curr_bcn()
2932 if (curr_bss->bcn_ht_oper) in mwifiex_save_curr_bcn()
2933 curr_bss->bcn_ht_oper = (struct ieee80211_ht_operation *) in mwifiex_save_curr_bcn()
2934 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2935 curr_bss->ht_info_offset); in mwifiex_save_curr_bcn()
2937 if (curr_bss->bcn_vht_cap) in mwifiex_save_curr_bcn()
2938 curr_bss->bcn_vht_cap = (void *)(curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2939 curr_bss->vht_cap_offset); in mwifiex_save_curr_bcn()
2941 if (curr_bss->bcn_vht_oper) in mwifiex_save_curr_bcn()
2942 curr_bss->bcn_vht_oper = (void *)(curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2943 curr_bss->vht_info_offset); in mwifiex_save_curr_bcn()
2945 if (curr_bss->bcn_bss_co_2040) in mwifiex_save_curr_bcn()
2946 curr_bss->bcn_bss_co_2040 = in mwifiex_save_curr_bcn()
2947 (curr_bss->beacon_buf + curr_bss->bss_co_2040_offset); in mwifiex_save_curr_bcn()
2949 if (curr_bss->bcn_ext_cap) in mwifiex_save_curr_bcn()
2950 curr_bss->bcn_ext_cap = curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2951 curr_bss->ext_cap_offset; in mwifiex_save_curr_bcn()
2953 if (curr_bss->oper_mode) in mwifiex_save_curr_bcn()
2954 curr_bss->oper_mode = (void *)(curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2955 curr_bss->oper_mode_offset); in mwifiex_save_curr_bcn()
2964 kfree(priv->curr_bcn_buf); in mwifiex_free_curr_bcn()
2965 priv->curr_bcn_buf = NULL; in mwifiex_free_curr_bcn()