]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/igb/igb_main.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / drivers / net / igb / igb_main.c
index bff280eff5e335ec563c732c7b708b567fc60699..928ce8287e6932027fdffdc316962a64f6be73e1 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/netdevice.h>
-#include <linux/tcp.h>
 #include <linux/ipv6.h>
 #include <net/checksum.h>
 #include <net/ip6_checksum.h>
@@ -439,7 +438,7 @@ static int igb_request_irq(struct igb_adapter *adapter)
                err = igb_request_msix(adapter);
                if (!err) {
                        /* enable IAM, auto-mask,
-                        * DO NOT USE EIAME or IAME in legacy mode */
+                        * DO NOT USE EIAM or IAM in legacy mode */
                        wr32(E1000_IAM, IMS_ENABLE_MASK);
                        goto request_done;
                }
@@ -465,14 +464,9 @@ static int igb_request_irq(struct igb_adapter *adapter)
        err = request_irq(adapter->pdev->irq, &igb_intr, IRQF_SHARED,
                          netdev->name, netdev);
 
-       if (err) {
+       if (err)
                dev_err(&adapter->pdev->dev, "Error %d getting interrupt\n",
                        err);
-               goto request_done;
-       }
-
-       /* enable IAM, auto-mask */
-       wr32(E1000_IAM, IMS_ENABLE_MASK);
 
 request_done:
        return err;
@@ -821,7 +815,8 @@ void igb_reset(struct igb_adapter *adapter)
        wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
 
        igb_reset_adaptive(&adapter->hw);
-       adapter->hw.phy.ops.get_phy_info(&adapter->hw);
+       if (adapter->hw.phy.ops.get_phy_info)
+               adapter->hw.phy.ops.get_phy_info(&adapter->hw);
 }
 
 /**
@@ -2057,7 +2052,8 @@ static void igb_set_multi(struct net_device *netdev)
 static void igb_update_phy_info(unsigned long data)
 {
        struct igb_adapter *adapter = (struct igb_adapter *) data;
-       adapter->hw.phy.ops.get_phy_info(&adapter->hw);
+       if (adapter->hw.phy.ops.get_phy_info)
+               adapter->hw.phy.ops.get_phy_info(&adapter->hw);
 }
 
 /**
@@ -2487,10 +2483,24 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
                tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT);
 
                if (skb->ip_summed == CHECKSUM_PARTIAL) {
-                       if (skb->protocol == htons(ETH_P_IP))
+                       switch (skb->protocol) {
+                       case __constant_htons(ETH_P_IP):
                                tu_cmd |= E1000_ADVTXD_TUCMD_IPV4;
-                       if (skb->sk && (skb->sk->sk_protocol == IPPROTO_TCP))
-                               tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
+                               if (ip_hdr(skb)->protocol == IPPROTO_TCP)
+                                       tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
+                               break;
+                       case __constant_htons(ETH_P_IPV6):
+                               /* XXX what about other V6 headers?? */
+                               if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
+                                       tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
+                               break;
+                       default:
+                               if (unlikely(net_ratelimit()))
+                                       dev_warn(&adapter->pdev->dev,
+                                           "partial checksum but proto=%x!\n",
+                                           skb->protocol);
+                               break;
+                       }
                }
 
                context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd);