Search Linux Wireless

[RFC] mac80211: fix short preamble determination

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When looking at this code during the rate control API rewrite
yesterday, we wondered whether the determination of short
preamble was correct or not. I don't think it was, and this
should be better.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
---
 net/mac80211/tx.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

--- everything.orig/net/mac80211/tx.c	2008-10-11 10:06:51.000000000 +0200
+++ everything/net/mac80211/tx.c	2008-10-11 10:22:53.000000000 +0200
@@ -474,10 +474,15 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
 		txrc.rts = rts = true;
 	}
 
-	/* XXX: Is this really the right thing to check? */
-	if (ieee80211_is_data(hdr->frame_control) &&
-	    tx->sdata->vif.bss_conf.use_short_preamble &&
-	    (!tx->sta || test_sta_flags(tx->sta, WLAN_STA_SHORT_PREAMBLE)))
+	/*
+	 * Use short preamble if the BSS can handle it, but not for
+	 * management frames unless we know the receiver can handle
+	 * that -- the management frame might be to a station that
+	 * just wants a probe response.
+	 */
+	if (tx->sdata->vif.bss_conf.use_short_preamble &&
+	    (ieee80211_is_data(hdr->frame_control) ||
+	     (tx->sta && test_sta_flags(tx->sta, WLAN_STA_SHORT_PREAMBLE)))
 		txrc.short_preamble = short_preamble = true;
 
 


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux