#[no_mangle]
pub unsafe extern "C" fn start_and_run_bridged_wlansoftmac(
    init_completer: *mut c_void,
    run_init_completer: unsafe extern "C" fn(init_completer: *mut c_void, status: zx_status_t),
    frame_sender: CFrameSender,
    buffer_provider: CBufferProvider,
    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. When initialization of the bridged driver completes, run_init_completer will be called.

§Safety

There are two layers of safety documentation for this function. The first layer is for this function itself, and the second is for the run_init_completer function.

§For this function itself

This function is unsafe for the following reasons:

  • This function cannot guarantee run_init_completer is thread-safe, i.e., that it’s safe to to call at any time from any thread.
  • This function cannot guarantee init_completer points to a valid object when run_init_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_init_completer function is thread-safe.
  • The init_completer pointer will point to a valid object at least until run_init_completer is called.
  • The wlan_softmac_bridge_client_handle is a valid handle.

§For run_init_completer

The run_init_completer function is unsafe because it cannot guarantee the init_completer argument will be the same init_completer passed to start_and_run_bridged_wlansoftmac, and cannot guarantee it will be called exactly once.

The caller of run_init_completer must promise to pass the same init_completer from start_and_run_bridged_wlansoftmac to run_init_completer and call run_init_completer exactly once.