2022-08-18 21:41:19 +08:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, sakumisu
|
2022-02-08 11:44:46 +08:00
|
|
|
*
|
2022-08-18 21:41:19 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2022-02-08 11:44:46 +08:00
|
|
|
*/
|
2022-08-18 21:41:19 +08:00
|
|
|
#ifndef USBH_MSC_H
|
|
|
|
|
#define USBH_MSC_H
|
2022-02-08 11:44:46 +08:00
|
|
|
|
|
|
|
|
#include "usb_msc.h"
|
|
|
|
|
#include "usb_scsi.h"
|
|
|
|
|
|
|
|
|
|
struct usbh_msc {
|
2022-03-19 11:23:40 +08:00
|
|
|
struct usbh_hubport *hport;
|
|
|
|
|
|
2022-02-08 11:44:46 +08:00
|
|
|
uint8_t intf; /* Data interface number */
|
|
|
|
|
uint8_t sdchar;
|
2022-09-15 20:46:14 +08:00
|
|
|
usbh_pipe_t bulkin; /* Bulk IN endpoint */
|
|
|
|
|
usbh_pipe_t bulkout; /* Bulk OUT endpoint */
|
|
|
|
|
struct usbh_urb bulkin_urb; /* Bulk IN urb */
|
|
|
|
|
struct usbh_urb bulkout_urb; /* Bulk OUT urb */
|
|
|
|
|
uint32_t blocknum; /* Number of blocks on the USB mass storage device */
|
|
|
|
|
uint16_t blocksize; /* Block size of USB mass storage device */
|
2022-02-08 11:44:46 +08:00
|
|
|
};
|
|
|
|
|
|
2022-02-24 12:29:06 +08:00
|
|
|
int usbh_msc_scsi_write10(struct usbh_msc *msc_class, uint32_t start_sector, const uint8_t *buffer, uint32_t nsectors);
|
|
|
|
|
int usbh_msc_scsi_read10(struct usbh_msc *msc_class, uint32_t start_sector, const uint8_t *buffer, uint32_t nsectors);
|
|
|
|
|
|
2022-11-26 23:52:58 +08:00
|
|
|
void usbh_msc_run(struct usbh_msc *msc_class);
|
|
|
|
|
void usbh_msc_stop(struct usbh_msc *msc_class);
|
|
|
|
|
|
2022-02-08 11:44:46 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-08-18 21:41:19 +08:00
|
|
|
#endif /* USBH_MSC_H */
|