diff options
Diffstat (limited to 'drivers/net/slip.c')
-rw-r--r-- | drivers/net/slip.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 1588cb7f6c83..39c2152a07f4 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -113,7 +113,7 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd); | |||
113 | * on actively running device. | 113 | * on actively running device. |
114 | *********************************/ | 114 | *********************************/ |
115 | 115 | ||
116 | /* | 116 | /* |
117 | Allocate channel buffers. | 117 | Allocate channel buffers. |
118 | */ | 118 | */ |
119 | 119 | ||
@@ -207,7 +207,7 @@ sl_free_bufs(struct slip *sl) | |||
207 | #endif | 207 | #endif |
208 | } | 208 | } |
209 | 209 | ||
210 | /* | 210 | /* |
211 | Reallocate slip channel buffers. | 211 | Reallocate slip channel buffers. |
212 | */ | 212 | */ |
213 | 213 | ||
@@ -354,7 +354,7 @@ sl_bump(struct slip *sl) | |||
354 | #endif /* SL_INCLUDE_CSLIP */ | 354 | #endif /* SL_INCLUDE_CSLIP */ |
355 | 355 | ||
356 | sl->rx_bytes+=count; | 356 | sl->rx_bytes+=count; |
357 | 357 | ||
358 | skb = dev_alloc_skb(count); | 358 | skb = dev_alloc_skb(count); |
359 | if (skb == NULL) { | 359 | if (skb == NULL) { |
360 | printk(KERN_WARNING "%s: memory squeeze, dropping packet.\n", sl->dev->name); | 360 | printk(KERN_WARNING "%s: memory squeeze, dropping packet.\n", sl->dev->name); |
@@ -602,7 +602,7 @@ static int sl_init(struct net_device *dev) | |||
602 | struct slip *sl = netdev_priv(dev); | 602 | struct slip *sl = netdev_priv(dev); |
603 | 603 | ||
604 | /* | 604 | /* |
605 | * Finish setting up the DEVICE info. | 605 | * Finish setting up the DEVICE info. |
606 | */ | 606 | */ |
607 | 607 | ||
608 | dev->mtu = sl->mtu; | 608 | dev->mtu = sl->mtu; |
@@ -658,7 +658,7 @@ static void sl_setup(struct net_device *dev) | |||
658 | * be re-entered while running but other ldisc functions may be called | 658 | * be re-entered while running but other ldisc functions may be called |
659 | * in parallel | 659 | * in parallel |
660 | */ | 660 | */ |
661 | 661 | ||
662 | static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) | 662 | static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) |
663 | { | 663 | { |
664 | struct slip *sl = (struct slip *) tty->disc_data; | 664 | struct slip *sl = (struct slip *) tty->disc_data; |
@@ -720,7 +720,7 @@ sl_alloc(dev_t line) | |||
720 | struct net_device *dev = NULL; | 720 | struct net_device *dev = NULL; |
721 | struct slip *sl; | 721 | struct slip *sl; |
722 | 722 | ||
723 | if (slip_devs == NULL) | 723 | if (slip_devs == NULL) |
724 | return NULL; /* Master array missing ! */ | 724 | return NULL; /* Master array missing ! */ |
725 | 725 | ||
726 | for (i = 0; i < slip_maxdev; i++) { | 726 | for (i = 0; i < slip_maxdev; i++) { |
@@ -788,7 +788,7 @@ sl_alloc(dev_t line) | |||
788 | slip_devs[i] = NULL; | 788 | slip_devs[i] = NULL; |
789 | } | 789 | } |
790 | } | 790 | } |
791 | 791 | ||
792 | if (!dev) { | 792 | if (!dev) { |
793 | char name[IFNAMSIZ]; | 793 | char name[IFNAMSIZ]; |
794 | sprintf(name, "sl%d", i); | 794 | sprintf(name, "sl%d", i); |
@@ -815,7 +815,7 @@ sl_alloc(dev_t line) | |||
815 | sl->outfill_timer.function=sl_outfill; | 815 | sl->outfill_timer.function=sl_outfill; |
816 | #endif | 816 | #endif |
817 | slip_devs[i] = dev; | 817 | slip_devs[i] = dev; |
818 | 818 | ||
819 | return sl; | 819 | return sl; |
820 | } | 820 | } |
821 | 821 | ||
@@ -836,7 +836,7 @@ static int slip_open(struct tty_struct *tty) | |||
836 | 836 | ||
837 | if(!capable(CAP_NET_ADMIN)) | 837 | if(!capable(CAP_NET_ADMIN)) |
838 | return -EPERM; | 838 | return -EPERM; |
839 | 839 | ||
840 | /* RTnetlink lock is misused here to serialize concurrent | 840 | /* RTnetlink lock is misused here to serialize concurrent |
841 | opens of slip channels. There are better ways, but it is | 841 | opens of slip channels. There are better ways, but it is |
842 | the simplest one. | 842 | the simplest one. |
@@ -862,7 +862,7 @@ static int slip_open(struct tty_struct *tty) | |||
862 | tty->disc_data = sl; | 862 | tty->disc_data = sl; |
863 | sl->line = tty_devnum(tty); | 863 | sl->line = tty_devnum(tty); |
864 | sl->pid = current->pid; | 864 | sl->pid = current->pid; |
865 | 865 | ||
866 | if (!test_bit(SLF_INUSE, &sl->flags)) { | 866 | if (!test_bit(SLF_INUSE, &sl->flags)) { |
867 | /* Perform the low-level SLIP initialization. */ | 867 | /* Perform the low-level SLIP initialization. */ |
868 | if ((err = sl_alloc_bufs(sl, SL_MTU)) != 0) | 868 | if ((err = sl_alloc_bufs(sl, SL_MTU)) != 0) |
@@ -908,7 +908,7 @@ err_exit: | |||
908 | /* | 908 | /* |
909 | 909 | ||
910 | FIXME: 1,2 are fixed 3 was never true anyway. | 910 | FIXME: 1,2 are fixed 3 was never true anyway. |
911 | 911 | ||
912 | Let me to blame a bit. | 912 | Let me to blame a bit. |
913 | 1. TTY module calls this funstion on soft interrupt. | 913 | 1. TTY module calls this funstion on soft interrupt. |
914 | 2. TTY module calls this function WITH MASKED INTERRUPTS! | 914 | 2. TTY module calls this function WITH MASKED INTERRUPTS! |
@@ -920,7 +920,7 @@ err_exit: | |||
920 | 920 | ||
921 | By-product (not desired): sl? does not feel hangups and remains open. | 921 | By-product (not desired): sl? does not feel hangups and remains open. |
922 | It is supposed, that user level program (dip, diald, slattach...) | 922 | It is supposed, that user level program (dip, diald, slattach...) |
923 | will catch SIGHUP and make the rest of work. | 923 | will catch SIGHUP and make the rest of work. |
924 | 924 | ||
925 | I see no way to make more with current tty code. --ANK | 925 | I see no way to make more with current tty code. --ANK |
926 | */ | 926 | */ |
@@ -1291,7 +1291,7 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd) | |||
1291 | break; | 1291 | break; |
1292 | 1292 | ||
1293 | case SIOCSLEASE: | 1293 | case SIOCSLEASE: |
1294 | /* Resolve race condition, when ioctl'ing hanged up | 1294 | /* Resolve race condition, when ioctl'ing hanged up |
1295 | and opened by another process device. | 1295 | and opened by another process device. |
1296 | */ | 1296 | */ |
1297 | if (sl->tty != current->signal->tty && sl->pid != current->pid) { | 1297 | if (sl->tty != current->signal->tty && sl->pid != current->pid) { |
@@ -1350,7 +1350,7 @@ static int __init slip_init(void) | |||
1350 | } | 1350 | } |
1351 | 1351 | ||
1352 | /* Clear the pointer array, we allocate devices when we need them */ | 1352 | /* Clear the pointer array, we allocate devices when we need them */ |
1353 | memset(slip_devs, 0, sizeof(struct net_device *)*slip_maxdev); | 1353 | memset(slip_devs, 0, sizeof(struct net_device *)*slip_maxdev); |
1354 | 1354 | ||
1355 | /* Fill in our line protocol discipline, and register it */ | 1355 | /* Fill in our line protocol discipline, and register it */ |
1356 | if ((status = tty_register_ldisc(N_SLIP, &sl_ldisc)) != 0) { | 1356 | if ((status = tty_register_ldisc(N_SLIP, &sl_ldisc)) != 0) { |
@@ -1368,7 +1368,7 @@ static void __exit slip_exit(void) | |||
1368 | unsigned long timeout = jiffies + HZ; | 1368 | unsigned long timeout = jiffies + HZ; |
1369 | int busy = 0; | 1369 | int busy = 0; |
1370 | 1370 | ||
1371 | if (slip_devs == NULL) | 1371 | if (slip_devs == NULL) |
1372 | return; | 1372 | return; |
1373 | 1373 | ||
1374 | /* First of all: check for active disciplines and hangup them. | 1374 | /* First of all: check for active disciplines and hangup them. |
@@ -1405,7 +1405,7 @@ static void __exit slip_exit(void) | |||
1405 | dev->name); | 1405 | dev->name); |
1406 | /* Intentionally leak the control block. */ | 1406 | /* Intentionally leak the control block. */ |
1407 | dev->destructor = NULL; | 1407 | dev->destructor = NULL; |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | unregister_netdev(dev); | 1410 | unregister_netdev(dev); |
1411 | } | 1411 | } |