]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / UsbDesc.c
index c9e1755fded79eb2c573d762c02655f54ee13657..269dcbf81bc9aa8ce2a91b18eb0f802d06b916d2 100644 (file)
@@ -1,5 +1,7 @@
 /** @file\r
 \r
+    Manage Usb Descriptor List\r
+\r
 Copyright (c) 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
@@ -9,31 +11,19 @@ http://opensource.org/licenses/bsd-license.php
 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
-  Module Name:\r
-\r
-    UsbDesc.c\r
-\r
-  Abstract:\r
-\r
-    Manage Usb Descriptor List\r
-\r
-  Revision History\r
-\r
-\r
 **/\r
 \r
 #include "UsbBus.h"\r
 \r
 \r
 /**\r
-  Free the interface setting descriptor\r
+  Free the interface setting descriptor.\r
 \r
-  @param  Setting               The descriptor to free\r
+  @param  Setting               The descriptor to free.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 UsbFreeInterfaceDesc (\r
   IN USB_INTERFACE_SETTING  *Setting\r
@@ -61,17 +51,15 @@ UsbFreeInterfaceDesc (
 }\r
 \r
 \r
-\r
 /**\r
   Free a configuration descriptor with its interface\r
-  descriptors. It may be initialized partially\r
+  descriptors. It may be initialized partially.\r
 \r
-  @param  Config                The configuration descriptor to free\r
+  @param  Config                The configuration descriptor to free.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
-STATIC\r
 VOID\r
 UsbFreeConfigDesc (\r
   IN USB_CONFIG_DESC      *Config\r
@@ -112,13 +100,12 @@ UsbFreeConfigDesc (
 }\r
 \r
 \r
-\r
 /**\r
-  Free a device descriptor with its configurations\r
+  Free a device descriptor with its configurations.\r
 \r
-  @param  DevDesc               The device descriptor\r
+  @param  DevDesc               The device descriptor.\r
 \r
-  @return None\r
+  @return None.\r
 \r
 **/\r
 VOID\r
