class FrameStorage

Defined at line 44 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

A class for managing storage and lifetime of frames.

In this context a frame is merely meta data representing a location in a VMO, a mapped address of

that VMO location, the size of the data contained there and some additional data such as

priority, port id and buffer id related to transmission and receiving of frames.

The caller will populate the storage with frames and can then acquire single or multiple frames.

The lifetime of these frames will be automatically managed such that when the user no longer

needs a frame it will automatically be returned to the storage from which it came. Frames can

also be returned manually if desired.

Because the use cases for this class is almost certainly going to be multi threaded this class

also acts as its own mutex. This allows references to this class to not also have to store a

reference to a mutex stored somewhere else. Instead the caller will simply lock the storage for

as long as needed and then unlock it. This allows efficient storage of references in Frame

objects while also allowing thread annotation analysis to work properly. The locking and

unlocking can be done manually if desired but we recommend the following pattern.

FrameStorage storage;

std::lock_guard lock(storage);

This will maintain the lock on storage until the lock object goes out of scope. This will also

work with other locking classes and mechanisms that operate on things that behave like an

std::mutex.

Public Methods

void FrameStorage ()

Defined at line 50 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void ~FrameStorage ()

Defined at line 51 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void FrameStorage (const FrameStorage & )

Defined at line 56 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

FrameStorage & operator= (const FrameStorage & )

Defined at line 57 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void lock ()

Defined at line 59 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void unlock ()

Defined at line 60 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void Store (cpp20::span<const fuchsia_hardware_network_driver::wire::RxSpaceBuffer> buffers, uint8_t *[] vmo_addrs)

Defined at line 62 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void Store (Frame && frame)

Defined at line 72 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void Store (FrameContainer && frames)

Defined at line 77 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

FrameContainer Acquire (size_t count)

Defined at line 84 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

std::optional<Frame> Acquire ()

Defined at line 101 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void EraseFramesWithVmoId (uint8_t vmo_id)

Erase all frames with the given VMO id. This is useful when the underlying VMO is going away

and all frames backed by that VMO need to be removed.

Defined at line 114 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

void clear ()

Methods to make this behave like a standard container

Defined at line 129 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

size_t size ()

Defined at line 138 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

bool empty ()

Defined at line 139 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

const Frame & back ()

Defined at line 141 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h

const Frame & front ()

Defined at line 142 of file ../../src/connectivity/wlan/drivers/lib/components/cpp/include/wlan/drivers/components/frame_storage.h