X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fia64%2Fhp%2Fsim%2Fsimeth.c;h=424e9257c9a09e2b5257a02f89ccc056df692e79;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=93f4d190c4b689e51f2afb330d9204d5ece96f59;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c index 93f4d190c..424e9257c 100644 --- a/arch/ia64/hp/sim/simeth.c +++ b/arch/ia64/hp/sim/simeth.c @@ -4,7 +4,6 @@ * Copyright (C) 1999-2001, 2003 Hewlett-Packard Co * Stephane Eranian */ -#include #include #include #include @@ -20,7 +19,7 @@ #include #include #include -#include +#include #include #include @@ -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);