diff options
author | Felipe Balbi <balbi@ti.com> | 2011-03-21 06:25:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-22 20:31:53 -0400 |
commit | b1c43f82c5aa265442f82dba31ce985ebb7aa71c (patch) | |
tree | 8b344d8d5355b30e8deff901180edc708a653227 /include/linux/tty_ldisc.h | |
parent | e9a470f445271eb157ee860a93b062324402fc3a (diff) |
tty: make receive_buf() return the amout of bytes received
it makes it simpler to keep track of the amount of
bytes received and simplifies how flush_to_ldisc counts
the remaining bytes. It also fixes a bug of lost bytes
on n_tty when flushing too many bytes via the USB
serial gadget driver.
Tested-by: Stefan Bigler <stefan.bigler@keymile.com>
Tested-by: Toby Gray <toby.gray@realvnc.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/tty_ldisc.h')
-rw-r--r-- | include/linux/tty_ldisc.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index ff7dc08696a8..5b07792ccb46 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -76,7 +76,7 @@ | |||
76 | * tty device. It is solely the responsibility of the line | 76 | * tty device. It is solely the responsibility of the line |
77 | * discipline to handle poll requests. | 77 | * discipline to handle poll requests. |
78 | * | 78 | * |
79 | * void (*receive_buf)(struct tty_struct *, const unsigned char *cp, | 79 | * unsigned int (*receive_buf)(struct tty_struct *, const unsigned char *cp, |
80 | * char *fp, int count); | 80 | * char *fp, int count); |
81 | * | 81 | * |
82 | * This function is called by the low-level tty driver to send | 82 | * This function is called by the low-level tty driver to send |
@@ -84,7 +84,8 @@ | |||
84 | * processing. <cp> is a pointer to the buffer of input | 84 | * processing. <cp> is a pointer to the buffer of input |
85 | * character received by the device. <fp> is a pointer to a | 85 | * character received by the device. <fp> is a pointer to a |
86 | * pointer of flag bytes which indicate whether a character was | 86 | * pointer of flag bytes which indicate whether a character was |
87 | * received with a parity error, etc. | 87 | * received with a parity error, etc. Returns the amount of bytes |
88 | * received. | ||
88 | * | 89 | * |
89 | * void (*write_wakeup)(struct tty_struct *); | 90 | * void (*write_wakeup)(struct tty_struct *); |
90 | * | 91 | * |
@@ -140,8 +141,8 @@ struct tty_ldisc_ops { | |||
140 | /* | 141 | /* |
141 | * The following routines are called from below. | 142 | * The following routines are called from below. |
142 | */ | 143 | */ |
143 | void (*receive_buf)(struct tty_struct *, const unsigned char *cp, | 144 | unsigned int (*receive_buf)(struct tty_struct *, |
144 | char *fp, int count); | 145 | const unsigned char *cp, char *fp, int count); |
145 | void (*write_wakeup)(struct tty_struct *); | 146 | void (*write_wakeup)(struct tty_struct *); |
146 | void (*dcd_change)(struct tty_struct *, unsigned int, | 147 | void (*dcd_change)(struct tty_struct *, unsigned int, |
147 | struct pps_event_time *); | 148 | struct pps_event_time *); |