Commit b3df9f81 authored by Manfred Spraul's avatar Manfred Spraul Committed by Jeff Garzik

[PATCH] forcedeth: write back original mac address during ifdown

This is a multi-part message in MIME format.
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 72b31782
...@@ -91,6 +91,8 @@ ...@@ -91,6 +91,8 @@
* per-packet flags. * per-packet flags.
* 0.39: 18 Jul 2005: Add 64bit descriptor support. * 0.39: 18 Jul 2005: Add 64bit descriptor support.
* 0.40: 19 Jul 2005: Add support for mac address change. * 0.40: 19 Jul 2005: Add support for mac address change.
* 0.41: 30 Jul 2005: Write back original MAC in nv_close instead
* of nv_remove
* *
* Known bugs: * Known bugs:
* We suspect that on some hardware no TX done interrupts are generated. * We suspect that on some hardware no TX done interrupts are generated.
...@@ -102,7 +104,7 @@ ...@@ -102,7 +104,7 @@
* DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
* superfluous timer interrupts from the nic. * superfluous timer interrupts from the nic.
*/ */
#define FORCEDETH_VERSION "0.40" #define FORCEDETH_VERSION "0.41"
#define DRV_NAME "forcedeth" #define DRV_NAME "forcedeth"
#include <linux/module.h> #include <linux/module.h>
...@@ -2230,6 +2232,12 @@ static int nv_close(struct net_device *dev) ...@@ -2230,6 +2232,12 @@ static int nv_close(struct net_device *dev)
if (np->wolenabled) if (np->wolenabled)
nv_start_rx(dev); nv_start_rx(dev);
/* special op: write back the misordered MAC address - otherwise
* the next nv_probe would see a wrong address.
*/
writel(np->orig_mac[0], base + NvRegMacAddrA);
writel(np->orig_mac[1], base + NvRegMacAddrB);
/* FIXME: power down nic */ /* FIXME: power down nic */
return 0; return 0;
...@@ -2482,16 +2490,9 @@ static void __devexit nv_remove(struct pci_dev *pci_dev) ...@@ -2482,16 +2490,9 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
{ {
struct net_device *dev = pci_get_drvdata(pci_dev); struct net_device *dev = pci_get_drvdata(pci_dev);
struct fe_priv *np = get_nvpriv(dev); struct fe_priv *np = get_nvpriv(dev);
u8 __iomem *base = get_hwbase(dev);
unregister_netdev(dev); unregister_netdev(dev);
/* special op: write back the misordered MAC address - otherwise
* the next nv_probe would see a wrong address.
*/
writel(np->orig_mac[0], base + NvRegMacAddrA);
writel(np->orig_mac[1], base + NvRegMacAddrB);
/* free all structures */ /* free all structures */
if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2)
pci_free_consistent(np->pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), np->rx_ring.orig, np->ring_addr); pci_free_consistent(np->pci_dev, sizeof(struct ring_desc) * (RX_RING + TX_RING), np->rx_ring.orig, np->ring_addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment