Thread (11 messages) 11 messages, 5 authors, 2009-08-31

Re: [PATCH] WAN: bit and/or confusion

From: Roel Kluin <hidden>
Date: 2009-08-15 13:36:54
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Fix the tests that check whether Frame* bits are not set

Signed-off-by: Roel Kluin <redacted>
---
we need

	else if (!(skb->data[pkt_len] & FrameCrc))
vfr is "valid frame".  0 is invalid.

rab is "receive message aborted".  The data sheet doesn't actually say
if the bit is active-high or active-low (grr).  
Maybe someone could test this?
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 8face5d..b686050 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -663,9 +663,9 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
 	} else {
 		if (skb->data[pkt_len] & FrameRdo)
 			dev->stats.rx_fifo_errors++;
-		else if (!(skb->data[pkt_len] | ~FrameCrc))
+		else if (!(skb->data[pkt_len] & FrameCrc))
 			dev->stats.rx_crc_errors++;
-		else if (!(skb->data[pkt_len] | ~(FrameVfr | FrameRab)))
+		else if (!(skb->data[pkt_len] & (FrameVfr | FrameRab)))
 			dev->stats.rx_length_errors++;
 		else
 			dev->stats.rx_errors++;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help