diff options
author | adrian <adrian@FreeBSD.org> | 2015-09-22 02:25:29 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-09-22 02:25:29 +0000 |
commit | b71d742dc5dc9eb63999e111bb784eae47f67f2a (patch) | |
tree | b22fe24d5393dd3b457dcb512bfa3c5cf2b93b5d /sys/net80211 | |
parent | 9ddda59a98c33e7b94886dbc22bae52f3ecd8e27 (diff) | |
download | FreeBSD-src-b71d742dc5dc9eb63999e111bb784eae47f67f2a.zip FreeBSD-src-b71d742dc5dc9eb63999e111bb784eae47f67f2a.tar.gz |
Add external facing methods to control TX A-MPDU negotiaton.
Some fullmac devices may rely on the stack starting it but not doing it.
Whilst here, remove a duplicate LE_* macro definition, thanks to
Andriy Voskoboinyk <s3erios@gmail.com>.
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_ht.c | 55 | ||||
-rw-r--r-- | sys/net80211/ieee80211_ht.h | 3 |
2 files changed, 52 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index 09c007a..b43bc07 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. */ @@ -1833,6 +1827,55 @@ ieee80211_addba_request(struct ieee80211_node *ni, } /* + * 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 * state block according to the reply. diff --git a/sys/net80211/ieee80211_ht.h b/sys/net80211/ieee80211_ht.h index f7ba6c6..f099ffe 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_ */ |