27 #ifndef _ZCRYPT_MSGTYPE6_H_
28 #define _ZCRYPT_MSGTYPE6_H_
32 #define MSGTYPE06_NAME "zcrypt_msgtype6"
33 #define MSGTYPE06_VARIANT_DEFAULT 0
34 #define MSGTYPE06_VARIANT_NORNG 1
36 #define MSGTYPE06_MAX_MSG_SIZE (12*1024)
101 #define TYPE86_RSP_CODE 0x86
102 #define TYPE86_FMT2 0x02
123 static inline void rng_type6CPRB_msgX(
struct ap_device *ap_dev,
125 unsigned random_number_length)
131 short int rule_length;
133 short int verb_length;
136 static struct type6_hdr static_type6_hdrX = {
138 .offset1 = 0x00000058,
139 .agent_id = {
'C',
'A'},
140 .function_code = {
'R',
'L'},
141 .ToCardLen1 =
sizeof(*msg) -
sizeof(msg->hdr),
144 static struct CPRBX local_cprbx = {
147 .func_id = {0x54, 0x32},
148 .req_parml =
sizeof(*msg) -
sizeof(msg->hdr) -
150 .rpl_msgbl =
sizeof(*msg) -
sizeof(msg->hdr),
153 msg->hdr = static_type6_hdrX;
154 msg->hdr.FromCardLen2 = random_number_length,
155 msg->cprbx = local_cprbx;
156 msg->cprbx.rpl_datal = random_number_length,
158 memcpy(msg->function_code, msg->hdr.function_code, 0x02);
159 msg->rule_length = 0x0a;
160 memcpy(msg->rule,
"RANDOM ", 8);
161 msg->verb_length = 0x02;
162 msg->key_length = 0x02;
163 ap_msg->
length =
sizeof(*msg);