Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Feb 2011 02:14:19 +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: r218593 - head/sys/dev/ath
Message-ID:  <201102120214.p1C2EJHv081629@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sat Feb 12 02:14:19 2011
New Revision: 218593
URL: http://svn.freebsd.org/changeset/base/218593

Log:
  The current code used the fields in ath_set11nratescenario()  . Use them
  correctly:
  
  * pass in whether to allow the hardware to override the duration field
    in the main data frame (durupdate_en) - PS_POLL frames in particular
    don't have the duration bit overriden;
  * there's no rts/cts duration here; that's done elsehwere

Modified:
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx_ht.c
  head/sys/dev/ath/if_ath_tx_ht.h

Modified: head/sys/dev/ath/if_ath_tx.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx.c	Sat Feb 12 02:10:08 2011	(r218592)
+++ head/sys/dev/ath/if_ath_tx.c	Sat Feb 12 02:14:19 2011	(r218593)
@@ -812,7 +812,7 @@ ath_tx_start(struct ath_softc *sc, struc
         }
 
         if (ath_tx_is_11n(sc)) {
-                ath_buf_set_rate(sc, ni, bf, pktlen, flags, ctsrate, rate, try);
+                ath_buf_set_rate(sc, ni, bf, pktlen, flags, ctsrate, (atype == HAL_PKT_TYPE_PSPOLL), rate, try);
         }
 
 	ath_tx_handoff(sc, txq, bf);
@@ -998,7 +998,7 @@ ath_tx_raw_start(struct ath_softc *sc, s
 		 * notice that rix doesn't include any of the "magic" flags txrate
 		 * does for communicating "other stuff" to the HAL.
 		 */
-		ath_buf_set_rate(sc, ni, bf, pktlen, flags, ctsrate, rate, try);
+		ath_buf_set_rate(sc, ni, bf, pktlen, flags, ctsrate, (atype == HAL_PKT_TYPE_PSPOLL), rate, try);
 	}
 
 	/* NB: no buffered multicast in power save support */

Modified: head/sys/dev/ath/if_ath_tx_ht.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx_ht.c	Sat Feb 12 02:10:08 2011	(r218592)
+++ head/sys/dev/ath/if_ath_tx_ht.c	Sat Feb 12 02:14:19 2011	(r218593)
@@ -168,7 +168,7 @@ ath_rateseries_print(HAL_11N_RATE_SERIES
 
 void
 ath_buf_set_rate(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf,
-    int pktlen, int flags, uint8_t ctsrate, uint8_t *rix, uint8_t *try)
+    int pktlen, int flags, uint8_t ctsrate, int is_pspoll, uint8_t *rix, uint8_t *try)
 {
 	HAL_11N_RATE_SERIES series[4];
 	struct ath_desc *ds = bf->bf_desc;
@@ -189,8 +189,9 @@ ath_buf_set_rate(struct ath_softc *sc, s
 
 	/* Set rate scenario */
 	ath_hal_set11nratescenario(ah, ds,
+	    !is_pspoll,	/* whether to override the duration or not */
+			/* don't allow hardware to override the duration on ps-poll packets */
 	    ctsrate,	/* rts/cts rate */
-	    0,		/* rts/cts duration */
 	    series,	/* 11n rate series */
 	    4,		/* number of series */
 	    flags);

Modified: head/sys/dev/ath/if_ath_tx_ht.h
==============================================================================
--- head/sys/dev/ath/if_ath_tx_ht.h	Sat Feb 12 02:10:08 2011	(r218592)
+++ head/sys/dev/ath/if_ath_tx_ht.h	Sat Feb 12 02:14:19 2011	(r218593)
@@ -33,7 +33,7 @@
 
 extern void	ath_buf_set_rate(struct ath_softc *sc,
 		struct ieee80211_node *ni, struct ath_buf *bf,
-		int pktlen, int flags, uint8_t ctsrate, uint8_t *rix,
-		uint8_t *try);
+		int pktlen, int flags, uint8_t ctsrate, int is_pspoll,
+		uint8_t *rix, uint8_t *try);
 
 #endif



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