diff options
author | Alan Cox <alan@redhat.com> | 2008-07-22 06:18:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-22 16:03:28 -0400 |
commit | 9e98966c7bb94355689478bc84cc3e0c190f977e (patch) | |
tree | 928aebbfee524a48aa94a3d3def5249c8846a79a /drivers/char/istallion.c | |
parent | abbe629ae4011d2020047f41bea9f9e4b0ec4361 (diff) |
tty: rework break handling
Some hardware needs to do break handling itself and may have partial
support only. Make break_ctl return an error code. Add a tty driver flag
so you can indicate driver hardware side break support.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/istallion.c')
-rw-r--r-- | drivers/char/istallion.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index 7930fba4bafc..63d22b5ebc0d 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c | |||
@@ -609,7 +609,7 @@ static void stli_unthrottle(struct tty_struct *tty); | |||
609 | static void stli_stop(struct tty_struct *tty); | 609 | static void stli_stop(struct tty_struct *tty); |
610 | static void stli_start(struct tty_struct *tty); | 610 | static void stli_start(struct tty_struct *tty); |
611 | static void stli_flushbuffer(struct tty_struct *tty); | 611 | static void stli_flushbuffer(struct tty_struct *tty); |
612 | static void stli_breakctl(struct tty_struct *tty, int state); | 612 | static int stli_breakctl(struct tty_struct *tty, int state); |
613 | static void stli_waituntilsent(struct tty_struct *tty, int timeout); | 613 | static void stli_waituntilsent(struct tty_struct *tty, int timeout); |
614 | static void stli_sendxchar(struct tty_struct *tty, char ch); | 614 | static void stli_sendxchar(struct tty_struct *tty, char ch); |
615 | static void stli_hangup(struct tty_struct *tty); | 615 | static void stli_hangup(struct tty_struct *tty); |
@@ -1909,7 +1909,7 @@ static void stli_flushbuffer(struct tty_struct *tty) | |||
1909 | 1909 | ||
1910 | /*****************************************************************************/ | 1910 | /*****************************************************************************/ |
1911 | 1911 | ||
1912 | static void stli_breakctl(struct tty_struct *tty, int state) | 1912 | static int stli_breakctl(struct tty_struct *tty, int state) |
1913 | { | 1913 | { |
1914 | struct stlibrd *brdp; | 1914 | struct stlibrd *brdp; |
1915 | struct stliport *portp; | 1915 | struct stliport *portp; |
@@ -1917,15 +1917,16 @@ static void stli_breakctl(struct tty_struct *tty, int state) | |||
1917 | 1917 | ||
1918 | portp = tty->driver_data; | 1918 | portp = tty->driver_data; |
1919 | if (portp == NULL) | 1919 | if (portp == NULL) |
1920 | return; | 1920 | return -EINVAL; |
1921 | if (portp->brdnr >= stli_nrbrds) | 1921 | if (portp->brdnr >= stli_nrbrds) |
1922 | return; | 1922 | return -EINVAL; |
1923 | brdp = stli_brds[portp->brdnr]; | 1923 | brdp = stli_brds[portp->brdnr]; |
1924 | if (brdp == NULL) | 1924 | if (brdp == NULL) |
1925 | return; | 1925 | return -EINVAL; |
1926 | 1926 | ||
1927 | arg = (state == -1) ? BREAKON : BREAKOFF; | 1927 | arg = (state == -1) ? BREAKON : BREAKOFF; |
1928 | stli_cmdwait(brdp, portp, A_BREAK, &arg, sizeof(long), 0); | 1928 | stli_cmdwait(brdp, portp, A_BREAK, &arg, sizeof(long), 0); |
1929 | return 0; | ||
1929 | } | 1930 | } |
1930 | 1931 | ||
1931 | /*****************************************************************************/ | 1932 | /*****************************************************************************/ |