Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247517
b: refs/heads/master
c: 7dece1c
h: refs/heads/master
i:
  247515: 9077260
v: v3
  • Loading branch information
Arik Nemtsov authored and Luciano Coelho committed May 2, 2011
1 parent 3fa8349 commit 1dd31d5
Show file tree
Hide file tree
Showing 4 changed files with 23 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: 2dc5a5c2c656b9029a0e635bb3a1cbcfbcb4ca5c
refs/heads/master: 7dece1c8e1044287287d44ac183a946333b55fc3
21 changes: 16 additions & 5 deletions trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ static struct conf_drv_settings default_conf = {
.hci_io_ds = HCI_IO_DS_6MA,
};

static void __wl1271_op_remove_interface(struct wl1271 *wl);
static void __wl1271_op_remove_interface(struct wl1271 *wl,
bool reset_tx_queues);
static void wl1271_free_ap_keys(struct wl1271 *wl);


Expand Down Expand Up @@ -972,10 +973,19 @@ static void wl1271_recovery_work(struct work_struct *work)
if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
ieee80211_connection_loss(wl->vif);

/* Prevent spurious TX during FW restart */
ieee80211_stop_queues(wl->hw);

/* reboot the chipset */
__wl1271_op_remove_interface(wl);
__wl1271_op_remove_interface(wl, false);
ieee80211_restart_hw(wl->hw);

/*
* Its safe to enable TX now - the queues are stopped after a request
* to restart the HW.
*/
ieee80211_wake_queues(wl->hw);

out:
mutex_unlock(&wl->mutex);
}
Expand Down Expand Up @@ -1479,7 +1489,8 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
return ret;
}

static void __wl1271_op_remove_interface(struct wl1271 *wl)
static void __wl1271_op_remove_interface(struct wl1271 *wl,
bool reset_tx_queues)
{
int i;

Expand Down Expand Up @@ -1525,7 +1536,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl)
mutex_lock(&wl->mutex);

/* let's notify MAC80211 about the remaining pending TX frames */
wl1271_tx_reset(wl);
wl1271_tx_reset(wl, reset_tx_queues);
wl1271_power_off(wl);

memset(wl->bssid, 0, ETH_ALEN);
Expand Down Expand Up @@ -1586,7 +1597,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
*/
if (wl->vif) {
WARN_ON(wl->vif != vif);
__wl1271_op_remove_interface(wl);
__wl1271_op_remove_interface(wl, true);
}

mutex_unlock(&wl->mutex);
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/net/wireless/wl12xx/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ void wl1271_tx_reset_link_queues(struct wl1271 *wl, u8 hlid)
wl1271_handle_tx_low_watermark(wl);
}

/* caller must hold wl->mutex */
void wl1271_tx_reset(struct wl1271 *wl)
/* caller must hold wl->mutex and TX must be stopped */
void wl1271_tx_reset(struct wl1271 *wl, bool reset_tx_queues)
{
int i;
struct sk_buff *skb;
Expand Down Expand Up @@ -806,8 +806,10 @@ void wl1271_tx_reset(struct wl1271 *wl)
/*
* Make sure the driver is at a consistent state, in case this
* function is called from a context other than interface removal.
* This call will always wake the TX queues.
*/
wl1271_handle_tx_low_watermark(wl);
if (reset_tx_queues)
wl1271_handle_tx_low_watermark(wl);

for (i = 0; i < ACX_TX_DESCRIPTORS; i++) {
if (wl->tx_frames[i] == NULL)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/wl12xx/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static inline int wl1271_tx_get_queue(int queue)
void wl1271_tx_work(struct work_struct *work);
void wl1271_tx_work_locked(struct wl1271 *wl);
void wl1271_tx_complete(struct wl1271 *wl);
void wl1271_tx_reset(struct wl1271 *wl);
void wl1271_tx_reset(struct wl1271 *wl, bool reset_tx_queues);
void wl1271_tx_flush(struct wl1271 *wl);
u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set);
Expand Down

0 comments on commit 1dd31d5

Please sign in to comment.