software/drivers/sd8887/src/wlan/mlinux/moal_uap_cfg80211.c
/**
 * @brief Enable radar detect for DFS channel
 *
 * @param priv            A pointer to moal private structure
 * @param chandef         A pointer to cfg80211_chan_def structure
 * @return                N/A
 */
@brief Enable radar detect for DFS channel
@param priv            A pointer to moal private structure
@param chandef         A pointer to cfg80211_chan_def structure
@return                N/A
@brief Enable radar detect for DFS channel @param priv A pointer to moal private structure @param chandef A pointer to cfg80211_chan_def structure @return N / A
static void
woal_enable_dfs_support(moal_private *priv, struct cfg80211_chan_def *chandef)
{
	mlan_ioctl_req *req = NULL;
	mlan_ds_11h_chan_rep_req *pchan_rpt_req = NULL;
	mlan_ds_11h_cfg *p11h_cfg = NULL;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) {
		PRINTM(MIOCTL, "No radar channel\n");
		LEAVE();
		return;
	}
	PRINTM(MIOCTL, "start Radar detect, chan %d , Bw %d \n",
	       chandef->chan->hw_value, chandef->width);
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_11h_cfg));
	if (NULL == req) {
		PRINTM(MIOCTL, "No Memory to allocate ioctl buffer\n");
		LEAVE();
		return;
	}
	p11h_cfg = (mlan_ds_11h_cfg *)req->pbuf;
	pchan_rpt_req = &p11h_cfg->param.chan_rpt_req;
	pchan_rpt_req->startFreq = 5000;
	pchan_rpt_req->chanNum = (t_u8)chandef->chan->hw_value;
	woal_convert_chan_to_bandconfig(&pchan_rpt_req->bandcfg, chandef);
	pchan_rpt_req->host_based = MTRUE;
	pchan_rpt_req->millisec_dwell_time = 0;
	p11h_cfg->sub_command = MLAN_OID_11H_CHANNEL_CHECK;
	req->req_id = MLAN_IOCTL_11H_CFG;
	req->action = MLAN_ACT_SET;
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return;
}
static void woal_enable_dfs_support ( moal_private * priv , struct cfg80211_chan_def * chandef ) { mlan_ioctl_req * req = NULL ; mlan_ds_11h_chan_rep_req * pchan_rpt_req = NULL ; mlan_ds_11h_cfg * p11h_cfg = NULL ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; if ( ! ( chandef -> chan -> flags & IEEE80211_CHAN_RADAR ) ) { PRINTM ( MIOCTL , " \n " ) ; LEAVE ( ) ; return ; } PRINTM ( MIOCTL , " \n " , chandef -> chan -> hw_value , chandef -> width ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_11h_cfg ) ) ; if ( NULL == req ) { PRINTM ( MIOCTL , " \n " ) ; LEAVE ( ) ; return ; } p11h_cfg = ( mlan_ds_11h_cfg * ) req -> pbuf ; pchan_rpt_req = & p11h_cfg -> param . chan_rpt_req ; pchan_rpt_req -> startFreq = 5000 ; pchan_rpt_req -> chanNum = ( t_u8 ) chandef -> chan -> hw_value ; woal_convert_chan_to_bandconfig ( & pchan_rpt_req -> bandcfg , chandef ) ; pchan_rpt_req -> host_based = MTRUE ; pchan_rpt_req -> millisec_dwell_time = 0 ; p11h_cfg -> sub_command = MLAN_OID_11H_CHANNEL_CHECK ; req -> req_id = MLAN_IOCTL_11H_CFG ; req -> action = MLAN_ACT_SET ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ; }
@brief Enable radar detect for DFS channel
 @param priv            A pointer to moal private structure
 @param chandef         A pointer to cfg80211_chan_def structure
 @return                N/A
@brief Enable radar detect for DFS channel @param priv A pointer to moal private structure @param chandef A pointer to cfg80211_chan_def structure @return N / A
/* Send Channel Check command and wait until the report is ready */