VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/BIOS/scsi.h

Last change on this file was 100984, checked in by vboxsync, 8 months ago

BIOS: Support also ISA BusLogic/Adaptec HBAs, not just PCI (see bugref:6549).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: scsi.h 100984 2023-08-28 11:09:40Z vboxsync $ */
2/** @file
3 * PC BIOS - SCSI definitions.
4 */
5
6/*
7 * Copyright (C) 2019-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VBOX_INCLUDED_SRC_PC_BIOS_scsi_h
29#define VBOX_INCLUDED_SRC_PC_BIOS_scsi_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Command opcodes. */
35#define SCSI_SERVICE_ACT 0x9e
36#define SCSI_INQUIRY 0x12
37#define SCSI_READ_CAP_10 0x25
38#define SCSI_READ_10 0x28
39#define SCSI_WRITE_10 0x2a
40#define SCSI_READ_CAP_16 0x10 /* Not an opcode by itself, sub-action for the "Service Action" */
41#define SCSI_READ_16 0x88
42#define SCSI_WRITE_16 0x8a
43
44#pragma pack(1)
45
46/* READ_10/WRITE_10 CDB layout. */
47typedef struct {
48 uint16_t command; /* Command. */
49 uint32_t lba; /* LBA, MSB first! */
50 uint8_t pad1; /* Unused. */
51 uint16_t nsect; /* Sector count, MSB first! */
52 uint8_t pad2; /* Unused. */
53} cdb_rw10;
54
55/* READ_16/WRITE_16 CDB layout. */
56typedef struct {
57 uint16_t command; /* Command. */
58 uint64_t lba; /* LBA, MSB first! */
59 uint32_t nsect32; /* Sector count, MSB first! */
60 uint8_t pad1; /* Unused. */
61 uint8_t pad2; /* Unused. */
62} cdb_rw16;
63
64#pragma pack()
65
66ct_assert(sizeof(cdb_rw10) == 10);
67ct_assert(sizeof(cdb_rw16) == 16);
68
69extern int lsilogic_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
70extern int lsilogic_scsi_cmd_data_out(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
71 uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
72extern int lsilogic_scsi_cmd_data_in(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
73 uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
74
75extern int buslogic_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
76extern int buslogic_scsi_cmd_data_out(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
77 uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
78extern int buslogic_scsi_cmd_data_in(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
79 uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
80
81extern uint16_t btaha_scsi_detect();
82extern int btaha_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
83
84extern int virtio_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
85extern int virtio_scsi_cmd_data_out(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
86 uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
87extern int virtio_scsi_cmd_data_in(void __far *pvHba, uint8_t idTgt, uint8_t __far *aCDB,
88 uint8_t cbCDB, uint8_t __far *buffer, uint32_t length);
89
90#endif /* !VBOX_INCLUDED_SRC_PC_BIOS_scsi_h */
91
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use