Skip to content

Commit

Permalink
r8169: restore mac addr in rtl8169_remove_one and rtl_shutdown
Browse files Browse the repository at this point in the history
The newer chipsets (all PCI-E) are known that they need full power cycle
(AC or battery removal) to reset MAC address to a  hardwired one. Previous
patch to address this problem loads the original MAC address from EEPROM.
But it brought other problem for which it is necessary to introduce a new
module parameter.
However, it might suffice to restore the initial MAC address before
shutdown/reboot/kexec and when removing the module.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ivan Vecera authored and David S. Miller committed Nov 30, 2009
1 parent bbf31bf commit cc098dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -3235,6 +3235,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
flush_scheduled_work();

unregister_netdev(dev);

/* restore original MAC address */
rtl_rar_set(tp, dev->perm_addr);

rtl_disable_msi(pdev, tp);
rtl8169_release_board(pdev, dev, tp->mmio_addr);
pci_set_drvdata(pdev, NULL);
Expand Down Expand Up @@ -4881,6 +4885,9 @@ static void rtl_shutdown(struct pci_dev *pdev)

rtl8169_net_suspend(dev);

/* restore original MAC address */
rtl_rar_set(tp, dev->perm_addr);

spin_lock_irq(&tp->lock);

rtl8169_asic_down(ioaddr);
Expand Down

0 comments on commit cc098dc

Please sign in to comment.