|
USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
|
USB Mass Storage (Bulk-Only Transport + SCSI) device class, app API. More...
#include "usb_class.h"Data Structures | |
| struct | msc_disk |
| One mass-storage function: a single instance of the class on a device. More... | |
| struct | msc_lun |
| One logical unit: a backend context, plus what this unit alone presents itself as. More... | |
| struct | msc_opts |
| Mass-storage configuration: a block-storage backend + presentation options. More... | |
Macros | |
| #define | MSC_MAX_LUNS |
| Most logical units one mass-storage interface can carry. | |
Medium type | |
What the disk presents itself as, set in msc_opts::medium. The default (0) is a plain removable disk, so a zero-initialised msc_opts needs no medium field. | |
| #define | MSC_MEDIUM_DISK |
| Removable direct-access disk (SCSI type 0x00) | |
| #define | MSC_MEDIUM_CDROM |
| Read-only CD-ROM (SCSI type 0x05), MMC commands answered. | |
| #define | MSC_MEDIUM_FLOPPY |
| Floppy: direct-access with a Flexible Disk geometry page. | |
Floppy format | |
The standard formats a MSC_MEDIUM_FLOPPY disk can be, passed to msc_floppy_format_size(). All of them are 512 bytes per sector. | |
| #define | MSC_FLOPPY_2_88M |
| 2.88 MB - 80 cylinders, 2 heads, 36 sectors | |
| #define | MSC_FLOPPY_1_44M |
| 1.44 MB - 80 cylinders, 2 heads, 18 sectors | |
| #define | MSC_FLOPPY_1_2M |
| 1.2 MB - 80 cylinders, 2 heads, 15 sectors | |
| #define | MSC_FLOPPY_720K |
| 720 KB - 80 cylinders, 2 heads, 9 sectors | |
| #define | MSC_FLOPPY_360K |
| 360 KB - 40 cylinders, 2 heads, 9 sectors | |
Functions | |
| msc_disk * | msc_add (usbip_device *dev, const msc_opts *opts) |
| Add a mass-storage function to a device: one interface carrying one logical unit, or msc_opts::n_luns of them. | |
| uint64_t | msc_floppy_format_size (int format) |
| Byte size of a standard floppy format, for sizing the backing image. | |
Variables | |
| const usbip_device_class | usbip_device_msc |
| The mass-storage class, for usbip_device_add_class() | |
USB Mass Storage (Bulk-Only Transport + SCSI) device class, app API.
The class runs the BOT state machine and a SCSI command set; the app supplies a block-storage backend and a logging hook via msc_opts. Built on usbip_device.h only.