VirtualBox

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

Last change on this file since 93115 was 93115, checked in by vboxsync, 3 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
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. */
37typedef 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. */
46typedef 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
56ct_assert(sizeof(cdb_rw10) == 10);
57ct_assert(sizeof(cdb_rw16) == 16);
58
59extern int lsilogic_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
60extern 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);
62extern 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
65extern int buslogic_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
66extern 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);
68extern 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
71extern int virtio_scsi_init(void __far *pvHba, uint8_t u8Bus, uint8_t u8DevFn);
72extern 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);
74extern 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
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette