diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 992db2fa136e..ed65e4a473ec 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -855,10 +855,10 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
855 | else | 855 | else |
856 | tp->features &= ~RTL_FEATURE_WOL; | 856 | tp->features &= ~RTL_FEATURE_WOL; |
857 | __rtl8169_set_wol(tp, wol->wolopts); | 857 | __rtl8169_set_wol(tp, wol->wolopts); |
858 | device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts); | ||
859 | |||
860 | spin_unlock_irq(&tp->lock); | 858 | spin_unlock_irq(&tp->lock); |
861 | 859 | ||
860 | device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts); | ||
861 | |||
862 | return 0; | 862 | return 0; |
863 | } | 863 | } |
864 | 864 | ||
@@ -2936,7 +2936,7 @@ static const struct rtl_cfg_info { | |||
2936 | .hw_start = rtl_hw_start_8168, | 2936 | .hw_start = rtl_hw_start_8168, |
2937 | .region = 2, | 2937 | .region = 2, |
2938 | .align = 8, | 2938 | .align = 8, |
2939 | .intr_event = SYSErr | RxFIFOOver | LinkChg | RxOverflow | | 2939 | .intr_event = SYSErr | LinkChg | RxOverflow | |
2940 | TxErr | TxOK | RxOK | RxErr, | 2940 | TxErr | TxOK | RxOK | RxErr, |
2941 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, | 2941 | .napi_event = TxErr | TxOK | RxOK | RxOverflow, |
2942 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, | 2942 | .features = RTL_FEATURE_GMII | RTL_FEATURE_MSI, |
@@ -4455,14 +4455,12 @@ static inline int rtl8169_fragmented_frame(u32 status) | |||
4455 | return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag); | 4455 | return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag); |
4456 | } | 4456 | } |
4457 | 4457 | ||
4458 | static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc) | 4458 | static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1) |
4459 | { | 4459 | { |
4460 | u32 opts1 = le32_to_cpu(desc->opts1); | ||
4461 | u32 status = opts1 & RxProtoMask; | 4460 | u32 status = opts1 & RxProtoMask; |
4462 | 4461 | ||
4463 | if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || | 4462 | if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || |
4464 | ((status == RxProtoUDP) && !(opts1 & UDPFail)) || | 4463 | ((status == RxProtoUDP) && !(opts1 & UDPFail))) |
4465 | ((status == RxProtoIP) && !(opts1 & IPFail))) | ||
4466 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 4464 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
4467 | else | 4465 | else |
4468 | skb->ip_summed = CHECKSUM_NONE; | 4466 | skb->ip_summed = CHECKSUM_NONE; |
@@ -4551,8 +4549,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
4551 | continue; | 4549 | continue; |
4552 | } | 4550 | } |
4553 | 4551 | ||
4554 | rtl8169_rx_csum(skb, desc); | ||
4555 | |||
4556 | if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) { | 4552 | if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) { |
4557 | dma_sync_single_for_device(&pdev->dev, addr, | 4553 | dma_sync_single_for_device(&pdev->dev, addr, |
4558 | pkt_size, PCI_DMA_FROMDEVICE); | 4554 | pkt_size, PCI_DMA_FROMDEVICE); |
@@ -4563,6 +4559,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
4563 | tp->Rx_skbuff[entry] = NULL; | 4559 | tp->Rx_skbuff[entry] = NULL; |
4564 | } | 4560 | } |
4565 | 4561 | ||
4562 | rtl8169_rx_csum(skb, status); | ||
4566 | skb_put(skb, pkt_size); | 4563 | skb_put(skb, pkt_size); |
4567 | skb->protocol = eth_type_trans(skb, dev); | 4564 | skb->protocol = eth_type_trans(skb, dev); |
4568 | 4565 | ||
@@ -4630,7 +4627,8 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4630 | } | 4627 | } |
4631 | 4628 | ||
4632 | /* Work around for rx fifo overflow */ | 4629 | /* Work around for rx fifo overflow */ |
4633 | if (unlikely(status & RxFIFOOver)) { | 4630 | if (unlikely(status & RxFIFOOver) && |
4631 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { | ||
4634 | netif_stop_queue(dev); | 4632 | netif_stop_queue(dev); |
4635 | rtl8169_tx_timeout(dev); | 4633 | rtl8169_tx_timeout(dev); |
4636 | break; | 4634 | break; |
@@ -4891,6 +4889,9 @@ static int rtl8169_resume(struct device *device) | |||
4891 | { | 4889 | { |
4892 | struct pci_dev *pdev = to_pci_dev(device); | 4890 | struct pci_dev *pdev = to_pci_dev(device); |
4893 | struct net_device *dev = pci_get_drvdata(pdev); | 4891 | struct net_device *dev = pci_get_drvdata(pdev); |
4892 | struct rtl8169_private *tp = netdev_priv(dev); | ||
4893 | |||
4894 | rtl8169_init_phy(dev, tp); | ||
4894 | 4895 | ||
4895 | if (netif_running(dev)) | 4896 | if (netif_running(dev)) |
4896 | __rtl8169_resume(dev); | 4897 | __rtl8169_resume(dev); |
@@ -4931,6 +4932,8 @@ static int rtl8169_runtime_resume(struct device *device) | |||
4931 | tp->saved_wolopts = 0; | 4932 | tp->saved_wolopts = 0; |
4932 | spin_unlock_irq(&tp->lock); | 4933 | spin_unlock_irq(&tp->lock); |
4933 | 4934 | ||
4935 | rtl8169_init_phy(dev, tp); | ||
4936 | |||
4934 | __rtl8169_resume(dev); | 4937 | __rtl8169_resume(dev); |
4935 | 4938 | ||
4936 | return 0; | 4939 | return 0; |