@@ -83,8 +83,8 @@ static int whiteheat_port_remove(struct usb_serial_port *port);
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,7 +120,7 @@ static struct usb_serial_driver whiteheat_device = {
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,33 +442,21 @@ static int whiteheat_tiocmset(struct tty_struct *tty,
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
-
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 ;
463
-
464
- if (copy_to_user (user_arg , & serstruct , sizeof (serstruct )))
465
- return - EFAULT ;
466
- break ;
467
- default :
468
- break ;
469
- }
470
449
471
- return - ENOIOCTLCMD ;
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 ;
458
+
459
+ return 0 ;
472
460
}
473
461
474
462
0 commit comments