software/drivers/sd8887/src/wlan/mlan/mlan_scan.c
/**
 *  @brief This function will update the channel statistics from scan result
 *
 *  @param pmpriv           A pointer to mlan_private structure
 *  @param pchanstats_tlv   A pointer to MrvlIEtypes_ChannelStats_t tlv
 *
 *  @return                NA
 */
@brief This function will update the channel statistics from scan result
@param pmpriv           A pointer to mlan_private structure
@param pchanstats_tlv   A pointer to MrvlIEtypes_ChannelStats_t tlv

@return                NA
@brief This function will update the channel statistics from scan result @param pmpriv A pointer to mlan_private structure @param pchanstats_tlv A pointer to MrvlIEtypes_ChannelStats_t tlv @return NA
void
wlan_update_chan_statistics(mlan_private *pmpriv,
			    MrvlIEtypes_ChannelStats_t *pchanstats_tlv)
{
	mlan_adapter *pmadapter = pmpriv->adapter;
	t_u8 i;
	ChanStatistics_t *pchan_stats =
		(ChanStatistics_t *)((t_u8 *)pchanstats_tlv +
				     sizeof(MrvlIEtypesHeader_t));
	t_u8 num_chan =
		wlan_le16_to_cpu(pchanstats_tlv->header.len) /
		sizeof(ChanStatistics_t);
	ENTER();
	for (i = 0; i < num_chan; i++) {
		if (pmadapter->idx_chan_stats >= pmadapter->num_in_chan_stats) {
			PRINTM(MERROR,
			       "Over flow: idx_chan_stats=%d, num_in_chan_stats=%d\n",
			       pmadapter->idx_chan_stats,
			       pmadapter->num_in_chan_stats);
			break;
		}
		pchan_stats->total_networks =
			wlan_le16_to_cpu(pchan_stats->total_networks);
		pchan_stats->cca_scan_duration =
			wlan_le16_to_cpu(pchan_stats->cca_scan_duration);
		pchan_stats->cca_busy_duration =
			wlan_le16_to_cpu(pchan_stats->cca_busy_duration);
		PRINTM(MCMND,
		       "chan=%d, noise=%d, total_network=%d scan_duration=%d, busy_duration=%d\n",
		       pchan_stats->chan_num, pchan_stats->noise,
		       pchan_stats->total_networks,
		       pchan_stats->cca_scan_duration,
		       pchan_stats->cca_busy_duration);
		memcpy(pmadapter,
		       &pmadapter->pchan_stats[pmadapter->idx_chan_stats],
		       pchan_stats, sizeof(ChanStatistics_t));
		pmadapter->idx_chan_stats++;
		pchan_stats++;
	}
	LEAVE();
	return;
}
void wlan_update_chan_statistics ( mlan_private * pmpriv , MrvlIEtypes_ChannelStats_t * pchanstats_tlv ) { mlan_adapter * pmadapter = pmpriv -> adapter ; t_u8 i ; ChanStatistics_t * pchan_stats = ( ChanStatistics_t * ) ( ( t_u8 * ) pchanstats_tlv + sizeof ( MrvlIEtypesHeader_t ) ) ; t_u8 num_chan = wlan_le16_to_cpu ( pchanstats_tlv -> header . len ) / sizeof ( ChanStatistics_t ) ; ENTER ( ) ; for ( i = 0 ; i < num_chan ; i ++ ) { if ( pmadapter -> idx_chan_stats >= pmadapter -> num_in_chan_stats ) { PRINTM ( MERROR , " \n " , pmadapter -> idx_chan_stats , pmadapter -> num_in_chan_stats ) ; break ; } pchan_stats -> total_networks = wlan_le16_to_cpu ( pchan_stats -> total_networks ) ; pchan_stats -> cca_scan_duration = wlan_le16_to_cpu ( pchan_stats -> cca_scan_duration ) ; pchan_stats -> cca_busy_duration = wlan_le16_to_cpu ( pchan_stats -> cca_busy_duration ) ; PRINTM ( MCMND , " \n " , pchan_stats -> chan_num , pchan_stats -> noise , pchan_stats -> total_networks , pchan_stats -> cca_scan_duration , pchan_stats -> cca_busy_duration ) ; memcpy ( pmadapter , & pmadapter -> pchan_stats [ pmadapter -> idx_chan_stats ] , pchan_stats , sizeof ( ChanStatistics_t ) ) ; pmadapter -> idx_chan_stats ++ ; pchan_stats ++ ; } LEAVE ( ) ; return ; }
@brief This function will update the channel statistics from scan result
  @param pmpriv           A pointer to mlan_private structure
  @param pchanstats_tlv   A pointer to MrvlIEtypes_ChannelStats_t tlv
@brief This function will update the channel statistics from scan result @param pmpriv A pointer to mlan_private structure @param pchanstats_tlv A pointer to MrvlIEtypes_ChannelStats_t tlv