mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
qcacld-3.0: Clean up cfg80211 del_station for Kernel upgrade
Commit:89c771e("cfg80211: Convert del_station() callback to use a param struct") Commit:9885686("cfg80211: Specify frame and reason code for NL80211_CMD_DEL_STATION") These two commits have been merged in Kernel 3.19. Add a kernel version macro to support this. And refactor the inclusion of CFG80211_DEL_STA_V2 by adding a helper function to clean it up, that way we can keep the flag only in wlan_hdd_cfg80211.h/c as this is the cfg80211 interface related changes. Change-Id: I811065b7fa1cf2aee68cfe63c5cf78c2270e5af7 CRs-fixed: 963651
This commit is contained in:
parent
e7bc3a73f6
commit
8ecb0fa07a
4 changed files with 38 additions and 34 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue