1 | /* $Id: scsi.h 82162 2019-11-25 10:30:40Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * PC BIOS - SCSI definitions.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef VBOX_INCLUDED_SRC_PC_BIOS_scsi_h
|
---|
19 | #define VBOX_INCLUDED_SRC_PC_BIOS_scsi_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Command opcodes. */
|
---|
25 | #define SCSI_SERVICE_ACT 0x9e
|
---|
26 | #define SCSI_INQUIRY 0x12
|
---|
27 | #define SCSI_READ_CAP_10 0x25
|
---|
28 | #define SCSI_READ_10 0x28
|
---|
29 | #define SCSI_WRITE_10 0x2a
|
---|
30 | #define SCSI_READ_CAP_16 0x10 /* Not an opcode by itself, sub-action for the "Service Action" */
|
---|
31 | #define SCSI_READ_16 0x88
|
---|
32 | #define SCSI_WRITE_16 0x8a
|
---|
33 |
|
---|
34 | #pragma pack(1)
|
---|
35 |
|
---|
36 | /* READ_10/WRITE_10 CDB layout. */
|
---|
37 | typedef struct {
|
---|
38 | uint16_t command; /* Command. */
|
---|
39 | uint32_t lba; /* LBA, MSB first! */
|
---|
40 | uint8_t pad1; /* Unused. */
|
---|
41 | uint16_t nsect; /* Sector count, MSB first! */
|
---|
42 | uint8_t pad2; /* Unused. */
|
---|
43 | } cdb_rw10;
|
---|
44 |
|
---|
45 | /* READ_16/WRITE_16 CDB layout. */
|
---|
46 | typedef struct {
|
---|
47 | uint16_t command; /* Command. */
|
---|
48 | uint64_t lba; /* LBA, MSB first! */
|
---|
49 | uint32_t nsect32; /* Sector count, MSB first! */
|
---|
50 | uint8_t pad1; /* Unused. */
|
---|
51 | uint8_t pad2; /* Unused. */
|
---|
52 | } cdb_rw16;
|
---|
53 |
|
---|
54 | #pragma pack()
|
---|
55 |
|
---|
56 | ct_assert(sizeof(cdb_rw10) == 10);
|
---|
57 | ct_assert(sizeof(cdb_rw16) == 16);
|
---|
58 |
|
---|
59 | #endif /* !VBOX_INCLUDED_SRC_PC_BIOS_scsi_h */
|
---|
60 |
|
---|