/** * @brief This function prepares domain info from scan table and * downloads the domain info command to the FW. * * @param pmpriv A pointer to mlan_private structure * * @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE */ mlan_status wlan_11d_prepare_dnld_domain_info_cmd(mlan_private * pmpriv) { mlan_status ret = MLAN_STATUS_SUCCESS; mlan_adapter *pmadapter = pmpriv->adapter; IEEEtypes_CountryInfoFullSet_t *pcountry_full = MNULL; t_u32 idx; ENTER(); /* Only valid if 11D is enabled */ if (wlan_11d_get_state(pmpriv) == ENABLE_11D && pmadapter->num_in_scan_table != 0) { for (idx = 0; idx < pmadapter->num_in_scan_table; idx++) { pcountry_full = &pmadapter->pscan_table[idx].country_info; if (*(pcountry_full->country_code) == 0 || (pcountry_full->len <= COUNTRY_CODE_LEN)) { /* Country info not found in the BSS descriptor */ ret = wlan_11d_update_chan_pwr_table(pmpriv, &pmadapter-> pscan_table[idx]); } else { /* Country info found in the BSS Descriptor */ ret = wlan_11d_process_country_info(pmpriv, &pmadapter->pscan_table[idx]); /* * If valid country IE found, in BSS, channel table is updated * Send FW command */ if (ret == MLAN_STATUS_SUCCESS) break; } } /* Check if connected */ if (pmpriv->media_connected == MTRUE) { ret = wlan_11d_parse_dnld_countryinfo(pmpriv, &pmpriv->curr_bss_params. bss_descriptor); } else { ret = wlan_11d_parse_dnld_countryinfo(pmpriv, MNULL); } } LEAVE(); return ret; }
/** * @brief This function prepares domain info from scan table and * downloads the domain info command to the FW. * * @param pmpriv A pointer to mlan_private structure * * @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE */ mlan_status wlan_11d_prepare_dnld_domain_info_cmd(mlan_private * pmpriv) { mlan_status ret = MLAN_STATUS_SUCCESS; mlan_adapter *pmadapter = pmpriv->adapter; IEEEtypes_CountryInfoFullSet_t *pcountry_full = MNULL; t_u32 idx; ENTER(); /* Only valid if 11D is enabled */ if (wlan_11d_is_enabled(pmpriv) && pmadapter->num_in_scan_table != 0) { for (idx = 0; idx < pmadapter->num_in_scan_table; idx++) { pcountry_full = &pmadapter->pscan_table[idx].country_info; ret = wlan_11d_update_chan_pwr_table(pmpriv, &pmadapter-> pscan_table[idx]); if (*(pcountry_full->country_code) != 0 && (pcountry_full->len > COUNTRY_CODE_LEN)) { /* Country info found in the BSS Descriptor */ ret = wlan_11d_process_country_info(pmpriv, &pmadapter-> pscan_table [idx]); } } /* Sort parsed_region_chan in ascending channel number */ wlan_11d_sort_parsed_region_chan(&pmadapter-> parsed_region_chan); /* Check if connected */ if (pmpriv->media_connected == MTRUE) { ret = wlan_11d_parse_dnld_countryinfo(pmpriv, &pmpriv-> curr_bss_params. bss_descriptor); } else { ret = wlan_11d_parse_dnld_countryinfo(pmpriv, MNULL); } } LEAVE(); return ret; }
/** * @brief Process an TLV buffer for a pending BSS Join command for * both adhoc and infra networks * * The TLV command processing for a BSS join for either adhoc or * infrastructure network is performed with this function. The * capability bits are inspected for the IBSS flag and the appropriate * local routines are called to setup the necessary TLVs. * * Activate 11h functionality in the firmware if the spectrum management * capability bit is found in the network information for the BSS we are * joining. * * @param priv Private driver information structure * @param ppbuffer Output parameter: Pointer to the TLV output buffer, * modified on return to point after the appended 11h TLVs * @param pcap_info Pointer to the capability info for the BSS to join * @param channel Channel on which we are joining the BSS * @param p11h_bss_info Pointer to the 11h BSS information for this * network that was parsed out of the scan response. * * @return Integer number of bytes appended to the TLV output * buffer (ppbuffer), MLAN_STATUS_FAILURE (-1), * or MLAN_STATUS_SUCCESS (0) */ int wlan_11h_process_join(mlan_private * priv, t_u8 ** ppbuffer, IEEEtypes_CapInfo_t * pcap_info, t_u32 channel, wlan_11h_bss_info_t * p11h_bss_info) { int ret = 0; ENTER(); if (priv->media_connected == MTRUE) { if (wlan_11h_is_active(priv) == p11h_bss_info->sensed_11h) { /* Assume DFS parameters are the same for roaming as long as the current & next APs have the same spectrum mgmt capability bit setting */ ret = MLAN_STATUS_SUCCESS; } else { /* No support for roaming between DFS/non-DFS yet */ ret = MLAN_STATUS_FAILURE; } LEAVE(); return ret; } if (p11h_bss_info->sensed_11h) { /* No use having 11h enabled without 11d enabled */ wlan_11d_enable(priv, MNULL, ENABLE_11D); wlan_11d_parse_dnld_countryinfo(priv, priv->pattempted_bss_desc); /* Activate 11h functions in firmware, turns on capability bit */ wlan_11h_activate(priv, MTRUE); pcap_info->spectrum_mgmt = 1; if (pcap_info->ibss) { PRINTM(MINFO, "11h: Adhoc join: Sensed\n"); ret = wlan_11h_process_adhoc(priv, ppbuffer, channel, p11h_bss_info); } else { PRINTM(MINFO, "11h: Infra join: Sensed\n"); ret = wlan_11h_process_infra_join(priv, ppbuffer, channel, p11h_bss_info); } } else { /* Deactivate 11h functions in the firmware */ wlan_11h_activate(priv, MFALSE); pcap_info->spectrum_mgmt = 0; } LEAVE(); return ret; }