diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 6718d3cbff41..19f19b0399ba 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -7286,9 +7286,6 @@ void cds_restart_sap(hdd_adapter_t *ap_adapter) QDF_STATUS qdf_status; QDF_STATUS qdf_status; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); -#ifdef CFG80211_DEL_STA_V2 - struct tagCsrDelStaParams delStaParams; -#endif tsap_Config_t *sap_config; void *sap_ctx; @@ -7298,17 +7295,7 @@ void cds_restart_sap(hdd_adapter_t *ap_adapter) mutex_lock(&hdd_ctx->sap_lock); if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) { -#ifdef CFG80211_DEL_STA_V2 - delStaParams.mac = NULL; - delStaParams.subtype = SIR_MAC_MGMT_DEAUTH >> 4; - delStaParams.reason_code = eCsrForcedDeauthSta; - wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy, - ap_adapter->dev, - &delStaParams); -#else - wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy, - ap_adapter->dev, NULL); -#endif + wlan_hdd_del_station(ap_adapter); hdd_cleanup_actionframe(hdd_ctx, ap_adapter); hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter); qdf_event_reset(&hostapd_state->qdf_stop_bss_event); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 98265e02b0ff..77d513eac8ac 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10004,7 +10004,31 @@ fn_end: return 0; } -#ifdef CFG80211_DEL_STA_V2 +#if defined(USE_CFG80211_DEL_STA_V2) +/** + * wlan_hdd_del_station() - delete station wrapper + * @adapter: pointer to the hdd adapter + * + * Return: None + */ +void wlan_hdd_del_station(hdd_adapter_t *adapter) +{ + struct station_del_parameters del_sta; + del_sta.mac = NULL; + del_sta.subtype = SIR_MAC_MGMT_DEAUTH >> 4; + del_sta.reason_code = eCsrForcedDeauthSta; + + wlan_hdd_cfg80211_del_station(adapter->wdev.wiphy, adapter->dev, + &del_sta); +} +#else +void wlan_hdd_del_station(hdd_adapter_t *adapter) +{ + wlan_hdd_cfg80211_del_station(adapter->wdev.wiphy, adapter->dev, NULL); +} +#endif + +#if defined(USE_CFG80211_DEL_STA_V2) /** * wlan_hdd_cfg80211_del_station() - delete station v2 * @wiphy: Pointer to wiphy @@ -10038,9 +10062,9 @@ int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct tagCsrDelStaParams delStaParams; cds_ssr_protect(__func__); -#ifdef CFG80211_DEL_STA_V2 +#if defined(USE_CFG80211_DEL_STA_V2) if (NULL == param) { - hddLog(LOGE, FL("Invalid argumet passed")); + hdd_err("Invalid argument passed"); return -EINVAL; } wlansap_populate_del_sta_params(param->mac, param->reason_code, diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 7d05c1bd6e1b..eaa82bedf5dc 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -106,6 +106,10 @@ #define CHANNEL_SWITCH_SUPPORTED #endif +#if defined(CFG80211_DEL_STA_V2) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) || defined(WITH_BACKPORTS) +#define USE_CFG80211_DEL_STA_V2 +#endif + /** * typedef struct qcom_ie_age - age ie * @@ -2324,7 +2328,9 @@ void hdd_select_cbmode(hdd_adapter_t *pAdapter, uint8_t operationChannel); uint8_t *wlan_hdd_cfg80211_get_ie_ptr(const uint8_t *ies_ptr, int length, uint8_t eid); -#ifdef CFG80211_DEL_STA_V2 +void wlan_hdd_del_station(hdd_adapter_t *adapter); + +#if defined(USE_CFG80211_DEL_STA_V2) int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, struct station_del_parameters *param); @@ -2338,7 +2344,8 @@ int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, uint8_t *mac); #endif -#endif +#endif /* USE_CFG80211_DEL_STA_V2 */ + #if defined(QCA_WIFI_FTM) && defined(CONFIG_NL80211_TESTMODE) void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a9722789d714..9f0f4925d893 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6568,9 +6568,6 @@ void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter) hdd_hostapd_state_t *hostapd_state; QDF_STATUS qdf_status; hdd_context_t *hdd_ctx; -#ifdef CFG80211_DEL_STA_V2 - struct station_del_parameters delStaParams; -#endif if (NULL == ap_adapter) { hddLog(QDF_TRACE_LEVEL_ERROR, @@ -6587,18 +6584,7 @@ void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter) } mutex_lock(&hdd_ctx->sap_lock); if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) { -#ifdef CFG80211_DEL_STA_V2 - delStaParams.mac = NULL; - delStaParams.subtype = SIR_MAC_MGMT_DEAUTH >> 4; - delStaParams.reason_code = eCsrForcedDeauthSta; - wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy, - ap_adapter->dev, - &delStaParams); -#else - wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy, - ap_adapter->dev, - NULL); -#endif + wlan_hdd_del_station(ap_adapter); hdd_cleanup_actionframe(hdd_ctx, ap_adapter); hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter); hddLog(QDF_TRACE_LEVEL_INFO_HIGH,