software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @brief Utility function to process a start or join to an adhoc network
 *
 *  Add the elements to the TLV buffer needed in the start/join adhoc commands:
 *       - IBSS DFS IE
 *       - Quiet IE
 *
 *  Also send the local constraint to the firmware in a TPC_INFO command.
 *
 *  @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 channel       Channel on which we are starting/joining the IBSS
 *  @param p11h_bss_info Pointer to the 11h BSS information for this network
 *                       that was parsed out of the scan response.  NULL
 *                       indicates we are starting the adhoc network
 *
 *  @return              Integer number of bytes appended to the TLV output
 *                       buffer (ppbuffer)
 */
@brief Utility function to process a start or join to an adhoc network
Add the elements to the TLV buffer needed in the start/join adhoc commands:
- IBSS DFS IE
- Quiet IE

Also send the local constraint to the firmware in a TPC_INFO command.

@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 channel       Channel on which we are starting/joining the IBSS
@param p11h_bss_info Pointer to the 11h BSS information for this network
that was parsed out of the scan response.  NULL
indicates we are starting the adhoc network

@return              Integer number of bytes appended to the TLV output
buffer (ppbuffer)
@brief Utility function to process a start or join to an adhoc network Add the elements to the TLV buffer needed in the start / join adhoc commands : - IBSS DFS IE - Quiet IE Also send the local constraint to the firmware in a TPC_INFO command . @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 channel Channel on which we are starting / joining the IBSS @param p11h_bss_info Pointer to the 11h BSS information for this network that was parsed out of the scan response . NULL indicates we are starting the adhoc network @return Integer number of bytes appended to the TLV output buffer ( ppbuffer )
static t_u32
wlan_11h_process_adhoc(mlan_private *priv,
		       t_u8 **ppbuffer,
		       t_u32 channel, wlan_11h_bss_info_t *p11h_bss_info)
{
	IEEEtypes_IBSS_DFS_t dfs_elem;
	t_u32 size_appended;
	t_u32 ret_len = 0;
	t_s8 local_constraint = 0;
	mlan_adapter *adapter = priv->adapter;
	ENTER();
#ifdef STA_SUPPORT
	wlan_11h_set_ibss_dfs_ie(priv, &dfs_elem);
#endif
	if (p11h_bss_info) {
		memcpy(adapter, dfs_elem.dfs_owner,
		       p11h_bss_info->ibss_dfs.dfs_owner,
		       sizeof(dfs_elem.dfs_owner));
		dfs_elem.dfs_recovery_interval =
			p11h_bss_info->ibss_dfs.dfs_recovery_interval;
	}
	size_appended = wlan_11h_convert_ieee_to_mrvl_ie(adapter,
							 (t_u8 *)*ppbuffer,
							 (t_u8 *)&dfs_elem);
	HEXDUMP("11h: IBSS-DFS", (t_u8 *)*ppbuffer, size_appended);
	*ppbuffer += size_appended;
	ret_len += size_appended;
	if (p11h_bss_info) {
		if (p11h_bss_info->quiet.element_id == QUIET) {
			size_appended
				=
				wlan_11h_convert_ieee_to_mrvl_ie(adapter,
								 (t_u8 *)
								 *ppbuffer,
								 (t_u8 *)
								 &p11h_bss_info->
								 quiet);
			HEXDUMP("11h: Quiet", (t_u8 *)*ppbuffer, size_appended);
			*ppbuffer += size_appended;
			ret_len += size_appended;
		}
		local_constraint =
			p11h_bss_info->power_constraint.local_constraint;
	} else {
		if (adapter->state_11h.quiet_ie.quiet_period) {
			size_appended =
				wlan_11h_convert_ieee_to_mrvl_ie(adapter,
								 (t_u8 *)
								 *ppbuffer,
								 (t_u8 *)
								 &adapter->
								 state_11h.
								 quiet_ie);
			HEXDUMP("11h: Quiet", (t_u8 *)*ppbuffer, size_appended);
			*ppbuffer += size_appended;
			ret_len += size_appended;
		}
		local_constraint = adapter->state_11h.usr_def_power_constraint;
	}
	PRINTM(MINFO, "WEILIE 1: ppbuffer = %p\n", *ppbuffer);
	ret_len +=
		wlan_11h_set_local_power_constraint_tlv(ppbuffer, (t_u8)channel,
							(t_u8)local_constraint,
							(t_u8)priv->adapter->
							state_11h.
							min_tx_power_capability,
							(t_u8)priv->adapter->
							state_11h.
							max_tx_power_capability);
	PRINTM(MINFO, "WEILIE 2: ppbuffer = %p\n", *ppbuffer);
	LEAVE();
	return ret_len;
}
static t_u32 wlan_11h_process_adhoc ( mlan_private * priv , t_u8 * * ppbuffer , t_u32 channel , wlan_11h_bss_info_t * p11h_bss_info ) { IEEEtypes_IBSS_DFS_t dfs_elem ; t_u32 size_appended ; t_u32 ret_len = 0 ; t_s8 local_constraint = 0 ; mlan_adapter * adapter = priv -> adapter ; ENTER ( ) ; #ifdef STA_SUPPORT wlan_11h_set_ibss_dfs_ie ( priv , & dfs_elem ) ; #endif if ( p11h_bss_info ) { memcpy ( adapter , dfs_elem . dfs_owner , p11h_bss_info -> ibss_dfs . dfs_owner , sizeof ( dfs_elem . dfs_owner ) ) ; dfs_elem . dfs_recovery_interval = p11h_bss_info -> ibss_dfs . dfs_recovery_interval ; } size_appended = wlan_11h_convert_ieee_to_mrvl_ie ( adapter , ( t_u8 * ) * ppbuffer , ( t_u8 * ) & dfs_elem ) ; HEXDUMP ( " " , ( t_u8 * ) * ppbuffer , size_appended ) ; * ppbuffer += size_appended ; ret_len += size_appended ; if ( p11h_bss_info ) { if ( p11h_bss_info -> quiet . element_id == QUIET ) { size_appended = wlan_11h_convert_ieee_to_mrvl_ie ( adapter , ( t_u8 * ) * ppbuffer , ( t_u8 * ) & p11h_bss_info -> quiet ) ; HEXDUMP ( " " , ( t_u8 * ) * ppbuffer , size_appended ) ; * ppbuffer += size_appended ; ret_len += size_appended ; } local_constraint = p11h_bss_info -> power_constraint . local_constraint ; } else { if ( adapter -> state_11h . quiet_ie . quiet_period ) { size_appended = wlan_11h_convert_ieee_to_mrvl_ie ( adapter , ( t_u8 * ) * ppbuffer , ( t_u8 * ) & adapter -> state_11h . quiet_ie ) ; HEXDUMP ( " " , ( t_u8 * ) * ppbuffer , size_appended ) ; * ppbuffer += size_appended ; ret_len += size_appended ; } local_constraint = adapter -> state_11h . usr_def_power_constraint ; } PRINTM ( MINFO , " \n " , * ppbuffer ) ; ret_len += wlan_11h_set_local_power_constraint_tlv ( ppbuffer , ( t_u8 ) channel , ( t_u8 ) local_constraint , ( t_u8 ) priv -> adapter -> state_11h . min_tx_power_capability , ( t_u8 ) priv -> adapter -> state_11h . max_tx_power_capability ) ; PRINTM ( MINFO , " \n " , * ppbuffer ) ; LEAVE ( ) ; return ret_len ; }
@brief Utility function to process a start or join to an adhoc network
  Add the elements to the TLV buffer needed in the start/join adhoc commands:
       - IBSS DFS IE
       - Quiet IE
@brief Utility function to process a start or join to an adhoc network Add the elements to the TLV buffer needed in the start / join adhoc commands : - IBSS DFS IE - Quiet IE
/* Format our own IBSS DFS Element.  Include our channel map fields */ /*
		 * Copy the DFS Owner/Recovery Interval from the BSS
		 * we are joining
		 */ /* Append the dfs element to the TLV buffer */ /*
	 * Check to see if we are joining a network.  Join is indicated by the
	 *   BSS Info pointer being valid (not NULL)
	 */ /*
		 * If there was a quiet element, include it in
		 * adhoc join command
		 */ /* Copy the local constraint from the network */ /*
		 * If we are the adhoc starter, we can add a quiet element
		 */ /* Use the local_constraint configured in the driver state */