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 /include/linux/tty_driver.h | |
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 'include/linux/tty_driver.h')
-rw-r--r-- | include/linux/tty_driver.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index d2a003586761..e1065ac0d922 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -135,7 +135,7 @@ | |||
135 | * | 135 | * |
136 | * Optional: | 136 | * Optional: |
137 | * | 137 | * |
138 | * void (*break_ctl)(struct tty_stuct *tty, int state); | 138 | * int (*break_ctl)(struct tty_stuct *tty, int state); |
139 | * | 139 | * |
140 | * This optional routine requests the tty driver to turn on or | 140 | * This optional routine requests the tty driver to turn on or |
141 | * off BREAK status on the RS-232 port. If state is -1, | 141 | * off BREAK status on the RS-232 port. If state is -1, |
@@ -146,6 +146,10 @@ | |||
146 | * handle the following ioctls: TCSBRK, TCSBRKP, TIOCSBRK, | 146 | * handle the following ioctls: TCSBRK, TCSBRKP, TIOCSBRK, |
147 | * TIOCCBRK. | 147 | * TIOCCBRK. |
148 | * | 148 | * |
149 | * If the driver sets TTY_DRIVER_HARDWARE_BREAK then the interface | ||
150 | * will also be called with actual times and the hardware is expected | ||
151 | * to do the delay work itself. 0 and -1 are still used for on/off. | ||
152 | * | ||
149 | * Optional: Required for TCSBRK/BRKP/etc handling. | 153 | * Optional: Required for TCSBRK/BRKP/etc handling. |
150 | * | 154 | * |
151 | * void (*wait_until_sent)(struct tty_struct *tty, int timeout); | 155 | * void (*wait_until_sent)(struct tty_struct *tty, int timeout); |
@@ -192,7 +196,7 @@ struct tty_operations { | |||
192 | void (*stop)(struct tty_struct *tty); | 196 | void (*stop)(struct tty_struct *tty); |
193 | void (*start)(struct tty_struct *tty); | 197 | void (*start)(struct tty_struct *tty); |
194 | void (*hangup)(struct tty_struct *tty); | 198 | void (*hangup)(struct tty_struct *tty); |
195 | void (*break_ctl)(struct tty_struct *tty, int state); | 199 | int (*break_ctl)(struct tty_struct *tty, int state); |
196 | void (*flush_buffer)(struct tty_struct *tty); | 200 | void (*flush_buffer)(struct tty_struct *tty); |
197 | void (*set_ldisc)(struct tty_struct *tty); | 201 | void (*set_ldisc)(struct tty_struct *tty); |
198 | void (*wait_until_sent)(struct tty_struct *tty, int timeout); | 202 | void (*wait_until_sent)(struct tty_struct *tty, int timeout); |
@@ -285,12 +289,18 @@ extern struct tty_driver *tty_find_polling_driver(char *name, int *line); | |||
285 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead | 289 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead |
286 | * use dynamic memory keyed through the devpts filesystem. This | 290 | * use dynamic memory keyed through the devpts filesystem. This |
287 | * is only applicable to the pty driver. | 291 | * is only applicable to the pty driver. |
292 | * | ||
293 | * TTY_DRIVER_HARDWARE_BREAK -- hardware handles break signals. Pass | ||
294 | * the requested timeout to the caller instead of using a simple | ||
295 | * on/off interface. | ||
296 | * | ||
288 | */ | 297 | */ |
289 | #define TTY_DRIVER_INSTALLED 0x0001 | 298 | #define TTY_DRIVER_INSTALLED 0x0001 |
290 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 | 299 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 |
291 | #define TTY_DRIVER_REAL_RAW 0x0004 | 300 | #define TTY_DRIVER_REAL_RAW 0x0004 |
292 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 | 301 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 |
293 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 | 302 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 |
303 | #define TTY_DRIVER_HARDWARE_BREAK 0x0020 | ||
294 | 304 | ||
295 | /* tty driver types */ | 305 | /* tty driver types */ |
296 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 | 306 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 |