Beispiel #1
0
/** 
 *  @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;
}
Beispiel #2
0
/**
 *  @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;
}