software/drivers/sd8887/src/wlan/mlan/mlan_11ac.c
/**
 *  @brief This function fills the VHTOperation ie out put format is CPU
 *
 *  @param priv         A pointer to mlan_private structure
 *  @param vht_oprat    A pointer to IEEEtypes_VHTOprat_t structure
 *  @param sta_ptr      A pointer to sta_node
 *
 *  @return             N/A
 */
@brief This function fills the VHTOperation ie out put format is CPU
@param priv         A pointer to mlan_private structure
@param vht_oprat    A pointer to IEEEtypes_VHTOprat_t structure
@param sta_ptr      A pointer to sta_node

@return             N/A
@brief This function fills the VHTOperation ie out put format is CPU @param priv A pointer to mlan_private structure @param vht_oprat A pointer to IEEEtypes_VHTOprat_t structure @param sta_ptr A pointer to sta_node @return N / A
void
wlan_fill_tdls_vht_oprat_ie(mlan_private *priv, IEEEtypes_VHTOprat_t *vht_oprat,
			    sta_node *sta_ptr)
{
	t_u8 supp_chwd_set;
	t_u8 peer_supp_chwd_set;
	t_u8 ap_supp_chwd_set;
	t_u32 usr_vht_cap_info;
	t_u16 mcs_map_user = 0;
	t_u16 mcs_map_resp = 0;
	t_u16 mcs_map_result = 0;
	t_u16 mcs_user = 0;
	t_u16 mcs_resp = 0;
	t_u16 nss;
	t_u8 chan_bw = 0;
	BSSDescriptor_t *pbss_desc;
	IEEEtypes_VHTCap_t *pvht_cap = &sta_ptr->vht_cap;
	IEEEtypes_VHTCap_t *ap_vht_cap = MNULL;
	ENTER();
	pbss_desc = &priv->curr_bss_params.bss_descriptor;
	if (MFALSE == wlan_is_ap_in_11ac_mode(priv)) {
		if (sta_ptr->ExtCap.ieee_hdr.element_id != EXT_CAPABILITY) {
			PRINTM(MMSG, "No Peer's Ext_cap info\n");
			return;
		}
		if (!ISSUPP_EXTCAP_TDLS_WIDER_BANDWIDTH
		    (sta_ptr->ExtCap.ext_cap)) {
			PRINTM(MMSG,
			       "Peer don't support Wider Bandwitch in Ext_cap\n");
			return;
		}
	} else {
		ap_vht_cap = pbss_desc->pvht_cap;
	}
	vht_oprat->ieee_hdr.element_id = VHT_OPERATION;
	vht_oprat->ieee_hdr.len =
		sizeof(IEEEtypes_VHTOprat_t) - sizeof(IEEEtypes_Header_t);
	if (pbss_desc->bss_band & BAND_A)
		usr_vht_cap_info = priv->usr_dot_11ac_dev_cap_a;
	else
		usr_vht_cap_info = priv->usr_dot_11ac_dev_cap_bg;
	supp_chwd_set = GET_VHTCAP_CHWDSET(usr_vht_cap_info);
	peer_supp_chwd_set = GET_VHTCAP_CHWDSET(pvht_cap->vht_cap.vht_cap_info);
	supp_chwd_set = MIN(supp_chwd_set, peer_supp_chwd_set);
	if (ap_vht_cap &&
	    !ISSUPP_EXTCAP_TDLS_WIDER_BANDWIDTH(sta_ptr->ExtCap.ext_cap)) {
		ap_supp_chwd_set =
			GET_VHTCAP_CHWDSET(ap_vht_cap->vht_cap.vht_cap_info);
		supp_chwd_set = MIN(supp_chwd_set, ap_supp_chwd_set);
	}
	switch (supp_chwd_set) {
	case VHT_CAP_CHWD_80MHZ:
		vht_oprat->chan_width = VHT_OPER_CHWD_80MHZ;
		break;
	case VHT_CAP_CHWD_160MHZ:
		vht_oprat->chan_width = VHT_OPER_CHWD_160MHZ;
		break;
	case VHT_CAP_CHWD_80_80MHZ:
		vht_oprat->chan_width = VHT_OPER_CHWD_80_80MHZ;
		break;
	}
	mcs_map_user = GET_DEVRXMCSMAP(priv->usr_dot_11ac_mcs_support);
	mcs_map_resp = pvht_cap->vht_cap.mcs_sets.rx_mcs_map;
	mcs_map_result = 0;
	for (nss = 1; nss <= 8; nss++) {
		mcs_user = GET_VHTNSSMCS(mcs_map_user, nss);
		mcs_resp = GET_VHTNSSMCS(mcs_map_resp, nss);
		if ((mcs_user == NO_NSS_SUPPORT) ||
		    (mcs_resp == NO_NSS_SUPPORT))
			SET_VHTNSSMCS(mcs_map_result, nss, NO_NSS_SUPPORT);
		else
			SET_VHTNSSMCS(mcs_map_result, nss,
				      MIN(mcs_user, mcs_resp));
	}
	vht_oprat->basic_MCS_map = mcs_map_result;
	switch (vht_oprat->chan_width) {
	case VHT_OPER_CHWD_80MHZ:
		chan_bw = CHANNEL_BW_80MHZ;
		break;
	case VHT_OPER_CHWD_160MHZ:
		chan_bw = CHANNEL_BW_160MHZ;
		break;
	case VHT_OPER_CHWD_80_80MHZ:
		chan_bw = CHANNEL_BW_80MHZ;
		break;
	}
	vht_oprat->chan_center_freq_1 =
		wlan_get_center_freq_idx(priv, BAND_AAC, pbss_desc->channel,
					 chan_bw);
	LEAVE();
	return;
}
void wlan_fill_tdls_vht_oprat_ie ( mlan_private * priv , IEEEtypes_VHTOprat_t * vht_oprat , sta_node * sta_ptr ) { t_u8 supp_chwd_set ; t_u8 peer_supp_chwd_set ; t_u8 ap_supp_chwd_set ; t_u32 usr_vht_cap_info ; t_u16 mcs_map_user = 0 ; t_u16 mcs_map_resp = 0 ; t_u16 mcs_map_result = 0 ; t_u16 mcs_user = 0 ; t_u16 mcs_resp = 0 ; t_u16 nss ; t_u8 chan_bw = 0 ; BSSDescriptor_t * pbss_desc ; IEEEtypes_VHTCap_t * pvht_cap = & sta_ptr -> vht_cap ; IEEEtypes_VHTCap_t * ap_vht_cap = MNULL ; ENTER ( ) ; pbss_desc = & priv -> curr_bss_params . bss_descriptor ; if ( MFALSE == wlan_is_ap_in_11ac_mode ( priv ) ) { if ( sta_ptr -> ExtCap . ieee_hdr . element_id != EXT_CAPABILITY ) { PRINTM ( MMSG , " \n " ) ; return ; } if ( ! ISSUPP_EXTCAP_TDLS_WIDER_BANDWIDTH ( sta_ptr -> ExtCap . ext_cap ) ) { PRINTM ( MMSG , " \n " ) ; return ; } } else { ap_vht_cap = pbss_desc -> pvht_cap ; } vht_oprat -> ieee_hdr . element_id = VHT_OPERATION ; vht_oprat -> ieee_hdr . len = sizeof ( IEEEtypes_VHTOprat_t ) - sizeof ( IEEEtypes_Header_t ) ; if ( pbss_desc -> bss_band & BAND_A ) usr_vht_cap_info = priv -> usr_dot_11ac_dev_cap_a ; else usr_vht_cap_info = priv -> usr_dot_11ac_dev_cap_bg ; supp_chwd_set = GET_VHTCAP_CHWDSET ( usr_vht_cap_info ) ; peer_supp_chwd_set = GET_VHTCAP_CHWDSET ( pvht_cap -> vht_cap . vht_cap_info ) ; supp_chwd_set = MIN ( supp_chwd_set , peer_supp_chwd_set ) ; if ( ap_vht_cap && ! ISSUPP_EXTCAP_TDLS_WIDER_BANDWIDTH ( sta_ptr -> ExtCap . ext_cap ) ) { ap_supp_chwd_set = GET_VHTCAP_CHWDSET ( ap_vht_cap -> vht_cap . vht_cap_info ) ; supp_chwd_set = MIN ( supp_chwd_set , ap_supp_chwd_set ) ; } switch ( supp_chwd_set ) { case VHT_CAP_CHWD_80MHZ : vht_oprat -> chan_width = VHT_OPER_CHWD_80MHZ ; break ; case VHT_CAP_CHWD_160MHZ : vht_oprat -> chan_width = VHT_OPER_CHWD_160MHZ ; break ; case VHT_CAP_CHWD_80_80MHZ : vht_oprat -> chan_width = VHT_OPER_CHWD_80_80MHZ ; break ; } mcs_map_user = GET_DEVRXMCSMAP ( priv -> usr_dot_11ac_mcs_support ) ; mcs_map_resp = pvht_cap -> vht_cap . mcs_sets . rx_mcs_map ; mcs_map_result = 0 ; for ( nss = 1 ; nss <= 8 ; nss ++ ) { mcs_user = GET_VHTNSSMCS ( mcs_map_user , nss ) ; mcs_resp = GET_VHTNSSMCS ( mcs_map_resp , nss ) ; if ( ( mcs_user == NO_NSS_SUPPORT ) || ( mcs_resp == NO_NSS_SUPPORT ) ) SET_VHTNSSMCS ( mcs_map_result , nss , NO_NSS_SUPPORT ) ; else SET_VHTNSSMCS ( mcs_map_result , nss , MIN ( mcs_user , mcs_resp ) ) ; } vht_oprat -> basic_MCS_map = mcs_map_result ; switch ( vht_oprat -> chan_width ) { case VHT_OPER_CHWD_80MHZ : chan_bw = CHANNEL_BW_80MHZ ; break ; case VHT_OPER_CHWD_160MHZ : chan_bw = CHANNEL_BW_160MHZ ; break ; case VHT_OPER_CHWD_80_80MHZ : chan_bw = CHANNEL_BW_80MHZ ; break ; } vht_oprat -> chan_center_freq_1 = wlan_get_center_freq_idx ( priv , BAND_AAC , pbss_desc -> channel , chan_bw ) ; LEAVE ( ) ; return ; }
@brief This function fills the VHTOperation ie out put format is CPU
  @param priv         A pointer to mlan_private structure
  @param vht_oprat    A pointer to IEEEtypes_VHTOprat_t structure
  @param sta_ptr      A pointer to sta_node
@brief This function fills the VHTOperation ie out put format is CPU @param priv A pointer to mlan_private structure @param vht_oprat A pointer to IEEEtypes_VHTOprat_t structure @param sta_ptr A pointer to sta_node
/* Check if AP is in 11ac mode */ /* find the minmum bandwith between AP/TDLS peers */ /* We need check AP's bandwidth when TDLS_WIDER_BANDWIDTH is off */ /* Fill BASIC VHT MCS and NSS Set */ /* rx MCS Set, find the minimum of the user rx mcs and peer rx mcs */ /* Basic MCS map */