pub async fn start_and_serve<F, D: DeviceOps + 'static>(
start_completer: Completer<F>,
device: D,
) -> Result<(), Status>where
F: FnOnce(zx_status_t) + 'static,
Expand description
Run the bridged wlansoftmac driver composed of the following servers:
- WlanSoftmacIfcBridge server
- MLME server
- SME server
The WlanSoftmacIfcBridge server future executes on a parallel thread because otherwise synchronous calls from the MLME server into the vendor driver could deadlock if the vendor driver calls a WlanSoftmacIfcBridge method before returning from a synchronous call. For example, when the MLME server synchronously calls WlanSoftmac.StartActiveScan(), the vendor driver may call WlanSoftmacIfc.NotifyScanComplete() before returning from WlanSoftmac.StartActiveScan(). This can occur when the scan request results in immediate cancellation despite the request having valid arguments.
This function calls start_completer()
when MLME initialization completes successfully, and
will return in one of four cases:
- An error occurred during initialization.
- An error occurred while running.
- An error occurred during shutdown.
- Shutdown completed successfully.
If an error occurs during the bridge driver’s initialization, start_completer()
will not be
called.