/** * @brief Callback to finish 11H channel check handling. * Not to be called directly to initiate channel check. * * @param priv A pointer to mlan_private structure (cast from t_void*) * * @return MLAN_STATUS_SUCCESS/PENDING --success, otherwise fail * @sa wlan_uap_11h_channel_check_req */ static mlan_status wlan_uap_callback_11h_channel_check_req(IN t_void * priv) { mlan_status ret = MLAN_STATUS_FAILURE; mlan_private *pmpriv = (mlan_private *) priv; mlan_callbacks *pcb = (mlan_callbacks *) & pmpriv->adapter->callbacks; wlan_uap_get_info_cb_t *puap_state_chan_cb = &pmpriv->uap_state_chan_cb; /* keep copy as local variable */ pmlan_ioctl_req pioctl = puap_state_chan_cb->pioctl_req_curr; ENTER(); /* clear callback now that we're here */ puap_state_chan_cb->get_chan_callback = MNULL; /* clear early to avoid race condition */ puap_state_chan_cb->pioctl_req_curr = MNULL; /* * Check if the region and channel requires a channel availability * check. */ if ((puap_state_chan_cb->band_config & BAND_CONFIG_5GHZ) && wlan_11h_radar_detect_required(pmpriv, puap_state_chan_cb->channel) && !wlan_11h_is_channel_under_nop(pmpriv->adapter, puap_state_chan_cb->channel)) { /* * Radar detection is required for this channel, make sure * 11h is activated in the firmware */ ret = wlan_11h_activate(pmpriv, MNULL, MTRUE); ret = wlan_11h_config_master_radar_det(pmpriv, MTRUE); ret = wlan_11h_check_update_radar_det_state(pmpriv); /* Check for radar on the channel */ ret = wlan_11h_issue_radar_detect(pmpriv, pioctl, puap_state_chan_cb->channel); if (ret == MLAN_STATUS_SUCCESS) ret = MLAN_STATUS_PENDING; } else { /* No command sent with the ioctl, need manually signal completion */ pcb->moal_ioctl_complete(pmpriv->adapter->pmoal_handle, pioctl, MLAN_STATUS_FAILURE); } LEAVE(); return ret; }
/** * @brief Callback to finish 11H handling * Not to be called directly to initiate 11H setting. * * @param pmpriv A pointer to mlan_private structure (cast from t_void*) * * @return MLAN_STATUS_PENDING --success, otherwise fail * @sa wlan_uap_snmp_mib_11h */ static mlan_status wlan_uap_callback_snmp_mib_11h(IN t_void * priv) { mlan_status ret = MLAN_STATUS_SUCCESS; mlan_private *pmpriv = (mlan_private *) priv; wlan_uap_get_info_cb_t *puap_state_chan_cb = &pmpriv->uap_state_chan_cb; mlan_ds_snmp_mib *snmp; t_bool enable_11h; ENTER(); /* clear callback now that we're here */ puap_state_chan_cb->get_chan_callback = MNULL; snmp = (mlan_ds_snmp_mib *) puap_state_chan_cb->pioctl_req_curr->pbuf; enable_11h = (snmp->param.oid_value) ? MTRUE : MFALSE; if (enable_11h) { if ((puap_state_chan_cb->band_config & BAND_CONFIG_5GHZ) && wlan_11h_radar_detect_required(pmpriv, puap_state_chan_cb->channel)) { if (!wlan_11h_is_master_radar_det_active(pmpriv)) wlan_11h_config_master_radar_det(pmpriv, MTRUE); } } ret = wlan_11h_activate(pmpriv, (t_void *) puap_state_chan_cb->pioctl_req_curr, enable_11h); wlan_11h_check_update_radar_det_state(pmpriv); if (ret == MLAN_STATUS_SUCCESS) ret = MLAN_STATUS_PENDING; puap_state_chan_cb->pioctl_req_curr = MNULL; // prevent re-use LEAVE(); return ret; }