Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipwireless: switch to ->[sg]et_serial()

Acked-by: David Sterba <dsterba@suse.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro a7b06fcf 6fbf9582

+18 -18
+18 -18
drivers/tty/ipwireless/tty.c
··· 248 248 return room; 249 249 } 250 250 251 - static int ipwireless_get_serial_info(struct ipw_tty *tty, 252 - struct serial_struct __user *retinfo) 251 + static int ipwireless_get_serial_info(struct tty_struct *linux_tty, 252 + struct serial_struct *ss) 253 253 { 254 - struct serial_struct tmp; 254 + struct ipw_tty *tty = linux_tty->driver_data; 255 255 256 - memset(&tmp, 0, sizeof(tmp)); 257 - tmp.type = PORT_UNKNOWN; 258 - tmp.line = tty->index; 259 - tmp.baud_base = 115200; 256 + if (!tty) 257 + return -ENODEV; 260 258 261 - if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) 262 - return -EFAULT; 259 + if (!tty->port.count) 260 + return -EINVAL; 263 261 262 + ss->type = PORT_UNKNOWN; 263 + ss->line = tty->index; 264 + ss->baud_base = 115200; 264 265 return 0; 266 + } 267 + 268 + static int ipwireless_set_serial_info(struct tty_struct *linux_tty, 269 + struct serial_struct *ss) 270 + { 271 + return 0; /* Keeps the PCMCIA scripts happy. */ 265 272 } 266 273 267 274 static int ipw_chars_in_buffer(struct tty_struct *linux_tty) ··· 393 386 return -EINVAL; 394 387 395 388 /* FIXME: Exactly how is the tty object locked here .. */ 396 - 397 - switch (cmd) { 398 - case TIOCGSERIAL: 399 - return ipwireless_get_serial_info(tty, (void __user *) arg); 400 - 401 - case TIOCSSERIAL: 402 - return 0; /* Keeps the PCMCIA scripts happy. */ 403 - } 404 - 405 389 if (tty->tty_type == TTYTYPE_MODEM) { 406 390 switch (cmd) { 407 391 case PPPIOCGCHAN: ··· 559 561 .chars_in_buffer = ipw_chars_in_buffer, 560 562 .tiocmget = ipw_tiocmget, 561 563 .tiocmset = ipw_tiocmset, 564 + .set_serial = ipwireless_set_serial_info, 565 + .get_serial = ipwireless_get_serial_info, 562 566 }; 563 567 564 568 int ipwireless_tty_init(void)