Prusa MINI Firmware overview
masstorage.h File Reference
#include "Usb.h"

Go to the source code of this file.

Classes

struct  Capacity
 
struct  BASICCDB
 
struct  CDB6
 
struct  CDB10
 
struct  CDB12
 
struct  CDB_LBA32_16
 
struct  CDB_LBA64_16
 
struct  InquiryResponse
 
struct  CommandBlockWrapperBase
 
struct  CommandBlockWrapper
 
struct  CommandStatusWrapper
 
struct  RequestSenseResponce
 
class  BulkOnly
 

Macros

#define MS_WANT_PARSER   0
 
#define bmREQ_MASSOUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define bmREQ_MASSIN   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define MASS_SUBCLASS_SCSI_NOT_REPORTED   0x00
 
#define MASS_SUBCLASS_RBC   0x01
 
#define MASS_SUBCLASS_ATAPI   0x02
 
#define MASS_SUBCLASS_OBSOLETE1   0x03
 
#define MASS_SUBCLASS_UFI   0x04
 
#define MASS_SUBCLASS_OBSOLETE2   0x05
 
#define MASS_SUBCLASS_SCSI   0x06
 
#define MASS_SUBCLASS_LSDFS   0x07
 
#define MASS_SUBCLASS_IEEE1667   0x08
 
#define MASS_PROTO_CBI   0x00
 
#define MASS_PROTO_CBI_NO_INT   0x01
 
#define MASS_PROTO_OBSOLETE   0x02
 
#define MASS_PROTO_BBB   0x50
 
#define MASS_PROTO_UAS   0x62
 
#define MASS_REQ_ADSC   0x00
 
#define MASS_REQ_GET   0xFC
 
#define MASS_REQ_PUT   0xFD
 
#define MASS_REQ_GET_MAX_LUN   0xFE
 
#define MASS_REQ_BOMSR   0xFF
 
#define MASS_CBW_SIGNATURE   0x43425355
 
#define MASS_CSW_SIGNATURE   0x53425355
 
#define MASS_CMD_DIR_OUT   0
 
#define MASS_CMD_DIR_IN   0x80
 
#define SCSI_CMD_TEST_UNIT_READY   0x00
 
#define SCSI_CMD_REQUEST_SENSE   0x03
 
#define SCSI_CMD_FORMAT_UNIT   0x04
 
#define SCSI_CMD_READ_6   0x08
 
#define SCSI_CMD_WRITE_6   0x0A
 
#define SCSI_CMD_INQUIRY   0x12
 
#define SCSI_CMD_MODE_SELECT_6   0x15
 
#define SCSI_CMD_MODE_SENSE_6   0x1A
 
#define SCSI_CMD_START_STOP_UNIT   0x1B
 
#define SCSI_CMD_PREVENT_REMOVAL   0x1E
 
#define SCSI_CMD_READ_FORMAT_CAPACITIES   0x23
 
#define SCSI_CMD_READ_CAPACITY_10   0x25
 
#define SCSI_CMD_READ_10   0x28
 
#define SCSI_CMD_WRITE_10   0x2A
 
#define SCSI_CMD_SEEK_10   0x2B
 
#define SCSI_CMD_ERASE_10   0x2C
 
#define SCSI_CMD_WRITE_AND_VERIFY_10   0x2E
 
#define SCSI_CMD_VERIFY_10   0x2F
 
#define SCSI_CMD_SYNCHRONIZE_CACHE   0x35
 
#define SCSI_CMD_WRITE_BUFFER   0x3B
 
#define SCSI_CMD_READ_BUFFER   0x3C
 
#define SCSI_CMD_READ_SUBCHANNEL   0x42
 
#define SCSI_CMD_READ_TOC   0x43
 
#define SCSI_CMD_READ_HEADER   0x44
 
#define SCSI_CMD_PLAY_AUDIO_10   0x45
 
#define SCSI_CMD_GET_CONFIGURATION   0x46
 
#define SCSI_CMD_PLAY_AUDIO_MSF   0x47
 
#define SCSI_CMD_PLAY_AUDIO_TI   0x48
 
#define SCSI_CMD_PLAY_TRACK_REL_10   0x49
 
#define SCSI_CMD_GET_EVENT_STATUS   0x4A
 
#define SCSI_CMD_PAUSE_RESUME   0x4B
 
#define SCSI_CMD_READ_DISC_INFORMATION   0x51
 
#define SCSI_CMD_READ_TRACK_INFORMATION   0x52
 
#define SCSI_CMD_RESERVE_TRACK   0x53
 
#define SCSI_CMD_SEND_OPC_INFORMATION   0x54
 
#define SCSI_CMD_MODE_SELECT_10   0x55
 
#define SCSI_CMD_REPAIR_TRACK   0x58
 
#define SCSI_CMD_MODE_SENSE_10   0x5A
 
#define SCSI_CMD_CLOSE_TRACK_SESSION   0x5B
 
#define SCSI_CMD_READ_BUFFER_CAPACITY   0x5C
 
