kfree(tty->disc_data);
}
-static int spk_ttyio_receive_buf2(struct tty_struct *tty,
- const unsigned char *cp,
- const char *fp, int count)
+static size_t spk_ttyio_receive_buf2(struct tty_struct *tty,
+ const unsigned char *cp, const char *fp,
+ size_t count)
{
struct spk_ldisc_data *ldisc_data = tty->disc_data;
struct spk_synth *synth = ldisc_data->synth;
* Return Value: None
*/
static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
- const char *flags, int count)
+ const char *flags, size_t count)
{
struct hci_uart *hu = tty->disc_data;
*/
static void serport_ldisc_receive(struct tty_struct *tty,
- const unsigned char *cp, const char *fp, int count)
+ const unsigned char *cp, const char *fp,
+ size_t count)
{
struct serport *serport = tty->disc_data;
unsigned long flags;
}
static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,
- const char *tty_flags, int count)
+ const char *tty_flags, size_t count)
{
#ifdef VERBOSE
print_hex_dump(KERN_DEBUG, ">in>", DUMP_PREFIX_NONE,
#endif
static void ldisc_receive(struct tty_struct *tty, const u8 *data,
- const char *flags, int count)
+ const char *flags, size_t count)
{
struct sk_buff *skb = NULL;
struct ser_device *ser;
* functions may be called in parallel.
*/
static void can327_ldisc_rx(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count)
+ const char *fp, size_t count)
{
struct can327 *elm = tty->disc_data;
size_t first_new_char_idx;
while (count--) {
if (elm->rxfill >= CAN327_SIZE_RXBUF) {
netdev_err(elm->dev,
- "Receive buffer overflowed. Bad chip or wiring? count = %i",
+ "Receive buffer overflowed. Bad chip or wiring? count = %zu",
count);
goto uart_failure;
}
*/
static void slcan_receive_buf(struct tty_struct *tty,
const unsigned char *cp, const char *fp,
- int count)
+ size_t count)
{
struct slcan *sl = tty->disc_data;
* and sent on to some IP layer for further processing.
*/
static void sixpack_receive_buf(struct tty_struct *tty,
- const unsigned char *cp, const char *fp, int count)
+ const unsigned char *cp, const char *fp, size_t count)
{
struct sixpack *sp;
int count1;
* and sent on to the AX.25 layer for further processing.
*/
static void mkiss_receive_buf(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count)
+ const char *fp, size_t count)
{
struct mkiss *ax = mkiss_get(tty);
static void mctp_serial_tty_receive_buf(struct tty_struct *tty,
const unsigned char *c,
- const char *f, int len)
+ const char *f, size_t len)
{
struct mctp_serial *dev = tty->disc_data;
int i;
/* May sleep, don't call from interrupt level or with interrupts disabled */
static void
ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
- const char *cflags, int count)
+ const char *cflags, size_t count)
{
struct asyncppp *ap = ap_get(tty);
unsigned long flags;
/* May sleep, don't call from interrupt level or with interrupts disabled */
static void
ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
- const char *cflags, int count)
+ const char *cflags, size_t count)
{
struct syncppp *ap = sp_get(tty);
unsigned long flags;
*/
static void slip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count)
+ const char *fp, size_t count)
{
struct slip *sl = tty->disc_data;
}
static void gsmld_receive_buf(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count)
+ const char *fp, size_t count)
{
struct gsm_mux *gsm = tty->disc_data;
char flags = TTY_NORMAL;
* interpreted as one HDLC frame.
*/
static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data,
- const char *flags, int count)
+ const char *flags, size_t count)
{
register struct n_hdlc *n_hdlc = tty->disc_data;
register struct n_hdlc_buf *buf;
- pr_debug("%s() called count=%d\n", __func__, count);
+ pr_debug("%s() called count=%zu\n", __func__, count);
if (count > maxframe) {
pr_debug("rx count>maxframesize, data discarded\n");
/* Caller must ensure count > 0 */
static void n_tty_lookahead_flow_ctrl(struct tty_struct *tty, const unsigned char *cp,
- const unsigned char *fp, unsigned int count)
+ const unsigned char *fp, size_t count)
{
struct n_tty_data *ldata = tty->disc_data;
unsigned char flag = TTY_NORMAL;
* claims non-exclusive %termios_rwsem
* publishes commit_head or canon_head
*/
-static int
+static size_t
n_tty_receive_buf_common(struct tty_struct *tty, const unsigned char *cp,
const char *fp, int count, int flow)
{
struct n_tty_data *ldata = tty->disc_data;
- int room, n, rcvd = 0, overflow;
+ size_t rcvd = 0;
+ int room, n, overflow;
down_read(&tty->termios_rwsem);
}
static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count)
+ const char *fp, size_t count)
{
n_tty_receive_buf_common(tty, cp, fp, count, 0);
}
-static int n_tty_receive_buf2(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count)
+static size_t n_tty_receive_buf2(struct tty_struct *tty,
+ const unsigned char *cp, const char *fp,
+ size_t count)
{
return n_tty_receive_buf_common(tty, cp, fp, count, 1);
}
* Optional. Can sleep.
*
* @receive_buf: [DRV] ``void ()(struct tty_struct *tty,
- * const unsigned char *cp, const char *fp, int count)``
+ * const unsigned char *cp, const char *fp, size_t count)``
*
* This function is called by the low-level tty driver to send characters
* received by the hardware to the line discpline for processing. @cp is
*
* Optional.
*
- * @receive_buf2: [DRV] ``int ()(struct tty_struct *tty,
- * const unsigned char *cp, const char *fp, int count)``
+ * @receive_buf2: [DRV] ``ssize_t ()(struct tty_struct *tty,
+ * const unsigned char *cp, const char *fp, size_t count)``
*
* This function is called by the low-level tty driver to send characters
* received by the hardware to the line discpline for processing. @cp is a
* Optional.
*
* @lookahead_buf: [DRV] ``void ()(struct tty_struct *tty,
- * const unsigned char *cp, const char *fp, int count)``
+ * const unsigned char *cp, const char *fp, size_t count)``
*
* This function is called by the low-level tty driver for characters
* not eaten by ->receive_buf() or ->receive_buf2(). It is useful for
* The following routines are called from below.
*/
void (*receive_buf)(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count);
+ const char *fp, size_t count);
void (*write_wakeup)(struct tty_struct *tty);
void (*dcd_change)(struct tty_struct *tty, bool active);
- int (*receive_buf2)(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count);
+ size_t (*receive_buf2)(struct tty_struct *tty, const unsigned char *cp,
+ const char *fp, size_t count);
void (*lookahead_buf)(struct tty_struct *tty, const unsigned char *cp,
- const unsigned char *fp, unsigned int count);
+ const unsigned char *fp, size_t count);
struct module *owner;
};
* Return Value: None
*/
static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
- const char *flags, int count)
+ const char *flags, size_t count)
{
struct nci_uart *nu = tty->disc_data;
/* Line discipline .receive_buf() */
static void v253_receive(struct tty_struct *tty, const unsigned char *cp,
- const char *fp, int count)
+ const char *fp, size_t count)
{
struct snd_soc_component *component = tty->disc_data;
struct cx20442_priv *cx20442;