Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SCSI Primary Commands protocol definitions

Data Structures

struct  scsi_inquiry_data
 SCSI Standard Inquiry data structure. More...
 
struct  scsi_mode_page_0_header
 SCSI Page_0 Mode Page header (SPF not set) More...
 
struct  scsi_mode_param_header10
 SCSI Mode Parameter Header used by MODE SELECT(10) and MODE SENSE(10) More...
 
struct  scsi_mode_param_header6
 SCSI Mode Parameter Header used by MODE SELECT(6) and MODE SENSE(6) More...
 
struct  scsi_request_sense_data
 SCSI Standard Request sense data structure. More...
 
struct  spc_control_page_info_execpt
 SPC-2 Informational exceptions control page See chapter 8.3.8. More...
 

Macros

#define SCSI_VPD_CODE_SET_ASCII   2
 
#define SCSI_VPD_CODE_SET_BINARY   1
 
#define SCSI_VPD_CODE_SET_UTF8   3
 
#define SCSI_VPD_HEADER_SIZE   4
 
#define SCSI_VPD_ID_HEADER_SIZE   4
 
#define SCSI_VPD_ID_TYPE_T10   1
 

Enumerations

enum  scsi_asc_ascq {
  SCSI_ASC_NO_ADDITIONAL_SENSE_INFO = 0x0000,
  SCSI_ASC_LU_NOT_READY_REBUILD_IN_PROGRESS = 0x0405,
  SCSI_ASC_WRITE_ERROR = 0x0c00,
  SCSI_ASC_UNRECOVERED_READ_ERROR = 0x1100,
  SCSI_ASC_INVALID_COMMAND_OPERATION_CODE = 0x2000,
  SCSI_ASC_INVALID_FIELD_IN_CDB = 0x2400,
  SCSI_ASC_WRITE_PROTECTED = 0x2700,
  SCSI_ASC_NOT_READY_TO_READY_CHANGE = 0x2800,
  SCSI_ASC_MEDIUM_NOT_PRESENT = 0x3A00,
  SCSI_ASC_INTERNAL_TARGET_FAILURE = 0x4400
}
 
enum  scsi_sense_key {
  SCSI_SK_NO_SENSE = 0x0,
  SCSI_SK_RECOVERED_ERROR = 0x1,
  SCSI_SK_NOT_READY = 0x2,
  SCSI_SK_MEDIUM_ERROR = 0x3,
  SCSI_SK_HARDWARE_ERROR = 0x4,
  SCSI_SK_ILLEGAL_REQUEST = 0x5,
  SCSI_SK_UNIT_ATTENTION = 0x6,
  SCSI_SK_DATA_PROTECT = 0x7,
  SCSI_SK_BLANK_CHECK = 0x8,
  SCSI_SK_VENDOR_SPECIFIC = 0x9,
  SCSI_SK_COPY_ABORTED = 0xa,
  SCSI_SK_ABORTED_COMMAND = 0xb,
  SCSI_SK_VOLUME_OVERFLOW = 0xd,
  SCSI_SK_MISCOMPARE = 0xe
}
 
enum  scsi_spc_mode {
  SCSI_MS_MODE_VENDOR_SPEC = 0x00,
  SCSI_MS_MODE_INFEXP = 0x1C,
  SCSI_MS_MODE_ALL = 0x3f
}
 SPC-2 Mode parameter This subclause describes the block descriptors and the pages used with MODE SELECT and MODE SENSE commands that are applicable to all SCSI devices. More...
 
enum  scsi_spc_mode_sense_pc {
  SCSI_MS_SENSE_PC_CURRENT = 0,
  SCSI_MS_SENSE_PC_CHANGEABLE = 1,
  SCSI_MS_SENSE_PC_DEFAULT = 2,
  SCSI_MS_SENSE_PC_SAVED = 3
}
 
enum  scsi_vpd_page_code {
  SCSI_VPD_SUPPORTED_PAGES = 0x00,
  SCSI_VPD_UNIT_SERIAL_NUMBER = 0x80,
  SCSI_VPD_DEVICE_IDENTIFICATION = 0x83
}
 

Functions

static bool scsi_mode_sense_dbd_is_set (const uint8_t *cdb)
 
static uint8_t scsi_mode_sense_get_page_code (const uint8_t *cdb)
 
static uint8_t scsi_mode_sense_get_pc (const uint8_t *cdb)
 

SCSI commands defined by SPC-2

#define SPC_TEST_UNIT_READY   0x00
 
#define SPC_REQUEST_SENSE   0x03
 
#define SPC_INQUIRY   0x12
 