#define SCSI_CMD_SEND_CUE_SHEET   0x5D
 
#define SCSI_CMD_REPORT_LUNS   0xA0
 
#define SCSI_CMD_BLANK   0xA1
 
#define SCSI_CMD_SECURITY_PROTOCOL_IN   0xA2
 
#define SCSI_CMD_SEND_KEY   0xA3
 
#define SCSI_CMD_REPORT_KEY   0xA4
 
#define SCSI_CMD_PLAY_AUDIO_12   0xA5
 
#define SCSI_CMD_LOAD_UNLOAD   0xA6
 
#define SCSI_CMD_SET_READ_AHEAD   0xA7
 
#define SCSI_CMD_READ_12   0xA8
 
#define SCSI_CMD_PLAY_TRACK_REL_12   0xA9
 
#define SCSI_CMD_WRITE_12   0xAA
 
#define SCSI_CMD_READ_MEDIA_SERIAL_12   0xAB
 
#define SCSI_CMD_GET_PERFORMANCE   0xAC
 
#define SCSI_CMD_READ_DVD_STRUCTURE   0xAD
 
#define SCSI_CMD_SECURITY_PROTOCOL_OUT   0xB5
 
#define SCSI_CMD_SET_STREAMING   0xB6
 
#define SCSI_CMD_READ_MSF   0xB9
 
#define SCSI_CMD_SET_SPEED   0xBB
 
#define SCSI_CMD_MECHANISM_STATUS   0xBD
 
#define SCSI_CMD_READ_CD   0xBE
 
#define SCSI_CMD_SEND_DISC_STRUCTURE   0xBF
 
#define SCSI_CMD_CD_PLAYBACK_STATUS   0xC4 /* SONY unique */
 
#define SCSI_CMD_PLAYBACK_CONTROL   0xC9 /* SONY unique */
 
#define SCSI_CMD_READ_CDDA   0xD8 /* Vendor unique */
 
#define SCSI_CMD_READ_CDXA   0xDB /* Vendor unique */
 
#define SCSI_CMD_READ_ALL_SUBCODES   0xDF /* Vendor unique */
 
#define SCSI_S_NOT_READY   0x02
 
#define SCSI_S_MEDIUM_ERROR   0x03
 
#define SCSI_S_ILLEGAL_REQUEST   0x05
 
#define SCSI_S_UNIT_ATTENTION   0x06
 
#define SCSI_ASC_LBA_OUT_OF_RANGE   0x21
 
#define SCSI_ASC_MEDIA_CHANGED   0x28
 
#define SCSI_ASC_MEDIUM_NOT_PRESENT   0x3A
 
#define MASS_ERR_SUCCESS   0x00
 
#define MASS_ERR_PHASE_ERROR   0x02
 
#define MASS_ERR_UNIT_NOT_READY   0x03
 
#define MASS_ERR_UNIT_BUSY   0x04
 
#define MASS_ERR_STALL   0x05
 
#define MASS_ERR_CMD_NOT_SUPPORTED   0x06
 
#define MASS_ERR_INVALID_CSW   0x07
 
#define MASS_ERR_NO_MEDIA   0x08
 
#define MASS_ERR_BAD_LBA   0x09
 
#define MASS_ERR_MEDIA_CHANGED   0x0A
 
#define MASS_ERR_DEVICE_DISCONNECTED   0x11
 
#define MASS_ERR_UNABLE_TO_RECOVER   0x12
 
#define MASS_ERR_INVALID_LUN   0x13
 
#define MASS_ERR_WRITE_STALL   0x14
 
#define MASS_ERR_READ_NAKS   0x15
 
#define MASS_ERR_WRITE_NAKS   0x16
 
#define MASS_ERR_WRITE_PROTECTED   0x17
 
#define MASS_ERR_NOT_IMPLEMENTED   0xFD
 
#define MASS_ERR_GENERAL_SCSI_ERROR   0xFE
 
#define MASS_ERR_GENERAL_USB_ERROR   0xFF
 
#define MASS_ERR_USER   0xA0
 
#define MASS_TRANS_FLG_CALLBACK   0x01
 
#define MASS_TRANS_FLG_NO_STALL_CHECK   0x02
 
#define MASS_TRANS_FLG_NO_PHASE_CHECK   0x04
 
#define MASS_MAX_ENDPOINTS   3
 

Typedefs

typedef BASICCDB BASICCDB_t
 
typedef CDB6 CDB6_t
 
typedef CDB10 CDB10_t
 
typedef CDB12 CDB12_t
 

Functions

