aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSimon Glass2022-10-20 18:22:55 -0600
committerTom Rini2022-10-31 11:02:44 -0400
commit2ff3db3a1c5ef128a4f33c22d7be8ee37fca3613 (patch)
treeb039cad266e4cb9f32200eadbaebb5f6c484e514 /drivers/scsi
parent606b926f9d76eaab11be2d95cfd7734644e1627c (diff)
usb: Update the test to cover reading and writing
Add test coverage for blk_write() as well. The blk_erase() is not tested for now as the USB stor interface does not support erase. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_emul.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_emul.c b/drivers/scsi/scsi_emul.c
index 5ba364bdac7..6b8468f7994 100644
--- a/drivers/scsi/scsi_emul.c
+++ b/drivers/scsi/scsi_emul.c
@@ -62,6 +62,15 @@ int sb_scsi_emul_command(struct scsi_emul_info *info,
ret = SCSI_EMUL_DO_READ;
break;
}
+ case SCSI_WRITE10: {
+ const struct scsi_write10_req *write_req = (void *)req;
+
+ info->seek_block = be32_to_cpu(write_req->lba);
+ info->write_len = be16_to_cpu(write_req->xfer_len);
+ info->buff_used = info->write_len * info->block_size;
+ ret = SCSI_EMUL_DO_WRITE;
+ break;
+ }
default:
debug("Command not supported: %x\n", req->cmd[0]);
ret = -EPROTONOSUPPORT;