usbHcdLib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:4k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usbHcdLib.h - HCD functional API */
  2. /* Copyright 2000 Wind River Systems, Inc. */
  3. /*
  4. Modification history
  5. --------------------
  6. 01e,26jan00,rcb  Change <bytesPerFrame> parameter in usbHcdPipeCreate() to
  7.  <bandwidth> and redefined as UINT32.
  8. 01d,29nov99,rcb  Remove obsolete function usbHcdBusReset().
  9.  Increase frame number fields to 32 bits.
  10. 01c,23nov99,rcb  Replace bandwidth alloc/release functions with pipe
  11.  create/destroy functions...generalizes approach for use
  12.  with OHCI HCD.
  13. 01b,07sep99,rcb  Add support for management callbacks in attach.
  14.  Add set-bus-state API.
  15. 01a,08jun99,rcb  First.
  16. */
  17. /*
  18. DESCRIPTION
  19. This file defines a functional interface to the HCD.
  20. */
  21. #ifndef __INCusbHcdLibh
  22. #define __INCusbHcdLibh
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* includes */
  27. #include "drv/usb/usbHcd.h"
  28. /* defines */
  29. /* typedefs */
  30. /*
  31.  * HCD_NEXUS
  32.  *
  33.  * HCD_NEXUS contains the entry point and HCD_CLIENT_HANDLE needed by an
  34.  * HCD caller to invoke an HCD.
  35.  */
  36. typedef struct hcd_nexus
  37.     {
  38.     HCD_EXEC_FUNC hcdExecFunc;     /* HCD primary entry point */
  39.     HCD_CLIENT_HANDLE handle;     /* client's handle with HCD */
  40.     } HCD_NEXUS, *pHCD_NEXUS;
  41. /* functions */
  42. STATUS usbHcdAttach
  43.     (
  44.     HCD_EXEC_FUNC hcdExecFunc,     /* HCD's primary entry point */
  45.     pVOID param,     /* HCD-specific param */
  46.     USB_HCD_MNGMT_CALLBACK callback,/* management callback */
  47.     pVOID callbackParam,     /* parameter to management callback */
  48.     pHCD_NEXUS pNexus,     /* nexus will be initialized on return */
  49.     pUINT16 pBusCount
  50.     );
  51. STATUS usbHcdDetach
  52.     (
  53.     pHCD_NEXUS pNexus     /* client's nexus */
  54.     );
  55. STATUS usbHcdSetBusState
  56.     (
  57.     pHCD_NEXUS pNexus,     /* client's nexus */
  58.     UINT16 busNo,     /* bus number to suspend */
  59.     UINT16 busState     /* desired bus state */
  60.     );
  61. STATUS usbHcdSofIntervalGet
  62.     (
  63.     pHCD_NEXUS pNexus,     /* client's nexus */
  64.     UINT16 busNo,     /* bus number */
  65.     pUINT16 pSofInterval     /* bfr to receive SOF interval */
  66.     );
  67. STATUS usbHcdSofIntervalSet
  68.     (
  69.     pHCD_NEXUS pNexus,     /* client's nexus */
  70.     UINT16 busNo,     /* bus number */
  71.     UINT16 sofInterval     /* new SOF interval */
  72.     );
  73. STATUS usbHcdCurrentFrameGet
  74.     (
  75.     pHCD_NEXUS pNexus,     /* client's nexus */
  76.     UINT16 busNo,     /* bus number */
  77.     pUINT32 pFrameNo,     /* current frame number */
  78.     pUINT32 pFrameWindow     /* size of frame window */
  79.     );
  80. STATUS usbHcdIrpSubmit
  81.     (
  82.     pHCD_NEXUS pNexus,     /* client's nexus */
  83.     HCD_PIPE_HANDLE pipeHandle,     /* pipe to which IRP is directed */
  84.     pUSB_IRP pIrp     /* IRP to be executed */
  85.     );
  86. STATUS usbHcdIrpCancel
  87.     (
  88.     pHCD_NEXUS pNexus,     /* client's nexus */
  89.     pUSB_IRP pIrp     /* IRP to be canceled */
  90.     );
  91. STATUS usbHcdPipeCreate
  92.     (
  93.     pHCD_NEXUS pNexus,     /* client's nexus */
  94.     UINT16 busNo,     /* bus number for IRP */
  95.     UINT16 busAddress,     /* bus address of USB device */
  96.     UINT16 endpoint,     /* endpoint on device */
  97.     UINT16 transferType,     /* transfer type */
  98.     UINT16 direction,     /* pipe/transfer direction */
  99.     UINT16 speed,     /* transfer speed */
  100.     UINT16 maxPacketSize,     /* packet size */
  101.     UINT32 bandwidth,     /* bandwidth required by pipe */
  102.     UINT16 interval,     /* service interval */
  103.     pUINT32 pTime,     /* calculated packet time on return */
  104.     pHCD_PIPE_HANDLE pPipeHandle    /* HCD pipe handle */
  105.     );
  106. STATUS usbHcdPipeDestroy
  107.     (
  108.     pHCD_NEXUS pNexus,     /* client's nexus */
  109.     HCD_PIPE_HANDLE pipeHandle     /* pipe to be destroyed */
  110.     );
  111. STATUS usbHcdPipeModify
  112.     (
  113.     pHCD_NEXUS pNexus,     /* client's nexus */
  114.     HCD_PIPE_HANDLE pipeHandle,     /* pipe to be modified */
  115.     UINT16 busAddress,     /* new bus address or 0 */
  116.     UINT16 maxPacketSize     /* new max packet size or 0 */
  117.     );
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. #endif /* __INCusbHcdLibh */
  122. /* End of file. */