#define SPC_MODE_SELECT6   0x15
 
#define SPC_MODE_SENSE6   0x1A
 
#define SPC_SEND_DIAGNOSTIC   0x1D
 
#define SPC_PREVENT_ALLOW_MEDIUM_REMOVAL   0x1E
 
#define SPC_MODE_SENSE10   0x5A
 
#define SPC_REPORT_LUNS   0xA0
 
#define SCSI_INQ_REQ_EVPD   0x01
 May be set in byte 0 of the INQUIRY CDB. More...
 
#define SCSI_INQ_REQ_CMDT   0x02
 Command Support Data specified by the PAGE OR OPERATION CODE field. More...
 

#define SCSI_INQ_REQ_CMDT   0x02

Command Support Data specified by the PAGE OR OPERATION CODE field.

Referenced by udi_msc_spc_inquiry().

#define SCSI_INQ_REQ_EVPD   0x01

May be set in byte 0 of the INQUIRY CDB.

Enable Vital Product Data

Referenced by udi_msc_spc_inquiry().

#define SCSI_VPD_CODE_SET_ASCII   2
#define SCSI_VPD_CODE_SET_BINARY   1
#define SCSI_VPD_CODE_SET_UTF8   3
#define SCSI_VPD_HEADER_SIZE   4
#define SCSI_VPD_ID_HEADER_SIZE   4
#define SCSI_VPD_ID_TYPE_T10   1
#define SPC_INQUIRY   0x12
#define SPC_MODE_SELECT6   0x15
#define SPC_MODE_SENSE10   0x5A

Referenced by udi_msc_cbw_received().

#define SPC_MODE_SENSE6   0x1A
#define SPC_PREVENT_ALLOW_MEDIUM_REMOVAL   0x1E

Referenced by udi_msc_cbw_received().

#define SPC_REPORT_LUNS   0xA0
#define SPC_REQUEST_SENSE   0x03
#define SPC_SEND_DIAGNOSTIC   0x1D
#define SPC_TEST_UNIT_READY   0x00

Enumerator
SCSI_ASC_NO_ADDITIONAL_SENSE_INFO 
SCSI_ASC_LU_NOT_READY_REBUILD_IN_PROGRESS 
SCSI_ASC_WRITE_ERROR 
SCSI_ASC_UNRECOVERED_READ_ERROR 
SCSI_ASC_INVALID_COMMAND_OPERATION_CODE 
SCSI_ASC_INVALID_FIELD_IN_CDB 
SCSI_ASC_WRITE_PROTECTED 
SCSI_ASC_NOT_READY_TO_READY_CHANGE 
SCSI_ASC_MEDIUM_NOT_PRESENT 
SCSI_ASC_INTERNAL_TARGET_FAILURE 
Enumerator
SCSI_SK_NO_SENSE 
SCSI_SK_RECOVERED_ERROR 
SCSI_SK_NOT_READY 
SCSI_SK_MEDIUM_ERROR 
SCSI_SK_HARDWARE_ERROR 
SCSI_SK_ILLEGAL_REQUEST 
SCSI_SK_UNIT_ATTENTION 
SCSI_SK_DATA_PROTECT 
SCSI_SK_BLANK_CHECK 
SCSI_SK_VENDOR_SPECIFIC 
SCSI_SK_COPY_ABORTED 
SCSI_SK_ABORTED_COMMAND 
SCSI_SK_VOLUME_OVERFLOW 
SCSI_SK_MISCOMPARE 

SPC-2 Mode parameter This subclause describes the block descriptors and the pages used with MODE SELECT and MODE SENSE commands that are applicable to all SCSI devices.

Enumerator
SCSI_MS_MODE_VENDOR_SPEC 
SCSI_MS_MODE_INFEXP 
SCSI_MS_MODE_ALL 
Enumerator
SCSI_MS_SENSE_PC_CURRENT 
SCSI_MS_SENSE_PC_CHANGEABLE 
SCSI_MS_SENSE_PC_DEFAULT 
SCSI_MS_SENSE_PC_SAVED 
Enumerator
SCSI_VPD_SUPPORTED_PAGES 
SCSI_VPD_UNIT_SERIAL_NUMBER 
SCSI_VPD_DEVICE_IDENTIFICATION 

static bool scsi_mode_sense_dbd_is_set ( const uint8_t *  cdb)
inlinestatic
static uint8_t scsi_mode_sense_get_page_code ( const uint8_t *  cdb)
inlinestatic
static uint8_t scsi_mode_sense_get_pc ( const uint8_t *  cdb)
inlinestatic