struct Capacity __attribute__ ((packed))
 
 CDB6 (uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control)
 
 CDB6 (uint8_t _Opcode, uint8_t _LUN, uint8_t _AllocationLength, uint8_t _Control)
 
 CDB10 (uint8_t _Opcode, uint8_t _LUN)
 
 CDB10 (uint8_t _Opcode, uint8_t _LUN, uint16_t xflen, uint32_t _LBA)
 
 CommandBlockWrapperBase ()
 
 CommandBlockWrapperBase (uint32_t tag, uint32_t xflen, uint8_t flgs)
 
 CommandBlockWrapper ()
 
 CommandBlockWrapper (uint32_t tag, uint32_t xflen, uint8_t flgs, uint8_t lu, uint8_t cmdlen, uint8_t cmd)
 
 CommandBlockWrapper (uint32_t tag, uint32_t xflen, CDB6_t *cdb, uint8_t dir)
 
 CommandBlockWrapper (uint32_t tag, uint32_t xflen, CDB10_t *cdb, uint8_t dir)
 

Variables

uint8_t data [8]
 
uint8_t Opcode
 
unsigned unused
 
unsigned LUN
 
uint8_t info [12]
 
unsigned LBAMSB
 
uint8_t LBAHB
 
uint8_t LBALB
 
uint8_t AllocationLength
 
uint8_t Control
 
unsigned Service_Action
 
uint8_t LBA_L_M_MB
 
uint8_t LBA_L_M_LB
 
uint8_t LBA_L_L_MB
 
uint8_t LBA_L_L_LB
 
uint8_t Misc2
 
uint8_t ALC_MB
 
uint8_t ALC_LB
 
unsigned Misc
 
uint8_t ALC_M_LB
 
uint8_t ALC_L_MB
 
uint8_t ALC_L_LB
 
uint8_t A_M_M_MB
 
uint8_t A_M_M_LB
 
uint8_t A_M_L_MB
 
uint8_t A_M_L_LB
 
uint8_t ALC_M_MB
 
uint8_t LBA_M_M_MB
 
uint8_t LBA_M_M_LB
 
uint8_t LBA_M_L_MB
 
uint8_t LBA_M_L_LB
 
uint8_t DeviceType
 
uint8_t PeripheralQualifier
 
unsigned Reserved
 
unsigned Removable
 
uint8_t Version
 
unsigned ResponseDataFormat
 
unsigned HISUP
 
unsigned NormACA
 
unsigned TrmTsk
 
unsigned AERC
 
uint8_t AdditionalLength
 
unsigned PROTECT
 
unsigned Res
 
unsigned ThreePC
 
unsigned TPGS
 
unsigned ACC
 
unsigned SCCS
 
unsigned ADDR16
 
unsigned R1
 
unsigned R2
 
unsigned MCHNGR
 
unsigned MULTIP
 
unsigned VS
 
unsigned ENCSERV
 
unsigned BQUE
 
unsigned SoftReset
 
unsigned CmdQue
 
unsigned Reserved4
 
unsigned Linked
 
unsigned Sync
 
unsigned WideBus16Bit
 
unsigned WideBus32Bit
 
unsigned RelAddr
 
uint8_t VendorID [8]
 
uint8_t ProductID [16]
 
uint8_t RevisionID [4]
 
uint32_t dCBWSignature
 
uint32_t dCBWTag
 
uint32_t dCBWDataTransferLength
 
uint8_t bmCBWFlags
 
struct {
   uint8_t   bmCBWLUN: 4
 
   uint8_t   bmReserved1: 4
 
}; 
 
struct {
   uint8_t   bmCBWCBLength: 4
 
   uint8_t   bmReserved2: 4
 
}; 
 
uint8_t CBWCB [16]
 
uint32_t dCSWSignature
 
uint32_t dCSWTag
 
uint32_t dCSWDataResidue
 
uint8_t bCSWStatus
 
uint8_t bResponseCode
 
uint8_t bSegmentNumber
 
uint8_t bmSenseKey
 
uint8_t bmReserved
 
uint8_t bmILI
 
uint8_t bmEOM
 
uint8_t bmFileMark
 
uint8_t Information [4]
 
uint8_t bAdditionalLength
 
uint8_t CmdSpecificInformation [4]
 
uint8_t bAdditionalSenseCode
 
uint8_t bAdditionalSenseQualifier
 
uint8_t bFieldReplaceableUnitCode
 
uint8_t SenseKeySpecific [3]
 
BulkOnly __attribute__
 

Macro Definition Documentation

◆ MS_WANT_PARSER

#define MS_WANT_PARSER   0

Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Contact information

Circuits At Home, LTD Web : http://www.circuitsathome.com e-mail : suppo.nosp@m.rt@c.nosp@m.ircui.nosp@m.tsat.nosp@m.home..nosp@m.com

◆ bmREQ_MASSOUT

◆ bmREQ_MASSIN

◆ MASS_SUBCLASS_SCSI_NOT_REPORTED

#define MASS_SUBCLASS_SCSI_NOT_REPORTED   0x00

◆ MASS_SUBCLASS_RBC

#define MASS_SUBCLASS_RBC   0x01

◆ MASS_SUBCLASS_ATAPI

#define MASS_SUBCLASS_ATAPI   0x02

◆ MASS_SUBCLASS_OBSOLETE1

#define MASS_SUBCLASS_OBSOLETE1   0x03

