diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-09-14 00:07:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:29 -0400 |
commit | 43c2761364b77cd7fd20eb1f14cfee4cd1462abd (patch) | |
tree | 5f8759ab901fb94cf790805b816e7f7af53657ed /drivers/net/wireless/ath | |
parent | c46917bb53a546f60c7d3103407fe953c418dd5b (diff) |
atheros: move tx/rx chainmask to ath_common
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 3 |
6 files changed, 30 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index 2ca9701181e..38ca68ee09c 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h | |||
@@ -56,6 +56,9 @@ struct ath_common { | |||
56 | u8 curbssid[ETH_ALEN]; | 56 | u8 curbssid[ETH_ALEN]; |
57 | u8 bssidmask[ETH_ALEN]; | 57 | u8 bssidmask[ETH_ALEN]; |
58 | 58 | ||
59 | u8 tx_chainmask; | ||
60 | u8 rx_chainmask; | ||
61 | |||
59 | struct ath_regulatory regulatory; | 62 | struct ath_regulatory regulatory; |
60 | const struct ath_ops *ops; | 63 | const struct ath_ops *ops; |
61 | }; | 64 | }; |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 9864461ecb5..46d19e863d3 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -586,8 +586,6 @@ struct ath_softc { | |||
586 | u16 curtxpow; | 586 | u16 curtxpow; |
587 | u8 nbcnvifs; | 587 | u8 nbcnvifs; |
588 | u16 nvifs; | 588 | u16 nvifs; |
589 | u8 tx_chainmask; | ||
590 | u8 rx_chainmask; | ||
591 | u32 keymax; | 589 | u32 keymax; |
592 | DECLARE_BITMAP(keymap, ATH_KEYMAX); | 590 | DECLARE_BITMAP(keymap, ATH_KEYMAX); |
593 | u8 splitmic; | 591 | u8 splitmic; |
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 2f003132463..54be876639a 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -62,6 +62,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, | |||
62 | { | 62 | { |
63 | struct sk_buff *skb = bf->bf_mpdu; | 63 | struct sk_buff *skb = bf->bf_mpdu; |
64 | struct ath_hw *ah = sc->sc_ah; | 64 | struct ath_hw *ah = sc->sc_ah; |
65 | struct ath_common *common = ath9k_hw_common(ah); | ||
65 | struct ath_desc *ds; | 66 | struct ath_desc *ds; |
66 | struct ath9k_11n_rate_series series[4]; | 67 | struct ath9k_11n_rate_series series[4]; |
67 | const struct ath_rate_table *rt; | 68 | const struct ath_rate_table *rt; |
@@ -109,7 +110,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, | |||
109 | memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); | 110 | memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); |
110 | series[0].Tries = 1; | 111 | series[0].Tries = 1; |
111 | series[0].Rate = rate; | 112 | series[0].Rate = rate; |
112 | series[0].ChSel = sc->tx_chainmask; | 113 | series[0].ChSel = common->tx_chainmask; |
113 | series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0; | 114 | series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0; |
114 | ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration, | 115 | ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration, |
115 | series, 4, 0); | 116 | series, 4, 0); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 8ecd1b0bdf8..edf91d0fbb1 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -2334,8 +2334,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
2334 | int i, rx_chainmask, r; | 2334 | int i, rx_chainmask, r; |
2335 | 2335 | ||
2336 | ah->extprotspacing = sc->ht_extprotspacing; | 2336 | ah->extprotspacing = sc->ht_extprotspacing; |
2337 | ah->txchainmask = sc->tx_chainmask; | 2337 | ah->txchainmask = common->tx_chainmask; |
2338 | ah->rxchainmask = sc->rx_chainmask; | 2338 | ah->rxchainmask = common->rx_chainmask; |
2339 | 2339 | ||
2340 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) | 2340 | if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) |
2341 | return -EIO; | 2341 | return -EIO; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index f409bbc3053..7906b796dea 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -438,8 +438,11 @@ static void ath_ani_calibrate(unsigned long data) | |||
438 | 438 | ||
439 | /* Perform calibration if necessary */ | 439 | /* Perform calibration if necessary */ |
440 | if (longcal || shortcal) { | 440 | if (longcal || shortcal) { |
441 | sc->ani.caldone = ath9k_hw_calibrate(ah, ah->curchan, | 441 | sc->ani.caldone = |
442 | sc->rx_chainmask, longcal); | 442 | ath9k_hw_calibrate(ah, |
443 | ah->curchan, | ||
444 | common->rx_chainmask, | ||
445 | longcal); | ||
443 | 446 | ||
444 | if (longcal) | 447 | if (longcal) |
445 | sc->ani.noise_floor = ath9k_hw_getchan_noise(ah, | 448 | sc->ani.noise_floor = ath9k_hw_getchan_noise(ah, |
@@ -492,19 +495,21 @@ static void ath_start_ani(struct ath_softc *sc) | |||
492 | void ath_update_chainmask(struct ath_softc *sc, int is_ht) | 495 | void ath_update_chainmask(struct ath_softc *sc, int is_ht) |
493 | { | 496 | { |
494 | struct ath_hw *ah = sc->sc_ah; | 497 | struct ath_hw *ah = sc->sc_ah; |
498 | struct ath_common *common = ath9k_hw_common(ah); | ||
495 | 499 | ||
496 | if ((sc->sc_flags & SC_OP_SCANNING) || is_ht || | 500 | if ((sc->sc_flags & SC_OP_SCANNING) || is_ht || |
497 | (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE)) { | 501 | (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE)) { |
498 | sc->tx_chainmask = sc->sc_ah->caps.tx_chainmask; | 502 | common->tx_chainmask = ah->caps.tx_chainmask; |
499 | sc->rx_chainmask = sc->sc_ah->caps.rx_chainmask; | 503 | common->rx_chainmask = ah->caps.rx_chainmask; |
500 | } else { | 504 | } else { |
501 | sc->tx_chainmask = 1; | 505 | common->tx_chainmask = 1; |
502 | sc->rx_chainmask = 1; | 506 | common->rx_chainmask = 1; |
503 | } | 507 | } |
504 | 508 | ||
505 | ath_print(ath9k_hw_common(ah), ATH_DBG_CONFIG, | 509 | ath_print(common, ATH_DBG_CONFIG, |
506 | "tx chmask: %d, rx chmask: %d\n", | 510 | "tx chmask: %d, rx chmask: %d\n", |
507 | sc->tx_chainmask, sc->rx_chainmask); | 511 | common->tx_chainmask, |
512 | common->rx_chainmask); | ||
508 | } | 513 | } |
509 | 514 | ||
510 | static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta) | 515 | static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta) |
@@ -949,6 +954,7 @@ static void ath_key_delete(struct ath_softc *sc, struct ieee80211_key_conf *key) | |||
949 | static void setup_ht_cap(struct ath_softc *sc, | 954 | static void setup_ht_cap(struct ath_softc *sc, |
950 | struct ieee80211_sta_ht_cap *ht_info) | 955 | struct ieee80211_sta_ht_cap *ht_info) |
951 | { | 956 | { |
957 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
952 | u8 tx_streams, rx_streams; | 958 | u8 tx_streams, rx_streams; |
953 | 959 | ||
954 | ht_info->ht_supported = true; | 960 | ht_info->ht_supported = true; |
@@ -962,11 +968,13 @@ static void setup_ht_cap(struct ath_softc *sc, | |||
962 | 968 | ||
963 | /* set up supported mcs set */ | 969 | /* set up supported mcs set */ |
964 | memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); | 970 | memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); |
965 | tx_streams = !(sc->tx_chainmask & (sc->tx_chainmask - 1)) ? 1 : 2; | 971 | tx_streams = !(common->tx_chainmask & (common->tx_chainmask - 1)) ? |
966 | rx_streams = !(sc->rx_chainmask & (sc->rx_chainmask - 1)) ? 1 : 2; | 972 | 1 : 2; |
973 | rx_streams = !(common->rx_chainmask & (common->rx_chainmask - 1)) ? | ||
974 | 1 : 2; | ||
967 | 975 | ||
968 | if (tx_streams != rx_streams) { | 976 | if (tx_streams != rx_streams) { |
969 | ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG, | 977 | ath_print(common, ATH_DBG_CONFIG, |
970 | "TX streams %d, RX streams: %d\n", | 978 | "TX streams %d, RX streams: %d\n", |
971 | tx_streams, rx_streams); | 979 | tx_streams, rx_streams); |
972 | ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; | 980 | ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; |
@@ -1759,8 +1767,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid) | |||
1759 | sc->sc_flags |= SC_OP_RXAGGR; | 1767 | sc->sc_flags |= SC_OP_RXAGGR; |
1760 | } | 1768 | } |
1761 | 1769 | ||
1762 | sc->tx_chainmask = ah->caps.tx_chainmask; | 1770 | common->tx_chainmask = ah->caps.tx_chainmask; |
1763 | sc->rx_chainmask = ah->caps.rx_chainmask; | 1771 | common->rx_chainmask = ah->caps.rx_chainmask; |
1764 | 1772 | ||
1765 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); | 1773 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); |
1766 | sc->rx.defant = ath9k_hw_getdefantenna(ah); | 1774 | sc->rx.defant = ath9k_hw_getdefantenna(ah); |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 36650505d2f..f302652af39 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1456,6 +1456,7 @@ static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf, | |||
1456 | 1456 | ||
1457 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | 1457 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) |
1458 | { | 1458 | { |
1459 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
1459 | const struct ath_rate_table *rt = sc->cur_rate_table; | 1460 | const struct ath_rate_table *rt = sc->cur_rate_table; |
1460 | struct ath9k_11n_rate_series series[4]; | 1461 | struct ath9k_11n_rate_series series[4]; |
1461 | struct sk_buff *skb; | 1462 | struct sk_buff *skb; |
@@ -1511,7 +1512,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
1511 | 1512 | ||
1512 | rix = rates[i].idx; | 1513 | rix = rates[i].idx; |
1513 | series[i].Tries = rates[i].count; | 1514 | series[i].Tries = rates[i].count; |
1514 | series[i].ChSel = sc->tx_chainmask; | 1515 | series[i].ChSel = common->tx_chainmask; |
1515 | 1516 | ||
1516 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | 1517 | if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |
1517 | series[i].Rate = rt->info[rix].ratecode | | 1518 | series[i].Rate = rt->info[rix].ratecode | |