tinyusb  0.4
Click here to lend your support to tinyusb donation and make a donation at pledgie.com
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Common Definitions

Data Structures

struct  msc_cmd_block_wrapper_t
 Command Block Wrapper. More...
 
struct  msc_cmd_status_wrapper_t
 Command Status Wrapper. More...
 
struct  scsi_test_unit_ready_t
 SCSI Test Unit Ready Command. More...
 
struct  scsi_inquiry_t
 SCSI Inquiry Command. More...
 
struct  scsi_inquiry_data_t
 SCSI Inquiry Response Data. More...
 
struct  scsi_sense_fixed_data_t
 
struct  scsi_mode_sense_6_t
 
struct  scsi_mode_parameters_t
 
struct  scsi_prevent_allow_medium_removal_t
 
struct  scsi_read_format_capacity_t
 SCSI Read Format Capacity: Write Capacity. More...
 
struct  scsi_read_format_capacity_data_t
 
struct  scsi_read_capacity10_t
 SCSI Read Capacity 10 Command: Read Capacity. More...
 
struct  scsi_read_capacity10_data_t
 SCSI Read Capacity 10 Response Data. More...
 
struct  scsi_read10_t
 SCSI Read 10 Command. More...
 

Typedefs

typedef struct scsi_inquiry_t scsi_request_sense_t
 
typedef struct scsi_read10_t scsi_write10_t
 

Enumerations

enum  msc_subclass_type_t {
  MSC_SUBCLASS_RBC = 1, MSC_SUBCLASS_SFF_MMC, MSC_SUBCLASS_QIC, MSC_SUBCLASS_UFI,
  MSC_SUBCLASS_SFF, MSC_SUBCLASS_SCSI
}
 MassStorage Subclass. More...
 
enum  { MSC_CBW_SIGNATURE = 0x43425355, MSC_CSW_SIGNATURE = 0x53425355 }
 
enum  msc_protocol_type_t { MSC_PROTOCOL_CBI = 0, MSC_PROTOCOL_CBI_NO_INTERRUPT = 1, MSC_PROTOCOL_BOT = 0x50 }
 MassStorage Protocol. More...
 
enum  msc_request_type_t { MSC_REQUEST_GET_MAX_LUN = 254, MSC_REQUEST_RESET = 255 }
 MassStorage Class-Specific Control Request. More...
 
enum  msc_csw_status_t { MSC_CSW_STATUS_PASSED = 0, MSC_CSW_STATUS_FAILED, MSC_CSW_STATUS_PHASE_ERROR }
 Command Block Status Values. More...
 
enum  scsi_cmd_type_t {
  SCSI_CMD_TEST_UNIT_READY = 0x00, SCSI_CMD_INQUIRY = 0x12, SCSI_CMD_MODE_SELECT_6 = 0x15, SCSI_CMD_MODE_SENSE_6 = 0x1A,
  SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, SCSI_CMD_READ_CAPACITY_10 = 0x25, SCSI_CMD_REQUEST_SENSE = 0x03, SCSI_CMD_READ_FORMAT_CAPACITY = 0x23,
  SCSI_CMD_READ_10 = 0x28, SCSI_CMD_WRITE_10 = 0x2A
}
 SCSI Command Operation Code. More...
 
enum  scsi_sense_key_type_t {
  SCSI_SENSEKEY_NONE = 0x00, SCSI_SENSEKEY_RECOVERED_ERROR = 0x01, SCSI_SENSEKEY_NOT_READY = 0x02, SCSI_SENSEKEY_MEDIUM_ERROR = 0x03,
  SCSI_SENSEKEY_HARDWARE_ERROR = 0x04, SCSI_SENSEKEY_ILLEGLA_REQUEST = 0x05, SCSI_SENSEKEY_UNIT_ATTENTION = 0x06, SCSI_SENSEKEY_DATA_PROTECT = 0x07,
  SCSI_SENSEKEY_FIRMWARE_ERROR = 0x08, SCSI_SENSEKEY_ABORTED_COMMAND = 0x0b, SCSI_SENSEKEY_EQUAL = 0x0c, SCSI_SENSEKEY_VOLUME_OVERFLOW = 0x0d,
  SCSI_SENSEKEY_MISCOMPARE = 0x0e
}
 SCSI Sense Key. More...
 

Functions

 STATIC_ASSERT (sizeof(msc_cmd_block_wrapper_t)==31,"size is not correct")
 
 STATIC_ASSERT (sizeof(msc_cmd_status_wrapper_t)==13,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_test_unit_ready_t)==6,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_inquiry_t)==6,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_inquiry_data_t)==36,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_sense_fixed_data_t)==18,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_mode_sense_6_t)==6,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_mode_parameters_t)==4,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_prevent_allow_medium_removal_t)==6,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_read_format_capacity_t)==10,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_read_format_capacity_data_t)==12,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_read_capacity10_t)==10,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_read_capacity10_data_t)==8,"size is not correct")
 
 STATIC_ASSERT (sizeof(scsi_read10_t)==10,"size is not correct")
 

Detailed Description

Enumeration Type Documentation

anonymous enum
Enumerator
MSC_CBW_SIGNATURE 

Constant value of 43425355h (little endian)

MSC_CSW_SIGNATURE 

Constant value of 53425355h (little endian)

Definition at line 68 of file msc.h.

Command Block Status Values.

Indicates the success or failure of the command. The device shall set this byte to zero if the command completed successfully. A non-zero value shall indicate a failure during command execution according to the following

