diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-05-12 21:05:59 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-05-12 21:05:59 +0000 |
commit | ba2dacab305c598cd4c34a604f8e276bf5bab5ff (patch) | |
tree | 78670a0139bf4d5ace617b29b7eba82bbc74d602 /drivers/net/wan | |
parent | b77bf69998121e689c5e86cc5630d39a0a9ee6ca (diff) |
Merge with Linux 2.3.99-pre7 and various other bits.
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/comx.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/cosa.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/cycx_x25.c | 9 | ||||
-rw-r--r-- | drivers/net/wan/dlci.c | 10 | ||||
-rw-r--r-- | drivers/net/wan/hostess_sv11.c | 85 | ||||
-rw-r--r-- | drivers/net/wan/lapbether.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/lmc/lmc_main.c | 6 | ||||
-rw-r--r-- | drivers/net/wan/sdla_chdlc.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/sdla_fr.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/sdla_ppp.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/sdla_x25.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/sealevel.c | 77 | ||||
-rw-r--r-- | drivers/net/wan/x25_asy.c | 4 |
13 files changed, 83 insertions, 122 deletions
diff --git a/drivers/net/wan/comx.c b/drivers/net/wan/comx.c index 65a810889..4190e2ed4 100644 --- a/drivers/net/wan/comx.c +++ b/drivers/net/wan/comx.c @@ -877,7 +877,7 @@ static int comx_mkdir(struct inode *dir, struct dentry *dentry, int mode) return -ENOMEM; } memset(dev, 0, sizeof(struct net_device)); - dev->name = (char *)new_dir->name; + strcpy(dev->name, (char *)new_dir->name); dev->init = comx_init_dev; if (register_netdevice(dev)) { diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 8e0c5d37d..6d3f6a8a9 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c @@ -588,7 +588,7 @@ static void sppp_channel_init(struct channel_data *chan) memset(chan->pppdev.dev, 0, sizeof(struct net_device)); sppp_attach(&chan->pppdev); d=chan->pppdev.dev; - d->name = chan->name; + strcpy(d->name, chan->name); d->base_addr = chan->cosa->datareg; d->irq = chan->cosa->irq; d->dma = chan->cosa->dma; diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c index f3669aaf9..1103907bd 100644 --- a/drivers/net/wan/cycx_x25.c +++ b/drivers/net/wan/cycx_x25.c @@ -422,7 +422,7 @@ static int new_if (wan_device_t *wandev, struct net_device *dev, } /* prepare network device data space for registration */ - dev->name = chan->name; + strcpy(dev->name, chan->name); dev->init = if_init; dev->priv = chan; @@ -1513,11 +1513,8 @@ static void reset_timer(struct net_device *dev) { x25_channel_t *chan = dev->priv; - if (chan->svc) { - del_timer(&chan->timer); - chan->timer.expires = jiffies + chan->idle_tmout * HZ; - add_timer(&chan->timer); - } + if (chan->svc) + mod_timer(&chan->timer, jiffies+chan->idle_tmout*HZ); } #ifdef CYCLOMX_X25_DEBUG static void x25_dump_config(TX25Config *conf) diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 362e7a36e..af905fc09 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c @@ -441,13 +441,6 @@ int dlci_add(struct dlci_add *dlci) return(-ENOMEM); memset(master, 0, sizeof(*master)); - master->name = kmalloc(strlen(buf) + 1, GFP_KERNEL); - - if (!master->name) - { - kfree(master); - return(-ENOMEM); - } strcpy(master->name, buf); master->init = dlci_init; @@ -456,7 +449,6 @@ int dlci_add(struct dlci_add *dlci) err = register_netdev(master); if (err < 0) { - kfree(master->name); kfree(master); return(err); } @@ -472,7 +464,6 @@ int dlci_add(struct dlci_add *dlci) { unregister_netdev(master); kfree(master->priv); - kfree(master->name); kfree(master); return(err); } @@ -516,7 +507,6 @@ int dlci_del(struct dlci_add *dlci) open_dev[i] = NULL; kfree(master->priv); - kfree(master->name); kfree(master); MOD_DEC_USE_COUNT; diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c index 6220d7fdd..a4d038f05 100644 --- a/drivers/net/wan/hostess_sv11.c +++ b/drivers/net/wan/hostess_sv11.c @@ -44,7 +44,6 @@ struct sv11_device void *if_ptr; /* General purpose pointer (used by SPPP) */ struct z8530_dev sync; struct ppp_device netdev; - char name[16]; }; /* @@ -279,7 +278,6 @@ static struct sv11_device *sv11_init(int iobase, int irq) dev->chanA.netdevice=sv->netdev.dev; dev->chanA.dev=dev; dev->chanB.dev=dev; - dev->name=sv->name; if(dma) { @@ -323,55 +321,48 @@ static struct sv11_device *sv11_init(int iobase, int irq) /* * Now we can take the IRQ */ - - for(i=0;i<999;i++) + if(dev_alloc_name(dev->chanA.netdevice,"hdlc%d")>=0) { - sprintf(sv->name,"hdlc%d", i); - if(dev_get(sv->name)==0) - { - struct net_device *d=dev->chanA.netdevice; - - /* - * Initialise the PPP components - */ - sppp_attach(&sv->netdev); - - /* - * Local fields - */ - sprintf(sv->name,"hdlc%d", i); - - d->name = sv->name; - d->base_addr = iobase; - d->irq = irq; - d->priv = sv; - d->init = NULL; - - d->open = hostess_open; - d->stop = hostess_close; - d->hard_start_xmit = hostess_queue_xmit; - d->get_stats = hostess_get_stats; - d->set_multicast_list = NULL; - d->do_ioctl = hostess_ioctl; + struct net_device *d=dev->chanA.netdevice; + + /* + * Initialise the PPP components + */ + sppp_attach(&sv->netdev); + + /* + * Local fields + */ + + d->base_addr = iobase; + d->irq = irq; + d->priv = sv; + d->init = NULL; + + d->open = hostess_open; + d->stop = hostess_close; + d->hard_start_xmit = hostess_queue_xmit; + d->get_stats = hostess_get_stats; + d->set_multicast_list = NULL; + d->do_ioctl = hostess_ioctl; #ifdef LINUX_21 - d->neigh_setup = hostess_neigh_setup_dev; - dev_init_buffers(d); + d->neigh_setup = hostess_neigh_setup_dev; + dev_init_buffers(d); #else - d->init = return_0; + d->init = return_0; #endif - d->set_mac_address = NULL; - - if(register_netdev(d)==-1) - { - printk(KERN_ERR "%s: unable to register device.\n", - sv->name); - goto fail; - } - - z8530_describe(dev, "I/O", iobase); - dev->active=1; - return sv; - } + d->set_mac_address = NULL; + + if(register_netdev(d)==-1) + { + printk(KERN_ERR "%s: unable to register device.\n", + d->name); + goto fail; + } + + z8530_describe(dev, "I/O", iobase); + dev->active=1; + return sv; } dmafail2: if(dma==1) diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 1fa07475b..826fb02c6 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -441,7 +441,7 @@ static int lapbeth_new_device(struct net_device *dev) } dev->priv = (void *)lapbeth; /* pointer back */ - dev->name = buf; + strcpy(dev->name, buf); dev->init = lapbeth_dev_init; if (register_netdev(dev) != 0) { diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index 931fca21c..ebf339d2e 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c @@ -856,11 +856,6 @@ static struct net_device *lmc_probe1 (struct net_device *dev, unsigned long ioad /* * Switch to common hdlc%d naming. We name by type not by vendor */ -#if LINUX_VERSION_CODE < 0x20363 - dev->name = ((char *) (dev)) + sizeof (struct ppp_device); -#else - dev->name = ((char *) (dev)) + sizeof (struct net_device); -#endif dev_alloc_name(dev, "hdlc%d"); #else @@ -868,7 +863,6 @@ static struct net_device *lmc_probe1 (struct net_device *dev, unsigned long ioad * GCOM uses LMC vendor name so that clients can know which card * to attach to. */ - dev->name = ((char *) (dev)) + sizeof (struct ppp_device); dev_alloc_name(dev, "lmc%d"); #endif diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c index 62881254e..5989cdc47 100644 --- a/drivers/net/wan/sdla_chdlc.c +++ b/drivers/net/wan/sdla_chdlc.c @@ -603,7 +603,7 @@ static int new_if (wan_device_t* wandev, struct net_device* dev, wanif_conf_t* c chdlc_priv_area->mc = conf->mc; /* prepare network device data space for registration */ - dev->name = card->u.c.if_name; + strcpy(dev->name, card->u.c.if_name); dev->init = &if_init; dev->priv = chdlc_priv_area; diff --git a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c index d7a246dd9..ab88a8bb3 100644 --- a/drivers/net/wan/sdla_fr.c +++ b/drivers/net/wan/sdla_fr.c @@ -814,7 +814,7 @@ static int new_if (wan_device_t* wandev, struct net_device* dev, wanif_conf_t* c chan->transmit_length = 0; /* prepare network device data space for registration */ - dev->name = chan->name; + strcpy(dev->name, chan->name); dev->init = &if_init; dev->priv = chan; diff --git a/drivers/net/wan/sdla_ppp.c b/drivers/net/wan/sdla_ppp.c index f8c8fcae2..8c7d5c694 100644 --- a/drivers/net/wan/sdla_ppp.c +++ b/drivers/net/wan/sdla_ppp.c @@ -501,7 +501,7 @@ static int new_if(wan_device_t *wandev, struct net_device *dev, wanif_conf_t *co /* prepare network device data space for registration */ - dev->name = card->u.p.if_name; + strcpy(dev->name, card->u.p.if_name); dev->init = &if_init; dev->priv = ppp_priv_area; diff --git a/drivers/net/wan/sdla_x25.c b/drivers/net/wan/sdla_x25.c index dfb5d36a5..ab70aec0c 100644 --- a/drivers/net/wan/sdla_x25.c +++ b/drivers/net/wan/sdla_x25.c @@ -464,7 +464,7 @@ static int new_if (wan_device_t* wandev, struct net_device* dev, wanif_conf_t* c } /* prepare network device data space for registration */ - dev->name = chan->name; + strcpy(dev->name, chan->name); dev->init = &if_init; dev->priv = chan; return 0; diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c index 8fd2ff105..68b318688 100644 --- a/drivers/net/wan/sealevel.c +++ b/drivers/net/wan/sealevel.c @@ -35,7 +35,6 @@ struct slvl_device void *if_ptr; /* General purpose pointer (used by SPPP) */ struct z8530_channel *chan; struct ppp_device netdev; - char name[16]; int channel; }; @@ -223,7 +222,6 @@ static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, i struct slvl_device *sv; struct slvl_board *b; - int i; unsigned long flags; int u; @@ -306,7 +304,6 @@ static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, i dev->chanB.netdevice=b->dev[1].netdev.dev; dev->chanA.dev=dev; dev->chanB.dev=dev; - dev->name=b->dev[0].name; dev->chanA.txdma=3; dev->chanA.rxdma=1; @@ -350,52 +347,46 @@ static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, i sv=&b->dev[u]; sv->channel = u; - for(i=0;i<999;i++) + if(dev_alloc_name(sv->chan->netdevice,"hdlc%d")>=0) { - sprintf(sv->name,"hdlc%d", i); - if(dev_get(sv->name)==0) - { - struct net_device *d=sv->chan->netdevice; - - /* - * Initialise the PPP components - */ - sppp_attach(&sv->netdev); - - /* - * Local fields - */ - sprintf(sv->name,"hdlc%d", i); - - d->name = sv->name; - d->base_addr = iobase; - d->irq = irq; - d->priv = sv; - d->init = NULL; + struct net_device *d=sv->chan->netdevice; + + /* + * Initialise the PPP components + */ + sppp_attach(&sv->netdev); + + /* + * Local fields + */ - d->open = sealevel_open; - d->stop = sealevel_close; - d->hard_start_xmit = sealevel_queue_xmit; - d->get_stats = sealevel_get_stats; - d->set_multicast_list = NULL; - d->do_ioctl = sealevel_ioctl; + d->base_addr = iobase; + d->irq = irq; + d->priv = sv; + d->init = NULL; + + d->open = sealevel_open; + d->stop = sealevel_close; + d->hard_start_xmit = sealevel_queue_xmit; + d->get_stats = sealevel_get_stats; + d->set_multicast_list = NULL; + d->do_ioctl = sealevel_ioctl; #ifdef LINUX_21 - d->neigh_setup = sealevel_neigh_setup_dev; - dev_init_buffers(d); + d->neigh_setup = sealevel_neigh_setup_dev; + dev_init_buffers(d); #else - d->init = return_0; + d->init = return_0; #endif - d->set_mac_address = NULL; - - if(register_netdev(d)==-1) - { - printk(KERN_ERR "%s: unable to register device.\n", - sv->name); - goto fail_unit; - } + d->set_mac_address = NULL; + + if(register_netdev(d)==-1) + { + printk(KERN_ERR "%s: unable to register device.\n", + d->name); + goto fail_unit; + } - break; - } + break; } } z8530_describe(dev, "I/O", iobase); diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 7b647d663..5651ddeb2 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c @@ -32,7 +32,6 @@ #include "x25_asy.h" typedef struct x25_ctrl { - char if_name[8]; /* "xasy0\0" .. "xasy99999\0" */ struct x25_asy ctrl; /* X.25 things */ struct net_device dev; /* the device */ } x25_asy_ctrl_t; @@ -82,8 +81,7 @@ static inline struct x25_asy *x25_asy_alloc(void) /* Initialize channel control data */ set_bit(SLF_INUSE, &slp->ctrl.flags); slp->ctrl.tty = NULL; - sprintf(slp->if_name, "x25asy%d", i); - slp->dev.name = slp->if_name; + sprintf(slp->dev.name, "x25asy%d", i); slp->dev.base_addr = i; slp->dev.priv = (void*)&(slp->ctrl); slp->dev.next = NULL; |