mstorage.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * File : mstorage.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2012-10-01 Yi Qiu first version
  13. * 2012-12-12 heyuanjie87 add MASS endpoints collection
  14. */
  15. #ifndef __MSTORAGE_H__
  16. #define __MSTORAGE_H__
  17. #include <rtthread.h>
  18. #pragma pack(1)
  19. struct ustorage_cbw
  20. {
  21. rt_uint32_t signature;
  22. rt_uint32_t tag;
  23. rt_uint32_t xfer_len;
  24. rt_uint8_t dflags;
  25. rt_uint8_t lun;
  26. rt_uint8_t cb_len;
  27. rt_uint8_t cb[16];
  28. };
  29. typedef struct ustorage_cbw* ustorage_cbw_t;
  30. struct ustorage_csw
  31. {
  32. rt_uint32_t signature;
  33. rt_uint32_t tag;
  34. rt_uint32_t data_reside;
  35. rt_uint8_t status;
  36. };
  37. typedef struct ustorage_csw* ustorage_csw_t;
  38. struct umass_descriptor
  39. {
  40. struct uinterface_descriptor intf_desc;
  41. struct uendpoint_descriptor ep_out_desc;
  42. struct uendpoint_descriptor ep_in_desc;
  43. };
  44. typedef struct umass_descriptor* umass_desc_t;
  45. struct capacity_data
  46. {
  47. rt_uint8_t LastLogicalBlockAddress[4];
  48. rt_uint8_t BlockLengthInBytes[4];
  49. };
  50. struct request_sense_data
  51. {
  52. rt_uint8_t ErrorCode:7;
  53. rt_uint8_t Valid:1;
  54. rt_uint8_t Reserved1;
  55. rt_uint8_t SenseKey:4;
  56. rt_uint8_t Reserved2:4;
  57. rt_uint8_t Information[4];
  58. rt_uint8_t AdditionalSenseLength;
  59. rt_uint8_t Reserved3[4];
  60. rt_uint8_t AdditionalSenseCode;
  61. rt_uint8_t AdditionalSenseCodeQualifier;
  62. rt_uint8_t Reserved4[4];
  63. }request_sense_data_t;
  64. struct mass_eps
  65. {
  66. uep_t ep_in;
  67. uep_t ep_out;
  68. };
  69. typedef struct mass_eps* mass_eps_t;
  70. #pragma pack()
  71. #endif