Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / net / rose / rose_dev.c
index d779e07..2a1bf8e 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,12 +130,11 @@ 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)
 {
-       SET_MODULE_OWNER(dev);
        dev->mtu                = ROSE_MAX_PACKET_SIZE - 2;
        dev->hard_start_xmit    = rose_xmit;
        dev->open               = rose_open;
@@ -181,6 +148,6 @@ void rose_setup(struct net_device *dev)
        dev->set_mac_address    = rose_set_mac_address;
 
        /* New-style flags. */
-       dev->flags              = 0;
+       dev->flags              = IFF_NOARP;
        dev->get_stats = rose_get_stats;
 }