usb_ep0.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  *  Copyright (C) Intrinsyc, Inc., 2002
  3.  *
  4.  *  usb_ep0.h - PXA USB controller driver.
  5.  *              Endpoint zero management
  6.  *
  7.  *  Please see:
  8.  *    linux/Documentation/arm/SA1100/SA1100_USB
  9.  *  for details.
  10.  *
  11.  *  02-May-2002
  12.  *   Frank Becker (Intrinsyc) - 
  13.  * 
  14.  */
  15. #ifndef __USB_EP0_H
  16. #define __USB_EP0_H
  17. #define EP0_FIFO_SIZE 16
  18. #define SETUP_READY (UDCCS0_SA | UDCCS0_OPR)
  19. /*================================================
  20.  * USB Protocol Stuff
  21.  */
  22. /* Request Codes   */
  23. enum { 
  24. GET_STATUS =0,
  25. CLEAR_FEATURE =1,
  26. /* reserved =2 */
  27. SET_FEATURE =3,
  28. /* reserved =4 */
  29. SET_ADDRESS =5,        
  30. GET_DESCRIPTOR =6,
  31. SET_DESCRIPTOR =7,
  32. GET_CONFIGURATION =8,
  33. SET_CONFIGURATION =9,
  34. GET_INTERFACE =10,
  35. SET_INTERFACE =11,
  36. SYNCH_FRAME =12
  37. };
  38. typedef enum {
  39. EP0_IDLE,
  40. EP0_IN_DATA_PHASE,
  41. EP0_END_XFER,
  42. EP0_OUT_DATA_PHASE
  43. } EP0_state;
  44. /* USB Device Requests */
  45. typedef struct
  46. {
  47. __u8 bmRequestType;
  48. __u8 bRequest;
  49. __u16 wValue;
  50. __u16 wIndex;
  51. __u16 wLength;
  52. } usb_dev_request_t  __attribute__ ((packed));
  53. /* Data extraction from usb_request_t fields */
  54. enum { 
  55. kTargetDevice =0,
  56. kTargetInterface=1,
  57. kTargetEndpoint =2 
  58. };
  59. #endif