3 Copyright (c) 2006 - 2007 Intel Corporation. All rights reserved
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #ifndef _VGA_MINIPORT_H_
15 #define _VGA_MINIPORT_H_
18 // The package level header files this module uses
22 // The protocols, PPI and GUID defintions for this module
24 #include <Protocol/PciIo.h>
25 #include <Protocol/VgaMiniPort.h>
26 #include <Protocol/ComponentName2.h>
30 // The Library classes this module consumes
32 #include <Library/DebugLib.h>
33 #include <Library/BaseMemoryLib.h>
34 #include <Library/UefiDriverEntryPoint.h>
35 #include <Library/UefiBootServicesTableLib.h>
36 #include <Library/UefiLib.h>
38 #include <IndustryStandard/Pci22.h>
43 extern EFI_DRIVER_BINDING_PROTOCOL gPciVgaMiniPortDriverBinding
;
44 extern EFI_COMPONENT_NAME_PROTOCOL gPciVgaMiniPortComponentName
;
45 extern EFI_COMPONENT_NAME2_PROTOCOL gPciVgaMiniPortComponentName2
;
48 // PCI VGA MiniPort Device Structure
50 #define PCI_VGA_MINI_PORT_DEV_SIGNATURE SIGNATURE_32('P','V','M','P')
55 EFI_VGA_MINI_PORT_PROTOCOL VgaMiniPort
;
56 EFI_PCI_IO_PROTOCOL
*PciIo
;
57 } PCI_VGA_MINI_PORT_DEV
;
59 #define PCI_VGA_MINI_PORT_DEV_FROM_THIS(a) CR(a, PCI_VGA_MINI_PORT_DEV, VgaMiniPort, PCI_VGA_MINI_PORT_DEV_SIGNATURE)
62 // Driver Binding Protocol functions
67 (Standard DriverBinding Protocol Supported() function)
69 @param This The driver binding protocol.
70 @param Controller The controller handle to check.
71 @param RemainingDevicePath The remaining device path.
73 @retval EFI_SUCCESS The driver supports this controller.
74 @retval EFI_UNSUPPORTED This device isn't supported.
79 PciVgaMiniPortDriverBindingSupported (
80 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
81 IN EFI_HANDLE Controller
,
82 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
86 Install VGA Mini Port Protocol onto VGA device handles
88 (Standard DriverBinding Protocol Start() function)
90 @param This The driver binding instance.
91 @param Controller The controller to check.
92 @param RemainingDevicePath The remaining device patch.
94 @retval EFI_SUCCESS The controller is controlled by the driver.
95 @retval EFI_ALREADY_STARTED The controller is already controlled by the driver.
96 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
101 PciVgaMiniPortDriverBindingStart (
102 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
103 IN EFI_HANDLE Controller
,
104 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
110 (Standard DriverBinding Protocol Stop() function)
112 @param This The driver binding protocol.
113 @param Controller The controller to release.
114 @param NumberOfChildren The child number that opened controller
116 @param ChildHandleBuffer The array of child handle.
118 @retval EFI_SUCCESS The controller or children are stopped.
119 @retval EFI_DEVICE_ERROR Failed to stop the driver.
124 PciVgaMiniPortDriverBindingStop (
125 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
126 IN EFI_HANDLE Controller
,
127 IN UINTN NumberOfChildren
,
128 IN EFI_HANDLE
*ChildHandleBuffer
132 // VGA Mini Port Protocol functions
135 Thunk function of EFI_VGA_MINI_PORT_SET_MODE.
137 @param This Point to instance of EFI_VGA_MINI_PORT_PROTOCOL.
138 @param ModeNumber Mode number.
140 @retval EFI_UNSUPPORTED Invalid mode number.
141 @retval EFI_SUCCESS Success.
146 PciVgaMiniPortSetMode (
147 IN EFI_VGA_MINI_PORT_PROTOCOL
*This
,