diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-09 10:02:26 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-07-09 10:02:26 +0000 |
commit | 8616fc4c134d866cb6298faaa5d2dd17242dae9c (patch) | |
tree | 73e2b211bc1023c568cc8eb1ec666110606ba7b0 /MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h | |
parent | 78f64f281ae77848694035bd878caffdd19c1f59 (diff) | |
download | edk2-platforms-8616fc4c134d866cb6298faaa5d2dd17242dae9c.tar.xz |
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5436 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h')
-rw-r--r-- | MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h | 115 |
1 files changed, 102 insertions, 13 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h index 14f3c7feb0..dd7868bc1d 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h @@ -1,5 +1,7 @@ /** @file
+ Manage Usb Descriptor List
+
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -9,25 +11,14 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- Module Name:
-
- UsbDesc.h
-
- Abstract:
-
- Manage Usb Descriptor List
-
- Revision History
-
-
**/
#ifndef _USB_DESCRIPTOR_H_
#define _USB_DESCRIPTOR_H_
-enum {
+typedef enum {
USB_MAX_INTERFACE_SETTING = 8
-};
+}USB_INTERFACE_SETTING_MAX;
//
// The RequestType in EFI_USB_DEVICE_REQUEST is composed of
@@ -89,6 +80,26 @@ typedef struct { USB_CONFIG_DESC **Configs;
} USB_DEVICE_DESC;
+/**
+ USB standard control transfer support routine. This
+ function is used by USB device. It is possible that
+ the device's interfaces are still waiting to be
+ enumerated.
+
+ @param UsbDev The usb device.
+ @param Direction The direction of data transfer.
+ @param Type Standard / class specific / vendor specific.
+ @param Target The receiving target.
+ @param Request Which request.
+ @param Value The wValue parameter of the request.
+ @param Index The wIndex parameter of the request.
+ @param Buf The buffer to receive data into / transmit from.
+ @param Length The length of the buffer.
+
+ @retval EFI_SUCCESS The control request is executed.
+ @retval EFI_DEVICE_ERROR Failed to execute the control transfer.
+
+**/
EFI_STATUS
UsbCtrlRequest (
IN USB_DEVICE *UsbDev,
@@ -102,16 +113,47 @@ UsbCtrlRequest ( IN UINTN Length
);
+/**
+ Return the max packet size for endpoint zero. This function
+ is the first function called to get descriptors during bus
+ enumeration.
+
+ @param UsbDev The usb device.
+
+ @retval EFI_SUCCESS The max packet size of endpoint zero is retrieved.
+ @retval EFI_DEVICE_ERROR Failed to retrieve it.
+
+**/
EFI_STATUS
UsbGetMaxPacketSize0 (
IN USB_DEVICE *UsbDev
);
+/**
+ Free a device descriptor with its configurations.
+
+ @param DevDesc The device descriptor.
+
+ @return None.
+
+**/
VOID
UsbFreeDevDesc (
IN USB_DEVICE_DESC *DevDesc
);
+/**
+ Retrieve the indexed string for the language. It requires two
+ steps to get a string, first to get the string's length. Then
+ the string itself.
+
+ @param UsbDev The usb device.
+ @param StringIndex The index of the string to retrieve.
+ @param LangId Language ID.
+
+ @return The created string descriptor or NULL.
+
+**/
EFI_USB_STRING_DESCRIPTOR*
UsbGetOneString (
IN USB_DEVICE *UsbDev,
@@ -119,23 +161,70 @@ UsbGetOneString ( IN UINT16 LangId
);
+/**
+ Build the whole array of descriptors. This function must
+ be called after UsbGetMaxPacketSize0 returns the max packet
+ size correctly for endpoint 0.
+
+ @param UsbDev The Usb device.
+
+ @retval EFI_SUCCESS The descriptor table is build.
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate resource for the descriptor.
+
+**/
EFI_STATUS
UsbBuildDescTable (
IN USB_DEVICE *UsbDev
);
+/**
+ Set the device's address.
+
+ @param UsbDev The device to set address to.
+ @param Address The address to set.
+
+ @retval EFI_SUCCESS The device is set to the address.
+ @retval Others Failed to set the device address.
+
+**/
EFI_STATUS
UsbSetAddress (
IN USB_DEVICE *UsbDev,
IN UINT8 Address
);
+/**
+ Set the device's configuration. This function changes
+ the device's internal state. UsbSelectConfig changes
+ the Usb bus's internal state.
+
+ @param UsbDev The USB device to set configure to.
+ @param ConfigIndex The configure index to set.
+
+ @retval EFI_SUCCESS The device is configured now.
+ @retval Others Failed to set the device configure.
+
+**/
EFI_STATUS
UsbSetConfig (
IN USB_DEVICE *UsbDev,
IN UINT8 ConfigIndex
);
+/**
+ Usb UsbIo interface to clear the feature. This is should
+ only be used by HUB which is considered a device driver
+ on top of the UsbIo interface.
+
+ @param UsbIo The UsbIo interface.
+ @param Target The target of the transfer: endpoint/device.
+ @param Feature The feature to clear.
+ @param Index The wIndex parameter.
+
+ @retval EFI_SUCCESS The device feature is cleared.
+ @retval Others Failed to clear the feature.
+
+**/
EFI_STATUS
UsbIoClearFeature (
IN EFI_USB_IO_PROTOCOL *UsbIo,
|