software/drivers/sd8887/src/wlan/mlan/mlan_cfp.c
/**
 *  @brief This function search through all the regions cfp table to find the channel,
 *            if the channel is found then gets the MIN txpower of the channel
 *            present in all the regions.
 *
 *  @param pmpriv       A pointer to mlan_private structure
 *  @param channel      Channel number.
 *
 *  @return             The Tx power
 */
@brief This function search through all the regions cfp table to find the channel,
if the channel is found then gets the MIN txpower of the channel
present in all the regions.

@param pmpriv       A pointer to mlan_private structure
@param channel      Channel number.

@return             The Tx power
@brief This function search through all the regions cfp table to find the channel if the channel is found then gets the MIN txpower of the channel present in all the regions . @param pmpriv A pointer to mlan_private structure @param channel Channel number . @return The Tx power
t_u8
wlan_get_txpwr_of_chan_from_cfp(mlan_private *pmpriv, t_u8 channel)
{
	t_u8 i = 0;
	t_u8 j = 0;
	t_u8 tx_power = 0;
	t_u32 cfp_no;
	chan_freq_power_t *cfp = MNULL;
	chan_freq_power_t *cfp_a = MNULL;
	t_u32 cfp_no_a;
	ENTER();
	for (i = 0; i < MLAN_CFP_TABLE_SIZE_BG; i++) {
		cfp = cfp_table_BG[i].cfp;
		cfp_no = cfp_table_BG[i].cfp_no;
		for (j = 0; j < cfp_no; j++) {
			if ((cfp + j)->channel == channel) {
				if (tx_power != 0)
					tx_power =
						MIN(tx_power,
						    (cfp + j)->max_tx_power);
				else
					tx_power =
						(t_u8)(cfp + j)->max_tx_power;
				break;
			}
		}
	}
	for (i = 0; i < MLAN_CFP_TABLE_SIZE_A; i++) {
		cfp_a = cfp_table_A[i].cfp;
		cfp_no_a = cfp_table_A[i].cfp_no;
		for (j = 0; j < cfp_no_a; j++) {
			if ((cfp_a + j)->channel == channel) {
				if (tx_power != 0)
					tx_power =
						MIN(tx_power,
						    (cfp_a + j)->max_tx_power);
				else
					tx_power =
						(t_u8)((cfp_a +
							j)->max_tx_power);
				break;
			}
		}
	}
	LEAVE();
	return tx_power;
}
t_u8 wlan_get_txpwr_of_chan_from_cfp ( mlan_private * pmpriv , t_u8 channel ) { t_u8 i = 0 ; t_u8 j = 0 ; t_u8 tx_power = 0 ; t_u32 cfp_no ; chan_freq_power_t * cfp = MNULL ; chan_freq_power_t * cfp_a = MNULL ; t_u32 cfp_no_a ; ENTER ( ) ; for ( i = 0 ; i < MLAN_CFP_TABLE_SIZE_BG ; i ++ ) { cfp = cfp_table_BG [ i ] . cfp ; cfp_no = cfp_table_BG [ i ] . cfp_no ; for ( j = 0 ; j < cfp_no ; j ++ ) { if ( ( cfp + j ) -> channel == channel ) { if ( tx_power != 0 ) tx_power = MIN ( tx_power , ( cfp + j ) -> max_tx_power ) ; else tx_power = ( t_u8 ) ( cfp + j ) -> max_tx_power ; break ; } } } for ( i = 0 ; i < MLAN_CFP_TABLE_SIZE_A ; i ++ ) { cfp_a = cfp_table_A [ i ] . cfp ; cfp_no_a = cfp_table_A [ i ] . cfp_no ; for ( j = 0 ; j < cfp_no_a ; j ++ ) { if ( ( cfp_a + j ) -> channel == channel ) { if ( tx_power != 0 ) tx_power = MIN ( tx_power , ( cfp_a + j ) -> max_tx_power ) ; else tx_power = ( t_u8 ) ( ( cfp_a + j ) -> max_tx_power ) ; break ; } } } LEAVE ( ) ; return tx_power ; }
@brief This function search through all the regions cfp table to find the channel,
            if the channel is found then gets the MIN txpower of the channel
            present in all the regions.
@brief This function search through all the regions cfp table to find the channel if the channel is found then gets the MIN txpower of the channel present in all the regions .
/* Get CFP */ /* Find matching channel and get Tx power */ /* Get CFP */