typhoon: missed rx overruns on big-endian
authorAl Viro <viro@ftp.linux.org.uk>
Fri, 21 Dec 2007 06:20:53 +0000 (06:20 +0000)
committerJeff Garzik <jeff@garzik.org>
Sun, 23 Dec 2007 03:53:05 +0000 (22:53 -0500)
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>
drivers/net/typhoon.c
drivers/net/typhoon.h

index 16d443b71264a49d52873e7c9e5db90485aa9cb5..501abe37904734d2feaf01e53d39112556ea2e97 100644 (file)
@@ -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);
index 19df20889b820a14c6a4039928d96fa2386db44a..a02e09593970e21744ec5bc2a3cf3e53a4aeff6d 100644 (file)
@@ -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;