@@ -143,17 +130,16 @@ UsbFreeDevDesc (
 \r
 \r
 /**\r
-  Create a descriptor\r
+  Create a descriptor.\r
 \r
-  @param  DescBuf               The buffer of raw descriptor\r
-  @param  Len                   The lenght of the raw descriptor buffer\r
-  @param  Type                  The type of descriptor to create\r
-  @param  Consumed              Number of bytes consumed\r
+  @param  DescBuf               The buffer of raw descriptor.\r
+  @param  Len                   The lenght of the raw descriptor buffer.\r
+  @param  Type                  The type of descriptor to create.\r
+  @param  Consumed              Number of bytes consumed.\r
 \r
-  @return Created descriptor or NULL\r
+  @return Created descriptor or NULL.\r
 \r
 **/\r
-STATIC\r
 VOID *\r
 UsbCreateDesc (\r
   IN  UINT8               *DescBuf,\r
@@ -226,16 +212,15 @@ UsbCreateDesc (
 \r
 \r
 /**\r
-  Parse an interface desciptor and its endpoints\r
+  Parse an interface desciptor and its endpoints.\r
 \r
-  @param  DescBuf               The buffer of raw descriptor\r
-  @param  Len                   The lenght of the raw descriptor buffer\r
-  @param  Consumed              The number of raw descriptor consumed\r
+  @param  DescBuf               The buffer of raw descriptor.\r
+  @param  Len                   The lenght of the raw descriptor buffer.\r
+  @param  Consumed              The number of raw descriptor consumed.\r
 \r
-  @return The create interface setting or NULL if failed\r
+  @return The create interface setting or NULL if failed.\r
 \r
 **/\r
-STATIC\r
 USB_INTERFACE_SETTING *\r
 UsbParseInterfaceDesc (\r
   IN  UINT8               *DescBuf,\r
@@ -307,13 +292,12 @@ ON_ERROR:
 /**\r
   Parse the configuration descriptor and its interfaces.\r
 \r
-  @param  DescBuf               The buffer of raw descriptor\r
-  @param  Len                   The lenght of the raw descriptor buffer\r
+  @param  DescBuf               The buffer of raw descriptor.\r
+  @param  Len                   The lenght of the raw descriptor buffer.\r
 \r
-  @return The created configuration descriptor\r
+  @return The created configuration descriptor.\r
 \r
 **/\r
-STATIC\r
 USB_CONFIG_DESC *\r
 UsbParseConfigDesc (\r
   IN UINT8                *DescBuf,\r
@@ -407,25 +391,24 @@ ON_ERROR:
 }\r
 \r
 \r
-\r
 /**\r
   USB standard control transfer support routine. This\r
   function is used by USB device. It is possible that\r
   the device's interfaces are still waiting to be\r
   enumerated.\r
 \r
-  @param  UsbDev                The usb device\r
-  @param  Direction             The direction of data transfer\r
-  @param  Type                  Standard / class specific / vendor specific\r
-  @param  Target                The receiving target\r
-  @param  Request               Which request\r
-  @param  Value                 The wValue parameter of the request\r
-  @param  Index                 The wIndex parameter of the request\r
-  @param  Buf                   The buffer to receive data into / transmit from\r
-  @param  Length                The length of the buffer\r
+  @param  UsbDev                The usb device.\r
+  @param  Direction             The direction of data transfer.\r
+  @param  Type                  Standard / class specific / vendor specific.\r
+  @param  Target                The receiving target.\r
+  @param  Request               Which request.\r
+  @param  Value                 The wValue parameter of the request.\r
+  @param  Index                 The wIndex parameter of the request.\r
+  @param  Buf                   The buffer to receive data into / transmit from.\r
+  @param  Length                The length of the buffer.\r
 \r
-  @retval EFI_SUCCESS           The control request is executed\r
-  @retval EFI_DEVICE_ERROR      Failed to execute the control transfer\r
+  @retval EFI_SUCCESS           The control request is executed.\r
+  @retval EFI_DEVICE_ERROR      Failed to execute the control transfer.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -473,23 +456,21 @@ UsbCtrlRequest (
 }\r
 \r
 \r
-\r
 /**\r
   Get the standard descriptors.\r
 \r
-  @param  UsbDev                The USB device to read descriptor from\r
-  @param  DescType              The type of descriptor to read\r
-  @param  DescIndex             The index of descriptor to read\r
+  @param  UsbDev                The USB device to read descriptor from.\r
+  @param  DescType              The type of descriptor to read.\r
+  @param  DescIndex             The index of descriptor to read.\r
   @param  LangId                Language ID, only used to get string, otherwise set\r
-                                it to 0\r
-  @param  Buf                   The buffer to hold the descriptor read\r
-  @param  Length                The length of the buffer\r
+                                it to 0.\r
+  @param  Buf                   The buffer to hold the descriptor read.\r
+  @param  Length                The length of the buffer.\r
 \r
-  @retval EFI_SUCCESS           The descriptor is read OK\r
-  @retval Others                Failed to retrieve the descriptor\r
+  @retval EFI_SUCCESS           The descriptor is read OK.\r
+  @retval Others                Failed to retrieve the descriptor.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 UsbCtrlGetDesc (\r
   IN  USB_DEVICE          *UsbDev,\r
@@ -518,16 +499,15 @@ UsbCtrlGetDesc (
 }\r
 \r
 \r
-\r
 /**\r
   Return the max packet size for endpoint zero. This function\r
   is the first function called to get descriptors during bus\r
   enumeration.\r
 \r
-  @param  UsbDev                The usb device\r
+  @param  UsbDev                The usb device.\r
 \r
-  @retval EFI_SUCCESS           The max packet size of endpoint zero is retrieved\r
-  @retval EFI_DEVICE_ERROR      Failed to retrieve it\r
+  @retval EFI_SUCCESS           The max packet size of endpoint zero is retrieved.\r
+  @retval EFI_DEVICE_ERROR      Failed to retrieve it.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -561,17 +541,15 @@ UsbGetMaxPacketSize0 (
 }\r
 \r
 \r
-\r
 /**\r
   Get the device descriptor for the device.\r
 \r
-  @param  UsbDev                The Usb device to retrieve descriptor from\r
+  @param  UsbDev                The Usb device to retrieve descriptor from.\r
 \r
-  @retval EFI_SUCCESS           The device descriptor is returned\r
-  @retval EFI_OUT_OF_RESOURCES  Failed to allocate memory\r
+  @retval EFI_SUCCESS           The device descriptor is returned.\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate memory.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 UsbGetDevDesc (\r
   IN USB_DEVICE           *UsbDev\r
@@ -605,17 +583,16 @@ UsbGetDevDesc (
 }\r
 \r
 \r
-\r
 /**\r
   Retrieve the indexed string for the language. It requires two\r
   steps to get a string, first to get the string's length. Then\r
   the string itself.\r
 \r
-  @param  UsbDev                The usb device\r
-  @param  Index                 The index the string to retrieve\r
-  @param  LangId                Language ID\r
+  @param  UsbDev                The usb device.\r
+  @param  Index                 The index the string to retrieve.\r
+  @param  LangId                Language ID.\r
 \r
-  @return The created string descriptor or NULL\r
+  @return The created string descriptor or NULL.\r
 \r
 **/\r
 EFI_USB_STRING_DESCRIPTOR *\r
@@ -662,16 +639,14 @@ UsbGetOneString (
 }\r
 \r
 \r
-\r
 /**\r
-  Build the language ID table for string descriptors\r
+  Build the language ID table for string descriptors.\r
 \r
-  @param  UsbDev                The Usb device\r
+  @param  UsbDev                The Usb device.\r
 \r
-  @retval EFI_UNSUPPORTED       This device doesn't support string table\r
+  @retval EFI_UNSUPPORTED       This device doesn't support string table.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 UsbBuildLangTable (\r
   IN USB_DEVICE           *UsbDev\r
@@ -716,20 +691,18 @@ ON_EXIT:
 }\r
 \r
 \r
-\r
 /**\r
   Retrieve the indexed configure for the device. USB device\r
   returns the configuration togetther with the interfaces for\r
   this configuration. Configuration descriptor is also of\r
-  variable length\r
+  variable length.\r
 \r
-  @param  UsbDev                The Usb interface\r
-  @param  Index                 The index of the configuration\r
+  @param  UsbDev                The Usb interface.\r
+  @param  Index                 The index of the configuration.\r
 \r
-  @return The created configuration descriptor\r
+  @return The created configuration descriptor.\r
 \r
 **/\r
-STATIC\r
 EFI_USB_CONFIG_DESCRIPTOR *\r
 UsbGetOneConfig (\r
   IN USB_DEVICE           *UsbDev,\r
@@ -774,16 +747,15 @@ UsbGetOneConfig (
 }\r
 \r
 \r
-\r
 /**\r
   Build the whole array of descriptors. This function must\r
   be called after UsbGetMaxPacketSize0 returns the max packet\r
   size correctly for endpoint 0.\r
 \r
-  @param  UsbDev                The Usb device\r
+  @param  UsbDev                The Usb device.\r
 \r
-  @retval EFI_SUCCESS           The descriptor table is build\r
-  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource for the descriptor\r
+  @retval EFI_SUCCESS           The descriptor table is build.\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate resource for the descriptor.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -877,11 +849,11 @@ UsbBuildDescTable (
 /**\r
   Set the device's address.\r
 \r
-  @param  UsbDev                The device to set address to\r
-  @param  Address               The address to set\r
+  @param  UsbDev                The device to set address to.\r
+  @param  Address               The address to set.\r
 \r
-  @retval EFI_SUCCESS           The device is set to the address\r
-  @retval Others                Failed to set the device address\r
+  @retval EFI_SUCCESS           The device is set to the address.\r
+  @retval Others                Failed to set the device address.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -913,11 +885,11 @@ UsbSetAddress (
   the device's internal state. UsbSelectConfig changes\r
   the Usb bus's internal state.\r
 \r
-  @param  UsbDev                The USB device to set configure to\r
-  @param  ConfigIndex           The configure index to set\r
+  @param  UsbDev                The USB device to set configure to.\r
+  @param  ConfigIndex           The configure index to set.\r
 \r
-  @retval EFI_SUCCESS           The device is configured now\r
-  @retval Others                Failed to set the device configure\r
+  @retval EFI_SUCCESS           The device is configured now.\r
+  @retval Others                Failed to set the device configure.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -944,19 +916,18 @@ UsbSetConfig (
 }\r
 \r
 \r
-\r
 /**\r
   Usb UsbIo interface to clear the feature. This is should\r
   only be used by HUB which is considered a device driver\r
   on top of the UsbIo interface.\r
 \r
-  @param  UsbIo                 The UsbIo interface\r
-  @param  Target                The target of the transfer: endpoint/device\r
-  @param  Feature               The feature to clear\r
-  @param  Index                 The wIndex parameter\r
+  @param  UsbIo                 The UsbIo interface.\r
+  @param  Target                The target of the transfer: endpoint/device.\r
+  @param  Feature               The feature to clear.\r
+  @param  Index                 The wIndex parameter.\r
 \r
-  @retval EFI_SUCCESS           The device feature is cleared\r
-  @retval Others                Failed to clear the feature\r
+  @retval EFI_SUCCESS           The device feature is cleared.\r
+  @retval Others                Failed to clear the feature.\r
 \r
 **/\r
 EFI_STATUS\r