◆ MASS_SUBCLASS_UFI

#define MASS_SUBCLASS_UFI   0x04

◆ MASS_SUBCLASS_OBSOLETE2

#define MASS_SUBCLASS_OBSOLETE2   0x05

◆ MASS_SUBCLASS_SCSI

#define MASS_SUBCLASS_SCSI   0x06

◆ MASS_SUBCLASS_LSDFS

#define MASS_SUBCLASS_LSDFS   0x07

◆ MASS_SUBCLASS_IEEE1667

#define MASS_SUBCLASS_IEEE1667   0x08

◆ MASS_PROTO_CBI

#define MASS_PROTO_CBI   0x00

◆ MASS_PROTO_CBI_NO_INT

#define MASS_PROTO_CBI_NO_INT   0x01

◆ MASS_PROTO_OBSOLETE

#define MASS_PROTO_OBSOLETE   0x02

◆ MASS_PROTO_BBB

#define MASS_PROTO_BBB   0x50

◆ MASS_PROTO_UAS

#define MASS_PROTO_UAS   0x62

◆ MASS_REQ_ADSC

#define MASS_REQ_ADSC   0x00

◆ MASS_REQ_GET

#define MASS_REQ_GET   0xFC

◆ MASS_REQ_PUT

#define MASS_REQ_PUT   0xFD

◆ MASS_REQ_GET_MAX_LUN

#define MASS_REQ_GET_MAX_LUN   0xFE

◆ MASS_REQ_BOMSR

#define MASS_REQ_BOMSR   0xFF

◆ MASS_CBW_SIGNATURE

#define MASS_CBW_SIGNATURE   0x43425355

◆ MASS_CSW_SIGNATURE

#define MASS_CSW_SIGNATURE   0x53425355

◆ MASS_CMD_DIR_OUT

#define MASS_CMD_DIR_OUT   0

◆ MASS_CMD_DIR_IN

#define MASS_CMD_DIR_IN   0x80

◆ SCSI_CMD_TEST_UNIT_READY

#define SCSI_CMD_TEST_UNIT_READY   0x00

◆ SCSI_CMD_REQUEST_SENSE

#define SCSI_CMD_REQUEST_SENSE   0x03

◆ SCSI_CMD_FORMAT_UNIT

#define SCSI_CMD_FORMAT_UNIT   0x04

◆ SCSI_CMD_READ_6

#define SCSI_CMD_READ_6   0x08

◆ SCSI_CMD_WRITE_6

#define SCSI_CMD_WRITE_6   0x0A

◆ SCSI_CMD_INQUIRY

#define SCSI_CMD_INQUIRY   0x12

◆ SCSI_CMD_MODE_SELECT_6

#define SCSI_CMD_MODE_SELECT_6   0x15

◆ SCSI_CMD_MODE_SENSE_6

#define SCSI_CMD_MODE_SENSE_6   0x1A

◆ SCSI_CMD_START_STOP_UNIT

#define SCSI_CMD_START_STOP_UNIT   0x1B

◆ SCSI_CMD_PREVENT_REMOVAL

#define SCSI_CMD_PREVENT_REMOVAL   0x1E

◆ SCSI_CMD_READ_FORMAT_CAPACITIES

#define SCSI_CMD_READ_FORMAT_CAPACITIES   0x23

◆ SCSI_CMD_READ_CAPACITY_10

#define SCSI_CMD_READ_CAPACITY_10   0x25

◆ SCSI_CMD_READ_10

#define SCSI_CMD_READ_10   0x28

◆ SCSI_CMD_WRITE_10

#define SCSI_CMD_WRITE_10   0x2A

◆ SCSI_CMD_SEEK_10

#define SCSI_CMD_SEEK_10   0x2B

◆ SCSI_CMD_ERASE_10

#define SCSI_CMD_ERASE_10   0x2C

◆ SCSI_CMD_WRITE_AND_VERIFY_10

#define SCSI_CMD_WRITE_AND_VERIFY_10   0x2E

◆ SCSI_CMD_VERIFY_10

#define SCSI_CMD_VERIFY_10   0x2F

◆ SCSI_CMD_SYNCHRONIZE_CACHE

#define SCSI_CMD_SYNCHRONIZE_CACHE   0x35

◆ SCSI_CMD_WRITE_BUFFER

#define SCSI_CMD_WRITE_BUFFER   0x3B

◆ SCSI_CMD_READ_BUFFER

#define SCSI_CMD_READ_BUFFER   0x3C

◆ SCSI_CMD_READ_SUBCHANNEL

#define SCSI_CMD_READ_SUBCHANNEL   0x42

◆ SCSI_CMD_READ_TOC

#define SCSI_CMD_READ_TOC   0x43

◆ SCSI_CMD_READ_HEADER

#define SCSI_CMD_READ_HEADER   0x44

◆ SCSI_CMD_PLAY_AUDIO_10

#define SCSI_CMD_PLAY_AUDIO_10   0x45

