Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249628
b: refs/heads/master
c: f626574
h: refs/heads/master
v: v3
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed May 17, 2011
1 parent bccda0a commit 8beb058
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 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: de3170671a0620254703def8e01ed4242676e952
refs/heads/master: f6265746765a3f7e5158b5b779e6657d0c646adc
11 changes: 1 addition & 10 deletions trunk/drivers/staging/brcm80211/brcmsmac/hnddma.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,16 +728,7 @@ static void *_dma_rx(dma_info_t *di)

len = le16_to_cpu(*(u16 *) (head->data));
DMA_TRACE(("%s: dma_rx len %d\n", di->name, len));

#if defined(__mips__)
#define OSL_UNCACHED(va) ((void *)KSEG1ADDR((va)))
if (!len) {
while (!(len = *(u16 *) OSL_UNCACHED(head->data)))
udelay(1);

*(u16 *) (head->data) = cpu_to_le16((u16) len);
}
#endif /* defined(__mips__) */
dma_spin_for_len(len, head);

/* set actual length */
pkt_len = min((di->rxoffset + len), di->rxbufsize);
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/staging/brcm80211/include/hnddma.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,23 @@ extern const di_fcn_t dma64proc;
extern uint dma_addrwidth(si_t *sih, void *dmaregs);
void dma_walk_packets(struct hnddma_pub *dmah, void (*callback_fnc)
(void *pkt, void *arg_a), void *arg_a);

/*
* DMA(Bug) on some chips seems to declare that the packet is ready, but the
* packet length is not updated yet (by DMA) on the expected time.
* Workaround is to hold processor till DMA updates the length, and stay off
* the bus to allow DMA update the length in buffer
*/
static inline void dma_spin_for_len(uint len, struct sk_buff *head)
{
#if defined(__mips__)
if (!len) {
while (!(len = *(u16 *) KSEG1ADDR(head->data)))
udelay(1);

*(u16 *) (head->data) = cpu_to_le16((u16) len);
}
#endif /* defined(__mips__) */
}

#endif /* _hnddma_h_ */

0 comments on commit 8beb058

Please sign in to comment.