Lines Matching refs:tail
299 unsigned head, tail; in clear_events() local
305 tail = cs->ev_tail; in clear_events()
307 while (tail != head) { in clear_events()
313 cs->ev_head = tail; in clear_events()
337 unsigned next, tail; in gigaset_add_event() local
344 tail = cs->ev_tail; in gigaset_add_event()
345 next = (tail + 1) % MAX_EVENTS; in gigaset_add_event()
349 event = cs->events + tail; in gigaset_add_event()
553 inbuf->tail = 0; in gigaset_inbuf_init()
569 unsigned n, head, tail, bytesleft; in gigaset_fill_inbuf() local
577 tail = inbuf->tail; in gigaset_fill_inbuf()
579 gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail); in gigaset_fill_inbuf()
582 if (head > tail) in gigaset_fill_inbuf()
583 n = head - 1 - tail; in gigaset_fill_inbuf()
585 n = (RBUFSIZE - 1) - tail; in gigaset_fill_inbuf()
587 n = RBUFSIZE - tail; in gigaset_fill_inbuf()
596 memcpy(inbuf->data + tail, src, n); in gigaset_fill_inbuf()
598 tail = (tail + n) % RBUFSIZE; in gigaset_fill_inbuf()
601 gig_dbg(DEBUG_INTR, "setting tail to %u", tail); in gigaset_fill_inbuf()
602 inbuf->tail = tail; in gigaset_fill_inbuf()
836 cs->inbuf->tail = 0; in cleanup_cs()