diff options
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 3eeae1cf994..4f06641cd6d 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -497,6 +497,10 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, | |||
497 | goto next_desc; | 497 | goto next_desc; |
498 | } | 498 | } |
499 | 499 | ||
500 | /* adjust length to remove Ethernet CRC */ | ||
501 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) | ||
502 | length -= 4; | ||
503 | |||
500 | total_rx_bytes += length; | 504 | total_rx_bytes += length; |
501 | total_rx_packets++; | 505 | total_rx_packets++; |
502 | 506 | ||
@@ -802,6 +806,10 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
802 | pci_dma_sync_single_for_device(pdev, ps_page->dma, | 806 | pci_dma_sync_single_for_device(pdev, ps_page->dma, |
803 | PAGE_SIZE, PCI_DMA_FROMDEVICE); | 807 | PAGE_SIZE, PCI_DMA_FROMDEVICE); |
804 | 808 | ||
809 | /* remove the CRC */ | ||
810 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) | ||
811 | l1 -= 4; | ||
812 | |||
805 | skb_put(skb, l1); | 813 | skb_put(skb, l1); |
806 | goto copydone; | 814 | goto copydone; |
807 | } /* if */ | 815 | } /* if */ |
@@ -823,6 +831,12 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | |||
823 | skb->truesize += length; | 831 | skb->truesize += length; |
824 | } | 832 | } |
825 | 833 | ||
834 | /* strip the ethernet crc, problem is we're using pages now so | ||
835 | * this whole operation can get a little cpu intensive | ||
836 | */ | ||
837 | if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) | ||
838 | pskb_trim(skb, skb->len - 4); | ||
839 | |||
826 | copydone: | 840 | copydone: |
827 | total_rx_bytes += skb->len; | 841 | total_rx_bytes += skb->len; |
828 | total_rx_packets++; | 842 | total_rx_packets++; |
@@ -2298,8 +2312,12 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
2298 | else | 2312 | else |
2299 | rctl |= E1000_RCTL_LPE; | 2313 | rctl |= E1000_RCTL_LPE; |
2300 | 2314 | ||
2301 | /* Enable hardware CRC frame stripping */ | 2315 | /* Some systems expect that the CRC is included in SMBUS traffic. The |
2302 | rctl |= E1000_RCTL_SECRC; | 2316 | * hardware strips the CRC before sending to both SMBUS (BMC) and to |
2317 | * host memory when this is enabled | ||
2318 | */ | ||
2319 | if (adapter->flags2 & FLAG2_CRC_STRIPPING) | ||
2320 | rctl |= E1000_RCTL_SECRC; | ||
2303 | 2321 | ||
2304 | /* Setup buffer sizes */ | 2322 | /* Setup buffer sizes */ |
2305 | rctl &= ~E1000_RCTL_SZ_4096; | 2323 | rctl &= ~E1000_RCTL_SZ_4096; |
@@ -4761,6 +4779,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4761 | adapter->ei = ei; | 4779 | adapter->ei = ei; |
4762 | adapter->pba = ei->pba; | 4780 | adapter->pba = ei->pba; |
4763 | adapter->flags = ei->flags; | 4781 | adapter->flags = ei->flags; |
4782 | adapter->flags2 = ei->flags2; | ||
4764 | adapter->hw.adapter = adapter; | 4783 | adapter->hw.adapter = adapter; |
4765 | adapter->hw.mac.type = ei->mac; | 4784 | adapter->hw.mac.type = ei->mac; |
4766 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; | 4785 | adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; |
@@ -4962,6 +4981,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
4962 | 4981 | ||
4963 | /* initialize the wol settings based on the eeprom settings */ | 4982 | /* initialize the wol settings based on the eeprom settings */ |
4964 | adapter->wol = adapter->eeprom_wol; | 4983 | adapter->wol = adapter->eeprom_wol; |
4984 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | ||
4965 | 4985 | ||
4966 | /* reset the hardware with the new settings */ | 4986 | /* reset the hardware with the new settings */ |
4967 | e1000e_reset(adapter); | 4987 | e1000e_reset(adapter); |
@@ -5000,6 +5020,7 @@ err_hw_init: | |||
5000 | err_sw_init: | 5020 | err_sw_init: |
5001 | if (adapter->hw.flash_address) | 5021 | if (adapter->hw.flash_address) |
5002 | iounmap(adapter->hw.flash_address); | 5022 | iounmap(adapter->hw.flash_address); |
5023 | e1000e_reset_interrupt_capability(adapter); | ||
5003 | err_flashmap: | 5024 | err_flashmap: |
5004 | iounmap(adapter->hw.hw_addr); | 5025 | iounmap(adapter->hw.hw_addr); |
5005 | err_ioremap: | 5026 | err_ioremap: |