rockbox/firmware/usbstack
Andrew Rice 6958f6638e usb_storage: report read-only drives as write protected
A target that defines HAVE_STORAGE_READONLY provides storage_readonly(),
and USB mass storage reports such a drive write protected: MODE SENSE
sets the WP bit, and WRITE(10) and WRITE(16) fail with DATA PROTECT /
WRITE PROTECTED before taking data, so a host mounts it read-only
instead of failing each write as a medium error. Only NAND storage wires
it up so far.

The iPod Nano 3G, added in the changes that follow, defines it: its FTL
mounts read-only in the bootloader and after a failed commit, and the
NAND check image is always read-only.

Built for the Nano 3G (bootloader, check image, firmware) without new
warnings. On hardware, Linux and Windows hosts have read the
always-read-only check image over USB; no host write has been made to a
read-only drive.

AI provenance: developed with Claude Opus 5 (Anthropic), used through
Claude Code. The model wrote most of the code and this message under
Andrew Rice's direction. Any hardware testing described above was
carried out by Andrew Rice, who is responsible for this change.

Change-Id: Idb34def2d588047e5dced9bac1521c00b37dd5e5
2026-09-17 13:18:58 +10:00
..
iap pcm_sink: allow per-sink swvol/hwvol selection 2026-08-14 22:39:13 +09:00
usb_audio.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_audio.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_audio_def.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_charging_only.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_charging_only.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_class_driver.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_core.c usb: Directly reference the "driver" in the endpoint data structure 2026-07-12 09:02:29 -04:00
usb_hid.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_hid.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_hid_def.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_hid_usage_tables.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_iap.c usb: iap: format 2026-07-05 17:42:06 -04:00
usb_iap.h usb: hold class_driver instance in each driver 2026-05-03 15:18:51 -04:00
usb_serial.c usb: acknowledge SET_LINE_CODING in the serial driver 2026-08-10 15:30:53 -04:00
usb_serial.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb_storage.c usb_storage: report read-only drives as write protected 2026-09-17 13:18:58 +10:00
usb_storage.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00