aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/funsoft.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/funsoft.c')
-rw-r--r--drivers/usb/serial/funsoft.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c
index 77b977206a8c..4092f6dc9efd 100644
--- a/drivers/usb/serial/funsoft.c
+++ b/drivers/usb/serial/funsoft.c
@@ -14,6 +14,9 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/usb.h> 15#include <linux/usb.h>
16#include <linux/usb/serial.h> 16#include <linux/usb/serial.h>
17#include <asm/uaccess.h>
18
19static int debug;
17 20
18static struct usb_device_id id_table [] = { 21static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0x1404, 0xcddc) }, 22 { USB_DEVICE(0x1404, 0xcddc) },
@@ -21,6 +24,26 @@ static struct usb_device_id id_table [] = {
21}; 24};
22MODULE_DEVICE_TABLE(usb, id_table); 25MODULE_DEVICE_TABLE(usb, id_table);
23 26
27static int funsoft_ioctl(struct usb_serial_port *port, struct file *file,
28 unsigned int cmd, unsigned long arg)
29{
30 struct ktermios t;
31
32 dbg("%s - port %d, cmd 0x%04x", __FUNCTION__, port->number, cmd);
33
34 if (cmd == TCSETSF) {
35 if (user_termios_to_kernel_termios(&t, (struct termios __user *)arg))
36 return -EFAULT;
37
38 dbg("%s - iflag:%x oflag:%x cflag:%x lflag:%x", __FUNCTION__,
39 t.c_iflag, t.c_oflag, t.c_cflag, t.c_lflag);
40
41 if (!(t.c_lflag & ICANON))
42 return -EINVAL;
43 }
44 return -ENOIOCTLCMD;
45}
46
24static struct usb_driver funsoft_driver = { 47static struct usb_driver funsoft_driver = {
25 .name = "funsoft", 48 .name = "funsoft",
26 .probe = usb_serial_probe, 49 .probe = usb_serial_probe,
@@ -35,10 +58,12 @@ static struct usb_serial_driver funsoft_device = {
35 .name = "funsoft", 58 .name = "funsoft",
36 }, 59 },
37 .id_table = id_table, 60 .id_table = id_table,
61 .usb_driver = &funsoft_driver,
38 .num_interrupt_in = NUM_DONT_CARE, 62 .num_interrupt_in = NUM_DONT_CARE,
39 .num_bulk_in = NUM_DONT_CARE, 63 .num_bulk_in = NUM_DONT_CARE,
40 .num_bulk_out = NUM_DONT_CARE, 64 .num_bulk_out = NUM_DONT_CARE,
41 .num_ports = 1, 65 .num_ports = 1,
66 .ioctl = funsoft_ioctl,
42}; 67};
43 68
44static int __init funsoft_init(void) 69static int __init funsoft_init(void)
@@ -63,3 +88,6 @@ static void __exit funsoft_exit(void)
63module_init(funsoft_init); 88module_init(funsoft_init);
64module_exit(funsoft_exit); 89module_exit(funsoft_exit);
65MODULE_LICENSE("GPL"); 90MODULE_LICENSE("GPL");
91
92module_param(debug, bool, S_IRUGO | S_IWUSR);
93MODULE_PARM_DESC(debug, "Debug enabled or not");