◆ SCSI_CMD_GET_CONFIGURATION

#define SCSI_CMD_GET_CONFIGURATION   0x46

◆ SCSI_CMD_PLAY_AUDIO_MSF

#define SCSI_CMD_PLAY_AUDIO_MSF   0x47

◆ SCSI_CMD_PLAY_AUDIO_TI

#define SCSI_CMD_PLAY_AUDIO_TI   0x48

◆ SCSI_CMD_PLAY_TRACK_REL_10

#define SCSI_CMD_PLAY_TRACK_REL_10   0x49

◆ SCSI_CMD_GET_EVENT_STATUS

#define SCSI_CMD_GET_EVENT_STATUS   0x4A

◆ SCSI_CMD_PAUSE_RESUME

#define SCSI_CMD_PAUSE_RESUME   0x4B

◆ SCSI_CMD_READ_DISC_INFORMATION

#define SCSI_CMD_READ_DISC_INFORMATION   0x51

◆ SCSI_CMD_READ_TRACK_INFORMATION

#define SCSI_CMD_READ_TRACK_INFORMATION   0x52

◆ SCSI_CMD_RESERVE_TRACK

#define SCSI_CMD_RESERVE_TRACK   0x53

◆ SCSI_CMD_SEND_OPC_INFORMATION

#define SCSI_CMD_SEND_OPC_INFORMATION   0x54

◆ SCSI_CMD_MODE_SELECT_10

#define SCSI_CMD_MODE_SELECT_10   0x55

◆ SCSI_CMD_REPAIR_TRACK

#define SCSI_CMD_REPAIR_TRACK   0x58

◆ SCSI_CMD_MODE_SENSE_10

#define SCSI_CMD_MODE_SENSE_10   0x5A

◆ SCSI_CMD_CLOSE_TRACK_SESSION

#define SCSI_CMD_CLOSE_TRACK_SESSION   0x5B

◆ SCSI_CMD_READ_BUFFER_CAPACITY

#define SCSI_CMD_READ_BUFFER_CAPACITY   0x5C

◆ SCSI_CMD_SEND_CUE_SHEET

#define SCSI_CMD_SEND_CUE_SHEET   0x5D

◆ SCSI_CMD_REPORT_LUNS

#define SCSI_CMD_REPORT_LUNS   0xA0

◆ SCSI_CMD_BLANK

#define SCSI_CMD_BLANK   0xA1

◆ SCSI_CMD_SECURITY_PROTOCOL_IN

#define SCSI_CMD_SECURITY_PROTOCOL_IN   0xA2

◆ SCSI_CMD_SEND_KEY

#define SCSI_CMD_SEND_KEY   0xA3

◆ SCSI_CMD_REPORT_KEY

#define SCSI_CMD_REPORT_KEY   0xA4

◆ SCSI_CMD_PLAY_AUDIO_12

#define SCSI_CMD_PLAY_AUDIO_12   0xA5

◆ SCSI_CMD_LOAD_UNLOAD

#define SCSI_CMD_LOAD_UNLOAD   0xA6

◆ SCSI_CMD_SET_READ_AHEAD

#define SCSI_CMD_SET_READ_AHEAD   0xA7

◆ SCSI_CMD_READ_12

#define SCSI_CMD_READ_12   0xA8

◆ SCSI_CMD_PLAY_TRACK_REL_12

#define SCSI_CMD_PLAY_TRACK_REL_12   0xA9

◆ SCSI_CMD_WRITE_12

#define SCSI_CMD_WRITE_12   0xAA

◆ SCSI_CMD_READ_MEDIA_SERIAL_12

#define SCSI_CMD_READ_MEDIA_SERIAL_12   0xAB

◆ SCSI_CMD_GET_PERFORMANCE

#define SCSI_CMD_GET_PERFORMANCE   0xAC

◆ SCSI_CMD_READ_DVD_STRUCTURE

#define SCSI_CMD_READ_DVD_STRUCTURE   0xAD

◆ SCSI_CMD_SECURITY_PROTOCOL_OUT

#define SCSI_CMD_SECURITY_PROTOCOL_OUT   0xB5

◆ SCSI_CMD_SET_STREAMING

#define SCSI_CMD_SET_STREAMING   0xB6

◆ SCSI_CMD_READ_MSF

#define SCSI_CMD_READ_MSF   0xB9

◆ SCSI_CMD_SET_SPEED

#define SCSI_CMD_SET_SPEED   0xBB

◆ SCSI_CMD_MECHANISM_STATUS

#define SCSI_CMD_MECHANISM_STATUS   0xBD

◆ SCSI_CMD_READ_CD

#define SCSI_CMD_READ_CD   0xBE

◆ SCSI_CMD_SEND_DISC_STRUCTURE

#define SCSI_CMD_SEND_DISC_STRUCTURE   0xBF

◆ SCSI_CMD_CD_PLAYBACK_STATUS

#define SCSI_CMD_CD_PLAYBACK_STATUS   0xC4 /* SONY unique */

