aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@netinsight.net>2009-11-25 17:10:52 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-26 18:51:25 -0500
commitb06f78f4d06988aca2353fba6376c25726d7e236 (patch)
tree8c3a970a303b3217d55a21520aa3edbfe24fb1ef /drivers/net
parentc79992fddee28bbd31b35ac297e1068d32930179 (diff)
via-velocity: Set tx checksum from ethtool instead of module parameter
Defaults to on (as before). Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/via-velocity.c18
-rw-r--r--drivers/net/via-velocity.h1
2 files changed, 4 insertions, 15 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index a8009c217bd6..d4eac2a14427 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -297,14 +297,6 @@ VELOCITY_PARAM(DMA_length, "DMA length");
297*/ 297*/
298VELOCITY_PARAM(IP_byte_align, "Enable IP header dword aligned"); 298VELOCITY_PARAM(IP_byte_align, "Enable IP header dword aligned");
299 299
300#define TX_CSUM_DEF 1
301/* txcsum_offload[] is used for setting the checksum offload ability of NIC.
302 (We only support RX checksum offload now)
303 0: disable csum_offload[checksum offload
304 1: enable checksum offload. (Default)
305*/
306VELOCITY_PARAM(txcsum_offload, "Enable transmit packet checksum offload");
307
308#define FLOW_CNTL_DEF 1 300#define FLOW_CNTL_DEF 1
309#define FLOW_CNTL_MIN 1 301#define FLOW_CNTL_MIN 1
310#define FLOW_CNTL_MAX 5 302#define FLOW_CNTL_MAX 5
@@ -490,7 +482,6 @@ static void __devinit velocity_get_options(struct velocity_opt *opts, int index,
490 velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname); 482 velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname);
491 velocity_set_int_opt(&opts->numtx, TxDescriptors[index], TX_DESC_MIN, TX_DESC_MAX, TX_DESC_DEF, "TxDescriptors", devname); 483 velocity_set_int_opt(&opts->numtx, TxDescriptors[index], TX_DESC_MIN, TX_DESC_MAX, TX_DESC_DEF, "TxDescriptors", devname);
492 484
493 velocity_set_bool_opt(&opts->flags, txcsum_offload[index], TX_CSUM_DEF, VELOCITY_FLAGS_TX_CSUM, "txcsum_offload", devname);
494 velocity_set_int_opt(&opts->flow_cntl, flow_control[index], FLOW_CNTL_MIN, FLOW_CNTL_MAX, FLOW_CNTL_DEF, "flow_control", devname); 485 velocity_set_int_opt(&opts->flow_cntl, flow_control[index], FLOW_CNTL_MIN, FLOW_CNTL_MAX, FLOW_CNTL_DEF, "flow_control", devname);
495 velocity_set_bool_opt(&opts->flags, IP_byte_align[index], IP_ALIG_DEF, VELOCITY_FLAGS_IP_ALIGN, "IP_byte_align", devname); 486 velocity_set_bool_opt(&opts->flags, IP_byte_align[index], IP_ALIG_DEF, VELOCITY_FLAGS_IP_ALIGN, "IP_byte_align", devname);
496 velocity_set_bool_opt(&opts->flags, ValPktLen[index], VAL_PKT_LEN_DEF, VELOCITY_FLAGS_VAL_PKT_LEN, "ValPktLen", devname); 487 velocity_set_bool_opt(&opts->flags, ValPktLen[index], VAL_PKT_LEN_DEF, VELOCITY_FLAGS_VAL_PKT_LEN, "ValPktLen", devname);
@@ -2593,7 +2584,7 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb,
2593 /* 2584 /*
2594 * Handle hardware checksum 2585 * Handle hardware checksum
2595 */ 2586 */
2596 if ((vptr->flags & VELOCITY_FLAGS_TX_CSUM) 2587 if ( (dev->features & NETIF_F_IP_CSUM)
2597 && (skb->ip_summed == CHECKSUM_PARTIAL)) { 2588 && (skb->ip_summed == CHECKSUM_PARTIAL)) {
2598 const struct iphdr *ip = ip_hdr(skb); 2589 const struct iphdr *ip = ip_hdr(skb);
2599 if (ip->protocol == IPPROTO_TCP) 2590 if (ip->protocol == IPPROTO_TCP)
@@ -2838,10 +2829,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
2838 netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT); 2829 netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT);
2839 2830
2840 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | 2831 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER |
2841 NETIF_F_HW_VLAN_RX; 2832 NETIF_F_HW_VLAN_RX | NETIF_F_IP_CSUM;
2842
2843 if (vptr->flags & VELOCITY_FLAGS_TX_CSUM)
2844 dev->features |= NETIF_F_IP_CSUM;
2845 2833
2846 ret = register_netdev(dev); 2834 ret = register_netdev(dev);
2847 if (ret < 0) 2835 if (ret < 0)
@@ -3392,6 +3380,8 @@ static const struct ethtool_ops velocity_ethtool_ops = {
3392 .get_settings = velocity_get_settings, 3380 .get_settings = velocity_get_settings,
3393 .set_settings = velocity_set_settings, 3381 .set_settings = velocity_set_settings,
3394 .get_drvinfo = velocity_get_drvinfo, 3382 .get_drvinfo = velocity_get_drvinfo,
3383 .set_tx_csum = ethtool_op_set_tx_csum,
3384 .get_tx_csum = ethtool_op_get_tx_csum,
3395 .get_wol = velocity_ethtool_get_wol, 3385 .get_wol = velocity_ethtool_get_wol,
3396 .set_wol = velocity_ethtool_set_wol, 3386 .set_wol = velocity_ethtool_set_wol,
3397 .get_msglevel = velocity_get_msglevel, 3387 .get_msglevel = velocity_get_msglevel,
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h
index d37a30329312..4e28fd6fb366 100644
--- a/drivers/net/via-velocity.h
+++ b/drivers/net/via-velocity.h
@@ -1423,7 +1423,6 @@ enum velocity_msg_level {
1423 */ 1423 */
1424 1424
1425#define VELOCITY_FLAGS_TAGGING 0x00000001UL 1425#define VELOCITY_FLAGS_TAGGING 0x00000001UL
1426#define VELOCITY_FLAGS_TX_CSUM 0x00000002UL
1427#define VELOCITY_FLAGS_RX_CSUM 0x00000004UL 1426#define VELOCITY_FLAGS_RX_CSUM 0x00000004UL
1428#define VELOCITY_FLAGS_IP_ALIGN 0x00000008UL 1427#define VELOCITY_FLAGS_IP_ALIGN 0x00000008UL
1429#define VELOCITY_FLAGS_VAL_PKT_LEN 0x00000010UL 1428#define VELOCITY_FLAGS_VAL_PKT_LEN 0x00000010UL