This series moves sandbox over to use driver model for SCSI. It takes the opportunity to use common code with the USB flash driver.
This is mostly refactoring, but there is a small amount of new code, notably a test which checks that data can be read from a SCSI device. Changes in v2: - Change the comments to modern style - Add a comment for the enum - Add documentation for the structs - Drop the extra blank line - Fix 'start' type Simon Glass (15): scsi: Tidy up comments for struct scsi_cmd sandbox: usb: Rename transfer_len in protocol struct scsi: Move cmd_phase enum to the header scsi: Move core emulation state into a new struct sandbox: Move buffer to scsi_emul_info scsi: Move vendor/product info into the shared struct sandbox: scsi: Move block size into shared struct sandbox: scsi: Move file size into shared struct sandbox: scsi: Move reply setup out of helper sandbox: scsi: Remove setup calls from handle_read() sandbox: scsi: Move structs to header file sandbox: Enable SCSI for all builds sandbox: scsi: Move request-handling code to scsi_emul sandbox: Convert to use driver model for SCSI sandbox: Add a test for SCSI arch/Kconfig | 1 - arch/sandbox/dts/sandbox.dtsi | 4 + arch/sandbox/dts/test.dts | 5 + configs/sandbox64_defconfig | 6 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 5 + configs/sandbox_noinst_defconfig | 5 + configs/sandbox_spl_defconfig | 7 +- configs/sandbox_vpl_defconfig | 5 + drivers/scsi/Makefile | 1 + drivers/scsi/sandbox_scsi.c | 132 +++++++++++++++++- drivers/scsi/scsi_emul.c | 74 +++++++++++ drivers/usb/emul/sandbox_flash.c | 207 ++++++++++------------------- include/scsi.h | 126 +++++++++++++++--- include/scsi_emul.h | 70 ++++++++++ test/dm/Makefile | 1 + test/dm/scsi.c | 39 ++++++ test/py/tests/test_ut.py | 9 ++ 18 files changed, 535 insertions(+), 163 deletions(-) create mode 100644 drivers/scsi/scsi_emul.c create mode 100644 include/scsi_emul.h create mode 100644 test/dm/scsi.c -- 2.37.3.968.ga6b4b080e4-goog