.. | .. |
---|
453 | 453 | usb_kill_urb(serial_priv->read_urb); |
---|
454 | 454 | } |
---|
455 | 455 | |
---|
456 | | -static int get_serial_info(struct usb_serial_port *port, |
---|
457 | | - struct serial_struct __user *retinfo) |
---|
458 | | -{ |
---|
459 | | - struct serial_struct tmp; |
---|
460 | | - |
---|
461 | | - memset(&tmp, 0, sizeof(tmp)); |
---|
462 | | - tmp.line = port->minor; |
---|
463 | | - tmp.port = 0; |
---|
464 | | - tmp.irq = 0; |
---|
465 | | - tmp.xmit_fifo_size = port->bulk_out_size; |
---|
466 | | - tmp.baud_base = 9600; |
---|
467 | | - tmp.close_delay = 5*HZ; |
---|
468 | | - tmp.closing_wait = 30*HZ; |
---|
469 | | - |
---|
470 | | - if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) |
---|
471 | | - return -EFAULT; |
---|
472 | | - return 0; |
---|
473 | | -} |
---|
474 | | - |
---|
475 | | -static int qt2_ioctl(struct tty_struct *tty, |
---|
476 | | - unsigned int cmd, unsigned long arg) |
---|
| 456 | +static int get_serial_info(struct tty_struct *tty, |
---|
| 457 | + struct serial_struct *ss) |
---|
477 | 458 | { |
---|
478 | 459 | struct usb_serial_port *port = tty->driver_data; |
---|
479 | 460 | |
---|
480 | | - switch (cmd) { |
---|
481 | | - case TIOCGSERIAL: |
---|
482 | | - return get_serial_info(port, |
---|
483 | | - (struct serial_struct __user *)arg); |
---|
484 | | - default: |
---|
485 | | - break; |
---|
486 | | - } |
---|
487 | | - |
---|
488 | | - return -ENOIOCTLCMD; |
---|
| 461 | + ss->line = port->minor; |
---|
| 462 | + ss->port = 0; |
---|
| 463 | + ss->irq = 0; |
---|
| 464 | + ss->xmit_fifo_size = port->bulk_out_size; |
---|
| 465 | + ss->baud_base = 9600; |
---|
| 466 | + ss->close_delay = 5*HZ; |
---|
| 467 | + ss->closing_wait = 30*HZ; |
---|
| 468 | + return 0; |
---|
489 | 469 | } |
---|
490 | 470 | |
---|
491 | 471 | static void qt2_process_status(struct usb_serial_port *port, unsigned char *ch) |
---|
.. | .. |
---|
500 | 480 | } |
---|
501 | 481 | } |
---|
502 | 482 | |
---|
503 | | -/* not needed, kept to document functionality */ |
---|
504 | | -static void qt2_process_xmit_empty(struct usb_serial_port *port, |
---|
505 | | - unsigned char *ch) |
---|
506 | | -{ |
---|
507 | | - int bytes_written; |
---|
508 | | - |
---|
509 | | - bytes_written = (int)(*ch) + (int)(*(ch + 1) << 4); |
---|
510 | | -} |
---|
511 | | - |
---|
512 | | -/* not needed, kept to document functionality */ |
---|
513 | | -static void qt2_process_flush(struct usb_serial_port *port, unsigned char *ch) |
---|
514 | | -{ |
---|
515 | | - return; |
---|
516 | | -} |
---|
517 | | - |
---|
518 | 483 | static void qt2_process_read_urb(struct urb *urb) |
---|
519 | 484 | { |
---|
520 | 485 | struct usb_serial *serial; |
---|
521 | 486 | struct qt2_serial_private *serial_priv; |
---|
522 | 487 | struct usb_serial_port *port; |
---|
523 | | - struct qt2_port_private *port_priv; |
---|
524 | 488 | bool escapeflag; |
---|
525 | 489 | unsigned char *ch; |
---|
526 | 490 | int i; |
---|
.. | .. |
---|
534 | 498 | serial = urb->context; |
---|
535 | 499 | serial_priv = usb_get_serial_data(serial); |
---|
536 | 500 | port = serial->port[serial_priv->current_port]; |
---|
537 | | - port_priv = usb_get_serial_port_data(port); |
---|
538 | 501 | |
---|
539 | 502 | for (i = 0; i < urb->actual_length; i++) { |
---|
540 | 503 | ch = (unsigned char *)urb->transfer_buffer + i; |
---|
.. | .. |
---|
562 | 525 | __func__); |
---|
563 | 526 | break; |
---|
564 | 527 | } |
---|
565 | | - qt2_process_xmit_empty(port, ch + 3); |
---|
| 528 | + /* bytes_written = (ch[1] << 4) + ch[0]; */ |
---|
566 | 529 | i += 4; |
---|
567 | 530 | escapeflag = true; |
---|
568 | 531 | break; |
---|
.. | .. |
---|
586 | 549 | |
---|
587 | 550 | serial_priv->current_port = newport; |
---|
588 | 551 | port = serial->port[serial_priv->current_port]; |
---|
589 | | - port_priv = usb_get_serial_port_data(port); |
---|
590 | 552 | i += 3; |
---|
591 | 553 | escapeflag = true; |
---|
592 | 554 | break; |
---|
593 | 555 | case QT2_REC_FLUSH: |
---|
594 | 556 | case QT2_XMIT_FLUSH: |
---|
595 | | - qt2_process_flush(port, ch + 2); |
---|
596 | 557 | i += 2; |
---|
597 | 558 | escapeflag = true; |
---|
598 | 559 | break; |
---|
.. | .. |
---|
1019 | 980 | .tiocmset = qt2_tiocmset, |
---|
1020 | 981 | .tiocmiwait = usb_serial_generic_tiocmiwait, |
---|
1021 | 982 | .get_icount = usb_serial_generic_get_icount, |
---|
1022 | | - .ioctl = qt2_ioctl, |
---|
| 983 | + .get_serial = get_serial_info, |
---|
1023 | 984 | .set_termios = qt2_set_termios, |
---|
1024 | 985 | }; |
---|
1025 | 986 | |
---|