svn commit: r288085 - head/sys/net80211
Adrian Chadd
adrian at FreeBSD.org
Tue Sep 22 02:25:30 UTC 2015
Author: adrian
Date: Tue Sep 22 02:25:29 2015
New Revision: 288085
URL: https://svnweb.freebsd.org/changeset/base/288085
Log:
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 at gmail.com>.
Modified:
head/sys/net80211/ieee80211_ht.c
head/sys/net80211/ieee80211_ht.h
Modified: head/sys/net80211/ieee80211_ht.c
==============================================================================
--- head/sys/net80211/ieee80211_ht.c Tue Sep 22 02:24:13 2015 (r288084)
+++ head/sys/net80211/ieee80211_ht.c Tue Sep 22 02:25:29 2015 (r288085)
@@ -1415,12 +1415,6 @@ ieee80211_ht_timeout(struct ieee80211com
}
}
-/* 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
}
/*
+ * 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.
Modified: head/sys/net80211/ieee80211_ht.h
==============================================================================
--- head/sys/net80211/ieee80211_ht.h Tue Sep 22 02:24:13 2015 (r288084)
+++ head/sys/net80211/ieee80211_ht.h Tue Sep 22 02:25:29 2015 (r288085)
@@ -202,5 +202,8 @@ void ieee80211_ht_update_beacon(struct i
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_ */
More information about the svn-src-all
mailing list