usbd_msc_scsi.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*!
  2. \file usbd_msc_scsi.h
  3. \brief the header file of the usbd_msc_scsi.c file
  4. \version 2020-08-01, V3.0.0, firmware for GD32F4xx
  5. \version 2022-03-09, V3.1.0, firmware for GD32F4xx
  6. \version 2022-06-30, V3.2.0, firmware for GD32F4xx
  7. */
  8. /*
  9. Copyright (c) 2022, GigaDevice Semiconductor Inc.
  10. Redistribution and use in source and binary forms, with or without modification,
  11. are permitted provided that the following conditions are met:
  12. 1. Redistributions of source code must retain the above copyright notice, this
  13. list of conditions and the following disclaimer.
  14. 2. Redistributions in binary form must reproduce the above copyright notice,
  15. this list of conditions and the following disclaimer in the documentation
  16. and/or other materials provided with the distribution.
  17. 3. Neither the name of the copyright holder nor the names of its contributors
  18. may be used to endorse or promote products derived from this software without
  19. specific prior written permission.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  22. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  23. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  24. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  25. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  26. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  27. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  29. OF SUCH DAMAGE.
  30. */
  31. #ifndef __USBD_MSC_SCSI_H
  32. #define __USBD_MSC_SCSI_H
  33. #include "usbd_msc_bbb.h"
  34. #include "msc_scsi.h"
  35. #define SENSE_LIST_DEEPTH 4U
  36. #define MODE_SENSE6_LENGTH 8U
  37. #define MODE_SENSE10_LENGTH 8U
  38. #define INQUIRY_PAGE00_LENGTH 96U
  39. #define FORMAT_CAPACITIES_LENGTH 20U
  40. extern const uint8_t msc_page00_inquiry_data[];
  41. extern const uint8_t msc_mode_sense6_data[];
  42. extern const uint8_t msc_mode_sense10_data[];
  43. /* function declarations */
  44. /* process SCSI commands */
  45. int8_t scsi_process_cmd (usb_core_driver *udev, uint8_t lun, uint8_t *cmd);
  46. /* load the last error code in the error list */
  47. void scsi_sense_code (usb_core_driver *udev, uint8_t lun, uint8_t skey, uint8_t asc);
  48. #endif /* __USBD_MSC_SCSI_H */