]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/loopback.c
[S390] cio: Remove remains of _ccw_device_get_device_number().
[linux-2.6-omap-h63xx.git] / drivers / net / loopback.c
index 9265c27b13b295d1754023175b2ed7b970a52e78..6ba6ed2b480add4ec4d37fbdf2c1653997376c78 100644 (file)
@@ -75,7 +75,7 @@ static DEFINE_PER_CPU(struct pcpu_lstats, pcpu_lstats);
 #ifdef LOOPBACK_TSO
 static void emulate_large_send_offload(struct sk_buff *skb)
 {
-       struct iphdr *iph = skb->nh.iph;
+       struct iphdr *iph = ip_hdr(skb);
        struct tcphdr *th = (struct tcphdr *)(skb_network_header(skb) +
                                              (iph->ihl * 4));
        unsigned int doffset = (iph->ihl + th->doff) * 4;
@@ -93,8 +93,9 @@ static void emulate_large_send_offload(struct sk_buff *skb)
                skb_reserve(nskb, 32);
                skb_set_mac_header(nskb, -ETH_HLEN);
                skb_reset_network_header(nskb);
-               iph = nskb->nh.iph;
-               memcpy(nskb->data, skb_network_header(skb), doffset);
+               iph = ip_hdr(nskb);
+               skb_copy_to_linear_data(nskb, skb_network_header(skb),
+                                       doffset);
                if (skb_copy_bits(skb,
                                  doffset + offset,
                                  nskb->data + doffset,
@@ -145,7 +146,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
 #ifdef LOOPBACK_TSO
        if (skb_is_gso(skb)) {
                BUG_ON(skb->protocol != htons(ETH_P_IP));
-               BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP);
+               BUG_ON(ip_hdr(skb)->protocol != IPPROTO_TCP);
 
                emulate_large_send_offload(skb);
                return 0;
@@ -163,11 +164,9 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
        return 0;
 }
 
-static struct net_device_stats loopback_stats;
-
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
-       struct net_device_stats *stats = &loopback_stats;
+       struct net_device_stats *stats = &dev->stats;
        unsigned long bytes = 0;
        unsigned long packets = 0;
        int i;
@@ -207,7 +206,6 @@ static const struct ethtool_ops loopback_ethtool_ops = {
 struct net_device loopback_dev = {
        .name                   = "lo",
        .get_stats              = &get_stats,
-       .priv                   = &loopback_stats,
        .mtu                    = (16 * 1024) + 20 + 20 + 12,
        .hard_start_xmit        = loopback_xmit,
        .hard_header            = eth_header,