9060e3ec |
1 | /** @file\r |
2 | Functions declaration for Bus Specific Driver Override protoocl.\r |
3 | \r |
4 | Copyright (c) 2006 - 2009, Intel Corporation\r |
5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r |
8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
12 | \r |
13 | **/\r |
14 | \r |
15 | \r |
16 | #ifndef _EFI_PCI_DRIVER_OVERRRIDE_H_\r |
17 | #define _EFI_PCI_DRIVER_OVERRRIDE_H_\r |
18 | \r |
19 | #define DRIVER_OVERRIDE_SIGNATURE SIGNATURE_32 ('d', 'r', 'o', 'v')\r |
20 | \r |
21 | //\r |
22 | // PCI driver override driver image list\r |
23 | //\r |
24 | typedef struct {\r |
25 | UINT32 Signature;\r |
26 | LIST_ENTRY Link;\r |
27 | EFI_HANDLE DriverImageHandle;\r |
28 | } PCI_DRIVER_OVERRIDE_LIST;\r |
29 | \r |
30 | \r |
31 | #define DRIVER_OVERRIDE_FROM_LINK(a) \\r |
32 | CR (a, PCI_DRIVER_OVERRIDE_LIST, Link, DRIVER_OVERRIDE_SIGNATURE)\r |
33 | \r |
34 | /**\r |
35 | Initializes a PCI Driver Override Instance.\r |
36 | \r |
37 | @param PciIoDevice PCI Device instance.\r |
38 | \r |
39 | **/\r |
40 | VOID\r |
41 | InitializePciDriverOverrideInstance (\r |
42 | IN OUT PCI_IO_DEVICE *PciIoDevice\r |
43 | );\r |
44 | \r |
45 | /**\r |
46 | Add an overriding driver image.\r |
47 | \r |
48 | @param PciIoDevice Instance of PciIo device.\r |
49 | @param DriverImageHandle new added driver image.\r |
50 | \r |
51 | @retval EFI_SUCCESS Successfully added driver.\r |
52 | @retval EFI_OUT_OF_RESOURCES No memory resource for new driver instance.\r |
53 | @retval other Some error occurred when locating gEfiLoadedImageProtocolGuid.\r |
54 | \r |
55 | **/\r |
56 | EFI_STATUS\r |
57 | AddDriver (\r |
58 | IN PCI_IO_DEVICE *PciIoDevice,\r |
59 | IN EFI_HANDLE DriverImageHandle\r |
60 | );\r |
61 | \r |
62 | \r |
63 | /**\r |
64 | Uses a bus specific algorithm to retrieve a driver image handle for a controller.\r |
65 | \r |
66 | @param This A pointer to the EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL instance.\r |
67 | @param DriverImageHandle On input, a pointer to the previous driver image handle returned\r |
68 | by GetDriver(). On output, a pointer to the next driver\r |
69 | image handle. Passing in a NULL, will return the first driver\r |
70 | image handle.\r |
71 | \r |
72 | @retval EFI_SUCCESS A bus specific override driver is returned in DriverImageHandle.\r |
73 | @retval EFI_NOT_FOUND The end of the list of override drivers was reached.\r |
74 | A bus specific override driver is not returned in DriverImageHandle.\r |
75 | @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a\r |
76 | previous call to GetDriver().\r |
77 | \r |
78 | **/\r |
79 | EFI_STATUS\r |
80 | EFIAPI\r |
81 | GetDriver (\r |
82 | IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This,\r |
83 | IN OUT EFI_HANDLE *DriverImageHandle\r |
84 | );\r |
85 | \r |
86 | #endif\r |