Lines Matching refs:hdr
150 static int nx842_crypto_add_header(struct nx842_crypto_header *hdr, u8 *buf) in nx842_crypto_add_header() argument
152 int s = NX842_CRYPTO_HEADER_SIZE(hdr->groups); in nx842_crypto_add_header()
155 if (s > be16_to_cpu(hdr->group[0].padding)) { in nx842_crypto_add_header()
160 memcpy(buf, hdr, s); in nx842_crypto_add_header()
263 struct nx842_crypto_header *hdr = &ctx->header; in nx842_crypto_compress() local
297 hdr->magic = cpu_to_be16(NX842_CRYPTO_MAGIC); in nx842_crypto_compress()
298 hdr->groups = 0; in nx842_crypto_compress()
299 hdr->ignore = 0; in nx842_crypto_compress()
302 n = hdr->groups++; in nx842_crypto_compress()
304 if (hdr->groups > NX842_CRYPTO_GROUP_MAX) in nx842_crypto_compress()
313 ret = compress(ctx, &p, &hdr->group[n], &c, &ignore, h); in nx842_crypto_compress()
318 if (!add_header && hdr->groups > 1) { in nx842_crypto_compress()
325 hdr->ignore = cpu_to_be16(ignore); in nx842_crypto_compress()
330 ret = nx842_crypto_add_header(hdr, dst); in nx842_crypto_compress()
447 struct nx842_crypto_header *hdr; in nx842_crypto_decompress() local
463 hdr = (struct nx842_crypto_header *)src; in nx842_crypto_decompress()
470 if (be16_to_cpu(hdr->magic) != NX842_CRYPTO_MAGIC) { in nx842_crypto_decompress()
484 if (!hdr->groups) { in nx842_crypto_decompress()
489 if (hdr->groups > NX842_CRYPTO_GROUP_MAX) { in nx842_crypto_decompress()
491 hdr->groups, NX842_CRYPTO_GROUP_MAX); in nx842_crypto_decompress()
496 hdr_len = NX842_CRYPTO_HEADER_SIZE(hdr->groups); in nx842_crypto_decompress()
503 hdr = &ctx->header; in nx842_crypto_decompress()
505 for (n = 0; n < hdr->groups; n++) { in nx842_crypto_decompress()
507 if (n + 1 == hdr->groups) in nx842_crypto_decompress()
508 ignore = be16_to_cpu(hdr->ignore); in nx842_crypto_decompress()
510 ret = decompress(ctx, &p, &hdr->group[n], &c, ignore); in nx842_crypto_decompress()