提交 7c56d24b 编写于 作者: S Sujith 提交者: John W. Linville

ath9k: Use ah_curchan and remove sc_curchan which is redundant

Signed-off-by: NSujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 672840ac
...@@ -322,16 +322,16 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan) ...@@ -322,16 +322,16 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
DPRINTF(sc, ATH_DBG_CONFIG, DPRINTF(sc, ATH_DBG_CONFIG,
"%s: %u (%u MHz) -> %u (%u MHz), cflags:%x\n", "%s: %u (%u MHz) -> %u (%u MHz), cflags:%x\n",
__func__, __func__,
ath9k_hw_mhz2ieee(ah, sc->sc_curchan.channel, ath9k_hw_mhz2ieee(ah, sc->sc_ah->ah_curchan->channel,
sc->sc_curchan.channelFlags), sc->sc_ah->ah_curchan->channelFlags),
sc->sc_curchan.channel, sc->sc_ah->ah_curchan->channel,
ath9k_hw_mhz2ieee(ah, hchan->channel, hchan->channelFlags), ath9k_hw_mhz2ieee(ah, hchan->channel, hchan->channelFlags),
hchan->channel, hchan->channelFlags); hchan->channel, hchan->channelFlags);
ht_macmode = ath_cwm_macmode(sc); ht_macmode = ath_cwm_macmode(sc);
if (hchan->channel != sc->sc_curchan.channel || if (hchan->channel != sc->sc_ah->ah_curchan->channel ||
hchan->channelFlags != sc->sc_curchan.channelFlags || hchan->channelFlags != sc->sc_ah->ah_curchan->channelFlags ||
(sc->sc_flags & SC_OP_CHAINMASK_UPDATE) || (sc->sc_flags & SC_OP_CHAINMASK_UPDATE) ||
(sc->sc_flags & SC_OP_FULL_RESET)) { (sc->sc_flags & SC_OP_FULL_RESET)) {
int status; int status;
...@@ -372,7 +372,6 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan) ...@@ -372,7 +372,6 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
} }
spin_unlock_bh(&sc->sc_resetlock); spin_unlock_bh(&sc->sc_resetlock);
sc->sc_curchan = *hchan;
sc->sc_flags &= ~SC_OP_CHAINMASK_UPDATE; sc->sc_flags &= ~SC_OP_CHAINMASK_UPDATE;
sc->sc_flags &= ~SC_OP_FULL_RESET; sc->sc_flags &= ~SC_OP_FULL_RESET;
...@@ -702,16 +701,15 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan) ...@@ -702,16 +701,15 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)
* be followed by initialization of the appropriate bits * be followed by initialization of the appropriate bits
* and then setup of the interrupt mask. * and then setup of the interrupt mask.
*/ */
sc->sc_curchan = *initial_chan;
spin_lock_bh(&sc->sc_resetlock); spin_lock_bh(&sc->sc_resetlock);
if (!ath9k_hw_reset(ah, &sc->sc_curchan, ht_macmode, if (!ath9k_hw_reset(ah, initial_chan, ht_macmode,
sc->sc_tx_chainmask, sc->sc_rx_chainmask, sc->sc_tx_chainmask, sc->sc_rx_chainmask,
sc->sc_ht_extprotspacing, false, &status)) { sc->sc_ht_extprotspacing, false, &status)) {
DPRINTF(sc, ATH_DBG_FATAL, DPRINTF(sc, ATH_DBG_FATAL,
"%s: unable to reset hardware; hal status %u " "%s: unable to reset hardware; hal status %u "
"(freq %u flags 0x%x)\n", __func__, status, "(freq %u flags 0x%x)\n", __func__, status,
sc->sc_curchan.channel, sc->sc_curchan.channelFlags); initial_chan->channel, initial_chan->channelFlags);
error = -EIO; error = -EIO;
spin_unlock_bh(&sc->sc_resetlock); spin_unlock_bh(&sc->sc_resetlock);
goto done; goto done;
...@@ -793,7 +791,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) ...@@ -793,7 +791,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
/* Reset chip */ /* Reset chip */
spin_lock_bh(&sc->sc_resetlock); spin_lock_bh(&sc->sc_resetlock);
if (!ath9k_hw_reset(ah, &sc->sc_curchan, if (!ath9k_hw_reset(ah, sc->sc_ah->ah_curchan,
ht_macmode, ht_macmode,
sc->sc_tx_chainmask, sc->sc_rx_chainmask, sc->sc_tx_chainmask, sc->sc_rx_chainmask,
sc->sc_ht_extprotspacing, false, &status)) { sc->sc_ht_extprotspacing, false, &status)) {
...@@ -813,7 +811,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) ...@@ -813,7 +811,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
* that changes the channel so update any state that * that changes the channel so update any state that
* might change as a result. * might change as a result.
*/ */
ath_setcurmode(sc, ath_chan2mode(&sc->sc_curchan)); ath_setcurmode(sc, ath_chan2mode(sc->sc_ah->ah_curchan));
ath_update_txpow(sc); ath_update_txpow(sc);
......
...@@ -1001,7 +1001,6 @@ struct ath_softc { ...@@ -1001,7 +1001,6 @@ struct ath_softc {
/* Channel, Band */ /* Channel, Band */
struct ieee80211_channel channels[IEEE80211_NUM_BANDS][ATH_CHAN_MAX]; struct ieee80211_channel channels[IEEE80211_NUM_BANDS][ATH_CHAN_MAX];
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
struct ath9k_channel sc_curchan;
/* Locks */ /* Locks */
spinlock_t sc_rxflushlock; spinlock_t sc_rxflushlock;
......
...@@ -847,9 +847,9 @@ void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp) ...@@ -847,9 +847,9 @@ void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp)
/* For half and quarter rate channles use different /* For half and quarter rate channles use different
* rate tables * rate tables
*/ */
if (sc->sc_curchan.channelFlags & CHANNEL_HALF) if (sc->sc_ah->ah_curchan->channelFlags & CHANNEL_HALF)
ar5416_sethalf_ratetable(asc); ar5416_sethalf_ratetable(asc);
else if (sc->sc_curchan.channelFlags & CHANNEL_QUARTER) else if (sc->sc_ah->ah_curchan->channelFlags & CHANNEL_QUARTER)
ar5416_setquarter_ratetable(asc); ar5416_setquarter_ratetable(asc);
else /* full rate */ else /* full rate */
ar5416_setfull_ratetable(asc); ar5416_setfull_ratetable(asc);
......
...@@ -1456,7 +1456,7 @@ static void ath_drain_txdataq(struct ath_softc *sc, bool retry_tx) ...@@ -1456,7 +1456,7 @@ static void ath_drain_txdataq(struct ath_softc *sc, bool retry_tx)
spin_lock_bh(&sc->sc_resetlock); spin_lock_bh(&sc->sc_resetlock);
if (!ath9k_hw_reset(ah, if (!ath9k_hw_reset(ah,
&sc->sc_curchan, ht_macmode, sc->sc_ah->ah_curchan, ht_macmode,
sc->sc_tx_chainmask, sc->sc_rx_chainmask, sc->sc_tx_chainmask, sc->sc_rx_chainmask,
sc->sc_ht_extprotspacing, true, &status)) { sc->sc_ht_extprotspacing, true, &status)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册