diff options
author | Ben Greear <greearb@candelatech.com> | 2012-02-11 10:40:01 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-02-24 04:45:57 -0500 |
commit | 11a78dcf35fc20bd6ae57fee11ca0447a62d33a8 (patch) | |
tree | bcf704aec2a4d56152bc4b14fc49fd9e52805bcc /drivers/net/ethernet/intel/e1000 | |
parent | cf955e6c96cb9af2dce7093a8e3a5e808555c8a4 (diff) |
e1000: Support sending custom Ethernet CRC.
Good for testing the RX logic for bad CRC handling.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000')
-rw-r--r-- | drivers/net/ethernet/intel/e1000/e1000_main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index e72dc8175955..bd1d28f4cc9a 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -1067,6 +1067,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
1067 | (hw->mac_type != e1000_82547)) | 1067 | (hw->mac_type != e1000_82547)) |
1068 | netdev->hw_features |= NETIF_F_TSO; | 1068 | netdev->hw_features |= NETIF_F_TSO; |
1069 | 1069 | ||
1070 | netdev->priv_flags |= IFF_SUPP_NOFCS; | ||
1071 | |||
1070 | netdev->features |= netdev->hw_features; | 1072 | netdev->features |= netdev->hw_features; |
1071 | netdev->hw_features |= NETIF_F_RXCSUM; | 1073 | netdev->hw_features |= NETIF_F_RXCSUM; |
1072 | 1074 | ||
@@ -2692,6 +2694,7 @@ set_itr_now: | |||
2692 | #define E1000_TX_FLAGS_VLAN 0x00000002 | 2694 | #define E1000_TX_FLAGS_VLAN 0x00000002 |
2693 | #define E1000_TX_FLAGS_TSO 0x00000004 | 2695 | #define E1000_TX_FLAGS_TSO 0x00000004 |
2694 | #define E1000_TX_FLAGS_IPV4 0x00000008 | 2696 | #define E1000_TX_FLAGS_IPV4 0x00000008 |
2697 | #define E1000_TX_FLAGS_NO_FCS 0x00000010 | ||
2695 | #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 | 2698 | #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 |
2696 | #define E1000_TX_FLAGS_VLAN_SHIFT 16 | 2699 | #define E1000_TX_FLAGS_VLAN_SHIFT 16 |
2697 | 2700 | ||
@@ -2993,6 +2996,9 @@ static void e1000_tx_queue(struct e1000_adapter *adapter, | |||
2993 | txd_upper |= (tx_flags & E1000_TX_FLAGS_VLAN_MASK); | 2996 | txd_upper |= (tx_flags & E1000_TX_FLAGS_VLAN_MASK); |
2994 | } | 2997 | } |
2995 | 2998 | ||
2999 | if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS)) | ||
3000 | txd_lower &= ~(E1000_TXD_CMD_IFCS); | ||
3001 | |||
2996 | i = tx_ring->next_to_use; | 3002 | i = tx_ring->next_to_use; |
2997 | 3003 | ||
2998 | while (count--) { | 3004 | while (count--) { |
@@ -3007,6 +3013,10 @@ static void e1000_tx_queue(struct e1000_adapter *adapter, | |||
3007 | 3013 | ||
3008 | tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd); | 3014 | tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd); |
3009 | 3015 | ||
3016 | /* txd_cmd re-enables FCS, so we'll re-disable it here as desired. */ | ||
3017 | if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS)) | ||
3018 | tx_desc->lower.data &= ~(cpu_to_le32(E1000_TXD_CMD_IFCS)); | ||
3019 | |||
3010 | /* Force memory writes to complete before letting h/w | 3020 | /* Force memory writes to complete before letting h/w |
3011 | * know there are new descriptors to fetch. (Only | 3021 | * know there are new descriptors to fetch. (Only |
3012 | * applicable for weak-ordered memory model archs, | 3022 | * applicable for weak-ordered memory model archs, |
@@ -3222,6 +3232,9 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
3222 | if (likely(skb->protocol == htons(ETH_P_IP))) | 3232 | if (likely(skb->protocol == htons(ETH_P_IP))) |
3223 | tx_flags |= E1000_TX_FLAGS_IPV4; | 3233 | tx_flags |= E1000_TX_FLAGS_IPV4; |
3224 | 3234 | ||
3235 | if (unlikely(skb->no_fcs)) | ||
3236 | tx_flags |= E1000_TX_FLAGS_NO_FCS; | ||
3237 | |||
3225 | count = e1000_tx_map(adapter, tx_ring, skb, first, max_per_txd, | 3238 | count = e1000_tx_map(adapter, tx_ring, skb, first, max_per_txd, |
3226 | nr_frags, mss); | 3239 | nr_frags, mss); |
3227 | 3240 | ||