diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-03-23 07:03:29 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-03-23 07:03:29 +0100 |
commit | 991b5557f7f04602b3b161341dee85971e0b6be6 (patch) | |
tree | 32022450130edf96e100f04ad19a13ac16e361a1 /drivers/net/ewrk3.c | |
parent | Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
download | linux-991b5557f7f04602b3b161341dee85971e0b6be6.tar.xz linux-991b5557f7f04602b3b161341dee85971e0b6be6.zip |
[netdrvr] ewrk3: correct card detection bug
Arwin Vosselman pointed out:
> The ewrk3-driver doesn't function with 2.6.16-kernels (used 2.6.16.41 for
> my tests). Cards will never be detected due to this bug.
>
> drivers/net/ewrks3.c:
> Line 417 reads:
>
> if (nicsr == (CSR_TXD | CSR_RXD))
>
> that should be:
>
> if (nicsr != (CSR_TXD | CSR_RXD))
>
> Comparison with the same line in v2.4 shows why:
>
> 2.4:
> if (nicsr == (CSR_TXD | CSR_RXD)){
>
> blah, blah
> ==========
> 2.6:
> if (nicsr == (CSR_TXD | CSR_RXD))
> return -ENXIO;
>
> blah, blah
> ==========
>
> blah,blah will not, but should, be executed in 2.6 with a card being present.
>
> The fix mentioned above solves this bug.
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ewrk3.c')
-rw-r--r-- | drivers/net/ewrk3.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c index c8c41f0a47d6..714ea1176ec7 100644 --- a/drivers/net/ewrk3.c +++ b/drivers/net/ewrk3.c @@ -414,10 +414,9 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase) icr &= 0x70; outb(icr, EWRK3_ICR); /* Disable all the IRQs */ - if (nicsr == (CSR_TXD | CSR_RXD)) + if (nicsr != (CSR_TXD | CSR_RXD)) return -ENXIO; - /* Check that the EEPROM is alive and well and not living on Pluto... */ for (chksum = 0, i = 0; i < EEPROM_MAX; i += 2) { union { |