diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-21 11:19:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-21 11:19:50 -0400 |
commit | eb6a12c2428d21a9f3e0f1a50e927d5fd80fc3d0 (patch) | |
tree | 5ac6f43899648abeab1d43aad3107f664e7f13d5 /net/irda | |
parent | c4762aba0b1f72659aae9ce37b772ca8bd8f06f4 (diff) | |
parent | 14b395e35d1afdd8019d11b92e28041fad591b71 (diff) |
Merge branch 'linus' into cpus4096-for-linus
Conflicts:
net/sunrpc/svc.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 14 | ||||
-rw-r--r-- | net/irda/irlap_frame.c | 2 | ||||
-rw-r--r-- | net/irda/irnet/irnet_ppp.c | 54 | ||||
-rw-r--r-- | net/irda/irnet/irnet_ppp.h | 7 |
4 files changed, 41 insertions, 36 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 76c3057d0179..e4e2caeb9d82 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
@@ -650,12 +650,7 @@ static void ircomm_tty_do_softint(struct work_struct *work) | |||
650 | } | 650 | } |
651 | 651 | ||
652 | /* Check if user (still) wants to be waken up */ | 652 | /* Check if user (still) wants to be waken up */ |
653 | if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && | 653 | tty_wakeup(tty); |
654 | tty->ldisc.write_wakeup) | ||
655 | { | ||
656 | (tty->ldisc.write_wakeup)(tty); | ||
657 | } | ||
658 | wake_up_interruptible(&tty->write_wait); | ||
659 | } | 654 | } |
660 | 655 | ||
661 | /* | 656 | /* |
@@ -1141,6 +1136,7 @@ static int ircomm_tty_data_indication(void *instance, void *sap, | |||
1141 | struct sk_buff *skb) | 1136 | struct sk_buff *skb) |
1142 | { | 1137 | { |
1143 | struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; | 1138 | struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; |
1139 | struct tty_ldisc *ld; | ||
1144 | 1140 | ||
1145 | IRDA_DEBUG(2, "%s()\n", __func__ ); | 1141 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
1146 | 1142 | ||
@@ -1173,7 +1169,11 @@ static int ircomm_tty_data_indication(void *instance, void *sap, | |||
1173 | * involve the flip buffers, since we are not running in an interrupt | 1169 | * involve the flip buffers, since we are not running in an interrupt |
1174 | * handler | 1170 | * handler |
1175 | */ | 1171 | */ |
1176 | self->tty->ldisc.receive_buf(self->tty, skb->data, NULL, skb->len); | 1172 | |
1173 | ld = tty_ldisc_ref(self->tty); | ||
1174 | if (ld) | ||
1175 | ld->ops->receive_buf(self->tty, skb->data, NULL, skb->len); | ||
1176 | tty_ldisc_deref(ld); | ||
1177 | 1177 | ||
1178 | /* No need to kfree_skb - see ircomm_ttp_data_indication() */ | 1178 | /* No need to kfree_skb - see ircomm_ttp_data_indication() */ |
1179 | 1179 | ||
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 90894534f3cc..f17b65af9c9b 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c | |||
@@ -1326,7 +1326,7 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, | |||
1326 | int command; | 1326 | int command; |
1327 | __u8 control; | 1327 | __u8 control; |
1328 | 1328 | ||
1329 | if (dev_net(dev) != &init_net) | 1329 | if (!net_eq(dev_net(dev), &init_net)) |
1330 | goto out; | 1330 | goto out; |
1331 | 1331 | ||
1332 | /* FIXME: should we get our own field? */ | 1332 | /* FIXME: should we get our own field? */ |
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index e84a70dd346b..6d8ae03c14f5 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
@@ -631,8 +631,8 @@ dev_irnet_poll(struct file * file, | |||
631 | * This is the way pppd configure us and control us while the PPP | 631 | * This is the way pppd configure us and control us while the PPP |
632 | * instance is active. | 632 | * instance is active. |
633 | */ | 633 | */ |
634 | static int | 634 | static long |
635 | dev_irnet_ioctl(struct inode * inode, | 635 | dev_irnet_ioctl( |
636 | struct file * file, | 636 | struct file * file, |
637 | unsigned int cmd, | 637 | unsigned int cmd, |
638 | unsigned long arg) | 638 | unsigned long arg) |
@@ -663,6 +663,7 @@ dev_irnet_ioctl(struct inode * inode, | |||
663 | { | 663 | { |
664 | DEBUG(FS_INFO, "Entering PPP discipline.\n"); | 664 | DEBUG(FS_INFO, "Entering PPP discipline.\n"); |
665 | /* PPP channel setup (ap->chan in configued in dev_irnet_open())*/ | 665 | /* PPP channel setup (ap->chan in configued in dev_irnet_open())*/ |
666 | lock_kernel(); | ||
666 | err = ppp_register_channel(&ap->chan); | 667 | err = ppp_register_channel(&ap->chan); |
667 | if(err == 0) | 668 | if(err == 0) |
668 | { | 669 | { |
@@ -675,12 +676,14 @@ dev_irnet_ioctl(struct inode * inode, | |||
675 | } | 676 | } |
676 | else | 677 | else |
677 | DERROR(FS_ERROR, "Can't setup PPP channel...\n"); | 678 | DERROR(FS_ERROR, "Can't setup PPP channel...\n"); |
679 | unlock_kernel(); | ||
678 | } | 680 | } |
679 | else | 681 | else |
680 | { | 682 | { |
681 | /* In theory, should be N_TTY */ | 683 | /* In theory, should be N_TTY */ |
682 | DEBUG(FS_INFO, "Exiting PPP discipline.\n"); | 684 | DEBUG(FS_INFO, "Exiting PPP discipline.\n"); |
683 | /* Disconnect from the generic PPP layer */ | 685 | /* Disconnect from the generic PPP layer */ |
686 | lock_kernel(); | ||
684 | if(ap->ppp_open) | 687 | if(ap->ppp_open) |
685 | { | 688 | { |
686 | ap->ppp_open = 0; | 689 | ap->ppp_open = 0; |
@@ -689,24 +692,20 @@ dev_irnet_ioctl(struct inode * inode, | |||
689 | else | 692 | else |
690 | DERROR(FS_ERROR, "Channel not registered !\n"); | 693 | DERROR(FS_ERROR, "Channel not registered !\n"); |
691 | err = 0; | 694 | err = 0; |
695 | unlock_kernel(); | ||
692 | } | 696 | } |
693 | break; | 697 | break; |
694 | 698 | ||
695 | /* Query PPP channel and unit number */ | 699 | /* Query PPP channel and unit number */ |
696 | case PPPIOCGCHAN: | 700 | case PPPIOCGCHAN: |
697 | if(!ap->ppp_open) | 701 | if(ap->ppp_open && !put_user(ppp_channel_index(&ap->chan), |
698 | break; | 702 | (int __user *)argp)) |
699 | if(put_user(ppp_channel_index(&ap->chan), (int __user *)argp)) | 703 | err = 0; |
700 | break; | ||
701 | DEBUG(FS_INFO, "Query channel.\n"); | ||
702 | err = 0; | ||
703 | break; | 704 | break; |
704 | case PPPIOCGUNIT: | 705 | case PPPIOCGUNIT: |
705 | if(!ap->ppp_open) | 706 | lock_kernel(); |
706 | break; | 707 | if(ap->ppp_open && !put_user(ppp_unit_number(&ap->chan), |
707 | if(put_user(ppp_unit_number(&ap->chan), (int __user *)argp)) | 708 | (int __user *)argp)) |
708 | break; | ||
709 | DEBUG(FS_INFO, "Query unit number.\n"); | ||
710 | err = 0; | 709 | err = 0; |
711 | break; | 710 | break; |
712 | 711 | ||
@@ -726,34 +725,39 @@ dev_irnet_ioctl(struct inode * inode, | |||
726 | DEBUG(FS_INFO, "Standard PPP ioctl.\n"); | 725 | DEBUG(FS_INFO, "Standard PPP ioctl.\n"); |
727 | if(!capable(CAP_NET_ADMIN)) | 726 | if(!capable(CAP_NET_ADMIN)) |
728 | err = -EPERM; | 727 | err = -EPERM; |
729 | else | 728 | else { |
729 | lock_kernel(); | ||
730 | err = ppp_irnet_ioctl(&ap->chan, cmd, arg); | 730 | err = ppp_irnet_ioctl(&ap->chan, cmd, arg); |
731 | unlock_kernel(); | ||
732 | } | ||
731 | break; | 733 | break; |
732 | 734 | ||
733 | /* TTY IOCTLs : Pretend that we are a tty, to keep pppd happy */ | 735 | /* TTY IOCTLs : Pretend that we are a tty, to keep pppd happy */ |
734 | /* Get termios */ | 736 | /* Get termios */ |
735 | case TCGETS: | 737 | case TCGETS: |
736 | DEBUG(FS_INFO, "Get termios.\n"); | 738 | DEBUG(FS_INFO, "Get termios.\n"); |
739 | lock_kernel(); | ||
737 | #ifndef TCGETS2 | 740 | #ifndef TCGETS2 |
738 | if(kernel_termios_to_user_termios((struct termios __user *)argp, &ap->termios)) | 741 | if(!kernel_termios_to_user_termios((struct termios __user *)argp, &ap->termios)) |
739 | break; | 742 | err = 0; |
740 | #else | 743 | #else |
741 | if(kernel_termios_to_user_termios_1((struct termios __user *)argp, &ap->termios)) | 744 | if(kernel_termios_to_user_termios_1((struct termios __user *)argp, &ap->termios)) |
742 | break; | 745 | err = 0; |
743 | #endif | 746 | #endif |
744 | err = 0; | 747 | unlock_kernel(); |
745 | break; | 748 | break; |
746 | /* Set termios */ | 749 | /* Set termios */ |
747 | case TCSETSF: | 750 | case TCSETSF: |
748 | DEBUG(FS_INFO, "Set termios.\n"); | 751 | DEBUG(FS_INFO, "Set termios.\n"); |
752 | lock_kernel(); | ||
749 | #ifndef TCGETS2 | 753 | #ifndef TCGETS2 |
750 | if(user_termios_to_kernel_termios(&ap->termios, (struct termios __user *)argp)) | 754 | if(!user_termios_to_kernel_termios(&ap->termios, (struct termios __user *)argp)) |
751 | break; | 755 | err = 0; |
752 | #else | 756 | #else |
753 | if(user_termios_to_kernel_termios_1(&ap->termios, (struct termios __user *)argp)) | 757 | if(!user_termios_to_kernel_termios_1(&ap->termios, (struct termios __user *)argp)) |
754 | break; | 758 | err = 0; |
755 | #endif | 759 | #endif |
756 | err = 0; | 760 | unlock_kernel(); |
757 | break; | 761 | break; |
758 | 762 | ||
759 | /* Set DTR/RTS */ | 763 | /* Set DTR/RTS */ |
@@ -776,7 +780,9 @@ dev_irnet_ioctl(struct inode * inode, | |||
776 | * We should also worry that we don't accept junk here and that | 780 | * We should also worry that we don't accept junk here and that |
777 | * we get rid of our own buffers */ | 781 | * we get rid of our own buffers */ |
778 | #ifdef FLUSH_TO_PPP | 782 | #ifdef FLUSH_TO_PPP |
783 | lock_kernel(); | ||
779 | ppp_output_wakeup(&ap->chan); | 784 | ppp_output_wakeup(&ap->chan); |
785 | unlock_kernel(); | ||
780 | #endif /* FLUSH_TO_PPP */ | 786 | #endif /* FLUSH_TO_PPP */ |
781 | err = 0; | 787 | err = 0; |
782 | break; | 788 | break; |
@@ -791,7 +797,7 @@ dev_irnet_ioctl(struct inode * inode, | |||
791 | 797 | ||
792 | default: | 798 | default: |
793 | DERROR(FS_ERROR, "Unsupported ioctl (0x%X)\n", cmd); | 799 | DERROR(FS_ERROR, "Unsupported ioctl (0x%X)\n", cmd); |
794 | err = -ENOIOCTLCMD; | 800 | err = -ENOTTY; |
795 | } | 801 | } |
796 | 802 | ||
797 | DEXIT(FS_TRACE, " - err = 0x%X\n", err); | 803 | DEXIT(FS_TRACE, " - err = 0x%X\n", err); |
diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h index d2beb7df8f7f..d9f8bd4ebd05 100644 --- a/net/irda/irnet/irnet_ppp.h +++ b/net/irda/irnet/irnet_ppp.h | |||
@@ -76,9 +76,8 @@ static ssize_t | |||
76 | static unsigned int | 76 | static unsigned int |
77 | dev_irnet_poll(struct file *, | 77 | dev_irnet_poll(struct file *, |
78 | poll_table *); | 78 | poll_table *); |
79 | static int | 79 | static long |
80 | dev_irnet_ioctl(struct inode *, | 80 | dev_irnet_ioctl(struct file *, |
81 | struct file *, | ||
82 | unsigned int, | 81 | unsigned int, |
83 | unsigned long); | 82 | unsigned long); |
84 | /* ------------------------ PPP INTERFACE ------------------------ */ | 83 | /* ------------------------ PPP INTERFACE ------------------------ */ |
@@ -102,7 +101,7 @@ static struct file_operations irnet_device_fops = | |||
102 | .read = dev_irnet_read, | 101 | .read = dev_irnet_read, |
103 | .write = dev_irnet_write, | 102 | .write = dev_irnet_write, |
104 | .poll = dev_irnet_poll, | 103 | .poll = dev_irnet_poll, |
105 | .ioctl = dev_irnet_ioctl, | 104 | .unlocked_ioctl = dev_irnet_ioctl, |
106 | .open = dev_irnet_open, | 105 | .open = dev_irnet_open, |
107 | .release = dev_irnet_close | 106 | .release = dev_irnet_close |
108 | /* Also : llseek, readdir, mmap, flush, fsync, fasync, lock, readv, writev */ | 107 | /* Also : llseek, readdir, mmap, flush, fsync, fasync, lock, readv, writev */ |