mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacld-3.0: Fix regulatory update event
If set country fails, disable the flag stating the update is in progress. Otherwise, all subsequent requests will end up waiting for the full timeout period. Change-Id: Id35f49b65d5b641d9a0093204dadecc1792ee529 CRs-fixed: 2892388
This commit is contained in:
parent
3cee8e98aa
commit
74ae456ff0
3 changed files with 34 additions and 2 deletions
|
|
@ -3057,6 +3057,14 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
|
|||
hdd_debug("waiting for channel list to update");
|
||||
qdf_wait_for_event_completion(&hdd_ctx->regulatory_update_event,
|
||||
CHANNEL_LIST_UPDATE_TIMEOUT);
|
||||
/* In case of set country failure in FW, response never comes
|
||||
* so wait the full timeout, then set in_progress to false.
|
||||
* If the response comes back, in_progress will already be set
|
||||
* to false anyways.
|
||||
*/
|
||||
qdf_mutex_acquire(&hdd_ctx->regulatory_status_lock);
|
||||
hdd_ctx->is_regulatory_update_in_progress = false;
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
} else {
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
}
|
||||
|
|
@ -20735,6 +20743,14 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
|
|||
hdd_debug("waiting for channel list to update");
|
||||
qdf_wait_for_event_completion(&hdd_ctx->regulatory_update_event,
|
||||
CHANNEL_LIST_UPDATE_TIMEOUT);
|
||||
/* In case of set country failure in FW, response never comes
|
||||
* so wait the full timeout, then set in_progress to false.
|
||||
* If the response comes back, in_progress will already be set
|
||||
* to false anyways.
|
||||
*/
|
||||
qdf_mutex_acquire(&hdd_ctx->regulatory_status_lock);
|
||||
hdd_ctx->is_regulatory_update_in_progress = false;
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
} else {
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6486,6 +6486,14 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|||
hdd_debug("waiting for channel list to update");
|
||||
qdf_wait_for_event_completion(&hdd_ctx->regulatory_update_event,
|
||||
CHANNEL_LIST_UPDATE_TIMEOUT);
|
||||
/* In case of set country failure in FW, response never comes
|
||||
* so wait the full timeout, then set in_progress to false.
|
||||
* If the response comes back, in_progress will already be set
|
||||
* to false anyways.
|
||||
*/
|
||||
qdf_mutex_acquire(&hdd_ctx->regulatory_status_lock);
|
||||
hdd_ctx->is_regulatory_update_in_progress = false;
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
} else {
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -757,8 +757,12 @@ int hdd_reg_set_country(struct hdd_context *hdd_ctx, char *country_code)
|
|||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
|
||||
status = ucfg_reg_set_country(hdd_ctx->pdev, cc);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err("Failed to set country");
|
||||
qdf_mutex_acquire(&hdd_ctx->regulatory_status_lock);
|
||||
hdd_ctx->is_regulatory_update_in_progress = false;
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
}
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
|
@ -931,8 +935,12 @@ void hdd_reg_notifier(struct wiphy *wiphy,
|
|||
break;
|
||||
}
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err("Failed to set country");
|
||||
qdf_mutex_acquire(&hdd_ctx->regulatory_status_lock);
|
||||
hdd_ctx->is_regulatory_update_in_progress = false;
|
||||
qdf_mutex_release(&hdd_ctx->regulatory_status_lock);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void hdd_reg_notifier(struct wiphy *wiphy,
|
||||
|
|
|
|||
Loading…
Reference in a new issue