patch-2.3.34 linux/drivers/net/wan/sealevel.c
Next file: linux/drivers/net/wan/syncppp.c
Previous file: linux/drivers/net/wan/hostess_sv11.c
Back to the patch index
Back to the overall index
- Lines: 69
- Date:
Mon Dec 20 15:07:08 1999
- Orig file:
v2.3.33/linux/drivers/net/wan/sealevel.c
- Orig date:
Mon Oct 11 15:38:15 1999
diff -u --recursive --new-file v2.3.33/linux/drivers/net/wan/sealevel.c linux/drivers/net/wan/sealevel.c
@@ -32,6 +32,7 @@
struct slvl_device
{
+ void *if_ptr; /* General purpose pointer (used by SPPP) */
struct z8530_channel *chan;
struct ppp_device netdev;
char name[16];
@@ -243,8 +244,19 @@
memset(b, 0, sizeof(*sv));
b->dev[0].chan = &b->board.chanA;
+ b->dev[0].if_ptr = &b->dev[0].netdev;
+ b->dev[0].netdev.dev=(struct net_device *)
+ kmalloc(sizeof(struct net_device), GFP_KERNEL);
+ if(!b->dev[0].netdev.dev)
+ goto fail2;
+
b->dev[1].chan = &b->board.chanB;
-
+ b->dev[1].if_ptr = &b->dev[1].netdev;
+ b->dev[1].netdev.dev=(struct net_device *)
+ kmalloc(sizeof(struct net_device), GFP_KERNEL);
+ if(!b->dev[1].netdev.dev)
+ goto fail1_0;
+
dev=&b->board;
/*
@@ -283,14 +295,14 @@
if(request_irq(irq, &z8530_interrupt, SA_INTERRUPT, "SeaLevel", dev)<0)
{
printk(KERN_WARNING "sealevel: IRQ %d already in use.\n", irq);
- goto fail2;
+ goto fail1_1;
}
dev->irq=irq;
dev->chanA.private=&b->dev[0];
dev->chanB.private=&b->dev[1];
- dev->chanA.netdevice=&b->dev[0].netdev.dev;
- dev->chanB.netdevice=&b->dev[1].netdev.dev;
+ dev->chanA.netdevice=b->dev[0].netdev.dev;
+ dev->chanB.netdevice=b->dev[1].netdev.dev;
dev->chanA.dev=dev;
dev->chanB.dev=dev;
dev->name=b->dev[0].name;
@@ -399,6 +411,10 @@
free_dma(dev->chanA.txdma);
fail:
free_irq(irq, dev);
+fail1_1:
+ kfree(b->dev[1].netdev.dev);
+fail1_0:
+ kfree(b->dev[0].netdev.dev);
fail2:
kfree(b);
fail3:
@@ -414,8 +430,8 @@
for(u=0; u<2; u++)
{
- sppp_detach(&b->dev[u].netdev.dev);
- unregister_netdev(&b->dev[u].netdev.dev);
+ sppp_detach(b->dev[u].netdev.dev);
+ unregister_netdev(b->dev[u].netdev.dev);
}
free_irq(b->board.irq, &b->board);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)