All of lore.kernel.org
 help / color / mirror / Atom feed
* [IOC3] Fix link autonegotiation timer.
@ 2007-02-17  2:51 Ralf Baechle
  2007-02-17 20:38 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Ralf Baechle @ 2007-02-17  2:51 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linux-mips

Start link negotiation in the open method.  Previously it was started
on driver initialialization and shutdown on close so an ifdown would
have results in closing negotiation for good.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index ee6bca0..f5d277c 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -831,13 +831,17 @@ static int ioc3_mii_init(struct ioc3_private *ip)
 	}
 
 	ip->mii.phy_id = i;
+
+out:
+	return res;
+}
+
+static void ioc3_mii_start(struct ioc3_private *ip)
+{
 	ip->ioc3_timer.expires = jiffies + (12 * HZ)/10;  /* 1.2 sec. */
 	ip->ioc3_timer.data = (unsigned long) ip;
 	ip->ioc3_timer.function = &ioc3_timer;
 	add_timer(&ip->ioc3_timer);
-
-out:
-	return res;
 }
 
 static inline void ioc3_clean_rx_ring(struct ioc3_private *ip)
@@ -1066,6 +1070,7 @@ static int ioc3_open(struct net_device *dev)
 	ip->ehar_h = 0;
 	ip->ehar_l = 0;
 	ioc3_init(dev);
+	ioc3_mii_start(ip);
 
 	netif_start_queue(dev);
 	return 0;
@@ -1269,6 +1274,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto out_stop;
 	}
 
+	ioc3_mii_start(ip);
 	ioc3_ssram_disc(ip);
 	ioc3_get_eaddr(ip);
 
@@ -1307,6 +1313,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 out_stop:
 	ioc3_stop(ip);
+	del_timer_sync(&ip->ioc3_timer);
 	ioc3_free_rings(ip);
 out_res:
 	pci_release_regions(pdev);
@@ -1328,6 +1335,8 @@ static void __devexit ioc3_remove_one (struct pci_dev *pdev)
 	struct ioc3 *ioc3 = ip->regs;
 
 	unregister_netdev(dev);
+	del_timer_sync(&ip->ioc3_timer);
+
 	iounmap(ioc3);
 	pci_release_regions(pdev);
 	free_netdev(dev);
@@ -1483,6 +1492,7 @@ static void ioc3_timeout(struct net_device *dev)
 	ioc3_stop(ip);
 	ioc3_init(dev);
 	ioc3_mii_init(ip);
+	ioc3_mii_start(ip);
 
 	spin_unlock_irq(&ip->ioc3_lock);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [IOC3] Fix link autonegotiation timer.
  2007-02-17  2:51 [IOC3] Fix link autonegotiation timer Ralf Baechle
@ 2007-02-17 20:38 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-02-17 20:38 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: netdev, linux-mips

Ralf Baechle wrote:
> Start link negotiation in the open method.  Previously it was started
> on driver initialialization and shutdown on close so an ifdown would
> have results in closing negotiation for good.
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

applied



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-17 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-17  2:51 [IOC3] Fix link autonegotiation timer Ralf Baechle
2007-02-17 20:38 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.