aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-06-02 06:23:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-04 16:00:39 -0400
commitea46e644e80bd4ac778964afd998df4f666486d4 (patch)
treebefc63362be057a89ce2db1db08828e3958dff74
parent29d9075e1c577cb9affd7859c87e41f12ae270f2 (diff)
ath9k_htc: Setup 5GHz channels
AR7010 is dual-band. Setup the channels and rateset for 5GHz band. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c55
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c3
2 files changed, 56 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index acd9cb934311..cda30410d5ee 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -34,6 +34,13 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
34 .max_power = 20, \ 34 .max_power = 20, \
35} 35}
36 36
37#define CHAN5G(_freq, _idx) { \
38 .band = IEEE80211_BAND_5GHZ, \
39 .center_freq = (_freq), \
40 .hw_value = (_idx), \
41 .max_power = 20, \
42}
43
37static struct ieee80211_channel ath9k_2ghz_channels[] = { 44static struct ieee80211_channel ath9k_2ghz_channels[] = {
38 CHAN2G(2412, 0), /* Channel 1 */ 45 CHAN2G(2412, 0), /* Channel 1 */
39 CHAN2G(2417, 1), /* Channel 2 */ 46 CHAN2G(2417, 1), /* Channel 2 */
@@ -51,6 +58,37 @@ static struct ieee80211_channel ath9k_2ghz_channels[] = {
51 CHAN2G(2484, 13), /* Channel 14 */ 58 CHAN2G(2484, 13), /* Channel 14 */
52}; 59};
53 60
61static struct ieee80211_channel ath9k_5ghz_channels[] = {
62 /* _We_ call this UNII 1 */
63 CHAN5G(5180, 14), /* Channel 36 */
64 CHAN5G(5200, 15), /* Channel 40 */
65 CHAN5G(5220, 16), /* Channel 44 */
66 CHAN5G(5240, 17), /* Channel 48 */
67 /* _We_ call this UNII 2 */
68 CHAN5G(5260, 18), /* Channel 52 */
69 CHAN5G(5280, 19), /* Channel 56 */
70 CHAN5G(5300, 20), /* Channel 60 */
71 CHAN5G(5320, 21), /* Channel 64 */
72 /* _We_ call this "Middle band" */
73 CHAN5G(5500, 22), /* Channel 100 */
74 CHAN5G(5520, 23), /* Channel 104 */
75 CHAN5G(5540, 24), /* Channel 108 */
76 CHAN5G(5560, 25), /* Channel 112 */
77 CHAN5G(5580, 26), /* Channel 116 */
78 CHAN5G(5600, 27), /* Channel 120 */
79 CHAN5G(5620, 28), /* Channel 124 */
80 CHAN5G(5640, 29), /* Channel 128 */
81 CHAN5G(5660, 30), /* Channel 132 */
82 CHAN5G(5680, 31), /* Channel 136 */
83 CHAN5G(5700, 32), /* Channel 140 */
84 /* _We_ call this UNII 3 */
85 CHAN5G(5745, 33), /* Channel 149 */
86 CHAN5G(5765, 34), /* Channel 153 */
87 CHAN5G(5785, 35), /* Channel 157 */
88 CHAN5G(5805, 36), /* Channel 161 */
89 CHAN5G(5825, 37), /* Channel 165 */
90};
91
54/* Atheros hardware rate code addition for short premble */ 92/* Atheros hardware rate code addition for short premble */
55#define SHPCHECK(__hw_rate, __flags) \ 93#define SHPCHECK(__hw_rate, __flags) \
56 ((__flags & IEEE80211_RATE_SHORT_PREAMBLE) ? (__hw_rate | 0x04) : 0) 94 ((__flags & IEEE80211_RATE_SHORT_PREAMBLE) ? (__hw_rate | 0x04) : 0)
@@ -552,6 +590,17 @@ static void ath9k_init_channels_rates(struct ath9k_htc_priv *priv)
552 priv->sbands[IEEE80211_BAND_2GHZ].n_bitrates = 590 priv->sbands[IEEE80211_BAND_2GHZ].n_bitrates =
553 ARRAY_SIZE(ath9k_legacy_rates); 591 ARRAY_SIZE(ath9k_legacy_rates);
554 } 592 }
593
594 if (test_bit(ATH9K_MODE_11A, priv->ah->caps.wireless_modes)) {
595 priv->sbands[IEEE80211_BAND_5GHZ].channels = ath9k_5ghz_channels;
596 priv->sbands[IEEE80211_BAND_5GHZ].band = IEEE80211_BAND_5GHZ;
597 priv->sbands[IEEE80211_BAND_5GHZ].n_channels =
598 ARRAY_SIZE(ath9k_5ghz_channels);
599 priv->sbands[IEEE80211_BAND_5GHZ].bitrates =
600 ath9k_legacy_rates + 4;
601 priv->sbands[IEEE80211_BAND_5GHZ].n_bitrates =
602 ARRAY_SIZE(ath9k_legacy_rates) - 4;
603 }
555} 604}
556 605
557static void ath9k_init_misc(struct ath9k_htc_priv *priv) 606static void ath9k_init_misc(struct ath9k_htc_priv *priv)
@@ -683,11 +732,17 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,
683 if (test_bit(ATH9K_MODE_11G, priv->ah->caps.wireless_modes)) 732 if (test_bit(ATH9K_MODE_11G, priv->ah->caps.wireless_modes))
684 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 733 hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
685 &priv->sbands[IEEE80211_BAND_2GHZ]; 734 &priv->sbands[IEEE80211_BAND_2GHZ];
735 if (test_bit(ATH9K_MODE_11A, priv->ah->caps.wireless_modes))
736 hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
737 &priv->sbands[IEEE80211_BAND_5GHZ];
686 738
687 if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_HT) { 739 if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
688 if (test_bit(ATH9K_MODE_11G, priv->ah->caps.wireless_modes)) 740 if (test_bit(ATH9K_MODE_11G, priv->ah->caps.wireless_modes))
689 setup_ht_cap(priv, 741 setup_ht_cap(priv,
690 &priv->sbands[IEEE80211_BAND_2GHZ].ht_cap); 742 &priv->sbands[IEEE80211_BAND_2GHZ].ht_cap);
743 if (test_bit(ATH9K_MODE_11A, priv->ah->caps.wireless_modes))
744 setup_ht_cap(priv,
745 &priv->sbands[IEEE80211_BAND_5GHZ].ht_cap);
691 } 746 }
692 747
693 SET_IEEE80211_PERM_ADDR(hw, common->macaddr); 748 SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index b7ce902f2453..7aefbc638770 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -343,8 +343,7 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
343 u32 caps = 0; 343 u32 caps = 0;
344 int i, j; 344 int i, j;
345 345
346 /* Only 2GHz is supported */ 346 sband = priv->hw->wiphy->bands[priv->hw->conf.channel->band];
347 sband = priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ];
348 347
349 for (i = 0, j = 0; i < sband->n_bitrates; i++) { 348 for (i = 0, j = 0; i < sband->n_bitrates; i++) {
350 if (sta->supp_rates[sband->band] & BIT(i)) { 349 if (sta->supp_rates[sband->band] & BIT(i)) {