Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145020
b: refs/heads/master
c: 209d889
h: refs/heads/master
v: v3
  • Loading branch information
Bob Copeland authored and John W. Linville committed May 11, 2009
1 parent 5a81ec7 commit f1c15eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9be6f0d40d9191e6fe7e45551c7d1c1614472b53
refs/heads/master: 209d889bab3d0812ee9cda4f6bbeb1af8bede9d4
22 changes: 13 additions & 9 deletions trunk/drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static struct pci_driver ath5k_pci_driver = {
* Prototypes - MAC 802.11 stack related functions
*/
static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
static int ath5k_reset(struct ath5k_softc *sc, bool stop, bool change_channel);
static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan);
static int ath5k_reset_wake(struct ath5k_softc *sc);
static int ath5k_start(struct ieee80211_hw *hw);
static void ath5k_stop(struct ieee80211_hw *hw);
Expand Down Expand Up @@ -1038,16 +1038,13 @@ ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan)
if (chan->center_freq != sc->curchan->center_freq ||
chan->hw_value != sc->curchan->hw_value) {

sc->curchan = chan;
sc->curband = &sc->sbands[chan->band];

/*
* To switch channels clear any pending DMA operations;
* wait long enough for the RX fifo to drain, reset the
* hardware at the new frequency, and then re-enable
* the relevant bits of the h/w.
*/
return ath5k_reset(sc, true, true);
return ath5k_reset(sc, chan);
}

return 0;
Expand Down Expand Up @@ -2314,7 +2311,7 @@ ath5k_init(struct ath5k_softc *sc)
sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL |
AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL |
AR5K_INT_FATAL | AR5K_INT_GLOBAL;
ret = ath5k_reset(sc, false, false);
ret = ath5k_reset(sc, NULL);
if (ret)
goto done;

Expand Down Expand Up @@ -2599,18 +2596,25 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
return NETDEV_TX_OK;
}

/*
* Reset the hardware. If chan is not NULL, then also pause rx/tx
* and change to the given channel.
*/
static int
ath5k_reset(struct ath5k_softc *sc, bool stop, bool change_channel)
ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
{
struct ath5k_hw *ah = sc->ah;
int ret;

ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n");

if (stop) {
if (chan) {
ath5k_hw_set_imr(ah, 0);
ath5k_txq_cleanup(sc);
ath5k_rx_stop(sc);

sc->curchan = chan;
sc->curband = &sc->sbands[chan->band];
}
ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, true);
if (ret) {
Expand Down Expand Up @@ -2648,7 +2652,7 @@ ath5k_reset_wake(struct ath5k_softc *sc)
{
int ret;

ret = ath5k_reset(sc, true, true);
ret = ath5k_reset(sc, sc->curchan);
if (!ret)
ieee80211_wake_queues(sc->hw);

Expand Down

0 comments on commit f1c15eb

Please sign in to comment.