diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-19 08:06:15 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-19 08:06:15 +0000 |
commit | 61fb1657e5b2b37a2ec5c879f6fa7689100f0d54 (patch) | |
tree | ad1debff869454be6fdf84bc7528597931b57dcc /EdkModulePkg/Bus | |
parent | 8b018de64f54b67f437c95bf0ed591b03a6cc63b (diff) | |
download | edk2-platforms-61fb1657e5b2b37a2ec5c879f6fa7689100f0d54.tar.xz |
Fix component name bugs when input Controller Name is invalid
Fix the driver binding version for platform/OEM specific drivers
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2274 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Bus')
22 files changed, 86 insertions, 27 deletions
diff --git a/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c b/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c index 8eac997fc7..f11158bb9c 100644 --- a/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c +++ b/EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.c @@ -93,7 +93,7 @@ EFI_DRIVER_BINDING_PROTOCOL gAtapiScsiPassThruDriverBinding = { AtapiScsiPassThruDriverBindingSupported,
AtapiScsiPassThruDriverBindingStart,
AtapiScsiPassThruDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430.c b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430.c index 68c483071c..c5fa53464f 100644 --- a/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430.c +++ b/EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430.c @@ -30,7 +30,7 @@ EFI_DRIVER_BINDING_PROTOCOL gCirrusLogic5430DriverBinding = { CirrusLogic5430ControllerDriverSupported,
CirrusLogic5430ControllerDriverStart,
CirrusLogic5430ControllerDriverStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/ComponentName.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/ComponentName.c index e0d2010cd4..12cb7665d1 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/ComponentName.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/ComponentName.c @@ -162,6 +162,17 @@ EhciComponentNameGetControllerName ( return EFI_UNSUPPORTED;
}
//
+ // Make sure this driver is currently managing ControllerHandle
+ //
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ gEhciDriverBinding.DriverBindingHandle,
+ &gEfiPciIoProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ //
// Get the device context
//
Status = gBS->OpenProtocol (
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c index 8f32abf0dc..2d6dc838a4 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c @@ -218,7 +218,7 @@ EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding = { EhciDriverBindingSupported,
EhciDriverBindingStart,
EhciDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ComponentName.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ComponentName.c index edead729b4..12673c9c92 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ComponentName.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/ComponentName.c @@ -125,16 +125,13 @@ IDEBusComponentNameGetControllerName ( IDE_BLK_IO_DEV *IdeBlkIoDevice;
//
- // Get the controller context
+ // Make sure this driver is currently managing ControllHandle
//
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiCallerIdGuid,
- NULL,
- gIDEBusDriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL
- );
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ gIDEBusDriverBinding.DriverBindingHandle,
+ &gEfiIdeControllerInitProtocolGuid
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -148,6 +145,15 @@ IDEBusComponentNameGetControllerName ( );
}
+ Status = EfiTestChildHandle (
+ ControllerHandle,
+ ChildHandle,
+ &gEfiPciIoProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
//
// Get the child context
//
diff --git a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c index 3b0e69e929..c0cec601b8 100644 --- a/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c +++ b/EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c @@ -26,7 +26,7 @@ EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding = { IDEBusDriverBindingSupported,
IDEBusDriverBindingStart,
IDEBusDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/pcibus.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/pcibus.c index ed56578757..43d3e38dd1 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/pcibus.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/pcibus.c @@ -67,7 +67,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding = { PciBusDriverBindingSupported,
PciBusDriverBindingStart,
PciBusDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Pci/Uhci/Dxe/ComponentName.c b/EdkModulePkg/Bus/Pci/Uhci/Dxe/ComponentName.c index 71d9339a8f..909912f329 100644 --- a/EdkModulePkg/Bus/Pci/Uhci/Dxe/ComponentName.c +++ b/EdkModulePkg/Bus/Pci/Uhci/Dxe/ComponentName.c @@ -162,6 +162,17 @@ UhciComponentNameGetControllerName ( return EFI_UNSUPPORTED;
}
//
+ // Make sure this driver is currently managing ControllerHandle
+ //
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ gUhciDriverBinding.DriverBindingHandle,
+ &gEfiPciIoProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ //
// Get the device context
//
Status = gBS->OpenProtocol (
diff --git a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c index 14f8bf2790..96c5be48ba 100644 --- a/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c +++ b/EdkModulePkg/Bus/Pci/Uhci/Dxe/uhci.c @@ -364,7 +364,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUhciDriverBinding = { UHCIDriverBindingSupported,
UHCIDriverBindingStart,
UHCIDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c index ecb32f9adf..a5692f4dbd 100644 --- a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c +++ b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c @@ -192,7 +192,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUndiDriverBinding = { UndiDriverSupported,
UndiDriverStart,
UndiDriverStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c b/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c index 6a3778c919..2ef31fb38c 100644 --- a/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c +++ b/EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.c @@ -50,7 +50,7 @@ EFI_DRIVER_BINDING_PROTOCOL gSCSIBusDriverBinding = { SCSIBusDriverBindingSupported,
SCSIBusDriverBindingStart,
SCSIBusDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ComponentName.c b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ComponentName.c index 15f02d6c41..e1d0f8d470 100644 --- a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ComponentName.c +++ b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ComponentName.c @@ -163,6 +163,17 @@ ScsiDiskComponentNameGetControllerName ( }
//
+ // Make sure this driver is currently managing ControllerHandle
+ //
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ gScsiDiskDriverBinding.DriverBindingHandle,
+ &gEfiScsiIoProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ //
// Get the device context
//
Status = gBS->OpenProtocol (
diff --git a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c index 88c4c3aec8..4be2c38817 100644 --- a/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c +++ b/EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.c @@ -48,7 +48,7 @@ EFI_DRIVER_BINDING_PROTOCOL gScsiDiskDriverBinding = { ScsiDiskDriverBindingSupported,
ScsiDiskDriverBindingStart,
ScsiDiskDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Usb/UsbBot/Dxe/ComponentName.c b/EdkModulePkg/Bus/Usb/UsbBot/Dxe/ComponentName.c index 6a9cf13456..34ab75864f 100644 --- a/EdkModulePkg/Bus/Usb/UsbBot/Dxe/ComponentName.c +++ b/EdkModulePkg/Bus/Usb/UsbBot/Dxe/ComponentName.c @@ -161,7 +161,17 @@ UsbBotComponentNameGetControllerName ( if (ChildHandle != NULL) {
return EFI_UNSUPPORTED;
}
-
+ //
+ // Make sure this driver is currently managing ControllerHandle
+ //
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ gUsbBotDriverBinding.DriverBindingHandle,
+ &gEfiUsbIoProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
//
// Get the device context
//
diff --git a/EdkModulePkg/Bus/Usb/UsbBot/Dxe/bot.c b/EdkModulePkg/Bus/Usb/UsbBot/Dxe/bot.c index 8cd6b8e6f6..acba154842 100644 --- a/EdkModulePkg/Bus/Usb/UsbBot/Dxe/bot.c +++ b/EdkModulePkg/Bus/Usb/UsbBot/Dxe/bot.c @@ -62,7 +62,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbBotDriverBinding = { BotDriverBindingSupported,
BotDriverBindingStart,
BotDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c index 7bbb6f7a06..837a6001dd 100644 --- a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c +++ b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c @@ -68,7 +68,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbBusDriverBinding = { UsbBusControllerDriverSupported,
UsbBusControllerDriverStart,
UsbBusControllerDriverStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c index 913ac225e9..d9b094d114 100644 --- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c +++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/Cbi0.c @@ -73,7 +73,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbCbi0DriverBinding = { Cbi0DriverBindingSupported,
Cbi0DriverBindingStart,
Cbi0DriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/ComponentName.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/ComponentName.c index 7bbbb0f701..7d16b5a1e3 100644 --- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/ComponentName.c +++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/ComponentName.c @@ -163,7 +163,17 @@ UsbCbi0ComponentNameGetControllerName ( if (ChildHandle != NULL) {
return EFI_UNSUPPORTED;
}
-
+ //
+ // Make sure this driver is currently managing ControllerHandle
+ //
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ gUsbCbi0DriverBinding.DriverBindingHandle,
+ &gEfiUsbIoProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
//
// Get the device context
//
diff --git a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c index dd1c927dae..d778497096 100644 --- a/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c +++ b/EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/cbi1.c @@ -117,7 +117,7 @@ EFI_DRIVER_BINDING_PROTOCOL gCBI1DriverBinding = { CBI1DriverBindingSupported,
CBI1DriverBindingStart,
CBI1DriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c index a59de11998..ec496a6e39 100644 --- a/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c +++ b/EdkModulePkg/Bus/Usb/UsbKb/Dxe/efikey.c @@ -103,7 +103,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbKeyboardDriverBinding = { USBKeyboardDriverBindingSupported,
USBKeyboardDriverBindingStart,
USBKeyboardDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c index 932b8c5ed9..0d57f7642d 100644 --- a/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c +++ b/EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.c @@ -109,7 +109,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUSBFloppyDriverBinding = { USBFloppyDriverBindingSupported,
USBFloppyDriverBindingStart,
USBFloppyDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
diff --git a/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c b/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c index 81da0205a4..063247376b 100644 --- a/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c +++ b/EdkModulePkg/Bus/Usb/UsbMouse/Dxe/usbmouse.c @@ -61,7 +61,7 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding = { USBMouseDriverBindingSupported,
USBMouseDriverBindingStart,
USBMouseDriverBindingStop,
- 0x10,
+ 0xa,
NULL,
NULL
};
|