class DeviceInterface

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

Public Methods

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 98 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.h

TxQueue & tx_queue ()

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

SharedLock & control_lock ()

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

fbl::Mutex & rx_lock ()

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

fbl::Mutex & tx_lock ()

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

const netdriver::DeviceImplInfo & info ()

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

DiagnosticsService & diagnostics ()

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

void ~DeviceInterface ()

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

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

Public NetworkDevice API.

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

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

Defined at line 362 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 371 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 389 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 413 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 472 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 492 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 500 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 508 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

uint16_t rx_fifo_depth ()

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

uint16_t tx_fifo_depth ()

Defined at line 751 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 1249 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 755 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 761 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 1129 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 1241 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 1143 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 1151 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 1163 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

bool IsDataPlaneOpen ()

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

void GetInfo (GetInfoCompleter::Sync & completer)

FIDL protocol implementation.

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

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

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

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

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

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

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

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

Defined at line 741 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 1059 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 1069 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 1275 of file ../../src/connectivity/network/drivers/network-device/device/device_interface.cc

void NotifyTxComplete ()

Event observer hook for Tx complete.

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

void DropDelegatedRxLease (netdev::DelegatedRxLease lease)

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

Friends

class FakeNetworkDeviceImpl
class NetworkDeviceTest