software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @brief Process an TLV buffer for a pending BSS Adhoc start command.
 *
 *  Activate 11h functionality in the firmware if driver has is enabled
 *    for 11h (configured by the application via IOCTL).
 *
 *  @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 starting the IBSS
 *  @param p11h_bss_info Input/Output parameter: Pointer to the 11h BSS
 *                       information for this network that we are establishing.
 *                       11h sensed flag set on output if warranted.
 *
 *  @return
 *      - MLAN_STATUS_SUCCESS if 11h is disabled
 *      - Integer number of bytes appended to the TLV output buffer (ppbuffer)
 *      - < 0 for error (e.g. radar detected on channel)
 */
@brief Process an TLV buffer for a pending BSS Adhoc start command.
Activate 11h functionality in the firmware if driver has is enabled
for 11h (configured by the application via IOCTL).



@return
- MLAN_STATUS_SUCCESS if 11h is disabled
- Integer number of bytes appended to the TLV output buffer (ppbuffer)
- < 0 for error
@brief Process an TLV buffer for a pending BSS Adhoc start command . Activate 11h functionality in the firmware if driver has is enabled for 11h ( configured by the application via IOCTL ) . @return - MLAN_STATUS_SUCCESS if 11h is disabled - Integer number of bytes appended to the TLV output buffer ( ppbuffer ) - < 0 for error
t_s32
wlan_11h_process_start(mlan_private *priv,
		       t_u8 **ppbuffer,
		       IEEEtypes_CapInfo_t *pcap_info,
		       t_u32 channel, wlan_11h_bss_info_t *p11h_bss_info)
{
	mlan_adapter *adapter = priv->adapter;
	t_s32 ret = MLAN_STATUS_SUCCESS;
	t_bool is_dfs_chan = MFALSE;
	ENTER();
	if (wlan_11h_is_enabled(priv)
	    && ((adapter->adhoc_start_band & BAND_A)
	    )
		) {
		if (!wlan_fw_11d_is_enabled(priv)) {
			wlan_11d_enable(priv, MNULL, ENABLE_11D);
#ifdef STA_SUPPORT
			wlan_11d_create_dnld_countryinfo(priv,
							 adapter->
							 adhoc_start_band);
#endif
		}
		wlan_11h_activate(priv, MNULL, MTRUE);
		pcap_info->spectrum_mgmt = MTRUE;
		is_dfs_chan = wlan_11h_radar_detect_required(priv, channel);
		if (is_dfs_chan) {
			if (!wlan_11h_is_master_radar_det_active(priv))
				wlan_11h_config_master_radar_det(priv, MTRUE);
		}
		wlan_11h_check_update_radar_det_state(priv);
		p11h_bss_info->sensed_11h = MTRUE;
		if (is_dfs_chan) {
			if (wlan_11h_is_channel_under_nop(adapter, channel))
				ret = MLAN_STATUS_FAILURE;
			if (ret == MLAN_STATUS_SUCCESS)
				ret = wlan_11h_check_chan_report(priv, channel);
		}
		if (ret == MLAN_STATUS_SUCCESS)
			ret = wlan_11h_process_adhoc(priv, ppbuffer, channel,
						     MNULL);
		else
			ret = MLAN_STATUS_FAILURE;
	} 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_start ( mlan_private * priv , t_u8 * * ppbuffer , IEEEtypes_CapInfo_t * pcap_info , t_u32 channel , wlan_11h_bss_info_t * p11h_bss_info ) { mlan_adapter * adapter = priv -> adapter ; t_s32 ret = MLAN_STATUS_SUCCESS ; t_bool is_dfs_chan = MFALSE ; ENTER ( ) ; if ( wlan_11h_is_enabled ( priv ) && ( ( adapter -> adhoc_start_band & BAND_A ) ) ) { if ( ! wlan_fw_11d_is_enabled ( priv ) ) { wlan_11d_enable ( priv , MNULL , ENABLE_11D ) ; #ifdef STA_SUPPORT wlan_11d_create_dnld_countryinfo ( priv , adapter -> adhoc_start_band ) ; #endif } wlan_11h_activate ( priv , MNULL , MTRUE ) ; pcap_info -> spectrum_mgmt = MTRUE ; is_dfs_chan = wlan_11h_radar_detect_required ( priv , channel ) ; if ( is_dfs_chan ) { if ( ! wlan_11h_is_master_radar_det_active ( priv ) ) wlan_11h_config_master_radar_det ( priv , MTRUE ) ; } wlan_11h_check_update_radar_det_state ( priv ) ; p11h_bss_info -> sensed_11h = MTRUE ; if ( is_dfs_chan ) { if ( wlan_11h_is_channel_under_nop ( adapter , channel ) ) ret = MLAN_STATUS_FAILURE ; if ( ret == MLAN_STATUS_SUCCESS ) ret = wlan_11h_check_chan_report ( priv , channel ) ; } if ( ret == MLAN_STATUS_SUCCESS ) ret = wlan_11h_process_adhoc ( priv , ppbuffer , channel , MNULL ) ; else ret = MLAN_STATUS_FAILURE ; } 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 Adhoc start command.
@brief Process an TLV buffer for a pending BSS Adhoc start command .
/* 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. */ /* Set flag indicating this BSS we are starting is using 11h */ /* check if this channel is under NOP */ /* check last channel report, if this channel is free of radar */ /* Deactivate 11h functions in the firmware */