FreeBSD/sys/dev/iwn/if_iwn.c
/*
 * This function is called by upper layer when an ADDBA request is received
 * from another STA and before the ADDBA response is sent.
 */
This function is called by upper layer when an ADDBA request is received
from another STA and before the ADDBA response is sent.
This function is called by upper layer when an ADDBA request is received from another STA and before the ADDBA response is sent .
static int
iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap,
    int baparamset, int batimeout, int baseqctl)
{
#define MS(_v, _f)	(((_v) & _f) >> _f##_S)
	struct iwn_softc *sc = ni->ni_ic->ic_softc;
	struct iwn_ops *ops = &sc->ops;
	struct iwn_node *wn = (void *)ni;
	struct iwn_node_info node;
	uint16_t ssn;
	uint8_t tid;
	int error;
	DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
	tid = MS(le16toh(baparamset), IEEE80211_BAPS_TID);
	ssn = MS(le16toh(baseqctl), IEEE80211_BASEQ_START);
	memset(&node, 0, sizeof node);
	node.id = wn->id;
	node.control = IWN_NODE_UPDATE;
	node.flags = IWN_FLAG_SET_ADDBA;
	node.addba_tid = tid;
	node.addba_ssn = htole16(ssn);
	DPRINTF(sc, IWN_DEBUG_RECV, "ADDBA RA=%d TID=%d SSN=%d\n",
	    wn->id, tid, ssn);
	error = ops->add_node(sc, &node, 1);
	if (error != 0)
		return error;
	return sc->sc_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl);
#undef MS
}
static int iwn_ampdu_rx_start ( struct ieee80211_node * ni , struct ieee80211_rx_ampdu * rap , int baparamset , int batimeout , int baseqctl ) { #define MS ( _v , _f ) 	(((_v) & _f) >> _f##_S) struct iwn_softc * sc = ni -> ni_ic -> ic_softc ; struct iwn_ops * ops = & sc -> ops ; struct iwn_node * wn = ( void * ) ni ; struct iwn_node_info node ; uint16_t ssn ; uint8_t tid ; int error ; DPRINTF ( sc , IWN_DEBUG_TRACE , " \n " , __func__ ) ; tid = MS ( le16toh ( baparamset ) , IEEE80211_BAPS_TID ) ; ssn = MS ( le16toh ( baseqctl ) , IEEE80211_BASEQ_START ) ; memset ( & node , 0 , sizeof node ) ; node . id = wn -> id ; node . control = IWN_NODE_UPDATE ; node . flags = IWN_FLAG_SET_ADDBA ; node . addba_tid = tid ; node . addba_ssn = htole16 ( ssn ) ; DPRINTF ( sc , IWN_DEBUG_RECV , " \n " , wn -> id , tid , ssn ) ; error = ops -> add_node ( sc , & node , 1 ) ; if ( error != 0 ) return error ; return sc -> sc_ampdu_rx_start ( ni , rap , baparamset , batimeout , baseqctl ) ; #undef  MS }
This function is called by upper layer when an ADDBA request is received
 from another STA and before the ADDBA response is sent.
This function is called by upper layer when an ADDBA request is received from another STA and before the ADDBA response is sent .