software/drivers/sd8887/src/wlan/mlinux/moal_cfg80211.c
/**
 *  @brief Sets up the CFG802.11 specific VHT capability fields
 *  with default values
 *
 * @param priv         A pointer to moal private structure
 *  @param vht_cap      A pointer to ieee80211_sta_vht_cap structure
 *
 *  @return             N/A
 */
@brief Sets up the CFG802.11 specific VHT capability fields
with default values

@param priv         A pointer to moal private structure
@param vht_cap      A pointer to ieee80211_sta_vht_cap structure

@return             N/A
@brief Sets up the CFG802 . 11 specific VHT capability fields with default values @param priv A pointer to moal private structure @param vht_cap A pointer to ieee80211_sta_vht_cap structure @return N / A
void
woal_cfg80211_setup_vht_cap(moal_private *priv,
			    struct ieee80211_sta_vht_cap *vht_cap)
{
	mlan_ioctl_req *req = NULL;
	mlan_ds_11ac_cfg *cfg_11ac = NULL;
	mlan_status status;
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_11ac_cfg));
	if (req == NULL) {
		status = MLAN_STATUS_FAILURE;
		PRINTM(MERROR, "Fail to allocate buf for setup vht_cap\n");
		goto done;
	}
	cfg_11ac = (mlan_ds_11ac_cfg *)req->pbuf;
	cfg_11ac->sub_command = MLAN_OID_11AC_VHT_CFG;
	req->req_id = MLAN_IOCTL_11AC_CFG;
	req->action = MLAN_ACT_GET;
	cfg_11ac->param.vht_cfg.band = BAND_SELECT_A;
	cfg_11ac->param.vht_cfg.txrx = MLAN_RADIO_RX;
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (MLAN_STATUS_SUCCESS != status) {
		PRINTM(MERROR, "Fail to get vht_cfg\n");
		goto done;
	}
	vht_cap->vht_supported = true;
	vht_cap->cap = cfg_11ac->param.vht_cfg.vht_cap_info;
	vht_cap->vht_mcs.rx_mcs_map = (t_u16)cfg_11ac->param.vht_cfg.vht_rx_mcs;
	vht_cap->vht_mcs.rx_highest =
		(t_u16)cfg_11ac->param.vht_cfg.vht_rx_max_rate;
	vht_cap->vht_mcs.tx_mcs_map = (t_u16)cfg_11ac->param.vht_cfg.vht_tx_mcs;
	vht_cap->vht_mcs.tx_highest =
		(t_u16)cfg_11ac->param.vht_cfg.vht_tx_max_rate;
	PRINTM(MCMND,
	       "vht_cap=0x%x rx_mcs_map=0x%x rx_max=0x%x tx_mcs_map=0x%x tx_max=0x%x\n",
	       vht_cap->cap, vht_cap->vht_mcs.rx_mcs_map,
	       vht_cap->vht_mcs.rx_highest, vht_cap->vht_mcs.tx_mcs_map,
	       vht_cap->vht_mcs.tx_highest);
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return;
}
void woal_cfg80211_setup_vht_cap ( moal_private * priv , struct ieee80211_sta_vht_cap * vht_cap ) { mlan_ioctl_req * req = NULL ; mlan_ds_11ac_cfg * cfg_11ac = NULL ; mlan_status status ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_11ac_cfg ) ) ; if ( req == NULL ) { status = MLAN_STATUS_FAILURE ; PRINTM ( MERROR , " \n " ) ; goto done ; } cfg_11ac = ( mlan_ds_11ac_cfg * ) req -> pbuf ; cfg_11ac -> sub_command = MLAN_OID_11AC_VHT_CFG ; req -> req_id = MLAN_IOCTL_11AC_CFG ; req -> action = MLAN_ACT_GET ; cfg_11ac -> param . vht_cfg . band = BAND_SELECT_A ; cfg_11ac -> param . vht_cfg . txrx = MLAN_RADIO_RX ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( MLAN_STATUS_SUCCESS != status ) { PRINTM ( MERROR , " \n " ) ; goto done ; } vht_cap -> vht_supported = true ; vht_cap -> cap = cfg_11ac -> param . vht_cfg . vht_cap_info ; vht_cap -> vht_mcs . rx_mcs_map = ( t_u16 ) cfg_11ac -> param . vht_cfg . vht_rx_mcs ; vht_cap -> vht_mcs . rx_highest = ( t_u16 ) cfg_11ac -> param . vht_cfg . vht_rx_max_rate ; vht_cap -> vht_mcs . tx_mcs_map = ( t_u16 ) cfg_11ac -> param . vht_cfg . vht_tx_mcs ; vht_cap -> vht_mcs . tx_highest = ( t_u16 ) cfg_11ac -> param . vht_cfg . vht_tx_max_rate ; PRINTM ( MCMND , " \n " , vht_cap -> cap , vht_cap -> vht_mcs . rx_mcs_map , vht_cap -> vht_mcs . rx_highest , vht_cap -> vht_mcs . tx_mcs_map , vht_cap -> vht_mcs . tx_highest ) ; done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ; }
@brief Sets up the CFG802.11 specific VHT capability fields
  with default values
@brief Sets up the CFG802 . 11 specific VHT capability fields with default values