Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107078
b: refs/heads/master
c: 3a0f2c8
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and John W. Linville committed Jul 29, 2008
1 parent 4909a54 commit 224d467
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 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: 605a0bd66d9d55e9ba46da1a9e5140c68bdf6d85
refs/heads/master: 3a0f2c871849f23c1070965bf94dec3f9c0b479d
32 changes: 25 additions & 7 deletions trunk/drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1682,20 +1682,21 @@ ath5k_tasklet_rx(unsigned long data)
struct ath5k_rx_status rs = {};
struct sk_buff *skb;
struct ath5k_softc *sc = (void *)data;
struct ath5k_buf *bf;
struct ath5k_buf *bf, *bf_last;
struct ath5k_desc *ds;
int ret;
int hdrlen;
int pad;

spin_lock(&sc->rxbuflock);
if (list_empty(&sc->rxbuf)) {
ATH5K_WARN(sc, "empty rx buf pool\n");
goto unlock;
}
bf_last = list_entry(sc->rxbuf.prev, struct ath5k_buf, list);
do {
rxs.flag = 0;

if (unlikely(list_empty(&sc->rxbuf))) {
ATH5K_WARN(sc, "empty rx buf pool\n");
break;
}
bf = list_first_entry(&sc->rxbuf, struct ath5k_buf, list);
BUG_ON(bf->skb == NULL);
skb = bf->skb;
Expand All @@ -1705,8 +1706,24 @@ ath5k_tasklet_rx(unsigned long data)
pci_dma_sync_single_for_cpu(sc->pdev, sc->desc_daddr,
sc->desc_len, PCI_DMA_FROMDEVICE);

if (unlikely(ds->ds_link == bf->daddr)) /* this is the end */
break;
/*
* last buffer must not be freed to ensure proper hardware
* function. When the hardware finishes also a packet next to
* it, we are sure, it doesn't use it anymore and we can go on.
*/
if (bf_last == bf)
bf->flags |= 1;
if (bf->flags) {
struct ath5k_buf *bf_next = list_entry(bf->list.next,
struct ath5k_buf, list);
ret = sc->ah->ah_proc_rx_desc(sc->ah, bf_next->desc,
&rs);
if (ret)
break;
bf->flags &= ~1;
/* skip the overwritten one (even status is martian) */
goto next;
}

ret = sc->ah->ah_proc_rx_desc(sc->ah, ds, &rs);
if (unlikely(ret == -EINPROGRESS))
Expand Down Expand Up @@ -1816,6 +1833,7 @@ ath5k_tasklet_rx(unsigned long data)
next:
list_move_tail(&bf->list, &sc->rxbuf);
} while (ath5k_rxbuf_setup(sc, bf) == 0);
unlock:
spin_unlock(&sc->rxbuflock);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath5k/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

struct ath5k_buf {
struct list_head list;
unsigned int flags; /* tx descriptor flags */
unsigned int flags; /* rx descriptor flags */
struct ath5k_desc *desc; /* virtual addr of desc */
dma_addr_t daddr; /* physical addr of desc */
struct sk_buff *skb; /* skbuff for buf */
Expand Down

0 comments on commit 224d467

Please sign in to comment.