template <>
class Server
Defined at line 974 of file fidling/gen/sdk/fidl/fuchsia.hardware.network.driver/fuchsia.hardware.network.driver/cpp/fidl/fuchsia.hardware.network.driver/cpp/driver/natural_messaging.h
Public Methods
void Init (InitRequest & request, InitCompleter::Sync & completer)
Initializes the network device.
`Init` is only called once during the lifetime of the device to register
`iface` as the callback target for the Network Device implementation.
Upon initialization, the device is expected to be in the "Stopped"
state, the `Start` method will be called once the data path needs to be
opened.
+ request `iface` handle to the device interface.
- response `s` initialization status. A value other than `ZX_OK` will
cause the device to unbind.
void Server ()
Defined at line 977 of file fidling/gen/sdk/fidl/fuchsia.hardware.network.driver/fuchsia.hardware.network.driver/cpp/fidl/fuchsia.hardware.network.driver/cpp/driver/natural_messaging.h
void Start (StartCompleter::Sync & completer)
Starts the device's data path.
`start` signals to the device implementation that it should bring up its
data path and be ready to receive tx frames and `iface` will start
accepting rx frames.
The device is only considered started once `Start` returns successfully.
Until then, the contract guarantees that no other data-path calls will
be made to the device (`QueueTx`, `RxAvailable`, `Stop`, or a second
call to `Start`), so implementers can safely assume or assert that this
contract is upheld.
- response `s` start status. `ZX_OK` indicates a successful start.
`ZX_ERR_ALREADY_BOUND` indicates that the device has already been
successfully started. Any other status value indicates an implementation
specific error.
void Stop (StopCompleter::Sync & completer)
Stops the network device.
The device implementation must return all outstanding Tx and Rx buffers
upon receiving this call. Any new buffers received in the stopped state
must be returned with an appropriate error (tx) or unfulfilled (rx). See
[`NetworkDeviceIfc.CompleteTx`] and [`NetworkDeviceIfc.CompleteRx`] for
details.
The device implementation may perform any power saving measures after
observing stop.
void GetInfo (GetInfoCompleter::Sync & completer)
Gets information about the device.
Device information must not change over the course of the lifetime of
the device.
- response `info` device information.
void QueueTx (QueueTxRequest & request, QueueTxCompleter::Sync & completer)
Enqueues a list of buffers for transmission on the network device.
The driver takes ownership of the buffer and must complete the tx
transaction by using [`NetworkDeviceIfc.CompleteTx`] operations once it
is done with each buffer in `buffers`.
The total number of outstanding tx buffers given to a device will never
exceed the reported [`DeviceInfo.tx_depth`] value. Which also means that
no more than `tx_depth` buffers are going to be informed at once in a
single call to `QueueTx`.
Buffers enqueued while the device in is the stopped state must be
returned with an appropriate error. See [`TxResult.status`] for specific
error codes.
+ request `buffers` tx buffers to enqueue for sending.
void QueueRxSpace (QueueRxSpaceRequest & request, QueueRxSpaceCompleter::Sync & completer)
Enqueues a list of rx buffer space on the network device.
The driver takes ownership of the buffer and must complete the
transaction (once network data arrives) using
[`NetworkDeviceIfc.CompleteRx`].
The total number of outstanding rx buffers given to a device will never
exceed the reported [`DeviceInfo.rx_depth`] value. Which also means that
no more than `rx_depth` buffers are going to be informed at once in a
single call to `QueueRxSpace`.
Buffers enqueued while the device in is the stopped state must be
returned with a zero length.
+ request `buffers` rx space buffers to be filled with network data when
it arrives.
void PrepareVmo (PrepareVmoRequest & request, PrepareVmoCompleter::Sync & completer)
Informs device that a new VMO is being used to store frame data.
Implementers must store the VMO handle referenced by `id` until
[`NetworkDeviceImpl.ReleaseVmo`] is called with the same `id`.
+ request `id` identifier used to reference this VMO.
+ request `vmo` VMO where frame data will be stored.
- response `s` vmo registration status. `ZX_OK` indicates a successful
VMO preparation. Any other status value indicates an implementation
specific error and causes the client session which owns the VMO to be
closed.
void ReleaseVmo (ReleaseVmoRequest & request, ReleaseVmoCompleter::Sync & completer)
Device may dispose of all references to the VMO referenced by `id`.
No more buffers will be sent with this `id`.
`ReleaseVmo` is guaranteed to only be called when the implementation
holds no buffers that reference that `id`.
+ request `id` VMO identifier.
Handler bind_handler (fdf_dispatcher_t * dispatcher)
|bind_handler| returns a handler that binds incoming connections to this
server implementation.
The returned handler borrows the server instance.
The server must outlive the provided |dispatcher|. Only after
the dispatcher is shutdown will it be safe to destroy the servers.
The server should not be moved.
void ~Server ()
Defined at line 978 of file fidling/gen/sdk/fidl/fuchsia.hardware.network.driver/fuchsia.hardware.network.driver/cpp/fidl/fuchsia.hardware.network.driver/cpp/driver/natural_messaging.h