From: Andrew Morton <akpm@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: roel.kluin@gmail.com, romieu@fr.zoreil.com, netdev@vger.kernel.org
Subject: Re: [PATCH] WAN: bit and/or confusion
Date: Fri, 14 Aug 2009 16:58:52 -0700 [thread overview]
Message-ID: <20090814165852.7338461e.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090814.164123.36875657.davem@davemloft.net>
On Fri, 14 Aug 2009 16:41:23 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
> Date: Fri, 14 Aug 2009 16:36:44 -0700
>
> > On Fri, 14 Aug 2009 14:51:46 +0200
> > Roel Kluin <roel.kluin@gmail.com> wrote:
> >
> >> @@ -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++;
> >
> > that's
> >
> > if (!(x & 0xffffffdf))
> >
> > which seems peculiar. Should it have been
> >
> > else if (skb->data[pkt_len] & FrameCrc)
> >
> > or
> >
> > else if (!(skb->data[pkt_len] & FrameCrc))
>
> Indeed, I can't tell which variant would be correct.
>
> I'm reverting until someone with a datasheet for this chip speaks up
> :-)
http://www.datasheet.in/download.php?id=39415
Page 383 and 384 say that bit 5 (CRC) is zero if the rx frame contained
errors.
So we need
else if (!(skb->data[pkt_len] & FrameCrc))
> - else if (!(skb->data[pkt_len] | ~(FrameVfr | FrameRab)))
> + else if (!(skb->data[pkt_len] & ~(FrameVfr | FrameRab)))
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).
next prev parent reply other threads:[~2009-08-14 23:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-14 12:51 [PATCH] WAN: bit and/or confusion Roel Kluin
2009-08-14 23:32 ` David Miller
2009-08-14 23:36 ` Andrew Morton
2009-08-14 23:41 ` David Miller
2009-08-14 23:58 ` Andrew Morton [this message]
2009-08-15 13:41 ` Roel Kluin
2009-08-15 14:13 ` Francois Romieu
2009-08-15 18:46 ` Krzysztof Halasa
2009-08-20 14:04 ` Roel Kluin
2009-08-20 14:25 ` Krzysztof Halasa
2009-08-31 5:02 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090814165852.7338461e.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=roel.kluin@gmail.com \
--cc=romieu@fr.zoreil.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).