X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fserial%2Ffunsoft.c;h=2bebd63d5ed19e11b0f9ce174317737100e0de66;hb=refs%2Fheads%2Fvserver;hp=77b977206a8c09186d1d8e42203e40c4774ad790;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c index 77b977206..2bebd63d5 100644 --- a/drivers/usb/serial/funsoft.c +++ b/drivers/usb/serial/funsoft.c @@ -14,6 +14,9 @@ #include #include #include +#include + +static int debug; static struct usb_device_id id_table [] = { { USB_DEVICE(0x1404, 0xcddc) }, @@ -21,6 +24,26 @@ static struct usb_device_id id_table [] = { }; MODULE_DEVICE_TABLE(usb, id_table); +static int funsoft_ioctl(struct usb_serial_port *port, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct ktermios t; + + dbg("%s - port %d, cmd 0x%04x", __FUNCTION__, port->number, cmd); + + if (cmd == TCSETSF) { + if (user_termios_to_kernel_termios(&t, (struct termios __user *)arg)) + return -EFAULT; + + dbg("%s - iflag:%x oflag:%x cflag:%x lflag:%x", __FUNCTION__, + t.c_iflag, t.c_oflag, t.c_cflag, t.c_lflag); + + if (!(t.c_lflag & ICANON)) + return -EINVAL; + } + return -ENOIOCTLCMD; +} + static struct usb_driver funsoft_driver = { .name = "funsoft", .probe = usb_serial_probe, @@ -39,6 +62,7 @@ static struct usb_serial_driver funsoft_device = { .num_bulk_in = NUM_DONT_CARE, .num_bulk_out = NUM_DONT_CARE, .num_ports = 1, + .ioctl = funsoft_ioctl, }; static int __init funsoft_init(void) @@ -63,3 +87,6 @@ static void __exit funsoft_exit(void) module_init(funsoft_init); module_exit(funsoft_exit); MODULE_LICENSE("GPL"); + +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Debug enabled or not");