SioDriver.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /** @file
  2. Header file for Driver Binding Protocol.
  3. Copyright (c) 2010 - 2019 Intel Corporation. All rights reserved. <BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _SIO_DRIVER_H_
  7. #define _SIO_DRIVER_H_
  8. #include <PiDxe.h>
  9. #include <IndustryStandard/Pci.h>
  10. #include <Library/BaseLib.h>
  11. #include <Library/MemoryAllocationLib.h>
  12. #include <Library/BaseMemoryLib.h>
  13. #include <Library/DebugLib.h>
  14. #include <Library/IoLib.h>
  15. #include <Library/S3BootScriptLib.h>
  16. #include <Library/PciLib.h>
  17. #include <Library/UefiBootServicesTableLib.h>
  18. #include <Library/DevicePathLib.h>
  19. #include <Library/UefiLib.h>
  20. #include <Library/PcdLib.h>
  21. //
  22. // Driver Consumed Protocol Prototypes
  23. //
  24. #include <Protocol/DriverBinding.h>
  25. #include <Protocol/PciIo.h>
  26. #include <Protocol/DevicePath.h>
  27. //
  28. // Driver Produced Protocol Prototypes
  29. //
  30. #include <Protocol/SuperIo.h>
  31. #include "SioChip.h"
  32. #include "SioService.h"
  33. #include "ComponentName.h"
  34. //
  35. // Global Variables definitions
  36. //
  37. extern EFI_DRIVER_BINDING_PROTOCOL mSioDriver;
  38. extern EFI_COMPONENT_NAME_PROTOCOL mSioComponentName;
  39. extern EFI_COMPONENT_NAME2_PROTOCOL mSioComponentName2;
  40. //
  41. // SIO device private data structure
  42. //
  43. #define SIO_DEV_SIGNATURE SIGNATURE_32 ('_', 'S', 'I', 'O')
  44. typedef struct _SIO_DEV {
  45. UINT32 Signature;
  46. EFI_HANDLE PciHandle;
  47. EFI_SIO_ACPI_DEVICE_ID Device;
  48. EFI_HANDLE Handle;
  49. EFI_SIO_PROTOCOL Sio;
  50. EFI_DEVICE_PATH_PROTOCOL *DevicePath;
  51. LIST_ENTRY Link;
  52. } SIO_DEV;
  53. #define SIO_DEV_FROM_THIS(a) CR (a, SIO_DEV, Sio, SIO_DEV_SIGNATURE)
  54. //
  55. // Prototypes for Driver model protocol interface
  56. //
  57. /**
  58. Test to see if this driver supports Controller Handle.
  59. @param[in] This Protocol instance pointer.
  60. @param[in] Controller Handle of device to test
  61. @param[in] RemainingDevicePath Optional parameter use to pick a specific child
  62. device to start.
  63. @retval EFI_SUCCESS This driver supports this device
  64. @retval EFI_ALREADY_STARTED This driver is already running on this device
  65. @retval other This driver does not support this device
  66. **/
  67. EFI_STATUS
  68. EFIAPI
  69. SioDriverSupported (
  70. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  71. IN EFI_HANDLE Controller,
  72. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  73. );
  74. /**
  75. Start this driver on ControllerHandle.
  76. @param[in] This Protocol instance pointer.
  77. @param[in] Controller Handle of device to bind driver to
  78. @param[in] RemainingDevicePath Optional parameter use to pick a specific child
  79. device to start.
  80. @retval EFI_SUCCESS This driver is added to ControllerHandle
  81. @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
  82. @retval other This driver does not support this device
  83. **/
  84. EFI_STATUS
  85. EFIAPI
  86. SioDriverStart (
  87. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  88. IN EFI_HANDLE Controller,
  89. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  90. );
  91. /**
  92. Stop this driver on ControllerHandle.
  93. @param[in] This Protocol instance pointer.
  94. @param[in] Controller Handle of device to stop driver on
  95. @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
  96. children is zero stop the entire bus driver.
  97. @param[in] ChildHandleBuffer List of Child Handles to Stop.
  98. @retval EFI_SUCCESS This driver is removed ControllerHandle
  99. @retval other This driver was not removed from this device
  100. **/
  101. EFI_STATUS
  102. EFIAPI
  103. SioDriverStop (
  104. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  105. IN EFI_HANDLE Controller,
  106. IN UINTN NumberOfChildren,
  107. IN EFI_HANDLE *ChildHandleBuffer
  108. );
  109. #endif