software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @brief Setup the IBSS DFS element passed to the firmware in adhoc start
 *         and join commands
 *
 *  The DFS Owner and recovery fields are set to be our MAC address and
 *    a predetermined constant recovery value.  If we are joining an adhoc
 *    network, these values are replaced with the existing IBSS values.
 *    They are valid only when starting a new IBSS.
 *
 *  The IBSS DFS Element is variable in size based on the number of
 *    channels supported in our current region.
 *
 *  @param priv Private driver information structure
 *  @param pdfs Output parameter: Pointer to the IBSS DFS element setup by
 *              this function.
 *
 *  @return
 *    - Length of the returned element in pdfs output parameter
 *    - 0 if returned element is not setup
 */
@brief Setup the IBSS DFS element passed to the firmware in adhoc start
and join commands

The DFS Owner and recovery fields are set to be our MAC address and
a predetermined constant recovery value.  If we are joining an adhoc
network, these values are replaced with the existing IBSS values.
They are valid only when starting a new IBSS.

The IBSS DFS Element is variable in size based on the number of
channels supported in our current region.

@param priv Private driver information structure
@param pdfs Output parameter: Pointer to the IBSS DFS element setup by
this function.

@return
- Length of the returned element in pdfs output parameter
- 0 if returned element is not setup
@brief Setup the IBSS DFS element passed to the firmware in adhoc start and join commands The DFS Owner and recovery fields are set to be our MAC address and a predetermined constant recovery value . If we are joining an adhoc network these values are replaced with the existing IBSS values . They are valid only when starting a new IBSS . The IBSS DFS Element is variable in size based on the number of channels supported in our current region . @param priv Private driver information structure @param pdfs Output parameter : Pointer to the IBSS DFS element setup by this function . @return - Length of the returned element in pdfs output parameter - 0 if returned element is not setup
static t_u32
wlan_11h_set_ibss_dfs_ie(mlan_private *priv, IEEEtypes_IBSS_DFS_t *pdfs)
{
	t_u8 num_chans = 0;
	MeasRptBasicMap_t initial_map;
	mlan_adapter *adapter = priv->adapter;
	ENTER();
	memset(adapter, pdfs, 0x00, sizeof(IEEEtypes_IBSS_DFS_t));
	memset(adapter, &initial_map, 0x00, sizeof(initial_map));
	initial_map.unmeasured = 1;
	memcpy(adapter, pdfs->dfs_owner, priv->curr_addr,
	       sizeof(pdfs->dfs_owner));
	pdfs->dfs_recovery_interval = WLAN_11H_DEFAULT_DFS_RECOVERY_INTERVAL;
	for (; (num_chans < adapter->parsed_region_chan.no_of_chan)
	     && (num_chans < WLAN_11H_MAX_IBSS_DFS_CHANNELS); num_chans++) {
		pdfs->channel_map[num_chans].channel_number =
			adapter->parsed_region_chan.chan_pwr[num_chans].chan;
		pdfs->channel_map[num_chans].rpt_map = initial_map;
	}
	if (num_chans) {
		PRINTM(MINFO, "11h: Added %d channels to IBSS DFS Map\n",
		       num_chans);
		pdfs->element_id = IBSS_DFS;
		pdfs->len =
			(sizeof(pdfs->dfs_owner) +
			 sizeof(pdfs->dfs_recovery_interval)
			 + num_chans * sizeof(IEEEtypes_ChannelMap_t));
		LEAVE();
		return pdfs->len + sizeof(pdfs->len) + sizeof(pdfs->element_id);
	}
	memset(adapter, pdfs, 0x00, sizeof(IEEEtypes_IBSS_DFS_t));
	LEAVE();
	return 0;
}
static t_u32 wlan_11h_set_ibss_dfs_ie ( mlan_private * priv , IEEEtypes_IBSS_DFS_t * pdfs ) { t_u8 num_chans = 0 ; MeasRptBasicMap_t initial_map ; mlan_adapter * adapter = priv -> adapter ; ENTER ( ) ; memset ( adapter , pdfs , 0x00 , sizeof ( IEEEtypes_IBSS_DFS_t ) ) ; memset ( adapter , & initial_map , 0x00 , sizeof ( initial_map ) ) ; initial_map . unmeasured = 1 ; memcpy ( adapter , pdfs -> dfs_owner , priv -> curr_addr , sizeof ( pdfs -> dfs_owner ) ) ; pdfs -> dfs_recovery_interval = WLAN_11H_DEFAULT_DFS_RECOVERY_INTERVAL ; for ( ; ( num_chans < adapter -> parsed_region_chan . no_of_chan ) && ( num_chans < WLAN_11H_MAX_IBSS_DFS_CHANNELS ) ; num_chans ++ ) { pdfs -> channel_map [ num_chans ] . channel_number = adapter -> parsed_region_chan . chan_pwr [ num_chans ] . chan ; pdfs -> channel_map [ num_chans ] . rpt_map = initial_map ; } if ( num_chans ) { PRINTM ( MINFO , " \n " , num_chans ) ; pdfs -> element_id = IBSS_DFS ; pdfs -> len = ( sizeof ( pdfs -> dfs_owner ) + sizeof ( pdfs -> dfs_recovery_interval ) + num_chans * sizeof ( IEEEtypes_ChannelMap_t ) ) ; LEAVE ( ) ; return pdfs -> len + sizeof ( pdfs -> len ) + sizeof ( pdfs -> element_id ) ; } memset ( adapter , pdfs , 0x00 , sizeof ( IEEEtypes_IBSS_DFS_t ) ) ; LEAVE ( ) ; return 0 ; }
@brief Setup the IBSS DFS element passed to the firmware in adhoc start
         and join commands
@brief Setup the IBSS DFS element passed to the firmware in adhoc start and join commands
/*
	 * A basic measurement report is included with each channel in the
	 *   map field.  Initial value for the map for each supported channel
	 *   is with only the unmeasured bit set.
	 */ /* Set the DFS Owner and recovery interval fields */ /*
		 * Set the initial map field with a basic measurement
		 */ /*
	 * If we have an established channel map, include it and return
	 *   a valid DFS element
	 */ /* Ensure the element is zeroed out for an invalid return */