Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390/zcrypt: Slight rework on the agent_id field

The agent_id field is a two byte ascii field addressing
the target agent on the crypto card. Some code however
addresses this field as unsigned short. Rework these
places to treat this field always as a two byte array.
Unfortunately this field also shows up as __u16 in
struct ica_xcRB as part of the zcrypt ioctl interface.
Leave this untouched as it would break the API.

There are two other places (func_id) where a byte array
gets assigned with hex values but in fact these are ascii
value. So replace these assignments with real ascii values
for more readability.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Harald Freudenberger and committed by
Vasily Gorbik
2a0a1db5 0e72b785

+4 -5
+1 -1
drivers/s390/crypto/zcrypt_ccamisc.c
··· 305 305 struct CPRBX *prepcblk) 306 306 { 307 307 memset(pxcrb, 0, sizeof(*pxcrb)); 308 - pxcrb->agent_ID = 0x4341; /* 'CA' */ 308 + memcpy(&pxcrb->agent_ID, "CA", 2); 309 309 pxcrb->user_defined = (cardnr == 0xFFFF ? AUTOSELECT : cardnr); 310 310 pxcrb->request_control_blk_length = 311 311 preqcblk->cprb_len + preqcblk->req_parml;
+3 -4
drivers/s390/crypto/zcrypt_msgtype6.c
··· 65 65 static const struct CPRBX static_cprbx = { 66 66 .cprb_len = 0x00DC, 67 67 .cprb_ver_id = 0x02, 68 - .func_id = {0x54, 0x32}, 68 + .func_id = {'T', '2'}, 69 69 }; 70 70 71 71 int speed_idx_cca(int req_type) ··· 455 455 .type = 0x06, 456 456 .rqid = {0x00, 0x01}, 457 457 .function_code = {0x00, 0x00}, 458 - .agent_id[0] = 0x58, /* {'X'} */ 459 - .agent_id[1] = 0x43, /* {'C'} */ 458 + .agent_id = {'X', 'C'}, 460 459 .offset1 = 0x00000058, 461 460 }; 462 461 ··· 1284 1285 static struct CPRBX local_cprbx = { 1285 1286 .cprb_len = 0x00dc, 1286 1287 .cprb_ver_id = 0x02, 1287 - .func_id = {0x54, 0x32}, 1288 + .func_id = {'T', '2'}, 1288 1289 .req_parml = sizeof(*msg) - sizeof(msg->hdr) - 1289 1290 sizeof(msg->cprbx), 1290 1291 .rpl_msgbl = sizeof(*msg) - sizeof(msg->hdr),