Lines Matching refs:buf
119 char buf[1]; member
164 struct n_hdlc_buf *buf);
181 __u8 __user *buf, size_t nr);
183 const unsigned char *buf, size_t nr);
202 struct n_hdlc_buf *buf; in flush_rx_queue() local
204 while ((buf = n_hdlc_buf_get(&n_hdlc->rx_buf_list))) in flush_rx_queue()
205 n_hdlc_buf_put(&n_hdlc->rx_free_buf_list, buf); in flush_rx_queue()
211 struct n_hdlc_buf *buf; in flush_tx_queue() local
214 while ((buf = n_hdlc_buf_get(&n_hdlc->tx_buf_list))) in flush_tx_queue()
215 n_hdlc_buf_put(&n_hdlc->tx_free_buf_list, buf); in flush_tx_queue()
246 struct n_hdlc_buf *buf; in n_hdlc_release() local
260 buf = n_hdlc_buf_get(&n_hdlc->rx_free_buf_list); in n_hdlc_release()
261 if (buf) { in n_hdlc_release()
262 kfree(buf); in n_hdlc_release()
267 buf = n_hdlc_buf_get(&n_hdlc->tx_free_buf_list); in n_hdlc_release()
268 if (buf) { in n_hdlc_release()
269 kfree(buf); in n_hdlc_release()
274 buf = n_hdlc_buf_get(&n_hdlc->rx_buf_list); in n_hdlc_release()
275 if (buf) { in n_hdlc_release()
276 kfree(buf); in n_hdlc_release()
281 buf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); in n_hdlc_release()
282 if (buf) { in n_hdlc_release()
283 kfree(buf); in n_hdlc_release()
420 actual = tty->ops->write(tty, tbuf->buf, tbuf->count); in n_hdlc_send_frames()
515 register struct n_hdlc_buf *buf; in n_hdlc_tty_receive() local
540 buf = n_hdlc_buf_get(&n_hdlc->rx_free_buf_list); in n_hdlc_tty_receive()
541 if (!buf) { in n_hdlc_tty_receive()
545 buf = kmalloc(N_HDLC_BUF_SIZE, GFP_ATOMIC); in n_hdlc_tty_receive()
548 if (!buf) { in n_hdlc_tty_receive()
556 memcpy(buf->buf,data,count); in n_hdlc_tty_receive()
557 buf->count=count; in n_hdlc_tty_receive()
560 n_hdlc_buf_put(&n_hdlc->rx_buf_list, buf); in n_hdlc_tty_receive()
579 __u8 __user *buf, size_t nr) in n_hdlc_tty_read() argument
594 if (!access_ok(VERIFY_WRITE, buf, nr)) { in n_hdlc_tty_read()
618 if (copy_to_user(buf, rbuf->buf, rbuf->count)) in n_hdlc_tty_read()
725 memcpy(tbuf->buf, data, count); in n_hdlc_tty_write()
849 struct n_hdlc_buf *buf; in n_hdlc_alloc() local
863 buf = kmalloc(N_HDLC_BUF_SIZE, GFP_KERNEL); in n_hdlc_alloc()
864 if (buf) in n_hdlc_alloc()
865 n_hdlc_buf_put(&n_hdlc->rx_free_buf_list,buf); in n_hdlc_alloc()
872 buf = kmalloc(N_HDLC_BUF_SIZE, GFP_KERNEL); in n_hdlc_alloc()
873 if (buf) in n_hdlc_alloc()
874 n_hdlc_buf_put(&n_hdlc->tx_free_buf_list,buf); in n_hdlc_alloc()
903 struct n_hdlc_buf *buf) in n_hdlc_buf_put() argument
908 buf->link=NULL; in n_hdlc_buf_put()
910 list->tail->link = buf; in n_hdlc_buf_put()
912 list->head = buf; in n_hdlc_buf_put()
913 list->tail = buf; in n_hdlc_buf_put()
931 struct n_hdlc_buf *buf; in n_hdlc_buf_get() local
934 buf = list->head; in n_hdlc_buf_get()
935 if (buf) { in n_hdlc_buf_get()
936 list->head = buf->link; in n_hdlc_buf_get()
943 return buf; in n_hdlc_buf_get()