software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @brief Checks if a radar measurement was performed on channel,
 *         and if so, whether radar was detected on it.
 *
 *  Used when starting an adhoc network.
 *
 *  @param priv         Private driver information structure
 *  @param chan         Channel to check upon
 *
 *  @return
 *    - MLAN_STATUS_SUCCESS if no radar on channel
 *    - MLAN_STATUS_FAILURE if radar was found on channel
 *    - (TBD??) MLAN_STATUS_PENDING if radar report NEEDS TO BE REISSUED
 *
 *  @sa wlan_11h_issue_radar_detect
 *  @sa wlan_11h_process_start
 */
@brief Checks if a radar measurement was performed on channel,
and if so, whether radar was detected on it.

Used when starting an adhoc network.

@param priv         Private driver information structure
@param chan         Channel to check upon

@return
- MLAN_STATUS_SUCCESS if no radar on channel
- MLAN_STATUS_FAILURE if radar was found on channel
- (TBD??) MLAN_STATUS_PENDING if radar report NEEDS TO BE REISSUED


@brief Checks if a radar measurement was performed on channel and if so whether radar was detected on it . Used when starting an adhoc network . @param priv Private driver information structure @param chan Channel to check upon @return - MLAN_STATUS_SUCCESS if no radar on channel - MLAN_STATUS_FAILURE if radar was found on channel - ( TBD?? ) MLAN_STATUS_PENDING if radar report NEEDS TO BE REISSUED
mlan_status
wlan_11h_check_chan_report(mlan_private *priv, t_u8 chan)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
	t_u32 sec, usec;
	ENTER();
	priv->adapter->callbacks.moal_get_system_time(priv->adapter->
						      pmoal_handle, &sec,
						      &usec);
	PRINTM(MINFO, "11h: %s()\n", __func__);
	PRINTM(MINFO, "- sec_now=%d, sec_report=%d.\n",
	       sec, pstate_dfs->dfs_report_time_sec);
	PRINTM(MINFO, "- rpt_channel=%d, rpt_radar=%d.\n",
	       pstate_dfs->dfs_check_channel, pstate_dfs->dfs_radar_found);
	if ((!pstate_dfs->dfs_check_pending) &&
	    (chan == pstate_dfs->dfs_check_channel) &&
	    ((sec - pstate_dfs->dfs_report_time_sec) <
	     MAX_DFS_REPORT_USABLE_AGE_SEC)) {
		if (pstate_dfs->dfs_radar_found) {
			PRINTM(MEVENT, "Radar was detected on channel %d.\n",
			       chan);
			ret = MLAN_STATUS_FAILURE;
		}
	} else {
		pstate_dfs->dfs_check_channel = 0;
		ret = MLAN_STATUS_PENDING;
	}
	LEAVE();
	return ret;
}
mlan_status wlan_11h_check_chan_report ( mlan_private * priv , t_u8 chan ) { mlan_status ret = MLAN_STATUS_SUCCESS ; wlan_dfs_device_state_t * pstate_dfs = & priv -> adapter -> state_dfs ; t_u32 sec , usec ; ENTER ( ) ; priv -> adapter -> callbacks . moal_get_system_time ( priv -> adapter -> pmoal_handle , & sec , & usec ) ; PRINTM ( MINFO , " \n " , __func__ ) ; PRINTM ( MINFO , " \n " , sec , pstate_dfs -> dfs_report_time_sec ) ; PRINTM ( MINFO , " \n " , pstate_dfs -> dfs_check_channel , pstate_dfs -> dfs_radar_found ) ; if ( ( ! pstate_dfs -> dfs_check_pending ) && ( chan == pstate_dfs -> dfs_check_channel ) && ( ( sec - pstate_dfs -> dfs_report_time_sec ) < MAX_DFS_REPORT_USABLE_AGE_SEC ) ) { if ( pstate_dfs -> dfs_radar_found ) { PRINTM ( MEVENT , " \n " , chan ) ; ret = MLAN_STATUS_FAILURE ; } } else { pstate_dfs -> dfs_check_channel = 0 ; ret = MLAN_STATUS_PENDING ; } LEAVE ( ) ; return ret ; }
@brief Checks if a radar measurement was performed on channel,
         and if so, whether radar was detected on it.
@brief Checks if a radar measurement was performed on channel and if so whether radar was detected on it .
/* check report we hold is valid or not */ /* valid and not out-dated, check if radar */ /* When Cache is not valid. This is required during extending cache
		 * validity during bss_stop
		 */ /*TODO:  reissue report request if not pending.
		 *       BUT HOW to make the code wait for it???
		 * For now, just fail since we don't have the info. */