fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / ia64 / hp / sim / simeth.c
index 93f4d19..424e925 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co
  *     Stephane Eranian <eranian@hpl.hp.com>
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/types.h>
@@ -20,7 +19,7 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <linux/notifier.h>
-#include <asm/bitops.h>
+#include <linux/bitops.h>
 #include <asm/system.h>
 #include <asm/irq.h>
 
@@ -55,7 +54,7 @@ static int simeth_close(struct net_device *dev);
 static int simeth_tx(struct sk_buff *skb, struct net_device *dev);
 static int simeth_rx(struct net_device *dev);
 static struct net_device_stats *simeth_get_stats(struct net_device *dev);
-static irqreturn_t simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs);
+static irqreturn_t simeth_interrupt(int irq, void *dev_id);
 static void set_multicast_list(struct net_device *dev);
 static int simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr);
 
@@ -88,7 +87,7 @@ static int simeth_debug;              /* set to 1 to get debug information */
  */
 static struct notifier_block simeth_dev_notifier = {
        simeth_device_event,
-       0
+       NULL
 };
 
 
@@ -191,7 +190,7 @@ simeth_probe1(void)
        unsigned char mac_addr[ETH_ALEN];
        struct simeth_local *local;
        struct net_device *dev;
-       int fd, i, err;
+       int fd, i, err, rc;
 
        /*
         * XXX Fix me
@@ -228,7 +227,9 @@ simeth_probe1(void)
                return err;
        }
 
-       dev->irq = assign_irq_vector(AUTO_ASSIGN);
+       if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
+               panic("%s: out of interrupt vectors!\n", __FUNCTION__);
+       dev->irq = rc;
 
        /*
         * attach the interrupt in the simulator, this does enable interrupts
@@ -286,7 +287,7 @@ static __inline__ int dev_is_ethdev(struct net_device *dev)
 static int
 simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
 {
-       struct net_device *dev = (struct net_device *)ptr;
+       struct net_device *dev = ptr;
        struct simeth_local *local;
        struct in_device *in_dev;
        struct in_ifaddr **ifap = NULL;
@@ -319,7 +320,7 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
        }
 
        printk(KERN_INFO "simeth_device_event: %s ipaddr=0x%x\n",
-              dev->name, htonl(ifa->ifa_local));
+              dev->name, ntohl(ifa->ifa_local));
 
        /*
         * XXX Fix me
@@ -330,7 +331,7 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
        local = dev->priv;
        /* now do it for real */
        r = event == NETDEV_UP ?
-               netdev_attach(local->simfd, dev->irq, htonl(ifa->ifa_local)):
+               netdev_attach(local->simfd, dev->irq, ntohl(ifa->ifa_local)):
                netdev_detach(local->simfd);
 
        printk(KERN_INFO "simeth: netdev_attach/detach: event=%s ->%d\n",
@@ -382,7 +383,7 @@ frame_print(unsigned char *from, unsigned char *frame, int len)
 static int
 simeth_tx(struct sk_buff *skb, struct net_device *dev)
 {
-       struct simeth_local *local = (struct simeth_local *)dev->priv;
+       struct simeth_local *local = dev->priv;
 
 #if 0
        /* ensure we have at least ETH_ZLEN bytes (min frame size) */
@@ -446,7 +447,7 @@ simeth_rx(struct net_device *dev)
        int                     len;
        int                     rcv_count = SIMETH_RECV_MAX;
 
-       local = (struct simeth_local *)dev->priv;
+       local = dev->priv;
        /*
         * the loop concept has been borrowed from other drivers
         * looks to me like it's a throttling thing to avoid pushing to many
@@ -496,7 +497,7 @@ simeth_rx(struct net_device *dev)
  * Interrupt handler (Yes, we can do it too !!!)
  */
 static irqreturn_t
-simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+simeth_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = dev_id;
 
@@ -515,7 +516,7 @@ simeth_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 static struct net_device_stats *
 simeth_get_stats(struct net_device *dev)
 {
-       struct simeth_local  *local = (struct simeth_local *) dev->priv;
+       struct simeth_local *local = dev->priv;
 
        return &local->stats;
 }
@@ -527,13 +528,4 @@ set_multicast_list(struct net_device *dev)
        printk(KERN_WARNING "%s: set_multicast_list called\n", dev->name);
 }
 
-#ifdef CONFIG_NET_FASTROUTE
-static int
-simeth_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
-{
-       printk(KERN_WARNING "%s: simeth_accept_fastpath called\n", dev->name);
-       return -1;
-}
-#endif
-
 __initcall(simeth_probe);