◆ SCSI_CMD_PLAYBACK_CONTROL

#define SCSI_CMD_PLAYBACK_CONTROL   0xC9 /* SONY unique */

◆ SCSI_CMD_READ_CDDA

#define SCSI_CMD_READ_CDDA   0xD8 /* Vendor unique */

◆ SCSI_CMD_READ_CDXA

#define SCSI_CMD_READ_CDXA   0xDB /* Vendor unique */

◆ SCSI_CMD_READ_ALL_SUBCODES

#define SCSI_CMD_READ_ALL_SUBCODES   0xDF /* Vendor unique */

◆ SCSI_S_NOT_READY

#define SCSI_S_NOT_READY   0x02

◆ SCSI_S_MEDIUM_ERROR

#define SCSI_S_MEDIUM_ERROR   0x03

◆ SCSI_S_ILLEGAL_REQUEST

#define SCSI_S_ILLEGAL_REQUEST   0x05

◆ SCSI_S_UNIT_ATTENTION

#define SCSI_S_UNIT_ATTENTION   0x06

◆ SCSI_ASC_LBA_OUT_OF_RANGE

#define SCSI_ASC_LBA_OUT_OF_RANGE   0x21

◆ SCSI_ASC_MEDIA_CHANGED

#define SCSI_ASC_MEDIA_CHANGED   0x28

◆ SCSI_ASC_MEDIUM_NOT_PRESENT

#define SCSI_ASC_MEDIUM_NOT_PRESENT   0x3A

◆ MASS_ERR_SUCCESS

#define MASS_ERR_SUCCESS   0x00

◆ MASS_ERR_PHASE_ERROR

#define MASS_ERR_PHASE_ERROR   0x02

◆ MASS_ERR_UNIT_NOT_READY

#define MASS_ERR_UNIT_NOT_READY   0x03

◆ MASS_ERR_UNIT_BUSY

#define MASS_ERR_UNIT_BUSY   0x04

◆ MASS_ERR_STALL

#define MASS_ERR_STALL   0x05

◆ MASS_ERR_CMD_NOT_SUPPORTED

#define MASS_ERR_CMD_NOT_SUPPORTED   0x06

◆ MASS_ERR_INVALID_CSW

#define MASS_ERR_INVALID_CSW   0x07

◆ MASS_ERR_NO_MEDIA

#define MASS_ERR_NO_MEDIA   0x08

◆ MASS_ERR_BAD_LBA

#define MASS_ERR_BAD_LBA   0x09

◆ MASS_ERR_MEDIA_CHANGED

#define MASS_ERR_MEDIA_CHANGED   0x0A

◆ MASS_ERR_DEVICE_DISCONNECTED

#define MASS_ERR_DEVICE_DISCONNECTED   0x11

◆ MASS_ERR_UNABLE_TO_RECOVER

#define MASS_ERR_UNABLE_TO_RECOVER   0x12

◆ MASS_ERR_INVALID_LUN

#define MASS_ERR_INVALID_LUN   0x13

◆ MASS_ERR_WRITE_STALL

#define MASS_ERR_WRITE_STALL   0x14

◆ MASS_ERR_READ_NAKS

#define MASS_ERR_READ_NAKS   0x15

◆ MASS_ERR_WRITE_NAKS

#define MASS_ERR_WRITE_NAKS   0x16

◆ MASS_ERR_WRITE_PROTECTED

#define MASS_ERR_WRITE_PROTECTED   0x17

◆ MASS_ERR_NOT_IMPLEMENTED

#define MASS_ERR_NOT_IMPLEMENTED   0xFD

◆ MASS_ERR_GENERAL_SCSI_ERROR

#define MASS_ERR_GENERAL_SCSI_ERROR   0xFE

◆ MASS_ERR_GENERAL_USB_ERROR

#define MASS_ERR_GENERAL_USB_ERROR   0xFF

◆ MASS_ERR_USER

#define MASS_ERR_USER   0xA0

◆ MASS_TRANS_FLG_CALLBACK

#define MASS_TRANS_FLG_CALLBACK   0x01

◆ MASS_TRANS_FLG_NO_STALL_CHECK

#define MASS_TRANS_FLG_NO_STALL_CHECK   0x02

◆ MASS_TRANS_FLG_NO_PHASE_CHECK

#define MASS_TRANS_FLG_NO_PHASE_CHECK   0x04

◆ MASS_MAX_ENDPOINTS

#define MASS_MAX_ENDPOINTS   3

Typedef Documentation

◆ BASICCDB_t

◆ CDB6_t

typedef CDB6 CDB6_t

◆ CDB10_t

typedef CDB10 CDB10_t

◆ CDB12_t

typedef CDB12 CDB12_t

Function Documentation

◆ __attribute__()

struct Capacity __attribute__ ( (packed)  )

◆ CDB6() [1/2]

