Sd over usb macos (#1096)

* sd over usb works at least up to intel + big sur, not yet on m1 + ventura
* style
This commit is contained in:
E.T
2023-06-02 12:20:11 +02:00
committed by GitHub
parent c3264f0d15
commit 2fd3bf0136
2 changed files with 27 additions and 5 deletions

View File

@@ -175,6 +175,22 @@ uint8_t mode_sense6(msd_cbw_t* msd_cbw_data) {
return 0;
}
uint8_t mode_sense10(msd_cbw_t* msd_cbw_data) {
(void)msd_cbw_data;
scsi_mode_sense10_response_t ret = {
.byte = {
cpu_to_be16(sizeof(scsi_mode_sense6_response_t) - 2),
0,
0,
0}};
memcpy(&usb_bulk_buffer[0], &ret, sizeof(scsi_mode_sense10_response_t));
usb_send_bulk(&usb_bulk_buffer[0], sizeof(scsi_mode_sense10_response_t));
return 0;
}
static data_request_t decode_data_request(const uint8_t* cmd) {
data_request_t req;
uint32_t lba;
@@ -254,6 +270,10 @@ void scsi_command(msd_cbw_t* msd_cbw_data) {
status = mode_sense6(msd_cbw_data);
break;
case SCSI_CMD_MODE_SENSE_10:
status = mode_sense10(msd_cbw_data);
break;
case SCSI_CMD_READ_FORMAT_CAPACITIES:
status = read_format_capacities(msd_cbw_data);
break;