Lines Matching full:len

91 		unsigned int len, unsigned int off)  in kfifo_copy_in()  argument
101 len *= esize; in kfifo_copy_in()
103 l = min(len, size - off); in kfifo_copy_in()
106 memcpy(fifo->data, src + l, len - l); in kfifo_copy_in()
115 const void *buf, unsigned int len) in __kfifo_in() argument
120 if (len > l) in __kfifo_in()
121 len = l; in __kfifo_in()
123 kfifo_copy_in(fifo, buf, len, fifo->in); in __kfifo_in()
124 fifo->in += len; in __kfifo_in()
125 return len; in __kfifo_in()
130 unsigned int len, unsigned int off) in kfifo_copy_out() argument
140 len *= esize; in kfifo_copy_out()
142 l = min(len, size - off); in kfifo_copy_out()
145 memcpy(dst + l, fifo->data, len - l); in kfifo_copy_out()
154 void *buf, unsigned int len) in __kfifo_out_peek() argument
159 if (len > l) in __kfifo_out_peek()
160 len = l; in __kfifo_out_peek()
162 kfifo_copy_out(fifo, buf, len, fifo->out); in __kfifo_out_peek()
163 return len; in __kfifo_out_peek()
181 void *buf, unsigned int len) in __kfifo_out() argument
183 len = __kfifo_out_peek(fifo, buf, len); in __kfifo_out()
184 fifo->out += len; in __kfifo_out()
185 return len; in __kfifo_out()
190 const void __user *from, unsigned int len, unsigned int off, in kfifo_copy_from_user() argument
202 len *= esize; in kfifo_copy_from_user()
204 l = min(len, size - off); in kfifo_copy_from_user()
208 ret = DIV_ROUND_UP(ret + len - l, esize); in kfifo_copy_from_user()
210 ret = copy_from_user(fifo->data, from + l, len - l); in kfifo_copy_from_user()
219 *copied = len - ret * esize; in kfifo_copy_from_user()
225 unsigned long len, unsigned int *copied) in __kfifo_from_user() argument
233 len /= esize; in __kfifo_from_user()
236 if (len > l) in __kfifo_from_user()
237 len = l; in __kfifo_from_user()
239 ret = kfifo_copy_from_user(fifo, from, len, fifo->in, copied); in __kfifo_from_user()
241 len -= ret; in __kfifo_from_user()
245 fifo->in += len; in __kfifo_from_user()
251 unsigned int len, unsigned int off, unsigned int *copied) in kfifo_copy_to_user() argument
262 len *= esize; in kfifo_copy_to_user()
264 l = min(len, size - off); in kfifo_copy_to_user()
268 ret = DIV_ROUND_UP(ret + len - l, esize); in kfifo_copy_to_user()
270 ret = copy_to_user(to + l, fifo->data, len - l); in kfifo_copy_to_user()
279 *copied = len - ret * esize; in kfifo_copy_to_user()
285 unsigned long len, unsigned int *copied) in __kfifo_to_user() argument
293 len /= esize; in __kfifo_to_user()
296 if (len > l) in __kfifo_to_user()
297 len = l; in __kfifo_to_user()
298 ret = kfifo_copy_to_user(fifo, to, len, fifo->out, copied); in __kfifo_to_user()
300 len -= ret; in __kfifo_to_user()
304 fifo->out += len; in __kfifo_to_user()
311 unsigned int len, dma_addr_t dma) in setup_sgl_buf() argument
315 if (!nents || !len) in setup_sgl_buf()
318 sg_set_buf(sgl, buf, len); in setup_sgl_buf()
322 sg_dma_len(sgl) = len; in setup_sgl_buf()
329 int nents, unsigned int len, unsigned int off, dma_addr_t dma) in setup_sgl() argument
340 len *= esize; in setup_sgl()
342 len_to_end = min(len, size - off); in setup_sgl()
345 n += setup_sgl_buf(fifo, sgl + n, 0, nents - n, len - len_to_end, dma); in setup_sgl()
351 struct scatterlist *sgl, int nents, unsigned int len, in __kfifo_dma_in_prepare() argument
357 if (len > l) in __kfifo_dma_in_prepare()
358 len = l; in __kfifo_dma_in_prepare()
360 return setup_sgl(fifo, sgl, nents, len, fifo->in, dma); in __kfifo_dma_in_prepare()
365 struct scatterlist *sgl, int nents, unsigned int len, in __kfifo_dma_out_prepare() argument
371 if (len > l) in __kfifo_dma_out_prepare()
372 len = l; in __kfifo_dma_out_prepare()
374 return setup_sgl(fifo, sgl, nents, len, fifo->out, dma); in __kfifo_dma_out_prepare()
378 unsigned int __kfifo_max_r(unsigned int len, size_t recsize) in __kfifo_max_r() argument
382 if (len > max) in __kfifo_max_r()
384 return len; in __kfifo_max_r()
435 unsigned int len, size_t recsize) in __kfifo_in_r() argument
437 if (len + recsize > kfifo_unused(fifo)) in __kfifo_in_r()
440 __kfifo_poke_n(fifo, len, recsize); in __kfifo_in_r()
442 kfifo_copy_in(fifo, buf, len, fifo->in + recsize); in __kfifo_in_r()
443 fifo->in += len + recsize; in __kfifo_in_r()
444 return len; in __kfifo_in_r()
449 void *buf, unsigned int len, size_t recsize, unsigned int *n) in kfifo_out_copy_r() argument
453 if (len > *n) in kfifo_out_copy_r()
454 len = *n; in kfifo_out_copy_r()
456 kfifo_copy_out(fifo, buf, len, fifo->out + recsize); in kfifo_out_copy_r()
457 return len; in kfifo_out_copy_r()
461 unsigned int len, size_t recsize) in __kfifo_out_peek_r() argument
468 return kfifo_out_copy_r(fifo, buf, len, recsize, &n); in __kfifo_out_peek_r()
486 unsigned int len, size_t recsize) in __kfifo_out_r() argument
493 len = kfifo_out_copy_r(fifo, buf, len, recsize, &n); in __kfifo_out_r()
495 return len; in __kfifo_out_r()
509 unsigned long len, unsigned int *copied, size_t recsize) in __kfifo_from_user_r() argument
513 len = __kfifo_max_r(len, recsize); in __kfifo_from_user_r()
515 if (len + recsize > kfifo_unused(fifo)) { in __kfifo_from_user_r()
520 __kfifo_poke_n(fifo, len, recsize); in __kfifo_from_user_r()
522 ret = kfifo_copy_from_user(fifo, from, len, fifo->in + recsize, copied); in __kfifo_from_user_r()
527 fifo->in += len + recsize; in __kfifo_from_user_r()
533 unsigned long len, unsigned int *copied, size_t recsize) in __kfifo_to_user_r() argument
544 if (len > n) in __kfifo_to_user_r()
545 len = n; in __kfifo_to_user_r()
547 ret = kfifo_copy_to_user(fifo, to, len, fifo->out + recsize, copied); in __kfifo_to_user_r()
558 struct scatterlist *sgl, int nents, unsigned int len, size_t recsize, in __kfifo_dma_in_prepare_r() argument
563 len = __kfifo_max_r(len, recsize); in __kfifo_dma_in_prepare_r()
565 if (len + recsize > kfifo_unused(fifo)) in __kfifo_dma_in_prepare_r()
568 return setup_sgl(fifo, sgl, nents, len, fifo->in + recsize, dma); in __kfifo_dma_in_prepare_r()
573 unsigned int len, size_t recsize) in __kfifo_dma_in_finish_r() argument
575 len = __kfifo_max_r(len, recsize); in __kfifo_dma_in_finish_r()
576 __kfifo_poke_n(fifo, len, recsize); in __kfifo_dma_in_finish_r()
577 fifo->in += len + recsize; in __kfifo_dma_in_finish_r()
582 struct scatterlist *sgl, int nents, unsigned int len, size_t recsize, in __kfifo_dma_out_prepare_r() argument
587 len = __kfifo_max_r(len, recsize); in __kfifo_dma_out_prepare_r()
589 if (len + recsize > fifo->in - fifo->out) in __kfifo_dma_out_prepare_r()
592 return setup_sgl(fifo, sgl, nents, len, fifo->out + recsize, dma); in __kfifo_dma_out_prepare_r()