aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-18 15:54:49 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-18 15:54:49 -0500
commitd110ec3a1e1f522e2e9dfceb9c36d6590c26d2d4 (patch)
tree86b2f8f1d22b74b05239525c55bd42e3db6afc03 /drivers/net/e1000e
parent343e9099c8152daff20e10d6269edec21da44fc0 (diff)
parent55dac3a5553b13891f0ae4bbd11920619b5436d4 (diff)
Merge branch 'linus' into core/rcu
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r--drivers/net/e1000e/e1000.h5
-rw-r--r--drivers/net/e1000e/ethtool.c8
-rw-r--r--drivers/net/e1000e/ich8lan.c9
-rw-r--r--drivers/net/e1000e/netdev.c26
-rw-r--r--drivers/net/e1000e/param.c25
5 files changed, 66 insertions, 7 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index c55de1c027af..c55fd6fdb91c 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -299,6 +299,7 @@ struct e1000_adapter {
299 unsigned long led_status; 299 unsigned long led_status;
300 300
301 unsigned int flags; 301 unsigned int flags;
302 unsigned int flags2;
302 struct work_struct downshift_task; 303 struct work_struct downshift_task;
303 struct work_struct update_phy_task; 304 struct work_struct update_phy_task;
304}; 305};
@@ -306,6 +307,7 @@ struct e1000_adapter {
306struct e1000_info { 307struct e1000_info {
307 enum e1000_mac_type mac; 308 enum e1000_mac_type mac;
308 unsigned int flags; 309 unsigned int flags;
310 unsigned int flags2;
309 u32 pba; 311 u32 pba;
310 s32 (*get_variants)(struct e1000_adapter *); 312 s32 (*get_variants)(struct e1000_adapter *);
311 struct e1000_mac_operations *mac_ops; 313 struct e1000_mac_operations *mac_ops;
@@ -347,6 +349,9 @@ struct e1000_info {
347#define FLAG_RX_RESTART_NOW (1 << 30) 349#define FLAG_RX_RESTART_NOW (1 << 30)
348#define FLAG_MSI_TEST_FAILED (1 << 31) 350#define FLAG_MSI_TEST_FAILED (1 << 31)
349 351
352/* CRC Stripping defines */
353#define FLAG2_CRC_STRIPPING (1 << 0)
354
350#define E1000_RX_DESC_PS(R, i) \ 355#define E1000_RX_DESC_PS(R, i) \
351 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) 356 (&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
352#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) 357#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 70c11c811a08..62421ce96311 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1713,7 +1713,8 @@ static void e1000_get_wol(struct net_device *netdev,
1713 wol->supported = 0; 1713 wol->supported = 0;
1714 wol->wolopts = 0; 1714 wol->wolopts = 0;
1715 1715
1716 if (!(adapter->flags & FLAG_HAS_WOL)) 1716 if (!(adapter->flags & FLAG_HAS_WOL) ||
1717 !device_can_wakeup(&adapter->pdev->dev))
1717 return; 1718 return;
1718 1719
1719 wol->supported = WAKE_UCAST | WAKE_MCAST | 1720 wol->supported = WAKE_UCAST | WAKE_MCAST |
@@ -1751,7 +1752,8 @@ static int e1000_set_wol(struct net_device *netdev,
1751 if (wol->wolopts & WAKE_MAGICSECURE) 1752 if (wol->wolopts & WAKE_MAGICSECURE)
1752 return -EOPNOTSUPP; 1753 return -EOPNOTSUPP;
1753 1754
1754 if (!(adapter->flags & FLAG_HAS_WOL)) 1755 if (!(adapter->flags & FLAG_HAS_WOL) ||
1756 !device_can_wakeup(&adapter->pdev->dev))
1755 return wol->wolopts ? -EOPNOTSUPP : 0; 1757 return wol->wolopts ? -EOPNOTSUPP : 0;
1756 1758
1757 /* these settings will always override what we currently have */ 1759 /* these settings will always override what we currently have */
@@ -1770,6 +1772,8 @@ static int e1000_set_wol(struct net_device *netdev,
1770 if (wol->wolopts & WAKE_ARP) 1772 if (wol->wolopts & WAKE_ARP)
1771 adapter->wol |= E1000_WUFC_ARP; 1773 adapter->wol |= E1000_WUFC_ARP;
1772 1774
1775 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
1776
1773 return 0; 1777 return 0;
1774} 1778}
1775 1779
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 523b9716a543..d115a6d30f29 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -1893,12 +1893,17 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
1893 ctrl |= E1000_CTRL_PHY_RST; 1893 ctrl |= E1000_CTRL_PHY_RST;
1894 } 1894 }
1895 ret_val = e1000_acquire_swflag_ich8lan(hw); 1895 ret_val = e1000_acquire_swflag_ich8lan(hw);
1896 /* Whether or not the swflag was acquired, we need to reset the part */
1896 hw_dbg(hw, "Issuing a global reset to ich8lan"); 1897 hw_dbg(hw, "Issuing a global reset to ich8lan");
1897 ew32(CTRL, (ctrl | E1000_CTRL_RST)); 1898 ew32(CTRL, (ctrl | E1000_CTRL_RST));
1898 msleep(20); 1899 msleep(20);
1899 1900
1900 /* release the swflag because it is not reset by hardware reset */ 1901 if (!ret_val) {
1901 e1000_release_swflag_ich8lan(hw); 1902 /* release the swflag because it is not reset by
1903 * hardware reset
1904 */
1905 e1000_release_swflag_ich8lan(hw);
1906 }
1902 1907
1903 ret_val = e1000e_get_auto_rd_done(hw); 1908 ret_val = e1000e_get_auto_rd_done(hw);
1904 if (ret_val) { 1909 if (ret_val) {
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index abd492b7336d..122539a0e1fe 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -345,7 +345,6 @@ no_buffers:
345/** 345/**
346 * e1000_alloc_jumbo_rx_buffers - Replace used jumbo receive buffers 346 * e1000_alloc_jumbo_rx_buffers - Replace used jumbo receive buffers
347 * @adapter: address of board private structure 347 * @adapter: address of board private structure
348 * @rx_ring: pointer to receive ring structure
349 * @cleaned_count: number of buffers to allocate this pass 348 * @cleaned_count: number of buffers to allocate this pass
350 **/ 349 **/
351 350
@@ -499,6 +498,10 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
499 goto next_desc; 498 goto next_desc;
500 } 499 }
501 500
501 /* adjust length to remove Ethernet CRC */
502 if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
503 length -= 4;
504
502 total_rx_bytes += length; 505 total_rx_bytes += length;
503 total_rx_packets++; 506 total_rx_packets++;
504 507
@@ -804,6 +807,10 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
804 pci_dma_sync_single_for_device(pdev, ps_page->dma, 807 pci_dma_sync_single_for_device(pdev, ps_page->dma,
805 PAGE_SIZE, PCI_DMA_FROMDEVICE); 808 PAGE_SIZE, PCI_DMA_FROMDEVICE);
806 809
810 /* remove the CRC */
811 if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
812 l1 -= 4;
813
807 skb_put(skb, l1); 814 skb_put(skb, l1);
808 goto copydone; 815 goto copydone;
809 } /* if */ 816 } /* if */
@@ -825,6 +832,12 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
825 skb->truesize += length; 832 skb->truesize += length;
826 } 833 }
827 834
835 /* strip the ethernet crc, problem is we're using pages now so
836 * this whole operation can get a little cpu intensive
837 */
838 if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
839 pskb_trim(skb, skb->len - 4);
840
828copydone: 841copydone:
829 total_rx_bytes += skb->len; 842 total_rx_bytes += skb->len;
830 total_rx_packets++; 843 total_rx_packets++;
@@ -2301,8 +2314,12 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
2301 else 2314 else
2302 rctl |= E1000_RCTL_LPE; 2315 rctl |= E1000_RCTL_LPE;
2303 2316
2304 /* Enable hardware CRC frame stripping */ 2317 /* Some systems expect that the CRC is included in SMBUS traffic. The
2305 rctl |= E1000_RCTL_SECRC; 2318 * hardware strips the CRC before sending to both SMBUS (BMC) and to
2319 * host memory when this is enabled
2320 */
2321 if (adapter->flags2 & FLAG2_CRC_STRIPPING)
2322 rctl |= E1000_RCTL_SECRC;
2306 2323
2307 /* Setup buffer sizes */ 2324 /* Setup buffer sizes */
2308 rctl &= ~E1000_RCTL_SZ_4096; 2325 rctl &= ~E1000_RCTL_SZ_4096;
@@ -4766,6 +4783,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
4766 adapter->ei = ei; 4783 adapter->ei = ei;
4767 adapter->pba = ei->pba; 4784 adapter->pba = ei->pba;
4768 adapter->flags = ei->flags; 4785 adapter->flags = ei->flags;
4786 adapter->flags2 = ei->flags2;
4769 adapter->hw.adapter = adapter; 4787 adapter->hw.adapter = adapter;
4770 adapter->hw.mac.type = ei->mac; 4788 adapter->hw.mac.type = ei->mac;
4771 adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1; 4789 adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1;
@@ -4970,6 +4988,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
4970 4988
4971 /* initialize the wol settings based on the eeprom settings */ 4989 /* initialize the wol settings based on the eeprom settings */
4972 adapter->wol = adapter->eeprom_wol; 4990 adapter->wol = adapter->eeprom_wol;
4991 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
4973 4992
4974 /* reset the hardware with the new settings */ 4993 /* reset the hardware with the new settings */
4975 e1000e_reset(adapter); 4994 e1000e_reset(adapter);
@@ -5008,6 +5027,7 @@ err_hw_init:
5008err_sw_init: 5027err_sw_init:
5009 if (adapter->hw.flash_address) 5028 if (adapter->hw.flash_address)
5010 iounmap(adapter->hw.flash_address); 5029 iounmap(adapter->hw.flash_address);
5030 e1000e_reset_interrupt_capability(adapter);
5011err_flashmap: 5031err_flashmap:
5012 iounmap(adapter->hw.hw_addr); 5032 iounmap(adapter->hw.hw_addr);
5013err_ioremap: 5033err_ioremap:
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
index 77a3d7207a5f..e909f96698e8 100644
--- a/drivers/net/e1000e/param.c
+++ b/drivers/net/e1000e/param.c
@@ -151,6 +151,16 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
151 */ 151 */
152E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]"); 152E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]");
153 153
154/*
155 * Enable CRC Stripping
156 *
157 * Valid Range: 0, 1
158 *
159 * Default Value: 1 (enabled)
160 */
161E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs " \
162 "the CRC");
163
154struct e1000_option { 164struct e1000_option {
155 enum { enable_option, range_option, list_option } type; 165 enum { enable_option, range_option, list_option } type;
156 const char *name; 166 const char *name;
@@ -404,6 +414,21 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
404 adapter->flags |= FLAG_SMART_POWER_DOWN; 414 adapter->flags |= FLAG_SMART_POWER_DOWN;
405 } 415 }
406 } 416 }
417 { /* CRC Stripping */
418 const struct e1000_option opt = {
419 .type = enable_option,
420 .name = "CRC Stripping",
421 .err = "defaulting to enabled",
422 .def = OPTION_ENABLED
423 };
424
425 if (num_CrcStripping > bd) {
426 unsigned int crc_stripping = CrcStripping[bd];
427 e1000_validate_option(&crc_stripping, &opt, adapter);
428 if (crc_stripping == OPTION_ENABLED)
429 adapter->flags2 |= FLAG2_CRC_STRIPPING;
430 }
431 }
407 { /* Kumeran Lock Loss Workaround */ 432 { /* Kumeran Lock Loss Workaround */
408 const struct e1000_option opt = { 433 const struct e1000_option opt = {
409 .type = enable_option, 434 .type = enable_option,