Lines Matching refs:recsize
382 unsigned int __kfifo_max_r(unsigned int len, size_t recsize) in __kfifo_max_r() argument
384 unsigned int max = (1 << (recsize << 3)) - 1; in __kfifo_max_r()
398 static unsigned int __kfifo_peek_n(struct __kfifo *fifo, size_t recsize) in __kfifo_peek_n() argument
406 if (--recsize) in __kfifo_peek_n()
421 static void __kfifo_poke_n(struct __kfifo *fifo, unsigned int n, size_t recsize) in __kfifo_poke_n() argument
428 if (recsize > 1) in __kfifo_poke_n()
432 unsigned int __kfifo_len_r(struct __kfifo *fifo, size_t recsize) in __kfifo_len_r() argument
434 return __kfifo_peek_n(fifo, recsize); in __kfifo_len_r()
439 unsigned int len, size_t recsize) in __kfifo_in_r() argument
441 if (len + recsize > kfifo_unused(fifo)) in __kfifo_in_r()
444 __kfifo_poke_n(fifo, len, recsize); in __kfifo_in_r()
446 kfifo_copy_in(fifo, buf, len, fifo->in + recsize); in __kfifo_in_r()
447 fifo->in += len + recsize; in __kfifo_in_r()
453 void *buf, unsigned int len, size_t recsize, unsigned int *n) in kfifo_out_copy_r() argument
455 *n = __kfifo_peek_n(fifo, recsize); in kfifo_out_copy_r()
460 kfifo_copy_out(fifo, buf, len, fifo->out + recsize); in kfifo_out_copy_r()
465 unsigned int len, size_t recsize) in __kfifo_out_peek_r() argument
472 return kfifo_out_copy_r(fifo, buf, len, recsize, &n); in __kfifo_out_peek_r()
477 unsigned int len, size_t recsize) in __kfifo_out_r() argument
484 len = kfifo_out_copy_r(fifo, buf, len, recsize, &n); in __kfifo_out_r()
485 fifo->out += n + recsize; in __kfifo_out_r()
490 void __kfifo_skip_r(struct __kfifo *fifo, size_t recsize) in __kfifo_skip_r() argument
494 n = __kfifo_peek_n(fifo, recsize); in __kfifo_skip_r()
495 fifo->out += n + recsize; in __kfifo_skip_r()
500 unsigned long len, unsigned int *copied, size_t recsize) in __kfifo_from_user_r() argument
504 len = __kfifo_max_r(len, recsize); in __kfifo_from_user_r()
506 if (len + recsize > kfifo_unused(fifo)) { in __kfifo_from_user_r()
511 __kfifo_poke_n(fifo, len, recsize); in __kfifo_from_user_r()
513 ret = kfifo_copy_from_user(fifo, from, len, fifo->in + recsize, copied); in __kfifo_from_user_r()
518 fifo->in += len + recsize; in __kfifo_from_user_r()
524 unsigned long len, unsigned int *copied, size_t recsize) in __kfifo_to_user_r() argument
534 n = __kfifo_peek_n(fifo, recsize); in __kfifo_to_user_r()
538 ret = kfifo_copy_to_user(fifo, to, len, fifo->out + recsize, copied); in __kfifo_to_user_r()
543 fifo->out += n + recsize; in __kfifo_to_user_r()
549 struct scatterlist *sgl, int nents, unsigned int len, size_t recsize) in __kfifo_dma_in_prepare_r() argument
553 len = __kfifo_max_r(len, recsize); in __kfifo_dma_in_prepare_r()
555 if (len + recsize > kfifo_unused(fifo)) in __kfifo_dma_in_prepare_r()
558 return setup_sgl(fifo, sgl, nents, len, fifo->in + recsize); in __kfifo_dma_in_prepare_r()
563 unsigned int len, size_t recsize) in __kfifo_dma_in_finish_r() argument
565 len = __kfifo_max_r(len, recsize); in __kfifo_dma_in_finish_r()
566 __kfifo_poke_n(fifo, len, recsize); in __kfifo_dma_in_finish_r()
567 fifo->in += len + recsize; in __kfifo_dma_in_finish_r()
572 struct scatterlist *sgl, int nents, unsigned int len, size_t recsize) in __kfifo_dma_out_prepare_r() argument
576 len = __kfifo_max_r(len, recsize); in __kfifo_dma_out_prepare_r()
578 if (len + recsize > fifo->in - fifo->out) in __kfifo_dma_out_prepare_r()
581 return setup_sgl(fifo, sgl, nents, len, fifo->out + recsize); in __kfifo_dma_out_prepare_r()
585 void __kfifo_dma_out_finish_r(struct __kfifo *fifo, size_t recsize) in __kfifo_dma_out_finish_r() argument
589 len = __kfifo_peek_n(fifo, recsize); in __kfifo_dma_out_finish_r()
590 fifo->out += len + recsize; in __kfifo_dma_out_finish_r()