]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/qla3xxx.c
gianfar: kill unused header
[linux-2.6-omap-h63xx.git] / drivers / net / qla3xxx.c
index d8766c0e825585c230171dcb57cc0a627a791c5f..8be8be451ada960037f8521776066b1b33c12a22 100755 (executable)
@@ -2433,37 +2433,22 @@ static int ql_get_seg_count(struct ql3_adapter *qdev,
        return -1;
 }
 
-static void ql_hw_csum_setup(struct sk_buff *skb,
+static void ql_hw_csum_setup(const struct sk_buff *skb,
                             struct ob_mac_iocb_req *mac_iocb_ptr)
 {
-       struct ethhdr *eth;
-       struct iphdr *ip = NULL;
-       u8 offset = ETH_HLEN;
+       const struct iphdr *ip = ip_hdr(skb);
 
-       eth = (struct ethhdr *)(skb->data);
+       mac_iocb_ptr->ip_hdr_off = skb_network_offset(skb);
+       mac_iocb_ptr->ip_hdr_len = ip->ihl;
 
-       if (eth->h_proto == __constant_htons(ETH_P_IP)) {
-               ip = (struct iphdr *)&skb->data[ETH_HLEN];
-       } else if (eth->h_proto == htons(ETH_P_8021Q) &&
-                  ((struct vlan_ethhdr *)skb->data)->
-                  h_vlan_encapsulated_proto == __constant_htons(ETH_P_IP)) {
-               ip = (struct iphdr *)&skb->data[VLAN_ETH_HLEN];
-               offset = VLAN_ETH_HLEN;
-       }
-
-       if (ip) {
-               if (ip->protocol == IPPROTO_TCP) {
-                       mac_iocb_ptr->flags1 |= OB_3032MAC_IOCB_REQ_TC | 
+       if (ip->protocol == IPPROTO_TCP) {
+               mac_iocb_ptr->flags1 |= OB_3032MAC_IOCB_REQ_TC |
                        OB_3032MAC_IOCB_REQ_IC;
-                       mac_iocb_ptr->ip_hdr_off = offset;
-                       mac_iocb_ptr->ip_hdr_len = ip->ihl;
-               } else if (ip->protocol == IPPROTO_UDP) {
-                       mac_iocb_ptr->flags1 |= OB_3032MAC_IOCB_REQ_UC | 
+       } else {
+               mac_iocb_ptr->flags1 |= OB_3032MAC_IOCB_REQ_UC |
                        OB_3032MAC_IOCB_REQ_IC;
-                       mac_iocb_ptr->ip_hdr_off = offset;
-                       mac_iocb_ptr->ip_hdr_len = ip->ihl;
-               }
        }
+
 }
 
 /*
@@ -4044,7 +4029,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
        if (pci_using_dac)
                ndev->features |= NETIF_F_HIGHDMA;
        if (qdev->device_id == QL3032_DEVICE_ID)
-               ndev->features |= (NETIF_F_HW_CSUM | NETIF_F_SG);
+               ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
 
        qdev->mem_map_registers =
            ioremap_nocache(pci_resource_start(pdev, 1),