|
@@ -3092,6 +3092,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
|
|
|
struct hdd_adapter *ap_adapter = wlan_hdd_get_adapter_from_vdev(
|
|
|
psoc, vdev_id);
|
|
|
uint32_t sap_ch_freq, intf_ch_freq;
|
|
|
+ struct sap_context *sap_context;
|
|
|
|
|
|
if (!ap_adapter) {
|
|
|
hdd_err("ap_adapter is NULL");
|
|
@@ -3115,12 +3116,20 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
|
|
|
}
|
|
|
|
|
|
hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
|
|
|
-
|
|
|
mac_handle = hdd_ctx->mac_handle;
|
|
|
if (!mac_handle) {
|
|
|
hdd_err("mac_handle is NULL");
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
+ sap_context = hdd_ap_ctx->sap_context;
|
|
|
+ if (!sap_context) {
|
|
|
+ hdd_err("sap_context is null");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+ if (QDF_IS_STATUS_ERROR(wlansap_context_get(sap_context))) {
|
|
|
+ hdd_err("sap_context is invalid");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
|
* If STA+SAP sessions are on DFS channel and STA+SAP SCC is
|
|
@@ -3142,7 +3151,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
|
|
|
* supported, return from here if DBS is not supported.
|
|
|
* Need to take care of 3 port cases with 2 STA iface in future.
|
|
|
*/
|
|
|
- intf_ch_freq = wlansap_check_cc_intf(hdd_ap_ctx->sap_context);
|
|
|
+ intf_ch_freq = wlansap_check_cc_intf(sap_context);
|
|
|
policy_mgr_get_chan_by_session_id(psoc, vdev_id, &sap_ch_freq);
|
|
|
hdd_info("sap_vdev %d intf_ch: %d, orig freq: %d",
|
|
|
vdev_id, intf_ch_freq, sap_ch_freq);
|
|
@@ -3151,6 +3160,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
|
|
|
if (QDF_IS_STATUS_ERROR(
|
|
|
policy_mgr_valid_sap_conc_channel_check(
|
|
|
hdd_ctx->psoc, &intf_ch_freq, sap_ch_freq, vdev_id))) {
|
|
|
+ wlansap_context_put(sap_context);
|
|
|
hdd_debug("can't move sap to chan(freq): %u",
|
|
|
intf_ch_freq);
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
@@ -3159,13 +3169,14 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart(
|
|
|
|
|
|
sap_restart:
|
|
|
if (!intf_ch_freq) {
|
|
|
- intf_ch_freq = wlansap_get_chan_band_restrict(hdd_ap_ctx->sap_context);
|
|
|
+ intf_ch_freq = wlansap_get_chan_band_restrict(sap_context);
|
|
|
if (intf_ch_freq == sap_ch_freq)
|
|
|
intf_ch_freq = 0;
|
|
|
- } else if (hdd_ap_ctx->sap_context)
|
|
|
- hdd_ap_ctx->sap_context->csa_reason =
|
|
|
+ } else
|
|
|
+ sap_context->csa_reason =
|
|
|
CSA_REASON_CONCURRENT_STA_CHANGED_CHANNEL;
|
|
|
if (!intf_ch_freq) {
|
|
|
+ wlansap_context_put(sap_context);
|
|
|
hdd_debug("interface channel is 0");
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
@@ -3183,6 +3194,7 @@ sap_restart:
|
|
|
hdd_info("SAP channel change with CSA/ECSA");
|
|
|
hdd_sap_restart_chan_switch_cb(psoc, vdev_id, *ch_freq,
|
|
|
ch_params.ch_width, false);
|
|
|
+ wlansap_context_put(sap_context);
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|