[PATCH] sundance: add IFF_RUNNING support
From: Leigh Brown <hidden>
Date: 2007-02-12 21:48:03
Patch to add IFF_RUNNING support for sundance. I copied the basic code for this from the forcedeth driver, and I've tested it using the ifplugstatus command from the ifplugd package. This is very handy if you use Quagga or keepalived. Signed-off-by: Leigh Brown <redacted> diff -urN a/drivers/net/sundance.c b/drivers/net/sundance.c
--- a/drivers/net/sundance.c 2007-02-11 11:29:19.000000000 +0000
+++ b/drivers/net/sundance.c 2007-02-12 19:48:36.000000000 +0000@@ -23,8 +23,8 @@ */ #define DRV_NAME "sundance" -#define DRV_VERSION "1.2" -#define DRV_RELDATE "11-Sep-2006" +#define DRV_VERSION "1.3" +#define DRV_RELDATE "12-Feb-2007" /* The user-configurable values.
@@ -831,6 +831,7 @@ /* Fix DFE-580TX packet drop issue */ if (np->pci_rev_id >= 0x14) iowrite8(0x01, ioaddr + DebugCtrl1); + netif_carrier_off(dev); netif_start_queue(dev); spin_lock_irqsave(&np->lock, flags);
@@ -1429,6 +1430,13 @@ iowrite16(ioread16(ioaddr + MACCtrl0) | EnbFlowCtrl, ioaddr + MACCtrl0); } + if (mii_link_ok(&np->mii_if)) { + if (!netif_carrier_ok(dev)) + netif_carrier_on(dev); + } else { + if (netif_carrier_ok(dev)) + netif_carrier_off(dev); + } } if (intr_status & StatsMax) { get_stats(dev);