1 | /* $Id: scsi.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * PC BIOS - SCSI definitions.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019-2022 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 | extern int lsilogic_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
|
---|
60 | extern int lsilogic_scsi_cmd_data_out(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
|
---|
61 | uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
|
---|
62 | extern int lsilogic_scsi_cmd_data_in(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
|
---|
63 | uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
|
---|
64 |
|
---|
65 | extern int buslogic_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
|
---|
66 | extern int buslogic_scsi_cmd_data_out(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
|
---|
67 | uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
|
---|
68 | extern int buslogic_scsi_cmd_data_in(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
|
---|
69 | uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
|
---|
70 |
|
---|
71 | extern int virtio_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
|
---|
72 | extern int virtio_scsi_cmd_data_out(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
|
---|
73 | uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
|
---|
74 | extern int virtio_scsi_cmd_data_in(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
|
---|
75 | uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
|
---|
76 |
|
---|
77 | #endif /* !VBOX_INCLUDED_SRC_PC_BIOS_scsi_h */
|
---|
78 |
|
---|