aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/kobil_sct.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/kobil_sct.c')
-rw-r--r--drivers/usb/serial/kobil_sct.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 97901578343a..45ea694b3ae6 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -84,7 +84,7 @@ static void kobil_read_int_callback(struct urb *urb);
84static void kobil_write_callback(struct urb *purb); 84static void kobil_write_callback(struct urb *purb);
85static void kobil_set_termios(struct tty_struct *tty, 85static void kobil_set_termios(struct tty_struct *tty,
86 struct usb_serial_port *port, struct ktermios *old); 86 struct usb_serial_port *port, struct ktermios *old);
87 87static void kobil_init_termios(struct tty_struct *tty);
88 88
89static struct usb_device_id id_table [] = { 89static struct usb_device_id id_table [] = {
90 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_B_PRODUCT_ID) }, 90 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_B_PRODUCT_ID) },
@@ -119,6 +119,7 @@ static struct usb_serial_driver kobil_device = {
119 .release = kobil_release, 119 .release = kobil_release,
120 .ioctl = kobil_ioctl, 120 .ioctl = kobil_ioctl,
121 .set_termios = kobil_set_termios, 121 .set_termios = kobil_set_termios,
122 .init_termios = kobil_init_termios,
122 .tiocmget = kobil_tiocmget, 123 .tiocmget = kobil_tiocmget,
123 .tiocmset = kobil_tiocmset, 124 .tiocmset = kobil_tiocmset,
124 .open = kobil_open, 125 .open = kobil_open,
@@ -209,6 +210,15 @@ static void kobil_release(struct usb_serial *serial)
209 kfree(usb_get_serial_port_data(serial->port[i])); 210 kfree(usb_get_serial_port_data(serial->port[i]));
210} 211}
211 212
213static void kobil_init_termios(struct tty_struct *tty)
214{
215 /* Default to echo off and other sane device settings */
216 tty->termios->c_lflag = 0;
217 tty->termios->c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE);
218 tty->termios->c_iflag = IGNBRK | IGNPAR | IXOFF;
219 /* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */
220 tty->termios->c_oflag &= ~ONLCR;
221}
212 222
213static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port) 223static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
214{ 224{
@@ -224,16 +234,6 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
224 /* someone sets the dev to 0 if the close method has been called */ 234 /* someone sets the dev to 0 if the close method has been called */
225 port->interrupt_in_urb->dev = port->serial->dev; 235 port->interrupt_in_urb->dev = port->serial->dev;
226 236
227 if (tty) {
228
229 /* Default to echo off and other sane device settings */
230 tty->termios->c_lflag = 0;
231 tty->termios->c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN |
232 XCASE);
233 tty->termios->c_iflag = IGNBRK | IGNPAR | IXOFF;
234 /* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */
235 tty->termios->c_oflag &= ~ONLCR;
236 }
237 /* allocate memory for transfer buffer */ 237 /* allocate memory for transfer buffer */
238 transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL); 238 transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
239 if (!transfer_buffer) 239 if (!transfer_buffer)