diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-12-07 11:12:10 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-12 13:48:24 -0500 |
commit | 3706de6f58962ba74c18eb4cb1ebe034ff723037 (patch) | |
tree | f7abfd387c67b07ae27c57609a7aa819140ae103 /drivers/net/wireless/ath9k | |
parent | 40990ec01fcca0b86a19c13a5d3deb77da1913a7 (diff) |
ath9k: Maintain rate table choice after association
A scan run after association would change sc_curmode which is
used to get the current rate table. This patch fixes it
by removing sc_curmode and setting the rate table in usage in cur_rate_table
on association.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r-- | drivers/net/wireless/ath9k/beacon.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 8 |
6 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c index d8742230e624..9e5c0c0446b6 100644 --- a/drivers/net/wireless/ath9k/beacon.c +++ b/drivers/net/wireless/ath9k/beacon.c | |||
@@ -106,7 +106,7 @@ static void ath_beacon_setup(struct ath_softc *sc, | |||
106 | * XXX everything at min xmit rate | 106 | * XXX everything at min xmit rate |
107 | */ | 107 | */ |
108 | rix = 0; | 108 | rix = 0; |
109 | rt = sc->hw_rate_table[sc->sc_curmode]; | 109 | rt = sc->cur_rate_table; |
110 | rate = rt->info[rix].ratecode; | 110 | rate = rt->info[rix].ratecode; |
111 | if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) | 111 | if (sc->sc_flags & SC_OP_PREAMBLE_SHORT) |
112 | rate |= rt->info[rix].short_preamble; | 112 | rate |= rt->info[rix].short_preamble; |
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 726d0a38d240..23844e02eff1 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -646,7 +646,6 @@ struct ath_softc { | |||
646 | u8 sc_tx_chainmask; | 646 | u8 sc_tx_chainmask; |
647 | u8 sc_rx_chainmask; | 647 | u8 sc_rx_chainmask; |
648 | enum ath9k_int sc_imask; | 648 | enum ath9k_int sc_imask; |
649 | enum wireless_mode sc_curmode; | ||
650 | enum PROT_MODE sc_protmode; | 649 | enum PROT_MODE sc_protmode; |
651 | 650 | ||
652 | u8 sc_nbcnvaps; | 651 | u8 sc_nbcnvaps; |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 26c47577e183..ade92d518d52 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -60,7 +60,8 @@ static void bus_read_cachesize(struct ath_softc *sc, int *csz) | |||
60 | 60 | ||
61 | static void ath_setcurmode(struct ath_softc *sc, enum wireless_mode mode) | 61 | static void ath_setcurmode(struct ath_softc *sc, enum wireless_mode mode) |
62 | { | 62 | { |
63 | sc->sc_curmode = mode; | 63 | if (!sc->sc_curaid) |
64 | sc->cur_rate_table = sc->hw_rate_table[mode]; | ||
64 | /* | 65 | /* |
65 | * All protection frames are transmited at 2Mb/s for | 66 | * All protection frames are transmited at 2Mb/s for |
66 | * 11g, otherwise at 1Mb/s. | 67 | * 11g, otherwise at 1Mb/s. |
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index 8eec66756c75..0ae5988e0b65 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -874,9 +874,8 @@ static void ath_rc_ratefind(struct ath_softc *sc, | |||
874 | * So, set fourth rate in series to be same as third one for | 874 | * So, set fourth rate in series to be same as third one for |
875 | * above conditions. | 875 | * above conditions. |
876 | */ | 876 | */ |
877 | if ((sc->sc_curmode == ATH9K_MODE_11NG_HT20) || | 877 | if ((sc->hw->conf.channel->band == IEEE80211_BAND_2GHZ) && |
878 | (sc->sc_curmode == ATH9K_MODE_11NG_HT40PLUS) || | 878 | (sc->hw->conf.ht.enabled)) { |
879 | (sc->sc_curmode == ATH9K_MODE_11NG_HT40MINUS)) { | ||
880 | u8 dot11rate = rate_table->info[rix].dot11rate; | 879 | u8 dot11rate = rate_table->info[rix].dot11rate; |
881 | u8 phy = rate_table->info[rix].phy; | 880 | u8 phy = rate_table->info[rix].phy; |
882 | if (i == 4 && | 881 | if (i == 4 && |
@@ -1354,8 +1353,8 @@ static void ath_rc_init(struct ath_softc *sc, | |||
1354 | sta->ht_cap.ht_supported, | 1353 | sta->ht_cap.ht_supported, |
1355 | is_cw_40); | 1354 | is_cw_40); |
1356 | } else if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) { | 1355 | } else if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) { |
1357 | /* sc_curmode would be set on init through config() */ | 1356 | /* cur_rate_table would be set on init through config() */ |
1358 | rate_table = sc->hw_rate_table[sc->sc_curmode]; | 1357 | rate_table = sc->cur_rate_table; |
1359 | } | 1358 | } |
1360 | 1359 | ||
1361 | if (!rate_table) { | 1360 | if (!rate_table) { |
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 7a455468823b..b182ef570f88 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -148,7 +148,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds, | |||
148 | struct ieee80211_rx_status *rx_status, bool *decrypt_error, | 148 | struct ieee80211_rx_status *rx_status, bool *decrypt_error, |
149 | struct ath_softc *sc) | 149 | struct ath_softc *sc) |
150 | { | 150 | { |
151 | struct ath_rate_table *rate_table = sc->hw_rate_table[sc->sc_curmode]; | 151 | struct ath_rate_table *rate_table = sc->cur_rate_table; |
152 | struct ieee80211_hdr *hdr; | 152 | struct ieee80211_hdr *hdr; |
153 | int ratekbps, rix; | 153 | int ratekbps, rix; |
154 | u8 ratecode; | 154 | u8 ratecode; |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 9de27c681b86..353b7ed1c8a4 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -493,7 +493,7 @@ static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, | |||
493 | static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, | 493 | static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, |
494 | int width, int half_gi, bool shortPreamble) | 494 | int width, int half_gi, bool shortPreamble) |
495 | { | 495 | { |
496 | struct ath_rate_table *rate_table = sc->hw_rate_table[sc->sc_curmode]; | 496 | struct ath_rate_table *rate_table = sc->cur_rate_table; |
497 | u32 nbits, nsymbits, duration, nsymbols; | 497 | u32 nbits, nsymbits, duration, nsymbols; |
498 | u8 rc; | 498 | u8 rc; |
499 | int streams, pktlen; | 499 | int streams, pktlen; |
@@ -557,7 +557,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
557 | } | 557 | } |
558 | 558 | ||
559 | /* get the cix for the lowest valid rix */ | 559 | /* get the cix for the lowest valid rix */ |
560 | rt = sc->hw_rate_table[sc->sc_curmode]; | 560 | rt = sc->cur_rate_table; |
561 | for (i = 3; i >= 0; i--) { | 561 | for (i = 3; i >= 0; i--) { |
562 | if (rates[i].count && (rates[i].idx >= 0)) { | 562 | if (rates[i].count && (rates[i].idx >= 0)) { |
563 | rix = rates[i].idx; | 563 | rix = rates[i].idx; |
@@ -1240,7 +1240,7 @@ static u32 ath_lookup_rate(struct ath_softc *sc, | |||
1240 | struct ath_buf *bf, | 1240 | struct ath_buf *bf, |
1241 | struct ath_atx_tid *tid) | 1241 | struct ath_atx_tid *tid) |
1242 | { | 1242 | { |
1243 | struct ath_rate_table *rate_table = sc->hw_rate_table[sc->sc_curmode]; | 1243 | struct ath_rate_table *rate_table = sc->cur_rate_table; |
1244 | struct sk_buff *skb; | 1244 | struct sk_buff *skb; |
1245 | struct ieee80211_tx_info *tx_info; | 1245 | struct ieee80211_tx_info *tx_info; |
1246 | struct ieee80211_tx_rate *rates; | 1246 | struct ieee80211_tx_rate *rates; |
@@ -1308,7 +1308,7 @@ static int ath_compute_num_delims(struct ath_softc *sc, | |||
1308 | struct ath_buf *bf, | 1308 | struct ath_buf *bf, |
1309 | u16 frmlen) | 1309 | u16 frmlen) |
1310 | { | 1310 | { |
1311 | struct ath_rate_table *rt = sc->hw_rate_table[sc->sc_curmode]; | 1311 | struct ath_rate_table *rt = sc->cur_rate_table; |
1312 | struct sk_buff *skb = bf->bf_mpdu; | 1312 | struct sk_buff *skb = bf->bf_mpdu; |
1313 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 1313 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1314 | u32 nsymbits, nsymbols, mpdudensity; | 1314 | u32 nsymbits, nsymbols, mpdudensity; |