3 This driver produces Extended SCSI Pass Thru Protocol instances for
4 LSI 53C895A SCSI devices.
6 Copyright (C) 2020, SUSE LLC.
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include <Library/UefiLib.h>
13 #include <Uefi/UefiSpec.h>
18 // Probe, start and stop functions of this driver, called by the DXE core for
21 // The following specifications document these interfaces:
22 // - Driver Writer's Guide for UEFI 2.3.1 v1.01, 9 Driver Binding Protocol
23 // - UEFI Spec 2.3.1 + Errata C, 10.1 EFI Driver Binding Protocol
28 LsiScsiControllerSupported (
29 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
30 IN EFI_HANDLE ControllerHandle
,
31 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
34 return EFI_UNSUPPORTED
;
39 LsiScsiControllerStart (
40 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
41 IN EFI_HANDLE ControllerHandle
,
42 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath OPTIONAL
50 LsiScsiControllerStop (
51 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
52 IN EFI_HANDLE ControllerHandle
,
53 IN UINTN NumberOfChildren
,
54 IN EFI_HANDLE
*ChildHandleBuffer
61 // The static object that groups the Supported() (ie. probe), Start() and
62 // Stop() functions of the driver together. Refer to UEFI Spec 2.3.1 + Errata
63 // C, 10.1 EFI Driver Binding Protocol.
66 EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
= {
67 &LsiScsiControllerSupported
,
68 &LsiScsiControllerStart
,
69 &LsiScsiControllerStop
,
70 0x10, // Version, must be in [0x10 .. 0xFFFFFFEF] for IHV-developed drivers
71 NULL
, // ImageHandle, to be overwritten by
72 // EfiLibInstallDriverBindingComponentName2() in LsiScsiEntryPoint()
73 NULL
// DriverBindingHandle, ditto
78 // The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
79 // EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
80 // in English, for display on standard console devices. This is recommended for
81 // UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
82 // Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
84 // Device type names ("LSI 53C895A SCSI Controller") are not formatted because
85 // the driver supports only that device type. Therefore the driver name
86 // suffices for unambiguous identification.
90 EFI_UNICODE_STRING_TABLE mDriverNameTable
[] = {
91 { "eng;en", L
"LSI 53C895A SCSI Controller Driver" },
96 EFI_COMPONENT_NAME_PROTOCOL gComponentName
;
100 LsiScsiGetDriverName (
101 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
103 OUT CHAR16
**DriverName
106 return LookupUnicodeString2 (
108 This
->SupportedLanguages
,
111 (BOOLEAN
)(This
== &gComponentName
) // Iso639Language
117 LsiScsiGetDeviceName (
118 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
119 IN EFI_HANDLE DeviceHandle
,
120 IN EFI_HANDLE ChildHandle
,
122 OUT CHAR16
**ControllerName
125 return EFI_UNSUPPORTED
;
129 EFI_COMPONENT_NAME_PROTOCOL gComponentName
= {
130 &LsiScsiGetDriverName
,
131 &LsiScsiGetDeviceName
,
132 "eng" // SupportedLanguages, ISO 639-2 language codes
136 EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
= {
137 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) &LsiScsiGetDriverName
,
138 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) &LsiScsiGetDeviceName
,
139 "en" // SupportedLanguages, RFC 4646 language codes
143 // Entry point of this driver
148 IN EFI_HANDLE ImageHandle
,
149 IN EFI_SYSTEM_TABLE
*SystemTable
152 return EfiLibInstallDriverBindingComponentName2 (
156 ImageHandle
, // The handle to install onto