Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179714
b: refs/heads/master
c: d31a2ff
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jan 20, 2010
1 parent fe98327 commit 6595560
Show file tree
Hide file tree
Showing 3 changed files with 17 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: 20633bf0141c5e93e3396770d5eb7d200ee4068a
refs/heads/master: d31a2ff03f31cbecb92bdc5b1ab9d62fb70971d7
18 changes: 13 additions & 5 deletions trunk/drivers/staging/et131x/et1310_address_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,14 @@ typedef struct _GLOBAL_t { /* Location: */
* 9-0: pr ndes
*/

#define ET_DMA10_MASK 0x3FF /* 10 bit mask for DMA10W types */
#define ET_DMA10_WRAP 0x400
#define ET_DMA4_MASK 0x00F /* 4 bit mask for DMA4W types */
#define ET_DMA4_WRAP 0x010

#define ET_DMA12_MASK 0x0FFF /* 12 bit mask for DMA12W types */
#define ET_DMA12_WRAP 0x1000
#define ET_DMA10_MASK 0x03FF /* 10 bit mask for DMA10W types */
#define ET_DMA10_WRAP 0x0400
#define ET_DMA4_MASK 0x000F /* 4 bit mask for DMA4W types */
#define ET_DMA4_WRAP 0x0010

#define INDEX12(x) ((x) & ET_DMA12_MASK)
#define INDEX10(x) ((x) & ET_DMA10_MASK)
#define INDEX4(x) ((x) & ET_DMA4_MASK)

Expand All @@ -216,6 +219,11 @@ extern inline void add_10bit(u32 *v, int n)
*v = INDEX10(*v + n) | (*v & ET_DMA10_WRAP);
}

extern inline void add_12bit(u32 *v, int n)
{
*v = INDEX12(*v + n) | (*v & ET_DMA12_WRAP);
}

/*
* 10bit DMA with wrap
* txdma tx queue write address reg in txdma address map at 0x1010
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/et131x/et1310_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,10 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)

/* Indicate that we have used this PSR entry. */
/* FIXME wrap 12 */
rx_local->local_psr_full = (rx_local->local_psr_full + 1) & 0xFFF;
if (rx_local->local_psr_full > rx_local->PsrNumEntries - 1) {
add_12bit(&rx_local->local_psr_full, 1);
if ((rx_local->local_psr_full & 0xFFF) > rx_local->PsrNumEntries - 1) {
/* Clear psr full and toggle the wrap bit */
rx_local->local_psr_full &= 0xFFF;
rx_local->local_psr_full &= ~0xFFF;
rx_local->local_psr_full ^= 0x1000;
}

Expand Down

0 comments on commit 6595560

Please sign in to comment.