software/drivers/sd8887/src/wlan/mlan/mlan_cfp.c
/**
 *  @brief Use rate to get the index
 *
 *  @param pmadapter    A pointer to mlan_adapter structure
 *  @param rate         Data rate
 *
 *  @return                     Index or 0
 */
@brief Use rate to get the index
@param pmadapter    A pointer to mlan_adapter structure
@param rate         Data rate

@return                     Index or 0
@brief Use rate to get the index @param pmadapter A pointer to mlan_adapter structure @param rate Data rate @return Index or 0
t_u8
wlan_data_rate_to_index(pmlan_adapter pmadapter, t_u32 rate)
{
	t_u16 *ptr;
	ENTER();
	if (rate) {
		ptr = wlan_memchr(pmadapter, WlanDataRates, (t_u8)rate,
				  sizeof(WlanDataRates));
		if (ptr) {
			LEAVE();
			return (t_u8)(ptr - WlanDataRates);
		}
	}
	LEAVE();
	return 0;
}
t_u8 wlan_data_rate_to_index ( pmlan_adapter pmadapter , t_u32 rate ) { t_u16 * ptr ; ENTER ( ) ; if ( rate ) { ptr = wlan_memchr ( pmadapter , WlanDataRates , ( t_u8 ) rate , sizeof ( WlanDataRates ) ) ; if ( ptr ) { LEAVE ( ) ; return ( t_u8 ) ( ptr - WlanDataRates ) ; } } LEAVE ( ) ; return 0 ; }
@brief Use rate to get the index
  @param pmadapter    A pointer to mlan_adapter structure
  @param rate         Data rate
@brief Use rate to get the index @param pmadapter A pointer to mlan_adapter structure @param rate Data rate