software/drivers/sd8887/src/wlan/mlan/mlan_wmm.c
/**
 *  @brief Get the threshold value for BA setup using system time.
 *
 *  @param pmadapter       Pointer to the mlan_adapter structure
 *
 *  @return         threshold value.
 */
@brief Get the threshold value for BA setup using system time.
@param pmadapter       Pointer to the mlan_adapter structure

@return         threshold value.
@brief Get the threshold value for BA setup using system time . @param pmadapter Pointer to the mlan_adapter structure @return threshold value .
t_u8
wlan_get_random_ba_threshold(pmlan_adapter pmadapter)
{
	t_u32 sec, usec;
	t_u8 ba_threshold = 0;
	ENTER();
#define BA_SETUP_MAX_PACKET_THRESHOLD   16
#define BA_SETUP_PACKET_OFFSET          16
	pmadapter->callbacks.moal_get_system_time(pmadapter->pmoal_handle, &sec,
						  &usec);
	sec = (sec & 0xFFFF) + (sec >> 16);
	usec = (usec & 0xFFFF) + (usec >> 16);
	ba_threshold =
		(((sec << 16) + usec) % BA_SETUP_MAX_PACKET_THRESHOLD) +
		BA_SETUP_PACKET_OFFSET;
	PRINTM(MINFO, "setup BA after %d packets\n", ba_threshold);
	LEAVE();
	return ba_threshold;
}
t_u8 wlan_get_random_ba_threshold ( pmlan_adapter pmadapter ) { t_u32 sec , usec ; t_u8 ba_threshold = 0 ; ENTER ( ) ; #define BA_SETUP_MAX_PACKET_THRESHOLD    16 #define BA_SETUP_PACKET_OFFSET           16 pmadapter -> callbacks . moal_get_system_time ( pmadapter -> pmoal_handle , & sec , & usec ) ; sec = ( sec & 0xFFFF ) + ( sec >> 16 ) ; usec = ( usec & 0xFFFF ) + ( usec >> 16 ) ; ba_threshold = ( ( ( sec << 16 ) + usec ) % BA_SETUP_MAX_PACKET_THRESHOLD ) + BA_SETUP_PACKET_OFFSET ; PRINTM ( MINFO , " \n " , ba_threshold ) ; LEAVE ( ) ; return ba_threshold ; }
@brief Get the threshold value for BA setup using system time.
@brief Get the threshold value for BA setup using system time .
/* setup ba_packet_threshold here random number between
	   [BA_SETUP_PACKET_OFFSET, BA_SETUP_PACKET_OFFSET+BA_SETUP_MAX_PACKET_THRESHOLD-1] */