aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/dlci.c42
-rw-r--r--drivers/net/wan/lmc/lmc_main.c4
-rw-r--r--drivers/net/wan/n2.c4
-rw-r--r--drivers/net/wan/pc300_drv.c18
-rw-r--r--drivers/net/wan/pc300_tty.c2
-rw-r--r--drivers/net/wan/sdla.c108
-rw-r--r--drivers/net/wan/x25_asy.c2
7 files changed, 90 insertions, 90 deletions
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 421d0715310e..1481a446fefb 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -97,11 +97,11 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev,
97 97
98 dest = skb_push(skb, hlen); 98 dest = skb_push(skb, hlen);
99 if (!dest) 99 if (!dest)
100 return(0); 100 return 0;
101 101
102 memcpy(dest, &hdr, hlen); 102 memcpy(dest, &hdr, hlen);
103 103
104 return(hlen); 104 return hlen;
105} 105}
106 106
107static void dlci_receive(struct sk_buff *skb, struct net_device *dev) 107static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
@@ -211,14 +211,14 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in
211 if (copy_from_user(&config, conf, sizeof(struct dlci_conf))) 211 if (copy_from_user(&config, conf, sizeof(struct dlci_conf)))
212 return -EFAULT; 212 return -EFAULT;
213 if (config.flags & ~DLCI_VALID_FLAGS) 213 if (config.flags & ~DLCI_VALID_FLAGS)
214 return(-EINVAL); 214 return -EINVAL;
215 memcpy(&dlp->config, &config, sizeof(struct dlci_conf)); 215 memcpy(&dlp->config, &config, sizeof(struct dlci_conf));
216 dlp->configured = 1; 216 dlp->configured = 1;
217 } 217 }
218 218
219 err = (*flp->dlci_conf)(dlp->slave, dev, get); 219 err = (*flp->dlci_conf)(dlp->slave, dev, get);
220 if (err) 220 if (err)
221 return(err); 221 return err;
222 222
223 if (get) 223 if (get)
224 { 224 {
@@ -226,7 +226,7 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in
226 return -EFAULT; 226 return -EFAULT;
227 } 227 }
228 228
229 return(0); 229 return 0;
230} 230}
231 231
232static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 232static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -234,7 +234,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
234 struct dlci_local *dlp; 234 struct dlci_local *dlp;
235 235
236 if (!capable(CAP_NET_ADMIN)) 236 if (!capable(CAP_NET_ADMIN))
237 return(-EPERM); 237 return -EPERM;
238 238
239 dlp = netdev_priv(dev); 239 dlp = netdev_priv(dev);
240 240
@@ -242,7 +242,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
242 { 242 {
243 case DLCI_GET_SLAVE: 243 case DLCI_GET_SLAVE:
244 if (!*(short *)(dev->dev_addr)) 244 if (!*(short *)(dev->dev_addr))
245 return(-EINVAL); 245 return -EINVAL;
246 246
247 strncpy(ifr->ifr_slave, dlp->slave->name, sizeof(ifr->ifr_slave)); 247 strncpy(ifr->ifr_slave, dlp->slave->name, sizeof(ifr->ifr_slave));
248 break; 248 break;
@@ -250,15 +250,15 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
250 case DLCI_GET_CONF: 250 case DLCI_GET_CONF:
251 case DLCI_SET_CONF: 251 case DLCI_SET_CONF:
252 if (!*(short *)(dev->dev_addr)) 252 if (!*(short *)(dev->dev_addr))
253 return(-EINVAL); 253 return -EINVAL;
254 254
255 return(dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF)); 255 return dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF);
256 break; 256 break;
257 257
258 default: 258 default:
259 return(-EOPNOTSUPP); 259 return -EOPNOTSUPP;
260 } 260 }
261 return(0); 261 return 0;
262} 262}
263 263
264static int dlci_change_mtu(struct net_device *dev, int new_mtu) 264static int dlci_change_mtu(struct net_device *dev, int new_mtu)
@@ -277,15 +277,15 @@ static int dlci_open(struct net_device *dev)
277 dlp = netdev_priv(dev); 277 dlp = netdev_priv(dev);
278 278
279 if (!*(short *)(dev->dev_addr)) 279 if (!*(short *)(dev->dev_addr))
280 return(-EINVAL); 280 return -EINVAL;
281 281
282 if (!netif_running(dlp->slave)) 282 if (!netif_running(dlp->slave))
283 return(-ENOTCONN); 283 return -ENOTCONN;
284 284
285 flp = netdev_priv(dlp->slave); 285 flp = netdev_priv(dlp->slave);
286 err = (*flp->activate)(dlp->slave, dev); 286 err = (*flp->activate)(dlp->slave, dev);
287 if (err) 287 if (err)
288 return(err); 288 return err;
289 289
290 netif_start_queue(dev); 290 netif_start_queue(dev);
291 291
@@ -365,14 +365,14 @@ static int dlci_add(struct dlci_add *dlci)
365 list_add(&dlp->list, &dlci_devs); 365 list_add(&dlp->list, &dlci_devs);
366 rtnl_unlock(); 366 rtnl_unlock();
367 367
368 return(0); 368 return 0;
369 369
370 err2: 370 err2:
371 rtnl_unlock(); 371 rtnl_unlock();
372 free_netdev(master); 372 free_netdev(master);
373 err1: 373 err1:
374 dev_put(slave); 374 dev_put(slave);
375 return(err); 375 return err;
376} 376}
377 377
378static int dlci_del(struct dlci_add *dlci) 378static int dlci_del(struct dlci_add *dlci)
@@ -385,10 +385,10 @@ static int dlci_del(struct dlci_add *dlci)
385 /* validate slave device */ 385 /* validate slave device */
386 master = __dev_get_by_name(&init_net, dlci->devname); 386 master = __dev_get_by_name(&init_net, dlci->devname);
387 if (!master) 387 if (!master)
388 return(-ENODEV); 388 return -ENODEV;
389 389
390 if (netif_running(master)) { 390 if (netif_running(master)) {
391 return(-EBUSY); 391 return -EBUSY;
392 } 392 }
393 393
394 dlp = netdev_priv(master); 394 dlp = netdev_priv(master);
@@ -406,7 +406,7 @@ static int dlci_del(struct dlci_add *dlci)
406 } 406 }
407 rtnl_unlock(); 407 rtnl_unlock();
408 408
409 return(err); 409 return err;
410} 410}
411 411
412static int dlci_ioctl(unsigned int cmd, void __user *arg) 412static int dlci_ioctl(unsigned int cmd, void __user *arg)
@@ -415,7 +415,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg)
415 int err; 415 int err;
416 416
417 if (!capable(CAP_NET_ADMIN)) 417 if (!capable(CAP_NET_ADMIN))
418 return(-EPERM); 418 return -EPERM;
419 419
420 if (copy_from_user(&add, arg, sizeof(struct dlci_add))) 420 if (copy_from_user(&add, arg, sizeof(struct dlci_add)))
421 return -EFAULT; 421 return -EFAULT;
@@ -438,7 +438,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg)
438 err = -EINVAL; 438 err = -EINVAL;
439 } 439 }
440 440
441 return(err); 441 return err;
442} 442}
443 443
444static const struct header_ops dlci_header_ops = { 444static const struct header_ops dlci_header_ops = {
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 43af85b8e45e..70feb84df670 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1022,7 +1022,7 @@ static int lmc_open(struct net_device *dev)
1022 1022
1023 if (sc->lmc_ok){ 1023 if (sc->lmc_ok){
1024 lmc_trace(dev, "lmc_open lmc_ok out"); 1024 lmc_trace(dev, "lmc_open lmc_ok out");
1025 return (0); 1025 return 0;
1026 } 1026 }
1027 1027
1028 lmc_softreset (sc); 1028 lmc_softreset (sc);
@@ -1110,7 +1110,7 @@ static int lmc_open(struct net_device *dev)
1110 1110
1111 lmc_trace(dev, "lmc_open out"); 1111 lmc_trace(dev, "lmc_open out");
1112 1112
1113 return (0); 1113 return 0;
1114} 1114}
1115 1115
1116/* Total reset to compensate for the AdTran DSU doing bad things 1116/* Total reset to compensate for the AdTran DSU doing bad things
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index 7a3720f09ce3..17d408fe693f 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -379,14 +379,14 @@ static int __init n2_run(unsigned long io, unsigned long irq,
379 if (request_irq(irq, sca_intr, 0, devname, card)) { 379 if (request_irq(irq, sca_intr, 0, devname, card)) {
380 printk(KERN_ERR "n2: could not allocate IRQ\n"); 380 printk(KERN_ERR "n2: could not allocate IRQ\n");
381 n2_destroy_card(card); 381 n2_destroy_card(card);
382 return(-EBUSY); 382 return -EBUSY;
383 } 383 }
384 card->irq = irq; 384 card->irq = irq;
385 385
386 if (!request_mem_region(winbase, USE_WINDOWSIZE, devname)) { 386 if (!request_mem_region(winbase, USE_WINDOWSIZE, devname)) {
387 printk(KERN_ERR "n2: could not request RAM window\n"); 387 printk(KERN_ERR "n2: could not request RAM window\n");
388 n2_destroy_card(card); 388 n2_destroy_card(card);
389 return(-EBUSY); 389 return -EBUSY;
390 } 390 }
391 card->phy_winbase = winbase; 391 card->phy_winbase = winbase;
392 card->winbase = ioremap(winbase, USE_WINDOWSIZE); 392 card->winbase = ioremap(winbase, USE_WINDOWSIZE);
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index fbf1175a07f1..f875cfae3093 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -451,11 +451,11 @@ static int dma_get_rx_frame_size(pc300_t * card, int ch)
451 if ((status & DST_EOM) || (first_bd == card->chan[ch].rx_last_bd)) { 451 if ((status & DST_EOM) || (first_bd == card->chan[ch].rx_last_bd)) {
452 /* Return the size of a good frame or incomplete bad frame 452 /* Return the size of a good frame or incomplete bad frame
453 * (dma_buf_read will clean the buffer descriptors in this case). */ 453 * (dma_buf_read will clean the buffer descriptors in this case). */
454 return (rcvd); 454 return rcvd;
455 } 455 }
456 ptdescr = (card->hw.rambase + cpc_readl(&ptdescr->next)); 456 ptdescr = (card->hw.rambase + cpc_readl(&ptdescr->next));
457 } 457 }
458 return (-1); 458 return -1;
459} 459}
460 460
461/* 461/*
@@ -557,7 +557,7 @@ static int dma_buf_read(pc300_t * card, int ch, struct sk_buff *skb)
557 cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch), 557 cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch),
558 RX_BD_ADDR(ch, chan->rx_last_bd)); 558 RX_BD_ADDR(ch, chan->rx_last_bd));
559 } 559 }
560 return (rcvd); 560 return rcvd;
561} 561}
562 562
563static void tx_dma_stop(pc300_t * card, int ch) 563static void tx_dma_stop(pc300_t * card, int ch)
@@ -1733,7 +1733,7 @@ static u16 falc_pattern_test_error(pc300_t * card, int ch)
1733 pc300ch_t *chan = (pc300ch_t *) & card->chan[ch]; 1733 pc300ch_t *chan = (pc300ch_t *) & card->chan[ch];
1734 falc_t *pfalc = (falc_t *) & chan->falc; 1734 falc_t *pfalc = (falc_t *) & chan->falc;
1735 1735
1736 return (pfalc->bec); 1736 return pfalc->bec;
1737} 1737}
1738 1738
1739/**********************************/ 1739/**********************************/
@@ -2819,7 +2819,7 @@ static int clock_rate_calc(u32 rate, u32 clock, int *br_io)
2819 *br_io = 0; 2819 *br_io = 0;
2820 2820
2821 if (rate == 0) 2821 if (rate == 0)
2822 return (0); 2822 return 0;
2823 2823
2824 for (br = 0, br_pwr = 1; br <= 9; br++, br_pwr <<= 1) { 2824 for (br = 0, br_pwr = 1; br <= 9; br++, br_pwr <<= 1) {
2825 if ((tc = clock / br_pwr / rate) <= 0xff) { 2825 if ((tc = clock / br_pwr / rate) <= 0xff) {
@@ -2832,11 +2832,11 @@ static int clock_rate_calc(u32 rate, u32 clock, int *br_io)
2832 error = ((rate - (clock / br_pwr / rate)) / rate) * 1000; 2832 error = ((rate - (clock / br_pwr / rate)) / rate) * 1000;
2833 /* Errors bigger than +/- 1% won't be tolerated */ 2833 /* Errors bigger than +/- 1% won't be tolerated */
2834 if (error < -10 || error > 10) 2834 if (error < -10 || error > 10)
2835 return (-1); 2835 return -1;
2836 else 2836 else
2837 return (tc); 2837 return tc;
2838 } else { 2838 } else {
2839 return (-1); 2839 return -1;
2840 } 2840 }
2841} 2841}
2842 2842
@@ -3207,7 +3207,7 @@ static u32 detect_ram(pc300_t * card)
3207 break; 3207 break;
3208 } 3208 }
3209 } 3209 }
3210 return (i); 3210 return i;
3211} 3211}
3212 3212
3213static void plx_init(pc300_t * card) 3213static void plx_init(pc300_t * card)
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index 4293889e287e..515d9b8af01e 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -540,7 +540,7 @@ static int cpc_tty_chars_in_buffer(struct tty_struct *tty)
540 return -ENODEV; 540 return -ENODEV;
541 } 541 }
542 542
543 return(0); 543 return 0;
544} 544}
545 545
546static int pc300_tiocmset(struct tty_struct *tty, struct file *file, 546static int pc300_tiocmset(struct tty_struct *tty, struct file *file,
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index f4125da2762f..3f4e2b5684db 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -178,7 +178,7 @@ static char sdla_byte(struct net_device *dev, int addr)
178 byte = *temp; 178 byte = *temp;
179 spin_unlock_irqrestore(&sdla_lock, flags); 179 spin_unlock_irqrestore(&sdla_lock, flags);
180 180
181 return(byte); 181 return byte;
182} 182}
183 183
184static void sdla_stop(struct net_device *dev) 184static void sdla_stop(struct net_device *dev)
@@ -267,7 +267,7 @@ static int sdla_z80_poll(struct net_device *dev, int z80_addr, int jiffs, char r
267 resp = *temp; 267 resp = *temp;
268 } 268 }
269 } 269 }
270 return(time_before(jiffies, done) ? jiffies - start : -1); 270 return time_before(jiffies, done) ? jiffies - start : -1;
271} 271}
272 272
273/* constants for Z80 CPU speed */ 273/* constants for Z80 CPU speed */
@@ -283,13 +283,13 @@ static int sdla_cpuspeed(struct net_device *dev, struct ifreq *ifr)
283 283
284 sdla_start(dev); 284 sdla_start(dev);
285 if (sdla_z80_poll(dev, 0, 3*HZ, Z80_READY, 0) < 0) 285 if (sdla_z80_poll(dev, 0, 3*HZ, Z80_READY, 0) < 0)
286 return(-EIO); 286 return -EIO;
287 287
288 data = LOADER_READY; 288 data = LOADER_READY;
289 sdla_write(dev, 0, &data, 1); 289 sdla_write(dev, 0, &data, 1);
290 290
291 if ((jiffs = sdla_z80_poll(dev, 0, 8*HZ, Z80_SCC_OK, Z80_SCC_BAD)) < 0) 291 if ((jiffs = sdla_z80_poll(dev, 0, 8*HZ, Z80_SCC_OK, Z80_SCC_BAD)) < 0)
292 return(-EIO); 292 return -EIO;
293 293
294 sdla_stop(dev); 294 sdla_stop(dev);
295 sdla_read(dev, 0, &data, 1); 295 sdla_read(dev, 0, &data, 1);
@@ -297,11 +297,11 @@ static int sdla_cpuspeed(struct net_device *dev, struct ifreq *ifr)
297 if (data == Z80_SCC_BAD) 297 if (data == Z80_SCC_BAD)
298 { 298 {
299 printk("%s: SCC bad\n", dev->name); 299 printk("%s: SCC bad\n", dev->name);
300 return(-EIO); 300 return -EIO;
301 } 301 }
302 302
303 if (data != Z80_SCC_OK) 303 if (data != Z80_SCC_OK)
304 return(-EINVAL); 304 return -EINVAL;
305 305
306 if (jiffs < 165) 306 if (jiffs < 165)
307 ifr->ifr_mtu = SDLA_CPU_16M; 307 ifr->ifr_mtu = SDLA_CPU_16M;
@@ -316,7 +316,7 @@ static int sdla_cpuspeed(struct net_device *dev, struct ifreq *ifr)
316 else 316 else
317 ifr->ifr_mtu = SDLA_CPU_3M; 317 ifr->ifr_mtu = SDLA_CPU_3M;
318 318
319 return(0); 319 return 0;
320} 320}
321 321
322/************************************************ 322/************************************************
@@ -493,7 +493,7 @@ static int sdla_cmd(struct net_device *dev, int cmd, short dlci, short flags,
493 if (ret != SDLA_RET_OK) 493 if (ret != SDLA_RET_OK)
494 sdla_errors(dev, cmd, dlci, ret, len, &status); 494 sdla_errors(dev, cmd, dlci, ret, len, &status);
495 495
496 return(ret); 496 return ret;
497} 497}
498 498
499/*********************************************** 499/***********************************************
@@ -516,14 +516,14 @@ static int sdla_activate(struct net_device *slave, struct net_device *master)
516 break; 516 break;
517 517
518 if (i == CONFIG_DLCI_MAX) 518 if (i == CONFIG_DLCI_MAX)
519 return(-ENODEV); 519 return -ENODEV;
520 520
521 flp->dlci[i] = abs(flp->dlci[i]); 521 flp->dlci[i] = abs(flp->dlci[i]);
522 522
523 if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE)) 523 if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE))
524 sdla_cmd(slave, SDLA_ACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL); 524 sdla_cmd(slave, SDLA_ACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL);
525 525
526 return(0); 526 return 0;
527} 527}
528 528
529static int sdla_deactivate(struct net_device *slave, struct net_device *master) 529static int sdla_deactivate(struct net_device *slave, struct net_device *master)
@@ -538,14 +538,14 @@ static int sdla_deactivate(struct net_device *slave, struct net_device *master)
538 break; 538 break;
539 539
540 if (i == CONFIG_DLCI_MAX) 540 if (i == CONFIG_DLCI_MAX)
541 return(-ENODEV); 541 return -ENODEV;
542 542
543 flp->dlci[i] = -abs(flp->dlci[i]); 543 flp->dlci[i] = -abs(flp->dlci[i]);
544 544
545 if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE)) 545 if (netif_running(slave) && (flp->config.station == FRAD_STATION_NODE))
546 sdla_cmd(slave, SDLA_DEACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL); 546 sdla_cmd(slave, SDLA_DEACTIVATE_DLCI, 0, 0, &flp->dlci[i], sizeof(short), NULL, NULL);
547 547
548 return(0); 548 return 0;
549} 549}
550 550
551static int sdla_assoc(struct net_device *slave, struct net_device *master) 551static int sdla_assoc(struct net_device *slave, struct net_device *master)
@@ -554,7 +554,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master)
554 int i; 554 int i;
555 555
556 if (master->type != ARPHRD_DLCI) 556 if (master->type != ARPHRD_DLCI)
557 return(-EINVAL); 557 return -EINVAL;
558 558
559 flp = netdev_priv(slave); 559 flp = netdev_priv(slave);
560 560
@@ -563,11 +563,11 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master)
563 if (!flp->master[i]) 563 if (!flp->master[i])
564 break; 564 break;
565 if (abs(flp->dlci[i]) == *(short *)(master->dev_addr)) 565 if (abs(flp->dlci[i]) == *(short *)(master->dev_addr))
566 return(-EADDRINUSE); 566 return -EADDRINUSE;
567 } 567 }
568 568
569 if (i == CONFIG_DLCI_MAX) 569 if (i == CONFIG_DLCI_MAX)
570 return(-EMLINK); /* #### Alan: Comments on this ?? */ 570 return -EMLINK; /* #### Alan: Comments on this ?? */
571 571
572 572
573 flp->master[i] = master; 573 flp->master[i] = master;
@@ -581,7 +581,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master)
581 sdla_cmd(slave, SDLA_ADD_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL); 581 sdla_cmd(slave, SDLA_ADD_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL);
582 } 582 }
583 583
584 return(0); 584 return 0;
585} 585}
586 586
587static int sdla_deassoc(struct net_device *slave, struct net_device *master) 587static int sdla_deassoc(struct net_device *slave, struct net_device *master)
@@ -596,7 +596,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master)
596 break; 596 break;
597 597
598 if (i == CONFIG_DLCI_MAX) 598 if (i == CONFIG_DLCI_MAX)
599 return(-ENODEV); 599 return -ENODEV;
600 600
601 flp->master[i] = NULL; 601 flp->master[i] = NULL;
602 flp->dlci[i] = 0; 602 flp->dlci[i] = 0;
@@ -609,7 +609,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master)
609 sdla_cmd(slave, SDLA_DELETE_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL); 609 sdla_cmd(slave, SDLA_DELETE_DLCI, 0, 0, master->dev_addr, sizeof(short), NULL, NULL);
610 } 610 }
611 611
612 return(0); 612 return 0;
613} 613}
614 614
615static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, int get) 615static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, int get)
@@ -626,7 +626,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
626 break; 626 break;
627 627
628 if (i == CONFIG_DLCI_MAX) 628 if (i == CONFIG_DLCI_MAX)
629 return(-ENODEV); 629 return -ENODEV;
630 630
631 dlp = netdev_priv(master); 631 dlp = netdev_priv(master);
632 632
@@ -641,7 +641,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
641 &dlp->config, sizeof(struct dlci_conf) - 4 * sizeof(short), NULL, NULL); 641 &dlp->config, sizeof(struct dlci_conf) - 4 * sizeof(short), NULL, NULL);
642 } 642 }
643 643
644 return(ret == SDLA_RET_OK ? 0 : -EIO); 644 return ret == SDLA_RET_OK ? 0 : -EIO;
645} 645}
646 646
647/************************** 647/**************************
@@ -986,7 +986,7 @@ static int sdla_close(struct net_device *dev)
986 986
987 netif_stop_queue(dev); 987 netif_stop_queue(dev);
988 988
989 return(0); 989 return 0;
990} 990}
991 991
992struct conf_data { 992struct conf_data {
@@ -1006,10 +1006,10 @@ static int sdla_open(struct net_device *dev)
1006 flp = netdev_priv(dev); 1006 flp = netdev_priv(dev);
1007 1007
1008 if (!flp->initialized) 1008 if (!flp->initialized)
1009 return(-EPERM); 1009 return -EPERM;
1010 1010
1011 if (!flp->configured) 1011 if (!flp->configured)
1012 return(-EPERM); 1012 return -EPERM;
1013 1013
1014 /* time to send in the configuration */ 1014 /* time to send in the configuration */
1015 len = 0; 1015 len = 0;
@@ -1087,7 +1087,7 @@ static int sdla_open(struct net_device *dev)
1087 1087
1088 netif_start_queue(dev); 1088 netif_start_queue(dev);
1089 1089
1090 return(0); 1090 return 0;
1091} 1091}
1092 1092
1093static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, int get) 1093static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, int get)
@@ -1098,48 +1098,48 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in
1098 short size; 1098 short size;
1099 1099
1100 if (dev->type == 0xFFFF) 1100 if (dev->type == 0xFFFF)
1101 return(-EUNATCH); 1101 return -EUNATCH;
1102 1102
1103 flp = netdev_priv(dev); 1103 flp = netdev_priv(dev);
1104 1104
1105 if (!get) 1105 if (!get)
1106 { 1106 {
1107 if (netif_running(dev)) 1107 if (netif_running(dev))
1108 return(-EBUSY); 1108 return -EBUSY;
1109 1109
1110 if(copy_from_user(&data.config, conf, sizeof(struct frad_conf))) 1110 if(copy_from_user(&data.config, conf, sizeof(struct frad_conf)))
1111 return -EFAULT; 1111 return -EFAULT;
1112 1112
1113 if (data.config.station & ~FRAD_STATION_NODE) 1113 if (data.config.station & ~FRAD_STATION_NODE)
1114 return(-EINVAL); 1114 return -EINVAL;
1115 1115
1116 if (data.config.flags & ~FRAD_VALID_FLAGS) 1116 if (data.config.flags & ~FRAD_VALID_FLAGS)
1117 return(-EINVAL); 1117 return -EINVAL;
1118 1118
1119 if ((data.config.kbaud < 0) || 1119 if ((data.config.kbaud < 0) ||
1120 ((data.config.kbaud > 128) && (flp->type != SDLA_S508))) 1120 ((data.config.kbaud > 128) && (flp->type != SDLA_S508)))
1121 return(-EINVAL); 1121 return -EINVAL;
1122 1122
1123 if (data.config.clocking & ~(FRAD_CLOCK_INT | SDLA_S508_PORT_RS232)) 1123 if (data.config.clocking & ~(FRAD_CLOCK_INT | SDLA_S508_PORT_RS232))
1124 return(-EINVAL); 1124 return -EINVAL;
1125 1125
1126 if ((data.config.mtu < 0) || (data.config.mtu > SDLA_MAX_MTU)) 1126 if ((data.config.mtu < 0) || (data.config.mtu > SDLA_MAX_MTU))
1127 return(-EINVAL); 1127 return -EINVAL;
1128 1128
1129 if ((data.config.T391 < 5) || (data.config.T391 > 30)) 1129 if ((data.config.T391 < 5) || (data.config.T391 > 30))
1130 return(-EINVAL); 1130 return -EINVAL;
1131 1131
1132 if ((data.config.T392 < 5) || (data.config.T392 > 30)) 1132 if ((data.config.T392 < 5) || (data.config.T392 > 30))
1133 return(-EINVAL); 1133 return -EINVAL;
1134 1134
1135 if ((data.config.N391 < 1) || (data.config.N391 > 255)) 1135 if ((data.config.N391 < 1) || (data.config.N391 > 255))
1136 return(-EINVAL); 1136 return -EINVAL;
1137 1137
1138 if ((data.config.N392 < 1) || (data.config.N392 > 10)) 1138 if ((data.config.N392 < 1) || (data.config.N392 > 10))
1139 return(-EINVAL); 1139 return -EINVAL;
1140 1140
1141 if ((data.config.N393 < 1) || (data.config.N393 > 10)) 1141 if ((data.config.N393 < 1) || (data.config.N393 > 10))
1142 return(-EINVAL); 1142 return -EINVAL;
1143 1143
1144 memcpy(&flp->config, &data.config, sizeof(struct frad_conf)); 1144 memcpy(&flp->config, &data.config, sizeof(struct frad_conf));
1145 flp->config.flags |= SDLA_DIRECT_RECV; 1145 flp->config.flags |= SDLA_DIRECT_RECV;
@@ -1171,7 +1171,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in
1171 { 1171 {
1172 size = sizeof(data); 1172 size = sizeof(data);
1173 if (sdla_cmd(dev, SDLA_READ_DLCI_CONFIGURATION, 0, 0, NULL, 0, &data, &size) != SDLA_RET_OK) 1173 if (sdla_cmd(dev, SDLA_READ_DLCI_CONFIGURATION, 0, 0, NULL, 0, &data, &size) != SDLA_RET_OK)
1174 return(-EIO); 1174 return -EIO;
1175 } 1175 }
1176 else 1176 else
1177 if (flp->configured) 1177 if (flp->configured)
@@ -1185,7 +1185,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in
1185 return copy_to_user(conf, &data.config, sizeof(struct frad_conf))?-EFAULT:0; 1185 return copy_to_user(conf, &data.config, sizeof(struct frad_conf))?-EFAULT:0;
1186 } 1186 }
1187 1187
1188 return(0); 1188 return 0;
1189} 1189}
1190 1190
1191static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int read) 1191static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int read)
@@ -1200,7 +1200,7 @@ static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int r
1200 { 1200 {
1201 temp = kzalloc(mem.len, GFP_KERNEL); 1201 temp = kzalloc(mem.len, GFP_KERNEL);
1202 if (!temp) 1202 if (!temp)
1203 return(-ENOMEM); 1203 return -ENOMEM;
1204 sdla_read(dev, mem.addr, temp, mem.len); 1204 sdla_read(dev, mem.addr, temp, mem.len);
1205 if(copy_to_user(mem.data, temp, mem.len)) 1205 if(copy_to_user(mem.data, temp, mem.len))
1206 { 1206 {
@@ -1217,7 +1217,7 @@ static int sdla_xfer(struct net_device *dev, struct sdla_mem __user *info, int r
1217 sdla_write(dev, mem.addr, temp, mem.len); 1217 sdla_write(dev, mem.addr, temp, mem.len);
1218 kfree(temp); 1218 kfree(temp);
1219 } 1219 }
1220 return(0); 1220 return 0;
1221} 1221}
1222 1222
1223static int sdla_reconfig(struct net_device *dev) 1223static int sdla_reconfig(struct net_device *dev)
@@ -1241,7 +1241,7 @@ static int sdla_reconfig(struct net_device *dev)
1241 sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, 0, 0, &data, len, NULL, NULL); 1241 sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, 0, 0, &data, len, NULL, NULL);
1242 sdla_cmd(dev, SDLA_ENABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL); 1242 sdla_cmd(dev, SDLA_ENABLE_COMMUNICATIONS, 0, 0, NULL, 0, NULL, NULL);
1243 1243
1244 return(0); 1244 return 0;
1245} 1245}
1246 1246
1247static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 1247static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -1254,20 +1254,20 @@ static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1254 flp = netdev_priv(dev); 1254 flp = netdev_priv(dev);
1255 1255
1256 if (!flp->initialized) 1256 if (!flp->initialized)
1257 return(-EINVAL); 1257 return -EINVAL;
1258 1258
1259 switch (cmd) 1259 switch (cmd)
1260 { 1260 {
1261 case FRAD_GET_CONF: 1261 case FRAD_GET_CONF:
1262 case FRAD_SET_CONF: 1262 case FRAD_SET_CONF:
1263 return(sdla_config(dev, ifr->ifr_data, cmd == FRAD_GET_CONF)); 1263 return sdla_config(dev, ifr->ifr_data, cmd == FRAD_GET_CONF);
1264 1264
1265 case SDLA_IDENTIFY: 1265 case SDLA_IDENTIFY:
1266 ifr->ifr_flags = flp->type; 1266 ifr->ifr_flags = flp->type;
1267 break; 1267 break;
1268 1268
1269 case SDLA_CPUSPEED: 1269 case SDLA_CPUSPEED:
1270 return(sdla_cpuspeed(dev, ifr)); 1270 return sdla_cpuspeed(dev, ifr);
1271 1271
1272/* ========================================================== 1272/* ==========================================================
1273NOTE: This is rather a useless action right now, as the 1273NOTE: This is rather a useless action right now, as the
@@ -1277,7 +1277,7 @@ NOTE: This is rather a useless action right now, as the
1277============================================================*/ 1277============================================================*/
1278 case SDLA_PROTOCOL: 1278 case SDLA_PROTOCOL:
1279 if (flp->configured) 1279 if (flp->configured)
1280 return(-EALREADY); 1280 return -EALREADY;
1281 1281
1282 switch (ifr->ifr_flags) 1282 switch (ifr->ifr_flags)
1283 { 1283 {
@@ -1285,7 +1285,7 @@ NOTE: This is rather a useless action right now, as the
1285 dev->type = ifr->ifr_flags; 1285 dev->type = ifr->ifr_flags;
1286 break; 1286 break;
1287 default: 1287 default:
1288 return(-ENOPROTOOPT); 1288 return -ENOPROTOOPT;
1289 } 1289 }
1290 break; 1290 break;
1291 1291
@@ -1297,7 +1297,7 @@ NOTE: This is rather a useless action right now, as the
1297 case SDLA_READMEM: 1297 case SDLA_READMEM:
1298 if(!capable(CAP_SYS_RAWIO)) 1298 if(!capable(CAP_SYS_RAWIO))
1299 return -EPERM; 1299 return -EPERM;
1300 return(sdla_xfer(dev, ifr->ifr_data, cmd == SDLA_READMEM)); 1300 return sdla_xfer(dev, ifr->ifr_data, cmd == SDLA_READMEM);
1301 1301
1302 case SDLA_START: 1302 case SDLA_START:
1303 sdla_start(dev); 1303 sdla_start(dev);
@@ -1308,9 +1308,9 @@ NOTE: This is rather a useless action right now, as the
1308 break; 1308 break;
1309 1309
1310 default: 1310 default:
1311 return(-EOPNOTSUPP); 1311 return -EOPNOTSUPP;
1312 } 1312 }
1313 return(0); 1313 return 0;
1314} 1314}
1315 1315
1316static int sdla_change_mtu(struct net_device *dev, int new_mtu) 1316static int sdla_change_mtu(struct net_device *dev, int new_mtu)
@@ -1320,10 +1320,10 @@ static int sdla_change_mtu(struct net_device *dev, int new_mtu)
1320 flp = netdev_priv(dev); 1320 flp = netdev_priv(dev);
1321 1321
1322 if (netif_running(dev)) 1322 if (netif_running(dev))
1323 return(-EBUSY); 1323 return -EBUSY;
1324 1324
1325 /* for now, you can't change the MTU! */ 1325 /* for now, you can't change the MTU! */
1326 return(-EOPNOTSUPP); 1326 return -EOPNOTSUPP;
1327} 1327}
1328 1328
1329static int sdla_set_config(struct net_device *dev, struct ifmap *map) 1329static int sdla_set_config(struct net_device *dev, struct ifmap *map)
@@ -1337,18 +1337,18 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
1337 flp = netdev_priv(dev); 1337 flp = netdev_priv(dev);
1338 1338
1339 if (flp->initialized) 1339 if (flp->initialized)
1340 return(-EINVAL); 1340 return -EINVAL;
1341 1341
1342 for(i=0; i < ARRAY_SIZE(valid_port); i++) 1342 for(i=0; i < ARRAY_SIZE(valid_port); i++)
1343 if (valid_port[i] == map->base_addr) 1343 if (valid_port[i] == map->base_addr)
1344 break; 1344 break;
1345 1345
1346 if (i == ARRAY_SIZE(valid_port)) 1346 if (i == ARRAY_SIZE(valid_port))
1347 return(-EINVAL); 1347 return -EINVAL;
1348 1348
1349 if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){ 1349 if (!request_region(map->base_addr, SDLA_IO_EXTENTS, dev->name)){
1350 printk(KERN_WARNING "SDLA: io-port 0x%04lx in use\n", dev->base_addr); 1350 printk(KERN_WARNING "SDLA: io-port 0x%04lx in use\n", dev->base_addr);
1351 return(-EINVAL); 1351 return -EINVAL;
1352 } 1352 }
1353 base = map->base_addr; 1353 base = map->base_addr;
1354 1354
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index e47f5a986b1c..d81ad8397885 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -648,7 +648,7 @@ static int x25_asy_esc(unsigned char *s, unsigned char *d, int len)
648 } 648 }
649 } 649 }
650 *ptr++ = X25_END; 650 *ptr++ = X25_END;
651 return (ptr - d); 651 return ptr - d;
652} 652}
653 653
654static void x25_asy_unesc(struct x25_asy *sl, unsigned char s) 654static void x25_asy_unesc(struct x25_asy *sl, unsigned char s)