ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_usb_pmsc_storage_t Struct Reference

Caller-owned storage backend bound to the device-MSC class. More...

#include <ra8_usb_pmsc.h>

Data Fields

ra8_usb_pmsc_read_block_fn_t read_block
 Block read hook.
ra8_usb_pmsc_write_block_fn_t write_block
 Block write hook.
ra8_usb_pmsc_get_capacity_fn_t get_capacity
 Capacity hook.
ra8_usb_pmsc_get_inquiry_fn_t get_inquiry
 INQUIRY hook.
void * ctx
 Opaque context.

Detailed Description

Caller-owned storage backend bound to the device-MSC class.

All four function pointers must be non-NULL; the device cannot answer SCSI commands without them. ctx is opaque to the driver and threaded back into each callback unchanged.

Invariant
All four callbacks remain valid for the lifetime of the attached storage.
static ra8_err_t my_read(void* ctx, uint32_t lba, uint32_t n, uint8_t* b);
static ra8_err_t my_write(void* ctx, uint32_t lba, uint32_t n, const uint8_t* b);
static ra8_err_t my_cap(void* ctx, uint32_t* nb, uint32_t* bs);
static ra8_err_t my_inq(void* ctx, uint8_t* v, uint8_t* p, uint8_t* r);
.read_block = my_read,
.write_block = my_write,
.get_capacity = my_cap,
.get_inquiry = my_inq,
.ctx = nullptr,
};
static mdl_storage_vfs_t s_storage
Transactional VFS storage adapter.
Definition main.c:122
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Caller-owned storage backend bound to the device-MSC class.
void * ctx
Opaque context.

Definition at line 310 of file ra8_usb_pmsc.h.

Field Documentation

◆ ctx

void* ra8_usb_pmsc_storage_t::ctx

Opaque context.

Definition at line 315 of file ra8_usb_pmsc.h.

◆ get_capacity

ra8_usb_pmsc_get_capacity_fn_t ra8_usb_pmsc_storage_t::get_capacity

Capacity hook.

Definition at line 313 of file ra8_usb_pmsc.h.

Referenced by ra8_usb_pmsc_attach_storage().

◆ get_inquiry

ra8_usb_pmsc_get_inquiry_fn_t ra8_usb_pmsc_storage_t::get_inquiry

INQUIRY hook.

Definition at line 314 of file ra8_usb_pmsc.h.

Referenced by ra8_usb_pmsc_attach_storage().

◆ read_block

ra8_usb_pmsc_read_block_fn_t ra8_usb_pmsc_storage_t::read_block

Block read hook.

Definition at line 311 of file ra8_usb_pmsc.h.

Referenced by ra8_usb_pmsc_attach_storage().

◆ write_block

ra8_usb_pmsc_write_block_fn_t ra8_usb_pmsc_storage_t::write_block

Block write hook.

Definition at line 312 of file ra8_usb_pmsc.h.

Referenced by ra8_usb_pmsc_attach_storage().


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