Enumerator
MSC_CSW_STATUS_PASSED 

MSC_CSW_STATUS_PASSED.

MSC_CSW_STATUS_FAILED 

MSC_CSW_STATUS_FAILED.

MSC_CSW_STATUS_PHASE_ERROR 

MSC_CSW_STATUS_PHASE_ERROR.

Definition at line 90 of file msc.h.

MassStorage Protocol.

CBI only approved to use with full-speed floopy disk & should not used with highspeed or device other than floopy

Enumerator
MSC_PROTOCOL_CBI 

Control/Bulk/Interrupt protocol (with command completion interrupt)

MSC_PROTOCOL_CBI_NO_INTERRUPT 

Control/Bulk/Interrupt protocol (without command completion interrupt)

MSC_PROTOCOL_BOT 

Bulk-Only Transport.

Definition at line 75 of file msc.h.

MassStorage Class-Specific Control Request.

Enumerator
MSC_REQUEST_GET_MAX_LUN 

The Get Max LUN device request is used to determine the number of logical units supported by the device. Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15.

MSC_REQUEST_RESET 

This request is used to reset the mass storage device and its associated interface. This class-specific request shall ready the device for the next CBW from the host.

Definition at line 82 of file msc.h.

MassStorage Subclass.

Enumerator
MSC_SUBCLASS_RBC 

Reduced Block Commands (RBC) T10 Project 1240-D.

MSC_SUBCLASS_SFF_MMC 

SFF-8020i, MMC-2 (ATAPI). Typically used by a CD/DVD device.

MSC_SUBCLASS_QIC 

QIC-157. Typically used by a tape device.

MSC_SUBCLASS_UFI 

UFI. Typically used by Floppy Disk Drive (FDD) device.

MSC_SUBCLASS_SFF 

SFF-8070i. Can be used by Floppy Disk Drive (FDD) device.

MSC_SUBCLASS_SCSI 

SCSI transparent command set.

Definition at line 59 of file msc.h.

SCSI Command Operation Code.

Enumerator
SCSI_CMD_TEST_UNIT_READY 

The SCSI Test Unit Ready command is used to determine if a device is ready to transfer data (read/write), i.e. if a disk has spun up, if a tape is loaded and ready etc. The device does not perform a self-test operation.

SCSI_CMD_INQUIRY 

The SCSI Inquiry command is used to obtain basic information from a target device.

SCSI_CMD_MODE_SELECT_6 

provides a means for the application client to specify medium, logical unit, or peripheral device parameters to the device server. Device servers that implement the MODE SELECT(6) command shall also implement the MODE SENSE(6) command. Application clients should issue MODE SENSE(6) prior to each MODE SELECT(6) to determine supported mode pages, page lengths, and other parameters.

SCSI_CMD_MODE_SENSE_6 

provides a means for a device server to report parameters to an application client. It is a complementary command to the MODE SELECT(6) command. Device servers that implement the MODE SENSE(6) command shall also implement the MODE SELECT(6) command.

SCSI_CMD_READ_CAPACITY_10 

The SCSI Read Capacity command is used to obtain data capacity information from a target device.

SCSI_CMD_REQUEST_SENSE 

The SCSI Request Sense command is part of the SCSI computer protocol standard. This command is used to obtain sense data – status/error information – from a target device.

SCSI_CMD_READ_FORMAT_CAPACITY 

The command allows the Host to request a list of the possible format capacities for an installed writable media. This command also has the capability to report the writable capacity for a media when it is installed.

SCSI_CMD_READ_10 

The READ (10) command requests that the device server read the specified logical block(s) and transfer them to the data-in buffer.

SCSI_CMD_WRITE_10 

The WRITE (10) command requests thatthe device server transfer the specified logical block(s) from the data-out buffer and write them.

Definition at line 124 of file msc.h.

SCSI Sense Key.

Enumerator
SCSI_SENSEKEY_NONE 

no specific Sense Key. This would be the case for a successful command

SCSI_SENSEKEY_RECOVERED_ERROR 

ndicates the last command completed successfully with some recovery action performed by the disc drive.

SCSI_SENSEKEY_NOT_READY 

Indicates the logical unit addressed cannot be accessed.

SCSI_SENSEKEY_MEDIUM_ERROR 

Indicates the command terminated with a non-recovered error condition.

SCSI_SENSEKEY_HARDWARE_ERROR 

Indicates the disc drive detected a nonrecoverable hardware failure while performing the command or during a self test.

SCSI_SENSEKEY_ILLEGLA_REQUEST 

Indicates an illegal parameter in the command descriptor block or in the additional parameters.

SCSI_SENSEKEY_UNIT_ATTENTION 

Indicates the disc drive may have been reset.

SCSI_SENSEKEY_DATA_PROTECT 

Indicates that a command that reads or writes the medium was attempted on a block that is protected from this operation. The read or write operation is not performed.

SCSI_SENSEKEY_FIRMWARE_ERROR 

Vendor specific sense key.

SCSI_SENSEKEY_ABORTED_COMMAND 

Indicates the disc drive aborted the command.

SCSI_SENSEKEY_EQUAL 

Indicates a SEARCH DATA command has satisfied an equal comparison.

SCSI_SENSEKEY_VOLUME_OVERFLOW 

Indicates a buffered peripheral device has reached the end of medium partition and data remains in the buffer that has not been written to the medium.

SCSI_SENSEKEY_MISCOMPARE 

ndicates that the source data did not match the data read from the medium.

Definition at line 138 of file msc.h.