__attribute__::CDB6 ( uint8_t  _Opcode,
uint8_t  _LUN,
uint32_t  LBA,
uint8_t  _AllocationLength,
uint8_t  _Control 
)
214  :
215 
216  CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control) :
217  Opcode(_Opcode), LBAMSB(BGRAB2(LBA) & 0x1f), LUN(_LUN), LBAHB(BGRAB1(LBA)), LBALB(BGRAB0(LBA)),

◆ CDB6() [2/2]

__attribute__::CDB6 ( uint8_t  _Opcode,
uint8_t  _LUN,
uint8_t  _AllocationLength,
uint8_t  _Control 
)
221  :
222  Opcode(_Opcode), LBAMSB(0), LUN(_LUN), LBAHB(0), LBALB(0),

◆ CDB10() [1/2]

__attribute__::CDB10 ( uint8_t  _Opcode,
uint8_t  _LUN 
)
246  :
247 
248  CDB10(uint8_t _Opcode, uint8_t _LUN) :
249  Opcode(_Opcode), Service_Action(0), LUN(_LUN),

◆ CDB10() [2/2]

__attribute__::CDB10 ( uint8_t  _Opcode,
uint8_t  _LUN,
uint16_t  xflen,
uint32_t  _LBA 
)
254  :
255  Opcode(_Opcode), Service_Action(0), LUN(_LUN),
256  LBA_L_M_MB(BGRAB3(_LBA)), LBA_L_M_LB(BGRAB2(_LBA)), LBA_L_L_MB(BGRAB1(_LBA)), LBA_L_L_LB(BGRAB0(_LBA)),

◆ CommandBlockWrapperBase() [1/2]

__attribute__::CommandBlockWrapperBase ( )
306  {

◆ CommandBlockWrapperBase() [2/2]

__attribute__::CommandBlockWrapperBase ( uint32_t  tag,
uint32_t  xflen,
uint8_t  flgs 
)
306  {

◆ CommandBlockWrapper() [1/4]

__attribute__::CommandBlockWrapper ( )
306  {

◆ CommandBlockWrapper() [2/4]

__attribute__::CommandBlockWrapper ( uint32_t  tag,
uint32_t  xflen,
uint8_t  flgs,
uint8_t  lu,
uint8_t  cmdlen,
uint8_t  cmd 
)
306  {
307  uint8_t Opcode;
308  uint8_t Misc;
309 

◆ CommandBlockWrapper() [3/4]

__attribute__::CommandBlockWrapper ( uint32_t  tag,
uint32_t  xflen,
CDB6_t cdb,
uint8_t  dir 
)
329  {

◆ CommandBlockWrapper() [4/4]

__attribute__::CommandBlockWrapper ( uint32_t  tag,
uint32_t  xflen,
CDB10_t cdb,
uint8_t  dir 
)
329  {

Variable Documentation

◆ data

uint8_t data[8]

◆ Opcode

uint8_t Opcode

◆ unused

unsigned unused

◆ LUN

unsigned LUN

◆ info

uint8_t info[12]

◆ LBAMSB

unsigned LBAMSB

◆ LBAHB

uint8_t LBAHB

◆ LBALB

uint8_t LBALB

◆ AllocationLength

uint8_t AllocationLength

◆ Control

uint8_t Control

◆ Service_Action

unsigned Service_Action

◆ LBA_L_M_MB

uint8_t LBA_L_M_MB

◆ LBA_L_M_LB

uint8_t LBA_L_M_LB

◆ LBA_L_L_MB

uint8_t LBA_L_L_MB

◆ LBA_L_L_LB

uint8_t LBA_L_L_LB

◆ Misc2

uint8_t Misc2

◆ ALC_MB

uint8_t ALC_MB

◆ ALC_LB

uint8_t ALC_LB

◆ Misc

uint8_t Misc

◆ ALC_M_LB

uint8_t ALC_M_LB

◆ ALC_L_MB

uint8_t ALC_L_MB

◆ ALC_L_LB

uint8_t ALC_L_LB

◆ A_M_M_MB

uint8_t A_M_M_MB

◆ A_M_M_LB

uint8_t A_M_M_LB

◆ A_M_L_MB

uint8_t A_M_L_MB

◆ A_M_L_LB

uint8_t A_M_L_LB

◆ ALC_M_MB

uint8_t ALC_M_MB

◆ LBA_M_M_MB

uint8_t LBA_M_M_MB

◆ LBA_M_M_LB

uint8_t LBA_M_M_LB

◆ LBA_M_L_MB

uint8_t LBA_M_L_MB

◆ LBA_M_L_LB

uint8_t LBA_M_L_LB

◆ DeviceType

uint8_t DeviceType

◆ PeripheralQualifier

uint8_t PeripheralQualifier

◆ Reserved

unsigned Reserved

◆ Removable

unsigned Removable

◆ Version

uint8_t Version

◆ ResponseDataFormat

unsigned ResponseDataFormat

◆ HISUP

unsigned HISUP

◆ NormACA

unsigned NormACA

◆ TrmTsk

unsigned TrmTsk

◆ AERC

unsigned AERC

◆ AdditionalLength

uint8_t AdditionalLength

◆ PROTECT

unsigned PROTECT

◆ Res

unsigned Res

◆ ThreePC

unsigned ThreePC

◆ TPGS

unsigned TPGS

◆ ACC

unsigned ACC

◆ SCCS

unsigned SCCS

◆ ADDR16

unsigned ADDR16

◆ R1

unsigned R1

◆ R2

unsigned R2

◆ MCHNGR

unsigned MCHNGR

◆ MULTIP

unsigned MULTIP

◆ VS

unsigned VS

◆ ENCSERV

unsigned ENCSERV

◆ BQUE

unsigned BQUE

◆ SoftReset

unsigned SoftReset

◆ CmdQue

unsigned CmdQue

◆ Reserved4

unsigned Reserved4

◆ Linked

unsigned Linked

◆ Sync

unsigned Sync

◆ WideBus16Bit

unsigned WideBus16Bit

◆ WideBus32Bit

unsigned WideBus32Bit

◆ RelAddr

unsigned RelAddr

◆ VendorID

uint8_t VendorID[8]

◆ ProductID

uint8_t ProductID[16]

◆ RevisionID

uint8_t RevisionID[4]

◆ dCBWSignature

uint32_t dCBWSignature

◆ dCBWTag

uint32_t dCBWTag

◆ dCBWDataTransferLength

uint32_t dCBWDataTransferLength

◆ bmCBWFlags

uint8_t bmCBWFlags

◆ bmCBWLUN

uint8_t bmCBWLUN

◆ bmReserved1

uint8_t bmReserved1

◆ @39

struct { ... }

◆ bmCBWCBLength

uint8_t bmCBWCBLength

◆ bmReserved2

uint8_t bmReserved2

◆ @41

struct { ... }

◆ CBWCB

uint8_t CBWCB[16]

◆ dCSWSignature

uint32_t dCSWSignature

◆ dCSWTag

uint32_t dCSWTag

◆ dCSWDataResidue

uint32_t dCSWDataResidue

◆ bCSWStatus

uint8_t bCSWStatus

◆ bResponseCode

uint8_t bResponseCode

◆ bSegmentNumber

uint8_t bSegmentNumber

◆ bmSenseKey

uint8_t bmSenseKey

◆ bmReserved

uint8_t bmReserved

◆ bmILI

uint8_t bmILI

◆ bmEOM

uint8_t bmEOM

◆ bmFileMark

uint8_t bmFileMark

◆ Information

uint8_t Information[4]

◆ bAdditionalLength

uint8_t bAdditionalLength

◆ CmdSpecificInformation

uint8_t CmdSpecificInformation[4]

◆ bAdditionalSenseCode

uint8_t bAdditionalSenseCode

◆ bAdditionalSenseQualifier

uint8_t bAdditionalSenseQualifier

◆ bFieldReplaceableUnitCode

uint8_t bFieldReplaceableUnitCode

◆ SenseKeySpecific

uint8_t SenseKeySpecific[3]

◆ __attribute__

LBAMSB
unsigned LBAMSB
Definition: masstorage.h:204
Opcode
uint8_t Opcode
Definition: masstorage.h:49
Misc
unsigned Misc
Definition: masstorage.h:265
CDB6
CDB6(uint8_t _Opcode, uint8_t _LUN, uint32_t LBA, uint8_t _AllocationLength, uint8_t _Control)
Definition: masstorage.h:214
BGRAB0
#define BGRAB0(__usi__)
Definition: macros.h:57
BGRAB3
#define BGRAB3(__usi__)
Definition: macros.h:60
CDB10
CDB10(uint8_t _Opcode, uint8_t _LUN)
Definition: masstorage.h:246
LBA_L_L_LB
uint8_t LBA_L_L_LB
Definition: masstorage.h:236
LBA_M_M_MB
uint8_t LBA_M_M_MB
Definition: masstorage.h:283
LBAHB
uint8_t LBAHB
Definition: masstorage.h:207
LBALB
uint8_t LBALB
Definition: masstorage.h:208
BGRAB2
#define BGRAB2(__usi__)
Definition: macros.h:59
Service_Action
unsigned Service_Action
Definition: masstorage.h:230
BGRAB1
#define BGRAB1(__usi__)
Definition: macros.h:58
LBA_M_L_MB
uint8_t LBA_M_L_MB
Definition: masstorage.h:285
uint8_t
const uint8_t[]
Definition: 404_html.c:3
LBA_L_M_LB
uint8_t LBA_L_M_LB
Definition: masstorage.h:234
LBA_L_M_MB
uint8_t LBA_L_M_MB
Definition: masstorage.h:233
LBA_L_L_MB
uint8_t LBA_L_L_MB
Definition: masstorage.h:235
LBA_M_M_LB
uint8_t LBA_M_M_LB
Definition: masstorage.h:284
LUN
unsigned LUN
Definition: masstorage.h:52