aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2009-06-13 05:20:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-15 15:05:56 -0400
commit82880a7cf9c059c11cd6ad1868c48969956f966b (patch)
treeb17f8870a90cbc7d274bffab0961b4feb0235519 /drivers/net/wireless
parent35edf8aae8f903b154d658b9a7eed0d5c1a4a814 (diff)
ath9k: Add helper to get ath9k specific current channel
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index f7baa406918b..89bf07e66d10 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -231,6 +231,19 @@ static void ath_setup_rates(struct ath_softc *sc, enum ieee80211_band band)
231 } 231 }
232} 232}
233 233
234static struct ath9k_channel *ath_get_curchannel(struct ath_softc *sc,
235 struct ieee80211_hw *hw)
236{
237 struct ieee80211_channel *curchan = hw->conf.channel;
238 struct ath9k_channel *channel;
239 u8 chan_idx;
240
241 chan_idx = curchan->hw_value;
242 channel = &sc->sc_ah->channels[chan_idx];
243 ath9k_update_ichannel(sc, hw, channel);
244 return channel;
245}
246
234/* 247/*
235 * Set/change channels. If the channel is really being changed, it's done 248 * Set/change channels. If the channel is really being changed, it's done
236 * by reseting the chip. To accomplish this we must first cleanup any pending 249 * by reseting the chip. To accomplish this we must first cleanup any pending
@@ -1920,7 +1933,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
1920 struct ath_softc *sc = aphy->sc; 1933 struct ath_softc *sc = aphy->sc;
1921 struct ieee80211_channel *curchan = hw->conf.channel; 1934 struct ieee80211_channel *curchan = hw->conf.channel;
1922 struct ath9k_channel *init_channel; 1935 struct ath9k_channel *init_channel;
1923 int r, pos; 1936 int r;
1924 1937
1925 DPRINTF(sc, ATH_DBG_CONFIG, "Starting driver with " 1938 DPRINTF(sc, ATH_DBG_CONFIG, "Starting driver with "
1926 "initial channel: %d MHz\n", curchan->center_freq); 1939 "initial channel: %d MHz\n", curchan->center_freq);
@@ -1950,11 +1963,9 @@ static int ath9k_start(struct ieee80211_hw *hw)
1950 1963
1951 /* setup initial channel */ 1964 /* setup initial channel */
1952 1965
1953 pos = curchan->hw_value; 1966 sc->chan_idx = curchan->hw_value;
1954 1967
1955 sc->chan_idx = pos; 1968 init_channel = ath_get_curchannel(sc, hw);
1956 init_channel = &sc->sc_ah->channels[pos];
1957 ath9k_update_ichannel(sc, hw, init_channel);
1958 1969
1959 /* Reset SERDES registers */ 1970 /* Reset SERDES registers */
1960 ath9k_hw_configpcipowersave(sc->sc_ah, 0); 1971 ath9k_hw_configpcipowersave(sc->sc_ah, 0);