software/drivers/sd8887/src/wlan/mlan/mlan_cfp.c
/**
 *  @brief Get if radar detection is enabled or not on a certain channel
 *
 *  @param priv    Private driver information structure
 *  @param chnl Channel to determine radar detection requirements
 *
 *  @return
 *    - MTRUE if radar detection is required
 *    - MFALSE otherwise
 */
@brief Get if radar detection is enabled or not on a certain channel
@param priv    Private driver information structure
@param chnl Channel to determine radar detection requirements

@return
- MTRUE if radar detection is required
- MFALSE otherwise
@brief Get if radar detection is enabled or not on a certain channel @param priv Private driver information structure @param chnl Channel to determine radar detection requirements @return - MTRUE if radar detection is required - MFALSE otherwise
t_bool
wlan_get_cfp_radar_detect(mlan_private *priv, t_u8 chnl)
{
	int i, j;
	t_bool required = MFALSE;
	chan_freq_power_t *pcfp = MNULL;
	ENTER();
	for (i = 0; i < MAX_REGION_CHANNEL_NUM; i++) {
		if (priv->adapter->region_channel[i].band == BAND_A) {
			pcfp = priv->adapter->region_channel[i].pcfp;
			break;
		}
	}
	if (!pcfp) {
		goto done;
	}
	for (j = 0; j < priv->adapter->region_channel[i].num_cfp; j++) {
		if (pcfp[j].channel == chnl) {
			required = pcfp[j].passive_scan_or_radar_detect;
			break;
		}
	}
done:
	LEAVE();
	return required;
}
t_bool wlan_get_cfp_radar_detect ( mlan_private * priv , t_u8 chnl ) { int i , j ; t_bool required = MFALSE ; chan_freq_power_t * pcfp = MNULL ; ENTER ( ) ; for ( i = 0 ; i < MAX_REGION_CHANNEL_NUM ; i ++ ) { if ( priv -> adapter -> region_channel [ i ] . band == BAND_A ) { pcfp = priv -> adapter -> region_channel [ i ] . pcfp ; break ; } } if ( ! pcfp ) { goto done ; } for ( j = 0 ; j < priv -> adapter -> region_channel [ i ] . num_cfp ; j ++ ) { if ( pcfp [ j ] . channel == chnl ) { required = pcfp [ j ] . passive_scan_or_radar_detect ; break ; } } done : LEAVE ( ) ; return required ; }
@brief Get if radar detection is enabled or not on a certain channel
  @param priv    Private driver information structure
  @param chnl Channel to determine radar detection requirements
@brief Get if radar detection is enabled or not on a certain channel @param priv Private driver information structure @param chnl Channel to determine radar detection requirements
/*get the cfp table first */ /*This means operation in BAND-A is not support, we can
		   just return false here, it's harmless */ /*get the radar detection requirements according to chan num */