summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepthi Gowri <deepthi@codeaurora.org>2016-09-13 15:14:34 +0530
committerNishank Aggarwal <naggar@codeaurora.org>2016-09-16 21:06:35 +0530
commitb3bfefd6e10016326dca07e1f38565d28497b400 (patch)
treecdae56177e28735a15c7e8cf35d97308bdc774ec
parent81f573f56d880517f428744a1dcc3c845453f550 (diff)
qcacld-3.0: Pass the correct reason code to disassoc
qcacld-2.0 to qcacld-3.0 propagation use the same reason code in the disassoc, which the upper layer has passed to the driver Change-Id: I6302a5c8318a8e3c1221b9272637455da4e7f150 CRs-Fixed: 852387
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c4
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c17
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.h2
-rw-r--r--core/hdd/src/wlan_hdd_main.c9
-rw-r--r--core/sap/inc/sap_api.h2
-rw-r--r--core/sap/src/sap_module.c7
-rw-r--r--core/sme/inc/sme_api.h2
-rw-r--r--core/sme/src/common/sme_api.c24
-rw-r--r--core/sme/src/csr/csr_api_roam.c29
-rw-r--r--core/sme/src/csr/csr_inside_api.h24
10 files changed, 69 insertions, 51 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 8f1c09fa6ae7..e4e93f4b69d7 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -12550,7 +12550,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
qdf_event_reset(&hapd_state->qdf_event);
hdd_softap_sta_disassoc(pAdapter,
- mac);
+ pDelStaParams);
qdf_status =
hdd_softap_sta_deauth(pAdapter,
pDelStaParams);
@@ -12608,7 +12608,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
goto fn_end;
qdf_event_reset(&hapd_state->qdf_event);
- hdd_softap_sta_disassoc(pAdapter, mac);
+ hdd_softap_sta_disassoc(pAdapter, pDelStaParams);
qdf_status = hdd_softap_sta_deauth(pAdapter,
pDelStaParams);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 0bd7291073fa..f590d07cfc39 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -538,6 +538,7 @@ void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter,
{
uint8_t staId = 0;
struct net_device *dev;
+ struct tagCsrDelStaParams del_sta_params;
dev = (struct net_device *)usrDataForCallback;
hdd_err("Clearing all the STA entry....");
@@ -545,11 +546,14 @@ void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter,
if (pHostapdAdapter->aStaInfo[staId].isUsed &&
(staId !=
(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->uBCStaId)) {
+ wlansap_populate_del_sta_params(
+ &pHostapdAdapter->aStaInfo[staId].macAddrSTA.
+ bytes[0], eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
+ (SIR_MAC_MGMT_DISASSOC >> 4), &del_sta_params);
+
/* Disconnect all the stations */
hdd_softap_sta_disassoc(pHostapdAdapter,
- &pHostapdAdapter->
- aStaInfo[staId].macAddrSTA.
- bytes[0]);
+ &del_sta_params);
}
}
}
@@ -3739,6 +3743,7 @@ static __iw_softap_disassoc_sta(struct net_device *dev,
hdd_context_t *hdd_ctx;
uint8_t *peerMacAddr;
int ret;
+ struct tagCsrDelStaParams del_sta_params;
ENTER_DEV(dev);
@@ -3759,7 +3764,11 @@ static __iw_softap_disassoc_sta(struct net_device *dev,
hdd_notice("data " MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(peerMacAddr));
- hdd_softap_sta_disassoc(pHostapdAdapter, peerMacAddr);
+ wlansap_populate_del_sta_params(peerMacAddr,
+ eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
+ (SIR_MAC_MGMT_DISASSOC >> 4),
+ &del_sta_params);
+ hdd_softap_sta_disassoc(pHostapdAdapter, &del_sta_params);
EXIT();
return 0;
}
diff --git a/core/hdd/src/wlan_hdd_hostapd.h b/core/hdd/src/wlan_hdd_hostapd.h
index ed8c0ac5d3e0..251d5c7dabfb 100644
--- a/core/hdd/src/wlan_hdd_hostapd.h
+++ b/core/hdd/src/wlan_hdd_hostapd.h
@@ -83,7 +83,7 @@ hdd_translate_wpa_to_csr_encryption_type(uint8_t cipher_suite[4]);
QDF_STATUS hdd_softap_sta_deauth(hdd_adapter_t *,
struct tagCsrDelStaParams *);
-void hdd_softap_sta_disassoc(hdd_adapter_t *, uint8_t *);
+void hdd_softap_sta_disassoc(hdd_adapter_t *, struct tagCsrDelStaParams *);
void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t *, bool);
int hdd_softap_unpack_ie(tHalHandle halHandle,
eCsrEncryptionType *pEncryptType,
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index e37eb7261942..554fa29703a0 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -7876,13 +7876,14 @@ QDF_STATUS hdd_softap_sta_deauth(hdd_adapter_t *adapter,
/**
* hdd_softap_sta_disassoc() - take counter measure to handle deauth req from HDD
* @adapter: Pointer to the HDD
+ * @p_del_sta_params: pointer to station deletion parameters
*
* This to take counter measure to handle deauth req from HDD
*
* Return: None
*/
void hdd_softap_sta_disassoc(hdd_adapter_t *adapter,
- uint8_t *pDestMacAddress)
+ struct tagCsrDelStaParams *pDelStaParams)
{
#ifndef WLAN_FEATURE_MBSSID
v_CONTEXT_t p_cds_context = (WLAN_HDD_GET_CTX(adapter))->pcds_context;
@@ -7894,14 +7895,14 @@ void hdd_softap_sta_disassoc(hdd_adapter_t *adapter,
(WLAN_HDD_GET_CTX(adapter))->pcds_context);
/* Ignore request to disassoc bcmc station */
- if (pDestMacAddress[0] & 0x1)
+ if (pDelStaParams->peerMacAddr.bytes[0] & 0x1)
return;
#ifdef WLAN_FEATURE_MBSSID
wlansap_disassoc_sta(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
- pDestMacAddress);
+ pDelStaParams);
#else
- wlansap_disassoc_sta(p_cds_context, pDestMacAddress);
+ wlansap_disassoc_sta(p_cds_context, pDelStaParams);
#endif
}
diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h
index cb42982133b3..60b97cca6da2 100644
--- a/core/sap/inc/sap_api.h
+++ b/core/sap/inc/sap_api.h
@@ -855,7 +855,7 @@ uint16_t wlansap_check_cc_intf(void *Ctx);
QDF_STATUS wlansap_set_mac_acl(void *p_cds_gctx, tsap_Config_t *pConfig);
QDF_STATUS wlansap_stop_bss(void *p_cds_gctx);
QDF_STATUS wlansap_disassoc_sta(void *p_cds_gctx,
- const uint8_t *pPeerStaMac);
+ struct tagCsrDelStaParams *p_del_sta_params);
QDF_STATUS wlansap_deauth_sta(void *p_cds_gctx,
struct tagCsrDelStaParams *pDelStaParams);
QDF_STATUS wlansap_set_channel_change_with_csa(void *p_cds_gctx,
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index 0523494e2944..653871ecacf8 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -1452,14 +1452,15 @@ wlansap_modify_acl
* @pCtx: Pointer to the global cds 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.
- * @pPeerStaMac: Mac address of the station to disassociate
+ * @p_del_sta_params: pointer to station deletion parameters
*
* This api function provides for Ap App/HDD initiated disassociation of station
*
* Return: The QDF_STATUS code associated with performing the operation
* QDF_STATUS_SUCCESS: Success
*/
-QDF_STATUS wlansap_disassoc_sta(void *pCtx, const uint8_t *pPeerStaMac)
+QDF_STATUS wlansap_disassoc_sta(void *pCtx,
+ struct tagCsrDelStaParams *p_del_sta_params)
{
ptSapContext pSapCtx = CDS_GET_SAP_CB(pCtx);
@@ -1474,7 +1475,7 @@ QDF_STATUS wlansap_disassoc_sta(void *pCtx, const uint8_t *pPeerStaMac)
}
sme_roam_disconnect_sta(CDS_GET_HAL_CB(pSapCtx->p_cds_gctx),
- pSapCtx->sessionId, pPeerStaMac);
+ pSapCtx->sessionId, p_del_sta_params);
return QDF_STATUS_SUCCESS;
}
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 2514084508d1..1d98b854018a 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -288,7 +288,7 @@ QDF_STATUS sme_roam_get_associated_stas(tHalHandle hHal, uint8_t sessionId,
void *pfnSapEventCallback,
uint8_t *pAssocStasBuf);
QDF_STATUS sme_roam_disconnect_sta(tHalHandle hHal, uint8_t sessionId,
- const uint8_t *pPeerMacAddr);
+ struct tagCsrDelStaParams *p_del_sta_params);
QDF_STATUS sme_roam_deauth_sta(tHalHandle hHal, uint8_t sessionId,
struct tagCsrDelStaParams *pDelStaParams);
QDF_STATUS sme_roam_tkip_counter_measures(tHalHandle hHal, uint8_t sessionId,
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index bb32425df585..9cc8a1e35327 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -3993,16 +3993,19 @@ QDF_STATUS sme_roam_stop_bss(tHalHandle hHal, uint8_t sessionId)
return status;
}
-/* ---------------------------------------------------------------------------
- \fn sme_roam_disconnect_sta
- \brief To disassociate a station. This is an asynchronous API.
- \param hHal - Global structure
- \param sessionId - sessionId of SoftAP
- \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes)
- \return QDF_STATUS SUCCESS Roam callback will be called to indicate actual results
- -------------------------------------------------------------------------------*/
+/**
+ * sme_roam_disconnect_sta() - disassociate a station
+ * @hHal: Global structure
+ * @sessionId: SessionId of SoftAP
+ * @p_del_sta_params: Pointer to parameters of the station to disassoc
+ *
+ * To disassociate a station. This is an asynchronous API.
+ *
+ * Return: QDF_STATUS_SUCCESS on success.Roam callback will
+ * be called to indicate actual result.
+ */
QDF_STATUS sme_roam_disconnect_sta(tHalHandle hHal, uint8_t sessionId,
- const uint8_t *pPeerMacAddr)
+ struct tagCsrDelStaParams *p_del_sta_params)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
@@ -4016,8 +4019,7 @@ QDF_STATUS sme_roam_disconnect_sta(tHalHandle hHal, uint8_t sessionId,
if (QDF_IS_STATUS_SUCCESS(status)) {
if (CSR_IS_SESSION_VALID(pMac, sessionId)) {
status = csr_roam_issue_disassociate_sta_cmd(pMac,
- sessionId, pPeerMacAddr,
- eSIR_MAC_DEAUTH_LEAVING_BSS_REASON);
+ sessionId, p_del_sta_params);
} else {
status = QDF_STATUS_E_INVAL;
}
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 0086e0d2dba9..364f71c5e36d 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -3476,18 +3476,20 @@ QDF_STATUS csr_roam_issue_disassociate(tpAniSirGlobal pMac, uint32_t sessionId,
return status;
}
-/* ---------------------------------------------------------------------------
- \fn csr_roam_issue_disassociate_sta_cmd
- \brief csr function that HDD calls to disassociate a associated station
- \param sessionId - session Id for Soft AP
- \param pPeerMacAddr - MAC of associated station to delete
- \param reason - reason code, be one of the tSirMacReasonCodes
- \return QDF_STATUS
- ---------------------------------------------------------------------------*/
+/**
+ * csr_roam_issue_disassociate_sta_cmd() - disassociate a associated station
+ * @sessionId: Session Id for Soft AP
+ * @p_del_sta_params: Pointer to parameters of the station to disassoc
+ *
+ * CSR function that HDD calls to delete a associated station
+ *
+ * Return: QDF_STATUS_SUCCESS on success or another QDF_STATUS_* on error
+ */
QDF_STATUS csr_roam_issue_disassociate_sta_cmd(tpAniSirGlobal pMac,
uint32_t sessionId,
- const uint8_t *pPeerMacAddr,
- uint32_t reason)
+ struct tagCsrDelStaParams
+ *p_del_sta_params)
+
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
tSmeCmd *pCommand;
@@ -3502,8 +3504,11 @@ QDF_STATUS csr_roam_issue_disassociate_sta_cmd(tpAniSirGlobal pMac,
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (uint8_t) sessionId;
pCommand->u.roamCmd.roamReason = eCsrForcedDisassocSta;
- qdf_mem_copy(pCommand->u.roamCmd.peerMac, pPeerMacAddr, 6);
- pCommand->u.roamCmd.reason = (tSirMacReasonCodes) reason;
+ qdf_mem_copy(pCommand->u.roamCmd.peerMac,
+ p_del_sta_params->peerMacAddr.bytes,
+ sizeof(pCommand->u.roamCmd.peerMac));
+ pCommand->u.roamCmd.reason =
+ (tSirMacReasonCodes)p_del_sta_params->reason_code;
status = csr_queue_sme_command(pMac, pCommand, false);
if (!QDF_IS_STATUS_SUCCESS(status)) {
sms_log(pMac, LOGE,
diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h
index 8be19e1edfd8..ee6488c5884b 100644
--- a/core/sme/src/csr/csr_inside_api.h
+++ b/core/sme/src/csr/csr_inside_api.h
@@ -909,20 +909,20 @@ void csr_call_roaming_completion_callback(tpAniSirGlobal pMac,
tCsrRoamSession *pSession,
tCsrRoamInfo *pRoamInfo, uint32_t roamId,
eCsrRoamResult roamResult);
-
-/* ---------------------------------------------------------------------------
- \fn csr_roam_issue_disassociate_sta_cmd
- \brief csr function that HDD calls to disassociate a associated station
- \param sessionId - session Id for Soft AP
- \param pPeerMacAddr - MAC of associated station to delete
- \param reason - reason code, be one of the tSirMacReasonCodes
- \return QDF_STATUS
- ---------------------------------------------------------------------------*/
+/**
+ * csr_roam_issue_disassociate_sta_cmd() - disassociate a associated station
+ * @pMac: Pointer to global structure for MAC
+ * @sessionId: Session Id for Soft AP
+ * @p_del_sta_params: Pointer to parameters of the station to disassoc
+ *
+ * CSR function that HDD calls to issue a deauthenticate station command
+ *
+ * Return: QDF_STATUS_SUCCESS on success or another QDF_STATUS_* on error
+ */
QDF_STATUS csr_roam_issue_disassociate_sta_cmd(tpAniSirGlobal pMac,
uint32_t sessionId,
- const uint8_t *pPeerMacAddr,
- uint32_t reason);
-
+ struct tagCsrDelStaParams
+ *p_del_sta_params);
/**
* csr_roam_issue_deauth_sta_cmd() - issue deauthenticate station command
* @pMac: Pointer to global structure for MAC