Lines Matching defs:nbytes

34  * @nbytes: The amount of data to read
36 MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)
44 while (nbytes > 0 && buffer[0] == 0) {
46 nbytes--;
49 nbits = nbytes * 8;
54 if (nbytes > 0)
57 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB);
65 if (nbytes > 0) {
66 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
85 unsigned int nbits, nbytes;
97 nbytes = DIV_ROUND_UP(nbits, 8);
98 if (nbytes + 2 > *ret_nread) {
99 pr_info("MPI: mpi larger than buffer nbytes=%u ret_nread=%u\n",
100 nbytes, *ret_nread);
104 val = mpi_read_raw_data(buffer + 2, nbytes);
108 *ret_nread = nbytes + 2;
121 unsigned int nbits, nbytes, nlimbs;
142 nbytes = (nbits+7) / 8;
143 nlimbs = (nbytes+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB;
148 i = BYTES_PER_MPI_LIMB - (nbytes % BYTES_PER_MPI_LIMB);
243 * @nbytes: receives the actual length of the data written on success and
250 int mpi_read_buffer(MPI a, uint8_t *buf, unsigned buf_len, unsigned *nbytes,
264 if (!buf || !nbytes)
273 *nbytes = n - lzeros;
278 *nbytes = n - lzeros;
301 * This function does return a 0 byte buffer with nbytes set to zero if the
305 * @nbytes: receives the length of this buffer.
310 void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign)
316 if (!nbytes)
329 ret = mpi_read_buffer(a, buf, n, nbytes, sign);
348 * @nbytes: the number of bytes to write. Leading bytes will be
354 int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned nbytes,
373 if (nbytes < n)
376 nents = sg_nents_for_len(sgl, nbytes);
385 while (nbytes > n) {
386 i = min_t(unsigned, nbytes - n, buf_len);
389 nbytes -= i;
433 * @nbytes: number of bytes to read
437 MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes)
447 ents = sg_nents_for_len(sgl, nbytes);
455 while (nbytes > 0) {
469 nbytes -= lzeros;
475 nbytes -= lzeros;
476 nbits = nbytes * 8;
483 if (nbytes > 0)
488 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB);
497 if (nbytes == 0)
502 z = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
507 len = min_t(unsigned, miter.length, nbytes);
508 nbytes -= len;