/** @file\r
\r
+ This file contains URB request, each request is warpped in a\r
+ URB (Usb Request Block).\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
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
- EhciUrb.h\r
-\r
-Abstract:\r
-\r
- This file contains URB request, each request is warpped in a\r
- URB (Usb Request Block)\r
-\r
-Revision History\r
-\r
**/\r
\r
#ifndef _EFI_EHCI_URB_H_\r
typedef struct _EHC_QH EHC_QH;\r
typedef struct _URB URB;\r
\r
-enum {\r
+typedef enum {\r
//\r
// Transfer types, used in URB to identify the transfer type\r
//\r
EHC_INT_TRANSFER_SYNC = 0x04,\r
EHC_INT_TRANSFER_ASYNC = 0x08,\r
\r
- EHC_QTD_SIG = EFI_SIGNATURE_32 ('U', 'S', 'B', 'T'),\r
- EHC_QH_SIG = EFI_SIGNATURE_32 ('U', 'S', 'B', 'H'),\r
- EHC_URB_SIG = EFI_SIGNATURE_32 ('U', 'S', 'B', 'R'),\r
+ EHC_QTD_SIG = SIGNATURE_32 ('U', 'S', 'B', 'T'),\r
+ EHC_QH_SIG = SIGNATURE_32 ('U', 'S', 'B', 'H'),\r
+ EHC_URB_SIG = SIGNATURE_32 ('U', 'S', 'B', 'R'),\r
\r
//\r
// Hardware related bit definitions\r
QH_MICROFRAME_6 = 0x40,\r
QH_MICROFRAME_7 = 0x80,\r
\r
- USB_ERR_SHORT_PACKET = 0x200,\r
-};\r
+ USB_ERR_SHORT_PACKET = 0x200\r
+}EHCI_URB_FLAG_VALUE;\r
\r
//\r
// Fill in the hardware link point: pass in a EHC_QH/QH_HW\r
// Software QTD strcture, this is used to manage all the\r
// QTD generated from a URB. Don't add fields before QtdHw.\r
//\r
-typedef struct _EHC_QTD {\r
+struct _EHC_QTD {\r
QTD_HW QtdHw;\r
UINT32 Signature;\r
LIST_ENTRY QtdList; // The list of QTDs to one end point\r
UINT8 *Data; // Buffer of the original data\r
UINTN DataLen; // Original amount of data in this QTD\r
-} EHC_QTD;\r
+};\r
\r
//\r
// Software QH structure. All three different transaction types\r
// transfer is supported. A dummy QH is linked to EHCI AsyncListAddr\r
// as the reclamation header. New transfer is inserted after this QH.\r
//\r
-typedef struct _EHC_QH {\r
+struct _EHC_QH {\r
QH_HW QhHw;\r
UINT32 Signature;\r
EHC_QH *NextQh; // The queue head pointed to by horizontal link\r
LIST_ENTRY Qtds; // The list of QTDs to this queue head\r
UINTN Interval;\r
-} EHC_QH;\r
+};\r
\r
//\r
// URB (Usb Request Block) contains information for all kinds of\r
// usb requests.\r
//\r
-typedef struct _URB {\r
+struct _URB {\r
UINT32 Signature;\r
LIST_ENTRY UrbList;\r
\r
UINT32 Result;\r
UINTN Completed; // completed data length\r
UINT8 DataToggle;\r
-} URB;\r
+};\r
\r
\r
\r
/**\r
- Create a single QTD to hold the data\r
+ Create a single QTD to hold the data.\r
\r
- @param Ehc The EHCI device\r
- @param Data Current data not associated with a QTD\r
- @param DataLen The length of the data\r
- @param PktId Packet ID to use in the QTD\r
- @param Toggle Data toggle to use in the QTD\r
- @param MaxPacket Maximu packet length of the endpoint\r
+ @param Ehc The EHCI device.\r
+ @param Data Current data not associated with a QTD.\r
+ @param DataLen The length of the data.\r
+ @param PktId Packet ID to use in the QTD.\r
+ @param Toggle Data toggle to use in the QTD.\r
+ @param MaxPacket Maximu packet length of the endpoint.\r
\r
- @return Created QTD or NULL if failed to create one\r
+ @return Created QTD or NULL if failed to create one.\r
\r
**/\r
EHC_QTD *\r
IN UINT8 PktId,\r
IN UINT8 Toggle,\r
IN UINTN MaxPacket\r
- )\r
-;\r
+ );\r
\r
\r
\r
/**\r
- Allocate and initialize a EHCI queue head\r
+ Allocate and initialize a EHCI queue head.\r
\r
- @param Ehci The EHCI device\r
- @param Ep The endpoint to create queue head for\r
+ @param Ehci The EHCI device.\r
+ @param Ep The endpoint to create queue head for.\r
\r
- @return Created queue head or NULL if failed to create one\r
+ @return Created queue head or NULL if failed to create one.\r
\r
**/\r
EHC_QH *\r
EhcCreateQh (\r
IN USB2_HC_DEV *Ehci,\r
IN USB_ENDPOINT *Ep\r
- )\r
-;\r
+ );\r
\r
\r
/**\r
Free an allocated URB. It is possible for it to be partially inited.\r
\r
- @param Ehc The EHCI device\r
- @param Urb The URB to free\r
+ @param Ehc The EHCI device.\r
+ @param Urb The URB to free.\r
\r
- @return None\r
+ @return None.\r
\r
**/\r
VOID\r
EhcFreeUrb (\r
IN USB2_HC_DEV *Ehc,\r
IN URB *Urb\r
- )\r
-;\r
+ );\r
\r
\r
/**\r
- Create a new URB and its associated QTD\r
-\r
- @param Ehc The EHCI device\r
- @param DevAddr The device address\r
- @param EpAddr Endpoint addrress & its direction\r
- @param DevSpeed The device speed\r
- @param Toggle Initial data toggle to use\r
- @param MaxPacket The max packet length of the endpoint\r
- @param Hub The transaction translator to use\r
- @param Type The transaction type\r
- @param Request The standard USB request for control transfer\r
- @param Data The user data to transfer\r
- @param DataLen The length of data buffer\r
- @param Callback The function to call when data is transferred\r
- @param Context The context to the callback\r
- @param Interval The interval for interrupt transfer\r
-\r
- @return Created URB or NULL\r
+ Create a new URB and its associated QTD.\r
+\r
+ @param Ehc The EHCI device.\r
+ @param DevAddr The device address.\r
+ @param EpAddr Endpoint addrress & its direction.\r
+ @param DevSpeed The device speed.\r
+ @param Toggle Initial data toggle to use.\r
+ @param MaxPacket The max packet length of the endpoint.\r
+ @param Hub The transaction translator to use.\r
+ @param Type The transaction type.\r
+ @param Request The standard USB request for control transfer.\r
+ @param Data The user data to transfer.\r
+ @param DataLen The length of data buffer.\r
+ @param Callback The function to call when data is transferred.\r
+ @param Context The context to the callback.\r
+ @param Interval The interval for interrupt transfer.\r
+\r
+ @return Created URB or NULL.\r
\r
**/\r
URB *\r
IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback,\r
IN VOID *Context,\r
IN UINTN Interval\r
- )\r
-;\r
+ );\r
#endif\r