lkml.org 
[lkml]   [2015]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 7/7] usb: serial: modify ioctl TIOCGSERIAL for F81232
Date
Set correct product type from 16654 to 16550A and
fix the ioctl TIOCGSERIAL return struct values.

Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com>
---
drivers/usb/serial/f81232.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 0ed7e36..4d3aba8 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -518,13 +518,18 @@ static int f81232_ioctl(struct tty_struct *tty,

switch (cmd) {
case TIOCGSERIAL:
- memset(&ser, 0, sizeof ser);
- ser.type = PORT_16654;
+ memset(&ser, 0, sizeof(ser));
+ ser.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
+ ser.xmit_fifo_size = port->bulk_out_size;
+ ser.close_delay = 5*HZ;
+ ser.closing_wait = 30*HZ;
+
+ ser.type = PORT_16550A;
ser.line = port->minor;
ser.port = port->port_number;
- ser.baud_base = 460800;
+ ser.baud_base = 115200;

- if (copy_to_user((void __user *)arg, &ser, sizeof ser))
+ if (copy_to_user((void __user *)arg, &ser, sizeof(ser)))
return -EFAULT;

return 0;
--
1.9.1


\
 
 \ /
  Last update: 2015-01-30 07:41    [W:0.121 / U:2.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site