Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b12daf7 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman
Browse files

serqt_usb2: drag screaming into the 21st century



Fix the termios stuff but while we are at it do something about the rest of
it

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2d8a1001
Loading
Loading
Loading
Loading
+8 −10
Original line number Original line Diff line number Diff line
@@ -315,10 +315,8 @@ static void qt_read_bulk_callback(struct urb *urb)
	}
	}


	tty = tty_port_tty_get(&port->port);
	tty = tty_port_tty_get(&port->port);
	if (!tty) {
	if (!tty)
		dbg("%s - bad tty pointer - exiting", __func__);
		return;
		return;
	}


	data = urb->transfer_buffer;
	data = urb->transfer_buffer;


@@ -364,7 +362,7 @@ static void qt_read_bulk_callback(struct urb *urb)
		goto exit;
		goto exit;
	}
	}


	if (tty && RxCount) {
	if (RxCount) {
		flag_data = 0;
		flag_data = 0;
		for (i = 0; i < RxCount; ++i) {
		for (i = 0; i < RxCount; ++i) {
			/* Look ahead code here */
			/* Look ahead code here */
@@ -428,7 +426,7 @@ static void qt_read_bulk_callback(struct urb *urb)
		dbg("%s - failed resubmitting read urb, error %d",
		dbg("%s - failed resubmitting read urb, error %d",
		    __func__, result);
		    __func__, result);
	else {
	else {
		if (tty && RxCount) {
		if (RxCount) {
			tty_flip_buffer_push(tty);
			tty_flip_buffer_push(tty);
			tty_schedule_flip(tty);
			tty_schedule_flip(tty);
		}
		}
@@ -897,8 +895,6 @@ static int qt_open(struct tty_struct *tty,
	 * Put this here to make it responsive to stty and defaults set by
	 * Put this here to make it responsive to stty and defaults set by
	 * the tty layer
	 * the tty layer
	 */
	 */
	/* FIXME: is this needed? */
	/* qt_set_termios(tty, port, NULL); */


	/*  Check to see if we've set up our endpoint info yet */
	/*  Check to see if we've set up our endpoint info yet */
	if (port0->open_ports == 1) {
	if (port0->open_ports == 1) {
@@ -1195,7 +1191,7 @@ static void qt_set_termios(struct tty_struct *tty,
			   struct usb_serial_port *port,
			   struct usb_serial_port *port,
			   struct ktermios *old_termios)
			   struct ktermios *old_termios)
{
{
	struct ktermios *termios = tty->termios;
	struct ktermios *termios = &tty->termios;
	unsigned char new_LCR = 0;
	unsigned char new_LCR = 0;
	unsigned int cflag = termios->c_cflag;
	unsigned int cflag = termios->c_cflag;
	unsigned int index;
	unsigned int index;
@@ -1204,7 +1200,7 @@ static void qt_set_termios(struct tty_struct *tty,


	index = tty->index - port->serial->minor;
	index = tty->index - port->serial->minor;


	switch (cflag) {
	switch (cflag & CSIZE) {
	case CS5:
	case CS5:
		new_LCR |= SERIAL_5_DATA;
		new_LCR |= SERIAL_5_DATA;
		break;
		break;
@@ -1215,6 +1211,8 @@ static void qt_set_termios(struct tty_struct *tty,
		new_LCR |= SERIAL_7_DATA;
		new_LCR |= SERIAL_7_DATA;
		break;
		break;
	default:
	default:
		termios->c_cflag &= ~CSIZE;
		termios->c_cflag |= CS8;
	case CS8:
	case CS8:
		new_LCR |= SERIAL_8_DATA;
		new_LCR |= SERIAL_8_DATA;
		break;
		break;
@@ -1301,7 +1299,7 @@ static void qt_set_termios(struct tty_struct *tty,
			dbg(__FILE__ "BoxSetSW_FlowCtrl (diabling) failed\n");
			dbg(__FILE__ "BoxSetSW_FlowCtrl (diabling) failed\n");


	}
	}
	tty->termios->c_cflag &= ~CMSPAR;
	termios->c_cflag &= ~CMSPAR;
	/* FIXME: Error cases should be returning the actual bits changed only */
	/* FIXME: Error cases should be returning the actual bits changed only */
}
}