aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/kl5kusb105.c
diff options
context:
space:
mode:
authorAlan <alan@lxorguk.ukuu.org.uk>2006-12-04 11:43:01 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-20 13:13:23 -0500
commitb1cff285ae8d21012ad3717e412b0f50066dc061 (patch)
treed702adfe11a2279e0944fa42d6fb59eb677cbf62 /drivers/usb/serial/kl5kusb105.c
parent337445313ffb7a7e97f408500c7448044d54f921 (diff)
usb serial: Eliminate bogus ioctl code
Several drivers have bogus ioctl code that tries unneccessarily to override the standard processing. In the three cases here the actual code is not only wrong but also not required as they implement the proper set_termios method as well. Remove the junk. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/kl5kusb105.c')
-rw-r--r--drivers/usb/serial/kl5kusb105.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 73d755df4840..5c4b06a99ac0 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -87,10 +87,6 @@ static int klsi_105_write_room (struct usb_serial_port *port);
87static void klsi_105_read_bulk_callback (struct urb *urb); 87static void klsi_105_read_bulk_callback (struct urb *urb);
88static void klsi_105_set_termios (struct usb_serial_port *port, 88static void klsi_105_set_termios (struct usb_serial_port *port,
89 struct ktermios *old); 89 struct ktermios *old);
90static int klsi_105_ioctl (struct usb_serial_port *port,
91 struct file * file,
92 unsigned int cmd,
93 unsigned long arg);
94static void klsi_105_throttle (struct usb_serial_port *port); 90static void klsi_105_throttle (struct usb_serial_port *port);
95static void klsi_105_unthrottle (struct usb_serial_port *port); 91static void klsi_105_unthrottle (struct usb_serial_port *port);
96/* 92/*
@@ -140,7 +136,6 @@ static struct usb_serial_driver kl5kusb105d_device = {
140 .chars_in_buffer = klsi_105_chars_in_buffer, 136 .chars_in_buffer = klsi_105_chars_in_buffer,
141 .write_room = klsi_105_write_room, 137 .write_room = klsi_105_write_room,
142 .read_bulk_callback =klsi_105_read_bulk_callback, 138 .read_bulk_callback =klsi_105_read_bulk_callback,
143 .ioctl = klsi_105_ioctl,
144 .set_termios = klsi_105_set_termios, 139 .set_termios = klsi_105_set_termios,
145 /*.break_ctl = klsi_105_break_ctl,*/ 140 /*.break_ctl = klsi_105_break_ctl,*/
146 .tiocmget = klsi_105_tiocmget, 141 .tiocmget = klsi_105_tiocmget,
@@ -899,69 +894,6 @@ static int klsi_105_tiocmset (struct usb_serial_port *port, struct file *file,
899*/ 894*/
900 return retval; 895 return retval;
901} 896}
902
903static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
904 unsigned int cmd, unsigned long arg)
905{
906 struct klsi_105_private *priv = usb_get_serial_port_data(port);
907 void __user *user_arg = (void __user *)arg;
908
909 dbg("%scmd=0x%x", __FUNCTION__, cmd);
910
911 /* Based on code from acm.c and others */
912 switch (cmd) {
913 case TIOCMIWAIT:
914 /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/
915 /* TODO */
916 dbg("%s - TIOCMIWAIT not handled", __FUNCTION__);
917 return -ENOIOCTLCMD;
918 case TIOCGICOUNT:
919 /* return count of modemline transitions */
920 /* TODO */
921 dbg("%s - TIOCGICOUNT not handled", __FUNCTION__);
922 return -ENOIOCTLCMD;
923 case TCGETS:
924 /* return current info to caller */
925 dbg("%s - TCGETS data faked/incomplete", __FUNCTION__);
926
927 if (!access_ok(VERIFY_WRITE, user_arg, sizeof(struct termios)))
928 return -EFAULT;
929
930 if (kernel_termios_to_user_termios((struct termios __user *)arg,
931 &priv->termios))
932 return -EFAULT;
933 return 0;
934 case TCSETS:
935 /* set port termios to the one given by the user */
936 dbg("%s - TCSETS not handled", __FUNCTION__);
937
938 if (!access_ok(VERIFY_READ, user_arg, sizeof(struct termios)))
939 return -EFAULT;
940
941 if (user_termios_to_kernel_termios(&priv->termios,
942 (struct termios __user *)arg))
943 return -EFAULT;
944 klsi_105_set_termios(port, &priv->termios);
945 return 0;
946 case TCSETSW: {
947 /* set port termios and try to wait for completion of last
948 * write operation */
949 /* We guess here. If there are not too many write urbs
950 * outstanding, we lie. */
951 /* what is the right way to wait here? schedule() ? */
952 /*
953 while (klsi_105_chars_in_buffer(port) > (NUM_URBS / 4 ) * URB_TRANSFER_BUFFER_SIZE)
954 schedule();
955 */
956 return -ENOIOCTLCMD;
957 }
958 default:
959 dbg("%s: arg not supported - 0x%04x", __FUNCTION__,cmd);
960 return(-ENOIOCTLCMD);
961 break;
962 }
963 return 0;
964} /* klsi_105_ioctl */
965 897
966static void klsi_105_throttle (struct usb_serial_port *port) 898static void klsi_105_throttle (struct usb_serial_port *port)
967{ 899{