Commit graph

3 commits

Author SHA1 Message Date
Tomasz Moń 7ba5ecf451 usb: device_next: report medium error on Mass Storage failed writes
End Write command with Medium Error / Write Error when underlying disk
write or sync fails.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-05-17 11:45:45 +02:00
Tomasz Moń 3532c2563a usb: device_next: accept padded Mass Storage CDBs
Universal Serial Bus Mass Storage Specification For Bootability requires
that device shall accept Bulk-Only-Transport bCBWCBLength of 12 for all
commands documented in the specification. Allow padding for commands
documented in Bootability specification, but leave others intact.

This fixes Request Sense on Windows 11 which previously failed due to
bCBWCBLength being 12 instead of 6.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-05-17 11:45:45 +02:00
Tomasz Moń 509c033c1d usb: device_next: new USB Mass Storage implementation
Introduce new USB Mass Storage Bulk-Only Transport implementation
written from scratch. Main goal behind new implementation was to
separate USB and SCSI parts as clearly as possible.

Limited set of SCSI disk commands is implemented in separate source code
file that is internal to USB device stack. While it should be possible
to use the SCSI implementation by other components there is currently no
other user besides USB MSC and therefore SCSI header is kept private.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-02-24 15:19:20 +01:00