Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/devices/src/virtio/scsi/constants.rs
5394 views
1
// Copyright 2023 The ChromiumOS Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#![deny(missing_docs)]
6
//! This file contains values specified in spec.
7
//! SPC-3: <https://www.t10.org/cgi-bin/ac.pl?t=f&f=spc3r23.pdf>
8
//! SAM-5: <https://www.t10.org/cgi-bin/ac.pl?t=f&f=sam5r21.pdf>
9
10
// SCSI opcodes
11
/// Opcode for TEST UNIT READY command.
12
pub const TEST_UNIT_READY: u8 = 0x00;
13
/// Opcode for REQUEST SENSE command.
14
pub const REQUEST_SENSE: u8 = 0x03;
15
/// Opcode for READ(6) command.
16
pub const READ_6: u8 = 0x08;
17
/// Opcode for INQUIRY command.
18
pub const INQUIRY: u8 = 0x12;
19
/// Opcode for MODE SELECT(6) command.
20
pub const MODE_SELECT_6: u8 = 0x15;
21
/// Opcode for MODE SENSE(6) command.
22
pub const MODE_SENSE_6: u8 = 0x1a;
23
/// Opcode for READ CAPACITY(10) command.
24
pub const READ_CAPACITY_10: u8 = 0x25;
25
/// Opcode for READ(10) command.
26
pub const READ_10: u8 = 0x28;
27
/// Opcode for WRITE(10) command.
28
pub const WRITE_10: u8 = 0x2a;
29
/// Opcode for SYNCHRONIZE CACHE(10) command.
30
pub const SYNCHRONIZE_CACHE_10: u8 = 0x35;
31
/// Opcode for WRITE SAME(10) command.
32
pub const WRITE_SAME_10: u8 = 0x41;
33
/// Opcode for UNMAP command.
34
pub const UNMAP: u8 = 0x42;
35
/// Opcode for WRITE SAME(16) command.
36
pub const WRITE_SAME_16: u8 = 0x93;
37
/// Opcode for SERVICE ACTION IN(16) command.
38
pub const SERVICE_ACTION_IN_16: u8 = 0x9e;
39
/// Opcode for REPORT LUNS command.
40
pub const REPORT_LUNS: u8 = 0xa0;
41
/// Opcode for MAINTENANCE IN command.
42
pub const MAINTENANCE_IN: u8 = 0xa3;
43
44
// The service actions of MAINTENANCE IN command.
45
/// REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS
46
pub const REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS: u8 = 0x0d;
47
48
// The service actions of SERVICE ACTION IN(16) command.
49
/// READ CAPACITY(16)
50
pub const READ_CAPACITY_16: u8 = 0x10;
51
52
// SAM status code
53
/// Indicates the completion of the command without error.
54
pub const GOOD: u8 = 0x00;
55
/// Indicates that sense data has been delivered in the buffer.
56
pub const CHECK_CONDITION: u8 = 0x02;
57
58
// Device Types
59
/// Indicates the id of disk type.
60
pub const TYPE_DISK: u8 = 0x00;
61
62
// SENSE KEYS
63
/// Indicates that there is no specific sense data to be reported.
64
pub const NO_SENSE: u8 = 0x00;
65
/// Indicates an error that may have been caused by a flaw in the medium or an error in the
66
/// recorded data.
67
pub const MEDIUM_ERROR: u8 = 0x03;
68
/// Indicates an illegal request.
69
pub const ILLEGAL_REQUEST: u8 = 0x05;
70
/// Indicates that a unit attention condition has been established.
71
pub const UNIT_ATTENTION: u8 = 0x06;
72
73