aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/n_gsm.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-03-21 06:25:08 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-22 20:31:53 -0400
commitb1c43f82c5aa265442f82dba31ce985ebb7aa71c (patch)
tree8b344d8d5355b30e8deff901180edc708a653227 /drivers/tty/n_gsm.c
parente9a470f445271eb157ee860a93b062324402fc3a (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 'drivers/tty/n_gsm.c')
-rw-r--r--drivers/tty/n_gsm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 47f8cdb207f1..6abc73598847 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2138,8 +2138,8 @@ static void gsmld_detach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
2138 gsm->tty = NULL; 2138 gsm->tty = NULL;
2139} 2139}
2140 2140
2141static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp, 2141static unsigned int gsmld_receive_buf(struct tty_struct *tty,
2142 char *fp, int count) 2142 const unsigned char *cp, char *fp, int count)
2143{ 2143{
2144 struct gsm_mux *gsm = tty->disc_data; 2144 struct gsm_mux *gsm = tty->disc_data;
2145 const unsigned char *dp; 2145 const unsigned char *dp;
@@ -2173,6 +2173,8 @@ static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp,
2173 } 2173 }
2174 /* FASYNC if needed ? */ 2174 /* FASYNC if needed ? */
2175 /* If clogged call tty_throttle(tty); */ 2175 /* If clogged call tty_throttle(tty); */
2176
2177 return count;
2176} 2178}
2177 2179
2178/** 2180/**