]> bbs.cooldavid.org Git - net-next-2.6.git/commit
de2104x: fix TP link detection
authorOndrej Zary <linux@rainbow-software.org>
Sat, 25 Sep 2010 10:39:17 +0000 (10:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Sep 2010 22:51:55 +0000 (15:51 -0700)
commitca9a783575d2affed30ef27a3427a7705527ddac
treecf4fb6545c85f1d7411877dadbab4db04eb3ec2c
parentb0255a02351b00ca55f4eb2588d05a5db9dd1a58
de2104x: fix TP link detection

Compex FreedomLine 32 PnP-PCI2 cards have only TP and BNC connectors but the
SROM contains AUI port too. When TP loses link, the driver switches to
non-existing AUI port (which reports that carrier is always present).

Connecting TP back generates LinkPass interrupt but de_media_interrupt() is
broken - it only updates the link state of currently connected media, ignoring
the fact that LinkPass and LinkFail bits of MacStatus register belong to the
TP port only (the chip documentation says that).

This patch changes de_media_interrupt() to switch media to TP when link goes
up (and media type is not locked) and also to update the link state only when
the TP port is used.

Also the NonselPortActive (and also SelPortActive) bits of SIAStatus register
need to be cleared (by writing 1) after reading or they're useless.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tulip/de2104x.c