aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c47
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 9d4e9c9dbe0a..ed8aa5ab2668 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)
615 } 615 }
616} 616}
617 617
618#define NETXEN_CONFIG_INTR_COALESCE 3
619
620/*
621 * Send the interrupt coalescing parameter set by ethtool to the card.
622 */
623int netxen_config_intr_coalesce(struct netxen_adapter *adapter)
624{
625 nx_nic_req_t req;
626 int rv;
627
628 memset(&req, 0, sizeof(nx_nic_req_t));
629
630 req.qhdr |= (NIC_REQUEST << 23);
631 req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE;
632 req.req_hdr |= ((u64)adapter->portnum << 16);
633
634 memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal));
635
636 rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
637 if (rv != 0) {
638 printk(KERN_ERR "ERROR. Could not send "
639 "interrupt coalescing parameters\n");
640 }
641
642 return rv;
643}
644
618/* 645/*
619 * netxen_nic_change_mtu - Change the Maximum Transfer Unit 646 * netxen_nic_change_mtu - Change the Maximum Transfer Unit
620 * @returns 0 on success, negative on failure 647 * @returns 0 on success, negative on failure
@@ -651,26 +678,6 @@ int netxen_nic_change_mtu(struct net_device *netdev, int mtu)
651 return 0; 678 return 0;
652} 679}
653 680
654void netxen_tso_check(struct netxen_adapter *adapter,
655 struct cmd_desc_type0 *desc, struct sk_buff *skb)
656{
657 if (desc->mss) {
658 desc->total_hdr_length = (sizeof(struct ethhdr) +
659 ip_hdrlen(skb) + tcp_hdrlen(skb));
660 netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO);
661 } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
662 if (ip_hdr(skb)->protocol == IPPROTO_TCP) {
663 netxen_set_cmd_desc_opcode(desc, TX_TCP_PKT);
664 } else if (ip_hdr(skb)->protocol == IPPROTO_UDP) {
665 netxen_set_cmd_desc_opcode(desc, TX_UDP_PKT);
666 } else {
667 return;
668 }
669 }
670 desc->tcp_hdr_offset = skb_transport_offset(skb);
671 desc->ip_hdr_offset = skb_network_offset(skb);
672}
673
674int netxen_is_flash_supported(struct netxen_adapter *adapter) 681int netxen_is_flash_supported(struct netxen_adapter *adapter)
675{ 682{
676 const int locs[] = { 0, 0x4, 0x100, 0x4000, 0x4128 }; 683 const int locs[] = { 0, 0x4, 0x100, 0x4000, 0x4128 };