USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches
msc_disk Struct Reference

One mass-storage function: a single instance of the class on a device. More...

#include <classes/msc.h>

Data Fields

int index
 0-based instance number on this device, in msc_add() order

 
const char * name
 msc_opts::name, or "" (never NULL)

 
void * user
 msc_opts::user, passed straight through

 
int n_luns
 Logical units this disk carries: 1 unless msc_opts::luns asked for more

 
int medium
 Unit 0's medium, one of the MSC_MEDIUM_* codes.
 
int interface_number
 The mass-storage interface's bInterfaceNumber.
 
uint8_t in_ep
 Bulk IN address actually assigned (on a composite this is relocated off 0x82)

 
uint8_t out_ep
 Bulk OUT address actually assigned

 
usbip_devicedev
 The owning device

 
usbip_functionfunc
 The underlying function - escape hatch to the core usbip_device.h API

 

Detailed Description

One mass-storage function: a single instance of the class on a device.

Create one with msc_add(); it stays valid for the life of the device. The fields are maintained by the class and are read-only to the app - they are here so a callback (or a second function sharing the same app state) can tell which disk it is looking at and how it was wired up, without keeping its own table.

It is a distinct type from the other classes' handles, so passing (say) a cdc_port where a msc_disk is wanted is a compile error, not a misread state block.

Field Documentation

◆ index

int msc_disk::index

0-based instance number on this device, in msc_add() order

◆ name

const char* msc_disk::name

msc_opts::name, or "" (never NULL)

◆ user

void* msc_disk::user

msc_opts::user, passed straight through

◆ n_luns

int msc_disk::n_luns

Logical units this disk carries: 1 unless msc_opts::luns asked for more

◆ medium

int msc_disk::medium

Unit 0's medium, one of the MSC_MEDIUM_* codes.

◆ interface_number

int msc_disk::interface_number

The mass-storage interface's bInterfaceNumber.

◆ in_ep

uint8_t msc_disk::in_ep

Bulk IN address actually assigned (on a composite this is relocated off 0x82)

◆ out_ep

uint8_t msc_disk::out_ep

Bulk OUT address actually assigned

◆ dev

usbip_device* msc_disk::dev

The owning device

◆ func

usbip_function* msc_disk::func

The underlying function - escape hatch to the core usbip_device.h API


The documentation for this struct was generated from the following file: