software/drivers/sd8887/src/wlan/mlan/mlan_cfp.c
/**
 *  @brief Find the channel frequency power info for a specific frequency
 *
 *  @param pmadapter    A pointer to mlan_adapter structure
 *  @param band         It can be BAND_A, BAND_G or BAND_B
 *  @param freq         The frequency to search for
 *
 *  @return         Pointer to chan_freq_power_t structure; MNULL if not found
 */
@brief Find the channel frequency power info for a specific frequency
@param pmadapter    A pointer to mlan_adapter structure
@param band         It can be BAND_A, BAND_G or BAND_B
@param freq         The frequency to search for

@return         Pointer to chan_freq_power_t structure; MNULL if not found
@brief Find the channel frequency power info for a specific frequency @param pmadapter A pointer to mlan_adapter structure @param band It can be BAND_A BAND_G or BAND_B @param freq The frequency to search for @return Pointer to chan_freq_power_t structure ; MNULL if not found
chan_freq_power_t *
wlan_find_cfp_by_band_and_freq(mlan_adapter *pmadapter, t_u8 band, t_u32 freq)
{
	chan_freq_power_t *cfp = MNULL;
	region_chan_t *rc;
	int i, j;
	ENTER();
	for (j = 0; !cfp && (j < MAX_REGION_CHANNEL_NUM); j++) {
		rc = &pmadapter->region_channel[j];
		if (wlan_count_priv_cond(pmadapter, wlan_11d_is_enabled,
					 wlan_is_station) > 0)
			rc = &pmadapter->universal_channel[j];
		if (!rc->valid || !rc->pcfp)
			continue;
		switch (rc->band) {
		case BAND_A:
			switch (band) {
			case BAND_AN:
			case BAND_A | BAND_AN:
			case BAND_A | BAND_AN | BAND_AAC:
			case BAND_A:	
				break;
			default:
				continue;
			}
			break;
		case BAND_B:
		case BAND_G:
			switch (band) {
			case BAND_GN:
			case BAND_B | BAND_G | BAND_GN:
			case BAND_G | BAND_GN:
			case BAND_GN | BAND_GAC:
			case BAND_B | BAND_G | BAND_GN | BAND_GAC:
			case BAND_G | BAND_GN | BAND_GAC:
			case BAND_B | BAND_G:
			case BAND_B:
			case BAND_G:
			case 0:
				break;
			default:
				continue;
			}
			break;
		default:
			continue;
		}
		for (i = 0; i < rc->num_cfp; i++) {
			if (rc->pcfp[i].freq == freq) {
				cfp = &rc->pcfp[i];
				break;
			}
		}
	}
	if (!cfp && freq)
		PRINTM(MERROR,
		       "wlan_find_cfp_by_band_and_freq(): cannot find cfp by "
		       "band %d & freq %d\n", band, freq);
	LEAVE();
	return cfp;
}
chan_freq_power_t * wlan_find_cfp_by_band_and_freq ( mlan_adapter * pmadapter , t_u8 band , t_u32 freq ) { chan_freq_power_t * cfp = MNULL ; region_chan_t * rc ; int i , j ; ENTER ( ) ; for ( j = 0 ; ! cfp && ( j < MAX_REGION_CHANNEL_NUM ) ; j ++ ) { rc = & pmadapter -> region_channel [ j ] ; if ( wlan_count_priv_cond ( pmadapter , wlan_11d_is_enabled , wlan_is_station ) > 0 ) rc = & pmadapter -> universal_channel [ j ] ; if ( ! rc -> valid || ! rc -> pcfp ) continue ; switch ( rc -> band ) { case BAND_A : switch ( band ) { case BAND_AN : case BAND_A | BAND_AN : case BAND_A | BAND_AN | BAND_AAC : case BAND_A : break ; default : continue ; } break ; case BAND_B : case BAND_G : switch ( band ) { case BAND_GN : case BAND_B | BAND_G | BAND_GN : case BAND_G | BAND_GN : case BAND_GN | BAND_GAC : case BAND_B | BAND_G | BAND_GN | BAND_GAC : case BAND_G | BAND_GN | BAND_GAC : case BAND_B | BAND_G : case BAND_B : case BAND_G : case 0 : break ; default : continue ; } break ; default : continue ; } for ( i = 0 ; i < rc -> num_cfp ; i ++ ) { if ( rc -> pcfp [ i ] . freq == freq ) { cfp = & rc -> pcfp [ i ] ; break ; } } } if ( ! cfp && freq ) PRINTM ( MERROR , " " " \n " , band , freq ) ; LEAVE ( ) ; return cfp ; }
@brief Find the channel frequency power info for a specific frequency
  @param pmadapter    A pointer to mlan_adapter structure
  @param band         It can be BAND_A, BAND_G or BAND_B
  @param freq         The frequency to search for
@brief Find the channel frequency power info for a specific frequency @param pmadapter A pointer to mlan_adapter structure @param band It can be BAND_A BAND_G or BAND_B @param freq The frequency to search for
/* Any station(s) with 11D enabled */ /* Matching BAND_A */