.. | .. |
---|
8 | 8 | * Copyright (C) 1999 - 2001 |
---|
9 | 9 | * Greg Kroah-Hartman (greg@kroah.com) |
---|
10 | 10 | * |
---|
11 | | - * See Documentation/usb/usb-serial.txt for more information on using this |
---|
| 11 | + * See Documentation/usb/usb-serial.rst for more information on using this |
---|
12 | 12 | * driver |
---|
13 | 13 | */ |
---|
14 | 14 | |
---|
.. | .. |
---|
83 | 83 | static int whiteheat_open(struct tty_struct *tty, |
---|
84 | 84 | struct usb_serial_port *port); |
---|
85 | 85 | static void whiteheat_close(struct usb_serial_port *port); |
---|
86 | | -static int whiteheat_ioctl(struct tty_struct *tty, |
---|
87 | | - unsigned int cmd, unsigned long arg); |
---|
| 86 | +static int whiteheat_get_serial(struct tty_struct *tty, |
---|
| 87 | + struct serial_struct *ss); |
---|
88 | 88 | static void whiteheat_set_termios(struct tty_struct *tty, |
---|
89 | 89 | struct usb_serial_port *port, struct ktermios *old); |
---|
90 | 90 | static int whiteheat_tiocmget(struct tty_struct *tty); |
---|
.. | .. |
---|
120 | 120 | .port_remove = whiteheat_port_remove, |
---|
121 | 121 | .open = whiteheat_open, |
---|
122 | 122 | .close = whiteheat_close, |
---|
123 | | - .ioctl = whiteheat_ioctl, |
---|
| 123 | + .get_serial = whiteheat_get_serial, |
---|
124 | 124 | .set_termios = whiteheat_set_termios, |
---|
125 | 125 | .break_ctl = whiteheat_break_ctl, |
---|
126 | 126 | .tiocmget = whiteheat_tiocmget, |
---|
.. | .. |
---|
442 | 442 | } |
---|
443 | 443 | |
---|
444 | 444 | |
---|
445 | | -static int whiteheat_ioctl(struct tty_struct *tty, |
---|
446 | | - unsigned int cmd, unsigned long arg) |
---|
| 445 | +static int whiteheat_get_serial(struct tty_struct *tty, |
---|
| 446 | + struct serial_struct *ss) |
---|
447 | 447 | { |
---|
448 | 448 | struct usb_serial_port *port = tty->driver_data; |
---|
449 | | - struct serial_struct serstruct; |
---|
450 | | - void __user *user_arg = (void __user *)arg; |
---|
451 | 449 | |
---|
452 | | - switch (cmd) { |
---|
453 | | - case TIOCGSERIAL: |
---|
454 | | - memset(&serstruct, 0, sizeof(serstruct)); |
---|
455 | | - serstruct.type = PORT_16654; |
---|
456 | | - serstruct.line = port->minor; |
---|
457 | | - serstruct.port = port->port_number; |
---|
458 | | - serstruct.xmit_fifo_size = kfifo_size(&port->write_fifo); |
---|
459 | | - serstruct.custom_divisor = 0; |
---|
460 | | - serstruct.baud_base = 460800; |
---|
461 | | - serstruct.close_delay = CLOSING_DELAY; |
---|
462 | | - serstruct.closing_wait = CLOSING_DELAY; |
---|
| 450 | + ss->type = PORT_16654; |
---|
| 451 | + ss->line = port->minor; |
---|
| 452 | + ss->port = port->port_number; |
---|
| 453 | + ss->xmit_fifo_size = kfifo_size(&port->write_fifo); |
---|
| 454 | + ss->custom_divisor = 0; |
---|
| 455 | + ss->baud_base = 460800; |
---|
| 456 | + ss->close_delay = CLOSING_DELAY; |
---|
| 457 | + ss->closing_wait = CLOSING_DELAY; |
---|
463 | 458 | |
---|
464 | | - if (copy_to_user(user_arg, &serstruct, sizeof(serstruct))) |
---|
465 | | - return -EFAULT; |
---|
466 | | - break; |
---|
467 | | - default: |
---|
468 | | - break; |
---|
469 | | - } |
---|
470 | | - |
---|
471 | | - return -ENOIOCTLCMD; |
---|
| 459 | + return 0; |
---|
472 | 460 | } |
---|
473 | 461 | |
---|
474 | 462 | |
---|
.. | .. |
---|
611 | 599 | switch (command) { |
---|
612 | 600 | case WHITEHEAT_GET_DTR_RTS: |
---|
613 | 601 | info = usb_get_serial_port_data(port); |
---|
614 | | - memcpy(&info->mcr, command_info->result_buffer, |
---|
615 | | - sizeof(struct whiteheat_dr_info)); |
---|
616 | | - break; |
---|
| 602 | + info->mcr = command_info->result_buffer[0]; |
---|
| 603 | + break; |
---|
617 | 604 | } |
---|
618 | 605 | } |
---|
619 | 606 | exit: |
---|