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
This commit is contained in:
Deepthi Gowri 2016-09-13 15:14:34 +05:30 • committed by Nishank Aggarwal
commit b3bfefd6e1
10 changed files with 69 additions and 51 deletions

View file

@ -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)) {

View file

@ -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;
}

View file

@ -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,

View file

@ -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
}

View file

@ -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,

View file

@ -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;
}

View file

@ -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,

View file

@ -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;
}

View file

@ -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,

View file

@ -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