diff options
author | Adrian Chadd <adrian@FreeBSD.org> | 2015-09-22 02:25:29 +0000 |
---|---|---|
committer | Adrian Chadd <adrian@FreeBSD.org> | 2015-09-22 02:25:29 +0000 |
commit | 163f8705a492c9d546a494fe856d9ca94d476f26 (patch) | |
tree | b22fe24d5393dd3b457dcb512bfa3c5cf2b93b5d /sys | |
parent | 57791228800b443e715e373a0da38498a0ede751 (diff) | |
download | src-163f8705a492c9d546a494fe856d9ca94d476f26.tar.gz src-163f8705a492c9d546a494fe856d9ca94d476f26.zip |
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>.
Notes
Notes:
svn path=/head/; revision=288085
Diffstat (limited to 'sys')
-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 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. */ @@ -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 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_ */ |