//\r
EFI_GUID mUsbBusProtocolGuid = EFI_USB_BUS_PROTOCOL_GUID;\r
\r
+EFI_USB_IO_PROTOCOL mUsbIoProtocol = {\r
+ UsbIoControlTransfer,\r
+ UsbIoBulkTransfer,\r
+ UsbIoAsyncInterruptTransfer,\r
+ UsbIoSyncInterruptTransfer,\r
+ UsbIoIsochronousTransfer,\r
+ UsbIoAsyncIsochronousTransfer,\r
+ UsbIoGetDeviceDescriptor,\r
+ UsbIoGetActiveConfigDescriptor,\r
+ UsbIoGetInterfaceDescriptor,\r
+ UsbIoGetEndpointDescriptor,\r
+ UsbIoGetStringDescriptor,\r
+ UsbIoGetSupportedLanguages,\r
+ UsbIoPortReset\r
+};\r
+\r
+EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {\r
+ UsbBusControllerDriverSupported,\r
+ UsbBusControllerDriverStart,\r
+ UsbBusControllerDriverStop,\r
+ 0xa,\r
+ NULL,\r
+ NULL\r
+};\r
+\r
\r
/**\r
USB_IO function to execute a control transfer. This\r
@param UsbStatus USB result\r
\r
@retval EFI_INVALID_PARAMETER The parameters are invalid\r
- @retval EFI_SUCCESS The control transfer succeded.\r
+ @retval EFI_SUCCESS The control transfer succeeded.\r
@retval Others Failed to execute the transfer\r
\r
**/\r
// should stop use its current UsbIo after calling this driver. The old\r
// UsbIo will be uninstalled and new UsbIo be installed. We can't use\r
// ReinstallProtocol since interfaces in different configuration may be\r
- // completely irrellvant.\r
+ // completely irrelevant.\r
//\r
if ((Request->Request == USB_REQ_SET_CONFIG) &&\r
(Request->RequestType == USB_REQUEST_TYPE (EfiUsbNoData, USB_REQ_TYPE_STANDARD,\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to open device path %r\n", Status));\r
\r
- gBS->FreePool (UsbBus);\r
+ FreePool (UsbBus);\r
return Status;\r
}\r
\r
//\r
// Get USB_HC2/USB_HC host controller protocol (EHCI/UHCI).\r
- // This is for backward compatbility with EFI 1.x. In UEFI\r
+ // This is for backward compatibility with EFI 1.x. In UEFI\r
// 2.x, USB_HC2 replaces USB_HC. We will open both USB_HC2\r
// and USB_HC because EHCI driver will install both protocols\r
// (for the same reason). If we don't consume both of them,\r
UsbHcSetState (UsbBus, EfiUsbHcStateOperational);\r
\r
//\r
- // Install an EFI_USB_BUS_PROTOCOL to host controler to identify it.\r
+ // Install an EFI_USB_BUS_PROTOCOL to host controller to identify it.\r
//\r
Status = gBS->InstallProtocolInterface (\r
&Controller,\r
RootIf = AllocateZeroPool (sizeof (USB_INTERFACE));\r
\r
if (RootIf == NULL) {\r
- gBS->FreePool (RootHub);\r
+ FreePool (RootHub);\r
Status = EFI_OUT_OF_RESOURCES;\r
goto FREE_ROOTHUB;\r
}\r
\r
UsbBus->Devices[0] = RootHub;\r
\r
- DEBUG ((EFI_D_INFO, "UsbBusStart: usb bus started on %x, root hub %x\n", Controller, RootIf));\r
+ DEBUG ((EFI_D_INFO, "UsbBusStart: usb bus started on %p, root hub %p\n", Controller, RootIf));\r
return EFI_SUCCESS;\r
\r
FREE_ROOTHUB:\r
if (RootIf != NULL) {\r
- gBS->FreePool (RootIf);\r
+ FreePool (RootIf);\r
}\r
if (RootHub != NULL) {\r
- gBS->FreePool (RootHub);\r
+ FreePool (RootHub);\r
}\r
\r
UNINSTALL_USBBUS:\r
This->DriverBindingHandle,\r
Controller\r
);\r
- gBS->FreePool (UsbBus);\r
+ FreePool (UsbBus);\r
\r
DEBUG ((EFI_D_ERROR, "UsbBusStart: Failed to start bus driver %r\n", Status));\r
return Status;\r
}\r
\r
-EFI_USB_IO_PROTOCOL mUsbIoProtocol = {\r
- UsbIoControlTransfer,\r
- UsbIoBulkTransfer,\r
- UsbIoAsyncInterruptTransfer,\r
- UsbIoSyncInterruptTransfer,\r
- UsbIoIsochronousTransfer,\r
- UsbIoAsyncIsochronousTransfer,\r
- UsbIoGetDeviceDescriptor,\r
- UsbIoGetActiveConfigDescriptor,\r
- UsbIoGetInterfaceDescriptor,\r
- UsbIoGetEndpointDescriptor,\r
- UsbIoGetStringDescriptor,\r
- UsbIoGetSupportedLanguages,\r
- UsbIoPortReset\r
-};\r
-\r
\r
/**\r
The USB bus driver entry pointer.\r
Check whether USB bus driver support this device.\r
\r
@param This The USB bus driver binding protocol.\r
- @param Controller The controller handle to test againist.\r
+ @param Controller The controller handle to check.\r
@param RemainingDevicePath The remaining device path.\r
\r
@retval EFI_SUCCESS The bus supports this controller.\r
\r
if (EFI_ERROR (Status)) {\r
//\r
- // If first start, build the bus execute enviorment and install bus protocol\r
+ // If first start, build the bus execute environment and install bus protocol\r
//\r
Status = UsbBusBuildProtocol (This, Controller, RemainingDevicePath);\r
if (EFI_ERROR (Status)) {\r
return EFI_SUCCESS;\r
}\r
\r
- DEBUG (( EFI_D_INFO, "UsbBusStop: usb bus stopped on %x\n", Controller));\r
+ DEBUG (( EFI_D_INFO, "UsbBusStop: usb bus stopped on %p\n", Controller));\r
\r
//\r
// Locate USB_BUS for the current host controller\r
\r
return Status;\r
}\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL mUsbBusDriverBinding = {\r
- UsbBusControllerDriverSupported,\r
- UsbBusControllerDriverStart,\r
- UsbBusControllerDriverStop,\r
- 0xa,\r
- NULL,\r
- NULL\r
-};\r