diff options
author | Alan Cox <alan@redhat.com> | 2008-10-13 05:44:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-13 12:51:44 -0400 |
commit | ea1afd256258f04a290aaa7fd5c2d4deb2e79e26 (patch) | |
tree | 6ef94459212ed68e64b9a86c3b4542e935f32e10 /drivers/isdn | |
parent | 53e86317e967b9a1b1b78d6a076547144454bce1 (diff) |
tty: fix up gigaset a bit
Stephen's fixes reminded me that gigaset is still rather broken so fix it up
a bit
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/gigaset/ser-gigaset.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index cc4f4e44ffe4..07052ed2a0c5 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c | |||
@@ -571,6 +571,7 @@ gigaset_tty_close(struct tty_struct *tty) | |||
571 | } | 571 | } |
572 | 572 | ||
573 | /* prevent other callers from entering ldisc methods */ | 573 | /* prevent other callers from entering ldisc methods */ |
574 | /* FIXME: should use the tty state flags */ | ||
574 | tty->disc_data = NULL; | 575 | tty->disc_data = NULL; |
575 | 576 | ||
576 | if (!cs->hw.ser) | 577 | if (!cs->hw.ser) |
@@ -642,10 +643,11 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file, | |||
642 | return -ENXIO; | 643 | return -ENXIO; |
643 | 644 | ||
644 | switch (cmd) { | 645 | switch (cmd) { |
645 | case TCGETS: | 646 | |
646 | case TCGETA: | 647 | case FIONREAD: |
647 | /* pass through to underlying serial device */ | 648 | /* unused, always return zero */ |
648 | rc = n_tty_ioctl_helper(tty, file, cmd, arg); | 649 | val = 0; |
650 | rc = put_user(val, p); | ||
649 | break; | 651 | break; |
650 | 652 | ||
651 | case TCFLSH: | 653 | case TCFLSH: |
@@ -659,20 +661,13 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file, | |||
659 | flush_send_queue(cs); | 661 | flush_send_queue(cs); |
660 | break; | 662 | break; |
661 | } | 663 | } |
662 | /* flush the serial port's buffer */ | 664 | /* Pass through */ |
663 | rc = n_tty_ioctl_helper(tty, file, cmd, arg); | ||
664 | break; | ||
665 | |||
666 | case FIONREAD: | ||
667 | /* unused, always return zero */ | ||
668 | val = 0; | ||
669 | rc = put_user(val, p); | ||
670 | break; | ||
671 | 665 | ||
672 | default: | 666 | default: |
673 | rc = -ENOIOCTLCMD; | 667 | /* pass through to underlying serial device */ |
668 | rc = n_tty_ioctl_helper(tty, file, cmd, arg); | ||
669 | break; | ||
674 | } | 670 | } |
675 | |||
676 | cs_put(cs); | 671 | cs_put(cs); |
677 | return rc; | 672 | return rc; |
678 | } | 673 | } |
@@ -680,6 +675,8 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file, | |||
680 | /* | 675 | /* |
681 | * Poll on the tty. | 676 | * Poll on the tty. |
682 | * Unused, always return zero. | 677 | * Unused, always return zero. |
678 | * | ||
679 | * FIXME: should probably return an exception - especially on hangup | ||
683 | */ | 680 | */ |
684 | static unsigned int | 681 | static unsigned int |
685 | gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) | 682 | gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) |