diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 09c007a9d6ce..b43bc075472f 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -1415,12 +1415,6 @@ ieee80211_ht_timeout(struct ieee80211com *ic) } } -/* unalligned little endian access */ -#define LE_READ_2(p) \ - ((uint16_t) \ - ((((const uint8_t *)(p))[0] ) | \ - (((const uint8_t *)(p))[1] << 8))) - /* * Process an 802.11n HT capabilities ie. */ @@ -1832,6 +1826,55 @@ ieee80211_addba_request(struct ieee80211_node *ni, return 1; } +/* + * Called by drivers that wish to request an ADDBA session be + * setup. This brings it up and starts the request timer. + */ +int +ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid) +{ + struct ieee80211_tx_ampdu *tap; + + if (tid < 0 || tid > 15) + return (0); + tap = &ni->ni_tx_ampdu[tid]; + + /* XXX locking */ + if ((tap->txa_flags & IEEE80211_AGGR_SETUP) == 0) { + /* do deferred setup of state */ + ampdu_tx_setup(tap); + } + /* XXX hack for not doing proper locking */ + tap->txa_flags &= ~IEEE80211_AGGR_NAK; + addba_start_timeout(tap); + return (1); +} + +/* + * Called by drivers that have marked a session as active. + */ +int +ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, int tid, + int status) +{ + struct ieee80211_tx_ampdu *tap; + + if (tid < 0 || tid > 15) + return (0); + tap = &ni->ni_tx_ampdu[tid]; + + /* XXX locking */ + addba_stop_timeout(tap); + if (status == 1) { + tap->txa_flags |= IEEE80211_AGGR_RUNNING; + tap->txa_attempts = 0; + } else { + /* mark tid so we don't try again */ + tap->txa_flags |= IEEE80211_AGGR_NAK; + } + return (1); +} + /* * Default method for processing an A-MPDU tx aggregation * response. We shutdown any pending timer and update the diff --git a/sys/net80211/ieee80211_ht.h b/sys/net80211/ieee80211_ht.h index f7ba6c63c36a..f099ffe77464 100644 --- a/sys/net80211/ieee80211_ht.h +++ b/sys/net80211/ieee80211_ht.h @@ -202,5 +202,8 @@ void ieee80211_ht_update_beacon(struct ieee80211vap *, struct ieee80211_beacon_offsets *); int ieee80211_ampdu_rx_start_ext(struct ieee80211_node *ni, int tid, int seq, int baw); +int ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid); +int ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, + int tid, int status); #endif /* _NET80211_IEEE80211_HT_H_ */