Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions source/core/services/vap_svc_mesh_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,20 @@ void ext_try_connecting(vap_svc_t *svc)
bss_candidate_t *new_bss = NULL;
bss_candidate_t *last_connected_bss = NULL;
bool found_at_least_one_candidate = false;
bool candidate_valid;
wifi_ctrl_t *ctrl;
wifi_mgr_t *mgr;
wifi_radio_operationParam_t *radio_params;
wifi_radio_operationParam_t *candidate_params;
unsigned char candidate_channel;

ctrl = svc->ctrl;
mgr = (wifi_mgr_t *)get_wifimgr_obj();
if (mgr == NULL) {
wifi_util_error_print(WIFI_CTRL, "%s:%d: failed to get wifi manager\n",
__func__, __LINE__);
return;
}
ext = &svc->u.ext;

if (ext->conn_state == connection_state_connection_to_nb_in_progress) {
Expand Down Expand Up @@ -1161,6 +1172,59 @@ void ext_try_connecting(vap_svc_t *svc)
return;
}
vap_index = get_sta_vap_index_for_radio(svc->prop, radio_index);
radio_params = get_wifidb_radio_map(radio_index);
if (radio_params == NULL) {
wifi_util_error_print(WIFI_CTRL,
"%s:%d: failed to get radio parameters for radio index %d\n", __func__, __LINE__,
radio_index);
return;
}

candidate_channel = 0;
convert_freq_to_channel(candidate->external_ap.freq, &candidate_channel);
Comment thread
gsathish86 marked this conversation as resolved.
candidate_params = (wifi_radio_operationParam_t *)malloc(sizeof(wifi_radio_operationParam_t));
if (candidate_params == NULL) {
wifi_util_error_print(WIFI_CTRL, "%s:%d: failed to allocate candidate radio parameters\n",
__func__, __LINE__);
return;
Comment thread
gsathish86 marked this conversation as resolved.
}

pthread_mutex_lock(&mgr->data_cache_lock);
memcpy(candidate_params, radio_params, sizeof(wifi_radio_operationParam_t));
pthread_mutex_unlock(&mgr->data_cache_lock);

candidate_params->channel = candidate_channel;
if (candidate->external_ap.oper_chan_bw != 0) {
candidate_params->channelWidth = candidate->external_ap.oper_chan_bw;
Comment thread
gsathish86 marked this conversation as resolved.
}

candidate_valid = (candidate_channel != 0) &&
(wifi_radio_operationParam_validation(&mgr->hal_cap, candidate_params) == RETURN_OK);
Comment thread
gsathish86 marked this conversation as resolved.
free(candidate_params);
candidate_params = NULL;

if (!candidate_valid) {
wifi_util_error_print(WIFI_CTRL,
"%s:%d: rejecting backhaul candidate bssid:%s freq:%d; channel is unavailable\n",
__func__, __LINE__, to_mac_str(candidate->external_ap.bssid, bssid_str),
candidate->external_ap.freq);

if (ext->conn_state == connection_state_connection_to_nb_in_progress) {
memset(&ext->new_bss, 0, sizeof(ext->new_bss));
ext_set_conn_state(ext, connection_state_disconnected_scan_list_none, __func__,
__LINE__);
} else if (ext->conn_state == connection_state_connection_to_lcb_in_progress) {
memset(&ext->last_connected_bss, 0, sizeof(ext->last_connected_bss));
ext_set_conn_state(ext, connection_state_disconnected_scan_list_none, __func__,
__LINE__);
} else {
candidate->conn_attempt = connection_attempt_failed;
candidate->conn_retry_attempt = STA_MAX_CONNECT_ATTEMPT;
}

schedule_connect_sm(svc);
return;
}
if (ctrl->rf_status_down == true) {
hotspot_timing_target_detected();
}
Expand Down
6 changes: 4 additions & 2 deletions source/utils/wifi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3732,8 +3732,10 @@ int wifi_radio_operationParam_validation(wifi_hal_capability_t *hal_cap, wifi_r
is_valid = true;
}

//If radar was detected on the selected DFS channel, return error
if( (oper->channel >= 52 && oper->channel <=144) ) {
//If radar was detected in the selected 5GHz operating block, return error
if (is_valid &&
(is_5g_20M_channel_in_dfs(oper->channel) ||
oper->channelWidth == WIFI_CHANNELBANDWIDTH_160MHZ)) {
UINT inputChannelBlock = 0;
UINT firstChannelInBand = 36;
int blockStartChannel = 0;
Expand Down
Loading