Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
[pandora-kernel.git] / drivers / s390 / net / qeth_main.c
index d502b77..ad7792d 100644 (file)
@@ -2278,7 +2278,7 @@ qeth_type_trans(struct sk_buff *skb, struct net_device *dev)
            (card->info.link_type == QETH_LINK_TYPE_LANE_TR))
                return tr_type_trans(skb,dev);
 #endif /* CONFIG_TR */
-       skb->mac.raw = skb->data;
+       skb_reset_mac_header(skb);
        skb_pull(skb, ETH_HLEN );
        eth = eth_hdr(skb);
 
@@ -2306,7 +2306,7 @@ qeth_rebuild_skb_fake_ll_tr(struct qeth_card *card, struct sk_buff *skb,
        struct iphdr *ip_hdr;
 
        QETH_DBF_TEXT(trace,5,"skbfktr");
-       skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_TR;
+       skb_set_mac_header(skb, -QETH_FAKE_LL_LEN_TR);
        /* this is a fake ethernet header */
        fake_hdr = tr_hdr(skb);
 
@@ -2359,7 +2359,7 @@ qeth_rebuild_skb_fake_ll_eth(struct qeth_card *card, struct sk_buff *skb,
        struct iphdr *ip_hdr;
 
        QETH_DBF_TEXT(trace,5,"skbfketh");
-       skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_ETH;
+       skb_set_mac_header(skb, -QETH_FAKE_LL_LEN_ETH);
        /* this is a fake ethernet header */
        fake_hdr = eth_hdr(skb);
 
@@ -2461,7 +2461,7 @@ qeth_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
        if (card->options.fake_ll)
                qeth_rebuild_skb_fake_ll(card, skb, hdr);
        else
-               skb->mac.raw = skb->data;
+               skb_reset_mac_header(skb);
        skb->ip_summed = card->options.checksum_type;
        if (card->options.checksum_type == HW_CHECKSUMMING){
                if ( (hdr->hdr.l3.ext_flags &
@@ -2501,7 +2501,8 @@ qeth_process_inbound_buffer(struct qeth_card *card,
                        vlan_tag = qeth_rebuild_skb(card, skb, hdr);
                else { /*in case of OSN*/
                        skb_push(skb, sizeof(struct qeth_hdr));
-                       memcpy(skb->data, hdr, sizeof(struct qeth_hdr));
+                       skb_copy_to_linear_data(skb, hdr,
+                                               sizeof(struct qeth_hdr));
                }
                /* is device UP ? */
                if (!(card->dev->flags & IFF_UP)){
@@ -3778,9 +3779,11 @@ qeth_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
        }
        /* try something else */
        if (skb->protocol == ETH_P_IPV6)
-               return (skb->nh.raw[24] == 0xff) ? RTN_MULTICAST : 0;
+               return (skb_network_header(skb)[24] == 0xff) ?
+                               RTN_MULTICAST : 0;
        else if (skb->protocol == ETH_P_IP)
-               return ((skb->nh.raw[16] & 0xf0) == 0xe0) ? RTN_MULTICAST : 0;
+               return ((skb_network_header(skb)[16] & 0xf0) == 0xe0) ?
+                               RTN_MULTICAST : 0;
        /* ... */
        if (!memcmp(skb->data, skb->dev->broadcast, 6))
                return RTN_BROADCAST;
@@ -3818,18 +3821,20 @@ qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
                        return card->info.is_multicast_different &
                                (card->qdio.no_out_queues - 1);
                if (card->qdio.do_prio_queueing && (ipv == 4)) {
+                       const u8 tos = ip_hdr(skb)->tos;
+
                        if (card->qdio.do_prio_queueing==QETH_PRIO_Q_ING_TOS){
-                               if (skb->nh.iph->tos & IP_TOS_NOTIMPORTANT)
+                               if (tos & IP_TOS_NOTIMPORTANT)
                                        return 3;
-                               if (skb->nh.iph->tos & IP_TOS_HIGHRELIABILITY)
+                               if (tos & IP_TOS_HIGHRELIABILITY)
                                        return 2;
-                               if (skb->nh.iph->tos & IP_TOS_HIGHTHROUGHPUT)
+                               if (tos & IP_TOS_HIGHTHROUGHPUT)
                                        return 1;
-                               if (skb->nh.iph->tos & IP_TOS_LOWDELAY)
+                               if (tos & IP_TOS_LOWDELAY)
                                        return 0;
                        }
                        if (card->qdio.do_prio_queueing==QETH_PRIO_Q_ING_PREC)
-                               return 3 - (skb->nh.iph->tos >> 6);
+                               return 3 - (tos >> 6);
                } else if (card->qdio.do_prio_queueing && (ipv == 6)) {
                        /* TODO: IPv6!!! */
                }
@@ -3866,9 +3871,9 @@ __qeth_prepare_skb(struct qeth_card *card, struct sk_buff *skb, int ipv)
                 * memcpys instead of one memmove to save cycles.
                 */
                skb_push(skb, VLAN_HLEN);
-               memcpy(skb->data, skb->data + 4, 4);
-               memcpy(skb->data + 4, skb->data + 8, 4);
-               memcpy(skb->data + 8, skb->data + 12, 4);
+               skb_copy_to_linear_data(skb, skb->data + 4, 4);
+               skb_copy_to_linear_data_offset(skb, 4, skb->data + 8, 4);
+               skb_copy_to_linear_data_offset(skb, 8, skb->data + 12, 4);
                tag = (u16 *)(skb->data + 12);
                /*
                 * first two bytes  = ETH_P_8021Q (0x8100)
@@ -4039,7 +4044,8 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
                            *((u32 *) skb->dst->neighbour->primary_key);
                } else {
                        /* fill in destination address used in ip header */
-                       *((u32 *) (&hdr->hdr.l3.dest_addr[12])) = skb->nh.iph->daddr;
+                       *((u32 *)(&hdr->hdr.l3.dest_addr[12])) =
+                                                          ip_hdr(skb)->daddr;
                }
        } else if (ipv == 6) { /* IPv6 or passthru */
                hdr->hdr.l3.flags = qeth_get_qeth_hdr_flags6(cast_type);
@@ -4048,7 +4054,8 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
                               skb->dst->neighbour->primary_key, 16);
                } else {
                        /* fill in destination address used in ip header */
-                       memcpy(hdr->hdr.l3.dest_addr, &skb->nh.ipv6h->daddr, 16);
+                       memcpy(hdr->hdr.l3.dest_addr,
+                              &ipv6_hdr(skb)->daddr, 16);
                }
        } else { /* passthrough */
                 if((skb->dev->type == ARPHRD_IEEE802_TR) &&