Re: EtherExpress 16 Errors

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Sun, 19 Sep 1999 01:53:23 +0200 (MEST)


Philip Blundell wrote:
> >These cards have been problematic since the introduction of a
> >linux driver (hence the experimental status). Quite a few people
> >have had a go at hacking the driver but the consensus is that the
> >i82586 databook isn't detailed enough to allow a reliable driver
> >to be coded that handles all the quirks.

> Actually the 82586 itself is fairly well understood. The problem
> with the EtherExpress is that there is an undocumented custom ASIC
> involved as well, of which there are at least two different
> versions.

I've got the docs on the card (under NDA). One of the most scary
things about the card is that there are two register addresses that
access the exact same register. Those are the READ_PTR and the
WRITE_PTR .

The old driver used to assume that the READ_PTR was only used in the
interrupt routine and the WRITE_PTR only in the non-interrupt part of
the driver. That doesn't help, as overwriting the READ_PTR would also
overwrite the WRITE_PTR. As packets are usually checksummed, sending a
corrupted packet (because an interrupt came in which moved the
write_ptr for an incoming packet) would get silently dropped at the
other side.

The reason there are two registers is that setting the READ_PTR
register, prefetches from the local memory the data that the pointer
points at. The WRITE_PTR doesn't show this behaviour.

I see the interrupt routine do:

outw(old_read_ptr, ioaddr+READ_PTR);
outw(old_write_ptr, ioaddr+WRITE_PTR);

which I'd do the other way around, just to be sure. (Possibly the
readahead is aborted on setting the write pointer, leaving an invalid
value cached in the readahead register.)

I'd run the code for a few months with

if (old_write_ptr != old_read_ptr) {
static int toldyou = 0;
if (!toldyou++)
printk ("Roger is wrong! %x != %x\n",
old_write_ptr, old_read_ptr);
}

near the top of the interrupt routine (after reading the old pointer
values) just to be sure. When that never triggers, we can move to
remove one of the saved ptr's .....

Anyway, that's my view on the situation....

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/