| .. | .. |
|---|
| 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) |
|---|
| .. | .. |
|---|
| 386 | 393 | return -EINVAL; |
|---|
| 387 | 394 | |
|---|
| 388 | 395 | /* FIXME: Exactly how is the tty object locked here .. */ |
|---|
| 389 | | - |
|---|
| 390 | | - switch (cmd) { |
|---|
| 391 | | - case TIOCGSERIAL: |
|---|
| 392 | | - return ipwireless_get_serial_info(tty, (void __user *) arg); |
|---|
| 393 | | - |
|---|
| 394 | | - case TIOCSSERIAL: |
|---|
| 395 | | - return 0; /* Keeps the PCMCIA scripts happy. */ |
|---|
| 396 | | - } |
|---|
| 397 | | - |
|---|
| 398 | 396 | if (tty->tty_type == TTYTYPE_MODEM) { |
|---|
| 399 | 397 | switch (cmd) { |
|---|
| 400 | 398 | case PPPIOCGCHAN: |
|---|
| .. | .. |
|---|
| 561 | 559 | .chars_in_buffer = ipw_chars_in_buffer, |
|---|
| 562 | 560 | .tiocmget = ipw_tiocmget, |
|---|
| 563 | 561 | .tiocmset = ipw_tiocmset, |
|---|
| 562 | + .set_serial = ipwireless_set_serial_info, |
|---|
| 563 | + .get_serial = ipwireless_get_serial_info, |
|---|
| 564 | 564 | }; |
|---|
| 565 | 565 | |
|---|
| 566 | 566 | int ipwireless_tty_init(void) |
|---|