From: Kees Schoenmakers on 26 Jan 2010 07:10 Gentlemen, As of version 2.6.32.5 this patch has not made it into the kernel sources. Any reason for this? It is a pity for people who knowingly or unknowingly run into this effect in the driver. kind regards Kees On Saturday 19 September 2009 23:36:29 Greg Kroah-Hartman wrote: > From: Kees Schoenmakers <k.schoenmakers(a)sigmae.nl> > > I made a correction for get_lsr_info, now it returns some meaningful > information. I tested it with two simultaneous simplex modem channels. > > it is attached > > Signed-off-by: Kees Schoenmakers <k.schoenmakers(a)sigmae.nl> > Signed-off-by: Alan Cox <alan(a)linux.intel.com> > Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> > --- > drivers/usb/serial/mos7720.c | 19 +++++++++++++++---- > 1 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c > index 759cdd5..4342a8a 100644 > --- a/drivers/usb/serial/mos7720.c > +++ b/drivers/usb/serial/mos7720.c > @@ -378,10 +378,14 @@ static int mos7720_open(struct tty_struct *tty, > /* Initialize MCS7720 -- Write Init values to corresponding Registers > * > * Register Index > + * 0 : THR/RHR > * 1 : IER > * 2 : FCR > * 3 : LCR > * 4 : MCR > + * 5 : LSR > + * 6 : MSR > + * 7 : SPR > * > * 0x08 : SP1/2 Control Reg > */ > @@ -1250,15 +1254,22 @@ static void mos7720_set_termios(struct tty_struct > *tty, static int get_lsr_info(struct tty_struct *tty, > struct moschip_port *mos7720_port, unsigned int __user *value) > { > - int count; > + struct usb_serial_port *port = tty->driver_data; > unsigned int result = 0; > + unsigned char data = 0; > + int port_number = port->number - port->serial->minor; > + int count; > > count = mos7720_chars_in_buffer(tty); > if (count == 0) { > - dbg("%s -- Empty", __func__); > - result = TIOCSER_TEMT; > + send_mos_cmd(port->serial, MOS_READ, port_number, > + UART_LSR, &data); > + if ((data & (UART_LSR_TEMT | UART_LSR_THRE)) > + == (UART_LSR_TEMT | UART_LSR_THRE)) { > + dbg("%s -- Empty", __func__); > + result = TIOCSER_TEMT; > + } > } > - > if (copy_to_user(value, &result, sizeof(int))) > return -EFAULT; > return 0; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Kees Schoenmakers on 26 Jan 2010 07:10 Gentlemen, Drop my previous email, it has the wrong subject kind regards Kees On Saturday 19 September 2009 23:36:29 Greg Kroah-Hartman wrote: > From: Kees Schoenmakers <k.schoenmakers(a)sigmae.nl> > > I made a correction for get_lsr_info, now it returns some meaningful > information. I tested it with two simultaneous simplex modem channels. > > it is attached > > Signed-off-by: Kees Schoenmakers <k.schoenmakers(a)sigmae.nl> > Signed-off-by: Alan Cox <alan(a)linux.intel.com> > Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> > --- > drivers/usb/serial/mos7720.c | 19 +++++++++++++++---- > 1 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c > index 759cdd5..4342a8a 100644 > --- a/drivers/usb/serial/mos7720.c > +++ b/drivers/usb/serial/mos7720.c > @@ -378,10 +378,14 @@ static int mos7720_open(struct tty_struct *tty, > /* Initialize MCS7720 -- Write Init values to corresponding Registers > * > * Register Index > + * 0 : THR/RHR > * 1 : IER > * 2 : FCR > * 3 : LCR > * 4 : MCR > + * 5 : LSR > + * 6 : MSR > + * 7 : SPR > * > * 0x08 : SP1/2 Control Reg > */ > @@ -1250,15 +1254,22 @@ static void mos7720_set_termios(struct tty_struct > *tty, static int get_lsr_info(struct tty_struct *tty, > struct moschip_port *mos7720_port, unsigned int __user *value) > { > - int count; > + struct usb_serial_port *port = tty->driver_data; > unsigned int result = 0; > + unsigned char data = 0; > + int port_number = port->number - port->serial->minor; > + int count; > > count = mos7720_chars_in_buffer(tty); > if (count == 0) { > - dbg("%s -- Empty", __func__); > - result = TIOCSER_TEMT; > + send_mos_cmd(port->serial, MOS_READ, port_number, > + UART_LSR, &data); > + if ((data & (UART_LSR_TEMT | UART_LSR_THRE)) > + == (UART_LSR_TEMT | UART_LSR_THRE)) { > + dbg("%s -- Empty", __func__); > + result = TIOCSER_TEMT; > + } > } > - > if (copy_to_user(value, &result, sizeof(int))) > return -EFAULT; > return 0; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: Provide ways of crashing the kernel through debugfs Next: usb: otg: add notifier support |