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()
188 if (!ssid1 || !ssid2 || (ssid1->ssid_len != ssid2->ssid_len)) in mwifiex_ssid_cmp()
189 return -1; in mwifiex_ssid_cmp()
190 return memcmp(ssid1->ssid, ssid2->ssid, ssid1->ssid_len); in mwifiex_ssid_cmp()
201 if (priv->sec_info.wapi_enabled && in mwifiex_is_bss_wapi()
202 has_ieee_hdr(bss_desc->bcn_wapi_ie, WLAN_EID_BSS_AC_ACCESS_DELAY)) in mwifiex_is_bss_wapi()
215 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_no_sec()
216 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_no_sec()
217 !has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) && in mwifiex_is_bss_no_sec()
218 !has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) && in mwifiex_is_bss_no_sec()
219 !priv->sec_info.encryption_mode && !bss_desc->privacy) { in mwifiex_is_bss_no_sec()
233 if (priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_static_wep()
234 !priv->sec_info.wpa2_enabled && bss_desc->privacy) { in mwifiex_is_bss_static_wep()
248 if (!priv->sec_info.wep_enabled && priv->sec_info.wpa_enabled && in mwifiex_is_bss_wpa()
249 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_wpa()
250 has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) in mwifiex_is_bss_wpa()
253 * LinkSys WRT54G && bss_desc->privacy in mwifiex_is_bss_wpa()
270 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_wpa2()
271 priv->sec_info.wpa2_enabled && in mwifiex_is_bss_wpa2()
272 has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN)) { in mwifiex_is_bss_wpa2()
275 * LinkSys WRT54G && bss_desc->privacy in mwifiex_is_bss_wpa2()
291 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_adhoc_aes()
292 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_adhoc_aes()
293 !has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) && in mwifiex_is_bss_adhoc_aes()
294 !has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) && in mwifiex_is_bss_adhoc_aes()
295 !priv->sec_info.encryption_mode && bss_desc->privacy) { in mwifiex_is_bss_adhoc_aes()
309 if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled && in mwifiex_is_bss_dynamic_wep()
310 !priv->sec_info.wpa2_enabled && in mwifiex_is_bss_dynamic_wep()
311 !has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) && in mwifiex_is_bss_dynamic_wep()
312 !has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) && in mwifiex_is_bss_dynamic_wep()
313 priv->sec_info.encryption_mode && bss_desc->privacy) { in mwifiex_is_bss_dynamic_wep()
324 * WEP WPA WPA2 ad-hoc encrypt Network
331 * 0 0 0 1 NONE 1 0 0 yes Ad-hoc AES
342 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_is_network_compatible()
344 bss_desc->disable_11n = false; in mwifiex_is_network_compatible()
347 if (priv->media_connected && in mwifiex_is_network_compatible()
348 (priv->bss_mode == NL80211_IFTYPE_STATION) && in mwifiex_is_network_compatible()
349 (bss_desc->bss_mode == NL80211_IFTYPE_STATION)) in mwifiex_is_network_compatible()
352 if (priv->wps.session_enable) { in mwifiex_is_network_compatible()
358 if (bss_desc->chan_sw_ie_present) { in mwifiex_is_network_compatible()
361 return -1; in mwifiex_is_network_compatible()
370 if (bss_desc->bss_mode == mode) { in mwifiex_is_network_compatible()
378 bss_desc->disable_11n = true; in mwifiex_is_network_compatible()
382 if (((priv->adapter->config_bands & BAND_GN || in mwifiex_is_network_compatible()
383 priv->adapter->config_bands & BAND_AN) && in mwifiex_is_network_compatible()
384 bss_desc->bcn_ht_cap) && in mwifiex_is_network_compatible()
393 bss_desc->disable_11n = true; in mwifiex_is_network_compatible()
395 return -1; in mwifiex_is_network_compatible()
401 if (((priv->adapter->config_bands & BAND_GN || in mwifiex_is_network_compatible()
402 priv->adapter->config_bands & BAND_AN) && in mwifiex_is_network_compatible()
403 bss_desc->bcn_ht_cap) && in mwifiex_is_network_compatible()
412 bss_desc->disable_11n = true; in mwifiex_is_network_compatible()
414 return -1; in mwifiex_is_network_compatible()
419 /* Ad-hoc AES enabled */ in mwifiex_is_network_compatible()
428 return -1; in mwifiex_is_network_compatible()
432 return -1; in mwifiex_is_network_compatible()
453 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_create_channel_list()
458 if (!priv->wdev.wiphy->bands[band]) in mwifiex_scan_create_channel_list()
461 sband = priv->wdev.wiphy->bands[band]; in mwifiex_scan_create_channel_list()
463 for (i = 0; (i < sband->n_channels) ; i++) { in mwifiex_scan_create_channel_list()
464 ch = &sband->channels[i]; in mwifiex_scan_create_channel_list()
465 if (ch->flags & IEEE80211_CHAN_DISABLED) in mwifiex_scan_create_channel_list()
470 user_scan_in->chan_list[0].scan_time) in mwifiex_scan_create_channel_list()
472 cpu_to_le16((u16) user_scan_in-> in mwifiex_scan_create_channel_list()
474 else if ((ch->flags & IEEE80211_CHAN_NO_IR) || in mwifiex_scan_create_channel_list()
475 (ch->flags & IEEE80211_CHAN_RADAR)) in mwifiex_scan_create_channel_list()
477 cpu_to_le16(adapter->passive_scan_time); in mwifiex_scan_create_channel_list()
480 cpu_to_le16(adapter->active_scan_time); in mwifiex_scan_create_channel_list()
482 if (ch->flags & IEEE80211_CHAN_NO_IR) in mwifiex_scan_create_channel_list()
490 (u32) ch->hw_value; in mwifiex_scan_create_channel_list()
496 !((ch->flags & IEEE80211_CHAN_NO_IR) || in mwifiex_scan_create_channel_list()
497 (ch->flags & IEEE80211_CHAN_RADAR))) in mwifiex_scan_create_channel_list()
499 cpu_to_le16(adapter->specific_scan_time); in mwifiex_scan_create_channel_list()
508 /* This function creates a channel list tlv for bgscan config, based
521 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_bgscan_create_channel_list()
525 if (!priv->wdev.wiphy->bands[band]) in mwifiex_bgscan_create_channel_list()
528 sband = priv->wdev.wiphy->bands[band]; in mwifiex_bgscan_create_channel_list()
530 for (i = 0; (i < sband->n_channels) ; i++) { in mwifiex_bgscan_create_channel_list()
531 ch = &sband->channels[i]; in mwifiex_bgscan_create_channel_list()
532 if (ch->flags & IEEE80211_CHAN_DISABLED) in mwifiex_bgscan_create_channel_list()
536 if (bgscan_cfg_in->chan_list[0].scan_time) in mwifiex_bgscan_create_channel_list()
538 cpu_to_le16((u16)bgscan_cfg_in-> in mwifiex_bgscan_create_channel_list()
540 else if (ch->flags & IEEE80211_CHAN_NO_IR) in mwifiex_bgscan_create_channel_list()
542 cpu_to_le16(adapter->passive_scan_time); in mwifiex_bgscan_create_channel_list()
545 cpu_to_le16(adapter-> in mwifiex_bgscan_create_channel_list()
548 if (ch->flags & IEEE80211_CHAN_NO_IR) in mwifiex_bgscan_create_channel_list()
556 (u32)ch->hw_value; in mwifiex_bgscan_create_channel_list()
563 /* This function appends rate TLV to scan config command. */
575 tlv_pos = (u8 *)scan_cfg_out->tlv_buf + scan_cfg_out->tlv_buf_len; in mwifiex_append_rate_tlv()
577 if (priv->scan_request) in mwifiex_append_rate_tlv()
583 mwifiex_dbg(priv->adapter, CMD, in mwifiex_append_rate_tlv()
587 rates_tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES); in mwifiex_append_rate_tlv()
588 rates_tlv->header.len = cpu_to_le16((u16) rates_size); in mwifiex_append_rate_tlv()
589 memcpy(rates_tlv->rates, rates, rates_size); in mwifiex_append_rate_tlv()
590 scan_cfg_out->tlv_buf_len += sizeof(rates_tlv->header) + rates_size; in mwifiex_append_rate_tlv()
600 * with any requested TLVs. This function splits the channel TLV into maximum
601 * channels supported per scan lists and sends the portion of the channel TLV,
612 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_channel_list()
621 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_scan_channel_list()
624 return -1; in mwifiex_scan_channel_list()
630 chan_tlv_out->header.type = cpu_to_le16(TLV_TYPE_CHANLIST); in mwifiex_scan_channel_list()
639 while (tmp_chan_list->chan_number) { in mwifiex_scan_channel_list()
644 chan_tlv_out->header.len = 0; in mwifiex_scan_channel_list()
648 * Construct the Channel TLV for the scan command. Continue to in mwifiex_scan_channel_list()
650 * - the tlv_idx hits the maximum configured per scan command in mwifiex_scan_channel_list()
651 * - the next channel to insert is 0 (end of desired channel in mwifiex_scan_channel_list()
653 * - done_early is set (controlling individual scanning of in mwifiex_scan_channel_list()
657 tmp_chan_list->chan_number && !done_early) { in mwifiex_scan_channel_list()
659 if (tmp_chan_list->chan_number == priv->csa_chan) { in mwifiex_scan_channel_list()
664 radio_type = tmp_chan_list->radio_type; in mwifiex_scan_channel_list()
665 mwifiex_dbg(priv->adapter, INFO, in mwifiex_scan_channel_list()
668 tmp_chan_list->chan_number, in mwifiex_scan_channel_list()
669 tmp_chan_list->radio_type, in mwifiex_scan_channel_list()
670 tmp_chan_list->chan_scan_mode_bitmap in mwifiex_scan_channel_list()
672 (tmp_chan_list->chan_scan_mode_bitmap in mwifiex_scan_channel_list()
674 le16_to_cpu(tmp_chan_list->max_scan_time)); in mwifiex_scan_channel_list()
676 /* Copy the current channel TLV to the command being in mwifiex_scan_channel_list()
678 memcpy(chan_tlv_out->chan_scan_param + tlv_idx, in mwifiex_scan_channel_list()
680 sizeof(chan_tlv_out->chan_scan_param)); in mwifiex_scan_channel_list()
682 /* Increment the TLV header length by the size in mwifiex_scan_channel_list()
684 le16_unaligned_add_cpu(&chan_tlv_out->header.len, in mwifiex_scan_channel_list()
686 chan_tlv_out->chan_scan_param)); in mwifiex_scan_channel_list()
689 * The tlv buffer length is set to the number of bytes in mwifiex_scan_channel_list()
690 * of the between the channel tlv pointer and the start in mwifiex_scan_channel_list()
691 * of the tlv buffer. This compensates for any TLVs in mwifiex_scan_channel_list()
694 scan_cfg_out->tlv_buf_len = (u32) ((u8 *) chan_tlv_out - in mwifiex_scan_channel_list()
695 scan_cfg_out->tlv_buf); in mwifiex_scan_channel_list()
697 /* Add the size of the channel tlv header and the data in mwifiex_scan_channel_list()
699 scan_cfg_out->tlv_buf_len += in mwifiex_scan_channel_list()
700 (sizeof(chan_tlv_out->header) in mwifiex_scan_channel_list()
701 + le16_to_cpu(chan_tlv_out->header.len)); in mwifiex_scan_channel_list()
703 /* Increment the index to the channel tlv we are in mwifiex_scan_channel_list()
709 le16_to_cpu(tmp_chan_list->max_scan_time); in mwifiex_scan_channel_list()
717 (tmp_chan_list->chan_number == 1 || in mwifiex_scan_channel_list()
718 tmp_chan_list->chan_number == 6 || in mwifiex_scan_channel_list()
719 tmp_chan_list->chan_number == 11)) in mwifiex_scan_channel_list()
730 (tmp_chan_list->chan_number == 1 || in mwifiex_scan_channel_list()
731 tmp_chan_list->chan_number == 6 || in mwifiex_scan_channel_list()
732 tmp_chan_list->chan_number == 11)) in mwifiex_scan_channel_list()
739 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_scan_channel_list()
744 ret = -1; in mwifiex_scan_channel_list()
753 if (priv->adapter->ext_scan) in mwifiex_scan_channel_list()
763 * scan_cfg_out->buf is overwritten with new one. in mwifiex_scan_channel_list()
765 scan_cfg_out->tlv_buf_len -= in mwifiex_scan_channel_list()
775 return -1; in mwifiex_scan_channel_list()
792 * - SSID filter
793 * - BSSID filter
794 * - Number of Probes to be sent
795 * - Channel list
809 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_config_scan()
833 scan_cfg_out->tlv_buf_len = 0; in mwifiex_config_scan()
835 /* Running tlv pointer. Assigned to chan_list_out at end of function in mwifiex_config_scan()
838 tlv_pos = scan_cfg_out->tlv_buf; in mwifiex_config_scan()
840 /* Initialize the scan as un-filtered; the flag is later set to TRUE in mwifiex_config_scan()
859 scan_cfg_out->bss_mode = in mwifiex_config_scan()
860 (u8)(user_scan_in->bss_mode ?: adapter->scan_mode); in mwifiex_config_scan()
864 num_probes = user_scan_in->num_probes ?: adapter->scan_probes; in mwifiex_config_scan()
868 * if non-zero. If not set, it will remain disabled in mwifiex_config_scan()
871 memcpy(scan_cfg_out->specific_bssid, in mwifiex_config_scan()
872 user_scan_in->specific_bssid, in mwifiex_config_scan()
873 sizeof(scan_cfg_out->specific_bssid)); in mwifiex_config_scan()
875 memcpy(tmpaddr, scan_cfg_out->specific_bssid, ETH_ALEN); in mwifiex_config_scan()
877 if (adapter->ext_scan && in mwifiex_config_scan()
881 bssid_tlv->header.type = cpu_to_le16(TLV_TYPE_BSSID); in mwifiex_config_scan()
882 bssid_tlv->header.len = cpu_to_le16(ETH_ALEN); in mwifiex_config_scan()
883 memcpy(bssid_tlv->bssid, user_scan_in->specific_bssid, in mwifiex_config_scan()
888 for (i = 0; i < user_scan_in->num_ssids; i++) { in mwifiex_config_scan()
889 ssid_len = user_scan_in->ssid_list[i].ssid_len; in mwifiex_config_scan()
894 wildcard_ssid_tlv->header.type = in mwifiex_config_scan()
896 wildcard_ssid_tlv->header.len = cpu_to_le16( in mwifiex_config_scan()
897 (u16) (ssid_len + sizeof(wildcard_ssid_tlv-> in mwifiex_config_scan()
907 wildcard_ssid_tlv->max_ssid_length = 0; in mwifiex_config_scan()
909 wildcard_ssid_tlv->max_ssid_length = in mwifiex_config_scan()
912 if (!memcmp(user_scan_in->ssid_list[i].ssid, in mwifiex_config_scan()
913 "DIRECT-", 7)) in mwifiex_config_scan()
914 wildcard_ssid_tlv->max_ssid_length = 0xfe; in mwifiex_config_scan()
916 memcpy(wildcard_ssid_tlv->ssid, in mwifiex_config_scan()
917 user_scan_in->ssid_list[i].ssid, ssid_len); in mwifiex_config_scan()
919 tlv_pos += (sizeof(wildcard_ssid_tlv->header) in mwifiex_config_scan()
920 + le16_to_cpu(wildcard_ssid_tlv->header.len)); in mwifiex_config_scan()
924 i, wildcard_ssid_tlv->ssid, in mwifiex_config_scan()
925 wildcard_ssid_tlv->max_ssid_length); in mwifiex_config_scan()
931 if (!ssid_len && wildcard_ssid_tlv->max_ssid_length) in mwifiex_config_scan()
941 memcpy(tmpaddr, scan_cfg_out->specific_bssid, ETH_ALEN); in mwifiex_config_scan()
946 if (user_scan_in->scan_chan_gap) { in mwifiex_config_scan()
949 user_scan_in->scan_chan_gap); in mwifiex_config_scan()
954 chan_gap_tlv->header.type = in mwifiex_config_scan()
956 chan_gap_tlv->header.len = in mwifiex_config_scan()
957 cpu_to_le16(sizeof(chan_gap_tlv->chan_gap)); in mwifiex_config_scan()
958 chan_gap_tlv->chan_gap = in mwifiex_config_scan()
959 cpu_to_le16((user_scan_in->scan_chan_gap)); in mwifiex_config_scan()
964 if (!is_zero_ether_addr(user_scan_in->random_mac)) { in mwifiex_config_scan()
966 random_mac_tlv->header.type = in mwifiex_config_scan()
968 random_mac_tlv->header.len = in mwifiex_config_scan()
969 cpu_to_le16(sizeof(random_mac_tlv->mac)); in mwifiex_config_scan()
970 ether_addr_copy(random_mac_tlv->mac, in mwifiex_config_scan()
971 user_scan_in->random_mac); in mwifiex_config_scan()
976 scan_cfg_out->bss_mode = (u8) adapter->scan_mode; in mwifiex_config_scan()
977 num_probes = adapter->scan_probes; in mwifiex_config_scan()
987 if (!priv->media_connected) in mwifiex_config_scan()
994 if (adapter->ext_scan) { in mwifiex_config_scan()
996 bss_mode->header.type = cpu_to_le16(TLV_TYPE_BSS_MODE); in mwifiex_config_scan()
997 bss_mode->header.len = cpu_to_le16(sizeof(bss_mode->bss_mode)); in mwifiex_config_scan()
998 bss_mode->bss_mode = scan_cfg_out->bss_mode; in mwifiex_config_scan()
999 tlv_pos += sizeof(bss_mode->header) + in mwifiex_config_scan()
1000 le16_to_cpu(bss_mode->header.len); in mwifiex_config_scan()
1004 add tlv */ in mwifiex_config_scan()
1012 num_probes_tlv->header.type = cpu_to_le16(TLV_TYPE_NUMPROBES); in mwifiex_config_scan()
1013 num_probes_tlv->header.len = in mwifiex_config_scan()
1014 cpu_to_le16(sizeof(num_probes_tlv->num_probes)); in mwifiex_config_scan()
1015 num_probes_tlv->num_probes = cpu_to_le16((u16) num_probes); in mwifiex_config_scan()
1017 tlv_pos += sizeof(num_probes_tlv->header) + in mwifiex_config_scan()
1018 le16_to_cpu(num_probes_tlv->header.len); in mwifiex_config_scan()
1022 if (ISSUPP_11NENABLED(priv->adapter->fw_cap_info) && in mwifiex_config_scan()
1023 (priv->adapter->config_bands & BAND_GN || in mwifiex_config_scan()
1024 priv->adapter->config_bands & BAND_AN)) { in mwifiex_config_scan()
1027 ht_cap->header.type = cpu_to_le16(WLAN_EID_HT_CAPABILITY); in mwifiex_config_scan()
1028 ht_cap->header.len = in mwifiex_config_scan()
1031 mwifiex_band_to_radio_type(priv->adapter->config_bands); in mwifiex_config_scan()
1032 mwifiex_fill_cap_info(priv, radio_type, &ht_cap->ht_cap); in mwifiex_config_scan()
1036 /* Append vendor specific IE TLV */ in mwifiex_config_scan()
1040 * Set the output for the channel TLV to the address in the tlv buffer in mwifiex_config_scan()
1048 if (user_scan_in && user_scan_in->chan_list[0].chan_number) { in mwifiex_config_scan()
1055 user_scan_in->chan_list[chan_idx].chan_number; in mwifiex_config_scan()
1058 channel = user_scan_in->chan_list[chan_idx].chan_number; in mwifiex_config_scan()
1062 user_scan_in->chan_list[chan_idx].radio_type; in mwifiex_config_scan()
1065 scan_type = user_scan_in->chan_list[chan_idx].scan_type; in mwifiex_config_scan()
1078 if (user_scan_in->chan_list[chan_idx].scan_time) { in mwifiex_config_scan()
1079 scan_dur = (u16) user_scan_in-> in mwifiex_config_scan()
1083 scan_dur = adapter->passive_scan_time; in mwifiex_config_scan()
1085 scan_dur = adapter->specific_scan_time; in mwifiex_config_scan()
1087 scan_dur = adapter->active_scan_time; in mwifiex_config_scan()
1098 (user_scan_in->chan_list[0].chan_number == in mwifiex_config_scan()
1099 priv->curr_bss_params.bss_descriptor.channel)) { in mwifiex_config_scan()
1125 struct mwifiex_ie_types_data *tlv, in mwifiex_ret_802_11_scan_get_tlv_ptrs() argument
1134 current_tlv = tlv; in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1144 tlv_type = le16_to_cpu(current_tlv->header.type); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1145 tlv_len = le16_to_cpu(current_tlv->header.len); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1147 if (sizeof(tlv->header) + tlv_len > tlv_buf_left) { in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1149 "SCAN_RESP: TLV buffer corrupt\n"); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1158 "timestamp TLV, len = %d\n", in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1165 "band list TLV, len = %d\n", in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1171 "SCAN_RESP: unhandled TLV = %d\n", in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1182 tlv_buf_left -= (sizeof(tlv->header) + tlv_len); in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1184 (struct mwifiex_ie_types_data *) (current_tlv->data + in mwifiex_ret_802_11_scan_get_tlv_ptrs()
1216 current_ptr = bss_entry->beacon_buf; in mwifiex_update_bss_desc_with_ie()
1217 bytes_left = bss_entry->beacon_buf_size; in mwifiex_update_bss_desc_with_ie()
1229 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1234 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1235 bss_entry->ssid.ssid_len = element_len; in mwifiex_update_bss_desc_with_ie()
1236 memcpy(bss_entry->ssid.ssid, (current_ptr + 2), in mwifiex_update_bss_desc_with_ie()
1239 "info: InterpretIE: ssid: %-32s\n", in mwifiex_update_bss_desc_with_ie()
1240 bss_entry->ssid.ssid); in mwifiex_update_bss_desc_with_ie()
1245 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1246 memcpy(bss_entry->data_rates, current_ptr + 2, in mwifiex_update_bss_desc_with_ie()
1248 memcpy(bss_entry->supported_rates, current_ptr + 2, in mwifiex_update_bss_desc_with_ie()
1256 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1259 memcpy(&bss_entry->phy_param_set.fh_param_set, in mwifiex_update_bss_desc_with_ie()
1266 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1270 bss_entry->channel = ds_param_set->current_chan; in mwifiex_update_bss_desc_with_ie()
1272 memcpy(&bss_entry->phy_param_set.ds_param_set, in mwifiex_update_bss_desc_with_ie()
1279 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1282 memcpy(&bss_entry->ss_param_set.cf_param_set, in mwifiex_update_bss_desc_with_ie()
1289 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1293 memcpy(&bss_entry->ss_param_set.ibss_param_set, in mwifiex_update_bss_desc_with_ie()
1300 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1301 bss_entry->erp_flags = *(current_ptr + 2); in mwifiex_update_bss_desc_with_ie()
1306 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1307 bss_entry->local_constraint = *(current_ptr + 2); in mwifiex_update_bss_desc_with_ie()
1308 bss_entry->sensed_11h = true; in mwifiex_update_bss_desc_with_ie()
1312 bss_entry->chan_sw_ie_present = true; in mwifiex_update_bss_desc_with_ie()
1317 bss_entry->sensed_11h = true; in mwifiex_update_bss_desc_with_ie()
1331 (MWIFIEX_SUPPORTED_RATES - in mwifiex_update_bss_desc_with_ie()
1336 rate = (u8 *) bss_entry->data_rates; in mwifiex_update_bss_desc_with_ie()
1340 rate = (u8 *) bss_entry->supported_rates; in mwifiex_update_bss_desc_with_ie()
1350 /* 802.11 requires at least 3-byte OUI. */ in mwifiex_update_bss_desc_with_ie()
1351 if (element_len < sizeof(vendor_ie->vend_hdr.oui.oui)) in mwifiex_update_bss_desc_with_ie()
1352 return -EINVAL; in mwifiex_update_bss_desc_with_ie()
1358 if (!memcmp(&vendor_ie->vend_hdr.oui, wpa_oui, in mwifiex_update_bss_desc_with_ie()
1360 bss_entry->bcn_wpa_ie = in mwifiex_update_bss_desc_with_ie()
1363 bss_entry->wpa_offset = (u16) in mwifiex_update_bss_desc_with_ie()
1364 (current_ptr - bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1365 } else if (!memcmp(&vendor_ie->vend_hdr.oui, wmm_oui, in mwifiex_update_bss_desc_with_ie()
1376 memcpy((u8 *) &bss_entry->wmm_ie, in mwifiex_update_bss_desc_with_ie()
1381 bss_entry->bcn_rsn_ie = in mwifiex_update_bss_desc_with_ie()
1383 bss_entry->rsn_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_wapi_ie = in mwifiex_update_bss_desc_with_ie()
1389 bss_entry->wapi_offset = (u16) (current_ptr - in mwifiex_update_bss_desc_with_ie()
1390 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1393 bss_entry->bcn_ht_cap = (struct ieee80211_ht_cap *) in mwifiex_update_bss_desc_with_ie()
1396 bss_entry->ht_cap_offset = (u16) (current_ptr + in mwifiex_update_bss_desc_with_ie()
1397 sizeof(struct ieee_types_header) - in mwifiex_update_bss_desc_with_ie()
1398 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1401 bss_entry->bcn_ht_oper = in mwifiex_update_bss_desc_with_ie()
1404 bss_entry->ht_info_offset = (u16) (current_ptr + in mwifiex_update_bss_desc_with_ie()
1405 sizeof(struct ieee_types_header) - in mwifiex_update_bss_desc_with_ie()
1406 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1409 bss_entry->disable_11ac = false; in mwifiex_update_bss_desc_with_ie()
1410 bss_entry->bcn_vht_cap = in mwifiex_update_bss_desc_with_ie()
1413 bss_entry->vht_cap_offset = in mwifiex_update_bss_desc_with_ie()
1414 (u16)((u8 *)bss_entry->bcn_vht_cap - in mwifiex_update_bss_desc_with_ie()
1415 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1418 bss_entry->bcn_vht_oper = in mwifiex_update_bss_desc_with_ie()
1421 bss_entry->vht_info_offset = in mwifiex_update_bss_desc_with_ie()
1422 (u16)((u8 *)bss_entry->bcn_vht_oper - in mwifiex_update_bss_desc_with_ie()
1423 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1426 bss_entry->bcn_bss_co_2040 = current_ptr; in mwifiex_update_bss_desc_with_ie()
1427 bss_entry->bss_co_2040_offset = in mwifiex_update_bss_desc_with_ie()
1428 (u16) (current_ptr - bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1431 bss_entry->bcn_ext_cap = current_ptr; in mwifiex_update_bss_desc_with_ie()
1432 bss_entry->ext_cap_offset = in mwifiex_update_bss_desc_with_ie()
1433 (u16) (current_ptr - bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1436 bss_entry->oper_mode = (void *)current_ptr; in mwifiex_update_bss_desc_with_ie()
1437 bss_entry->oper_mode_offset = in mwifiex_update_bss_desc_with_ie()
1438 (u16)((u8 *)bss_entry->oper_mode - in mwifiex_update_bss_desc_with_ie()
1439 bss_entry->beacon_buf); in mwifiex_update_bss_desc_with_ie()
1446 bytes_left -= total_ie_len; in mwifiex_update_bss_desc_with_ie()
1480 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_networks()
1489 if (adapter->scan_processing) { in mwifiex_scan_networks()
1492 return -EBUSY; in mwifiex_scan_networks()
1495 if (priv->scan_block) { in mwifiex_scan_networks()
1498 return -EBUSY; in mwifiex_scan_networks()
1501 if (test_bit(MWIFIEX_SURPRISE_REMOVED, &adapter->work_flags) || in mwifiex_scan_networks()
1502 test_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags)) { in mwifiex_scan_networks()
1505 return -EFAULT; in mwifiex_scan_networks()
1508 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1509 adapter->scan_processing = true; in mwifiex_scan_networks()
1510 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1515 ret = -ENOMEM; in mwifiex_scan_networks()
1524 ret = -ENOMEM; in mwifiex_scan_networks()
1528 mwifiex_config_scan(priv, user_scan_in, &scan_cfg_out->config, in mwifiex_scan_networks()
1533 &scan_cfg_out->config, chan_list_out, in mwifiex_scan_networks()
1538 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_scan_networks()
1539 if (!list_empty(&adapter->scan_pending_q)) { in mwifiex_scan_networks()
1540 cmd_node = list_first_entry(&adapter->scan_pending_q, in mwifiex_scan_networks()
1542 list_del(&cmd_node->list); in mwifiex_scan_networks()
1543 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_scan_networks()
1545 queue_work(adapter->workqueue, &adapter->main_work); in mwifiex_scan_networks()
1548 if (!priv->scan_request) { in mwifiex_scan_networks()
1554 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_scan_networks()
1562 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1563 adapter->scan_processing = false; in mwifiex_scan_networks()
1564 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_scan_networks()
1579 * Preparation also includes -
1580 * - Setting command ID, and proper size
1581 * - Ensuring correct endian-ness
1586 struct host_cmd_ds_802_11_scan *scan_cmd = &cmd->params.scan; in mwifiex_cmd_802_11_scan()
1589 scan_cmd->bss_mode = scan_cfg->bss_mode; in mwifiex_cmd_802_11_scan()
1590 memcpy(scan_cmd->bssid, scan_cfg->specific_bssid, in mwifiex_cmd_802_11_scan()
1591 sizeof(scan_cmd->bssid)); in mwifiex_cmd_802_11_scan()
1592 memcpy(scan_cmd->tlv_buffer, scan_cfg->tlv_buf, scan_cfg->tlv_buf_len); in mwifiex_cmd_802_11_scan()
1594 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SCAN); in mwifiex_cmd_802_11_scan()
1596 /* Size is equal to the sizeof(fixed portions) + the TLV len + header */ in mwifiex_cmd_802_11_scan()
1597 cmd->size = cpu_to_le16((u16) (sizeof(scan_cmd->bss_mode) in mwifiex_cmd_802_11_scan()
1598 + sizeof(scan_cmd->bssid) in mwifiex_cmd_802_11_scan()
1599 + scan_cfg->tlv_buf_len + S_DS_GEN)); in mwifiex_cmd_802_11_scan()
1611 int ret = -1; in mwifiex_check_network_compatibility()
1614 return -1; in mwifiex_check_network_compatibility()
1616 if ((mwifiex_get_cfp(priv, (u8) bss_desc->bss_band, in mwifiex_check_network_compatibility()
1617 (u16) bss_desc->channel, 0))) { in mwifiex_check_network_compatibility()
1618 switch (priv->bss_mode) { in mwifiex_check_network_compatibility()
1622 priv->bss_mode); in mwifiex_check_network_compatibility()
1624 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_check_network_compatibility()
1640 for (idx = 0; idx < ssid->ssid_len; idx++) { in mwifiex_is_hidden_ssid()
1641 if (ssid->ssid[idx]) in mwifiex_is_hidden_ssid()
1661 return -ENOMEM; in mwifiex_save_hidden_ssid_channels()
1667 if (mwifiex_is_hidden_ssid(&bss_desc->ssid)) { in mwifiex_save_hidden_ssid_channels()
1668 mwifiex_dbg(priv->adapter, INFO, "found hidden SSID\n"); in mwifiex_save_hidden_ssid_channels()
1670 if (priv->hidden_chan[chid].chan_number == in mwifiex_save_hidden_ssid_channels()
1671 bss->channel->hw_value) in mwifiex_save_hidden_ssid_channels()
1674 if (!priv->hidden_chan[chid].chan_number) { in mwifiex_save_hidden_ssid_channels()
1675 priv->hidden_chan[chid].chan_number = in mwifiex_save_hidden_ssid_channels()
1676 bss->channel->hw_value; in mwifiex_save_hidden_ssid_channels()
1677 priv->hidden_chan[chid].radio_type = in mwifiex_save_hidden_ssid_channels()
1678 bss->channel->band; in mwifiex_save_hidden_ssid_channels()
1679 priv->hidden_chan[chid].scan_type = in mwifiex_save_hidden_ssid_channels()
1690 kfree(bss_desc->beacon_buf); in mwifiex_save_hidden_ssid_channels()
1704 return -ENOMEM; in mwifiex_update_curr_bss_params()
1714 spin_lock_bh(&priv->curr_bcn_buf_lock); in mwifiex_update_curr_bss_params()
1716 memcpy(&priv->curr_bss_params.bss_descriptor, bss_desc, in mwifiex_update_curr_bss_params()
1717 sizeof(priv->curr_bss_params.bss_descriptor)); in mwifiex_update_curr_bss_params()
1723 spin_unlock_bh(&priv->curr_bcn_buf_lock); in mwifiex_update_curr_bss_params()
1729 kfree(bss_desc->beacon_buf); in mwifiex_update_curr_bss_params()
1739 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_parse_single_response_buf()
1760 *bytes_left -= sizeof(beacon_size); in mwifiex_parse_single_response_buf()
1767 return -EFAULT; in mwifiex_parse_single_response_buf()
1777 *bytes_left -= beacon_size; in mwifiex_parse_single_response_buf()
1788 return -EFAULT; in mwifiex_parse_single_response_buf()
1793 curr_bcn_bytes -= ETH_ALEN; in mwifiex_parse_single_response_buf()
1797 rssi = (-rssi) * 100; /* Convert dBm to mBm */ in mwifiex_parse_single_response_buf()
1799 curr_bcn_bytes -= sizeof(u8); in mwifiex_parse_single_response_buf()
1808 curr_bcn_bytes -= sizeof(*bcn_param); in mwifiex_parse_single_response_buf()
1810 timestamp = le64_to_cpu(bcn_param->timestamp); in mwifiex_parse_single_response_buf()
1811 beacon_period = le16_to_cpu(bcn_param->beacon_period); in mwifiex_parse_single_response_buf()
1813 cap_info_bitmap = le16_to_cpu(bcn_param->cap_info_bitmap); in mwifiex_parse_single_response_buf()
1834 return -EFAULT; in mwifiex_parse_single_response_buf()
1843 curr_bcn_bytes -= element_len + in mwifiex_parse_single_response_buf()
1852 if (channel == priv->csa_chan) { in mwifiex_parse_single_response_buf()
1865 freq = cfp ? cfp->freq : 0; in mwifiex_parse_single_response_buf()
1867 chan = ieee80211_get_channel(priv->wdev.wiphy, freq); in mwifiex_parse_single_response_buf()
1869 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { in mwifiex_parse_single_response_buf()
1870 bss = cfg80211_inform_bss(priv->wdev.wiphy, in mwifiex_parse_single_response_buf()
1876 bss_priv = (struct mwifiex_bss_priv *)bss->priv; in mwifiex_parse_single_response_buf()
1877 bss_priv->band = band; in mwifiex_parse_single_response_buf()
1878 bss_priv->fw_tsf = fw_tsf; in mwifiex_parse_single_response_buf()
1879 if (priv->media_connected && in mwifiex_parse_single_response_buf()
1880 !memcmp(bssid, priv->curr_bss_params. in mwifiex_parse_single_response_buf()
1886 if ((chan->flags & IEEE80211_CHAN_RADAR) || in mwifiex_parse_single_response_buf()
1887 (chan->flags & IEEE80211_CHAN_NO_IR)) { in mwifiex_parse_single_response_buf()
1895 cfg80211_put_bss(priv->wdev.wiphy, bss); in mwifiex_parse_single_response_buf()
1907 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_complete_scan()
1909 adapter->survey_idx = 0; in mwifiex_complete_scan()
1910 if (adapter->curr_cmd->wait_q_enabled) { in mwifiex_complete_scan()
1911 adapter->cmd_wait_q.status = 0; in mwifiex_complete_scan()
1912 if (!priv->scan_request) { in mwifiex_complete_scan()
1915 mwifiex_complete_cmd(adapter, adapter->curr_cmd); in mwifiex_complete_scan()
1927 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_active_scan_req_for_passive_chan()
1931 if (adapter->active_scan_triggered || !priv->scan_request || in mwifiex_active_scan_req_for_passive_chan()
1932 priv->scan_aborting) { in mwifiex_active_scan_req_for_passive_chan()
1933 adapter->active_scan_triggered = false; in mwifiex_active_scan_req_for_passive_chan()
1937 if (!priv->hidden_chan[0].chan_number) { in mwifiex_active_scan_req_for_passive_chan()
1944 return -ENOMEM; in mwifiex_active_scan_req_for_passive_chan()
1947 if (!priv->hidden_chan[id].chan_number) in mwifiex_active_scan_req_for_passive_chan()
1949 memcpy(&user_scan_cfg->chan_list[id], in mwifiex_active_scan_req_for_passive_chan()
1950 &priv->hidden_chan[id], in mwifiex_active_scan_req_for_passive_chan()
1954 adapter->active_scan_triggered = true; in mwifiex_active_scan_req_for_passive_chan()
1955 if (priv->scan_request->flags & NL80211_SCAN_FLAG_RANDOM_ADDR) in mwifiex_active_scan_req_for_passive_chan()
1956 ether_addr_copy(user_scan_cfg->random_mac, in mwifiex_active_scan_req_for_passive_chan()
1957 priv->scan_request->mac_addr); in mwifiex_active_scan_req_for_passive_chan()
1958 user_scan_cfg->num_ssids = priv->scan_request->n_ssids; in mwifiex_active_scan_req_for_passive_chan()
1959 user_scan_cfg->ssid_list = priv->scan_request->ssids; in mwifiex_active_scan_req_for_passive_chan()
1964 memset(&priv->hidden_chan, 0, sizeof(priv->hidden_chan)); in mwifiex_active_scan_req_for_passive_chan()
1967 dev_err(priv->adapter->dev, "scan failed: %d\n", ret); in mwifiex_active_scan_req_for_passive_chan()
1975 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_check_next_scan_command()
1978 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
1979 if (list_empty(&adapter->scan_pending_q)) { in mwifiex_check_next_scan_command()
1980 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
1982 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
1983 adapter->scan_processing = false; in mwifiex_check_next_scan_command()
1984 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
1988 if (!adapter->ext_scan) in mwifiex_check_next_scan_command()
1991 if (priv->scan_request) { in mwifiex_check_next_scan_command()
1998 cfg80211_scan_done(priv->scan_request, &info); in mwifiex_check_next_scan_command()
1999 priv->scan_request = NULL; in mwifiex_check_next_scan_command()
2000 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
2002 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
2006 } else if ((priv->scan_aborting && !priv->scan_request) || in mwifiex_check_next_scan_command()
2007 priv->scan_block) { in mwifiex_check_next_scan_command()
2008 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
2012 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
2013 adapter->scan_processing = false; in mwifiex_check_next_scan_command()
2014 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_check_next_scan_command()
2016 if (!adapter->active_scan_triggered) { in mwifiex_check_next_scan_command()
2017 if (priv->scan_request) { in mwifiex_check_next_scan_command()
2024 cfg80211_scan_done(priv->scan_request, &info); in mwifiex_check_next_scan_command()
2025 priv->scan_request = NULL; in mwifiex_check_next_scan_command()
2026 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
2028 priv->scan_aborting = false; in mwifiex_check_next_scan_command()
2037 cmd_node = list_first_entry(&adapter->scan_pending_q, in mwifiex_check_next_scan_command()
2039 list_del(&cmd_node->list); in mwifiex_check_next_scan_command()
2040 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_check_next_scan_command()
2054 if (adapter->scan_processing) { in mwifiex_cancel_scan()
2055 spin_lock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_cancel_scan()
2056 adapter->scan_processing = false; in mwifiex_cancel_scan()
2057 spin_unlock_bh(&adapter->mwifiex_cmd_lock); in mwifiex_cancel_scan()
2058 for (i = 0; i < adapter->priv_num; i++) { in mwifiex_cancel_scan()
2059 priv = adapter->priv[i]; in mwifiex_cancel_scan()
2062 if (priv->scan_request) { in mwifiex_cancel_scan()
2069 cfg80211_scan_done(priv->scan_request, &info); in mwifiex_cancel_scan()
2070 priv->scan_request = NULL; in mwifiex_cancel_scan()
2071 priv->scan_aborting = false; in mwifiex_cancel_scan()
2081 * memory layout:
2083 * .-------------------------------------------------------------.
2085 * .-------------------------------------------------------------.
2087 * .-------------------------------------------------------------.
2089 * .-------------------------------------------------------------.
2091 * .-------------------------------------------------------------.
2092 * | TLV data (variable, size calculated using Header->Size, |
2094 * .-------------------------------------------------------------.
2100 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_802_11_scan()
2117 is_bgscan_resp = (le16_to_cpu(resp->command) in mwifiex_ret_802_11_scan()
2120 scan_rsp = &resp->params.bg_scan_query_resp.scan_resp; in mwifiex_ret_802_11_scan()
2122 scan_rsp = &resp->params.scan_resp; in mwifiex_ret_802_11_scan()
2125 if (scan_rsp->number_of_sets > MWIFIEX_MAX_AP) { in mwifiex_ret_802_11_scan()
2128 scan_rsp->number_of_sets); in mwifiex_ret_802_11_scan()
2129 ret = -1; in mwifiex_ret_802_11_scan()
2136 bytes_left = le16_to_cpu(scan_rsp->bss_descript_size); in mwifiex_ret_802_11_scan()
2141 scan_resp_size = le16_to_cpu(resp->size); in mwifiex_ret_802_11_scan()
2145 scan_rsp->number_of_sets); in mwifiex_ret_802_11_scan()
2147 bss_info = scan_rsp->bss_desc_and_tlv_buffer; in mwifiex_ret_802_11_scan()
2150 * The size of the TLV buffer is equal to the entire command response in mwifiex_ret_802_11_scan()
2155 tlv_buf_size = scan_resp_size - (bytes_left in mwifiex_ret_802_11_scan()
2156 + sizeof(scan_rsp->bss_descript_size) in mwifiex_ret_802_11_scan()
2157 + sizeof(scan_rsp->number_of_sets) in mwifiex_ret_802_11_scan()
2160 tlv_data = (struct mwifiex_ie_types_data *) (scan_rsp-> in mwifiex_ret_802_11_scan()
2164 /* Search the TLV buffer space in the scan response for any valid in mwifiex_ret_802_11_scan()
2171 /* Search the TLV buffer space in the scan response for any valid in mwifiex_ret_802_11_scan()
2179 if (priv->wdev.wiphy->wowlan_config) in mwifiex_ret_802_11_scan()
2180 nd_config = priv->wdev.wiphy->wowlan_config->nd_config; in mwifiex_ret_802_11_scan()
2184 adapter->nd_info = in mwifiex_ret_802_11_scan()
2185 kzalloc(struct_size(adapter->nd_info, matches, in mwifiex_ret_802_11_scan()
2186 scan_rsp->number_of_sets), in mwifiex_ret_802_11_scan()
2189 if (adapter->nd_info) in mwifiex_ret_802_11_scan()
2190 adapter->nd_info->n_matches = scan_rsp->number_of_sets; in mwifiex_ret_802_11_scan()
2193 for (idx = 0; idx < scan_rsp->number_of_sets && bytes_left; idx++) { in mwifiex_ret_802_11_scan()
2195 * If the TSF TLV was appended to the scan results, save this in mwifiex_ret_802_11_scan()
2201 memcpy(&fw_tsf, &tsf_tlv->tsf_data[idx * TSF_DATA_SIZE], in mwifiex_ret_802_11_scan()
2205 chan_band = &chan_band_tlv->chan_band_param[idx]; in mwifiex_ret_802_11_scan()
2206 radio_type = &chan_band->radio_type; in mwifiex_ret_802_11_scan()
2211 if (chan_band_tlv && adapter->nd_info) { in mwifiex_ret_802_11_scan()
2212 adapter->nd_info->matches[idx] = in mwifiex_ret_802_11_scan()
2216 pmatch = adapter->nd_info->matches[idx]; in mwifiex_ret_802_11_scan()
2219 pmatch->n_channels = 1; in mwifiex_ret_802_11_scan()
2220 pmatch->channels[0] = chan_band->chan_number; in mwifiex_ret_802_11_scan()
2248 struct host_cmd_ds_802_11_scan_ext *ext_scan = &cmd->params.ext_scan; in mwifiex_cmd_802_11_scan_ext()
2251 memcpy(ext_scan->tlv_buffer, scan_cfg->tlv_buf, scan_cfg->tlv_buf_len); in mwifiex_cmd_802_11_scan_ext()
2253 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SCAN_EXT); in mwifiex_cmd_802_11_scan_ext()
2255 /* Size is equal to the sizeof(fixed portions) + the TLV len + header */ in mwifiex_cmd_802_11_scan_ext()
2256 cmd->size = cpu_to_le16((u16)(sizeof(ext_scan->reserved) in mwifiex_cmd_802_11_scan_ext()
2257 + scan_cfg->tlv_buf_len + S_DS_GEN)); in mwifiex_cmd_802_11_scan_ext()
2270 &cmd->params.bg_scan_config; in mwifiex_cmd_802_11_bg_scan_config()
2272 u8 *tlv_pos = bgscan_config->tlv; in mwifiex_cmd_802_11_bg_scan_config()
2284 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_BG_SCAN_CONFIG); in mwifiex_cmd_802_11_bg_scan_config()
2285 cmd->size = cpu_to_le16(sizeof(*bgscan_config) + S_DS_GEN); in mwifiex_cmd_802_11_bg_scan_config()
2287 bgscan_config->action = cpu_to_le16(bgscan_cfg_in->action); in mwifiex_cmd_802_11_bg_scan_config()
2288 bgscan_config->enable = bgscan_cfg_in->enable; in mwifiex_cmd_802_11_bg_scan_config()
2289 bgscan_config->bss_type = bgscan_cfg_in->bss_type; in mwifiex_cmd_802_11_bg_scan_config()
2290 bgscan_config->scan_interval = in mwifiex_cmd_802_11_bg_scan_config()
2291 cpu_to_le32(bgscan_cfg_in->scan_interval); in mwifiex_cmd_802_11_bg_scan_config()
2292 bgscan_config->report_condition = in mwifiex_cmd_802_11_bg_scan_config()
2293 cpu_to_le32(bgscan_cfg_in->report_condition); in mwifiex_cmd_802_11_bg_scan_config()
2296 if (!bgscan_config->enable) in mwifiex_cmd_802_11_bg_scan_config()
2299 bgscan_config->chan_per_scan = bgscan_cfg_in->chan_per_scan; in mwifiex_cmd_802_11_bg_scan_config()
2301 num_probes = (bgscan_cfg_in->num_probes ? bgscan_cfg_in-> in mwifiex_cmd_802_11_bg_scan_config()
2302 num_probes : priv->adapter->scan_probes); in mwifiex_cmd_802_11_bg_scan_config()
2306 num_probes_tlv->header.type = cpu_to_le16(TLV_TYPE_NUMPROBES); in mwifiex_cmd_802_11_bg_scan_config()
2307 num_probes_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2308 cpu_to_le16(sizeof(num_probes_tlv->num_probes)); in mwifiex_cmd_802_11_bg_scan_config()
2309 num_probes_tlv->num_probes = cpu_to_le16((u16)num_probes); in mwifiex_cmd_802_11_bg_scan_config()
2311 tlv_pos += sizeof(num_probes_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2312 le16_to_cpu(num_probes_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2315 if (bgscan_cfg_in->repeat_count) { in mwifiex_cmd_802_11_bg_scan_config()
2318 repeat_count_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2320 repeat_count_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2321 cpu_to_le16(sizeof(repeat_count_tlv->repeat_count)); in mwifiex_cmd_802_11_bg_scan_config()
2322 repeat_count_tlv->repeat_count = in mwifiex_cmd_802_11_bg_scan_config()
2323 cpu_to_le16(bgscan_cfg_in->repeat_count); in mwifiex_cmd_802_11_bg_scan_config()
2325 tlv_pos += sizeof(repeat_count_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2326 le16_to_cpu(repeat_count_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2329 if (bgscan_cfg_in->rssi_threshold) { in mwifiex_cmd_802_11_bg_scan_config()
2332 rssi_threshold_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2334 rssi_threshold_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2335 cpu_to_le16(sizeof(rssi_threshold_tlv->rssi_threshold)); in mwifiex_cmd_802_11_bg_scan_config()
2336 rssi_threshold_tlv->rssi_threshold = in mwifiex_cmd_802_11_bg_scan_config()
2337 cpu_to_le16(bgscan_cfg_in->rssi_threshold); in mwifiex_cmd_802_11_bg_scan_config()
2339 tlv_pos += sizeof(rssi_threshold_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2340 le16_to_cpu(rssi_threshold_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2343 for (i = 0; i < bgscan_cfg_in->num_ssids; i++) { in mwifiex_cmd_802_11_bg_scan_config()
2344 ssid_len = bgscan_cfg_in->ssid_list[i].ssid.ssid_len; in mwifiex_cmd_802_11_bg_scan_config()
2348 wildcard_ssid_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2350 wildcard_ssid_tlv->header.len = cpu_to_le16( in mwifiex_cmd_802_11_bg_scan_config()
2351 (u16)(ssid_len + sizeof(wildcard_ssid_tlv-> in mwifiex_cmd_802_11_bg_scan_config()
2360 wildcard_ssid_tlv->max_ssid_length = 0; in mwifiex_cmd_802_11_bg_scan_config()
2362 wildcard_ssid_tlv->max_ssid_length = in mwifiex_cmd_802_11_bg_scan_config()
2365 memcpy(wildcard_ssid_tlv->ssid, in mwifiex_cmd_802_11_bg_scan_config()
2366 bgscan_cfg_in->ssid_list[i].ssid.ssid, ssid_len); in mwifiex_cmd_802_11_bg_scan_config()
2368 tlv_pos += (sizeof(wildcard_ssid_tlv->header) in mwifiex_cmd_802_11_bg_scan_config()
2369 + le16_to_cpu(wildcard_ssid_tlv->header.len)); in mwifiex_cmd_802_11_bg_scan_config()
2374 if (bgscan_cfg_in->chan_list[0].chan_number) { in mwifiex_cmd_802_11_bg_scan_config()
2375 dev_dbg(priv->adapter->dev, "info: bgscan: Using supplied channel list\n"); in mwifiex_cmd_802_11_bg_scan_config()
2377 chan_list_tlv->header.type = cpu_to_le16(TLV_TYPE_CHANLIST); in mwifiex_cmd_802_11_bg_scan_config()
2381 bgscan_cfg_in->chan_list[chan_idx].chan_number; in mwifiex_cmd_802_11_bg_scan_config()
2383 temp_chan = chan_list_tlv->chan_scan_param + chan_idx; in mwifiex_cmd_802_11_bg_scan_config()
2385 /* Increment the TLV header length by size appended */ in mwifiex_cmd_802_11_bg_scan_config()
2386 le16_unaligned_add_cpu(&chan_list_tlv->header.len, in mwifiex_cmd_802_11_bg_scan_config()
2388 chan_list_tlv->chan_scan_param)); in mwifiex_cmd_802_11_bg_scan_config()
2390 temp_chan->chan_number = in mwifiex_cmd_802_11_bg_scan_config()
2391 bgscan_cfg_in->chan_list[chan_idx].chan_number; in mwifiex_cmd_802_11_bg_scan_config()
2392 temp_chan->radio_type = in mwifiex_cmd_802_11_bg_scan_config()
2393 bgscan_cfg_in->chan_list[chan_idx].radio_type; in mwifiex_cmd_802_11_bg_scan_config()
2396 bgscan_cfg_in->chan_list[chan_idx].scan_type; in mwifiex_cmd_802_11_bg_scan_config()
2399 temp_chan->chan_scan_mode_bitmap in mwifiex_cmd_802_11_bg_scan_config()
2402 temp_chan->chan_scan_mode_bitmap in mwifiex_cmd_802_11_bg_scan_config()
2405 if (bgscan_cfg_in->chan_list[chan_idx].scan_time) { in mwifiex_cmd_802_11_bg_scan_config()
2406 scan_dur = (u16)bgscan_cfg_in-> in mwifiex_cmd_802_11_bg_scan_config()
2411 priv->adapter->passive_scan_time : in mwifiex_cmd_802_11_bg_scan_config()
2412 priv->adapter->specific_scan_time; in mwifiex_cmd_802_11_bg_scan_config()
2415 temp_chan->min_scan_time = cpu_to_le16(scan_dur); in mwifiex_cmd_802_11_bg_scan_config()
2416 temp_chan->max_scan_time = cpu_to_le16(scan_dur); in mwifiex_cmd_802_11_bg_scan_config()
2419 dev_dbg(priv->adapter->dev, in mwifiex_cmd_802_11_bg_scan_config()
2423 chan_list_tlv-> in mwifiex_cmd_802_11_bg_scan_config()
2425 le16_unaligned_add_cpu(&chan_list_tlv->header.len, in mwifiex_cmd_802_11_bg_scan_config()
2427 sizeof(chan_list_tlv->chan_scan_param[0])); in mwifiex_cmd_802_11_bg_scan_config()
2430 tlv_pos += (sizeof(chan_list_tlv->header) in mwifiex_cmd_802_11_bg_scan_config()
2431 + le16_to_cpu(chan_list_tlv->header.len)); in mwifiex_cmd_802_11_bg_scan_config()
2433 if (bgscan_cfg_in->start_later) { in mwifiex_cmd_802_11_bg_scan_config()
2436 start_later_tlv->header.type = in mwifiex_cmd_802_11_bg_scan_config()
2438 start_later_tlv->header.len = in mwifiex_cmd_802_11_bg_scan_config()
2439 cpu_to_le16(sizeof(start_later_tlv->start_later)); in mwifiex_cmd_802_11_bg_scan_config()
2440 start_later_tlv->start_later = in mwifiex_cmd_802_11_bg_scan_config()
2441 cpu_to_le16(bgscan_cfg_in->start_later); in mwifiex_cmd_802_11_bg_scan_config()
2443 tlv_pos += sizeof(start_later_tlv->header) + in mwifiex_cmd_802_11_bg_scan_config()
2444 le16_to_cpu(start_later_tlv->header.len); in mwifiex_cmd_802_11_bg_scan_config()
2447 /* Append vendor specific IE TLV */ in mwifiex_cmd_802_11_bg_scan_config()
2450 le16_unaligned_add_cpu(&cmd->size, tlv_pos - bgscan_config->tlv); in mwifiex_cmd_802_11_bg_scan_config()
2459 if (!priv->sched_scanning) { in mwifiex_stop_bg_scan()
2460 dev_dbg(priv->adapter->dev, "bgscan already stopped!\n"); in mwifiex_stop_bg_scan()
2466 return -ENOMEM; in mwifiex_stop_bg_scan()
2468 bgscan_cfg->bss_type = MWIFIEX_BSS_MODE_INFRA; in mwifiex_stop_bg_scan()
2469 bgscan_cfg->action = MWIFIEX_BGSCAN_ACT_SET; in mwifiex_stop_bg_scan()
2470 bgscan_cfg->enable = false; in mwifiex_stop_bg_scan()
2475 return -EFAULT; in mwifiex_stop_bg_scan()
2479 priv->sched_scanning = false; in mwifiex_stop_bg_scan()
2488 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_update_chan_statistics()
2495 num_chan = le16_to_cpu(tlv_stat->header.len) / in mwifiex_update_chan_statistics()
2499 if (adapter->survey_idx >= adapter->num_in_chan_stats) { in mwifiex_update_chan_statistics()
2502 adapter->num_in_chan_stats); in mwifiex_update_chan_statistics()
2505 chan_stats.chan_num = fw_chan_stats->chan_num; in mwifiex_update_chan_statistics()
2506 chan_stats.bandcfg = fw_chan_stats->bandcfg; in mwifiex_update_chan_statistics()
2507 chan_stats.flags = fw_chan_stats->flags; in mwifiex_update_chan_statistics()
2508 chan_stats.noise = fw_chan_stats->noise; in mwifiex_update_chan_statistics()
2509 chan_stats.total_bss = le16_to_cpu(fw_chan_stats->total_bss); in mwifiex_update_chan_statistics()
2511 le16_to_cpu(fw_chan_stats->cca_scan_dur); in mwifiex_update_chan_statistics()
2513 le16_to_cpu(fw_chan_stats->cca_busy_dur); in mwifiex_update_chan_statistics()
2521 memcpy(&adapter->chan_stats[adapter->survey_idx++], &chan_stats, in mwifiex_update_chan_statistics()
2531 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_ret_802_11_scan_ext()
2533 struct mwifiex_ie_types_header *tlv; in mwifiex_ret_802_11_scan_ext() local
2543 ext_scan_resp = &resp->params.ext_scan; in mwifiex_ret_802_11_scan_ext()
2545 tlv = (void *)ext_scan_resp->tlv_buffer; in mwifiex_ret_802_11_scan_ext()
2546 buf_left = le16_to_cpu(resp->size) - (sizeof(*ext_scan_resp) + S_DS_GEN); in mwifiex_ret_802_11_scan_ext()
2549 type = le16_to_cpu(tlv->type); in mwifiex_ret_802_11_scan_ext()
2550 len = le16_to_cpu(tlv->len); in mwifiex_ret_802_11_scan_ext()
2560 tlv_stat = (void *)tlv; in mwifiex_ret_802_11_scan_ext()
2567 buf_left -= len + sizeof(struct mwifiex_ie_types_header); in mwifiex_ret_802_11_scan_ext()
2568 tlv = (void *)((u8 *)tlv + len + in mwifiex_ret_802_11_scan_ext()
2572 spin_lock_bh(&adapter->cmd_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2573 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2574 if (list_empty(&adapter->scan_pending_q)) { in mwifiex_ret_802_11_scan_ext()
2576 list_for_each_entry(cmd_node, &adapter->cmd_pending_q, list) { in mwifiex_ret_802_11_scan_ext()
2577 cmd_ptr = (void *)cmd_node->cmd_skb->data; in mwifiex_ret_802_11_scan_ext()
2578 if (le16_to_cpu(cmd_ptr->command) == in mwifiex_ret_802_11_scan_ext()
2587 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2588 spin_unlock_bh(&adapter->cmd_pending_q_lock); in mwifiex_ret_802_11_scan_ext()
2603 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_handle_event_ext_scan_report()
2607 struct mwifiex_ie_types_data *tlv; in mwifiex_handle_event_ext_scan_report() local
2614 u8 num_of_set = event_scan->num_of_set; in mwifiex_handle_event_ext_scan_report()
2616 u16 scan_resp_size = le16_to_cpu(event_scan->buf_size); in mwifiex_handle_event_ext_scan_report()
2622 ret = -1; in mwifiex_handle_event_ext_scan_report()
2634 tlv = (struct mwifiex_ie_types_data *)scan_resp; in mwifiex_handle_event_ext_scan_report()
2637 type = le16_to_cpu(tlv->header.type); in mwifiex_handle_event_ext_scan_report()
2638 len = le16_to_cpu(tlv->header.len); in mwifiex_handle_event_ext_scan_report()
2641 "EXT_SCAN: Error bytes left < TLV length\n"); in mwifiex_handle_event_ext_scan_report()
2648 /* BSS response TLV with beacon or probe response buffer in mwifiex_handle_event_ext_scan_report()
2654 bss_info = (u8 *)tlv; in mwifiex_handle_event_ext_scan_report()
2655 scan_rsp_tlv = (struct mwifiex_ie_types_bss_scan_rsp *)tlv; in mwifiex_handle_event_ext_scan_report()
2656 tlv = (struct mwifiex_ie_types_data *)(tlv->data + len); in mwifiex_handle_event_ext_scan_report()
2657 bytes_left_for_tlv -= in mwifiex_handle_event_ext_scan_report()
2662 le16_to_cpu(tlv->header.type) != TLV_TYPE_BSS_SCAN_RSP) { in mwifiex_handle_event_ext_scan_report()
2663 type = le16_to_cpu(tlv->header.type); in mwifiex_handle_event_ext_scan_report()
2664 len = le16_to_cpu(tlv->header.len); in mwifiex_handle_event_ext_scan_report()
2668 "EXT_SCAN: Error in processing TLV,\t" in mwifiex_handle_event_ext_scan_report()
2669 "bytes left < TLV length\n"); in mwifiex_handle_event_ext_scan_report()
2677 (struct mwifiex_ie_types_bss_scan_info *)tlv; in mwifiex_handle_event_ext_scan_report()
2679 sizeof(struct mwifiex_ie_types_bss_scan_info) - in mwifiex_handle_event_ext_scan_report()
2688 tlv = (struct mwifiex_ie_types_data *)(tlv->data + len); in mwifiex_handle_event_ext_scan_report()
2689 bytes_left -= in mwifiex_handle_event_ext_scan_report()
2691 bytes_left_for_tlv -= in mwifiex_handle_event_ext_scan_report()
2704 bytes_left -= sizeof(u16); in mwifiex_handle_event_ext_scan_report()
2707 rssi = (s32)(s16)(le16_to_cpu(scan_info_tlv->rssi)); in mwifiex_handle_event_ext_scan_report()
2711 fw_tsf = le64_to_cpu(scan_info_tlv->tsf); in mwifiex_handle_event_ext_scan_report()
2712 radio_type = &scan_info_tlv->radio_type; in mwifiex_handle_event_ext_scan_report()
2724 if (!event_scan->more_event) in mwifiex_handle_event_ext_scan_report()
2733 * Preparation includes -
2734 * - Setting command ID and proper size
2735 * - Setting background scan flush parameter
2736 * - Ensuring correct endian-ness
2741 &cmd->params.bg_scan_query; in mwifiex_cmd_802_11_bg_scan_query()
2743 cmd->command = cpu_to_le16(HostCmd_CMD_802_11_BG_SCAN_QUERY); in mwifiex_cmd_802_11_bg_scan_query()
2744 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_bg_scan_query) in mwifiex_cmd_802_11_bg_scan_query()
2747 bg_query->flush = 1; in mwifiex_cmd_802_11_bg_scan_query()
2759 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_queue_scan_cmd()
2761 cmd_node->wait_q_enabled = true; in mwifiex_queue_scan_cmd()
2762 cmd_node->condition = &adapter->scan_wait_q_woken; in mwifiex_queue_scan_cmd()
2763 spin_lock_bh(&adapter->scan_pending_q_lock); in mwifiex_queue_scan_cmd()
2764 list_add_tail(&cmd_node->list, &adapter->scan_pending_q); in mwifiex_queue_scan_cmd()
2765 spin_unlock_bh(&adapter->scan_pending_q_lock); in mwifiex_queue_scan_cmd()
2775 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_scan_specific_ssid()
2779 if (adapter->scan_processing) { in mwifiex_scan_specific_ssid()
2782 return -EBUSY; in mwifiex_scan_specific_ssid()
2785 if (priv->scan_block) { in mwifiex_scan_specific_ssid()
2788 return -EBUSY; in mwifiex_scan_specific_ssid()
2793 return -ENOMEM; in mwifiex_scan_specific_ssid()
2795 scan_cfg->ssid_list = req_ssid; in mwifiex_scan_specific_ssid()
2796 scan_cfg->num_ssids = 1; in mwifiex_scan_specific_ssid()
2818 if (mutex_lock_interruptible(&priv->async_mutex)) { in mwifiex_request_scan()
2819 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_request_scan()
2822 return -1; in mwifiex_request_scan()
2825 priv->adapter->scan_wait_q_woken = false; in mwifiex_request_scan()
2827 if (req_ssid && req_ssid->ssid_len != 0) in mwifiex_request_scan()
2834 mutex_unlock(&priv->async_mutex); in mwifiex_request_scan()
2840 * This function appends the vendor specific IE TLV to a buffer.
2856 * the selected(scan/assoc/adhoc) IE as TLV to the command in mwifiex_cmd_append_vsie_tlv()
2859 if (priv->vs_ie[id].mask & vsie_mask) { in mwifiex_cmd_append_vsie_tlv()
2863 vs_param_set->header.type = in mwifiex_cmd_append_vsie_tlv()
2865 vs_param_set->header.len = in mwifiex_cmd_append_vsie_tlv()
2866 cpu_to_le16((((u16) priv->vs_ie[id].ie[1]) in mwifiex_cmd_append_vsie_tlv()
2868 if (le16_to_cpu(vs_param_set->header.len) > in mwifiex_cmd_append_vsie_tlv()
2870 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_cmd_append_vsie_tlv()
2875 memcpy(vs_param_set->ie, priv->vs_ie[id].ie, in mwifiex_cmd_append_vsie_tlv()
2876 le16_to_cpu(vs_param_set->header.len)); in mwifiex_cmd_append_vsie_tlv()
2877 *buffer += le16_to_cpu(vs_param_set->header.len) + in mwifiex_cmd_append_vsie_tlv()
2879 ret_len += le16_to_cpu(vs_param_set->header.len) + in mwifiex_cmd_append_vsie_tlv()
2892 * - The current ssid was not found somehow in the last scan.
2893 * - The current ssid was the last entry of the scan table and overloaded.
2899 &priv->curr_bss_params.bss_descriptor; in mwifiex_save_curr_bcn()
2901 if (!curr_bss->beacon_buf_size) in mwifiex_save_curr_bcn()
2905 if (!priv->curr_bcn_buf || in mwifiex_save_curr_bcn()
2906 priv->curr_bcn_size != curr_bss->beacon_buf_size) { in mwifiex_save_curr_bcn()
2907 priv->curr_bcn_size = curr_bss->beacon_buf_size; in mwifiex_save_curr_bcn()
2909 kfree(priv->curr_bcn_buf); in mwifiex_save_curr_bcn()
2910 priv->curr_bcn_buf = kmalloc(curr_bss->beacon_buf_size, in mwifiex_save_curr_bcn()
2912 if (!priv->curr_bcn_buf) in mwifiex_save_curr_bcn()
2916 memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf, in mwifiex_save_curr_bcn()
2917 curr_bss->beacon_buf_size); in mwifiex_save_curr_bcn()
2918 mwifiex_dbg(priv->adapter, INFO, in mwifiex_save_curr_bcn()
2920 priv->curr_bcn_size); in mwifiex_save_curr_bcn()
2922 curr_bss->beacon_buf = priv->curr_bcn_buf; in mwifiex_save_curr_bcn()
2925 if (curr_bss->bcn_wpa_ie) in mwifiex_save_curr_bcn()
2926 curr_bss->bcn_wpa_ie = in mwifiex_save_curr_bcn()
2928 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2929 curr_bss->wpa_offset); in mwifiex_save_curr_bcn()
2931 if (curr_bss->bcn_rsn_ie) in mwifiex_save_curr_bcn()
2932 curr_bss->bcn_rsn_ie = (struct ieee_types_generic *) in mwifiex_save_curr_bcn()
2933 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2934 curr_bss->rsn_offset); in mwifiex_save_curr_bcn()
2936 if (curr_bss->bcn_ht_cap) in mwifiex_save_curr_bcn()
2937 curr_bss->bcn_ht_cap = (struct ieee80211_ht_cap *) in mwifiex_save_curr_bcn()
2938 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2939 curr_bss->ht_cap_offset); in mwifiex_save_curr_bcn()
2941 if (curr_bss->bcn_ht_oper) in mwifiex_save_curr_bcn()
2942 curr_bss->bcn_ht_oper = (struct ieee80211_ht_operation *) in mwifiex_save_curr_bcn()
2943 (curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2944 curr_bss->ht_info_offset); in mwifiex_save_curr_bcn()
2946 if (curr_bss->bcn_vht_cap) in mwifiex_save_curr_bcn()
2947 curr_bss->bcn_vht_cap = (void *)(curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2948 curr_bss->vht_cap_offset); in mwifiex_save_curr_bcn()
2950 if (curr_bss->bcn_vht_oper) in mwifiex_save_curr_bcn()
2951 curr_bss->bcn_vht_oper = (void *)(curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2952 curr_bss->vht_info_offset); in mwifiex_save_curr_bcn()
2954 if (curr_bss->bcn_bss_co_2040) in mwifiex_save_curr_bcn()
2955 curr_bss->bcn_bss_co_2040 = in mwifiex_save_curr_bcn()
2956 (curr_bss->beacon_buf + curr_bss->bss_co_2040_offset); in mwifiex_save_curr_bcn()
2958 if (curr_bss->bcn_ext_cap) in mwifiex_save_curr_bcn()
2959 curr_bss->bcn_ext_cap = curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2960 curr_bss->ext_cap_offset; in mwifiex_save_curr_bcn()
2962 if (curr_bss->oper_mode) in mwifiex_save_curr_bcn()
2963 curr_bss->oper_mode = (void *)(curr_bss->beacon_buf + in mwifiex_save_curr_bcn()
2964 curr_bss->oper_mode_offset); in mwifiex_save_curr_bcn()
2973 kfree(priv->curr_bcn_buf); in mwifiex_free_curr_bcn()
2974 priv->curr_bcn_buf = NULL; in mwifiex_free_curr_bcn()