summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c20
-rw-r--r--core/sap/inc/sap_api.h1
-rw-r--r--core/sap/src/sap_module.c23
3 files changed, 43 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index b43b4ecf2fc6..9ddd3fd6d48a 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -604,6 +604,21 @@ static void hdd_issue_stored_joinreq(hdd_adapter_t *sta_adapter,
}
}
+#ifdef WLAN_FEATURE_MBSSID
+static eCsrPhyMode
+hdd_sap_get_phymode(hdd_adapter_t *hostapd_adapter)
+{
+ return wlansap_get_phymode(WLAN_HDD_GET_SAP_CTX_PTR(hostapd_adapter));
+}
+#else
+static eCsrPhyMode
+hdd_sap_get_phymode(hdd_adapter_t *hostapd_adapter)
+{
+ return wlansap_get_phymode(
+ (WLAN_HDD_GET_CTX(hostapd_adapter))->pcds_context);
+}
+#endif
+
/**
* hdd_chan_change_notify() - Function to notify hostapd about channel change
* @hostapd_adapter hostapd adapter
@@ -641,7 +656,7 @@ CDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
return CDF_STATUS_E_FAILURE;
}
- phy_mode = sme_get_phy_mode(hal);
+ phy_mode = hdd_sap_get_phymode(hostapd_adapter);
if (oper_chan <= 14)
cb_mode = sme_get_cb_phy_state_from_cb_ini_value(
@@ -669,6 +684,9 @@ CDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
break;
}
+ hdd_info("%s: phy_mode %d cb_mode %d chann_type %d oper_chan %d",
+ __func__, phy_mode, cb_mode, channel_type, oper_chan);
+
cfg80211_chandef_create(&chandef, chan, channel_type);
cfg80211_ch_switch_notify(dev, &chandef);
diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h
index 0da62d0f9c05..e77d058822ea 100644
--- a/core/sap/inc/sap_api.h
+++ b/core/sap/inc/sap_api.h
@@ -906,6 +906,7 @@ CDF_STATUS wlansap_acs_chselect(void *pvos_gctx,
tpWLAN_SAPEventCB pacs_event_callback,
tsap_Config_t *pconfig,
void *pusr_context);
+eCsrPhyMode wlansap_get_phymode(void *pctx);
#ifdef __cplusplus
}
#endif
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index 581db3d8bdc2..63b9981bf27f 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -3299,3 +3299,26 @@ void wlan_sap_enable_phy_error_logs(tHalHandle hal, bool enable_log)
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
mac_ctx->sap.enable_dfs_phy_error_logs = enable_log;
}
+/**
+* wlansap_get_phymode() - get SAP phymode.
+* @pctx: Pointer to the global vos context; a handle to SAP's control block
+* can be extracted from its context. When MBSSID feature is enabled,
+* SAP context is directly passed to SAP APIs.
+*
+* This function provides current phymode of SAP interface.
+*
+* Return: phymode with eCsrPhyMode type.
+*/
+eCsrPhyMode
+wlansap_get_phymode(void *pctx)
+{
+ ptSapContext sap_context = NULL;
+
+ sap_context = CDS_GET_SAP_CB(pctx);
+ if (NULL == sap_context) {
+ CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_ERROR,
+ "%s: Invalid SAP pointer from pctx", __func__);
+ return eCSR_DOT11_MODE_AUTO;
+ }
+ return sap_context->csr_roamProfile.phyMode;
+}