software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @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 band          Band on which we are joining the BSS
 *  @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)
 */
@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.



@return              Integer number of bytes appended to the TLV output
buffer (ppbuffer), MLAN_STATUS_FAILURE (-1),
or MLAN_STATUS_SUCCESS (0)
@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 . @return Integer number of bytes appended to the TLV output buffer ( ppbuffer ) MLAN_STATUS_FAILURE ( - 1 ) or MLAN_STATUS_SUCCESS ( 0 )
t_s32
wlan_11h_process_join(mlan_private *priv,
		      t_u8 **ppbuffer,
		      IEEEtypes_CapInfo_t *pcap_info,
		      t_u8 band,
		      t_u32 channel, wlan_11h_bss_info_t *p11h_bss_info)
{
	t_s32 ret = 0;
	ENTER();
	if (priv->media_connected == MTRUE) {
		if (wlan_11h_is_active(priv) == p11h_bss_info->sensed_11h) {
			ret = MLAN_STATUS_SUCCESS;
		} else {
			ret = MLAN_STATUS_FAILURE;
		}
		LEAVE();
		return ret;
	}
	if (p11h_bss_info->sensed_11h) {
		if (!wlan_fw_11d_is_enabled(priv)) {
			wlan_11d_enable(priv, MNULL, ENABLE_11D);
#ifdef STA_SUPPORT
			wlan_11d_parse_dnld_countryinfo(priv,
							priv->
							pattempted_bss_desc);
#endif
		}
		wlan_11h_activate(priv, MNULL, MTRUE);
		pcap_info->spectrum_mgmt = MTRUE;
		if ((band & BAND_A) &&
		    wlan_11h_radar_detect_required(priv, channel)) {
			if (!wlan_11h_is_slave_radar_det_active(priv))
				wlan_11h_config_slave_radar_det(priv, MTRUE);
		}
		wlan_11h_check_update_radar_det_state(priv);
		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, band,
							  channel,
							  p11h_bss_info);
		}
	} else {
		wlan_11h_activate(priv, MNULL, MFALSE);
		pcap_info->spectrum_mgmt = MFALSE;
		wlan_11h_check_update_radar_det_state(priv);
	}
	LEAVE();
	return ret;
}
t_s32 wlan_11h_process_join ( mlan_private * priv , t_u8 * * ppbuffer , IEEEtypes_CapInfo_t * pcap_info , t_u8 band , t_u32 channel , wlan_11h_bss_info_t * p11h_bss_info ) { t_s32 ret = 0 ; ENTER ( ) ; if ( priv -> media_connected == MTRUE ) { if ( wlan_11h_is_active ( priv ) == p11h_bss_info -> sensed_11h ) { ret = MLAN_STATUS_SUCCESS ; } else { ret = MLAN_STATUS_FAILURE ; } LEAVE ( ) ; return ret ; } if ( p11h_bss_info -> sensed_11h ) { if ( ! wlan_fw_11d_is_enabled ( priv ) ) { wlan_11d_enable ( priv , MNULL , ENABLE_11D ) ; #ifdef STA_SUPPORT wlan_11d_parse_dnld_countryinfo ( priv , priv -> pattempted_bss_desc ) ; #endif } wlan_11h_activate ( priv , MNULL , MTRUE ) ; pcap_info -> spectrum_mgmt = MTRUE ; if ( ( band & BAND_A ) && wlan_11h_radar_detect_required ( priv , channel ) ) { if ( ! wlan_11h_is_slave_radar_det_active ( priv ) ) wlan_11h_config_slave_radar_det ( priv , MTRUE ) ; } wlan_11h_check_update_radar_det_state ( priv ) ; if ( pcap_info -> ibss ) { PRINTM ( MINFO , " \n " ) ; ret = wlan_11h_process_adhoc ( priv , ppbuffer , channel , p11h_bss_info ) ; } else { PRINTM ( MINFO , " \n " ) ; ret = wlan_11h_process_infra_join ( priv , ppbuffer , band , channel , p11h_bss_info ) ; } } else { wlan_11h_activate ( priv , MNULL , MFALSE ) ; pcap_info -> spectrum_mgmt = MFALSE ; wlan_11h_check_update_radar_det_state ( priv ) ; } LEAVE ( ) ; return ret ; }
@brief Process an TLV buffer for a pending BSS Join command for
         both adhoc and infra networks
@brief Process an TLV buffer for a pending BSS Join command for both adhoc and infra networks
/*
			 * Assume DFS parameters are the same for roaming as long as
			 * the current & next APs have the same spectrum mgmt capability
			 * bit setting
			 */ /* No support for roaming between DFS/non-DFS yet */ /* No use having 11h enabled without 11d enabled */ /*
		 * Activate 11h functions in firmware,
		 * turns on capability bit
		 */ /* If using a DFS channel, enable radar detection. */ /* Deactivate 11h functions in the firmware */