OvmfPkg/MptScsiDxe: Install DriverBinding Protocol
[mirror_edk2.git] / OvmfPkg / MptScsiDxe / MptScsi.c
CommitLineData
feec20b2
NL
1/** @file\r
2\r
3 This driver produces Extended SCSI Pass Thru Protocol instances for\r
4 LSI Fusion MPT SCSI devices.\r
5\r
6 Copyright (C) 2020, Oracle and/or its affiliates.\r
7\r
8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
9\r
10**/\r
11\r
ad8f2d6b 12#include <Library/UefiLib.h>\r
feec20b2
NL
13#include <Uefi/UefiSpec.h>\r
14\r
ad8f2d6b
NL
15//\r
16// Higher versions will be used before lower, 0x10-0xffffffef is the version\r
17// range for IVH (Indie Hardware Vendors)\r
18//\r
19#define MPT_SCSI_BINDING_VERSION 0x10\r
20\r
21//\r
22// Driver Binding\r
23//\r
24\r
25STATIC\r
26EFI_STATUS\r
27EFIAPI\r
28MptScsiControllerSupported (\r
29 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
30 IN EFI_HANDLE ControllerHandle,\r
31 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
32 )\r
33{\r
34 return EFI_UNSUPPORTED;\r
35}\r
36\r
37STATIC\r
38EFI_STATUS\r
39EFIAPI\r
40MptScsiControllerStart (\r
41 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
42 IN EFI_HANDLE ControllerHandle,\r
43 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
44 )\r
45{\r
46 return EFI_UNSUPPORTED;\r
47}\r
48\r
49STATIC\r
50EFI_STATUS\r
51EFIAPI\r
52MptScsiControllerStop (\r
53 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
54 IN EFI_HANDLE ControllerHandle,\r
55 IN UINTN NumberOfChildren,\r
56 IN EFI_HANDLE *ChildHandleBuffer\r
57 )\r
58{\r
59 return EFI_UNSUPPORTED;\r
60}\r
61\r
62STATIC\r
63EFI_DRIVER_BINDING_PROTOCOL mMptScsiDriverBinding = {\r
64 &MptScsiControllerSupported,\r
65 &MptScsiControllerStart,\r
66 &MptScsiControllerStop,\r
67 MPT_SCSI_BINDING_VERSION,\r
68 NULL, // ImageHandle, filled by EfiLibInstallDriverBindingComponentName2\r
69 NULL, // DriverBindingHandle, filled as well\r
70};\r
71\r
feec20b2
NL
72//\r
73// Entry Point\r
74//\r
75\r
76EFI_STATUS\r
77EFIAPI\r
78MptScsiEntryPoint (\r
79 IN EFI_HANDLE ImageHandle,\r
80 IN EFI_SYSTEM_TABLE *SystemTable\r
81 )\r
82{\r
ad8f2d6b
NL
83 return EfiLibInstallDriverBindingComponentName2 (\r
84 ImageHandle,\r
85 SystemTable,\r
86 &mMptScsiDriverBinding,\r
87 ImageHandle, // The handle to install onto\r
88 NULL, // TODO Component name\r
89 NULL // TODO Component name\r
90 );\r
feec20b2 91}\r