usbmsc.h 960 B

12345678910111213141516171819202122232425
  1. /* USB mass-storage class driver (Bulk-Only Transport + SCSI).
  2. *
  3. * Devices are registered as `usb0..` in the block-device registry. Only the
  4. * controllers with a bulk-transfer path work: EHCI (high-speed) and xHCI
  5. * (USB2 root ports). UHCI/OHCI leave bulk_in/bulk_out NULL, so a stick on a
  6. * full/low-speed companion controller is not usable.
  7. */
  8. #ifndef USB_MSC_H
  9. #define USB_MSC_H
  10. /* Register the device probe; call before the first USB bus scan. */
  11. void usbmsc_register(void);
  12. /* Add the currently present MSC devices to the blkdev registry. Called at
  13. * the end of blk_scan(); the USB bus scan itself runs earlier at boot. */
  14. void usbmsc_blk_scan(void);
  15. /* Block I/O for BLK_USB devices (unit = usbmsc slot index). */
  16. int usbmsc_read(unsigned int unit, unsigned int lba, void *buf,
  17. unsigned int count);
  18. int usbmsc_write(unsigned int unit, unsigned int lba, const void *buf,
  19. unsigned int count);
  20. int usbmsc_flush(unsigned int unit);
  21. #endif