3 Internal definitions for the LSI 53C895A SCSI driver, which produces
4 Extended SCSI Pass Thru Protocol instances for LSI 53C895A SCSI devices.
6 Copyright (C) 2020, SUSE LLC.
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef _LSI_SCSI_DXE_H_
13 #define _LSI_SCSI_DXE_H_
17 // Allocate 32 UINT32 entries for the script and it's sufficient for
22 // The max size of CDB is 32.
26 // Allocate 64KB for read/write buffer. It seems sufficient for the common
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).
32 UINT8 Data
[SIZE_64KB
];
34 // For SCSI Message In phase
38 // For SCSI Message Out phase
42 // For SCSI Status phase
45 } LSI_SCSI_DMA_BUFFER
;
51 EFI_PCI_IO_PROTOCOL
*PciIo
;
54 UINT32 StallPerPollUsec
;
55 LSI_SCSI_DMA_BUFFER
*Dma
;
56 EFI_PHYSICAL_ADDRESS DmaPhysical
;
58 EFI_EXT_SCSI_PASS_THRU_MODE PassThruMode
;
59 EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru
;
62 #define LSI_SCSI_DEV_SIGNATURE SIGNATURE_32 ('L','S','I','S')
64 #define LSI_SCSI_FROM_PASS_THRU(PassThruPtr) \
65 CR (PassThruPtr, LSI_SCSI_DEV, PassThru, LSI_SCSI_DEV_SIGNATURE)
67 #define LSI_SCSI_DMA_ADDR(Dev, MemberName) \
68 ((UINT32)(Dev->DmaPhysical + OFFSET_OF (LSI_SCSI_DMA_BUFFER, MemberName)))
71 // Probe, start and stop functions of this driver, called by the DXE core for
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
81 LsiScsiControllerSupported (
82 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
83 IN EFI_HANDLE ControllerHandle
,
84 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
89 LsiScsiControllerStart (
90 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
91 IN EFI_HANDLE ControllerHandle
,
92 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
97 LsiScsiControllerStop (
98 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
99 IN EFI_HANDLE ControllerHandle
,
100 IN UINTN NumberOfChildren
,
101 IN EFI_HANDLE
*ChildHandleBuffer
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,
108 // - 14.1 SCSI Driver Model Overview,
109 // - 14.7 Extended SCSI Pass Thru Protocol.
115 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
118 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
119 IN EFI_EVENT Event OPTIONAL
124 LsiScsiGetNextTargetLun (
125 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
126 IN OUT UINT8
**TargetPointer
,
132 LsiScsiBuildDevicePath (
133 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
136 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
141 LsiScsiGetTargetLun (
142 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
143 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
144 OUT UINT8
**TargetPointer
,
150 LsiScsiResetChannel (
151 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
156 LsiScsiResetTargetLun (
157 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
164 LsiScsiGetNextTarget (
165 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
166 IN OUT UINT8
**TargetPointer
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.
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.
183 LsiScsiGetDriverName (
184 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
186 OUT CHAR16
**DriverName
191 LsiScsiGetDeviceName (
192 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
193 IN EFI_HANDLE DeviceHandle
,
194 IN EFI_HANDLE ChildHandle
,
196 OUT CHAR16
**ControllerName
199 #endif // _LSI_SCSI_DXE_H_