TianoCore EDK2 master
Loading...
Searching...
No Matches
LsiScsi.h
Go to the documentation of this file.
1
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;
46
47typedef struct {
48 UINT32 Signature;
49 UINT64 OrigPciAttrs;
50 EFI_EVENT ExitBoot;
52 UINT8 MaxTarget;
53 UINT8 MaxLun;
54 UINT32 StallPerPollUsec;
56 EFI_PHYSICAL_ADDRESS DmaPhysical;
57 VOID *DmaMapping;
58 EFI_EXT_SCSI_PASS_THRU_MODE PassThruMode;
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// Probe, start and stop functions of this driver, called by the DXE core for
72// specific devices.
73//
74// The following specifications document these interfaces:
75// - Driver Writer's Guide for UEFI 2.3.1 v1.01, 9 Driver Binding Protocol
76// - UEFI Spec 2.3.1 + Errata C, 10.1 EFI Driver Binding Protocol
77//
78
80EFIAPI
81LsiScsiControllerSupported (
83 IN EFI_HANDLE ControllerHandle,
84 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
85 );
86
88EFIAPI
89LsiScsiControllerStart (
91 IN EFI_HANDLE ControllerHandle,
92 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
93 );
94
96EFIAPI
97LsiScsiControllerStop (
99 IN EFI_HANDLE ControllerHandle,
100 IN UINTN NumberOfChildren,
101 IN EFI_HANDLE *ChildHandleBuffer
102 );
103
104//
105// The next seven functions implement EFI_EXT_SCSI_PASS_THRU_PROTOCOL
106// for the LSI 53C895A SCSI Controller. Refer to UEFI Spec 2.3.1 + Errata C,
107// sections
108// - 14.1 SCSI Driver Model Overview,
109// - 14.7 Extended SCSI Pass Thru Protocol.
110//
111
113EFIAPI
114LsiScsiPassThru (
116 IN UINT8 *Target,
117 IN UINT64 Lun,
119 IN EFI_EVENT Event OPTIONAL
120 );
121
123EFIAPI
124LsiScsiGetNextTargetLun (
126 IN OUT UINT8 **TargetPointer,
127 IN OUT UINT64 *Lun
128 );
129
131EFIAPI
132LsiScsiBuildDevicePath (
134 IN UINT8 *Target,
135 IN UINT64 Lun,
136 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
137 );
138
140EFIAPI
141LsiScsiGetTargetLun (
143 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
144 OUT UINT8 **TargetPointer,
145 OUT UINT64 *Lun
146 );
147
149EFIAPI
150LsiScsiResetChannel (
152 );
153
155EFIAPI
156LsiScsiResetTargetLun (
158 IN UINT8 *Target,
159 IN UINT64 Lun
160 );
161
163EFIAPI
164LsiScsiGetNextTarget (
166 IN OUT UINT8 **TargetPointer
167 );
168
169//
170// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
171// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
172// in English, for display on standard console devices. This is recommended for
173// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
174// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
175//
176// Device type names ("LSI 53C895A SCSI Controller") are not formatted because
177// the driver supports only that device type. Therefore the driver name
178// suffices for unambiguous identification.
179//
180
182EFIAPI
183LsiScsiGetDriverName (
185 IN CHAR8 *Language,
186 OUT CHAR16 **DriverName
187 );
188
190EFIAPI
191LsiScsiGetDeviceName (
193 IN EFI_HANDLE DeviceHandle,
194 IN EFI_HANDLE ChildHandle,
195 IN CHAR8 *Language,
196 OUT CHAR16 **ControllerName
197 );
198
199#endif // _LSI_SCSI_DXE_H_
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33