Lines Matching defs:hdr
141 static int nx842_crypto_add_header(struct nx842_crypto_header *hdr, u8 *buf)
143 int s = NX842_CRYPTO_HEADER_SIZE(hdr->groups);
146 if (s > be16_to_cpu(hdr->group[0].padding)) {
151 memcpy(buf, hdr, s);
254 struct nx842_crypto_header *hdr = &ctx->header;
288 hdr->magic = cpu_to_be16(NX842_CRYPTO_MAGIC);
289 hdr->groups = 0;
290 hdr->ignore = 0;
293 n = hdr->groups++;
295 if (hdr->groups > NX842_CRYPTO_GROUP_MAX)
304 ret = compress(ctx, &p, &hdr->group[n], &c, &ignore, h);
309 if (!add_header && hdr->groups > 1) {
316 hdr->ignore = cpu_to_be16(ignore);
321 ret = nx842_crypto_add_header(hdr, dst);
437 struct nx842_crypto_header *hdr;
453 hdr = (struct nx842_crypto_header *)src;
460 if (be16_to_cpu(hdr->magic) != NX842_CRYPTO_MAGIC) {
474 if (!hdr->groups) {
479 if (hdr->groups > NX842_CRYPTO_GROUP_MAX) {
481 hdr->groups, NX842_CRYPTO_GROUP_MAX);
486 hdr_len = NX842_CRYPTO_HEADER_SIZE(hdr->groups);
493 hdr = &ctx->header;
495 for (n = 0; n < hdr->groups; n++) {
497 if (n + 1 == hdr->groups)
498 ignore = be16_to_cpu(hdr->ignore);
500 ret = decompress(ctx, &p, &hdr->group[n], &c, ignore);