]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
Update to support to produce Component Name and & Component Name 2 protocol based...
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciDxe / Ehci.c
index 093388d45f69e593bae3d5f0e1537909db41e809..13ce7fdfb1f9f9f58b4e57f107e46d12a8103642 100644 (file)
@@ -351,7 +351,7 @@ EhcGetRootHubPortStatus (
 \r
   for (Index = 0; Index < MapSize; Index++) {\r
     if (EHC_BIT_IS_SET (State, mUsbPortStateMap[Index].HwState)) {\r
-      PortStatus->PortStatus |= mUsbPortStateMap[Index].UefiState;\r
+      PortStatus->PortStatus = (UINT16) (PortStatus->PortStatus | mUsbPortStateMap[Index].UefiState);\r
     }\r
   }\r
 \r
@@ -359,7 +359,7 @@ EhcGetRootHubPortStatus (
 \r
   for (Index = 0; Index < MapSize; Index++) {\r
     if (EHC_BIT_IS_SET (State, mUsbPortChangeMap[Index].HwState)) {\r
-      PortStatus->PortChangeStatus |= mUsbPortChangeMap[Index].UefiState;\r
+      PortStatus->PortChangeStatus = (UINT16) (PortStatus->PortChangeStatus | mUsbPortChangeMap[Index].UefiState);\r
     }\r
   }\r
 \r
@@ -707,7 +707,7 @@ EhcControlTransfer (
   // endpoint is bidirectional. EhcCreateUrb expects this\r
   // combination of Ep addr and its direction.\r
   //\r
-  Endpoint = 0 | ((TransferDirection == EfiUsbDataIn) ? 0x80 : 0);\r
+  Endpoint = (UINT8) (0 | ((TransferDirection == EfiUsbDataIn) ? 0x80 : 0));\r
   Urb = EhcCreateUrb (\r
           Ehc,\r
           DeviceAddress,\r
@@ -1271,8 +1271,6 @@ EhcAsyncIsochronousTransfer (
   return EFI_UNSUPPORTED;\r
 }\r
 \r
-//@MT: EFI_DRIVER_ENTRY_POINT (EhcDriverEntryPoint)\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 EhcDriverEntryPoint (\r
@@ -1297,14 +1295,13 @@ Returns:
 \r
 --*/\r
 {\r
-  return EfiLibInstallAllDriverProtocols (\r
+  return EfiLibInstallDriverBindingComponentName2 (\r
            ImageHandle,\r
            SystemTable,\r
            &gEhciDriverBinding,\r
            ImageHandle,\r
            &gEhciComponentName,\r
-           NULL,\r
-           NULL\r
+           &gEhciComponentName2\r
            );\r
 }\r
 \r
@@ -1340,7 +1337,7 @@ EhcDriverBindingSupported (
   Status = gBS->OpenProtocol (\r
                   Controller,\r
                   &gEfiPciIoProtocolGuid,\r
-                  &PciIo,\r
+                  (VOID **) &PciIo,\r
                   This->DriverBindingHandle,\r
                   Controller,\r
                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
@@ -1491,7 +1488,7 @@ EhcDriverBindingStart (
   Status = gBS->OpenProtocol (\r
                   Controller,\r
                   &gEfiPciIoProtocolGuid,\r
-                  &PciIo,\r
+                  (VOID **) &PciIo,\r
                   This->DriverBindingHandle,\r
                   Controller,\r
                   EFI_OPEN_PROTOCOL_BY_DRIVER\r
@@ -1567,12 +1564,21 @@ EhcDriverBindingStart (
   // Install the component name protocol, don't fail the start\r
   // because of something for display.\r
   //\r
-  AddUnicodeString (\r
+  AddUnicodeString2 (\r
     "eng",\r
     gEhciComponentName.SupportedLanguages,\r
     &Ehc->ControllerNameTable,\r
-    L"Enhanced Host Controller (USB 2.0)"\r
+    L"Enhanced Host Controller (USB 2.0)",\r
+    TRUE\r
     );\r
+  AddUnicodeString2 (\r
+    "en",\r
+    gEhciComponentName2.SupportedLanguages,\r
+    &Ehc->ControllerNameTable,\r
+    L"Enhanced Host Controller (USB 2.0)",\r
+    FALSE\r
+    );\r
+\r
 \r
   EHC_DEBUG (("EhcDriverBindingStart: EHCI started for controller @ %x\n", Controller));\r
   return EFI_SUCCESS;\r
@@ -1636,7 +1642,7 @@ EhcDriverBindingStop (
   Status = gBS->OpenProtocol (\r
                   Controller,\r
                   &gEfiUsb2HcProtocolGuid,\r
-                  &Usb2Hc,\r
+                  (VOID **) &Usb2Hc,\r
                   This->DriverBindingHandle,\r
                   Controller,\r
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r