aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tty_ioctl.c170
-rw-r--r--drivers/net/Kconfig7
-rw-r--r--drivers/net/hamradio/6pack.c26
-rw-r--r--drivers/net/irda/irtty-sir.c7
-rw-r--r--drivers/net/ppp_async.c10
-rw-r--r--drivers/net/ppp_synctty.c10
-rw-r--r--drivers/net/pppol2tp.c25
-rw-r--r--drivers/net/rrunner.c18
-rw-r--r--drivers/net/slip.c8
-rw-r--r--drivers/net/usb/Kconfig9
-rw-r--r--drivers/net/usb/usbnet.c7
-rw-r--r--drivers/net/wan/x25_asy.c6
-rw-r--r--drivers/net/wireless/strip.c10
13 files changed, 147 insertions, 166 deletions
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 7a003504c265..1bdd2bf4f37d 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -730,13 +730,23 @@ static int send_prio_char(struct tty_struct *tty, char ch)
730 return 0; 730 return 0;
731} 731}
732 732
733int n_tty_ioctl(struct tty_struct * tty, struct file * file, 733/**
734 unsigned int cmd, unsigned long arg) 734 * tty_mode_ioctl - mode related ioctls
735 * @tty: tty for the ioctl
736 * @file: file pointer for the tty
737 * @cmd: command
738 * @arg: ioctl argument
739 *
740 * Perform non line discipline specific mode control ioctls. This
741 * is designed to be called by line disciplines to ensure they provide
742 * consistent mode setting.
743 */
744
745int tty_mode_ioctl(struct tty_struct * tty, struct file *file,
746 unsigned int cmd, unsigned long arg)
735{ 747{
736 struct tty_struct * real_tty; 748 struct tty_struct * real_tty;
737 void __user *p = (void __user *)arg; 749 void __user *p = (void __user *)arg;
738 int retval;
739 struct tty_ldisc *ld;
740 750
741 if (tty->driver->type == TTY_DRIVER_TYPE_PTY && 751 if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
742 tty->driver->subtype == PTY_TYPE_MASTER) 752 tty->driver->subtype == PTY_TYPE_MASTER)
@@ -799,6 +809,93 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
799 return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO); 809 return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO);
800 case TCSETA: 810 case TCSETA:
801 return set_termios(real_tty, p, TERMIOS_TERMIO); 811 return set_termios(real_tty, p, TERMIOS_TERMIO);
812#ifndef TCGETS2
813 case TIOCGLCKTRMIOS:
814 if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
815 return -EFAULT;
816 return 0;
817
818 case TIOCSLCKTRMIOS:
819 if (!capable(CAP_SYS_ADMIN))
820 return -EPERM;
821 if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg))
822 return -EFAULT;
823 return 0;
824#else
825 case TIOCGLCKTRMIOS:
826 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
827 return -EFAULT;
828 return 0;
829
830 case TIOCSLCKTRMIOS:
831 if (!capable(CAP_SYS_ADMIN))
832 return -EPERM;
833 if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
834 return -EFAULT;
835 return 0;
836#endif
837 case TIOCGSOFTCAR:
838 return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg);
839 case TIOCSSOFTCAR:
840 if (get_user(arg, (unsigned int __user *) arg))
841 return -EFAULT;
842 mutex_lock(&tty->termios_mutex);
843 tty->termios->c_cflag =
844 ((tty->termios->c_cflag & ~CLOCAL) |
845 (arg ? CLOCAL : 0));
846 mutex_unlock(&tty->termios_mutex);
847 return 0;
848 default:
849 return -ENOIOCTLCMD;
850 }
851}
852
853EXPORT_SYMBOL_GPL(tty_mode_ioctl);
854
855int tty_perform_flush(struct tty_struct *tty, unsigned long arg)
856{
857 struct tty_ldisc *ld;
858 int retval = tty_check_change(tty);
859 if (retval)
860 return retval;
861
862 ld = tty_ldisc_ref(tty);
863 switch (arg) {
864 case TCIFLUSH:
865 if (ld && ld->flush_buffer)
866 ld->flush_buffer(tty);
867 break;
868 case TCIOFLUSH:
869 if (ld && ld->flush_buffer)
870 ld->flush_buffer(tty);
871 /* fall through */
872 case TCOFLUSH:
873 if (tty->driver->flush_buffer)
874 tty->driver->flush_buffer(tty);
875 break;
876 default:
877 tty_ldisc_deref(ld);
878 return -EINVAL;
879 }
880 tty_ldisc_deref(ld);
881 return 0;
882}
883
884EXPORT_SYMBOL_GPL(tty_perform_flush);
885
886int n_tty_ioctl(struct tty_struct * tty, struct file * file,
887 unsigned int cmd, unsigned long arg)
888{
889 struct tty_struct * real_tty;
890 int retval;
891
892 if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
893 tty->driver->subtype == PTY_TYPE_MASTER)
894 real_tty = tty->link;
895 else
896 real_tty = tty;
897
898 switch (cmd) {
802 case TCXONC: 899 case TCXONC:
803 retval = tty_check_change(tty); 900 retval = tty_check_change(tty);
804 if (retval) 901 if (retval)
@@ -829,30 +926,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
829 } 926 }
830 return 0; 927 return 0;
831 case TCFLSH: 928 case TCFLSH:
832 retval = tty_check_change(tty); 929 return tty_perform_flush(tty, arg);
833 if (retval)
834 return retval;
835
836 ld = tty_ldisc_ref(tty);
837 switch (arg) {
838 case TCIFLUSH:
839 if (ld && ld->flush_buffer)
840 ld->flush_buffer(tty);
841 break;
842 case TCIOFLUSH:
843 if (ld && ld->flush_buffer)
844 ld->flush_buffer(tty);
845 /* fall through */
846 case TCOFLUSH:
847 if (tty->driver->flush_buffer)
848 tty->driver->flush_buffer(tty);
849 break;
850 default:
851 tty_ldisc_deref(ld);
852 return -EINVAL;
853 }
854 tty_ldisc_deref(ld);
855 return 0;
856 case TIOCOUTQ: 930 case TIOCOUTQ:
857 return put_user(tty->driver->chars_in_buffer ? 931 return put_user(tty->driver->chars_in_buffer ?
858 tty->driver->chars_in_buffer(tty) : 0, 932 tty->driver->chars_in_buffer(tty) : 0,
@@ -862,32 +936,6 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
862 if (L_ICANON(tty)) 936 if (L_ICANON(tty))
863 retval = inq_canon(tty); 937 retval = inq_canon(tty);
864 return put_user(retval, (unsigned int __user *) arg); 938 return put_user(retval, (unsigned int __user *) arg);
865#ifndef TCGETS2
866 case TIOCGLCKTRMIOS:
867 if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
868 return -EFAULT;
869 return 0;
870
871 case TIOCSLCKTRMIOS:
872 if (!capable(CAP_SYS_ADMIN))
873 return -EPERM;
874 if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg))
875 return -EFAULT;
876 return 0;
877#else
878 case TIOCGLCKTRMIOS:
879 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
880 return -EFAULT;
881 return 0;
882
883 case TIOCSLCKTRMIOS:
884 if (!capable(CAP_SYS_ADMIN))
885 return -EPERM;
886 if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
887 return -EFAULT;
888 return 0;
889#endif
890
891 case TIOCPKT: 939 case TIOCPKT:
892 { 940 {
893 int pktmode; 941 int pktmode;
@@ -906,19 +954,9 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
906 tty->packet = 0; 954 tty->packet = 0;
907 return 0; 955 return 0;
908 } 956 }
909 case TIOCGSOFTCAR:
910 return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg);
911 case TIOCSSOFTCAR:
912 if (get_user(arg, (unsigned int __user *) arg))
913 return -EFAULT;
914 mutex_lock(&tty->termios_mutex);
915 tty->termios->c_cflag =
916 ((tty->termios->c_cflag & ~CLOCAL) |
917 (arg ? CLOCAL : 0));
918 mutex_unlock(&tty->termios_mutex);
919 return 0;
920 default: 957 default:
921 return -ENOIOCTLCMD; 958 /* Try the mode commands */
959 return tty_mode_ioctl(tty, file, cmd, arg);
922 } 960 }
923} 961}
924 962
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 5f800a6dd978..cb581ebbe3c5 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -136,10 +136,11 @@ config TUN
136 If you don't know what to use this for, you don't need it. 136 If you don't know what to use this for, you don't need it.
137 137
138config VETH 138config VETH
139 tristate "Virtual ethernet device" 139 tristate "Virtual ethernet pair device"
140 ---help--- 140 ---help---
141 The device is an ethernet tunnel. Devices are created in pairs. When 141 This device is a local ethernet tunnel. Devices are created in pairs.
142 one end receives the packet it appears on its pair and vice versa. 142 When one end receives the packet it appears on its pair and vice
143 versa.
143 144
144config NET_SB1000 145config NET_SB1000
145 tristate "General Instruments Surfboard 1000" 146 tristate "General Instruments Surfboard 1000"
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index e0119f6a3319..580cb4ab2af1 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -762,26 +762,20 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
762 762
763 if (copy_from_user(&addr, 763 if (copy_from_user(&addr,
764 (void __user *) arg, AX25_ADDR_LEN)) { 764 (void __user *) arg, AX25_ADDR_LEN)) {
765 err = -EFAULT; 765 err = -EFAULT;
766 break; 766 break;
767 } 767 }
768 768
769 netif_tx_lock_bh(dev); 769 netif_tx_lock_bh(dev);
770 memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN); 770 memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN);
771 netif_tx_unlock_bh(dev); 771 netif_tx_unlock_bh(dev);
772 772
773 err = 0; 773 err = 0;
774 break; 774 break;
775 } 775 }
776
777 /* Allow stty to read, but not set, the serial port */
778 case TCGETS:
779 case TCGETA:
780 err = n_tty_ioctl(tty, (struct file *) file, cmd, arg);
781 break;
782 776
783 default: 777 default:
784 err = -ENOIOCTLCMD; 778 err = tty_mode_ioctl(tty, file, cmd, arg);
785 } 779 }
786 780
787 sp_put(sp); 781 sp_put(sp);
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index 2c6f7be36e8a..fc753d7f674e 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -434,11 +434,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
434 IRDA_ASSERT(dev != NULL, return -1;); 434 IRDA_ASSERT(dev != NULL, return -1;);
435 435
436 switch (cmd) { 436 switch (cmd) {
437 case TCGETS:
438 case TCGETA:
439 err = n_tty_ioctl(tty, file, cmd, arg);
440 break;
441
442 case IRTTY_IOCTDONGLE: 437 case IRTTY_IOCTDONGLE:
443 /* this call blocks for completion */ 438 /* this call blocks for completion */
444 err = sirdev_set_dongle(dev, (IRDA_DONGLE) arg); 439 err = sirdev_set_dongle(dev, (IRDA_DONGLE) arg);
@@ -454,7 +449,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
454 err = -EFAULT; 449 err = -EFAULT;
455 break; 450 break;
456 default: 451 default:
457 err = -ENOIOCTLCMD; 452 err = tty_mode_ioctl(tty, file, cmd, arg);
458 break; 453 break;
459 } 454 }
460 return err; 455 return err;
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 27f5b904f48e..8d278c87ba48 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -309,16 +309,11 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
309 err = 0; 309 err = 0;
310 break; 310 break;
311 311
312 case TCGETS:
313 case TCGETA:
314 err = n_tty_ioctl(tty, file, cmd, arg);
315 break;
316
317 case TCFLSH: 312 case TCFLSH:
318 /* flush our buffers and the serial port's buffer */ 313 /* flush our buffers and the serial port's buffer */
319 if (arg == TCIOFLUSH || arg == TCOFLUSH) 314 if (arg == TCIOFLUSH || arg == TCOFLUSH)
320 ppp_async_flush_output(ap); 315 ppp_async_flush_output(ap);
321 err = n_tty_ioctl(tty, file, cmd, arg); 316 err = tty_perform_flush(tty, arg);
322 break; 317 break;
323 318
324 case FIONREAD: 319 case FIONREAD:
@@ -329,7 +324,8 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
329 break; 324 break;
330 325
331 default: 326 default:
332 err = -ENOIOCTLCMD; 327 /* Try the various mode ioctls */
328 err = tty_mode_ioctl(tty, file, cmd, arg);
333 } 329 }
334 330
335 ap_put(ap); 331 ap_put(ap);
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index ce64032a465a..00e2fb48b4ae 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -349,16 +349,11 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
349 err = 0; 349 err = 0;
350 break; 350 break;
351 351
352 case TCGETS:
353 case TCGETA:
354 err = n_tty_ioctl(tty, file, cmd, arg);
355 break;
356
357 case TCFLSH: 352 case TCFLSH:
358 /* flush our buffers and the serial port's buffer */ 353 /* flush our buffers and the serial port's buffer */
359 if (arg == TCIOFLUSH || arg == TCOFLUSH) 354 if (arg == TCIOFLUSH || arg == TCOFLUSH)
360 ppp_sync_flush_output(ap); 355 ppp_sync_flush_output(ap);
361 err = n_tty_ioctl(tty, file, cmd, arg); 356 err = tty_perform_flush(tty, arg);
362 break; 357 break;
363 358
364 case FIONREAD: 359 case FIONREAD:
@@ -369,7 +364,8 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
369 break; 364 break;
370 365
371 default: 366 default:
372 err = -ENOIOCTLCMD; 367 err = tty_mode_ioctl(tty, file, cmd, arg);
368 break;
373 } 369 }
374 370
375 sp_put(ap); 371 sp_put(ap);
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index f8904fd92369..a7556cd2df79 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -488,7 +488,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
488{ 488{
489 struct pppol2tp_session *session = NULL; 489 struct pppol2tp_session *session = NULL;
490 struct pppol2tp_tunnel *tunnel; 490 struct pppol2tp_tunnel *tunnel;
491 unsigned char *ptr; 491 unsigned char *ptr, *optr;
492 u16 hdrflags; 492 u16 hdrflags;
493 u16 tunnel_id, session_id; 493 u16 tunnel_id, session_id;
494 int length; 494 int length;
@@ -496,7 +496,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
496 496
497 tunnel = pppol2tp_sock_to_tunnel(sock); 497 tunnel = pppol2tp_sock_to_tunnel(sock);
498 if (tunnel == NULL) 498 if (tunnel == NULL)
499 goto error; 499 goto no_tunnel;
500 500
501 /* UDP always verifies the packet length. */ 501 /* UDP always verifies the packet length. */
502 __skb_pull(skb, sizeof(struct udphdr)); 502 __skb_pull(skb, sizeof(struct udphdr));
@@ -509,7 +509,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
509 } 509 }
510 510
511 /* Point to L2TP header */ 511 /* Point to L2TP header */
512 ptr = skb->data; 512 optr = ptr = skb->data;
513 513
514 /* Get L2TP header flags */ 514 /* Get L2TP header flags */
515 hdrflags = ntohs(*(__be16*)ptr); 515 hdrflags = ntohs(*(__be16*)ptr);
@@ -637,12 +637,14 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
637 /* If offset bit set, skip it. */ 637 /* If offset bit set, skip it. */
638 if (hdrflags & L2TP_HDRFLAG_O) { 638 if (hdrflags & L2TP_HDRFLAG_O) {
639 offset = ntohs(*(__be16 *)ptr); 639 offset = ntohs(*(__be16 *)ptr);
640 skb->transport_header += 2 + offset; 640 ptr += 2 + offset;
641 if (!pskb_may_pull(skb, skb_transport_offset(skb) + 2))
642 goto discard;
643 } 641 }
644 642
645 __skb_pull(skb, skb_transport_offset(skb)); 643 offset = ptr - optr;
644 if (!pskb_may_pull(skb, offset))
645 goto discard;
646
647 __skb_pull(skb, offset);
646 648
647 /* Skip PPP header, if present. In testing, Microsoft L2TP clients 649 /* Skip PPP header, if present. In testing, Microsoft L2TP clients
648 * don't send the PPP header (PPP header compression enabled), but 650 * don't send the PPP header (PPP header compression enabled), but
@@ -652,6 +654,9 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
652 * Note that skb->data[] isn't dereferenced from a u16 ptr here since 654 * Note that skb->data[] isn't dereferenced from a u16 ptr here since
653 * the field may be unaligned. 655 * the field may be unaligned.
654 */ 656 */
657 if (!pskb_may_pull(skb, 2))
658 goto discard;
659
655 if ((skb->data[0] == 0xff) && (skb->data[1] == 0x03)) 660 if ((skb->data[0] == 0xff) && (skb->data[1] == 0x03))
656 skb_pull(skb, 2); 661 skb_pull(skb, 2);
657 662
@@ -709,6 +714,10 @@ discard:
709 return 0; 714 return 0;
710 715
711error: 716error:
717 /* Put UDP header back */
718 __skb_push(skb, sizeof(struct udphdr));
719
720no_tunnel:
712 return 1; 721 return 1;
713} 722}
714 723
@@ -1050,6 +1059,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
1050 /* Get routing info from the tunnel socket */ 1059 /* Get routing info from the tunnel socket */
1051 dst_release(skb->dst); 1060 dst_release(skb->dst);
1052 skb->dst = sk_dst_get(sk_tun); 1061 skb->dst = sk_dst_get(sk_tun);
1062 skb_orphan(skb);
1063 skb->sk = sk_tun;
1053 1064
1054 /* Queue the packet to IP for output */ 1065 /* Queue the packet to IP for output */
1055 len = skb->len; 1066 len = skb->len;
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c
index b822859c8de3..73a7e6529ee0 100644
--- a/drivers/net/rrunner.c
+++ b/drivers/net/rrunner.c
@@ -78,12 +78,6 @@ static char version[] __devinitdata = "rrunner.c: v0.50 11/11/2002 Jes Sorensen
78 * stack will need to know about I/O vectors or something similar. 78 * stack will need to know about I/O vectors or something similar.
79 */ 79 */
80 80
81/*
82 * sysctl_[wr]mem_max are checked at init time to see if they are at
83 * least 256KB and increased to 256KB if they are not. This is done to
84 * avoid ending up with socket buffers smaller than the MTU size,
85 */
86
87static int __devinit rr_init_one(struct pci_dev *pdev, 81static int __devinit rr_init_one(struct pci_dev *pdev,
88 const struct pci_device_id *ent) 82 const struct pci_device_id *ent)
89{ 83{
@@ -561,18 +555,6 @@ static int __devinit rr_init(struct net_device *dev)
561 sram_size = rr_read_eeprom_word(rrpriv, (void *)8); 555 sram_size = rr_read_eeprom_word(rrpriv, (void *)8);
562 printk(" SRAM size 0x%06x\n", sram_size); 556 printk(" SRAM size 0x%06x\n", sram_size);
563 557
564 if (sysctl_rmem_max < 262144){
565 printk(" Receive socket buffer limit too low (%i), "
566 "setting to 262144\n", sysctl_rmem_max);
567 sysctl_rmem_max = 262144;
568 }
569
570 if (sysctl_wmem_max < 262144){
571 printk(" Transmit socket buffer limit too low (%i), "
572 "setting to 262144\n", sysctl_wmem_max);
573 sysctl_wmem_max = 262144;
574 }
575
576 return 0; 558 return 0;
577} 559}
578 560
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index 335b7cc80eba..251a3ce376ac 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -1218,14 +1218,8 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
1218 return 0; 1218 return 0;
1219 /* VSV changes end */ 1219 /* VSV changes end */
1220#endif 1220#endif
1221
1222 /* Allow stty to read, but not set, the serial port */
1223 case TCGETS:
1224 case TCGETA:
1225 return n_tty_ioctl(tty, file, cmd, arg);
1226
1227 default: 1221 default:
1228 return -ENOIOCTLCMD; 1222 return tty_mode_ioctl(tty, file, cmd, arg);
1229 } 1223 }
1230} 1224}
1231 1225
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index 5a96d74e4ce8..a12c9c41b217 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -93,13 +93,9 @@ config USB_RTL8150
93 To compile this driver as a module, choose M here: the 93 To compile this driver as a module, choose M here: the
94 module will be called rtl8150. 94 module will be called rtl8150.
95 95
96config USB_USBNET_MII
97 tristate
98 default n
99
100config USB_USBNET 96config USB_USBNET
101 tristate "Multi-purpose USB Networking Framework" 97 tristate "Multi-purpose USB Networking Framework"
102 select MII if USB_USBNET_MII != n 98 select MII
103 ---help--- 99 ---help---
104 This driver supports several kinds of network links over USB, 100 This driver supports several kinds of network links over USB,
105 with "minidrivers" built around a common network driver core 101 with "minidrivers" built around a common network driver core
@@ -135,7 +131,6 @@ config USB_NET_AX8817X
135 tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" 131 tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters"
136 depends on USB_USBNET && NET_ETHERNET 132 depends on USB_USBNET && NET_ETHERNET
137 select CRC32 133 select CRC32
138 select USB_USBNET_MII
139 default y 134 default y
140 help 135 help
141 This option adds support for ASIX AX88xxx based USB 2.0 136 This option adds support for ASIX AX88xxx based USB 2.0
@@ -190,7 +185,6 @@ config USB_NET_DM9601
190 tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices" 185 tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices"
191 depends on USB_USBNET 186 depends on USB_USBNET
192 select CRC32 187 select CRC32
193 select USB_USBNET_MII
194 help 188 help
195 This option adds support for Davicom DM9601 based USB 1.1 189 This option adds support for Davicom DM9601 based USB 1.1
196 10/100 Ethernet adapters. 190 10/100 Ethernet adapters.
@@ -225,7 +219,6 @@ config USB_NET_PLUSB
225config USB_NET_MCS7830 219config USB_NET_MCS7830
226 tristate "MosChip MCS7830 based Ethernet adapters" 220 tristate "MosChip MCS7830 based Ethernet adapters"
227 depends on USB_USBNET 221 depends on USB_USBNET
228 select USB_USBNET_MII
229 help 222 help
230 Choose this option if you're using a 10/100 Ethernet USB2 223 Choose this option if you're using a 10/100 Ethernet USB2
231 adapter based on the MosChip 7830 controller. This includes 224 adapter based on the MosChip 7830 controller. This includes
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index acd5f1c0e63a..8ed1fc5cbc70 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -683,9 +683,6 @@ done_nopm:
683 * they'll probably want to use this base set. 683 * they'll probably want to use this base set.
684 */ 684 */
685 685
686#if defined(CONFIG_MII) || defined(CONFIG_MII_MODULE)
687#define HAVE_MII
688
689int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd) 686int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd)
690{ 687{
691 struct usbnet *dev = netdev_priv(net); 688 struct usbnet *dev = netdev_priv(net);
@@ -744,8 +741,6 @@ int usbnet_nway_reset(struct net_device *net)
744} 741}
745EXPORT_SYMBOL_GPL(usbnet_nway_reset); 742EXPORT_SYMBOL_GPL(usbnet_nway_reset);
746 743
747#endif /* HAVE_MII */
748
749void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info) 744void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
750{ 745{
751 struct usbnet *dev = netdev_priv(net); 746 struct usbnet *dev = netdev_priv(net);
@@ -776,12 +771,10 @@ EXPORT_SYMBOL_GPL(usbnet_set_msglevel);
776 771
777/* drivers may override default ethtool_ops in their bind() routine */ 772/* drivers may override default ethtool_ops in their bind() routine */
778static struct ethtool_ops usbnet_ethtool_ops = { 773static struct ethtool_ops usbnet_ethtool_ops = {
779#ifdef HAVE_MII
780 .get_settings = usbnet_get_settings, 774 .get_settings = usbnet_get_settings,
781 .set_settings = usbnet_set_settings, 775 .set_settings = usbnet_set_settings,
782 .get_link = usbnet_get_link, 776 .get_link = usbnet_get_link,
783 .nway_reset = usbnet_nway_reset, 777 .nway_reset = usbnet_nway_reset,
784#endif
785 .get_drvinfo = usbnet_get_drvinfo, 778 .get_drvinfo = usbnet_get_drvinfo,
786 .get_msglevel = usbnet_get_msglevel, 779 .get_msglevel = usbnet_get_msglevel,
787 .set_msglevel = usbnet_set_msglevel, 780 .set_msglevel = usbnet_set_msglevel,
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index c48b1cc63fd5..1e89d4de1bb7 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -719,12 +719,8 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
719 return 0; 719 return 0;
720 case SIOCSIFHWADDR: 720 case SIOCSIFHWADDR:
721 return -EINVAL; 721 return -EINVAL;
722 /* Allow stty to read, but not set, the serial port */
723 case TCGETS:
724 case TCGETA:
725 return n_tty_ioctl(tty, file, cmd, arg);
726 default: 722 default:
727 return -ENOIOCTLCMD; 723 return tty_mode_ioctl(tty, file, cmd, arg);
728 } 724 }
729} 725}
730 726
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 4bd14b331862..88efe1bae58f 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -2735,16 +2735,8 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
2735 return -EFAULT; 2735 return -EFAULT;
2736 return set_mac_address(strip_info, &addr); 2736 return set_mac_address(strip_info, &addr);
2737 } 2737 }
2738 /*
2739 * Allow stty to read, but not set, the serial port
2740 */
2741
2742 case TCGETS:
2743 case TCGETA:
2744 return n_tty_ioctl(tty, file, cmd, arg);
2745 break;
2746 default: 2738 default:
2747 return -ENOIOCTLCMD; 2739 return tty_mode_ioctl(tty, file, cmd, arg);
2748 break; 2740 break;
2749 } 2741 }
2750 return 0; 2742 return 0;