openMSX
SCSI.hh
Go to the documentation of this file.
1 /* Ported from:
2 ** Source: /cvsroot/bluemsx/blueMSX/Src/IoDevice/ScsiDefs.h,v
3 ** Revision: 1.2
4 ** Date: 2007/03/24 08:01:48
5 **
6 ** More info: http://www.bluemsx.com
7 **
8 ** Copyright (C) 2003-2007 Daniel Vik, white cat
9 */
10 #ifndef SCSI_HH
11 #define SCSI_HH
12 
13 #include "openmsx.hh"
14 
15 namespace openmsx::SCSI {
16 
17 // Group 0: 6bytes cdb
18 constexpr byte OP_TEST_UNIT_READY = 0x00;
19 constexpr byte OP_REZERO_UNIT = 0x01;
20 constexpr byte OP_REQUEST_SENSE = 0x03;
21 constexpr byte OP_FORMAT_UNIT = 0x04;
22 constexpr byte OP_REASSIGN_BLOCKS = 0x07;
23 constexpr byte OP_READ6 = 0x08;
24 constexpr byte OP_WRITE6 = 0x0A;
25 constexpr byte OP_SEEK6 = 0x0B;
26 constexpr byte OP_INQUIRY = 0x12;
27 constexpr byte OP_RESERVE_UNIT = 0x16;
28 constexpr byte OP_RELEASE_UNIT = 0x17;
29 constexpr byte OP_MODE_SENSE = 0x1A;
30 constexpr byte OP_START_STOP_UNIT = 0x1B;
31 constexpr byte OP_SEND_DIAGNOSTIC = 0x1D;
32 
33 // Group 1: 10bytes cdb
34 constexpr byte OP_GROUP1 = 0x20;
35 constexpr byte OP_READ_CAPACITY = 0x25;
36 constexpr byte OP_READ10 = 0x28;
37 constexpr byte OP_WRITE10 = 0x2A;
38 constexpr byte OP_SEEK10 = 0x2B;
39 
40 constexpr byte OP_GROUP2 = 0x40;
41 constexpr byte OP_CHANGE_DEFINITION = 0x40;
42 constexpr byte OP_READ_SUB_CHANNEL = 0x42;
43 constexpr byte OP_READ_TOC = 0x43;
44 constexpr byte OP_READ_HEADER = 0x44;
45 constexpr byte OP_PLAY_AUDIO = 0x45;
46 constexpr byte OP_PLAY_AUDIO_MSF = 0x47;
47 constexpr byte OP_PLAY_TRACK_INDEX = 0x48;
48 constexpr byte OP_PLAY_TRACK_RELATIVE = 0x49;
49 constexpr byte OP_PAUSE_RESUME = 0x4B;
50 
51 constexpr byte OP_PLAY_AUDIO12 = 0xA5;
52 constexpr byte OP_READ12 = 0xA8;
53 constexpr byte OP_PLAY_TRACK_RELATIVE12 = 0xA9;
54 constexpr byte OP_READ_CD_MSF = 0xB9;
55 constexpr byte OP_READ_CD = 0xBE;
56 
57 // Sense data KEY | ASC | ASCQ
58 constexpr unsigned SENSE_NO_SENSE = 0x000000;
59 constexpr unsigned SENSE_NOT_READY = 0x020400;
60 constexpr unsigned SENSE_MEDIUM_NOT_PRESENT = 0x023a00;
61 constexpr unsigned SENSE_UNRECOVERED_READ_ERROR = 0x031100;
62 constexpr unsigned SENSE_WRITE_FAULT = 0x040300;
63 constexpr unsigned SENSE_INVALID_COMMAND_CODE = 0x052000;
64 constexpr unsigned SENSE_ILLEGAL_BLOCK_ADDRESS = 0x052100;
65 constexpr unsigned SENSE_INVALID_LUN = 0x052500;
66 constexpr unsigned SENSE_POWER_ON = 0x062900;
67 constexpr unsigned SENSE_WRITE_PROTECT = 0x072700;
68 constexpr unsigned SENSE_MESSAGE_REJECT_ERROR = 0x0b4300;
69 constexpr unsigned SENSE_INITIATOR_DETECTED_ERR = 0x0b4800;
70 constexpr unsigned SENSE_ILLEGAL_MESSAGE = 0x0b4900;
71 
72 // Message
73 constexpr byte MSG_COMMAND_COMPLETE = 0x00;
74 constexpr byte MSG_INITIATOR_DETECT_ERROR = 0x05;
75 constexpr byte MSG_ABORT = 0x06;
76 constexpr byte MSG_REJECT = 0x07;
77 constexpr byte MSG_NO_OPERATION = 0x08;
78 constexpr byte MSG_PARITY_ERROR = 0x09;
79 constexpr byte MSG_BUS_DEVICE_RESET = 0x0c;
80 
81 // Status
82 constexpr byte ST_GOOD = 0;
83 constexpr byte ST_CHECK_CONDITION = 2;
84 constexpr byte ST_BUSY = 8;
85 
86 // Device type
87 constexpr byte DT_DirectAccess = 0x00;
88 constexpr byte DT_SequencialAccess = 0x01;
89 constexpr byte DT_Printer = 0x02;
90 constexpr byte DT_Processor = 0x03;
91 constexpr byte DT_WriteOnce = 0x04;
92 constexpr byte DT_CDROM = 0x05;
93 constexpr byte DT_Scanner = 0x06;
94 constexpr byte DT_OpticalMemory = 0x07;
95 constexpr byte DT_MediaChanger = 0x08;
96 constexpr byte DT_Communications = 0x09;
97 constexpr byte DT_Undefined = 0x1f;
98 
99 enum Phase {
100  UNDEFINED, // used in MB89532
112 };
113 
114 } // namespace openmsx::SCSI
115 
116 #endif
openmsx::SCSI::OP_GROUP1
constexpr byte OP_GROUP1
Definition: SCSI.hh:34
openmsx::SCSI::SENSE_INITIATOR_DETECTED_ERR
constexpr unsigned SENSE_INITIATOR_DETECTED_ERR
Definition: SCSI.hh:69
openmsx::SCSI::ARBITRATION
@ ARBITRATION
Definition: SCSI.hh:102
openmsx::SCSI::OP_READ_CD
constexpr byte OP_READ_CD
Definition: SCSI.hh:55
openmsx.hh
openmsx::SCSI::DT_SequencialAccess
constexpr byte DT_SequencialAccess
Definition: SCSI.hh:88
openmsx::SCSI::SENSE_NOT_READY
constexpr unsigned SENSE_NOT_READY
Definition: SCSI.hh:59
openmsx::SCSI::OP_PLAY_TRACK_RELATIVE12
constexpr byte OP_PLAY_TRACK_RELATIVE12
Definition: SCSI.hh:53
openmsx::SCSI::OP_PLAY_AUDIO
constexpr byte OP_PLAY_AUDIO
Definition: SCSI.hh:45
openmsx::SCSI::OP_REASSIGN_BLOCKS
constexpr byte OP_REASSIGN_BLOCKS
Definition: SCSI.hh:22
openmsx::SCSI::OP_RESERVE_UNIT
constexpr byte OP_RESERVE_UNIT
Definition: SCSI.hh:27
openmsx::SCSI::DT_Scanner
constexpr byte DT_Scanner
Definition: SCSI.hh:93
openmsx::SCSI::SENSE_POWER_ON
constexpr unsigned SENSE_POWER_ON
Definition: SCSI.hh:66
openmsx::SCSI::OP_WRITE10
constexpr byte OP_WRITE10
Definition: SCSI.hh:37
openmsx::SCSI::OP_CHANGE_DEFINITION
constexpr byte OP_CHANGE_DEFINITION
Definition: SCSI.hh:41
openmsx::SCSI::OP_MODE_SENSE
constexpr byte OP_MODE_SENSE
Definition: SCSI.hh:29
openmsx::SCSI::DT_Printer
constexpr byte DT_Printer
Definition: SCSI.hh:89
openmsx::SCSI::DT_DirectAccess
constexpr byte DT_DirectAccess
Definition: SCSI.hh:87
openmsx::SCSI::SENSE_WRITE_FAULT
constexpr unsigned SENSE_WRITE_FAULT
Definition: SCSI.hh:62
openmsx::SCSI::SENSE_INVALID_COMMAND_CODE
constexpr unsigned SENSE_INVALID_COMMAND_CODE
Definition: SCSI.hh:63
openmsx::SCSI::SENSE_WRITE_PROTECT
constexpr unsigned SENSE_WRITE_PROTECT
Definition: SCSI.hh:67
openmsx::SCSI::OP_REQUEST_SENSE
constexpr byte OP_REQUEST_SENSE
Definition: SCSI.hh:20
openmsx::SCSI::MSG_BUS_DEVICE_RESET
constexpr byte MSG_BUS_DEVICE_RESET
Definition: SCSI.hh:79
openmsx::SCSI::DT_Processor
constexpr byte DT_Processor
Definition: SCSI.hh:90
openmsx::SCSI::OP_READ10
constexpr byte OP_READ10
Definition: SCSI.hh:36
openmsx::SCSI::OP_SEEK6
constexpr byte OP_SEEK6
Definition: SCSI.hh:25
openmsx::SCSI::DATA_IN
@ DATA_IN
Definition: SCSI.hh:107
openmsx::SCSI::MSG_OUT
@ MSG_OUT
Definition: SCSI.hh:110
openmsx::SCSI::SENSE_UNRECOVERED_READ_ERROR
constexpr unsigned SENSE_UNRECOVERED_READ_ERROR
Definition: SCSI.hh:61
openmsx::SCSI::OP_FORMAT_UNIT
constexpr byte OP_FORMAT_UNIT
Definition: SCSI.hh:21
openmsx::SCSI::OP_READ_TOC
constexpr byte OP_READ_TOC
Definition: SCSI.hh:43
openmsx::SCSI::OP_SEEK10
constexpr byte OP_SEEK10
Definition: SCSI.hh:38
openmsx::SCSI::OP_READ_CD_MSF
constexpr byte OP_READ_CD_MSF
Definition: SCSI.hh:54
openmsx::SCSI::OP_READ6
constexpr byte OP_READ6
Definition: SCSI.hh:23
openmsx::SCSI::OP_READ_SUB_CHANNEL
constexpr byte OP_READ_SUB_CHANNEL
Definition: SCSI.hh:42
openmsx::SCSI::ST_GOOD
constexpr byte ST_GOOD
Definition: SCSI.hh:82
openmsx::SCSI::OP_PLAY_TRACK_INDEX
constexpr byte OP_PLAY_TRACK_INDEX
Definition: SCSI.hh:47
openmsx::SCSI::OP_READ_HEADER
constexpr byte OP_READ_HEADER
Definition: SCSI.hh:44
openmsx::SCSI::DT_MediaChanger
constexpr byte DT_MediaChanger
Definition: SCSI.hh:95
openmsx::SCSI::SENSE_ILLEGAL_BLOCK_ADDRESS
constexpr unsigned SENSE_ILLEGAL_BLOCK_ADDRESS
Definition: SCSI.hh:64
openmsx::SCSI::OP_PLAY_TRACK_RELATIVE
constexpr byte OP_PLAY_TRACK_RELATIVE
Definition: SCSI.hh:48
openmsx::SCSI
Definition: SCSI.hh:15
openmsx::SCSI::DT_Undefined
constexpr byte DT_Undefined
Definition: SCSI.hh:97
openmsx::SCSI::MSG_PARITY_ERROR
constexpr byte MSG_PARITY_ERROR
Definition: SCSI.hh:78
openmsx::SCSI::OP_PAUSE_RESUME
constexpr byte OP_PAUSE_RESUME
Definition: SCSI.hh:49
openmsx::SCSI::SENSE_ILLEGAL_MESSAGE
constexpr unsigned SENSE_ILLEGAL_MESSAGE
Definition: SCSI.hh:70
openmsx::SCSI::COMMAND
@ COMMAND
Definition: SCSI.hh:105
openmsx::SCSI::OP_PLAY_AUDIO12
constexpr byte OP_PLAY_AUDIO12
Definition: SCSI.hh:51
openmsx::SCSI::OP_RELEASE_UNIT
constexpr byte OP_RELEASE_UNIT
Definition: SCSI.hh:28
openmsx::SCSI::MSG_INITIATOR_DETECT_ERROR
constexpr byte MSG_INITIATOR_DETECT_ERROR
Definition: SCSI.hh:74
openmsx::SCSI::OP_START_STOP_UNIT
constexpr byte OP_START_STOP_UNIT
Definition: SCSI.hh:30
openmsx::SCSI::OP_PLAY_AUDIO_MSF
constexpr byte OP_PLAY_AUDIO_MSF
Definition: SCSI.hh:46
openmsx::SCSI::MSG_REJECT
constexpr byte MSG_REJECT
Definition: SCSI.hh:76
openmsx::SCSI::SELECTION
@ SELECTION
Definition: SCSI.hh:103
openmsx::SCSI::MSG_ABORT
constexpr byte MSG_ABORT
Definition: SCSI.hh:75
openmsx::SCSI::STATUS
@ STATUS
Definition: SCSI.hh:109
openmsx::SCSI::BUS_FREE
@ BUS_FREE
Definition: SCSI.hh:101
openmsx::SCSI::EXECUTE
@ EXECUTE
Definition: SCSI.hh:106
openmsx::SCSI::SENSE_INVALID_LUN
constexpr unsigned SENSE_INVALID_LUN
Definition: SCSI.hh:65
openmsx::SCSI::OP_READ12
constexpr byte OP_READ12
Definition: SCSI.hh:52
openmsx::SCSI::RESELECTION
@ RESELECTION
Definition: SCSI.hh:104
openmsx::SCSI::OP_GROUP2
constexpr byte OP_GROUP2
Definition: SCSI.hh:40
openmsx::SCSI::OP_READ_CAPACITY
constexpr byte OP_READ_CAPACITY
Definition: SCSI.hh:35
openmsx::SCSI::SENSE_NO_SENSE
constexpr unsigned SENSE_NO_SENSE
Definition: SCSI.hh:58
openmsx::SCSI::OP_TEST_UNIT_READY
constexpr byte OP_TEST_UNIT_READY
Definition: SCSI.hh:18
openmsx::SCSI::DATA_OUT
@ DATA_OUT
Definition: SCSI.hh:108
openmsx::SCSI::MSG_IN
@ MSG_IN
Definition: SCSI.hh:111
openmsx::SCSI::SENSE_MEDIUM_NOT_PRESENT
constexpr unsigned SENSE_MEDIUM_NOT_PRESENT
Definition: SCSI.hh:60
openmsx::SCSI::OP_INQUIRY
constexpr byte OP_INQUIRY
Definition: SCSI.hh:26
openmsx::SCSI::DT_CDROM
constexpr byte DT_CDROM
Definition: SCSI.hh:92
openmsx::SCSI::OP_REZERO_UNIT
constexpr byte OP_REZERO_UNIT
Definition: SCSI.hh:19
openmsx::SCSI::DT_Communications
constexpr byte DT_Communications
Definition: SCSI.hh:96
openmsx::SCSI::OP_SEND_DIAGNOSTIC
constexpr byte OP_SEND_DIAGNOSTIC
Definition: SCSI.hh:31
openmsx::SCSI::SENSE_MESSAGE_REJECT_ERROR
constexpr unsigned SENSE_MESSAGE_REJECT_ERROR
Definition: SCSI.hh:68
openmsx::SCSI::DT_WriteOnce
constexpr byte DT_WriteOnce
Definition: SCSI.hh:91
openmsx::SCSI::DT_OpticalMemory
constexpr byte DT_OpticalMemory
Definition: SCSI.hh:94
openmsx::SCSI::MSG_NO_OPERATION
constexpr byte MSG_NO_OPERATION
Definition: SCSI.hh:77
openmsx::SCSI::ST_BUSY
constexpr byte ST_BUSY
Definition: SCSI.hh:84
openmsx::SCSI::Phase
Phase
Definition: SCSI.hh:99
openmsx::SCSI::UNDEFINED
@ UNDEFINED
Definition: SCSI.hh:100
openmsx::SCSI::ST_CHECK_CONDITION
constexpr byte ST_CHECK_CONDITION
Definition: SCSI.hh:83
openmsx::SCSI::OP_WRITE6
constexpr byte OP_WRITE6
Definition: SCSI.hh:24
openmsx::SCSI::MSG_COMMAND_COMPLETE
constexpr byte MSG_COMMAND_COMPLETE
Definition: SCSI.hh:73