software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @brief Process an element from a scan response, copy relevant info for 11h
 *
 *  @param pmadapter Pointer to mlan_adapter
 *  @param p11h_bss_info Output parameter: Pointer to the 11h BSS information
 *                       for the network that is being processed
 *  @param pelement      Pointer to the current IE we are inspecting for 11h
 *                       relevance
 *
 *  @return              MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief Process an element from a scan response, copy relevant info for 11h
@param pmadapter Pointer to mlan_adapter
@param p11h_bss_info Output parameter: Pointer to the 11h BSS information
for the network that is being processed
@param pelement      Pointer to the current IE we are inspecting for 11h
relevance


@brief Process an element from a scan response copy relevant info for 11h @param pmadapter Pointer to mlan_adapter @param p11h_bss_info Output parameter : Pointer to the 11h BSS information for the network that is being processed @param pelement Pointer to the current IE we are inspecting for 11h relevance
mlan_status
wlan_11h_process_bss_elem(mlan_adapter *pmadapter,
			  wlan_11h_bss_info_t *p11h_bss_info,
			  const t_u8 *pelement)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	t_u8 element_len = *((t_u8 *)pelement + 1);
	ENTER();
	switch (*pelement) {
	case POWER_CONSTRAINT:
		PRINTM(MINFO, "11h: Power Constraint IE Found\n");
		p11h_bss_info->sensed_11h = MTRUE;
		memcpy(pmadapter, &p11h_bss_info->power_constraint, pelement,
		       MIN((element_len + sizeof(IEEEtypes_Header_t)),
			   sizeof(IEEEtypes_PowerConstraint_t)));
		p11h_bss_info->power_constraint.len =
			MIN(element_len, (sizeof(IEEEtypes_PowerConstraint_t)
					  - sizeof(IEEEtypes_Header_t)));
		break;
	case POWER_CAPABILITY:
		PRINTM(MINFO, "11h: Power Capability IE Found\n");
		p11h_bss_info->sensed_11h = MTRUE;
		memcpy(pmadapter, &p11h_bss_info->power_capability, pelement,
		       MIN((element_len + sizeof(IEEEtypes_Header_t)),
			   sizeof(IEEEtypes_PowerCapability_t)));
		p11h_bss_info->power_capability.len =
			MIN(element_len, (sizeof(IEEEtypes_PowerCapability_t)
					  - sizeof(IEEEtypes_Header_t)));
		break;
	case TPC_REPORT:
		PRINTM(MINFO, "11h: Tpc Report IE Found\n");
		p11h_bss_info->sensed_11h = MTRUE;
		memcpy(pmadapter, &p11h_bss_info->tpc_report, pelement,
		       MIN((element_len + sizeof(IEEEtypes_Header_t)),
			   sizeof(IEEEtypes_TPCReport_t)));
		p11h_bss_info->tpc_report.len =
			MIN(element_len, (sizeof(IEEEtypes_TPCReport_t)
					  - sizeof(IEEEtypes_Header_t)));
		break;
	case CHANNEL_SWITCH_ANN:
		PRINTM(MINFO, "11h: Channel Switch Ann IE Found\n");
		p11h_bss_info->sensed_11h = MTRUE;
		memcpy(pmadapter, &p11h_bss_info->chan_switch_ann, pelement,
		       MIN((element_len + sizeof(IEEEtypes_Header_t)),
			   sizeof(IEEEtypes_ChanSwitchAnn_t)));
		p11h_bss_info->chan_switch_ann.len =
			MIN(element_len, (sizeof(IEEEtypes_ChanSwitchAnn_t)
					  - sizeof(IEEEtypes_Header_t)));
		break;
	case QUIET:
		PRINTM(MINFO, "11h: Quiet IE Found\n");
		p11h_bss_info->sensed_11h = MTRUE;
		memcpy(pmadapter, &p11h_bss_info->quiet, pelement,
		       MIN((element_len + sizeof(IEEEtypes_Header_t)),
			   sizeof(IEEEtypes_Quiet_t)));
		p11h_bss_info->quiet.len =
			MIN(element_len, (sizeof(IEEEtypes_Quiet_t)
					  - sizeof(IEEEtypes_Header_t)));
		break;
	case IBSS_DFS:
		PRINTM(MINFO, "11h: Ibss Dfs IE Found\n");
		p11h_bss_info->sensed_11h = MTRUE;
		memcpy(pmadapter, &p11h_bss_info->ibss_dfs, pelement,
		       MIN((element_len + sizeof(IEEEtypes_Header_t)),
			   sizeof(IEEEtypes_IBSS_DFS_t)));
		p11h_bss_info->ibss_dfs.len =
			MIN(element_len, (sizeof(IEEEtypes_IBSS_DFS_t)
					  - sizeof(IEEEtypes_Header_t)));
		break;
	case SUPPORTED_CHANNELS:
	case TPC_REQUEST:
		break;
	default:
		ret = MLAN_STATUS_FAILURE;
	}
	LEAVE();
	return ret;
}
mlan_status wlan_11h_process_bss_elem ( mlan_adapter * pmadapter , wlan_11h_bss_info_t * p11h_bss_info , const t_u8 * pelement ) { mlan_status ret = MLAN_STATUS_SUCCESS ; t_u8 element_len = * ( ( t_u8 * ) pelement + 1 ) ; ENTER ( ) ; switch ( * pelement ) { case POWER_CONSTRAINT : PRINTM ( MINFO , " \n " ) ; p11h_bss_info -> sensed_11h = MTRUE ; memcpy ( pmadapter , & p11h_bss_info -> power_constraint , pelement , MIN ( ( element_len + sizeof ( IEEEtypes_Header_t ) ) , sizeof ( IEEEtypes_PowerConstraint_t ) ) ) ; p11h_bss_info -> power_constraint . len = MIN ( element_len , ( sizeof ( IEEEtypes_PowerConstraint_t ) - sizeof ( IEEEtypes_Header_t ) ) ) ; break ; case POWER_CAPABILITY : PRINTM ( MINFO , " \n " ) ; p11h_bss_info -> sensed_11h = MTRUE ; memcpy ( pmadapter , & p11h_bss_info -> power_capability , pelement , MIN ( ( element_len + sizeof ( IEEEtypes_Header_t ) ) , sizeof ( IEEEtypes_PowerCapability_t ) ) ) ; p11h_bss_info -> power_capability . len = MIN ( element_len , ( sizeof ( IEEEtypes_PowerCapability_t ) - sizeof ( IEEEtypes_Header_t ) ) ) ; break ; case TPC_REPORT : PRINTM ( MINFO , " \n " ) ; p11h_bss_info -> sensed_11h = MTRUE ; memcpy ( pmadapter , & p11h_bss_info -> tpc_report , pelement , MIN ( ( element_len + sizeof ( IEEEtypes_Header_t ) ) , sizeof ( IEEEtypes_TPCReport_t ) ) ) ; p11h_bss_info -> tpc_report . len = MIN ( element_len , ( sizeof ( IEEEtypes_TPCReport_t ) - sizeof ( IEEEtypes_Header_t ) ) ) ; break ; case CHANNEL_SWITCH_ANN : PRINTM ( MINFO , " \n " ) ; p11h_bss_info -> sensed_11h = MTRUE ; memcpy ( pmadapter , & p11h_bss_info -> chan_switch_ann , pelement , MIN ( ( element_len + sizeof ( IEEEtypes_Header_t ) ) , sizeof ( IEEEtypes_ChanSwitchAnn_t ) ) ) ; p11h_bss_info -> chan_switch_ann . len = MIN ( element_len , ( sizeof ( IEEEtypes_ChanSwitchAnn_t ) - sizeof ( IEEEtypes_Header_t ) ) ) ; break ; case QUIET : PRINTM ( MINFO , " \n " ) ; p11h_bss_info -> sensed_11h = MTRUE ; memcpy ( pmadapter , & p11h_bss_info -> quiet , pelement , MIN ( ( element_len + sizeof ( IEEEtypes_Header_t ) ) , sizeof ( IEEEtypes_Quiet_t ) ) ) ; p11h_bss_info -> quiet . len = MIN ( element_len , ( sizeof ( IEEEtypes_Quiet_t ) - sizeof ( IEEEtypes_Header_t ) ) ) ; break ; case IBSS_DFS : PRINTM ( MINFO , " \n " ) ; p11h_bss_info -> sensed_11h = MTRUE ; memcpy ( pmadapter , & p11h_bss_info -> ibss_dfs , pelement , MIN ( ( element_len + sizeof ( IEEEtypes_Header_t ) ) , sizeof ( IEEEtypes_IBSS_DFS_t ) ) ) ; p11h_bss_info -> ibss_dfs . len = MIN ( element_len , ( sizeof ( IEEEtypes_IBSS_DFS_t ) - sizeof ( IEEEtypes_Header_t ) ) ) ; break ; case SUPPORTED_CHANNELS : case TPC_REQUEST : break ; default : ret = MLAN_STATUS_FAILURE ; } LEAVE ( ) ; return ret ; }
@brief Process an element from a scan response, copy relevant info for 11h
  @param pmadapter Pointer to mlan_adapter
  @param p11h_bss_info Output parameter: Pointer to the 11h BSS information
                       for the network that is being processed
  @param pelement      Pointer to the current IE we are inspecting for 11h
                       relevance
@brief Process an element from a scan response copy relevant info for 11h @param pmadapter Pointer to mlan_adapter @param p11h_bss_info Output parameter : Pointer to the 11h BSS information for the network that is being processed @param pelement Pointer to the current IE we are inspecting for 11h relevance
/*
		 * These elements are not in beacons/probe responses.
		 * Included here to cover set of enumerated 11h elements.
		 */