Author: adrian
Date: Fri Mar 25 10:55:25 2011
New Revision: 219985
URL: http://svn.freebsd.org/changeset/base/219985

Log:
  After discussing with Bernhard, the "right" way in net80211 to check
  the channel width is ni->ni_chw, which is set to the negotiated channel
  width. ni->ni_htflags is the capability, rather than the negotiated
  value.
  
  Teach both the TX path and the sample rate module about this.

Modified:
  head/sys/dev/ath/ath_rate/sample/sample.c
  head/sys/dev/ath/if_ath_tx_ht.c

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==============================================================================
--- head/sys/dev/ath/ath_rate/sample/sample.c   Fri Mar 25 10:53:13 2011        
(r219984)
+++ head/sys/dev/ath/ath_rate/sample/sample.c   Fri Mar 25 10:55:25 2011        
(r219985)
@@ -484,7 +484,7 @@ update_stats(struct ath_softc *sc, struc
        const int size_bin = size_to_bin(frame_size);
        const int size = bin_to_size(size_bin);
        int tt, tries_so_far;
-       int is_ht40 = (an->an_node.ni_htcap & IEEE80211_HTCAP_CHWIDTH40);
+       int is_ht40 = (an->an_node.ni_chw == 40);
 
        if (!IS_RATE_DEFINED(sn, rix0))
                return;
@@ -799,7 +799,7 @@ ath_rate_ctl_reset(struct ath_softc *sc,
                                continue;
                        printf(" %d %s/%d", dot11rate(rt, rix), 
dot11rate_label(rt, rix),
                            calc_usecs_unicast_packet(sc, 1600, rix, 0,0,
-                               (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40)));
+                               (ni->ni_chw == 40)));
                }
                printf("\n");
        }
@@ -829,7 +829,7 @@ ath_rate_ctl_reset(struct ath_softc *sc,
                        
                        sn->stats[y][rix].perfect_tx_time =
                            calc_usecs_unicast_packet(sc, size, rix, 0, 0,
-                           (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40));
+                           (ni->ni_chw == 40));
                        sn->stats[y][rix].average_tx_time =
                            sn->stats[y][rix].perfect_tx_time;
                }

Modified: head/sys/dev/ath/if_ath_tx_ht.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx_ht.c     Fri Mar 25 10:53:13 2011        
(r219984)
+++ head/sys/dev/ath/if_ath_tx_ht.c     Fri Mar 25 10:55:25 2011        
(r219985)
@@ -129,9 +129,14 @@ ath_rateseries_setup(struct ath_softc *s
                if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))
                        series[i].RateFlags |= HAL_RATESERIES_RTS_CTS;
 
-#if 0
-               if (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40)
+               /*
+                * Transmit 40MHz frames only if the node has negotiated
+                * it rather than whether the node is capable of it or not.
+                * It's subtly different in the hostap case.
+                */
+               if (ni->ni_chw == 40)
                        series[i].RateFlags |= HAL_RATESERIES_2040;
+#if 0
                /*
                 * The hardware only supports short-gi in 40mhz mode -
                 * if later hardware supports it in 20mhz mode, be sure
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to