vserver 1.9.5.x5
[linux-2.6.git] / net / rose / rose_dev.c
index d779e07..a8ed9a1 100644 (file)
 #include <net/ax25.h>
 #include <net/rose.h>
 
-/*
- *     Only allow IP over ROSE frames through if the netrom device is up.
- */
-
-int rose_rx_ip(struct sk_buff *skb, struct net_device *dev)
-{
-       struct net_device_stats *stats = (struct net_device_stats *)dev->priv;
-
-#ifdef CONFIG_INET
-       if (!netif_running(dev)) {
-               stats->rx_errors++;
-               return 0;
-       }
-
-       stats->rx_packets++;
-       stats->rx_bytes += skb->len;
-
-       skb->protocol = htons(ETH_P_IP);
-
-       /* Spoof incoming device */
-       skb->dev      = dev;
-       skb->h.raw    = skb->data;
-       skb->nh.raw   = skb->data;
-       skb->pkt_type = PACKET_HOST;
-
-       ip_rcv(skb, skb->dev, NULL);
-#else
-       kfree_skb(skb);
-#endif
-       return 1;
-}
-
 static int rose_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
        void *daddr, void *saddr, unsigned len)
 {
@@ -89,7 +57,7 @@ static int rose_header(struct sk_buff *skb, struct net_device *dev, unsigned sho
 static int rose_rebuild_header(struct sk_buff *skb)
 {
        struct net_device *dev = skb->dev;
-       struct net_device_stats *stats = (struct net_device_stats *)dev->priv;
+       struct net_device_stats *stats = netdev_priv(dev);
        unsigned char *bp = (unsigned char *)skb->data;
        struct sk_buff *skbn;
 
@@ -149,7 +117,7 @@ static int rose_close(struct net_device *dev)
 
 static int rose_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct net_device_stats *stats = (struct net_device_stats *)dev->priv;
+       struct net_device_stats *stats = netdev_priv(dev);
 
        if (!netif_running(dev)) {
                printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n");
@@ -162,7 +130,7 @@ static int rose_xmit(struct sk_buff *skb, struct net_device *dev)
 
 static struct net_device_stats *rose_get_stats(struct net_device *dev)
 {
-       return (struct net_device_stats *)dev->priv;
+       return netdev_priv(dev);
 }
 
 void rose_setup(struct net_device *dev)