.. | .. |
---|
189 | 189 | return 0; |
---|
190 | 190 | } |
---|
191 | 191 | |
---|
192 | | -static void ark3116_init_termios(struct tty_struct *tty) |
---|
193 | | -{ |
---|
194 | | - struct ktermios *termios = &tty->termios; |
---|
195 | | - *termios = tty_std_termios; |
---|
196 | | - termios->c_cflag = B9600 | CS8 |
---|
197 | | - | CREAD | HUPCL | CLOCAL; |
---|
198 | | - termios->c_ispeed = 9600; |
---|
199 | | - termios->c_ospeed = 9600; |
---|
200 | | -} |
---|
201 | | - |
---|
202 | 192 | static void ark3116_set_termios(struct tty_struct *tty, |
---|
203 | 193 | struct usb_serial_port *port, |
---|
204 | 194 | struct ktermios *old_termios) |
---|
.. | .. |
---|
397 | 387 | return result; |
---|
398 | 388 | } |
---|
399 | 389 | |
---|
400 | | -static int ark3116_get_serial_info(struct usb_serial_port *port, |
---|
401 | | - struct serial_struct __user *retinfo) |
---|
402 | | -{ |
---|
403 | | - struct serial_struct tmp; |
---|
404 | | - |
---|
405 | | - memset(&tmp, 0, sizeof(tmp)); |
---|
406 | | - |
---|
407 | | - tmp.type = PORT_16654; |
---|
408 | | - tmp.line = port->minor; |
---|
409 | | - tmp.port = port->port_number; |
---|
410 | | - tmp.baud_base = 460800; |
---|
411 | | - |
---|
412 | | - if (copy_to_user(retinfo, &tmp, sizeof(tmp))) |
---|
413 | | - return -EFAULT; |
---|
414 | | - |
---|
415 | | - return 0; |
---|
416 | | -} |
---|
417 | | - |
---|
418 | | -static int ark3116_ioctl(struct tty_struct *tty, |
---|
419 | | - unsigned int cmd, unsigned long arg) |
---|
| 390 | +static int ark3116_get_serial_info(struct tty_struct *tty, |
---|
| 391 | + struct serial_struct *ss) |
---|
420 | 392 | { |
---|
421 | 393 | struct usb_serial_port *port = tty->driver_data; |
---|
422 | | - void __user *user_arg = (void __user *)arg; |
---|
423 | 394 | |
---|
424 | | - switch (cmd) { |
---|
425 | | - case TIOCGSERIAL: |
---|
426 | | - return ark3116_get_serial_info(port, user_arg); |
---|
427 | | - default: |
---|
428 | | - break; |
---|
429 | | - } |
---|
430 | | - |
---|
431 | | - return -ENOIOCTLCMD; |
---|
| 395 | + ss->type = PORT_16654; |
---|
| 396 | + ss->line = port->minor; |
---|
| 397 | + ss->port = port->port_number; |
---|
| 398 | + ss->baud_base = 460800; |
---|
| 399 | + return 0; |
---|
432 | 400 | } |
---|
433 | 401 | |
---|
434 | 402 | static int ark3116_tiocmget(struct tty_struct *tty) |
---|
.. | .. |
---|
667 | 635 | .port_probe = ark3116_port_probe, |
---|
668 | 636 | .port_remove = ark3116_port_remove, |
---|
669 | 637 | .set_termios = ark3116_set_termios, |
---|
670 | | - .init_termios = ark3116_init_termios, |
---|
671 | | - .ioctl = ark3116_ioctl, |
---|
| 638 | + .get_serial = ark3116_get_serial_info, |
---|
672 | 639 | .tiocmget = ark3116_tiocmget, |
---|
673 | 640 | .tiocmset = ark3116_tiocmset, |
---|
674 | 641 | .tiocmiwait = usb_serial_generic_tiocmiwait, |
---|