Skip to content

Commit 6789734

Browse files
committed
nvme: nvme_security_send use nvme_passthru_cmd directly
Drop nvme_security_send_args entirely. Signed-off-by: Dennis Maisenbacher <[email protected]>
1 parent 7782c13 commit 6789734

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

nvme-rpmb.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -275,21 +275,8 @@ struct rpmb_config_block_t {
275275
static int send_rpmb_req(nvme_link_t l, unsigned char tgt, int size,
276276
struct rpmb_data_frame_t *req)
277277
{
278-
struct nvme_security_send_args args = {
279-
.args_size = sizeof(args),
280-
.nsid = 0,
281-
.nssf = tgt,
282-
.spsp0 = RPMB_NVME_SPSP,
283-
.spsp1 = 0,
284-
.secp = RPMB_NVME_SECP,
285-
.tl = 0,
286-
.data_len = size,
287-
.data = (void *)req,
288-
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
289-
.result = NULL,
290-
};
291-
292-
return nvme_security_send(l, &args);
278+
return nvme_security_send(l, 0, tgt, RPMB_NVME_SPSP, 0, RPMB_NVME_SECP, 0,
279+
(void *)req, size, NULL);
293280
}
294281

295282
static int recv_rpmb_rsp(nvme_link_t l, int tgt, int size,

nvme.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6876,21 +6876,8 @@ static int sec_send(int argc, char **argv, struct command *cmd, struct plugin *p
68766876
return -errno;
68776877
}
68786878

6879-
struct nvme_security_send_args args = {
6880-
.args_size = sizeof(args),
6881-
.nsid = cfg.namespace_id,
6882-
.nssf = cfg.nssf,
6883-
.spsp0 = cfg.spsp & 0xff,
6884-
.spsp1 = cfg.spsp >> 8,
6885-
.secp = cfg.secp,
6886-
.tl = cfg.tl,
6887-
.data_len = cfg.tl,
6888-
.data = sec_buf,
6889-
.timeout = nvme_cfg.timeout,
6890-
.result = NULL,
6891-
};
6892-
6893-
err = nvme_security_send(l, &args);
6879+
err = nvme_security_send(l, cfg.namespace_id, cfg.nssf, cfg.spsp & 0xff,
6880+
cfg.spsp >> 8, cfg.secp, cfg.tl, sec_buf, cfg.tl, NULL);
68946881

68956882
if (err < 0)
68966883
nvme_show_error("security-send: %s", nvme_strerror(-err));

0 commit comments

Comments
 (0)