diff options
| author | hathach <[email protected]> | 2019-05-06 16:48:50 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-05-06 16:48:50 +0700 |
| commit | 6e4dc2f23dd6fe7725b145f49b49116859916b5c (patch) | |
| tree | e208050ed7987977b03c32607e4c54a1c819f6fe /src/class/msc/msc_device.c | |
| parent | efefbd3a4ef9d867d4aaa05e3c06e51b441aca6e (diff) | |
adding msc Start Stop to buitin command, but not complate yet
add tud_msc_start_stop_cb() as optional callback
Diffstat (limited to 'src/class/msc/msc_device.c')
| -rw-r--r-- | src/class/msc/msc_device.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c index fcb118a67..509f54957 100644 --- a/src/class/msc/msc_device.c +++ b/src/class/msc/msc_device.c @@ -202,8 +202,18 @@ int32_t proc_builtin_scsi(uint8_t lun, uint8_t const scsi_cmd[16], uint8_t* buff // not ready response with Failed status and sense key = not ready
resplen = - 1;
- // Logical Unit Not Ready, Cause Not Reportable
- tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x04, 0x00);
+ // If sense key is not set by callback, default to Logical Unit Not Ready, Cause Not Reportable
+ if ( _mscd_itf.sense_key == 0 ) tud_msc_set_sense(lun, SCSI_SENSE_NOT_READY, 0x04, 0x00);
+ }
+ break;
+
+ case SCSI_CMD_START_STOP_UNIT:
+ resplen = 0;
+
+ if (tud_msc_start_stop_cb)
+ {
+ scsi_start_stop_unit_t const * start_stop = (scsi_start_stop_unit_t const *) scsi_cmd;
+ tud_msc_start_stop_cb(lun, start_stop->power_condition, start_stop->start, start_stop->load_eject);
}
break;
|
