| 1234567891011121314151617181920212223242526272829303132333435 |
- /* USB mass-storage class driver (Bulk-Only Transport + SCSI).
- *
- * Devices are registered as `usb0..` in the block-device registry. Only the
- * controllers with a bulk-transfer path work: EHCI (high-speed) and xHCI
- * (USB2 root ports). UHCI/OHCI leave bulk_in/bulk_out NULL, so a stick on a
- * full/low-speed companion controller is not usable.
- */
- #ifndef USB_MSC_H
- #define USB_MSC_H
- /* Register the device probe; call before the first USB bus scan. */
- void usbmsc_register(void);
- /* Add the currently present MSC devices to the blkdev registry. Called at
- * the end of blk_scan(); the USB bus scan itself runs earlier at boot. */
- void usbmsc_blk_scan(void);
- /* Best-effort boot mounting: the first media read gets one bounded attempt
- * instead of the normal retry chain, so a stuck device cannot hold
- * vfs_scan_busy behind the boot scan. A later `storage` rescan uses the
- * full recovery path again. */
- void usbmsc_set_probe_only(int on);
- /* A full storage rescan gives every present device its long first-media-read
- * deadline again (the boot background probe consumes it once). */
- void usbmsc_begin_full_scan(void);
- /* Block I/O for BLK_USB devices (unit = usbmsc slot index). */
- int usbmsc_read(unsigned int unit, unsigned int lba, void *buf,
- unsigned int count);
- int usbmsc_write(unsigned int unit, unsigned int lba, const void *buf,
- unsigned int count);
- int usbmsc_flush(unsigned int unit);
- #endif
|