Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314149
b: refs/heads/master
c: 2c38849
h: refs/heads/master
i:
  314147: 899f202
v: v3
  • Loading branch information
Arik Nemtsov authored and Luciano Coelho committed Jun 6, 2012
1 parent c923af8 commit ba3f0e6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 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: 6639611467f34038aa63c5cb9f8d9e48171d6022
refs/heads/master: 2c38849f4a247673c8203a569444042e32d82410
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5148,6 +5148,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size)
wl->state = WL1271_STATE_OFF;
wl->fw_type = WL12XX_FW_TYPE_NONE;
mutex_init(&wl->mutex);
mutex_init(&wl->flush_mutex);

order = get_order(WL1271_AGGR_BUFFER_SIZE);
wl->aggr_buf = (u8 *)__get_free_pages(GFP_KERNEL, order);
Expand Down
11 changes: 10 additions & 1 deletion trunk/drivers/net/wireless/ti/wlcore/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,11 @@ void wl1271_tx_flush(struct wl1271 *wl)
int i;
timeout = jiffies + usecs_to_jiffies(WL1271_TX_FLUSH_TIMEOUT);

/* only one flush should be in progress, for consistent queue state */
mutex_lock(&wl->flush_mutex);

wlcore_stop_queues(wl, WLCORE_QUEUE_STOP_REASON_FLUSH);

while (!time_after(jiffies, timeout)) {
mutex_lock(&wl->mutex);
wl1271_debug(DEBUG_TX, "flushing tx buffer: %d %d",
Expand All @@ -1032,7 +1037,7 @@ void wl1271_tx_flush(struct wl1271 *wl)
if ((wl->tx_frames_cnt == 0) &&
(wl1271_tx_total_queue_count(wl) == 0)) {
mutex_unlock(&wl->mutex);
return;
goto out;
}
mutex_unlock(&wl->mutex);
msleep(1);
Expand All @@ -1045,6 +1050,10 @@ void wl1271_tx_flush(struct wl1271 *wl)
for (i = 0; i < WL12XX_MAX_LINKS; i++)
wl1271_tx_reset_link_queues(wl, i);
mutex_unlock(&wl->mutex);

out:
wlcore_wake_queues(wl, WLCORE_QUEUE_STOP_REASON_FLUSH);
mutex_unlock(&wl->flush_mutex);
}

u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ti/wlcore/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ struct wl1271_tx_hw_res_if {
enum wlcore_queue_stop_reason {
WLCORE_QUEUE_STOP_REASON_WATERMARK,
WLCORE_QUEUE_STOP_REASON_FW_RESTART,
WLCORE_QUEUE_STOP_REASON_FLUSH,
};

static inline int wl1271_tx_get_queue(int queue)
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/ti/wlcore/wlcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ struct wl1271 {

/* the current channel type */
enum nl80211_channel_type channel_type;

/* mutex for protecting the tx_flush function */
struct mutex flush_mutex;
};

int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
Expand Down

0 comments on commit ba3f0e6

Please sign in to comment.