mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 12:56:00 +01:00
scsi: Move vendor/product info into the shared struct
Move this information into struct scsi_emul_info so we can use it in common code. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
fc7a7ed3a6
commit
0c12d9dd23
@ -245,12 +245,8 @@ static int handle_ufi_command(struct sandbox_flash_plat *plat,
|
|||||||
memset(resp, '\0', sizeof(*resp));
|
memset(resp, '\0', sizeof(*resp));
|
||||||
resp->data_format = 1;
|
resp->data_format = 1;
|
||||||
resp->additional_len = 0x1f;
|
resp->additional_len = 0x1f;
|
||||||
strncpy(resp->vendor,
|
strncpy(resp->vendor, info->vendor, sizeof(resp->vendor));
|
||||||
plat->flash_strings[STRINGID_MANUFACTURER - 1].s,
|
strncpy(resp->product, info->product, sizeof(resp->product));
|
||||||
sizeof(resp->vendor));
|
|
||||||
strncpy(resp->product,
|
|
||||||
plat->flash_strings[STRINGID_PRODUCT - 1].s,
|
|
||||||
sizeof(resp->product));
|
|
||||||
strncpy(resp->revision, "1.0", sizeof(resp->revision));
|
strncpy(resp->revision, "1.0", sizeof(resp->revision));
|
||||||
setup_response(priv, resp, sizeof(*resp));
|
setup_response(priv, resp, sizeof(*resp));
|
||||||
break;
|
break;
|
||||||
@ -406,6 +402,8 @@ static int sandbox_flash_probe(struct udevice *dev)
|
|||||||
info->buff = malloc(SANDBOX_FLASH_BUF_SIZE);
|
info->buff = malloc(SANDBOX_FLASH_BUF_SIZE);
|
||||||
if (!info->buff)
|
if (!info->buff)
|
||||||
return log_ret(-ENOMEM);
|
return log_ret(-ENOMEM);
|
||||||
|
info->vendor = plat->flash_strings[STRINGID_MANUFACTURER - 1].s;
|
||||||
|
info->product = plat->flash_strings[STRINGID_PRODUCT - 1].s;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
/**
|
/**
|
||||||
* struct scsi_emul_info - information for emulating a SCSI device
|
* struct scsi_emul_info - information for emulating a SCSI device
|
||||||
*
|
*
|
||||||
|
* @vendor: Vendor name
|
||||||
|
* @product: Product name
|
||||||
|
*
|
||||||
* @phase: Current SCSI phase
|
* @phase: Current SCSI phase
|
||||||
* @buff_used: Number of bytes ready to transfer back to host
|
* @buff_used: Number of bytes ready to transfer back to host
|
||||||
* @read_len: Number of bytes of data left in the current read command
|
* @read_len: Number of bytes of data left in the current read command
|
||||||
@ -25,6 +28,8 @@
|
|||||||
struct scsi_emul_info {
|
struct scsi_emul_info {
|
||||||
/* provided by the caller: */
|
/* provided by the caller: */
|
||||||
void *buff;
|
void *buff;
|
||||||
|
const char *vendor;
|
||||||
|
const char *product;
|
||||||
|
|
||||||
/* state maintained by the emulator: */
|
/* state maintained by the emulator: */
|
||||||
enum scsi_cmd_phase phase;
|
enum scsi_cmd_phase phase;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user