Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135110
b: refs/heads/master
c: 7ec3e51
h: refs/heads/master
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Mar 5, 2009
1 parent 3726a9f commit 40ac745
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 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: ee166a0e71947e0ebeb044fd2277435f665270ac
refs/heads/master: 7ec3e514d9361596cbd8aa71ce41d6e5b0220103
4 changes: 4 additions & 0 deletions trunk/drivers/net/wireless/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ struct ath_softc {
int chan_is_ht;
struct ath_wiphy *next_wiphy;
struct work_struct chan_work;
int wiphy_select_failures;
unsigned long wiphy_select_first_fail;

struct tasklet_struct intr_tq;
struct tasklet_struct bcon_tasklet;
Expand Down Expand Up @@ -665,6 +667,8 @@ void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
void ath_update_chainmask(struct ath_softc *sc, int is_ht);
int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
struct ath9k_channel *hchan);
void ath_radio_enable(struct ath_softc *sc);
void ath_radio_disable(struct ath_softc *sc);

#ifdef CONFIG_PCI
int ath_pci_init(void);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ static void ath_init_leds(struct ath_softc *sc)
/* Rfkill */
/*******************/

static void ath_radio_enable(struct ath_softc *sc)
void ath_radio_enable(struct ath_softc *sc)
{
struct ath_hw *ah = sc->sc_ah;
struct ieee80211_channel *channel = sc->hw->conf.channel;
Expand Down Expand Up @@ -1131,7 +1131,7 @@ static void ath_radio_enable(struct ath_softc *sc)
ath9k_ps_restore(sc);
}

static void ath_radio_disable(struct ath_softc *sc)
void ath_radio_disable(struct ath_softc *sc)
{
struct ath_hw *ah = sc->sc_ah;
struct ieee80211_channel *channel = sc->hw->conf.channel;
Expand Down
37 changes: 37 additions & 0 deletions trunk/drivers/net/wireless/ath9k/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,18 @@ int ath9k_wiphy_unpause(struct ath_wiphy *aphy)
return ret;
}

static void __ath9k_wiphy_mark_all_paused(struct ath_softc *sc)
{
int i;
if (sc->pri_wiphy->state != ATH_WIPHY_INACTIVE)
sc->pri_wiphy->state = ATH_WIPHY_PAUSED;
for (i = 0; i < sc->num_sec_wiphy; i++) {
if (sc->sec_wiphy[i] &&
sc->sec_wiphy[i]->state != ATH_WIPHY_INACTIVE)
sc->sec_wiphy[i]->state = ATH_WIPHY_PAUSED;
}
}

/* caller must hold wiphy_lock */
static void __ath9k_wiphy_pause_all(struct ath_softc *sc)
{
Expand All @@ -452,9 +464,34 @@ int ath9k_wiphy_select(struct ath_wiphy *aphy)

spin_lock_bh(&sc->wiphy_lock);
if (__ath9k_wiphy_pausing(sc)) {
if (sc->wiphy_select_failures == 0)
sc->wiphy_select_first_fail = jiffies;
sc->wiphy_select_failures++;
if (time_after(jiffies, sc->wiphy_select_first_fail + HZ / 2))
{
printk(KERN_DEBUG "ath9k: Previous wiphy select timed "
"out; disable/enable hw to recover\n");
__ath9k_wiphy_mark_all_paused(sc);
/*
* TODO: this workaround to fix hardware is unlikely to
* be specific to virtual wiphy changes. It can happen
* on normal channel change, too, and as such, this
* should really be made more generic. For example,
* tricker radio disable/enable on GTT interrupt burst
* (say, 10 GTT interrupts received without any TX
* frame being completed)
*/
spin_unlock_bh(&sc->wiphy_lock);
ath_radio_disable(sc);
ath_radio_enable(sc);
queue_work(aphy->sc->hw->workqueue,
&aphy->sc->chan_work);
return -EBUSY; /* previous select still in progress */
}
spin_unlock_bh(&sc->wiphy_lock);
return -EBUSY; /* previous select still in progress */
}
sc->wiphy_select_failures = 0;

/* Store the new channel */
sc->chan_idx = aphy->chan_idx;
Expand Down

0 comments on commit 40ac745

Please sign in to comment.