include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / net / arcnet / rfc1051.c
index 2de8877..f81db40 100644 (file)
@@ -24,6 +24,7 @@
  * **********************
  */
 #include <linux/module.h>
+#include <linux/gfp.h>
 #include <linux/init.h>
 #include <linux/if_arp.h>
 #include <net/arp.h>
@@ -34,7 +35,7 @@
 #define VERSION "arcnet: RFC1051 \"simple standard\" (`s') encapsulation support loaded.\n"
 
 
-static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev);
+static __be16 type_trans(struct sk_buff *skb, struct net_device *dev);
 static void rx(struct net_device *dev, int bufnum,
               struct archdr *pkthdr, int length);
 static int build_header(struct sk_buff *skb, struct net_device *dev,
@@ -86,9 +87,8 @@ MODULE_LICENSE("GPL");
  * 
  * With ARCnet we have to convert everything to Ethernet-style stuff.
  */
-static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
+static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
 {
-       struct arcnet_local *lp = dev->priv;
        struct archdr *pkt = (struct archdr *) skb->data;
        struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
        int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
@@ -112,8 +112,8 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
                return htons(ETH_P_ARP);
 
        default:
-               lp->stats.rx_errors++;
-               lp->stats.rx_crc_errors++;
+               dev->stats.rx_errors++;
+               dev->stats.rx_crc_errors++;
                return 0;
        }
 
@@ -125,7 +125,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
 static void rx(struct net_device *dev, int bufnum,
               struct archdr *pkthdr, int length)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        struct sk_buff *skb;
        struct archdr *pkt = pkthdr;
        int ofs;
@@ -140,7 +140,7 @@ static void rx(struct net_device *dev, int bufnum,
        skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
        if (skb == NULL) {
                BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
-               lp->stats.rx_dropped++;
+               dev->stats.rx_dropped++;
                return;
        }
        skb_put(skb, length + ARC_HDR_SIZE);
@@ -159,7 +159,6 @@ static void rx(struct net_device *dev, int bufnum,
 
        skb->protocol = type_trans(skb, dev);
        netif_rx(skb);
-       dev->last_rx = jiffies;
 }
 
 
@@ -169,7 +168,6 @@ static void rx(struct net_device *dev, int bufnum,
 static int build_header(struct sk_buff *skb, struct net_device *dev,
                        unsigned short type, uint8_t daddr)
 {
-       struct arcnet_local *lp = dev->priv;
        int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
        struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size);
        struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
@@ -185,8 +183,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
        default:
                BUGMSG(D_NORMAL, "RFC1051: I don't understand protocol %d (%Xh)\n",
                       type, type);
-               lp->stats.tx_errors++;
-               lp->stats.tx_aborted_errors++;
+               dev->stats.tx_errors++;
+               dev->stats.tx_aborted_errors++;
                return 0;
        }
 
@@ -220,7 +218,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
                      int bufnum)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        struct arc_hardware *hard = &pkt->hard;
        int ofs;