class DeviceInterface
Defined at line 67 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
Public Methods
bool IsDataVmoPrepared (uint8_t vmo_id)
Defined at line 102 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
uint16_t rx_notify_threshold ()
Returns the device-owned buffer count threshold at which we should trigger RxQueue work. If the
number of buffers on device is less than or equal to the threshold, we should attempt to fetch
more buffers.
Defined at line 113 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
TxQueue & tx_queue ()
Defined at line 115 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
SharedLock & control_lock ()
Defined at line 117 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
fbl::Mutex & rx_lock ()
Defined at line 118 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
fbl::Mutex & tx_lock ()
Defined at line 119 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
const netdriver::DeviceImplInfo & info ()
Defined at line 120 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
uint8_t GetPortSalt (uint8_t base_id)
Returns the current port salt for the provided base port ID.
If the port with |base_id| does not currently exist, returns the value of
the previously existing port with the same |base_id| or the initial salt
value.
Defined at line 173 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
DiagnosticsService & diagnostics ()
Defined at line 199 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h
zx::result<std::unique_ptr<DeviceInterface>> Create (const DeviceInterfaceDispatchers & dispatchers, std::unique_ptr<NetworkDeviceImplBinder> && binder)
Defined at line 207 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void ~DeviceInterface ()
Defined at line 225 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void Teardown (fit::callback<void ()> callback)
Public NetworkDevice API.
Defined at line 356 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
zx_status_t Bind (fidl::ServerEnd<netdev::Device> req)
Defined at line 370 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
zx_status_t BindPort (uint8_t port_id, fidl::ServerEnd<netdev::Port> req)
Defined at line 379 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void PortStatusChanged (netdriver::wire::NetworkDeviceIfcPortStatusChangedRequest *request,fdf::Arena &arena,PortStatusChangedCompleter::Sync &completer)
NetworkDeviceIfc implementation.
Defined at line 397 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void AddPort (netdriver::wire::NetworkDeviceIfcAddPortRequest *request,fdf::Arena &arena,AddPortCompleter::Sync &completer)
Defined at line 421 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void RemovePort (netdriver::wire::NetworkDeviceIfcRemovePortRequest *request,fdf::Arena &arena,RemovePortCompleter::Sync &completer)
Defined at line 481 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void CompleteRx (netdriver::wire::NetworkDeviceIfcCompleteRxRequest *request,fdf::Arena &arena,CompleteRxCompleter::Sync &completer)
Defined at line 502 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void CompleteTx (netdriver::wire::NetworkDeviceIfcCompleteTxRequest *request,fdf::Arena &arena,CompleteTxCompleter::Sync &completer)
Defined at line 510 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void DelegateRxLease (netdriver::wire::NetworkDeviceIfcDelegateRxLeaseRequest *request,fdf::Arena &arena,DelegateRxLeaseCompleter::Sync &completer)
Defined at line 518 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void UpdateRxBufferParams (netdriver::wire::NetworkDeviceIfcUpdateRxBufferParamsRequest *request,fdf::Arena &arena,UpdateRxBufferParamsCompleter::Sync &completer)
Defined at line 543 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void RequestRxSpace (netdriver::wire::NetworkDeviceIfcRequestRxSpaceRequest *request,fdf::Arena &arena,RequestRxSpaceCompleter::Sync &completer)
Defined at line 559 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
uint16_t rx_fifo_depth ()
Defined at line 1430 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
uint16_t tx_fifo_depth ()
Defined at line 1434 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
zx_status_t LoadRxDescriptors (RxSessionTransaction & transact)
Loads rx path descriptors from the session into a session transaction.
Defined at line 1993 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void SessionStarted ()
Operates workflow for when the session is started. The data path will be started.
Defined at line 1438 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void SessionStopped ()
Operates workflow for when the session is stopped. The data path will be stopped.
Defined at line 1444 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
fbl::RefPtr<RefCountedFifo> rx_fifo ()
If a live session exists, rx_fifo returns a reference-counted pointer to the
session's Rx FIFO. Otherwise, the returned pointer is null.
Defined at line 1798 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void CommitSession ()
Commits all pending rx buffers in the active session.
Defined at line 1985 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void NotifyTxReturned (bool was_full)
Notifies that a batch of Tx frames has been returned.
If was_full is true, all active sessions are notified that device tx space has freed up.
Checks if dead sessions are ready to be destroyed due to buffers returning.
Defined at line 1826 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void QueueRxSpace (cpp20::span<netdriver::wire::RxSpaceBuffer> rx)
Sends the provided space buffers in `rx` to the device implementation.
Defined at line 1834 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void QueueTx (cpp20::span<netdriver::wire::TxBuffer> tx)
Sends the provided transmit buffers in `tx` to the device implementation.
Defined at line 1846 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
bool IsDataPlaneOpen ()
Defined at line 2000 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void NotifyDeadSession ()
Called by the session when it's no longer running. If the dead session has any outstanding
buffers with the device implementation, it'll be kept until all the buffers
are safely returned and we own all the buffers again.
Defined at line 1858 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void GetInfo (GetInfoCompleter::Sync & completer)
FIDL protocol implementation.
Defined at line 572 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void OpenSession (OpenSessionRequestView request, OpenSessionCompleter::Sync & completer)
Defined at line 656 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void RegisterForTx (cpp20::span<const VmoId> vmos, fidl::WireServer<netdev::Session>::RegisterForTxCompleter::Async completer)
Defined at line 960 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void UnregisterForTx (cpp20::span<const VmoId> vmos, fidl::WireServer<netdev::Session>::UnregisterForTxCompleter::Async completer)
Defined at line 1087 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void GetPort (GetPortRequestView request, GetPortCompleter::Sync & _completer)
Defined at line 1219 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void GetPortWatcher (GetPortWatcherRequestView request, GetPortWatcherCompleter::Sync & _completer)
Defined at line 1231 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void Clone (CloneRequestView request, CloneCompleter::Sync & _completer)
Defined at line 1270 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void NotifyPortRxFrame (uint8_t base_id, uint64_t frame_length)
Notifies of |frame_length| bytes received on port with |base_id|.
Defined at line 1751 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
zx::result<AttachedPort> AcquirePort (netdev::wire::PortId port_id, cpp20::span<const netdev::wire::FrameType> rx_frame_types)
Acquires a port for use in a Session.
Sessions are notified of ports that are no longer safe to use by the DeviceInterface through
Session::DetachPort.
NB: The validity of the returned AttachedPort is not really guaranteed by the type system, but
by the fact that DeviceInterface will detach all ports from sessions before continuing.
Defined at line 1761 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void NotifyRxQueuePacket (uint64_t key)
Event observer hook for Rx queue packets.
Defined at line 2019 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void NotifyRxVmoOpFinished (zx_status_t status)
Event observer hook for Rx VMO operation finish.
Defined at line 2021 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void NotifyTxComplete ()
Event observer hook for Tx complete.
Defined at line 2025 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void DropDelegatedRxLease (netdev::DelegatedRxLease lease)
Defined at line 2027 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void TryDelegateRxLease (uint64_t completed_frame_index)
Delegates a pending lease to the session.
The lease is delegated if |completed_frame_index| is larger than the lease's
hold_until_frame value.
The session receives the lease if one exists _and_ the session is
opted in to receive leases. Drops the pending lease immediately otherwise.
Defined at line 2038 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
void DecommitVmo (netdev::VmoId vmo_id)
Decommits the VMO by its ID. The VMO must be released from the device impl and all the buffers
from this Rx VMO must be withheld.
Defined at line 1276 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
bool PrepareRxVmos (RxVmoList::iteratorstart,RxVmoList::iterator *in_out_end,fit::callback<void (fit::result<std::tuple<zx_status_t, DataVmoList>>)>cb)
Submits a batch of Rx VMOs for preparation. It skips any VMO that has already been prepared.
Returns whether the batch is already prepared.
|in_out_end| specifies the end of the range on input, and on output is set to the iterator
past the last VMO submitted for preparation before any lock is released, or to |start| if
nothing could be prepared.
Defined at line 1297 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
bool ReleaseRxVmo (DataVmoMeta & vmo)
Attempts to release the Rx VMO. Returns true if the VMO has successfully transitioned to
VmoState::kReleasing (meaning a release operation is now pending or starting). Returns false if
the release attempt failed (e.g., the VMO is also registered for Tx, not currently prepared,
or the session is invalid).
Defined at line 1381 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc
Friends
class FakeNetworkDeviceImpl
class NetworkDeviceTest