97 Status =
gBS->OpenProtocol (
99 &gEfiPciIoProtocolGuid,
101 This->DriverBindingHandle,
103 EFI_OPEN_PROTOCOL_BY_DRIVER
105 if (EFI_ERROR (Status)) {
109 Status = PciIo->Pci.
Read (
113 sizeof (Pci) /
sizeof (UINT32),
117 if (!EFI_ERROR (Status)) {
118 Status = EFI_UNSUPPORTED;
119 if ((Pci.Hdr.Command & 0x03) == 0x03) {
120 if (Pci.Hdr.ClassCode[2] == PCI_CLASS_BRIDGE) {
125 if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA) {
132 if ((Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE) &&
133 (Pci.Hdr.VendorId == 0x8086))
140 Status = PciIo->GetLocation (
147 if (!EFI_ERROR (Status) && (FunctionNumber == 0)) {
150 Status = EFI_UNSUPPORTED;
159 &gEfiPciIoProtocolGuid,
160 This->DriverBindingHandle,
225 UINT64 OriginalAttributes;
229 UINT32 ChildDeviceNumber;
233 OriginalAttributes = 0;
240 Status =
gBS->OpenProtocol (
242 &gEfiPciIoProtocolGuid,
244 This->DriverBindingHandle,
246 EFI_OPEN_PROTOCOL_BY_DRIVER
248 if (EFI_ERROR (Status)) {
255 Status =
gBS->OpenProtocol (
257 &gEfiDevicePathProtocolGuid,
258 (VOID **)&ParentDevicePath,
259 This->DriverBindingHandle,
261 EFI_OPEN_PROTOCOL_BY_DRIVER
263 if (EFI_ERROR (Status)) {
266 &gEfiPciIoProtocolGuid,
267 This->DriverBindingHandle,
276 Status = PciIo->Attributes (
282 if (EFI_ERROR (Status)) {
288 if ((Supports == 0) ||
292 Status = EFI_UNSUPPORTED;
296 Status = PciIo->Attributes (
302 if (EFI_ERROR (Status)) {
306 Attributes = EFI_PCI_DEVICE_ENABLE |
309 Status = PciIo->Attributes (
315 if (EFI_ERROR (Status)) {
325 if (Private ==
NULL) {
326 Status = EFI_OUT_OF_RESOURCES;
330 Private->PciIo = PciIo;
331 Private->OriginalAttributes = OriginalAttributes;
333 Status =
gBS->InstallProtocolInterface (
339 if (EFI_ERROR (Status)) {
357 (EFI_IO_BUS_LPC | EFI_IOB_PC_ENABLE),
370 if (ChildDeviceNumber == 0) {
371 Status = EFI_DEVICE_ERROR;
375 if (EFI_ERROR (Status)) {
376 if ((PciIo !=
NULL) && Enabled) {
387 &gEfiDevicePathProtocolGuid,
388 This->DriverBindingHandle,
394 &gEfiPciIoProtocolGuid,
395 This->DriverBindingHandle,
399 if (Private !=
NULL) {
400 gBS->UninstallMultipleProtocolInterfaces (
460 BOOLEAN AllChildrenStopped;
465 if (NumberOfChildren == 0) {
469 Status =
gBS->OpenProtocol (
473 This->DriverBindingHandle,
475 EFI_OPEN_PROTOCOL_GET_PROTOCOL
477 if (EFI_ERROR (Status)) {
481 Status = Private->PciIo->Attributes (
484 Private->OriginalAttributes,
487 if (EFI_ERROR (Status)) {
491 gBS->UninstallProtocolInterface (
501 Status =
gBS->CloseProtocol (
503 &gEfiDevicePathProtocolGuid,
504 This->DriverBindingHandle,
507 if (EFI_ERROR (Status)) {
511 Status =
gBS->CloseProtocol (
513 &gEfiPciIoProtocolGuid,
514 This->DriverBindingHandle,
517 if (EFI_ERROR (Status)) {
527 AllChildrenStopped =
TRUE;
529 for (Index = 0; Index < NumberOfChildren; Index++) {
530 Status =
gBS->OpenProtocol (
531 ChildHandleBuffer[Index],
532 &gEfiSioProtocolGuid,
534 This->DriverBindingHandle,
536 EFI_OPEN_PROTOCOL_GET_PROTOCOL
538 if (!EFI_ERROR (Status)) {
539 SioDevice = SIO_DEV_FROM_SIO (Sio);
544 Status =
gBS->CloseProtocol (
546 &gEfiPciIoProtocolGuid,
547 This->DriverBindingHandle,
548 ChildHandleBuffer[Index]
550 Status =
gBS->UninstallMultipleProtocolInterfaces (
551 ChildHandleBuffer[Index],
552 &gEfiDevicePathProtocolGuid,
553 SioDevice->DevicePath,
554 &gEfiSioProtocolGuid,
559 if (!EFI_ERROR (Status)) {
569 &gEfiPciIoProtocolGuid,
571 This->DriverBindingHandle,
572 ChildHandleBuffer[Index],
573 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
578 if (EFI_ERROR (Status)) {
579 AllChildrenStopped =
FALSE;
583 if (!AllChildrenStopped) {
584 return EFI_DEVICE_ERROR;
613 &gSioBusDriverBinding,
615 &gSioBusComponentName,
616 &gSioBusComponentName2
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type, Value, DevicePathParameter)
#define EFI_PCI_IO_ATTRIBUTE_ISA_IO
I/O cycles 0x0100-0x03FF or greater (10 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16
I/O cycles 0x0100-0x03FF or greater (16 bit decode)
@ EfiPciIoAttributeOperationGet
@ EfiPciIoAttributeOperationEnable
@ EfiPciIoAttributeOperationSet
@ EfiPciIoAttributeOperationSupported
#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO
I/O cycles 0x0000-0x00FF (10 bit decode)
#define EFI_PROGRESS_CODE
EFI_STATUS EFIAPI SioBusDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI SioBusDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI SioBusDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI SioBusDxeDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
UINT32 SioCreateAllChildDevices(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
EFI_PCI_IO_PROTOCOL_CONFIG Read