Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Feb 2011 08:10:18 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218160 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample
Message-ID:  <201102010810.p118AIIv063623@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Tue Feb  1 08:10:18 2011
New Revision: 218160
URL: http://svn.freebsd.org/changeset/base/218160

Log:
  Add a new method to the rate control modules which extract out the
  three other rates and try counts.
  
  The 11n rate scenario path wants to take a list of rate and tries,
  rather than calling setupxtxdesc().

Modified:
  head/sys/dev/ath/ath_rate/amrr/amrr.c
  head/sys/dev/ath/ath_rate/onoe/onoe.c
  head/sys/dev/ath/ath_rate/sample/sample.c
  head/sys/dev/ath/if_athrate.h

Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c
==============================================================================
--- head/sys/dev/ath/ath_rate/amrr/amrr.c	Tue Feb  1 08:03:01 2011	(r218159)
+++ head/sys/dev/ath/ath_rate/amrr/amrr.c	Tue Feb  1 08:10:18 2011	(r218160)
@@ -114,6 +114,30 @@ ath_rate_findrate(struct ath_softc *sc, 
 		*txrate = amn->amn_tx_rate0;
 }
 
+/*
+ * Get the TX rates.
+ *
+ * The short preamble bits aren't set here; the caller should augment
+ * the returned rate with the relevant preamble rate flag.
+ */
+void
+ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
+    uint8_t rix0, uint8_t *rix, uint8_t *try)
+{
+	struct amrr_node *amn = ATH_NODE_AMRR(an);
+
+/*	rix[0] = amn->amn_tx_rate0; */
+	rix[1] = amn->amn_tx_rate1;
+	rix[2] = amn->amn_tx_rate2;
+	rix[3] = amn->amn_tx_rate3;
+
+	try[0] = amn->amn_tx_try0;
+	try[1] = amn->amn_tx_try1;
+	try[2] = amn->amn_tx_try2;
+	try[3] = amn->amn_tx_try3;
+}
+
+
 void
 ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
 	struct ath_desc *ds, int shortPreamble, u_int8_t rix)

Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c
==============================================================================
--- head/sys/dev/ath/ath_rate/onoe/onoe.c	Tue Feb  1 08:03:01 2011	(r218159)
+++ head/sys/dev/ath/ath_rate/onoe/onoe.c	Tue Feb  1 08:10:18 2011	(r218160)
@@ -122,6 +122,29 @@ ath_rate_findrate(struct ath_softc *sc, 
 		*txrate = on->on_tx_rate0;
 }
 
+/*
+ * Get the TX rates.
+ *
+ * The short preamble bits aren't set here; the caller should augment
+ * the returned rate with the relevant preamble rate flag.
+ */
+void
+ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
+    uint8_t rix0, uint8_t *rix, uint8_t *try)
+{
+	struct onoe_node *on = ATH_NODE_ONOE(an);
+
+/*	rix[0] = on->on_tx_rate0; */
+	rix[1] = on->on_tx_rate1;
+	rix[2] = on->on_tx_rate2;
+	rix[3] = on->on_tx_rate3;
+
+	try[0] = on->on_tx_try0;
+	try[1] = 2;
+	try[2] = 2;
+	try[3] = 2;
+}
+
 void
 ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
 	struct ath_desc *ds, int shortPreamble, u_int8_t rix)

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==============================================================================
--- head/sys/dev/ath/ath_rate/sample/sample.c	Tue Feb  1 08:03:01 2011	(r218159)
+++ head/sys/dev/ath/ath_rate/sample/sample.c	Tue Feb  1 08:10:18 2011	(r218160)
@@ -363,6 +363,30 @@ done:
 #undef RATE
 }
 
+/*
+ * Get the TX rates. Don't fiddle with short preamble flags for them;
+ * the caller can do that.
+ */
+void
+ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
+    uint8_t rix0, uint8_t *rix, uint8_t *try)
+{
+	struct sample_node *sn = ATH_NODE_SAMPLE(an);
+	const struct txschedule *sched = &sn->sched[rix0];
+
+	KASSERT(rix0 == sched->r0, ("rix0 (%x) != sched->r0 (%x)!\n", rix0, sched->r0));
+
+/*	rix[0] = sched->r0; */
+	rix[1] = sched->r1;
+	rix[2] = sched->r2;
+	rix[3] = sched->r3;
+
+	try[0] = sched->t0;
+	try[1] = sched->t1;
+	try[2] = sched->t2;
+	try[3] = sched->t3;
+}
+
 void
 ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an,
 		      struct ath_desc *ds, int shortPreamble, u_int8_t rix)

Modified: head/sys/dev/ath/if_athrate.h
==============================================================================
--- head/sys/dev/ath/if_athrate.h	Tue Feb  1 08:03:01 2011	(r218159)
+++ head/sys/dev/ath/if_athrate.h	Tue Feb  1 08:10:18 2011	(r218160)
@@ -102,6 +102,12 @@ void	ath_rate_newassoc(struct ath_softc 
  * Transmit handling.
  */
 /*
+ * Return the four TX rate index and try counts for the current data packet.
+ */
+void	ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an,
+		uint8_t rix0, uint8_t *rix, uint8_t *try);
+
+/*
  * Return the transmit info for a data packet.  If multi-rate state
  * is to be setup then try0 should contain a value other than ATH_TXMATRY
  * and ath_rate_setupxtxdesc will be called after deciding if the frame



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