#[no_mangle]
pub unsafe extern "C" fn start_bridged_wlansoftmac(
start_completer: *mut c_void,
run_start_completer: unsafe extern "C" fn(start_completer: *mut c_void, status: zx_status_t),
shutdown_completer: *mut c_void,
run_shutdown_completer: unsafe extern "C" fn(shutdown_completer: *mut c_void, status: zx_status_t),
ethernet_rx: FfiEthernetRx,
wlan_tx: FfiWlanTx,
wlan_softmac_bridge_client_handle: zx_handle_t,
) -> zx_status_t
Expand description
Start and run a bridged wlansoftmac driver hosting an MLME server and an SME server.
The driver is “bridged” in the sense that it requires a bridge to a Fuchsia driver to
communicate with other Fuchsia drivers over the FDF transport. After the bridged
driver starts successfully, run_start_completer
will be called with start_completer
.
If the bridged driver does not start successfully, this function will return a
non-ZX_OK
status.
This function returns ZX_OK
only if shutdown completes successfully. A successful
shutdown only occurs if the bridged driver receives a
fuchsia.wlan.softmac/WlanSoftmacIfcBridge.StopBridgedDriver
message and the subsequent
teardown of the hosted server succeeds.
In all other scenarios, e.g., failure during startup, while running, or during shutdown,
this function will return a non-ZX_OK
value.
§Safety
This function is unsafe for the following reasons:
- This function cannot guarantee
run_start_completer
is thread-safe. - This function cannot guarantee
start_completer
points to a valid object whenrun_start_completer
is called. - This function cannot guarantee
run_shutdown_completer
is thread-safe. - This function cannot guarantee
shutdown_completer
points to a valid object whenrun_shutdown_completer
is called. - This function cannot guarantee
wlan_softmac_bridge_client_handle
is a valid handle.
By calling this function, the caller promises the following:
- The
run_start_completer
function is thread-safe. - The
start_completer
pointer will point to a valid object at least untilrun_start_completer
is called. - The
run_shutdown_completer
function is thread-safe. - The
shutdown_completer
pointer will point to a valid object at least untilrun_shutdown_completer
is called. - The
wlan_softmac_bridge_client_handle
is a valid handle.