]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiUsbLib/UsbDxeLib.c
[Description]
[mirror_edk2.git] / MdePkg / Library / UefiUsbLib / UsbDxeLib.c
index c8c89acc127ba5b5d4d09b942084f6d7f5847f2c..a3ac0e614016ecff0da5c5ba3c8201c3fe77b8a7 100644 (file)
@@ -1,15 +1,18 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-   Common Dxe Libarary  for USB\r
+  The library provides the USB descritor, interface and protocol\r
+  operations.\r
+  \r
+  Copyright (c) 2004 - 2007, Intel Corporation All rights\r
+  reserved. This program and the accompanying materials are\r
+  licensed and made available under the terms and conditions of\r
+  the BSD License which accompanies this distribution.  The full\r
+  text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+  \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  \r
 \r
 **/\r
 \r
@@ -32,6 +35,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbGetDescriptor (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINT16                  Value,\r
@@ -83,6 +87,7 @@ UsbGetDescriptor (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbSetDescriptor (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINT16                  Value,\r
@@ -132,6 +137,7 @@ UsbSetDescriptor (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbGetInterface (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINT16                  Index,\r
@@ -178,6 +184,7 @@ UsbGetInterface (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbSetInterface (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINT16                  InterfaceNo,\r
@@ -224,6 +231,7 @@ UsbSetInterface (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbGetConfiguration (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   OUT UINT8                   *ConfigValue,\r
@@ -267,6 +275,7 @@ UsbGetConfiguration (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbSetConfiguration (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINT16                  Value,\r
@@ -312,6 +321,7 @@ UsbSetConfiguration (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbSetFeature (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINTN       Recipient,\r
@@ -377,6 +387,7 @@ UsbSetFeature (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbClearFeature (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINTN       Recipient,\r
@@ -442,6 +453,7 @@ UsbClearFeature (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbGetStatus (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINTN       Recipient,\r
@@ -506,6 +518,7 @@ UsbGetStatus (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 UsbClearEndpointHalt (\r
   IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
   IN  UINT8                   EndpointNo,\r
@@ -517,6 +530,10 @@ UsbClearEndpointHalt (
   EFI_USB_INTERFACE_DESCRIPTOR  InterfaceDescriptor;\r
   UINT8                         Index;\r
 \r
+  if (UsbIo == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   ZeroMem (&EndpointDescriptor, sizeof (EFI_USB_ENDPOINT_DESCRIPTOR));\r
   //\r
   // First seach the endpoint descriptor for that endpoint addr\r
@@ -554,7 +571,7 @@ UsbClearEndpointHalt (
   Result = UsbClearFeature (\r
             UsbIo,\r
             USB_TARGET_ENDPOINT,\r
-            EfiUsbEndpointHalt,\r
+            USB_FEATURE_ENDPOINT_HALT,\r
             EndpointDescriptor.EndpointAddress,\r
             Status\r
             );\r