class DeviceInterface

Defined at line 66 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

Public Methods

bool IsDataVmoPrepared (uint8_t vmo_id)

Defined at line 101 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 112 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

TxQueue & tx_queue ()

Defined at line 114 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

SharedLock & control_lock ()

Defined at line 116 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

fbl::Mutex & rx_lock ()

Defined at line 117 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

fbl::Mutex & tx_lock ()

Defined at line 118 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

const netdriver::DeviceImplInfo & info ()

Defined at line 119 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 166 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

DiagnosticsService & diagnostics ()

Defined at line 190 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 205 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void ~DeviceInterface ()

Defined at line 223 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void Teardown (fit::callback<void ()> callback)

Public NetworkDevice API.

Defined at line 354 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

zx_status_t Bind (fidl::ServerEnd<netdev::Device> req)

Defined at line 368 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 377 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 395 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 419 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 479 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 500 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 508 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 516 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 541 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 548 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

uint16_t rx_fifo_depth ()

Defined at line 772 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

uint16_t tx_fifo_depth ()

Defined at line 776 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 1272 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 780 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 786 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 1140 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 1264 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 1154 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 1162 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 1174 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

bool IsDataPlaneOpen ()

Defined at line 1279 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 1186 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void GetInfo (GetInfoCompleter::Sync & completer)

FIDL protocol implementation.

Defined at line 554 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void OpenSession (OpenSessionRequestView request, OpenSessionCompleter::Sync & completer)

Defined at line 614 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void GetPort (GetPortRequestView request, GetPortCompleter::Sync & _completer)

Defined at line 715 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void GetPortWatcher (GetPortWatcherRequestView request, GetPortWatcherCompleter::Sync & _completer)

Defined at line 727 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void Clone (CloneRequestView request, CloneCompleter::Sync & _completer)

Defined at line 766 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 1093 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 1103 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 1298 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void NotifyTxComplete ()

Event observer hook for Tx complete.

Defined at line 1300 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void DropDelegatedRxLease (netdev::DelegatedRxLease lease)

Defined at line 1302 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 1313 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

Friends

class FakeNetworkDeviceImpl
class NetworkDeviceTest