diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2008-07-21 19:44:09 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-22 17:52:54 -0400 |
commit | cd1f8160e015cd1538701b7de216cbeaefc6b0a8 (patch) | |
tree | da264cfcbca7c5cc2989349a4536021204aa5c46 /drivers/net/netxen/netxen_nic_hw.c | |
parent | d9e651bc06690c5a5326e8d019fa7668409bc819 (diff) | |
download | op-kernel-dev-cd1f8160e015cd1538701b7de216cbeaefc6b0a8.zip op-kernel-dev-cd1f8160e015cd1538701b7de216cbeaefc6b0a8.tar.gz |
netxen: enable tso6, intr coalescing.
Enable tso6 and ipv6 checksum, interrupt coalescing for NX3031.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 9d4e9c9..ed8aa5a 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c @@ -615,6 +615,33 @@ void netxen_p3_nic_set_multi(struct net_device *netdev) } } +#define NETXEN_CONFIG_INTR_COALESCE 3 + +/* + * Send the interrupt coalescing parameter set by ethtool to the card. + */ +int netxen_config_intr_coalesce(struct netxen_adapter *adapter) +{ + nx_nic_req_t req; + int rv; + + memset(&req, 0, sizeof(nx_nic_req_t)); + + req.qhdr |= (NIC_REQUEST << 23); + req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE; + req.req_hdr |= ((u64)adapter->portnum << 16); + + memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal)); + + rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); + if (rv != 0) { + printk(KERN_ERR "ERROR. Could not send " + "interrupt coalescing parameters\n"); + } + + return rv; +} + /* * netxen_nic_change_mtu - Change the Maximum Transfer Unit * @returns 0 on success, negative on failure @@ -651,26 +678,6 @@ int netxen_nic_change_mtu(struct net_device *netdev, int mtu) return 0; } -void netxen_tso_check(struct netxen_adapter *adapter, - struct cmd_desc_type0 *desc, struct sk_buff *skb) -{ - if (desc->mss) { - desc->total_hdr_length = (sizeof(struct ethhdr) + - ip_hdrlen(skb) + tcp_hdrlen(skb)); - netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO); - } else if (skb->ip_summed == CHECKSUM_PARTIAL) { - if (ip_hdr(skb)->protocol == IPPROTO_TCP) { - netxen_set_cmd_desc_opcode(desc, TX_TCP_PKT); - } else if (ip_hdr(skb)->protocol == IPPROTO_UDP) { - netxen_set_cmd_desc_opcode(desc, TX_UDP_PKT); - } else { - return; - } - } - desc->tcp_hdr_offset = skb_transport_offset(skb); - desc->ip_hdr_offset = skb_network_offset(skb); -} - int netxen_is_flash_supported(struct netxen_adapter *adapter) { const int locs[] = { 0, 0x4, 0x100, 0x4000, 0x4128 }; |