aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e100.c
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2012-02-11 10:39:35 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-03-01 01:59:53 -0500
commit75f58a537674cdff2122789cfd3cc7a76956ece5 (patch)
tree218c736e7ec39fc7ab3e5f98e5d45f819b07f73e /drivers/net/ethernet/intel/e100.c
parent719cdac54e0237837251a32a3d690bfe9c1e9bed (diff)
e100: Support sending custom Ethernet CRC
This can aid with testing the RX logic for bad CRCs. 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/e100.c')
-rw-r--r--drivers/net/ethernet/intel/e100.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 3ecbdedf6135..6f9f70a04474 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -412,6 +412,10 @@ enum cb_status {
412 cb_ok = 0x2000, 412 cb_ok = 0x2000,
413}; 413};
414 414
415/**
416 * cb_command - Command Block flags
417 * @cb_tx_nc: 0: controler does CRC (normal), 1: CRC from skb memory
418 */
415enum cb_command { 419enum cb_command {
416 cb_nop = 0x0000, 420 cb_nop = 0x0000,
417 cb_iaaddr = 0x0001, 421 cb_iaaddr = 0x0001,
@@ -421,6 +425,7 @@ enum cb_command {
421 cb_ucode = 0x0005, 425 cb_ucode = 0x0005,
422 cb_dump = 0x0006, 426 cb_dump = 0x0006,
423 cb_tx_sf = 0x0008, 427 cb_tx_sf = 0x0008,
428 cb_tx_nc = 0x0010,
424 cb_cid = 0x1f00, 429 cb_cid = 0x1f00,
425 cb_i = 0x2000, 430 cb_i = 0x2000,
426 cb_s = 0x4000, 431 cb_s = 0x4000,
@@ -1724,6 +1729,16 @@ static void e100_xmit_prepare(struct nic *nic, struct cb *cb,
1724 struct sk_buff *skb) 1729 struct sk_buff *skb)
1725{ 1730{
1726 cb->command = nic->tx_command; 1731 cb->command = nic->tx_command;
1732
1733 /*
1734 * Use the last 4 bytes of the SKB payload packet as the CRC, used for
1735 * testing, ie sending frames with bad CRC.
1736 */
1737 if (unlikely(skb->no_fcs))
1738 cb->command |= __constant_cpu_to_le16(cb_tx_nc);
1739 else
1740 cb->command &= ~__constant_cpu_to_le16(cb_tx_nc);
1741
1727 /* interrupt every 16 packets regardless of delay */ 1742 /* interrupt every 16 packets regardless of delay */
1728 if ((nic->cbs_avail & ~15) == nic->cbs_avail) 1743 if ((nic->cbs_avail & ~15) == nic->cbs_avail)
1729 cb->command |= cpu_to_le16(cb_i); 1744 cb->command |= cpu_to_le16(cb_i);
@@ -2778,6 +2793,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2778 return -ENOMEM; 2793 return -ENOMEM;
2779 2794
2780 netdev->hw_features |= NETIF_F_RXFCS; 2795 netdev->hw_features |= NETIF_F_RXFCS;
2796 netdev->priv_flags |= IFF_SUPP_NOFCS;
2781 2797
2782 netdev->netdev_ops = &e100_netdev_ops; 2798 netdev->netdev_ops = &e100_netdev_ops;
2783 SET_ETHTOOL_OPS(netdev, &e100_ethtool_ops); 2799 SET_ETHTOOL_OPS(netdev, &e100_ethtool_ops);