summaryrefslogtreecommitdiff
path: root/src/class/msc/msc_device.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-11-22 12:11:06 +0700
committerhathach <[email protected]>2018-11-22 12:11:06 +0700
commit4314be9aebff009f5dd626d59142459edea5c8a2 (patch)
tree3387b9f6006c74262c6abe47751036c5fe854fbc /src/class/msc/msc_device.h
parentd7e48f307bb77e8e6a55967d9b94c7218f267e83 (diff)
msc device block count and block num
- replace CFG_TUD_MSC_BLOCK_NUM & CFG_TUD_MSC_BLOCK_SZ by tud_msc_capacity_cb() (mandatory callback)
Diffstat (limited to 'src/class/msc/msc_device.h')
-rw-r--r--src/class/msc/msc_device.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/class/msc/msc_device.h b/src/class/msc/msc_device.h
index d08d9f9cb..c1c51255a 100644
--- a/src/class/msc/msc_device.h
+++ b/src/class/msc/msc_device.h
@@ -132,6 +132,9 @@ int32_t tud_msc_read10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* buf
*/
int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize);
+// Invoked to determine the disk size
+void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size);
+
/**
* Callback invoked when received an SCSI command not in built-in list below.
* \param[in] lun Logical unit number
@@ -152,16 +155,19 @@ int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, uint8_t*
int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize);
/*------------- Optional callbacks : Could be used by application to free up resources -------------*/
+
+// Invoked when Read10 command is complete
ATTR_WEAK void tud_msc_read10_complete_cb(uint8_t lun);
+
+// Invoke when Write10 command is complete
ATTR_WEAK void tud_msc_write10_complete_cb(uint8_t lun);
+
+// Invoked when command in tud_msc_scsi_cb is complete
ATTR_WEAK void tud_msc_scsi_complete_cb(uint8_t lun, uint8_t const scsi_cmd[16]);
-// Hook to make a mass storage device read-only.
+// Hook to make a mass storage device read-only. TODO remove
ATTR_WEAK bool tud_msc_is_writable_cb(uint8_t lun);
-// Override for dynamic LUN sizes.
-ATTR_WEAK bool tud_lun_capacity_cb(uint8_t lun, uint32_t* last_valid_sector, uint16_t* block_size);
-
/** @} */
/** @} */