diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2008-08-11 04:35:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-29 16:24:00 -0400 |
commit | 7c56d24bc80112daadc7ef54247a5fc8397dbc5c (patch) | |
tree | 25fb4a594a76ecb0d4959ed0e3e7611a2663a80e /drivers | |
parent | 672840ac04f79f499b60b9f0eb41799c837db4eb (diff) |
ath9k: Use ah_curchan and remove sc_curchan which is redundant
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath9k/core.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 2 |
4 files changed, 12 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c index 9b8258d9efd3..87b4ca525d25 100644 --- a/drivers/net/wireless/ath9k/core.c +++ b/drivers/net/wireless/ath9k/core.c | |||
@@ -322,16 +322,16 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan) | |||
322 | DPRINTF(sc, ATH_DBG_CONFIG, | 322 | DPRINTF(sc, ATH_DBG_CONFIG, |
323 | "%s: %u (%u MHz) -> %u (%u MHz), cflags:%x\n", | 323 | "%s: %u (%u MHz) -> %u (%u MHz), cflags:%x\n", |
324 | __func__, | 324 | __func__, |
325 | ath9k_hw_mhz2ieee(ah, sc->sc_curchan.channel, | 325 | ath9k_hw_mhz2ieee(ah, sc->sc_ah->ah_curchan->channel, |
326 | sc->sc_curchan.channelFlags), | 326 | sc->sc_ah->ah_curchan->channelFlags), |
327 | sc->sc_curchan.channel, | 327 | sc->sc_ah->ah_curchan->channel, |
328 | ath9k_hw_mhz2ieee(ah, hchan->channel, hchan->channelFlags), | 328 | ath9k_hw_mhz2ieee(ah, hchan->channel, hchan->channelFlags), |
329 | hchan->channel, hchan->channelFlags); | 329 | hchan->channel, hchan->channelFlags); |
330 | 330 | ||
331 | ht_macmode = ath_cwm_macmode(sc); | 331 | ht_macmode = ath_cwm_macmode(sc); |
332 | 332 | ||
333 | if (hchan->channel != sc->sc_curchan.channel || | 333 | if (hchan->channel != sc->sc_ah->ah_curchan->channel || |
334 | hchan->channelFlags != sc->sc_curchan.channelFlags || | 334 | hchan->channelFlags != sc->sc_ah->ah_curchan->channelFlags || |
335 | (sc->sc_flags & SC_OP_CHAINMASK_UPDATE) || | 335 | (sc->sc_flags & SC_OP_CHAINMASK_UPDATE) || |
336 | (sc->sc_flags & SC_OP_FULL_RESET)) { | 336 | (sc->sc_flags & SC_OP_FULL_RESET)) { |
337 | int status; | 337 | int status; |
@@ -372,7 +372,6 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan) | |||
372 | } | 372 | } |
373 | spin_unlock_bh(&sc->sc_resetlock); | 373 | spin_unlock_bh(&sc->sc_resetlock); |
374 | 374 | ||
375 | sc->sc_curchan = *hchan; | ||
376 | sc->sc_flags &= ~SC_OP_CHAINMASK_UPDATE; | 375 | sc->sc_flags &= ~SC_OP_CHAINMASK_UPDATE; |
377 | sc->sc_flags &= ~SC_OP_FULL_RESET; | 376 | sc->sc_flags &= ~SC_OP_FULL_RESET; |
378 | 377 | ||
@@ -702,16 +701,15 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan) | |||
702 | * be followed by initialization of the appropriate bits | 701 | * be followed by initialization of the appropriate bits |
703 | * and then setup of the interrupt mask. | 702 | * and then setup of the interrupt mask. |
704 | */ | 703 | */ |
705 | sc->sc_curchan = *initial_chan; | ||
706 | 704 | ||
707 | spin_lock_bh(&sc->sc_resetlock); | 705 | spin_lock_bh(&sc->sc_resetlock); |
708 | if (!ath9k_hw_reset(ah, &sc->sc_curchan, ht_macmode, | 706 | if (!ath9k_hw_reset(ah, initial_chan, ht_macmode, |
709 | sc->sc_tx_chainmask, sc->sc_rx_chainmask, | 707 | sc->sc_tx_chainmask, sc->sc_rx_chainmask, |
710 | sc->sc_ht_extprotspacing, false, &status)) { | 708 | sc->sc_ht_extprotspacing, false, &status)) { |
711 | DPRINTF(sc, ATH_DBG_FATAL, | 709 | DPRINTF(sc, ATH_DBG_FATAL, |
712 | "%s: unable to reset hardware; hal status %u " | 710 | "%s: unable to reset hardware; hal status %u " |
713 | "(freq %u flags 0x%x)\n", __func__, status, | 711 | "(freq %u flags 0x%x)\n", __func__, status, |
714 | sc->sc_curchan.channel, sc->sc_curchan.channelFlags); | 712 | initial_chan->channel, initial_chan->channelFlags); |
715 | error = -EIO; | 713 | error = -EIO; |
716 | spin_unlock_bh(&sc->sc_resetlock); | 714 | spin_unlock_bh(&sc->sc_resetlock); |
717 | goto done; | 715 | goto done; |
@@ -793,7 +791,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) | |||
793 | 791 | ||
794 | /* Reset chip */ | 792 | /* Reset chip */ |
795 | spin_lock_bh(&sc->sc_resetlock); | 793 | spin_lock_bh(&sc->sc_resetlock); |
796 | if (!ath9k_hw_reset(ah, &sc->sc_curchan, | 794 | if (!ath9k_hw_reset(ah, sc->sc_ah->ah_curchan, |
797 | ht_macmode, | 795 | ht_macmode, |
798 | sc->sc_tx_chainmask, sc->sc_rx_chainmask, | 796 | sc->sc_tx_chainmask, sc->sc_rx_chainmask, |
799 | sc->sc_ht_extprotspacing, false, &status)) { | 797 | sc->sc_ht_extprotspacing, false, &status)) { |
@@ -813,7 +811,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) | |||
813 | * that changes the channel so update any state that | 811 | * that changes the channel so update any state that |
814 | * might change as a result. | 812 | * might change as a result. |
815 | */ | 813 | */ |
816 | ath_setcurmode(sc, ath_chan2mode(&sc->sc_curchan)); | 814 | ath_setcurmode(sc, ath_chan2mode(sc->sc_ah->ah_curchan)); |
817 | 815 | ||
818 | ath_update_txpow(sc); | 816 | ath_update_txpow(sc); |
819 | 817 | ||
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 702f7b8eba59..7f4bd15fa7ef 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -1001,7 +1001,6 @@ struct ath_softc { | |||
1001 | /* Channel, Band */ | 1001 | /* Channel, Band */ |
1002 | struct ieee80211_channel channels[IEEE80211_NUM_BANDS][ATH_CHAN_MAX]; | 1002 | struct ieee80211_channel channels[IEEE80211_NUM_BANDS][ATH_CHAN_MAX]; |
1003 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; | 1003 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; |
1004 | struct ath9k_channel sc_curchan; | ||
1005 | 1004 | ||
1006 | /* Locks */ | 1005 | /* Locks */ |
1007 | spinlock_t sc_rxflushlock; | 1006 | spinlock_t sc_rxflushlock; |
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index 20e10849e934..1392361ef9a6 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -847,9 +847,9 @@ void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp) | |||
847 | /* For half and quarter rate channles use different | 847 | /* For half and quarter rate channles use different |
848 | * rate tables | 848 | * rate tables |
849 | */ | 849 | */ |
850 | if (sc->sc_curchan.channelFlags & CHANNEL_HALF) | 850 | if (sc->sc_ah->ah_curchan->channelFlags & CHANNEL_HALF) |
851 | ar5416_sethalf_ratetable(asc); | 851 | ar5416_sethalf_ratetable(asc); |
852 | else if (sc->sc_curchan.channelFlags & CHANNEL_QUARTER) | 852 | else if (sc->sc_ah->ah_curchan->channelFlags & CHANNEL_QUARTER) |
853 | ar5416_setquarter_ratetable(asc); | 853 | ar5416_setquarter_ratetable(asc); |
854 | else /* full rate */ | 854 | else /* full rate */ |
855 | ar5416_setfull_ratetable(asc); | 855 | ar5416_setfull_ratetable(asc); |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 75a84924b4dc..9ea5d9333305 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -1456,7 +1456,7 @@ static void ath_drain_txdataq(struct ath_softc *sc, bool retry_tx) | |||
1456 | 1456 | ||
1457 | spin_lock_bh(&sc->sc_resetlock); | 1457 | spin_lock_bh(&sc->sc_resetlock); |
1458 | if (!ath9k_hw_reset(ah, | 1458 | if (!ath9k_hw_reset(ah, |
1459 | &sc->sc_curchan, ht_macmode, | 1459 | sc->sc_ah->ah_curchan, ht_macmode, |
1460 | sc->sc_tx_chainmask, sc->sc_rx_chainmask, | 1460 | sc->sc_tx_chainmask, sc->sc_rx_chainmask, |
1461 | sc->sc_ht_extprotspacing, true, &status)) { | 1461 | sc->sc_ht_extprotspacing, true, &status)) { |
1462 | 1462 | ||