tinyusb
msc.h File Reference
#include "common/common.h"

Go to the source code of this file.

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

Author
hathach (tinyusb.org)

LICENSE

Software License Agreement (BSD License)

Copyright (c) 2013, hathach (tinyusb.org) All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This file is part of the tinyusb stack.