software/drivers/sd8887/src/wlan/mlan/mlan_11h.c
/**
 *  @brief Add a dfs timestamp to the list
 *
 *  Assumes there will only be one timestamp per channel in the list,
 *  and that timestamp modes (represents) are mutually exclusive.
 *
 *  @param pmadapter  Pointer to mlan_adapter
 *  @param repr       Timestamp 'represents' value (see _dfs_timestamp_repr_e)
 *  @param channel    Channel number
 *
 *  @return           Pointer to timestamp if found, or MNULL
 */
@brief Add a dfs timestamp to the list
Assumes there will only be one timestamp per channel in the list,
and that timestamp modes (represents) are mutually exclusive.

@param pmadapter  Pointer to mlan_adapter
@param repr       Timestamp 'represents' value
@param channel    Channel number

@return           Pointer to timestamp if found, or MNULL
@brief Add a dfs timestamp to the list Assumes there will only be one timestamp per channel in the list and that timestamp modes ( represents ) are mutually exclusive . @param pmadapter Pointer to mlan_adapter @param repr Timestamp ' represents ' value @param channel Channel number @return Pointer to timestamp if found or MNULL
static mlan_status
wlan_11h_add_dfs_timestamp(mlan_adapter *pmadapter, t_u8 repr, t_u8 channel)
{
	wlan_dfs_timestamp_t *pdfs_ts = MNULL;
	mlan_status ret = MLAN_STATUS_SUCCESS;
	ENTER();
	pdfs_ts = wlan_11h_find_dfs_timestamp(pmadapter, channel);
	if (!pdfs_ts) {
		ret = pmadapter->callbacks.moal_malloc(pmadapter->pmoal_handle,
						       sizeof
						       (wlan_dfs_timestamp_t),
						       MLAN_MEM_DEF,
						       (t_u8 **)&pdfs_ts);
		if ((ret != MLAN_STATUS_SUCCESS) || !pdfs_ts) {
			PRINTM(MERROR, "%s(): Could not allocate dfs_ts\n",
			       __func__);
			LEAVE();
			return MLAN_STATUS_FAILURE;
		}
		memset(pmadapter, (t_u8 *)pdfs_ts, 0,
		       sizeof(wlan_dfs_timestamp_t));
		util_enqueue_list_tail(pmadapter->pmoal_handle,
				       &pmadapter->state_dfs.dfs_ts_head,
				       (pmlan_linked_list)pdfs_ts, MNULL,
				       MNULL);
		pdfs_ts->channel = channel;
	}
	pmadapter->callbacks.moal_get_system_time(pmadapter->pmoal_handle,
						  &pdfs_ts->ts_sec,
						  &pdfs_ts->ts_usec);
	pdfs_ts->represents = repr;
	PRINTM(MCMD_D, "11h: add/update dfs_timestamp - chan=%d, repr=%d(%s),"
	       " time(sec.usec)=%lu.%06lu\n", pdfs_ts->channel,
	       pdfs_ts->represents, DFS_TS_REPR_STRINGS[pdfs_ts->represents],
	       pdfs_ts->ts_sec, pdfs_ts->ts_usec);
	LEAVE();
	return ret;
}
static mlan_status wlan_11h_add_dfs_timestamp ( mlan_adapter * pmadapter , t_u8 repr , t_u8 channel ) { wlan_dfs_timestamp_t * pdfs_ts = MNULL ; mlan_status ret = MLAN_STATUS_SUCCESS ; ENTER ( ) ; pdfs_ts = wlan_11h_find_dfs_timestamp ( pmadapter , channel ) ; if ( ! pdfs_ts ) { ret = pmadapter -> callbacks . moal_malloc ( pmadapter -> pmoal_handle , sizeof ( wlan_dfs_timestamp_t ) , MLAN_MEM_DEF , ( t_u8 * * ) & pdfs_ts ) ; if ( ( ret != MLAN_STATUS_SUCCESS ) || ! pdfs_ts ) { PRINTM ( MERROR , " \n " , __func__ ) ; LEAVE ( ) ; return MLAN_STATUS_FAILURE ; } memset ( pmadapter , ( t_u8 * ) pdfs_ts , 0 , sizeof ( wlan_dfs_timestamp_t ) ) ; util_enqueue_list_tail ( pmadapter -> pmoal_handle , & pmadapter -> state_dfs . dfs_ts_head , ( pmlan_linked_list ) pdfs_ts , MNULL , MNULL ) ; pdfs_ts -> channel = channel ; } pmadapter -> callbacks . moal_get_system_time ( pmadapter -> pmoal_handle , & pdfs_ts -> ts_sec , & pdfs_ts -> ts_usec ) ; pdfs_ts -> represents = repr ; PRINTM ( MCMD_D , " " " \n " , pdfs_ts -> channel , pdfs_ts -> represents , DFS_TS_REPR_STRINGS [ pdfs_ts -> represents ] , pdfs_ts -> ts_sec , pdfs_ts -> ts_usec ) ; LEAVE ( ) ; return ret ; }
@brief Add a dfs timestamp to the list
  Assumes there will only be one timestamp per channel in the list,
  and that timestamp modes (represents) are mutually exclusive.
@brief Add a dfs timestamp to the list Assumes there will only be one timestamp per channel in the list and that timestamp modes ( represents ) are mutually exclusive .
/* need to allocate new timestamp */ /* (else, use existing timestamp for channel; see assumptions above) */ /* update params */