Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314906
b: refs/heads/master
c: 7a50bdf
h: refs/heads/master
v: v3
  • Loading branch information
Eyal Shapira authored and Luciano Coelho committed Jun 26, 2012
1 parent 188d17f commit d58b036
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 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: 8b425e62d96a3b3a3cc68e6203267f92d1a01946
refs/heads/master: 7a50bdfb81a6bff96100cd2a2c95f8b3cf05bc0c
35 changes: 24 additions & 11 deletions trunk/drivers/net/wireless/ti/wlcore/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,10 @@ static int wl1271_prepare_tx_frame(struct wl1271 *wl, struct wl12xx_vif *wlvif,
bool is_dummy;
bool is_gem = false;

if (!skb)
if (!skb) {
wl1271_error("discarding null skb");
return -EINVAL;
}

info = IEEE80211_SKB_CB(skb);

Expand Down Expand Up @@ -662,6 +664,16 @@ void wl12xx_rearm_rx_streaming(struct wl1271 *wl, unsigned long *active_hlids)
}
}

/*
* Returns failure values only in case of failed bus ops within this function.
* wl1271_prepare_tx_frame retvals won't be returned in order to avoid
* triggering recovery by higher layers when not necessary.
* In case a FW command fails within wl1271_prepare_tx_frame fails a recovery
* will be queued in wl1271_cmd_send. -EAGAIN/-EBUSY from prepare_tx_frame
* can occur and are legitimate so don't propagate. -EINVAL will emit a WARNING
* within prepare_tx_frame code but there's nothing we should do about those
* as well.
*/
int wlcore_tx_work_locked(struct wl1271 *wl)
{
struct wl12xx_vif *wlvif;
Expand All @@ -671,9 +683,10 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
bool sent_packets = false;
unsigned long active_hlids[BITS_TO_LONGS(WL12XX_MAX_LINKS)] = {0};
int ret = 0;
int bus_ret = 0;

if (unlikely(wl->state == WL1271_STATE_OFF))
return -EIO;
return 0;

while ((skb = wl1271_skb_dequeue(wl))) {
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
Expand All @@ -694,9 +707,9 @@ int wlcore_tx_work_locked(struct wl1271 *wl)

buf_offset = wlcore_hw_pre_pkt_send(wl, buf_offset,
last_len);
ret = wlcore_write_data(wl, REG_SLV_MEM_DATA,
wl->aggr_buf, buf_offset, true);
if (ret < 0)
bus_ret = wlcore_write_data(wl, REG_SLV_MEM_DATA,
wl->aggr_buf, buf_offset, true);
if (bus_ret < 0)
goto out;

sent_packets = true;
Expand Down Expand Up @@ -734,9 +747,9 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
out_ack:
if (buf_offset) {
buf_offset = wlcore_hw_pre_pkt_send(wl, buf_offset, last_len);
ret = wlcore_write_data(wl, REG_SLV_MEM_DATA, wl->aggr_buf,
buf_offset, true);
if (ret < 0)
bus_ret = wlcore_write_data(wl, REG_SLV_MEM_DATA, wl->aggr_buf,
buf_offset, true);
if (bus_ret < 0)
goto out;

sent_packets = true;
Expand All @@ -747,9 +760,9 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
* required for older hardware revisions
*/
if (wl->quirks & WLCORE_QUIRK_END_OF_TRANSACTION) {
ret = wlcore_write32(wl, WL12XX_HOST_WR_ACCESS,
bus_ret = wlcore_write32(wl, WL12XX_HOST_WR_ACCESS,
wl->tx_packets_count);
if (ret < 0)
if (bus_ret < 0)
goto out;
}

Expand All @@ -758,7 +771,7 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
wl12xx_rearm_rx_streaming(wl, active_hlids);

out:
return ret;
return bus_ret;
}

void wl1271_tx_work(struct work_struct *work)
Expand Down

0 comments on commit d58b036

Please sign in to comment.