This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Another cs8900a problem
- From: "Stephen Finney" <shf at pfinc dot com>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 07 Jun 2004 12:34:07 -0400
- Subject: [ECOS] Another cs8900a problem
I have been getting zero-length frames from my 8900a ethernet controller. My
problem appears to be similar to, but sightly different from Bob Konickx's problem.
When I receive a zero length frame, stat = 3284. This indicates a runt frame,
CRC error, hashed, with dribble bits. The frames appear on my network at the
rate of 5 to 10 a day, usually during the day (presumably when there is more
activity on the network). They caused my system to crash until I added the
following code in cs8900a_RxEvent (in devs/eth/cl/cs8900a/current/src/if_cs8900a.c)
to ignore zero-length frames (and frames greater than 1518 bytes - the maximum
frame length that the cs8900a will handle):
// (sc->funs->eth_drv->recv)(sc, len);
if ( (len >= 0) && (len <= 1518) )
{
(sc->funs->eth_drv->recv)(sc, len);
}
Since the 8900a can be programmed to ignore runt frames, I next modified
cs8900a_start (also in devs/eth/cl/cs8900a/current/src/if_cs8900a.c) to only
generate an RxOK interrupt if the frame is received without errors:
// put_reg(base, PP_RxCFG, PP_RxCFG_RxOK | PP_RxCFG_CRC |
// PP_RxCFG_RUNT | PP_RxCFG_EXTRA);
put_reg(base, PP_RxCFG, PP_RxCFG_RxOK );
This modification allows the cs8900a to ignore the runt frame, and no receive
interrupt is generated. As Bob Konickx pointed out, programming the config
register to generate an interrupt, but leaving the corresponding acceptance bit
unset in the control register will cause the cs8900a to generate a zero length
frame.
Presumably, Bob Konickx's zero length frames were produced by a different
mechanism, since he tried modifying cs8900a_start but still got the zero length
frames.
I believe that the RxCFG register should be programmed to ignore bad frames,
reducing interrupt overhead. At the same time, the test in cs8900a_RxEvent should
suppress zero length frames of the sort that Bob Konickx experienced.
Before I (attempt to) submit a patch, I would like some feedback.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss