Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203706
b: refs/heads/master
c: 5faaff7
h: refs/heads/master
v: v3
  • Loading branch information
Bob Copeland authored and John W. Linville committed Jul 14, 2010
1 parent d0caf98 commit 092a13b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 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: da5747eb89eb1511dcfc1d8b32c70370616eac92
refs/heads/master: 5faaff747710dfb79d5aa72b9faface94ad4b3f3
38 changes: 21 additions & 17 deletions trunk/drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ static int ath5k_init(struct ath5k_softc *sc);
static int ath5k_stop_locked(struct ath5k_softc *sc);
static int ath5k_stop_hw(struct ath5k_softc *sc);
static irqreturn_t ath5k_intr(int irq, void *dev_id);
static void ath5k_tasklet_reset(unsigned long data);
static void ath5k_reset_work(struct work_struct *work);

static void ath5k_tasklet_calibrate(unsigned long data);

Expand Down Expand Up @@ -831,11 +831,12 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)

tasklet_init(&sc->rxtq, ath5k_tasklet_rx, (unsigned long)sc);
tasklet_init(&sc->txtq, ath5k_tasklet_tx, (unsigned long)sc);
tasklet_init(&sc->restq, ath5k_tasklet_reset, (unsigned long)sc);
tasklet_init(&sc->calib, ath5k_tasklet_calibrate, (unsigned long)sc);
tasklet_init(&sc->beacontq, ath5k_tasklet_beacon, (unsigned long)sc);
tasklet_init(&sc->ani_tasklet, ath5k_tasklet_ani, (unsigned long)sc);

INIT_WORK(&sc->reset_work, ath5k_reset_work);

ret = ath5k_eeprom_read_mac(ah, mac);
if (ret) {
ATH5K_ERR(sc, "unable to read address from EEPROM: 0x%04x\n",
Expand Down Expand Up @@ -2294,8 +2295,8 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
* frame contents are done as needed and the slot time is
* also adjusted based on current state.
*
* This is called from software irq context (beacontq or restq
* tasklets) or user context from ath5k_beacon_config.
* This is called from software irq context (beacontq tasklets)
* or user context from ath5k_beacon_config.
*/
static void
ath5k_beacon_send(struct ath5k_softc *sc)
Expand Down Expand Up @@ -2328,7 +2329,7 @@ ath5k_beacon_send(struct ath5k_softc *sc)
sc->bmisscount);
ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
"stuck beacon, resetting\n");
tasklet_schedule(&sc->restq);
ieee80211_queue_work(sc->hw, &sc->reset_work);
}
return;
}
Expand Down Expand Up @@ -2684,7 +2685,6 @@ ath5k_stop_hw(struct ath5k_softc *sc)

tasklet_kill(&sc->rxtq);
tasklet_kill(&sc->txtq);
tasklet_kill(&sc->restq);
tasklet_kill(&sc->calib);
tasklet_kill(&sc->beacontq);
tasklet_kill(&sc->ani_tasklet);
Expand Down Expand Up @@ -2737,7 +2737,7 @@ ath5k_intr(int irq, void *dev_id)
*/
ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
"fatal int, resetting\n");
tasklet_schedule(&sc->restq);
ieee80211_queue_work(sc->hw, &sc->reset_work);
} else if (unlikely(status & AR5K_INT_RXORN)) {
/*
* Receive buffers are full. Either the bus is busy or
Expand All @@ -2752,7 +2752,7 @@ ath5k_intr(int irq, void *dev_id)
if (ah->ah_mac_srev < AR5K_SREV_AR5212) {
ATH5K_DBG(sc, ATH5K_DEBUG_RESET,
"rx overrun, resetting\n");
tasklet_schedule(&sc->restq);
ieee80211_queue_work(sc->hw, &sc->reset_work);
}
else
tasklet_schedule(&sc->rxtq);
Expand Down Expand Up @@ -2799,14 +2799,6 @@ ath5k_intr(int irq, void *dev_id)
return IRQ_HANDLED;
}

static void
ath5k_tasklet_reset(unsigned long data)
{
struct ath5k_softc *sc = (void *)data;

ath5k_reset(sc, sc->curchan);
}

/*
* Periodically recalibrate the PHY to account
* for temperature/environment changes.
Expand All @@ -2830,7 +2822,7 @@ ath5k_tasklet_calibrate(unsigned long data)
* to load new gain values.
*/
ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "calibration, resetting\n");
ath5k_reset(sc, sc->curchan);
ieee80211_queue_work(sc->hw, &sc->reset_work);
}
if (ath5k_hw_phy_calibrate(ah, sc->curchan))
ATH5K_ERR(sc, "calibration of channel %u failed\n",
Expand Down Expand Up @@ -2934,6 +2926,8 @@ static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
/*
* Reset the hardware. If chan is not NULL, then also pause rx/tx
* and change to the given channel.
*
* This should be called with sc->lock.
*/
static int
ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
Expand Down Expand Up @@ -2990,6 +2984,16 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
return ret;
}

static void ath5k_reset_work(struct work_struct *work)
{
struct ath5k_softc *sc = container_of(work, struct ath5k_softc,
reset_work);

mutex_lock(&sc->lock);
ath5k_reset(sc, sc->curchan);
mutex_unlock(&sc->lock);
}

static int ath5k_start(struct ieee80211_hw *hw)
{
return ath5k_init(hw->priv);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath5k/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/if_ether.h>
#include <linux/leds.h>
#include <linux/rfkill.h>
#include <linux/workqueue.h>

#include "ath5k.h"
#include "debug.h"
Expand Down Expand Up @@ -189,7 +190,7 @@ struct ath5k_softc {
unsigned int led_pin, /* GPIO pin for driving LED */
led_on; /* pin setting for LED on */

struct tasklet_struct restq; /* reset tasklet */
struct work_struct reset_work; /* deferred chip reset */

unsigned int rxbufsize; /* rx size based on mtu */
struct list_head rxbuf; /* receive buffer */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath5k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static ssize_t write_file_reset(struct file *file,
{
struct ath5k_softc *sc = file->private_data;
ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "debug file triggered reset\n");
tasklet_schedule(&sc->restq);
ieee80211_queue_work(sc->hw, &sc->reset_work);
return count;
}

Expand Down

0 comments on commit 092a13b

Please sign in to comment.