mstorage.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * File : mstorage.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2012-10-01 Yi Qiu first version
  23. * 2012-12-12 heyuanjie87 add MASS endpoints collection
  24. */
  25. #ifndef __MSTORAGE_H__
  26. #define __MSTORAGE_H__
  27. #include <rtthread.h>
  28. #pragma pack(1)
  29. struct umass_descriptor
  30. {
  31. #ifdef RT_USB_DEVICE_COMPOSITE
  32. struct uiad_descriptor iad_desc;
  33. #endif
  34. struct uinterface_descriptor intf_desc;
  35. struct uendpoint_descriptor ep_out_desc;
  36. struct uendpoint_descriptor ep_in_desc;
  37. };
  38. typedef struct umass_descriptor* umass_desc_t;
  39. struct capacity_data
  40. {
  41. rt_uint8_t LastLogicalBlockAddress[4];
  42. rt_uint8_t BlockLengthInBytes[4];
  43. };
  44. struct request_sense_data
  45. {
  46. rt_uint8_t ErrorCode:7;
  47. rt_uint8_t Valid:1;
  48. rt_uint8_t Reserved1;
  49. rt_uint8_t SenseKey:4;
  50. rt_uint8_t Reserved2:4;
  51. rt_uint8_t Information[4];
  52. rt_uint8_t AdditionalSenseLength;
  53. rt_uint8_t Reserved3[4];
  54. rt_uint8_t AdditionalSenseCode;
  55. rt_uint8_t AdditionalSenseCodeQualifier;
  56. rt_uint8_t Reserved4[4];
  57. }request_sense_data_t;
  58. #pragma pack()
  59. #endif