SCSI protocol definitions for USBUS. More...
SCSI protocol definitions for USBUS.
Definition in file scsi.h.
#include "byteorder.h"
Go to the source code of this file.
Data Structures | |
struct | msc_test_unit_pkt_t |
Packet structure to answer (SCSI_TEST_UNIT_READY) request. More... | |
struct | msc_mode_parameter_pkt_t |
Packet structure to answer (SCSI_MODE_SELECT6) and (SCSI_MODE_SENSE6) requests. More... | |
struct | msc_cbw_rw10_pkt_t |
CBW Packet structure for (SCSI_READ10) and (SCSI_WRITE10) requests. More... | |
struct | msc_inquiry_pkt_t |
Packet structure to answer (SCSI_INQUIRY) request. More... | |
struct | msc_read_fmt_capa_pkt_t |
Packet structure to answer (SCSI_READ_FORMAT_CAPACITIES) request. More... | |
struct | msc_request_sense_pkt_t |
Packet structure to answer (SCSI_REQUEST_SENSE) request. More... | |
struct | msc_read_capa_pkt_t |
Packet structure to answer (SCSI_READ_CAPACITY) request. More... | |
struct | msc_cbw_buf_t |
Command Block Wrapper packet structure. More... | |
struct | msc_csw_buf_t |
Command Status Wrapper packet structure. More... | |
struct | cbw_info_t |
USBUS Command Block Wrapper information. More... | |
Macros | |
#define | SCSI_CBW_SIGNATURE 0x43425355 |
Command Block Wrapper signature. | |
#define | SCSI_CSW_SIGNATURE 0x53425355 |
Command Status Wrapper signature. | |
#define | SCSI_REQUEST_SENSE_ERROR 0x70 |
SCSI Request Sense error type. | |
Functions | |
void | usbus_msc_scsi_process_cmd (usbus_t *usbus, usbus_handler_t *handler, usbdev_ep_t *ep, size_t len) |
Process incoming Command Block Wrapper buffer. More... | |
void | scsi_gen_csw (usbus_handler_t *handler, cbw_info_t *cmd) |
Generate Command Status Wrapper and send it to the host. More... | |
#define | USBUS_MSC_VENDOR_ID "RIOT-OS" |
#define | USBUS_MSC_PRODUCT_ID "RIOT_MSC_DISK " |
#define | USBUS_MSC_PRODUCT_REV " 1.0" |
USB SCSI Commands | |
| |
#define | SCSI_TEST_UNIT_READY 0x00 |
SCSI Test Unit Ready. | |
#define | SCSI_REQUEST_SENSE 0x03 |
SCSI Request Sense. | |
#define | SCSI_FORMAT_UNIT 0x04 |
SCSI Format Unit. | |
#define | SCSI_INQUIRY 0x12 |
SCSI Inquiry. | |
#define | SCSI_MODE_SELECT6 0x15 |
SCSI Mode Select6. | |
#define | SCSI_MODE_SENSE6 0x1A |
SCSI Mode Sense6. | |
#define | SCSI_START_STOP_UNIT 0x1B |
SCSI Start Stop Unit. | |
#define | SCSI_MEDIA_REMOVAL 0x1E |
SCSI Media Removal. | |
#define | SCSI_READ_FORMAT_CAPACITIES 0x23 |
SCSI Read Format Capacities. | |
#define | SCSI_READ_CAPACITY 0x25 |
SCSI Read Capacity. | |
#define | SCSI_READ10 0x28 |
SCSI Read10. | |
#define | SCCI_READ12 0xA8 |
SCSI Read12. | |
#define | SCSI_WRITE10 0x2A |
SCSI Write10. | |
#define | SCSI_WRITE12 0xAA |
SCSI Write12. | |
#define | SCSI_SEEK 0x2B |
SCSI Seek. | |
#define | SCSI_WRITE_AND_VERIFY 0x2E |
SCSI Write and Verify. | |
#define | SCSI_VERIFY10 0x2F |
SCSI Verify10. | |
#define | SCSI_MODE_SELECT10 0x55 |
SCSI Mode Select10. | |
#define | SCSI_MODE_SENSE10 0x5A |
SCSI Mode Sense10. | |
USB SCSI Version list | |
#define | SCSI_VERSION_NONE 0x0000 |
#define | SCSI_VERSION_SCSI1 0x0001 |
#define | SCSI_VERSION_SCSI2 0x0002 |
USB SCSI Read format capacities descriptor type | |
| |
#define | SCSI_READ_FMT_CAPA_TYPE_RESERVED 0x00 |
#define | SCSI_READ_FMT_CAPA_TYPE_UNFORMATTED 0x01 |
#define | SCSI_READ_FMT_CAPA_TYPE_FORMATTED 0x02 |
#define | SCSI_READ_FMT_CAPA_TYPE_NO_MEDIA 0x03 |
void scsi_gen_csw | ( | usbus_handler_t * | handler, |
cbw_info_t * | cmd | ||
) |
Generate Command Status Wrapper and send it to the host.
handler | MSC device struct |
cmd | struct containing needed information to generate CBW response |
void usbus_msc_scsi_process_cmd | ( | usbus_t * | usbus, |
usbus_handler_t * | handler, | ||
usbdev_ep_t * | ep, | ||
size_t | len | ||
) |
Process incoming Command Block Wrapper buffer.
usbus | USBUS thread to use |
handler | MSC device struct |
ep | Endpoint pointer to read CBW from |
len | Size of the received CBW buffer |