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 // The max size of CDB is 32.
21 // Allocate 64KB for read/write buffer. It seems sufficient for the common
24 // NOTE: The number of bytes for data transmission is bounded by DMA Byte
25 // Count (DBC), a 24-bit register, so the maximum is 0xFFFFFF (16MB-1).
27 UINT8 Data
[SIZE_64KB
];
28 } LSI_SCSI_DMA_BUFFER
;
34 EFI_PCI_IO_PROTOCOL
*PciIo
;
37 LSI_SCSI_DMA_BUFFER
*Dma
;
38 EFI_PHYSICAL_ADDRESS DmaPhysical
;
40 EFI_EXT_SCSI_PASS_THRU_MODE PassThruMode
;
41 EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru
;
44 #define LSI_SCSI_DEV_SIGNATURE SIGNATURE_32 ('L','S','I','S')
46 #define LSI_SCSI_FROM_PASS_THRU(PassThruPtr) \
47 CR (PassThruPtr, LSI_SCSI_DEV, PassThru, LSI_SCSI_DEV_SIGNATURE)
51 // Probe, start and stop functions of this driver, called by the DXE core for
54 // The following specifications document these interfaces:
55 // - Driver Writer's Guide for UEFI 2.3.1 v1.01, 9 Driver Binding Protocol
56 // - UEFI Spec 2.3.1 + Errata C, 10.1 EFI Driver Binding Protocol
61 LsiScsiControllerSupported (
62 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
63 IN EFI_HANDLE ControllerHandle
,
64 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
69 LsiScsiControllerStart (
70 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
71 IN EFI_HANDLE ControllerHandle
,
72 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
77 LsiScsiControllerStop (
78 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
79 IN EFI_HANDLE ControllerHandle
,
80 IN UINTN NumberOfChildren
,
81 IN EFI_HANDLE
*ChildHandleBuffer
86 // The next seven functions implement EFI_EXT_SCSI_PASS_THRU_PROTOCOL
87 // for the LSI 53C895A SCSI Controller. Refer to UEFI Spec 2.3.1 + Errata C,
89 // - 14.1 SCSI Driver Model Overview,
90 // - 14.7 Extended SCSI Pass Thru Protocol.
96 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
99 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
100 IN EFI_EVENT Event OPTIONAL
105 LsiScsiGetNextTargetLun (
106 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
107 IN OUT UINT8
**TargetPointer
,
113 LsiScsiBuildDevicePath (
114 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
117 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
122 LsiScsiGetTargetLun (
123 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
124 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
125 OUT UINT8
**TargetPointer
,
131 LsiScsiResetChannel (
132 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
137 LsiScsiResetTargetLun (
138 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
145 LsiScsiGetNextTarget (
146 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
147 IN OUT UINT8
**TargetPointer
152 // The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
153 // EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
154 // in English, for display on standard console devices. This is recommended for
155 // UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
156 // Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
158 // Device type names ("LSI 53C895A SCSI Controller") are not formatted because
159 // the driver supports only that device type. Therefore the driver name
160 // suffices for unambiguous identification.
165 LsiScsiGetDriverName (
166 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
168 OUT CHAR16
**DriverName
173 LsiScsiGetDeviceName (
174 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
175 IN EFI_HANDLE DeviceHandle
,
176 IN EFI_HANDLE ChildHandle
,
178 OUT CHAR16
**ControllerName
181 #endif // _LSI_SCSI_DXE_H_