Lines Matching full:ctrl1
367 /* Dump FMD ctrl1. The ctrl1 input is in host byte order */
368 static void spu2_dump_fmd_ctrl1(u64 ctrl1) in spu2_dump_fmd_ctrl1() argument
378 packet_log(" FMD CTRL1 %#16llx\n", ctrl1); in spu2_dump_fmd_ctrl1()
379 if (ctrl1 & SPU2_TAG_LOC) in spu2_dump_fmd_ctrl1()
383 if (ctrl1 & SPU2_HAS_FR_DATA) in spu2_dump_fmd_ctrl1()
385 if (ctrl1 & SPU2_HAS_AAD1) in spu2_dump_fmd_ctrl1()
387 if (ctrl1 & SPU2_HAS_NAAD) in spu2_dump_fmd_ctrl1()
389 if (ctrl1 & SPU2_HAS_AAD2) in spu2_dump_fmd_ctrl1()
391 if (ctrl1 & SPU2_HAS_ESN) in spu2_dump_fmd_ctrl1()
395 hash_key_len = (ctrl1 & SPU2_HASH_KEY_LEN) >> SPU2_HASH_KEY_LEN_SHIFT; in spu2_dump_fmd_ctrl1()
398 ciph_key_len = (ctrl1 & SPU2_CIPH_KEY_LEN) >> SPU2_CIPH_KEY_LEN_SHIFT; in spu2_dump_fmd_ctrl1()
401 if (ctrl1 & SPU2_GENIV) in spu2_dump_fmd_ctrl1()
404 if (ctrl1 & SPU2_HASH_IV) in spu2_dump_fmd_ctrl1()
407 if (ctrl1 & SPU2_RET_IV) in spu2_dump_fmd_ctrl1()
410 ret_iv_len = (ctrl1 & SPU2_RET_IV_LEN) >> SPU2_RET_IV_LEN_SHIFT; in spu2_dump_fmd_ctrl1()
414 iv_offset = (ctrl1 & SPU2_IV_OFFSET) >> SPU2_IV_OFFSET_SHIFT; in spu2_dump_fmd_ctrl1()
417 iv_len = (ctrl1 & SPU2_IV_LEN) >> SPU2_IV_LEN_SHIFT; in spu2_dump_fmd_ctrl1()
420 hash_tag_len = (ctrl1 & SPU2_HASH_TAG_LEN) >> SPU2_HASH_TAG_LEN_SHIFT; in spu2_dump_fmd_ctrl1()
424 ret_md = (ctrl1 & SPU2_RETURN_MD) >> SPU2_RETURN_MD_SHIFT; in spu2_dump_fmd_ctrl1()
431 if (ctrl1 & SPU2_RETURN_FD) in spu2_dump_fmd_ctrl1()
433 if (ctrl1 & SPU2_RETURN_AAD1) in spu2_dump_fmd_ctrl1()
435 if (ctrl1 & SPU2_RETURN_NAAD) in spu2_dump_fmd_ctrl1()
437 if (ctrl1 & SPU2_RETURN_AAD2) in spu2_dump_fmd_ctrl1()
439 if (ctrl1 & SPU2_RETURN_PAY) in spu2_dump_fmd_ctrl1()
471 spu2_dump_fmd_ctrl1(le64_to_cpu(fmd->ctrl1)); in spu2_dump_fmd()
512 u64 ctrl1; in spu2_dump_msg_hdr() local
525 ctrl1 = le64_to_cpu(fmd->ctrl1); in spu2_dump_msg_hdr()
526 hash_key_len = (ctrl1 & SPU2_HASH_KEY_LEN) >> SPU2_HASH_KEY_LEN_SHIFT; in spu2_dump_msg_hdr()
527 ciph_key_len = (ctrl1 & SPU2_CIPH_KEY_LEN) >> SPU2_CIPH_KEY_LEN_SHIFT; in spu2_dump_msg_hdr()
529 ciph_iv_len = (ctrl1 & SPU2_IV_LEN) >> SPU2_IV_LEN_SHIFT; in spu2_dump_msg_hdr()
560 u64 ctrl1; in spu2_fmd_init() local
571 ctrl1 = (cipher_key_len << SPU2_CIPH_KEY_LEN_SHIFT) | in spu2_fmd_init()
590 fmd->ctrl1 = cpu_to_le64(ctrl1); in spu2_fmd_init()
641 * spu2_fmd_ctrl1_write() - Write ctrl1 field in fixed metadata (FMD) field of
669 u64 ctrl1 = 0; in spu2_fmd_ctrl1_write() local
672 ctrl1 |= SPU2_TAG_LOC; in spu2_fmd_ctrl1_write()
675 ctrl1 |= SPU2_HAS_AAD2; in spu2_fmd_ctrl1_write()
676 ctrl1 |= SPU2_RETURN_AAD2; /* need aad2 for gcm aes esp */ in spu2_fmd_ctrl1_write()
680 ctrl1 |= ((auth_key_len << SPU2_HASH_KEY_LEN_SHIFT) & in spu2_fmd_ctrl1_write()
684 ctrl1 |= ((cipher_key_len << SPU2_CIPH_KEY_LEN_SHIFT) & in spu2_fmd_ctrl1_write()
688 ctrl1 |= SPU2_GENIV; in spu2_fmd_ctrl1_write()
691 ctrl1 |= SPU2_HASH_IV; in spu2_fmd_ctrl1_write()
694 ctrl1 |= SPU2_RET_IV; in spu2_fmd_ctrl1_write()
695 ctrl1 |= ret_iv_len << SPU2_RET_IV_LEN_SHIFT; in spu2_fmd_ctrl1_write()
696 ctrl1 |= ret_iv_offset << SPU2_IV_OFFSET_SHIFT; in spu2_fmd_ctrl1_write()
699 ctrl1 |= ((cipher_iv_len << SPU2_IV_LEN_SHIFT) & SPU2_IV_LEN); in spu2_fmd_ctrl1_write()
702 ctrl1 |= ((digest_size << SPU2_HASH_TAG_LEN_SHIFT) & in spu2_fmd_ctrl1_write()
709 ctrl1 |= ((u64)SPU2_RET_FMD_ONLY << SPU2_RETURN_MD_SHIFT); in spu2_fmd_ctrl1_write()
711 ctrl1 |= ((u64)SPU2_RET_NO_MD << SPU2_RETURN_MD_SHIFT); in spu2_fmd_ctrl1_write()
716 ctrl1 |= SPU2_RETURN_PAY; in spu2_fmd_ctrl1_write()
718 fmd->ctrl1 = cpu_to_le64(ctrl1); in spu2_fmd_ctrl1_write()