Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iwn/if_iwn.c
Show First 20 Lines • Show All 7,436 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* This function is called by upper layer when an ADDBA request is received | * This function is called by upper layer when an ADDBA request is received | ||||
* from another STA and before the ADDBA response is sent. | * from another STA and before the ADDBA response is sent. | ||||
*/ | */ | ||||
static int | static int | ||||
iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, | iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, | ||||
int baparamset, int batimeout, int baseqctl) | 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_softc *sc = ni->ni_ic->ic_softc; | ||||
struct iwn_ops *ops = &sc->ops; | struct iwn_ops *ops = &sc->ops; | ||||
struct iwn_node *wn = (void *)ni; | struct iwn_node *wn = (void *)ni; | ||||
struct iwn_node_info node; | struct iwn_node_info node; | ||||
uint16_t ssn; | uint16_t ssn; | ||||
uint8_t tid; | uint8_t tid; | ||||
int error; | int error; | ||||
DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); | DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); | ||||
tid = MS(le16toh(baparamset), IEEE80211_BAPS_TID); | tid = _IEEE80211_MASKSHIFT(le16toh(baparamset), IEEE80211_BAPS_TID); | ||||
ssn = MS(le16toh(baseqctl), IEEE80211_BASEQ_START); | ssn = _IEEE80211_MASKSHIFT(le16toh(baseqctl), IEEE80211_BASEQ_START); | ||||
if (wn->id == IWN_ID_UNDEFINED) | if (wn->id == IWN_ID_UNDEFINED) | ||||
return (ENOENT); | return (ENOENT); | ||||
memset(&node, 0, sizeof node); | memset(&node, 0, sizeof node); | ||||
node.id = wn->id; | node.id = wn->id; | ||||
node.control = IWN_NODE_UPDATE; | node.control = IWN_NODE_UPDATE; | ||||
node.flags = IWN_FLAG_SET_ADDBA; | node.flags = IWN_FLAG_SET_ADDBA; | ||||
node.addba_tid = tid; | node.addba_tid = tid; | ||||
node.addba_ssn = htole16(ssn); | node.addba_ssn = htole16(ssn); | ||||
DPRINTF(sc, IWN_DEBUG_RECV, "ADDBA RA=%d TID=%d SSN=%d\n", | DPRINTF(sc, IWN_DEBUG_RECV, "ADDBA RA=%d TID=%d SSN=%d\n", | ||||
wn->id, tid, ssn); | wn->id, tid, ssn); | ||||
error = ops->add_node(sc, &node, 1); | error = ops->add_node(sc, &node, 1); | ||||
if (error != 0) | if (error != 0) | ||||
return error; | return error; | ||||
return sc->sc_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); | return sc->sc_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); | ||||
#undef MS | |||||
} | } | ||||
/* | /* | ||||
* This function is called by upper layer on teardown of an HT-immediate | * This function is called by upper layer on teardown of an HT-immediate | ||||
* Block Ack agreement (eg. uppon receipt of a DELBA frame). | * Block Ack agreement (eg. uppon receipt of a DELBA frame). | ||||
*/ | */ | ||||
static void | static void | ||||
iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) | iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) | ||||
▲ Show 20 Lines • Show All 1,746 Lines • Show Last 20 Lines |