# msc_func Struct Reference

A Mass Storage Class interface instance. More...

Collaboration diagram for msc_func:

[legend]

## Data Fields
struct usb_func_iface | iface
| The corresponding USB interface.
struct udc * | udc
| The low-level USB Device Controller.
struct block_device * | bdev
| The block device used for storage.
usb_ep_id_t | bulk_in_ep
| Bulk-IN endpoint used for data transfer.
usb_ep_id_t | bulk_out_ep
| Bulk-OUT endpoint used for data transfer.
uint8_t * | sense_data
| Buffer holding the current sense information.
phys_addr_t | sense_data_phys
| Physical address of sense_data.
uint32_t | blocks_queued
| Number of blocks queued for transfer via bdev.
uint32_t | blocks_total
| The total number of blocks to be transfered.
uint32_t | first_lba
| The first Logical Block Address to be transfered.
atomic_t | blk_segs_pending
| Number of pending block buffer segments.
atomic_t | usb_reqs_pending
| Number of pending USB data requests.
struct usb_msc_cbw * | cbw
| The current Command Block Wrapper.
struct usb_msc_csw * | csw
| The current Command Status Wrapper.
struct usb_request * | cbw_csw_req
| USB request used for transfering the CBW and CSW.
struct block_request * | block_req
| Block request used for doing block data transfers via bdev.
uint16_t | busy_asc
| Additional Sense Code (Qualifier) set by usb_msc_set_busy().
void(* | busy_cb )(void *)
| Function to be called when the MSC interface has been blocked.
void * | busy_cb_data
| Arbitrary data to be passed to busy_cb().
bool | queue_locked
| True while queuing new buffers for a request.
bool | not_ready
| True if all block data transfer requests are to be blocked.
bool | xfer_in_progress
| True if there's currently a block data transfer in progress.

## Detailed Description

A Mass Storage Class interface instance.

For internal use only.

Definition at line 118 of file msc_bulk_function.c.

## Field Documentation

struct block_device* msc_func::bdev`[read]`

The block device used for storage.

Definition at line 124 of file msc_bulk_function.c.

Referenced by msc_do_read(), msc_read_worker(), and msc_write_worker().

atomic_t msc_func::blk_segs_pending

Number of pending block buffer segments.

Definition at line 140 of file msc_bulk_function.c.

Referenced by msc_do_read(), msc_read_worker(), and msc_submit_read_buffers().

struct block_request* msc_func::block_req`[read]`

Block request used for doing block data transfers via bdev.

Definition at line 150 of file msc_bulk_function.c.

Referenced by msc_do_read(), msc_read_worker(), and msc_write_worker().

uint32_t msc_func::blocks_queued

Number of blocks queued for transfer via bdev.

Definition at line 134 of file msc_bulk_function.c.

Referenced by msc_do_read(), msc_read_worker(), msc_submit_read_buffers(), msc_submit_write_data_req(), and msc_write_worker().

uint32_t msc_func::blocks_total

The total number of blocks to be transfered.

Definition at line 136 of file msc_bulk_function.c.

Referenced by msc_do_read(), msc_read_worker(), and msc_write_worker().

usb_ep_id_t msc_func::bulk_in_ep

Bulk-IN endpoint used for data transfer.

Definition at line 126 of file msc_bulk_function.c.

usb_ep_id_t msc_func::bulk_out_ep

Bulk-OUT endpoint used for data transfer.

Definition at line 128 of file msc_bulk_function.c.

Referenced by msc_submit_write_data_req().

uint16_t msc_func::busy_asc

Additional Sense Code (Qualifier) set by usb_msc_set_busy().

Definition at line 152 of file msc_bulk_function.c.

Referenced by msc_do_read().

void(* msc_func::busy_cb)(void *)

Function to be called when the MSC interface has been blocked.

Referenced by msc_queue_empty().

void* msc_func::busy_cb_data

Arbitrary data to be passed to busy_cb().

Definition at line 156 of file msc_bulk_function.c.

Referenced by msc_queue_empty().

struct usb_msc_cbw* msc_func::cbw`[read]`

The current Command Block Wrapper.

Definition at line 144 of file msc_bulk_function.c.

struct usb_request* msc_func::cbw_csw_req`[read]`

USB request used for transfering the CBW and CSW.

Definition at line 148 of file msc_bulk_function.c.

struct usb_msc_csw* msc_func::csw`[read]`

The current Command Status Wrapper.

Definition at line 146 of file msc_bulk_function.c.

uint32_t msc_func::first_lba

The first Logical Block Address to be transfered.

Definition at line 138 of file msc_bulk_function.c.

struct usb_func_iface msc_func::iface`[read]`

The corresponding USB interface.

Definition at line 120 of file msc_bulk_function.c.

bool msc_func::not_ready

True if all block data transfer requests are to be blocked.

Definition at line 160 of file msc_bulk_function.c.

Referenced by msc_do_read(), and msc_queue_empty().

bool msc_func::queue_locked

True while queuing new buffers for a request.

Definition at line 158 of file msc_bulk_function.c.

Referenced by msc_do_read(), msc_read_worker(), and msc_write_worker().

uint8_t* msc_func::sense_data

Buffer holding the current sense information.

Definition at line 130 of file msc_bulk_function.c.

phys_addr_t msc_func::sense_data_phys

Physical address of sense_data.

Definition at line 132 of file msc_bulk_function.c.

struct udc* msc_func::udc`[read]`

The low-level USB Device Controller.

Definition at line 122 of file msc_bulk_function.c.

Referenced by msc_submit_write_data_req().

atomic_t msc_func::usb_reqs_pending

Number of pending USB data requests.

Definition at line 142 of file msc_bulk_function.c.

Referenced by msc_do_read(), msc_submit_write_data_req(), and msc_write_worker().

bool msc_func::xfer_in_progress

True if there's currently a block data transfer in progress.

Definition at line 162 of file msc_bulk_function.c.

Referenced by msc_do_read(), and msc_queue_empty().

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

- drivers/usb/function/msc_bulk_function.c