| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#ifndef SCSI_HH |
| 11 |
#define SCSI_HH |
| 12 |
|
| 13 |
#include <cstdint> |
| 14 |
|
| 15 |
namespace openmsx::SCSI { |
| 16 |
|
| 17 |
|
| 18 |
inline constexpr uint8_t OP_TEST_UNIT_READY = 0x00; |
| 19 |
inline constexpr uint8_t OP_REZERO_UNIT = 0x01; |
| 20 |
inline constexpr uint8_t OP_REQUEST_SENSE = 0x03; |
| 21 |
inline constexpr uint8_t OP_FORMAT_UNIT = 0x04; |
| 22 |
inline constexpr uint8_t OP_REASSIGN_BLOCKS = 0x07; |
| 23 |
inline constexpr uint8_t OP_READ6 = 0x08; |
| 24 |
inline constexpr uint8_t OP_WRITE6 = 0x0A; |
| 25 |
inline constexpr uint8_t OP_SEEK6 = 0x0B; |
| 26 |
inline constexpr uint8_t OP_INQUIRY = 0x12; |
| 27 |
inline constexpr uint8_t OP_RESERVE_UNIT = 0x16; |
| 28 |
inline constexpr uint8_t OP_RELEASE_UNIT = 0x17; |
| 29 |
inline constexpr uint8_t OP_MODE_SENSE = 0x1A; |
| 30 |
inline constexpr uint8_t OP_START_STOP_UNIT = 0x1B; |
| 31 |
inline constexpr uint8_t OP_SEND_DIAGNOSTIC = 0x1D; |
| 32 |
|
| 33 |
|
| 34 |
inline constexpr uint8_t OP_GROUP1 = 0x20; |
| 35 |
inline constexpr uint8_t OP_READ_CAPACITY = 0x25; |
| 36 |
inline constexpr uint8_t OP_READ10 = 0x28; |
| 37 |
inline constexpr uint8_t OP_WRITE10 = 0x2A; |
| 38 |
inline constexpr uint8_t OP_SEEK10 = 0x2B; |
| 39 |
|
| 40 |
inline constexpr uint8_t OP_GROUP2 = 0x40; |
| 41 |
inline constexpr uint8_t OP_CHANGE_DEFINITION = 0x40; |
| 42 |
inline constexpr uint8_t OP_READ_SUB_CHANNEL = 0x42; |
| 43 |
inline constexpr uint8_t OP_READ_TOC = 0x43; |
| 44 |
inline constexpr uint8_t OP_READ_HEADER = 0x44; |
| 45 |
inline constexpr uint8_t OP_PLAY_AUDIO = 0x45; |
| 46 |
inline constexpr uint8_t OP_PLAY_AUDIO_MSF = 0x47; |
| 47 |
inline constexpr uint8_t OP_PLAY_TRACK_INDEX = 0x48; |
| 48 |
inline constexpr uint8_t OP_PLAY_TRACK_RELATIVE = 0x49; |
| 49 |
inline constexpr uint8_t OP_PAUSE_RESUME = 0x4B; |
| 50 |
|
| 51 |
inline constexpr uint8_t OP_PLAY_AUDIO12 = 0xA5; |
| 52 |
inline constexpr uint8_t OP_READ12 = 0xA8; |
| 53 |
inline constexpr uint8_t OP_PLAY_TRACK_RELATIVE12 = 0xA9; |
| 54 |
inline constexpr uint8_t OP_READ_CD_MSF = 0xB9; |
| 55 |
inline constexpr uint8_t OP_READ_CD = 0xBE; |
| 56 |
|
| 57 |
|
| 58 |
inline constexpr uint32_t SENSE_NO_SENSE = 0x000000; |
| 59 |
inline constexpr uint32_t SENSE_NOT_READY = 0x020400; |
| 60 |
inline constexpr uint32_t SENSE_MEDIUM_NOT_PRESENT = 0x023a00; |
| 61 |
inline constexpr uint32_t SENSE_UNRECOVERED_READ_ERROR = 0x031100; |
| 62 |
inline constexpr uint32_t SENSE_WRITE_FAULT = 0x040300; |
| 63 |
inline constexpr uint32_t SENSE_INVALID_COMMAND_CODE = 0x052000; |
| 64 |
inline constexpr uint32_t SENSE_ILLEGAL_BLOCK_ADDRESS = 0x052100; |
| 65 |
inline constexpr uint32_t SENSE_INVALID_LUN = 0x052500; |
| 66 |
inline constexpr uint32_t SENSE_POWER_ON = 0x062900; |
| 67 |
inline constexpr uint32_t SENSE_WRITE_PROTECT = 0x072700; |
| 68 |
inline constexpr uint32_t SENSE_MESSAGE_REJECT_ERROR = 0x0b4300; |
| 69 |
inline constexpr uint32_t SENSE_INITIATOR_DETECTED_ERR = 0x0b4800; |
| 70 |
inline constexpr uint32_t SENSE_ILLEGAL_MESSAGE = 0x0b4900; |
| 71 |
|
| 72 |
|
| 73 |
inline constexpr uint8_t MSG_COMMAND_COMPLETE = 0x00; |
| 74 |
inline constexpr uint8_t MSG_INITIATOR_DETECT_ERROR = 0x05; |
| 75 |
inline constexpr uint8_t MSG_ABORT = 0x06; |
| 76 |
inline constexpr uint8_t MSG_REJECT = 0x07; |
| 77 |
inline constexpr uint8_t MSG_NO_OPERATION = 0x08; |
| 78 |
inline constexpr uint8_t MSG_PARITY_ERROR = 0x09; |
| 79 |
inline constexpr uint8_t MSG_BUS_DEVICE_RESET = 0x0c; |
| 80 |
|
| 81 |
|
| 82 |
inline constexpr uint8_t ST_GOOD = 0; |
| 83 |
inline constexpr uint8_t ST_CHECK_CONDITION = 2; |
| 84 |
inline constexpr uint8_t ST_BUSY = 8; |
| 85 |
|
| 86 |
|
| 87 |
inline constexpr uint8_t DT_DirectAccess = 0x00; |
| 88 |
inline constexpr uint8_t DT_SequencialAccess = 0x01; |
| 89 |
inline constexpr uint8_t DT_Printer = 0x02; |
| 90 |
inline constexpr uint8_t DT_Processor = 0x03; |
| 91 |
inline constexpr uint8_t DT_WriteOnce = 0x04; |
| 92 |
inline constexpr uint8_t DT_CDROM = 0x05; |
| 93 |
inline constexpr uint8_t DT_Scanner = 0x06; |
| 94 |
inline constexpr uint8_t DT_OpticalMemory = 0x07; |
| 95 |
inline constexpr uint8_t DT_MediaChanger = 0x08; |
| 96 |
inline constexpr uint8_t DT_Communications = 0x09; |
| 97 |
inline constexpr uint8_t DT_Undefined = 0x1f; |
| 98 |
|
| 99 |
enum class Phase : uint8_t { |
| 100 |
UNDEFINED, |
| 101 |
BUS_FREE, |
| 102 |
ARBITRATION, |
| 103 |
SELECTION, |
| 104 |
RESELECTION, |
| 105 |
COMMAND, |
| 106 |
EXECUTE, |
| 107 |
DATA_IN, |
| 108 |
DATA_OUT, |
| 109 |
STATUS, |
| 110 |
MSG_OUT, |
| 111 |
MSG_IN, |
| 112 |
}; |
| 113 |
|
| 114 |
} |
| 115 |
|
| 116 |
#endif |