Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224254
b: refs/heads/master
c: 25eeb9e
h: refs/heads/master
v: v3
  • Loading branch information
Ido Yariv authored and John W. Linville committed Nov 15, 2010
1 parent 11eaff6 commit 74b9bc8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 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: a522550a283de31c7cfc30c7a129ce584e38c582
refs/heads/master: 25eeb9e3876a161e3afcc820c6cb72e13f9b7c7e
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1271.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ struct wl1271 {
struct work_struct tx_work;

/* Pending TX frames */
unsigned long tx_frames_map[BITS_TO_LONGS(ACX_TX_DESCRIPTORS)];
struct sk_buff *tx_frames[ACX_TX_DESCRIPTORS];
int tx_frames_cnt;

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1271_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,7 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
wl->sg_enabled = true;
wl->hw_pg_ver = -1;

memset(wl->tx_frames_map, 0, sizeof(wl->tx_frames_map));
for (i = 0; i < ACX_TX_DESCRIPTORS; i++)
wl->tx_frames[i] = NULL;

Expand Down
38 changes: 22 additions & 16 deletions trunk/drivers/net/wireless/wl12xx/wl1271_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,26 @@
#include "wl1271_ps.h"
#include "wl1271_tx.h"

static int wl1271_tx_id(struct wl1271 *wl, struct sk_buff *skb)
static int wl1271_alloc_tx_id(struct wl1271 *wl, struct sk_buff *skb)
{
int i;
for (i = 0; i < ACX_TX_DESCRIPTORS; i++)
if (wl->tx_frames[i] == NULL) {
wl->tx_frames[i] = skb;
wl->tx_frames_cnt++;
return i;
}
int id;

id = find_first_zero_bit(wl->tx_frames_map, ACX_TX_DESCRIPTORS);
if (id >= ACX_TX_DESCRIPTORS)
return -EBUSY;

__set_bit(id, wl->tx_frames_map);
wl->tx_frames[id] = skb;
wl->tx_frames_cnt++;
return id;
}

return -EBUSY;
static void wl1271_free_tx_id(struct wl1271 *wl, int id)
{
if (__test_and_clear_bit(id, wl->tx_frames_map)) {
wl->tx_frames[id] = NULL;
wl->tx_frames_cnt--;
}
}

static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra,
Expand All @@ -55,7 +64,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra,
return -EAGAIN;

/* allocate free identifier for the packet */
id = wl1271_tx_id(wl, skb);
id = wl1271_alloc_tx_id(wl, skb);
if (id < 0)
return id;

Expand All @@ -79,8 +88,7 @@ static int wl1271_tx_allocate(struct wl1271 *wl, struct sk_buff *skb, u32 extra,
"tx_allocate: size: %d, blocks: %d, id: %d",
total_len, total_blocks, id);
} else {
wl->tx_frames[id] = NULL;
wl->tx_frames_cnt--;
wl1271_free_tx_id(wl, id);
}

return ret;
Expand Down Expand Up @@ -352,8 +360,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,

/* return the packet to the stack */
ieee80211_tx_status(wl->hw, skb);
wl->tx_frames[result->id] = NULL;
wl->tx_frames_cnt--;
wl1271_free_tx_id(wl, result->id);
}

/* Called upon reception of a TX complete interrupt */
Expand Down Expand Up @@ -422,11 +429,10 @@ void wl1271_tx_reset(struct wl1271 *wl)
for (i = 0; i < ACX_TX_DESCRIPTORS; i++)
if (wl->tx_frames[i] != NULL) {
skb = wl->tx_frames[i];
wl->tx_frames[i] = NULL;
wl1271_free_tx_id(wl, i);
wl1271_debug(DEBUG_TX, "freeing skb 0x%p", skb);
ieee80211_tx_status(wl->hw, skb);
}
wl->tx_frames_cnt = 0;
}

#define WL1271_TX_FLUSH_TIMEOUT 500000
Expand Down

0 comments on commit 74b9bc8

Please sign in to comment.