VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/LsiScsiDxe/LsiScsi.h@ 94368

Last change on this file since 94368 was 89983, checked in by vboxsync, 4 years ago

Devices/EFI: Merge edk-stable202105 and openssl 1.1.1j and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 5.6 KB
Line 
1/** @file
2
3 Internal definitions for the LSI 53C895A SCSI driver, which produces
4 Extended SCSI Pass Thru Protocol instances for LSI 53C895A SCSI devices.
5
6 Copyright (C) 2020, SUSE LLC.
7
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#ifndef _LSI_SCSI_DXE_H_
13#define _LSI_SCSI_DXE_H_
14
15typedef struct {
16 //
17 // Allocate 32 UINT32 entries for the script and it's sufficient for
18 // 16 instructions.
19 //
20 UINT32 Script[32];
21 //
22 // The max size of CDB is 32.
23 //
24 UINT8 Cdb[32];
25 //
26 // Allocate 64KB for read/write buffer. It seems sufficient for the common
27 // boot scenarios.
28 //
29 // NOTE: The number of bytes for data transmission is bounded by DMA Byte
30 // Count (DBC), a 24-bit register, so the maximum is 0xFFFFFF (16MB-1).
31 //
32 UINT8 Data[SIZE_64KB];
33 //
34 // For SCSI Message In phase
35 //
36 UINT8 MsgIn[2];
37 //
38 // For SCSI Message Out phase
39 //
40 UINT8 MsgOut;
41 //
42 // For SCSI Status phase
43 //
44 UINT8 Status;
45} LSI_SCSI_DMA_BUFFER;
46
47typedef struct {
48 UINT32 Signature;
49 UINT64 OrigPciAttrs;
50 EFI_EVENT ExitBoot;
51 EFI_PCI_IO_PROTOCOL *PciIo;
52 UINT8 MaxTarget;
53 UINT8 MaxLun;
54 UINT32 StallPerPollUsec;
55 LSI_SCSI_DMA_BUFFER *Dma;
56 EFI_PHYSICAL_ADDRESS DmaPhysical;
57 VOID *DmaMapping;
58 EFI_EXT_SCSI_PASS_THRU_MODE PassThruMode;
59 EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru;
60} LSI_SCSI_DEV;
61
62#define LSI_SCSI_DEV_SIGNATURE SIGNATURE_32 ('L','S','I','S')
63
64#define LSI_SCSI_FROM_PASS_THRU(PassThruPtr) \
65 CR (PassThruPtr, LSI_SCSI_DEV, PassThru, LSI_SCSI_DEV_SIGNATURE)
66
67#define LSI_SCSI_DMA_ADDR(Dev, MemberName) \
68 ((UINT32)(Dev->DmaPhysical + OFFSET_OF (LSI_SCSI_DMA_BUFFER, MemberName)))
69
70
71//
72// Probe, start and stop functions of this driver, called by the DXE core for
73// specific devices.
74//
75// The following specifications document these interfaces:
76// - Driver Writer's Guide for UEFI 2.3.1 v1.01, 9 Driver Binding Protocol
77// - UEFI Spec 2.3.1 + Errata C, 10.1 EFI Driver Binding Protocol
78//
79
80EFI_STATUS
81EFIAPI
82LsiScsiControllerSupported (
83 IN EFI_DRIVER_BINDING_PROTOCOL *This,
84 IN EFI_HANDLE ControllerHandle,
85 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
86 );
87
88EFI_STATUS
89EFIAPI
90LsiScsiControllerStart (
91 IN EFI_DRIVER_BINDING_PROTOCOL *This,
92 IN EFI_HANDLE ControllerHandle,
93 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
94 );
95
96EFI_STATUS
97EFIAPI
98LsiScsiControllerStop (
99 IN EFI_DRIVER_BINDING_PROTOCOL *This,
100 IN EFI_HANDLE ControllerHandle,
101 IN UINTN NumberOfChildren,
102 IN EFI_HANDLE *ChildHandleBuffer
103 );
104
105
106//
107// The next seven functions implement EFI_EXT_SCSI_PASS_THRU_PROTOCOL
108// for the LSI 53C895A SCSI Controller. Refer to UEFI Spec 2.3.1 + Errata C,
109// sections
110// - 14.1 SCSI Driver Model Overview,
111// - 14.7 Extended SCSI Pass Thru Protocol.
112//
113
114EFI_STATUS
115EFIAPI
116LsiScsiPassThru (
117 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
118 IN UINT8 *Target,
119 IN UINT64 Lun,
120 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,
121 IN EFI_EVENT Event OPTIONAL
122 );
123
124EFI_STATUS
125EFIAPI
126LsiScsiGetNextTargetLun (
127 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
128 IN OUT UINT8 **TargetPointer,
129 IN OUT UINT64 *Lun
130 );
131
132EFI_STATUS
133EFIAPI
134LsiScsiBuildDevicePath (
135 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
136 IN UINT8 *Target,
137 IN UINT64 Lun,
138 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
139 );
140
141EFI_STATUS
142EFIAPI
143LsiScsiGetTargetLun (
144 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
145 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
146 OUT UINT8 **TargetPointer,
147 OUT UINT64 *Lun
148 );
149
150EFI_STATUS
151EFIAPI
152LsiScsiResetChannel (
153 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This
154 );
155
156EFI_STATUS
157EFIAPI
158LsiScsiResetTargetLun (
159 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
160 IN UINT8 *Target,
161 IN UINT64 Lun
162 );
163
164EFI_STATUS
165EFIAPI
166LsiScsiGetNextTarget (
167 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
168 IN OUT UINT8 **TargetPointer
169 );
170
171
172//
173// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
174// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
175// in English, for display on standard console devices. This is recommended for
176// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
177// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
178//
179// Device type names ("LSI 53C895A SCSI Controller") are not formatted because
180// the driver supports only that device type. Therefore the driver name
181// suffices for unambiguous identification.
182//
183
184EFI_STATUS
185EFIAPI
186LsiScsiGetDriverName (
187 IN EFI_COMPONENT_NAME_PROTOCOL *This,
188 IN CHAR8 *Language,
189 OUT CHAR16 **DriverName
190 );
191
192EFI_STATUS
193EFIAPI
194LsiScsiGetDeviceName (
195 IN EFI_COMPONENT_NAME_PROTOCOL *This,
196 IN EFI_HANDLE DeviceHandle,
197 IN EFI_HANDLE ChildHandle,
198 IN CHAR8 *Language,
199 OUT CHAR16 **ControllerName
200 );
201
202#endif // _LSI_SCSI_DXE_H_
Note: See TracBrowser for help on using the repository browser.

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