Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jun 2011 05:34:08 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r223036 - in user/adrian/if_ath_tx/sys: dev/ath net80211
Message-ID:  <201106130534.p5D5Y8gX057683@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon Jun 13 05:34:08 2011
New Revision: 223036
URL: http://svn.freebsd.org/changeset/base/223036

Log:
  Expose the default ampdu TX methods for use by ath(4).
  
  The (current) aim is to leverage the existing per-TID AMPDU TX handling
  (negotiation, BAR/BAW tracking and handling, etc) and to simply handle
  the packet TX, BA response handling and retransmission in the ath(4)
  driver.
  
  The timeout call also should be turned into a callback so the ath(4)
  code can trap it and remove the TID queue pause.

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h
  user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.c
  user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.h

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Mon Jun 13 05:22:07 2011	(r223035)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Mon Jun 13 05:34:08 2011	(r223036)
@@ -644,6 +644,10 @@ ath_attach(u_int16_t devid, struct ath_s
 			    | IEEE80211_HTCAP_SMPS_OFF;		/* SM power save off */
 			;
 
+		ic->ic_addba_request = ath_addba_request;
+		ic->ic_addba_response = ath_addba_response;
+		ic->ic_addba_stop = ath_addba_stop;
+
 		/*
 		 * Enable short-GI for HT20 only if the hardware
 		 * advertises support.

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Mon Jun 13 05:22:07 2011	(r223035)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Mon Jun 13 05:34:08 2011	(r223036)
@@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$");
 #ifdef IEEE80211_SUPPORT_TDMA
 #include <net80211/ieee80211_tdma.h>
 #endif
+#include <net80211/ieee80211_ht.h>
 
 #include <net/bpf.h>
 
@@ -1566,3 +1567,54 @@ ath_txq_sched(struct ath_softc *sc)
 	}
 	ATH_TXNODE_UNLOCK(sc);
 } 
+
+
+
+/*
+ * TX addba handling
+ */
+
+/*
+ * Method to handle sending an ADDBA request.
+ *
+ * We tap this so the relevant flags can be set to pause the TID
+ * whilst waiting for the response.
+ *
+ * XXX there's no timeout handler we can override?
+ */
+int
+ath_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
+    int dialogtoken, int baparamset, int batimeout)
+{
+	return ieee80211_addba_request(ni, tap, dialogtoken, baparamset,
+	    batimeout);
+}
+
+/*
+ * Handle an ADDBA response.
+ *
+ * We unpause the queue so TX'ing can resume.
+ *
+ * Any packets TX'ed from this point should be "aggregate" (whether
+ * aggregate or not) so the BAW is updated.
+ */
+int
+ath_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
+    int dialogtoken, int code, int batimeout)
+{
+	return ieee80211_addba_request(ni, tap, dialogtoken, code, batimeout);
+}
+
+
+/*
+ * Stop ADDBA on a queue.
+ *
+ * In theory, queued ath_bufs should be turned back into non-aggregate
+ * buffers. I'm not sure what to do about packets currently queued
+ * to the hardware.
+ */
+void
+ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
+{
+	ieee80211_addba_stop(ni, tap);
+}

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h	Mon Jun 13 05:22:07 2011	(r223035)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h	Mon Jun 13 05:34:08 2011	(r223036)
@@ -52,5 +52,14 @@ extern void ath_tx_tid_hw_queue(struct a
 extern void ath_tx_hw_queue(struct ath_softc *sc, struct ath_node *an);
 extern void ath_txq_sched(struct ath_softc *sc);
 
+/* TX addba handling */
+extern	int ath_addba_request(struct ieee80211_node *ni,
+    struct ieee80211_tx_ampdu *tap, int dialogtoken,
+    int baparamset, int batimeout);
+extern	int ath_addba_response(struct ieee80211_node *ni,
+    struct ieee80211_tx_ampdu *tap, int dialogtoken,
+    int code, int batimeout);
+extern	void ath_addba_stop(struct ieee80211_node *ni,
+    struct ieee80211_tx_ampdu *tap);
 
 #endif

Modified: user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.c
==============================================================================
--- user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.c	Mon Jun 13 05:22:07 2011	(r223035)
+++ user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.c	Mon Jun 13 05:34:08 2011	(r223036)
@@ -209,14 +209,7 @@ SYSINIT(wlan_ht, SI_SUB_DRIVERS, SI_ORDE
 
 static int ieee80211_ampdu_enable(struct ieee80211_node *ni,
 	struct ieee80211_tx_ampdu *tap);
-static int ieee80211_addba_request(struct ieee80211_node *ni,
-	struct ieee80211_tx_ampdu *tap,
-	int dialogtoken, int baparamset, int batimeout);
-static int ieee80211_addba_response(struct ieee80211_node *ni,
-	struct ieee80211_tx_ampdu *tap,
-	int code, int baparamset, int batimeout);
-static void ieee80211_addba_stop(struct ieee80211_node *ni,
-	struct ieee80211_tx_ampdu *tap);
+
 static void ieee80211_bar_response(struct ieee80211_node *ni,
 	struct ieee80211_tx_ampdu *tap, int status);
 static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap);
@@ -1726,7 +1719,7 @@ addba_stop_timeout(struct ieee80211_tx_a
  * We setup the specified state block and start a timer
  * to wait for an ADDBA response frame.
  */
-static int
+int
 ieee80211_addba_request(struct ieee80211_node *ni,
 	struct ieee80211_tx_ampdu *tap,
 	int dialogtoken, int baparamset, int batimeout)
@@ -1748,7 +1741,7 @@ ieee80211_addba_request(struct ieee80211
  * response.  We shutdown any pending timer and update the
  * state block according to the reply.
  */
-static int
+int
 ieee80211_addba_response(struct ieee80211_node *ni,
 	struct ieee80211_tx_ampdu *tap,
 	int status, int baparamset, int batimeout)
@@ -1777,7 +1770,7 @@ ieee80211_addba_response(struct ieee8021
  * Default method for stopping A-MPDU tx aggregation.
  * Any timer is cleared and we drain any pending frames.
  */
-static void
+void
 ieee80211_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
 {
 	/* XXX locking */

Modified: user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.h
==============================================================================
--- user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.h	Mon Jun 13 05:22:07 2011	(r223035)
+++ user/adrian/if_ath_tx/sys/net80211/ieee80211_ht.h	Mon Jun 13 05:34:08 2011	(r223036)
@@ -200,4 +200,14 @@ uint8_t	*ieee80211_add_htinfo_vendor(uin
 struct ieee80211_beacon_offsets;
 void	ieee80211_ht_update_beacon(struct ieee80211vap *,
 		struct ieee80211_beacon_offsets *);
+
+int	ieee80211_addba_request(struct ieee80211_node *ni,
+		struct ieee80211_tx_ampdu *tap, int dialogtoken,
+		int baparamset, int batimeout);
+int	ieee80211_addba_response(struct ieee80211_node *ni,
+		struct ieee80211_tx_ampdu *tap, int dialogtoken,
+		int code, int batimeout);
+void	ieee80211_addba_stop(struct ieee80211_node *ni,
+		struct ieee80211_tx_ampdu *tap);
+
 #endif /* _NET80211_IEEE80211_HT_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106130534.p5D5Y8gX057683>