aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvri Altman <avri.altman@wdc.com>2023-06-25 13:38:10 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2023-08-07 13:08:21 +0200
commit6c8944a9000c5d883a00a37341cf9bb7cd8f8d00 (patch)
treef229997160391013ea7c16c3620f6cd253bac056
parent731a1cca552cdb85da9df5d8ffdfb2045870aef3 (diff)
downloadmmc-utils-6c8944a9000c5d883a00a37341cf9bb7cd8f8d00.tar.gz
mmc-utils: Add arg argument to set_single_cmd
Will prove itself useful in a minute. No functional change. Signed-off-by: Avri Altman <avri.altman@wdc.com> Link: https://lore.kernel.org/r/20230625103814.105-3-avri.altman@wdc.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--mmc_cmds.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/mmc_cmds.c b/mmc_cmds.c
index da89724..8650c2f 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -2095,11 +2095,12 @@ struct rpmb_frame {
};
static inline void set_single_cmd(struct mmc_ioc_cmd *ioc, __u32 opcode,
- int write_flag, unsigned int blocks)
+ int write_flag, unsigned int blocks,
+ __u32 arg)
{
ioc->opcode = opcode;
ioc->write_flag = write_flag;
- ioc->arg = 0x0;
+ ioc->arg = arg;
ioc->blksz = 512;
ioc->blocks = blocks;
ioc->flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
@@ -2152,18 +2153,18 @@ static int do_rpmb_op(int fd,
/* Write request */
ioc = &mioc->cmds[0];
- set_single_cmd(ioc, MMC_WRITE_MULTIPLE_BLOCK, (1 << 31) | 1, 1);
+ set_single_cmd(ioc, MMC_WRITE_MULTIPLE_BLOCK, (1 << 31) | 1, 1, 0);
mmc_ioc_cmd_set_data((*ioc), frame_in);
/* Result request */
ioc = &mioc->cmds[1];
frame_status.req_resp = htobe16(MMC_RPMB_READ_RESP);
- set_single_cmd(ioc, MMC_WRITE_MULTIPLE_BLOCK, 1, 1);
+ set_single_cmd(ioc, MMC_WRITE_MULTIPLE_BLOCK, 1, 1, 0);
mmc_ioc_cmd_set_data((*ioc), &frame_status);
/* Get response */
ioc = &mioc->cmds[2];
- set_single_cmd(ioc, MMC_READ_MULTIPLE_BLOCK, 0, 1);
+ set_single_cmd(ioc, MMC_READ_MULTIPLE_BLOCK, 0, 1, 0);
mmc_ioc_cmd_set_data((*ioc), frame_out);
break;
@@ -2179,12 +2180,12 @@ static int do_rpmb_op(int fd,
/* Read request */
ioc = &mioc->cmds[0];
- set_single_cmd(ioc, MMC_WRITE_MULTIPLE_BLOCK, 1, 1);
+ set_single_cmd(ioc, MMC_WRITE_MULTIPLE_BLOCK, 1, 1, 0);
mmc_ioc_cmd_set_data((*ioc), frame_in);
/* Get response */
ioc = &mioc->cmds[1];
- set_single_cmd(ioc, MMC_READ_MULTIPLE_BLOCK, 0, out_cnt);
+ set_single_cmd(ioc, MMC_READ_MULTIPLE_BLOCK, 0, out_cnt, 0);
mmc_ioc_cmd_set_data((*ioc), frame_out);
break;