mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-01 19:41:19 +00:00
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>
This commit is contained in:
parent
e9a470f445
commit
b1c43f82c5
20 changed files with 125 additions and 113 deletions
|
@ -76,7 +76,7 @@
|
|||
* tty device. It is solely the responsibility of the line
|
||||
* discipline to handle poll requests.
|
||||
*
|
||||
* void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
|
||||
* unsigned int (*receive_buf)(struct tty_struct *, const unsigned char *cp,
|
||||
* char *fp, int count);
|
||||
*
|
||||
* This function is called by the low-level tty driver to send
|
||||
|
@ -84,7 +84,8 @@
|
|||
* processing. <cp> is a pointer to the buffer of input
|
||||
* character received by the device. <fp> is a pointer to a
|
||||
* pointer of flag bytes which indicate whether a character was
|
||||
* received with a parity error, etc.
|
||||
* received with a parity error, etc. Returns the amount of bytes
|
||||
* received.
|
||||
*
|
||||
* void (*write_wakeup)(struct tty_struct *);
|
||||
*
|
||||
|
@ -140,8 +141,8 @@ struct tty_ldisc_ops {
|
|||
/*
|
||||
* The following routines are called from below.
|
||||
*/
|
||||
void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
|
||||
char *fp, int count);
|
||||
unsigned int (*receive_buf)(struct tty_struct *,
|
||||
const unsigned char *cp, char *fp, int count);
|
||||
void (*write_wakeup)(struct tty_struct *);
|
||||
void (*dcd_change)(struct tty_struct *, unsigned int,
|
||||
struct pps_event_time *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue