mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
tty: Make tiocgicount a handler
Dan Rosenberg noted that various drivers return the struct with uncleared fields. Instead of spending forever trying to stomp all the drivers that get it wrong (and every new driver) do the job in one place. This first patch adds the needed operations and hooks them up, including the needed USB midlayer and serial core plumbing. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
68707539df
commit
d281da7ff6
5 changed files with 61 additions and 19 deletions
|
@ -224,6 +224,12 @@
|
|||
* unless the tty also has a valid tty->termiox pointer.
|
||||
*
|
||||
* Optional: Called under the termios lock
|
||||
*
|
||||
* int (*get_icount)(struct tty_struct *tty, struct serial_icounter *icount);
|
||||
*
|
||||
* Called when the device receives a TIOCGICOUNT ioctl. Passed a kernel
|
||||
* structure to complete. This method is optional and will only be called
|
||||
* if provided (otherwise EINVAL will be returned).
|
||||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
|
@ -232,6 +238,7 @@
|
|||
|
||||
struct tty_struct;
|
||||
struct tty_driver;
|
||||
struct serial_icounter_struct;
|
||||
|
||||
struct tty_operations {
|
||||
struct tty_struct * (*lookup)(struct tty_driver *driver,
|
||||
|
@ -268,6 +275,8 @@ struct tty_operations {
|
|||
unsigned int set, unsigned int clear);
|
||||
int (*resize)(struct tty_struct *tty, struct winsize *ws);
|
||||
int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
|
||||
int (*get_icount)(struct tty_struct *tty,
|
||||
struct serial_icounter_struct *icount);
|
||||
#ifdef CONFIG_CONSOLE_POLL
|
||||
int (*poll_init)(struct tty_driver *driver, int line, char *options);
|
||||
int (*poll_get_char)(struct tty_driver *driver, int line);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue