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

From: Roel Kluin <[email-masked]>
Date: Sat, 15 Aug 2009 15:41:07 +0200

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

Signed-off-by: Roel Kluin <[email-masked]>
---
> 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++;