summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-21 06:20:53 +0000
committerJeff Garzik <jeff@garzik.org>2007-12-22 22:53:05 -0500
commit8a5ed9efe661dd42bc140e522c2635e0d7b26141 (patch)
tree9f37f414587fa25e4ab34290a67789f67d4dcc02 /drivers/net
parentb46281f9c5d6ab7b6e412e83f8c62cecf4ebbdfd (diff)
downloadlinux-8a5ed9efe661dd42bc140e522c2635e0d7b26141.tar.bz2
typhoon: missed rx overruns on big-endian
rxBuffCleared is little-endian; we miss le32_to_cpu() in checks for rx ring overruns. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/typhoon.c4
-rw-r--r--drivers/net/typhoon.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 16d443b71264..501abe379047 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -1596,7 +1596,7 @@ typhoon_recycle_rx_skb(struct typhoon *tp, u32 idx)
struct rx_free *r;
if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) ==
- indexes->rxBuffCleared) {
+ le32_to_cpu(indexes->rxBuffCleared)) {
/* no room in ring, just drop the skb
*/
dev_kfree_skb_any(rxb->skb);
@@ -1627,7 +1627,7 @@ typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx)
rxb->skb = NULL;
if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) ==
- indexes->rxBuffCleared)
+ le32_to_cpu(indexes->rxBuffCleared))
return -ENOMEM;
skb = dev_alloc_skb(PKT_BUF_SZ);
diff --git a/drivers/net/typhoon.h b/drivers/net/typhoon.h
index 19df20889b82..a02e09593970 100644
--- a/drivers/net/typhoon.h
+++ b/drivers/net/typhoon.h
@@ -73,7 +73,7 @@ struct typhoon_indexes {
volatile __le32 txLoCleared;
volatile __le32 txHiCleared;
volatile __le32 rxLoReady;
- volatile __u32 rxBuffCleared; /* AV: really? */
+ volatile __le32 rxBuffCleared;
volatile __le32 cmdCleared;
volatile __le32 respReady;
volatile __le32 rxHiReady;