diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index f98ef523f525..0fe2fc90f207 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -3235,6 +3235,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | |||
3235 | flush_scheduled_work(); | 3235 | flush_scheduled_work(); |
3236 | 3236 | ||
3237 | unregister_netdev(dev); | 3237 | unregister_netdev(dev); |
3238 | |||
3239 | /* restore original MAC address */ | ||
3240 | rtl_rar_set(tp, dev->perm_addr); | ||
3241 | |||
3238 | rtl_disable_msi(pdev, tp); | 3242 | rtl_disable_msi(pdev, tp); |
3239 | rtl8169_release_board(pdev, dev, tp->mmio_addr); | 3243 | rtl8169_release_board(pdev, dev, tp->mmio_addr); |
3240 | pci_set_drvdata(pdev, NULL); | 3244 | pci_set_drvdata(pdev, NULL); |
@@ -3243,9 +3247,9 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) | |||
3243 | static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, | 3247 | static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, |
3244 | struct net_device *dev) | 3248 | struct net_device *dev) |
3245 | { | 3249 | { |
3246 | unsigned int mtu = dev->mtu; | 3250 | unsigned int max_frame = dev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN; |
3247 | 3251 | ||
3248 | tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; | 3252 | tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE; |
3249 | } | 3253 | } |
3250 | 3254 | ||
3251 | static int rtl8169_open(struct net_device *dev) | 3255 | static int rtl8169_open(struct net_device *dev) |
@@ -3379,7 +3383,7 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr) | |||
3379 | static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) | 3383 | static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) |
3380 | { | 3384 | { |
3381 | /* Low hurts. Let's disable the filtering. */ | 3385 | /* Low hurts. Let's disable the filtering. */ |
3382 | RTL_W16(RxMaxSize, rx_buf_sz); | 3386 | RTL_W16(RxMaxSize, rx_buf_sz + 1); |
3383 | } | 3387 | } |
3384 | 3388 | ||
3385 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) | 3389 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) |
@@ -4881,6 +4885,9 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
4881 | 4885 | ||
4882 | rtl8169_net_suspend(dev); | 4886 | rtl8169_net_suspend(dev); |
4883 | 4887 | ||
4888 | /* restore original MAC address */ | ||
4889 | rtl_rar_set(tp, dev->perm_addr); | ||
4890 | |||
4884 | spin_lock_irq(&tp->lock); | 4891 | spin_lock_irq(&tp->lock); |
4885 | 4892 | ||
4886 | rtl8169_asic_down(ioaddr); | 4893 | rtl8169_asic_down(ioaddr); |