> Date: Tue, 14 Jan 1997 14:37:55 -0800
> From: Marcelo Mourier <marcelom@rapid-city.com>
> To: becker@cesdis.gsfc.nasa.gov
> Cc: linux-net@vger.rutgers.edu
> Subject: Getting the frame's CRC word
>
> I'd like to modify the Linux driver for the 3Com 509B so that the 32-bit
> CRC word at the end of the frame is read from the MAC's receive FIFO
> (normally it is stripped by the MAC.) Do you know how to configure the
> 509B to do this..?
This is easy to set up on the 3c509B (and the other boards that use the "B"
revision EtherLink III silicon):
Set bit 2 (0x0004) in Window 4, offset 0x0A, i.e.:
EL3WINDOW(4);
outw(inw(ioaddr + WN4_MEDIA) | 0x0004, ioaddr + WN4_MEDIA);
Read back the word -- if the bit remains set, the silicon supports passing
through the CRC value. If the bit is clear, the silicon doesn't support it
(presumably because it's an original 3c509).
A good place for the driver to set this bit is around line 358 in
el3_open(), where the link beat enable bit is also set in WN4_MEDIA.
Setting this bit increases the hardware-reported packet size (and other byte
counts) by four bytes, so the driver doesn't require other changes.
This lead to the bigger question of "why?"
The only reason I can think of enabling CRC pass-through is for
- bridging
- some network monitoring application
Normally, all frames with CRC errors are discarded. The CRC can be
recomputed on correct frames, at some (definitely noticable) cost. So the
only thing passing through the CRC gets you is
- protection against local memory errors
- some savings in recomputing the CRC (but is it ever necessary?)
If we decide that getting the Rx CRC is a Good Thing, almost all drivers could
support it. It's not clear what the interface should be though -- perhaps
another dev->flags bit?
This mechanism is of limited use in Ethernet-to-Ethernet bridging unless we
also have a mechanism to indicate "Don't append a CRC to this Tx packet",
which would have to be added to every driver. This is complicated because
some hardware doesn't have a per-packet append-CRC flag, only a global
CRC/no-CRC flag.
Donald Becker becker@cesdis.gsfc.nasa.gov
USRA-CESDIS, Center of Excellence in Space Data and Information Sciences.
Code 930.5, Goddard Space Flight Center, Greenbelt, MD. 20771
301-286-0882 http://cesdis.gsfc.nasa.gov/pub/people/becker/whoiam.html