From 4f9d4a2aa8b91cfbf675c2fa5a8b2105c1f42332 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 6 Oct 2016 18:45:15 -0700 Subject: [PATCH 001/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_ft* We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_ft & lim_ft_preauth. Change-Id: I566992b77e47309f8a98fa5be8b46014140820a1 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_ft.c | 2 +- core/mac/src/pe/lim/lim_ft_preauth.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/mac/src/pe/lim/lim_ft.c b/core/mac/src/pe/lim/lim_ft.c index ba6ef6ce34cc..d690218a2ce4 100644 --- a/core/mac/src/pe/lim/lim_ft.c +++ b/core/mac/src/pe/lim/lim_ft.c @@ -861,7 +861,7 @@ bool lim_process_ft_update_key(tpAniSirGlobal pMac, uint32_t *pMsgBuf) return true; } -void +static void lim_ft_send_aggr_qos_rsp(tpAniSirGlobal pMac, uint8_t rspReqd, tpAggrAddTsParams aggrQosRsp, uint8_t smesessionId) { diff --git a/core/mac/src/pe/lim/lim_ft_preauth.c b/core/mac/src/pe/lim/lim_ft_preauth.c index 07368b6cfd92..6195a041f3c0 100644 --- a/core/mac/src/pe/lim/lim_ft_preauth.c +++ b/core/mac/src/pe/lim/lim_ft_preauth.c @@ -350,12 +350,13 @@ tSirRetStatus lim_ft_setup_auth_session(tpAniSirGlobal pMac, * lim_ft_process_pre_auth_result() - Process the Auth frame * @pMac: Global MAC context * @status: Status code - * psessionEntry: PE Session + * @psessionEntry: PE Session * * Return: None */ -void lim_ft_process_pre_auth_result(tpAniSirGlobal pMac, QDF_STATUS status, - tpPESession psessionEntry) +static void lim_ft_process_pre_auth_result(tpAniSirGlobal pMac, + QDF_STATUS status, + tpPESession psessionEntry) { if (NULL == psessionEntry || NULL == psessionEntry->ftPEContext.pFTPreAuthReq) From 3a4d31e84a80799edd2b42fcc478f9c2c2a6cc15 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:25:04 -0700 Subject: [PATCH 002/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_process_mlm_req_messages We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_process_mlm_req_messages. Change-Id: I82d77da22143e4d6e421392457be51c3e11b62f0 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_process_mlm_req_messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 09e5c52f867e..6819abd894a8 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -714,7 +714,7 @@ end: * * Return: none */ -void lim_post_join_set_link_state_callback(tpAniSirGlobal mac, +static void lim_post_join_set_link_state_callback(tpAniSirGlobal mac, void *callback_arg, bool status) { uint8_t chan_num, sec_chan_offset; From a0495a608565542880e52340fe75441988c35875 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:25:58 -0700 Subject: [PATCH 003/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_process_mlm_rsp_messages We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_process_mlm_rsp_messages. Change-Id: Ib4f962d436e427d39303511c60799e9efcb25779 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 9082aecadb68..668b63696bb2 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -339,7 +339,7 @@ void lim_process_mlm_join_cnf(tpAniSirGlobal mac_ctx, * Return: None */ -void lim_send_mlm_assoc_req(tpAniSirGlobal mac_ctx, +static void lim_send_mlm_assoc_req(tpAniSirGlobal mac_ctx, tpPESession session_entry) { tLimMlmAssocReq *assoc_req; @@ -740,7 +740,7 @@ void lim_process_mlm_assoc_cnf(tpAniSirGlobal mac_ctx, * Return: None */ -void +static void lim_fill_assoc_ind_params(tpAniSirGlobal mac_ctx, tpLimMlmAssocInd assoc_ind, tSirSmeAssocInd *sme_assoc_ind, tpPESession session_entry) @@ -3224,7 +3224,7 @@ void lim_send_beacon_ind(tpAniSirGlobal pMac, tpPESession psessionEntry) * * @return None */ -void lim_send_sme_scan_cache_updated_ind(uint8_t sessionId) +static void lim_send_sme_scan_cache_updated_ind(uint8_t sessionId) { cds_msg_t msg; @@ -3241,8 +3241,8 @@ void lim_send_sme_scan_cache_updated_ind(uint8_t sessionId) } #endif -void lim_send_scan_offload_complete(tpAniSirGlobal pMac, - tSirScanOffloadEvent *pScanEvent) +static void lim_send_scan_offload_complete(tpAniSirGlobal pMac, + tSirScanOffloadEvent *pScanEvent) { pMac->lim.gLimRspReqd = false; From 662ba06e20b5517b708c56ec9c5c3335de2b1a14 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:26:47 -0700 Subject: [PATCH 004/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_process_probe_req_frame We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_process_probe_req_frame. Change-Id: I8d253570f1ab52b52964a6ff67477f7150d39e5d CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_process_probe_req_frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_probe_req_frame.c b/core/mac/src/pe/lim/lim_process_probe_req_frame.c index e83ffd2f7e20..1cea1deda676 100644 --- a/core/mac/src/pe/lim/lim_process_probe_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_probe_req_frame.c @@ -312,7 +312,7 @@ void lim_wpspbc_close(tpAniSirGlobal pMac, tpPESession psessionEntry) * @return BOOLEAN */ -bool lim_check11b_rates(uint8_t rate) +static bool lim_check11b_rates(uint8_t rate) { if ((0x02 == (rate)) || (0x04 == (rate)) From 1e259fa46b785abe20ae4690ad09b5e3ee3d1885 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:27:40 -0700 Subject: [PATCH 005/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_process_probe_rsp_frame We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_process_probe_rsp_frame. Change-Id: I0916219f8560c6e78d475cf94e6f048557d54384 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_process_probe_rsp_frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c index a983f7f4eeec..c47d7aab9bf0 100644 --- a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c @@ -60,7 +60,7 @@ * * Return: 0 on success, one on failure */ -tSirRetStatus +static tSirRetStatus lim_validate_ie_information_in_probe_rsp_frame(tpAniSirGlobal mac_ctx, uint8_t *pRxPacketInfo) { From 38112a38e21dfd81be1080e8b00edb1f7e8058c0 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:30:50 -0700 Subject: [PATCH 006/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_send_management_frames We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_send_management_frames. Change-Id: I7d615fb0837ad427a14764ef8aecbe5c0f64d952 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_send_management_frames.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index b10e5847a4aa..94248e13a9c4 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -79,7 +79,7 @@ * number will roll over. * */ -void lim_add_mgmt_seq_num(tpAniSirGlobal pMac, tpSirMacMgmtHdr pMacHdr) +static void lim_add_mgmt_seq_num(tpAniSirGlobal pMac, tpSirMacMgmtHdr pMacHdr) { if (pMac->mgmtSeqNum >= WLAN_HOST_SEQ_NUM_MAX) { pMac->mgmtSeqNum = WLAN_HOST_SEQ_NUM_MIN - 1; @@ -449,7 +449,7 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx, return eSIR_SUCCESS; } /* End lim_send_probe_req_mgmt_frame. */ -tSirRetStatus lim_get_addn_ie_for_probe_resp(tpAniSirGlobal pMac, +static tSirRetStatus lim_get_addn_ie_for_probe_resp(tpAniSirGlobal pMac, uint8_t *addIE, uint16_t *addnIELen, uint8_t probeReqP2pIe) { @@ -2017,8 +2017,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, * Return: This returns QDF_STATUS */ -QDF_STATUS lim_auth_tx_complete_cnf(tpAniSirGlobal mac_ctx, - uint32_t tx_complete) +static QDF_STATUS lim_auth_tx_complete_cnf(tpAniSirGlobal mac_ctx, + uint32_t tx_complete) { lim_log(mac_ctx, LOG1, FL("tx_complete= %d"), tx_complete); From 6db011e5c47d6651f8022b02d6b8f0588bbfa259 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:31:39 -0700 Subject: [PATCH 007/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_send_sme_rsp_messages We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_send_sme_rsp_messages. Change-Id: I5f97e655d54f06f752d8e83298250ce80e5369e0 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 60ee95534a28..6b524cfbb080 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -398,7 +398,7 @@ static void lim_handle_join_rsp_status(tpAniSirGlobal mac_ctx, * * Return: None */ -void lim_add_bss_info(tpDphHashNode sta_ds, tpSirSmeJoinRsp sme_join_rsp) +static void lim_add_bss_info(tpDphHashNode sta_ds, tpSirSmeJoinRsp sme_join_rsp) { struct parsed_ies *parsed_ies = &sta_ds->parsed_ies; From 9769900bfe97726da06a1facab12105b3680f993 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:32:55 -0700 Subject: [PATCH 008/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_session We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_session. Change-Id: Ied228b11bd6484ee96fa2db827cb675669e78487 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/mac/src/pe/lim/lim_session.c b/core/mac/src/pe/lim/lim_session.c index 9a06e4207da7..efd2482129db 100644 --- a/core/mac/src/pe/lim/lim_session.c +++ b/core/mac/src/pe/lim/lim_session.c @@ -58,7 +58,8 @@ --------------------------------------------------------------------------*/ -void pe_init_beacon_params(tpAniSirGlobal pMac, tpPESession psessionEntry) +static void pe_init_beacon_params(tpAniSirGlobal pMac, + tpPESession psessionEntry) { psessionEntry->beaconParams.beaconInterval = 0; psessionEntry->beaconParams.fShortPreamble = 0; @@ -100,7 +101,7 @@ void pe_init_beacon_params(tpAniSirGlobal pMac, tpPESession psessionEntry) * * Return: void */ -void pe_reset_protection_callback(void *ptr) +static void pe_reset_protection_callback(void *ptr) { tpPESession pe_session_entry = (tpPESession)ptr; tpAniSirGlobal mac_ctx = (tpAniSirGlobal)pe_session_entry->mac_ctx; From 5fc517637240897bd44c5b1123d2dc1295493779 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:33:42 -0700 Subject: [PATCH 009/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_sme_req_utils We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_sme_req_utils. Change-Id: I7b0404a3ca41aa038b9e7db313eb1aadb6b92517 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_sme_req_utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.c b/core/mac/src/pe/lim/lim_sme_req_utils.c index 327009f7f073..cd2112ba0531 100644 --- a/core/mac/src/pe/lim/lim_sme_req_utils.c +++ b/core/mac/src/pe/lim/lim_sme_req_utils.c @@ -49,6 +49,7 @@ #include "lim_assoc_utils.h" #include "lim_security_utils.h" #include "lim_ser_des_utils.h" +#include "lim_sme_req_utils.h" /** * lim_is_rs_nie_valid_in_sme_req_message() From 2249644ff1222b58c5ef7e6e8ac0ba84785e16d3 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:34:46 -0700 Subject: [PATCH 010/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_utils We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_utils. Change-Id: I401597018b30acb6bb8675c7a2d03e2157b1318a CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 420f7c4e30aa..f347e201eec3 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -1167,7 +1167,7 @@ uint8_t lim_is_null_ssid(tSirMacSSid *ssid) \param tHalBitVal lsigTxopSupported \return None -------------------------------------------------------------*/ -void +static void lim_update_prot_sta_params(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tLimProtStaCacheType protStaCacheType, @@ -6472,9 +6472,9 @@ void lim_set_stads_rtt_cap(tpDphHashNode sta_ds, struct s_ext_cap *ext_cap, * * Return: status of operation */ -QDF_STATUS lim_send_ie(tpAniSirGlobal mac_ctx, uint32_t sme_session_id, - uint8_t eid, enum cds_band_type band, uint8_t *buf, - uint32_t len) +static QDF_STATUS lim_send_ie(tpAniSirGlobal mac_ctx, uint32_t sme_session_id, + uint8_t eid, enum cds_band_type band, + uint8_t *buf, uint32_t len) { struct vdev_ie_info *ie_msg; cds_msg_t msg = {0}; From c91a4fc47ed95449b8209cea4b32815f09e62c30 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:33:12 -0700 Subject: [PATCH 011/179] qcacld-3.0: Fix -Wmissing-prototypes in csr_link_list We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in csr_link_list. Change-Id: Iac3b07372d0bb3d949eb7f6dc3dd6b9c084619d2 CRs-Fixed: 1075575 --- core/sme/src/csr/csr_link_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sme/src/csr/csr_link_list.c b/core/sme/src/csr/csr_link_list.c index 2e52aa4312e3..6bac6d808ccf 100644 --- a/core/sme/src/csr/csr_link_list.c +++ b/core/sme/src/csr/csr_link_list.c @@ -103,7 +103,7 @@ static inline void csr_list_insert_head(tListElem *pHead, tListElem *pEntry) } /* Insert pNewEntry before pEntry */ -void csr_list_insert_entry(tListElem *pEntry, tListElem *pNewEntry) +static void csr_list_insert_entry(tListElem *pEntry, tListElem *pNewEntry) { tListElem *pLast; if (!pEntry) { From 7240dd9e5e847b40caa6bcafc272ac4189f68850 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:34:57 -0700 Subject: [PATCH 012/179] qcacld-3.0: Fix -Wmissing-prototypes in csr_tdls_process We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in csr_tdls_process. Change-Id: I9b573e4bb3ee26678b77faae537a4968a7921db2 CRs-Fixed: 1075575 --- core/sme/src/csr/csr_tdls_process.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/sme/src/csr/csr_tdls_process.c b/core/sme/src/csr/csr_tdls_process.c index 28b8856000f4..0faa5bb689cc 100644 --- a/core/sme/src/csr/csr_tdls_process.c +++ b/core/sme/src/csr/csr_tdls_process.c @@ -51,7 +51,8 @@ * common routine to remove TDLS cmd from SME command list.. * commands are removed after getting reponse from PE. */ -QDF_STATUS csr_tdls_remove_sme_cmd(tpAniSirGlobal pMac, eSmeCommandType cmdType) +static QDF_STATUS csr_tdls_remove_sme_cmd(tpAniSirGlobal pMac, + eSmeCommandType cmdType) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tListElem *pEntry; @@ -363,8 +364,8 @@ QDF_STATUS csr_tdls_del_peer_sta(tHalHandle hHal, uint8_t sessionId, /* * TDLS messages sent to PE . */ -QDF_STATUS tdls_send_message(tpAniSirGlobal pMac, uint16_t msg_type, - void *msg_data, uint32_t msg_size) +static QDF_STATUS tdls_send_message(tpAniSirGlobal pMac, uint16_t msg_type, + void *msg_data, uint32_t msg_size) { tSirMbMsg *pMsg = (tSirMbMsg *) msg_data; @@ -382,7 +383,7 @@ QDF_STATUS tdls_send_message(tpAniSirGlobal pMac, uint16_t msg_type, return QDF_STATUS_SUCCESS; } -QDF_STATUS csr_tdls_process_send_mgmt(tpAniSirGlobal pMac, tSmeCmd *cmd) +static QDF_STATUS csr_tdls_process_send_mgmt(tpAniSirGlobal pMac, tSmeCmd *cmd) { tTdlsSendMgmtCmdInfo *tdlsSendMgmtCmdInfo = &cmd->u.tdlsCmd.u.tdlsSendMgmtCmdInfo; @@ -451,7 +452,7 @@ QDF_STATUS csr_tdls_process_send_mgmt(tpAniSirGlobal pMac, tSmeCmd *cmd) return status; } -QDF_STATUS csr_tdls_process_add_sta(tpAniSirGlobal pMac, tSmeCmd *cmd) +static QDF_STATUS csr_tdls_process_add_sta(tpAniSirGlobal pMac, tSmeCmd *cmd) { tTdlsAddStaCmdInfo *tdlsAddStaCmdInfo = &cmd->u.tdlsCmd.u.tdlsAddStaCmdInfo; @@ -522,7 +523,7 @@ QDF_STATUS csr_tdls_process_add_sta(tpAniSirGlobal pMac, tSmeCmd *cmd) return status; } -QDF_STATUS csr_tdls_process_del_sta(tpAniSirGlobal pMac, tSmeCmd *cmd) +static QDF_STATUS csr_tdls_process_del_sta(tpAniSirGlobal pMac, tSmeCmd *cmd) { tTdlsDelStaCmdInfo *tdlsDelStaCmdInfo = &cmd->u.tdlsCmd.u.tdlsDelStaCmdInfo; From 844498997fc8c7df90abd0953e9abea529abebed Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 11:52:02 -0700 Subject: [PATCH 013/179] Release 5.1.0.30Q Release 5.1.0.30Q Change-Id: I7c7d2683e51eed645fd66681c25e3d68be1b769e CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 825fdb196df9..a03f9af60459 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_EXTRA "Q" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30P" +#define QWLAN_VERSIONSTR "5.1.0.30Q" #endif /* QWLAN_VERSION_H */ From 2ac92bda55ac0ef21f66173f4f486d3d74d58edf Mon Sep 17 00:00:00 2001 From: Prashanth Bhatta Date: Tue, 11 Oct 2016 16:08:00 -0700 Subject: [PATCH 014/179] qcacld-3.0: Stop MC thread during recovery As part of Dynamic Mode change, optimization is added to not to stop the MC thread but just to flush the message queues but that doesn't help in case of recovery where in MC thread is the one which needs to be stopped first so that lower layers doesn't try to post any messages and try to process them while firmware doesn't exist. Processing such messages may cause stability issues. Stop the MC thread as part of recovery and bring-up thread again during re-init. Change-Id: Ie1cfbfa74f6b3e849361f2213a9d29f277aa09cc CRs-fixed: 1075224 --- core/cds/src/cds_api.c | 3 ++- core/hdd/inc/wlan_hdd_main.h | 2 +- core/hdd/src/wlan_hdd_main.c | 16 ++++++++-------- core/hdd/src/wlan_hdd_power.c | 13 +++++++++---- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 1cfb12871f5b..69f68d76d42e 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -247,7 +247,8 @@ QDF_STATUS cds_open(void) } /* Now Open the CDS Scheduler */ - if (pHddCtx->driver_status == DRIVER_MODULES_UNINITIALIZED) { + if (pHddCtx->driver_status == DRIVER_MODULES_UNINITIALIZED || + cds_is_driver_recovering()) { qdf_status = cds_sched_open(gp_cds_context, &gp_cds_context->qdf_sched, sizeof(cds_sched_context)); diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 284cb7bce939..3a0b6fb7a520 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1865,7 +1865,7 @@ int hdd_start_ftm_adapter(hdd_adapter_t *adapter); int hdd_set_fw_params(hdd_adapter_t *adapter); int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, bool reinit); -int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool shutdown); +int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx); int hdd_start_adapter(hdd_adapter_t *adapter); void hdd_connect_result(struct net_device *dev, const u8 *bssid, tCsrRoamInfo *roam_info, const u8 *req_ie, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fdd639078983..c2677892d0a3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4751,7 +4751,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) hdd_stop_all_adapters(hdd_ctx); } - hdd_wlan_stop_modules(hdd_ctx, false); + hdd_wlan_stop_modules(hdd_ctx); /* * Close the scheduler before calling cds_close to make sure no thread * is scheduled after the each module close is called i.e after all the @@ -7618,7 +7618,6 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) /** * hdd_wlan_stop_modules - Single driver state machine for stoping modules * @hdd_ctx: HDD context - * @shutdown: flag to indicate from SSR or normal path * * This function maintains the driver state machine it will be invoked from * exit, shutdown and con_mode change handler. Depending on the driver state @@ -7626,7 +7625,7 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) * * Return: 0 for success; non-zero for failure */ -int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool shutdown) +int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx) { void *hif_ctx; qdf_device_t qdf_ctx; @@ -7688,7 +7687,8 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool shutdown) QDF_ASSERT(0); } /* Clean up message queues of TX, RX and MC thread */ - cds_sched_flush_mc_mqs(cds_sched_context); + if (!cds_is_driver_recovering()) + cds_sched_flush_mc_mqs(cds_sched_context); hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (!hif_ctx) { @@ -7701,7 +7701,7 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool shutdown) ol_cds_free(); - if (!shutdown) { + if (!cds_is_driver_recovering()) { ret = pld_power_off(qdf_ctx->dev); if (ret) hdd_err("CNSS power down failed put device into Low power mode:%d", @@ -7738,7 +7738,7 @@ static void hdd_iface_change_callback(void *priv) ENTER(); hdd_info("Interface change timer expired close the modules!"); - ret = hdd_wlan_stop_modules(hdd_ctx, false); + ret = hdd_wlan_stop_modules(hdd_ctx); if (ret) hdd_alert("Failed to stop modules"); EXIT(); @@ -7990,7 +7990,7 @@ err_wiphy_unregister: wlan_hdd_cfg80211_deinit(hdd_ctx->wiphy); err_stop_modules: - hdd_wlan_stop_modules(hdd_ctx, false); + hdd_wlan_stop_modules(hdd_ctx); status = cds_sched_close(hdd_ctx->pcds_context); @@ -9289,7 +9289,7 @@ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) hdd_stop_all_adapters(hdd_ctx); hdd_deinit_all_adapters(hdd_ctx, false); - ret = hdd_wlan_stop_modules(hdd_ctx, false); + ret = hdd_wlan_stop_modules(hdd_ctx); if (ret) { hdd_err("Stop wlan modules failed"); return -EINVAL; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 55caa12744d3..f629c6e7982c 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1423,6 +1423,7 @@ QDF_STATUS hdd_wlan_shutdown(void) v_CONTEXT_t p_cds_context = NULL; hdd_context_t *pHddCtx; p_cds_sched_context cds_sched_context = NULL; + QDF_STATUS qdf_status; hdd_alert("WLAN driver shutting down!"); @@ -1444,8 +1445,6 @@ QDF_STATUS hdd_wlan_shutdown(void) return QDF_STATUS_E_FAILURE; } - cds_set_recovery_in_progress(true); - cds_clear_concurrent_session_count(); hdd_cleanup_scan_queue(pHddCtx); hdd_reset_all_adapters(pHddCtx); @@ -1471,8 +1470,14 @@ QDF_STATUS hdd_wlan_shutdown(void) } #endif + qdf_status = cds_sched_close(p_cds_context); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { + hdd_err("Failed to close CDS Scheduler"); + QDF_ASSERT(false); + } + wlansap_global_deinit(); - hdd_wlan_stop_modules(pHddCtx, true); + hdd_wlan_stop_modules(pHddCtx); hdd_lpass_notify_stop(pHddCtx); @@ -1574,7 +1579,7 @@ QDF_STATUS hdd_wlan_re_init(void) goto success; err_cds_disable: - hdd_wlan_stop_modules(pHddCtx, true); + hdd_wlan_stop_modules(pHddCtx); err_wiphy_unregister: if (pHddCtx) { From ab00438c68952dccfe41f2d3c00d7197bcfe0e45 Mon Sep 17 00:00:00 2001 From: Prashanth Bhatta Date: Tue, 11 Oct 2016 16:08:11 -0700 Subject: [PATCH 015/179] qcacld-3.0: Stop bus BW timer during recovery During recovery, bus bandwidth (BW) compute timer may fire and cause stability issues. Destroy the bus bandwidth timer during shutdown and initialize during re-init. Change-Id: I20d52f028e61e81bdda5004e30f1c143ef4d5f23 CRs-fixed: 1075655 --- core/hdd/inc/wlan_hdd_main.h | 30 ++++++++++++++++++++++++ core/hdd/src/wlan_hdd_main.c | 43 ++++++++++++++++++++--------------- core/hdd/src/wlan_hdd_power.c | 4 ++++ 3 files changed, 59 insertions(+), 18 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 3a0b6fb7a520..41e16d0da753 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1619,6 +1619,26 @@ void hdd_checkandupdate_phymode(hdd_context_t *pHddCtx); #ifdef MSM_PLATFORM void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter); void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *pAdapter); + +/** + * hdd_bus_bandwidth_init() - Initialize bus bandwidth data structures. + * hdd_ctx: HDD context + * + * Initialize bus bandwidth related data structures like spinlock and timer. + * + * Return: None. + */ +int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx); + +/** + * hdd_bus_bandwidth_destroy() - Destroy bus bandwidth data structures. + * hdd_ctx: HDD context + * + * Destroy bus bandwidth related data structures like timer. + * + * Return: None. + */ +void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx); #else static inline void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter) { @@ -1629,6 +1649,16 @@ static inline void hdd_stop_bus_bw_computer_timer(hdd_adapter_t *pAdapter) { return; } + +int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx) +{ + return 0; +} + +void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx) +{ + return; +} #endif int hdd_init(void); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c2677892d0a3..10738b27a157 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4693,18 +4693,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) hdd_unregister_notifiers(hdd_ctx); -#ifdef MSM_PLATFORM - if (QDF_TIMER_STATE_RUNNING == - qdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer)) { - qdf_mc_timer_stop(&hdd_ctx->bus_bw_timer); - hdd_reset_tcp_delack(hdd_ctx); - } - - if (!QDF_IS_STATUS_SUCCESS - (qdf_mc_timer_destroy(&hdd_ctx->bus_bw_timer))) { - hdd_err("Cannot deallocate Bus bandwidth timer"); - } -#endif + hdd_bus_bandwidth_destroy(hdd_ctx); #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE if (QDF_TIMER_STATE_RUNNING == @@ -5270,6 +5259,9 @@ static void hdd_bus_bw_compute_cbk(void *priv) bool connected = false; uint32_t ipa_tx_packets = 0, ipa_rx_packets = 0; + if (wlan_hdd_validate_context(hdd_ctx)) + return; + for (status = hdd_get_front_adapter(hdd_ctx, &adapterNode); NULL != adapterNode && QDF_STATUS_SUCCESS == status; status = @@ -5362,6 +5354,26 @@ static void hdd_bus_bw_compute_cbk(void *priv) qdf_mc_timer_start(&hdd_ctx->bus_bw_timer, hdd_ctx->config->busBandwidthComputeInterval); } + +int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx) +{ + spin_lock_init(&hdd_ctx->bus_bw_lock); + + qdf_mc_timer_init(&hdd_ctx->bus_bw_timer, + QDF_TIMER_TYPE_SW, + hdd_bus_bw_compute_cbk, (void *)hdd_ctx); + + return 0; +} + +void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx) +{ + if (qdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer) == + QDF_TIMER_STATE_RUNNING) + hdd_reset_tcp_delack(hdd_ctx); + + qdf_mc_timer_destroy(&hdd_ctx->bus_bw_timer); +} #endif /** @@ -7922,12 +7934,7 @@ int hdd_wlan_startup(struct device *dev) hdd_err("Failed to init ACS Skip timer"); #endif -#ifdef MSM_PLATFORM - spin_lock_init(&hdd_ctx->bus_bw_lock); - qdf_mc_timer_init(&hdd_ctx->bus_bw_timer, - QDF_TIMER_TYPE_SW, - hdd_bus_bw_compute_cbk, (void *)hdd_ctx); -#endif + hdd_bus_bandwidth_init(hdd_ctx); hdd_lpass_notify_start(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index f629c6e7982c..2e625006e12c 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1476,6 +1476,8 @@ QDF_STATUS hdd_wlan_shutdown(void) QDF_ASSERT(false); } + hdd_bus_bandwidth_destroy(pHddCtx); + wlansap_global_deinit(); hdd_wlan_stop_modules(pHddCtx); @@ -1537,6 +1539,8 @@ QDF_STATUS hdd_wlan_re_init(void) if (pHddCtx->config->enable_dp_trace) qdf_dp_trace_init(); + hdd_bus_bandwidth_init(pHddCtx); + ret = hdd_wlan_start_modules(pHddCtx, pAdapter, true); if (ret) { hdd_err("Failed to start wlan after error"); From 41f0429860fb9c926cae647c0d132c962a7bcc63 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 17:45:02 -0700 Subject: [PATCH 016/179] Release 5.1.0.30R Release 5.1.0.30R Change-Id: Ibdd57ff3fecd9ee040c7f5ca73f70afc4e31b0c1 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index a03f9af60459..0515cfc287f2 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Q" +#define QWLAN_VERSION_EXTRA "R" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30Q" +#define QWLAN_VERSIONSTR "5.1.0.30R" #endif /* QWLAN_VERSION_H */ From 286def583354ba88de05cb6bc148964a87b29885 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Fri, 23 Sep 2016 15:38:02 -0700 Subject: [PATCH 017/179] qcacld-3.0: Fix NDI teardown issue on "ifconfig down" request This is qcacld-2.0 to qcacld-3.0 propagation. NAN data session is expected to be available across ifconfig up and ifconfig down requests from user space. The userspace will issue ifconfig down when it is done using the interface and will bring up the interface again if required. NAN data interface termination is expected to be done only on NDI delete request from the userspace. Change-Id: Ib9d7c1719077687bdd7e550404e874406ec50758 CRs-Fixed: 962367 --- core/hdd/src/wlan_hdd_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 10738b27a157..2ee4e27da71a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1961,6 +1961,14 @@ static int __hdd_open(struct net_device *dev) WLAN_CONTROL_PATH); } + /* Enable carrier and transmit queues for NDI */ + if (WLAN_HDD_IS_NDI(adapter)) { + hdd_notice("Enabling Tx Queues"); + wlan_hdd_netif_queue_control(adapter, + WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, + WLAN_CONTROL_PATH); + } + return ret; } @@ -2028,6 +2036,18 @@ static int __hdd_stop(struct net_device *dev) wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); + /* + * NAN data interface is different in some sense. The traffic on NDI is + * bursty in nature and depends on the need to transfer. The service + * layer may down the interface after the usage and up again when + * required. In some sense, the NDI is expected to be available + * (like SAP) iface until NDI delete request is issued by the service + * layer. Skip BSS termination and adapter deletion for NAN Data + * interface (NDI). + */ + if (WLAN_HDD_IS_NDI(adapter)) + return 0; + /* * The interface is marked as down for outside world (aka kernel) * But the driver is pretty much alive inside. The driver needs to From 16602d36f1b48d192b53dc16ed08f49c196420f0 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 19:59:01 -0700 Subject: [PATCH 018/179] Release 5.1.0.30S Release 5.1.0.30S Change-Id: I1c7ea531cd3a7dc22fb99ce7a2537eed5a38631d CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 0515cfc287f2..e058e5583655 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "R" +#define QWLAN_VERSION_EXTRA "S" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30R" +#define QWLAN_VERSIONSTR "5.1.0.30S" #endif /* QWLAN_VERSION_H */ From 59ff755f86a98ad686890dd778266394c2aa306f Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Wed, 17 Aug 2016 18:51:01 -0700 Subject: [PATCH 019/179] qcacld-3.0: Validate session Id in sme_QosInternalReleaseReq This is a qcacld-2.0 to qcacld-3.0 propagation. Validate session Id in sme_QosInternalReleaseReq. Change-Id: Id3ad752fe3e4c6f6fec18febb1c839003bef3df0 CRs-Fixed: 1013359 --- core/sme/src/qos/sme_qos.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/sme/src/qos/sme_qos.c b/core/sme/src/qos/sme_qos.c index 5eaa248c031a..3ad7a41f372b 100644 --- a/core/sme/src/qos/sme_qos.c +++ b/core/sme/src/qos/sme_qos.c @@ -2072,6 +2072,14 @@ sme_QosStatusType sme_qos_internal_release_req(tpAniSirGlobal pMac, flow_info = GET_BASE_ADDR(pEntry, sme_QosFlowInfoEntry, link); ac = flow_info->ac_type; sessionId = flow_info->sessionId; + + if (!CSR_IS_SESSION_VALID(pMac, sessionId)) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + "%s: %d: Session Id: %d is invalid", + __func__, __LINE__, sessionId); + return status; + } + pSession = &sme_qos_cb.sessionInfo[sessionId]; pACInfo = &pSession->ac_info[ac]; /* need to vote off powersave for the duration of this request */ From fae5010b10975789e7586fb28f778eae22424b7f Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Wed, 17 Aug 2016 19:05:01 -0700 Subject: [PATCH 020/179] qcacld-3.0: Handle disassociate reason code 34 and cleanup logs This is a qcacld-2.0 to qcacld-3.0 propagation. Currently code honors disconnect reason code 34 but still log shows up as invalid reason code. 34 is a valid 802.11 reason code. Add eSIR_MAC_XS_UNACKED_FRAMES_REASON and clean up logs. Change-Id: I32fb804792dd67dd31824a5387e4ecb419656420 CRs-Fixed: 1015244 --- .../src/pe/lim/lim_process_disassoc_frame.c | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_disassoc_frame.c b/core/mac/src/pe/lim/lim_process_disassoc_frame.c index 80a06c80bac2..b90b1ed11cea 100644 --- a/core/mac/src/pe/lim/lim_process_disassoc_frame.c +++ b/core/mac/src/pe/lim/lim_process_disassoc_frame.c @@ -266,20 +266,6 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo, (psessionEntry->limSmeState != eLIM_SME_WT_ASSOC_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_REASSOC_STATE))) { switch (reasonCode) { - case eSIR_MAC_UNSPEC_FAILURE_REASON: - case eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON: - case eSIR_MAC_DISASSOC_DUE_TO_DISABILITY_REASON: - case eSIR_MAC_CLASS2_FRAME_FROM_NON_AUTH_STA_REASON: - case eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON: - case eSIR_MAC_MIC_FAILURE_REASON: - case eSIR_MAC_4WAY_HANDSHAKE_TIMEOUT_REASON: - case eSIR_MAC_GR_KEY_UPDATE_TIMEOUT_REASON: - case eSIR_MAC_RSN_IE_MISMATCH_REASON: - case eSIR_MAC_1X_AUTH_FAILURE_REASON: - case eSIR_MAC_PREV_AUTH_NOT_VALID_REASON: - /* Valid reasonCode in received Disassociation frame */ - break; - case eSIR_MAC_DEAUTH_LEAVING_BSS_REASON: case eSIR_MAC_DISASSOC_LEAVING_BSS_REASON: /* Valid reasonCode in received Disassociation frame */ @@ -297,15 +283,7 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo, break; default: - /* Invalid reasonCode in received Disassociation frame */ - /* Log error and ignore the frame */ - PELOGE(lim_log(pMac, LOGE, - FL - ("received Disassoc frame with invalid reasonCode " - "%d from " MAC_ADDRESS_STR), reasonCode, - MAC_ADDR_ARRAY(pHdr->sa)); - ) - return; + break; } } else { /* Received Disassociation frame in either IBSS */ From 0ee96441f425b1c4eaac96841259e09ef11a11c9 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Wed, 17 Aug 2016 19:10:56 -0700 Subject: [PATCH 021/179] qcacld-3.0: Reduce log levels and cleanup This is a qcacld-2.0 to qcacld-3.0 propagation. Reduce log levels and cleanup. Change-Id: I05f88b7a49c4fc9c531dfe1574f38da2b416c827 CRs-Fixed: 1047807 --- core/hdd/src/wlan_hdd_main.c | 2 +- core/sme/src/csr/csr_api_roam.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2ee4e27da71a..be6cef30c817 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8603,7 +8603,7 @@ void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *adapter) if (QDF_TIMER_STATE_RUNNING != qdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer)) { /* trying to stop timer, when not running is not good */ - hdd_err("bus band width compute timer is not running"); + hdd_info("bus band width compute timer is not running"); return; } diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 896fa91b593d..2fd7fc8f2775 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -10452,15 +10452,12 @@ csr_roam_chk_lnk_disassoc_ind(tpAniSirGlobal mac_ctx, tSirSmeRsp *msg_ptr) return; } - sms_log(mac_ctx, LOGE, - FL("DISASSOCIATION Indication from MAC for session %d "), - sessionId); sms_log(mac_ctx, LOGE, FL("DISASSOCIATION from peer =" MAC_ADDRESS_STR - " " " reason = %d status = %d "), + " " " reason: %d status: %d session: %d"), MAC_ADDR_ARRAY(pDisassocInd->peer_macaddr.bytes), pDisassocInd->reasonCode, - pDisassocInd->statusCode); + pDisassocInd->statusCode, sessionId); /* * If we are in neighbor preauth done state then on receiving * disassoc or deauth we dont roam instead we just disassoc From 0fb6cc4dde6e44907cd85f9c33e09f78592a9c12 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Fri, 26 Aug 2016 14:53:59 -0700 Subject: [PATCH 022/179] qcacld-3.0: Fix buffer overwrite problem in CCXPLMREQ This is a qcacld-2.0 to qcacld-3.0 propagation. Set the number of channels to minimum of input data and WNI_CFG_VALID_CHANNEL_LIST_LEN. Change-Id: Ib6fca483ac99cddfcd3b739ce62e86ecd498f1f5 CRs-Fixed: 1001450 --- core/hdd/src/wlan_hdd_ioctl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index fd4def55ed73..775ec138633e 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -1863,8 +1863,9 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) if (content < 0) return QDF_STATUS_E_FAILURE; + content = QDF_MIN(content, WNI_CFG_VALID_CHANNEL_LIST_LEN); pPlmRequest->plmNumCh = content; - hdd_debug("numch %d", pPlmRequest->plmNumCh); + hdd_debug("numch: %d", pPlmRequest->plmNumCh); /* Channel numbers */ for (count = 0; count < pPlmRequest->plmNumCh; count++) { @@ -1883,10 +1884,8 @@ QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) return QDF_STATUS_E_FAILURE; ret = kstrtos32(buf, 10, &content); - if (ret < 0) - return QDF_STATUS_E_FAILURE; - - if (content <= 0) + if (ret < 0 || content <= 0 || + content > WNI_CFG_CURRENT_CHANNEL_STAMAX) return QDF_STATUS_E_FAILURE; pPlmRequest->plmChList[count] = content; From 1efc80ea4683e911bb378da44353f38d755da111 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Fri, 26 Aug 2016 18:53:47 -0700 Subject: [PATCH 023/179] qcacld-3.0: Add input validation for SENDACTIONFRAME This is a qcacld-2.0 to qcacld-3.0 propagation. Add input validation for SENDACTIONFRAME driver command. Change-Id: I3d1bf424e5e0f9a3b6f4662dd12a3a7314c7eace CRs-Fixed: 1001449 --- core/hdd/src/wlan_hdd_ioctl.c | 63 +++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 775ec138633e..5fdab298fb8c 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -1071,16 +1071,15 @@ static int hdd_parse_reassoc(hdd_adapter_t *adapter, const char *command) static int hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid, const uint8_t channel, const uint8_t dwell_time, - const uint8_t payload_len, const uint8_t *payload) + const int payload_len, const uint8_t *payload) { struct ieee80211_channel chan; - uint8_t frame_len; + int frame_len, ret = 0; uint8_t *frame; struct ieee80211_hdr_3addr *hdr; u64 cookie; hdd_station_ctx_t *pHddStaCtx; hdd_context_t *hdd_ctx; - int ret = 0; tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) payload; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) @@ -1259,29 +1258,42 @@ hdd_parse_sendactionframe_v1(hdd_adapter_t *adapter, const char *command) * Return: 0 for success non-zero for failure */ static int -hdd_parse_sendactionframe_v2(hdd_adapter_t *adapter, const char *command) +hdd_parse_sendactionframe_v2(hdd_adapter_t *adapter, + const char *command, int total_len) { struct android_wifi_af_params *params; tSirMacAddr bssid; int ret; - /* params are large so keep off the stack */ - params = kmalloc(sizeof(*params), GFP_KERNEL); - if (!params) - return -ENOMEM; - /* The params are located after "SENDACTIONFRAME " */ - memcpy(params, command + 16, sizeof(*params)); + total_len -= 16; + params = (struct android_wifi_af_params *)(command + 16); - if (!mac_pton(params->bssid, (u8 *) &bssid)) { - hdd_err("MAC address parsing failed"); - ret = -EINVAL; - } else { - ret = hdd_sendactionframe(adapter, bssid, params->channel, - params->dwell_time, params->len, - params->data); + if (params->len <= 0 || params->len > ANDROID_WIFI_ACTION_FRAME_SIZE || + (params->len > total_len)) { + hdd_err("Invalid payload length: %d", params->len); + return -EINVAL; } - kfree(params); + + if (!mac_pton(params->bssid, (u8 *)&bssid)) { + hdd_err("MAC address parsing failed"); + return -EINVAL; + } + + if (params->channel < 0 || + params->channel > WNI_CFG_CURRENT_CHANNEL_STAMAX) { + hdd_err("Invalid channel: %d", params->channel); + return -EINVAL; + } + + if (params->dwell_time < 0) { + hdd_err("Invalid dwell_time: %d", params->dwell_time); + return -EINVAL; + } + + ret = hdd_sendactionframe(adapter, bssid, params->channel, + params->dwell_time, params->len, params->data); + return ret; } @@ -1300,7 +1312,8 @@ hdd_parse_sendactionframe_v2(hdd_adapter_t *adapter, const char *command) * Return: 0 for success non-zero for failure */ static int -hdd_parse_sendactionframe(hdd_adapter_t *adapter, const char *command) +hdd_parse_sendactionframe(hdd_adapter_t *adapter, const char *command, + int total_len) { int ret; @@ -1317,11 +1330,18 @@ hdd_parse_sendactionframe(hdd_adapter_t *adapter, const char *command) * SENDACTIONFRAME xx:xx:xx:xx:xx:xx* * 111111111122222222223333 * 0123456789012345678901234567890123 + * For both the commands, a valid command must have atleast + * first 34 length of data. */ + if (total_len < 34) { + hdd_err("Invalid command (total_len=%d)", total_len); + return -EINVAL; + } + if (command[33]) { ret = hdd_parse_sendactionframe_v1(adapter, command); } else { - ret = hdd_parse_sendactionframe_v2(adapter, command); + ret = hdd_parse_sendactionframe_v2(adapter, command, total_len); } return ret; @@ -3708,7 +3728,8 @@ static int drv_cmd_send_action_frame(hdd_adapter_t *adapter, uint8_t command_len, hdd_priv_data_t *priv_data) { - return hdd_parse_sendactionframe(adapter, command); + return hdd_parse_sendactionframe(adapter, command, + priv_data->total_len); } static int drv_cmd_get_roam_scan_channel_min_time(hdd_adapter_t *adapter, From dbfb26400550f94dbc49bba8f0be61d63cba24a1 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Sun, 28 Aug 2016 21:32:38 -0700 Subject: [PATCH 024/179] qcacld-3.0: extscan: Logs cleanup This is a qcacld-2.0 to qcacld-3.0 propagation. Remove unnecessary logs and merge some of the logs together. Change-Id: Ibf9fdf0a92cc71644f02d6890574eeed0d175d6f CRs-Fixed: 1023849 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 +- core/hdd/src/wlan_hdd_ext_scan.c | 81 ++++++++++++-------------------- core/wma/src/wma_scan_roam.c | 13 ++--- core/wma/src/wma_utils.c | 3 +- 4 files changed, 37 insertions(+), 63 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 8e18bcd66c0b..01c4eca68398 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1800,7 +1800,7 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, uint32_t fset = 0; int ret; - ENTER_DEV(wdev->netdev); + /* ENTER_DEV() intentionally not used in a frequently invoked API */ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); @@ -1888,7 +1888,6 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, goto nla_put_failure; } ret = cfg80211_vendor_cmd_reply(skb); - EXIT(); return ret; nla_put_failure: kfree_skb(skb); diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index 92241e2687e5..7dd23a0dee59 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -293,7 +293,7 @@ wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx, uint32_t i, j, nl_buf_len; bool ignore_cached_results = false; - ENTER(); + /* ENTER() intentionally not used in a frequently invoked API */ if (wlan_hdd_validate_context(pHddCtx)) return; @@ -361,7 +361,6 @@ wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx, } } - hdd_notice("nl_buf_len = %u", nl_buf_len); skb = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy, nl_buf_len); if (!skb) { @@ -490,7 +489,6 @@ wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx, complete(&context->response_event); spin_unlock(&context->context_lock); } - EXIT(); return; fail: @@ -785,7 +783,7 @@ wlan_hdd_cfg80211_extscan_full_scan_result_event(void *ctx, int flags = cds_get_gfp_flags(); - ENTER(); + /* ENTER() intentionally not used in a frequently invoked API */ if (wlan_hdd_validate_context(pHddCtx)) return; @@ -898,7 +896,6 @@ wlan_hdd_cfg80211_extscan_full_scan_result_event(void *ctx, spin_unlock(&context->context_lock); cfg80211_vendor_event(skb, flags); - EXIT(); return; nla_put_failure: @@ -987,13 +984,12 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx, int flags = cds_get_gfp_flags(); struct hdd_ext_scan_context *context; - ENTER(); + /* ENTER() intentionally not used in a frequently invoked API */ if (wlan_hdd_validate_context(pHddCtx)) return; if (!pData) { hdd_err("pData is null"); - EXIT(); return; } @@ -1006,11 +1002,10 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx, if (!skb) { hdd_err("cfg80211_vendor_event_alloc failed"); - EXIT(); return; } - hdd_notice("Request Id %u Scan event type %u Scan event status %u buckets scanned %u", + hdd_notice("Request Id: %u Scan event type: %u Scan event status: %u buckets scanned: %u", pData->requestId, pData->scanEventType, pData->status, pData->buckets_scanned); @@ -1039,12 +1034,10 @@ wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx, } cfg80211_vendor_event(skb, flags); - EXIT(); return; nla_put_failure: kfree_skb(skb); - EXIT(); return; } @@ -1493,7 +1486,7 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const uint16_t evType, { hdd_context_t *pHddCtx = (hdd_context_t *) ctx; - ENTER(); + /* ENTER() intentionally not used in a frequently invoked API */ if (wlan_hdd_validate_context(pHddCtx)) return; @@ -1570,7 +1563,6 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const uint16_t evType, hdd_err("Unknown event type %u", evType); break; } - EXIT(); } /* @@ -1888,7 +1880,7 @@ static int __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, int retval = 0; unsigned long rc; - ENTER_DEV(dev); + /* ENTER_DEV() intentionally not used in a frequently invoked API */ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); @@ -1923,8 +1915,6 @@ static int __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, pReqMsg->requestId = nla_get_u32(tb[PARAM_REQUEST_ID]); pReqMsg->sessionId = pAdapter->sessionId; - hdd_notice("Req Id %d Session Id %d", - pReqMsg->requestId, pReqMsg->sessionId); /* Parse and fetch flush parameter */ if (!tb[PARAM_FLUSH]) { @@ -1932,7 +1922,8 @@ static int __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, goto fail; } pReqMsg->flush = nla_get_u8(tb[PARAM_FLUSH]); - hdd_notice("Flush %d", pReqMsg->flush); + hdd_notice("Req Id: %u Session Id: %d Flush: %d", + pReqMsg->requestId, pReqMsg->sessionId, pReqMsg->flush); context = &ext_scan_context; spin_lock(&context->context_lock); @@ -1960,7 +1951,6 @@ static int __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy, retval = context->response_status; spin_unlock(&context->context_lock); } - EXIT(); return retval; fail: @@ -2511,17 +2501,16 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); uint32_t chan_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; - uint8_t num_channels = 0; + uint8_t num_channels = 0, i, buf[256] = {0}; struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; uint32_t requestId, maxChannels; tWifiBand wifiBand; QDF_STATUS status; struct sk_buff *reply_skb; - uint8_t i; - int ret; + int ret, len = 0; - ENTER_DEV(dev); + /* ENTER_DEV() intentionally not used in a frequently invoked API */ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); @@ -2550,7 +2539,6 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, requestId = nla_get_u32(tb [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]); - hdd_notice("Req Id %d", requestId); /* Parse and fetch wifi band */ if (!tb @@ -2561,7 +2549,6 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, wifiBand = nla_get_u32(tb [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND]); - hdd_notice("Wifi band %d", wifiBand); if (!tb [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS]) { @@ -2571,7 +2558,8 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, maxChannels = nla_get_u32(tb [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS]); - hdd_notice("Max channels %d", maxChannels); + hdd_notice("Req Id: %u Wifi band: %d Max channels: %d", requestId, + wifiBand, maxChannels); status = sme_get_valid_channels_by_band((tHalHandle) (pHddCtx->hHal), wifiBand, chan_list, &num_channels); @@ -2589,9 +2577,12 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, !strncmp(hdd_get_fwpath(), "ap", 2)) hdd_remove_indoor_channels(wiphy, chan_list, &num_channels); - hdd_notice("Number of channels %d", num_channels); + hdd_notice("Number of channels: %d", num_channels); for (i = 0; i < num_channels; i++) - hdd_notice("Channel: %u ", chan_list[i]); + len += scnprintf(buf + len, sizeof(buf) - len, + "%u ", chan_list[i]); + + hdd_notice("Channels: %s", buf); reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u32) + sizeof(u32) * @@ -2610,7 +2601,6 @@ __wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy, return -EINVAL; } ret = cfg80211_vendor_cmd_reply(reply_skb); - EXIT(); return ret; } @@ -2779,8 +2769,6 @@ static int hdd_extscan_start_fill_bucket_channel_spec( } req_msg->buckets[bkt_index].bucket = nla_get_u8( bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX]); - hdd_notice("Bucket spec Index %d", - req_msg->buckets[bkt_index].bucket); /* Parse and fetch wifi band */ if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]) { @@ -2789,8 +2777,6 @@ static int hdd_extscan_start_fill_bucket_channel_spec( } req_msg->buckets[bkt_index].band = nla_get_u8( bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]); - hdd_notice("Wifi band %d", - req_msg->buckets[bkt_index].band); /* Parse and fetch period */ if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]) { @@ -2799,8 +2785,6 @@ static int hdd_extscan_start_fill_bucket_channel_spec( } req_msg->buckets[bkt_index].period = nla_get_u32( bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]); - hdd_notice("period %d", - req_msg->buckets[bkt_index].period); /* Parse and fetch report events */ if (!bucket[ @@ -2811,8 +2795,6 @@ static int hdd_extscan_start_fill_bucket_channel_spec( req_msg->buckets[bkt_index].reportEvents = nla_get_u8( bucket[ QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS]); - hdd_notice("report events %d", - req_msg->buckets[bkt_index].reportEvents); /* Parse and fetch max period */ if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD]) { @@ -2821,8 +2803,6 @@ static int hdd_extscan_start_fill_bucket_channel_spec( } req_msg->buckets[bkt_index].max_period = nla_get_u32( bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD]); - hdd_notice("max period %u", - req_msg->buckets[bkt_index].max_period); /* Parse and fetch base */ if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BASE]) { @@ -2831,8 +2811,6 @@ static int hdd_extscan_start_fill_bucket_channel_spec( } req_msg->buckets[bkt_index].exponent = nla_get_u32( bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BASE]); - hdd_notice("base %u", - req_msg->buckets[bkt_index].exponent); /* Parse and fetch step count */ if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT]) { @@ -2841,8 +2819,14 @@ static int hdd_extscan_start_fill_bucket_channel_spec( } req_msg->buckets[bkt_index].step_count = nla_get_u32( bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT]); - hdd_notice("Step count %u", - req_msg->buckets[bkt_index].step_count); + hdd_notice("Bucket spec Index: %d Wifi band: %d period: %d report events: %d max period: %u base: %u Step count: %u", + req_msg->buckets[bkt_index].bucket, + req_msg->buckets[bkt_index].band, + req_msg->buckets[bkt_index].period, + req_msg->buckets[bkt_index].reportEvents, + req_msg->buckets[bkt_index].max_period, + req_msg->buckets[bkt_index].exponent, + req_msg->buckets[bkt_index].step_count); /* start with known good values for bucket dwell times */ req_msg->buckets[bkt_index].min_dwell_time_active = @@ -3221,9 +3205,6 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, pReqMsg->requestId = nla_get_u32(tb[PARAM_REQUEST_ID]); pReqMsg->sessionId = pAdapter->sessionId; - hdd_notice("Req Id %d Session Id %d", - pReqMsg->requestId, - pReqMsg->sessionId); /* Parse and fetch base period */ if (!tb[PARAM_BASE_PERIOD]) { @@ -3231,8 +3212,6 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, goto fail; } pReqMsg->basePeriod = nla_get_u32(tb[PARAM_BASE_PERIOD]); - hdd_notice("Base Period %d", - pReqMsg->basePeriod); /* Parse and fetch max AP per scan */ if (!tb[PARAM_MAX_AP_PER_SCAN]) { @@ -3240,7 +3219,6 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, goto fail; } pReqMsg->maxAPperScan = nla_get_u32(tb[PARAM_MAX_AP_PER_SCAN]); - hdd_notice("Max AP per Scan %d", pReqMsg->maxAPperScan); /* Parse and fetch report threshold percent */ if (!tb[PARAM_RPT_THRHLD_PERCENT]) { @@ -3248,8 +3226,6 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, goto fail; } pReqMsg->report_threshold_percent = nla_get_u8(tb[PARAM_RPT_THRHLD_PERCENT]); - hdd_notice("Report Threshold percent %d", - pReqMsg->report_threshold_percent); /* Parse and fetch report threshold num scans */ if (!tb[PARAM_RPT_THRHLD_NUM_SCANS]) { @@ -3257,7 +3233,10 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, goto fail; } pReqMsg->report_threshold_num_scans = nla_get_u8(tb[PARAM_RPT_THRHLD_NUM_SCANS]); - hdd_notice("Report Threshold num scans %d", + hdd_notice("Req Id: %d Session Id: %d Base Period: %d Max AP per Scan: %d Report Threshold percent: %d Report Threshold num scans: %d", + pReqMsg->requestId, pReqMsg->sessionId, + pReqMsg->basePeriod, pReqMsg->maxAPperScan, + pReqMsg->report_threshold_percent, pReqMsg->report_threshold_num_scans); /* Parse and fetch number of buckets */ diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 1bba4b8718dd..6394cae08551 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -4252,9 +4252,9 @@ int wma_extscan_cached_results_event_handler(void *handle, src_hotlist = param_buf->bssid_list; src_rssi = param_buf->rssi_list; numap = event->num_entries_in_page; - WMA_LOGI("Total_entries %u first_entry_index %u", event->total_entries, - event->first_entry_index); - WMA_LOGI("num_entries_in_page %d", numap); + WMA_LOGI("Total_entries: %u first_entry_index: %u num_entries_in_page: %d", + event->total_entries, + event->first_entry_index, numap); if (!src_hotlist || !src_rssi || !numap) { WMA_LOGW("%s: Cached results empty, send 0 results", __func__); goto noresults; @@ -4293,7 +4293,6 @@ int wma_extscan_cached_results_event_handler(void *handle, pMac->sme.pExtScanIndCb(pMac->hHdd, eSIR_EXTSCAN_CACHED_RESULTS_IND, dest_cachelist); - WMA_LOGI("%s: sending cached results event", __func__); dest_result = dest_cachelist->result; for (i = 0; i < dest_cachelist->num_scan_ids; i++) { qdf_mem_free(dest_result->ap); @@ -4311,7 +4310,6 @@ noresults: pMac->sme.pExtScanIndCb(pMac->hHdd, eSIR_EXTSCAN_CACHED_RESULTS_IND, &empty_cachelist); - WMA_LOGI("%s: sending cached results event", __func__); return 0; } @@ -4644,8 +4642,6 @@ QDF_STATUS wma_get_buf_extscan_start_cmd(tp_wma_handle wma_handle, src_bucket++; } - WMA_LOGD("%s: Total buckets: %d total #of channels is %d", - __func__, nbuckets, nchannels); len += nchannels * sizeof(wmi_extscan_bucket_channel); /* Allocate the memory */ *buf = wmi_buf_alloc(wma_handle->wmi_handle, len); @@ -4668,7 +4664,8 @@ QDF_STATUS wma_get_buf_extscan_start_cmd(tp_wma_handle wma_handle, cmd->configuration_flags = 0; if (pstart->configuration_flags & EXTSCAN_LP_EXTENDED_BATCHING) cmd->configuration_flags |= WMI_EXTSCAN_EXTENDED_BATCHING_EN; - WMA_LOGI("%s: configuration_flags: 0x%x", __func__, + WMA_LOGI("%s: Total buckets: %d total #of channels is %d cfgn_flags: 0x%x", + __func__, nbuckets, nchannels, cmd->configuration_flags); cmd->min_rest_time = WMA_EXTSCAN_REST_TIME; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index fd9254d98a7f..29d9efe3c68f 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -706,8 +706,7 @@ static int wma_unified_link_radio_stats_event_handler(void *handle, fixed_param->request_id, fixed_param->num_radio, fixed_param->more_radio_events); - WMA_LOGD("Radio Info"); - WMA_LOGD("radio_id %u on_time %u tx_time %u rx_time %u on_time_scan %u " + WMA_LOGD("Radio Info: radio_id %u on_time %u tx_time %u rx_time %u on_time_scan %u " "on_time_nbd %u on_time_gscan %u on_time_roam_scan %u " "on_time_pno_scan %u on_time_hs20 %u num_channels %u", radio_stats->radio_id, radio_stats->on_time, From 1472fab27592b8709359c626beaeb9cdb6a7e0d8 Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Fri, 7 Oct 2016 13:29:27 +0530 Subject: [PATCH 025/179] qcacld-3.0: Fix warning during driver unload During hdd_encrypt_decrypt_deinit, driver tries to acquire sme global lock. But hdd_encrypt_decrypt_deinit is invoked after sme close, where driver destroys sme global lock. This results in failure to acquire sme global lock. Fix this by invoking hdd_encrypt_decrypt_deinit before sme close. Also, move hdd_encrypt_decrypt_init to hdd_features_init. Change-Id: I2c9ab551ea53053db75dc197d6772d53e58f2dfc CRs-Fixed: 1075442 --- core/hdd/src/wlan_hdd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index be6cef30c817..02d0140eea9f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4791,7 +4791,6 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) /* Free up RoC request queue and flush workqueue */ cds_flush_work(&hdd_ctx->roc_req_work); - hdd_encrypt_decrypt_deinit(hdd_ctx); wlansap_global_deinit(); wlan_hdd_deinit_tx_rx_histogram(hdd_ctx); wiphy_unregister(wiphy); @@ -7518,6 +7517,7 @@ static int hdd_features_init(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) hdd_err("Error setting txlimit in sme: %d", status); hdd_tsf_init(hdd_ctx); + hdd_encrypt_decrypt_init(hdd_ctx); ret = hdd_register_cb(hdd_ctx); if (ret) { @@ -7627,6 +7627,7 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) ENTER(); /* De-register the SME callbacks */ hdd_deregister_cb(hdd_ctx); + hdd_encrypt_decrypt_deinit(hdd_ctx); /* De-init Policy Manager */ if (!QDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) { @@ -7974,7 +7975,6 @@ int hdd_wlan_startup(struct device *dev) goto err_debugfs_exit; memdump_init(); - hdd_encrypt_decrypt_init(hdd_ctx); hdd_driver_memdump_init(); if (hdd_ctx->config->fIsImpsEnabled) From 999799766d73f228527d9433722894bca0308445 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 22:04:27 -0700 Subject: [PATCH 026/179] Release 5.1.0.30T Release 5.1.0.30T Change-Id: Icf339515919926c70f0b7d03cde8472cea0ecde4 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index e058e5583655..5f68226fd7db 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "S" +#define QWLAN_VERSION_EXTRA "T" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30S" +#define QWLAN_VERSIONSTR "5.1.0.30T" #endif /* QWLAN_VERSION_H */ From ac4fcf34be45e943b4a4bb5b7fc2eeceb7707b8c Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Wed, 28 Sep 2016 12:57:32 +0530 Subject: [PATCH 027/179] qcacld-3.0: Add provision to configure Association disallowed functionality As part of MBO[MultiBand Operations], association disallowed functionality is added.i.e. if driver receives probe response/beacon with MBO IE with association disallowed subattribute present, STA stops connection attempt with the particular BSS. This code change addresses the following: 1) Adds provision to ignore/disable association disallowed functionality in host driver. Apply this change to enable STA to act as testbed for AP association disallowed test case. 2) Limit the assoc disallowed functionality in host driver only for connect cases, i.e. limit this only when driver tries to join BSS [MLM_WT_JOIN_BEACON_STATE] since similar functionality is in supplicant to take care of scan results case and checks for the assoc disallowed subattribute presence in probe responses. Change-Id: I66c6f7f31ebdaad32d01ab8882935861ddb54f51 CRs-Fixed: 1067826 --- core/hdd/src/wlan_hdd_cfg80211.c | 36 ++++++++++++++----- core/hdd/src/wlan_hdd_cfg80211.h | 17 +++++++++ core/mac/inc/sir_api.h | 2 ++ core/mac/src/pe/include/lim_session.h | 1 + core/mac/src/pe/lim/lim_assoc_utils.c | 25 +++++++++++++ .../mac/src/pe/lim/lim_process_beacon_frame.c | 9 ----- .../src/pe/lim/lim_process_probe_rsp_frame.c | 18 ---------- .../src/pe/lim/lim_process_sme_req_messages.c | 3 ++ 8 files changed, 76 insertions(+), 35 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 01c4eca68398..fe547cdc7da6 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4057,16 +4057,16 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, if (access_policy == QCA_ACCESS_POLICY_DENY_UNLESS_LISTED) { access_policy = WLAN_HDD_VENDOR_IE_ACCESS_ALLOW_IF_LISTED; - } else { + } else { access_policy = WLAN_HDD_VENDOR_IE_ACCESS_NONE; - } + } - hdd_info("calling sme_update_access_policy_vendor_ie"); - status = sme_update_access_policy_vendor_ie(hdd_ctx->hHal, - adapter->sessionId, &vendor_ie[0], - access_policy); - if (QDF_STATUS_SUCCESS != status) { - hdd_info("Failed to set vendor ie and access policy."); + hdd_info("calling sme_update_access_policy_vendor_ie"); + status = sme_update_access_policy_vendor_ie(hdd_ctx->hHal, + adapter->sessionId, &vendor_ie[0], + access_policy); + if (QDF_STATUS_SUCCESS != status) { + hdd_info("Failed to set vendor ie and access policy."); return -EINVAL; } } @@ -4140,6 +4140,26 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, } } + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED]) { + uint8_t ignore_assoc_disallowed; + + ignore_assoc_disallowed + = nla_get_u8(tb[ + QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED]); + hdd_info("Set ignore_assoc_disallowed value - %d", + ignore_assoc_disallowed); + if ((ignore_assoc_disallowed < + QCA_IGNORE_ASSOC_DISALLOWED_DISABLE) || + (ignore_assoc_disallowed > + QCA_IGNORE_ASSOC_DISALLOWED_ENABLE)) + return -EPERM; + + sme_update_session_param(hdd_ctx->hHal, + adapter->sessionId, + SIR_PARAM_IGNORE_ASSOC_DISALLOWED, + ignore_assoc_disallowed); + } + return ret_val; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 37fa4e6ab79a..c8d2f6b5c13f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -2311,6 +2311,20 @@ enum qca_access_policy { QCA_ACCESS_POLICY_DENY_UNLESS_LISTED, }; +/** + * enum qca_ignore_assoc_disallowed - Ignore assoc disallowed values + * + * The valid values for the ignore assoc disallowed + * + * @QCA_IGNORE_ASSOC_DISALLOWED_DISABLE: Disable ignore assoc disallowed + * @QCA_IGNORE_ASSOC_DISALLOWED_ENABLE: Enable ignore assoc disallowed + * + */ +enum qca_ignore_assoc_disallowed { + QCA_IGNORE_ASSOC_DISALLOWED_DISABLE, + QCA_IGNORE_ASSOC_DISALLOWED_ENABLE +}; + /** * enum qca_wlan_vendor_config: wifi config attr * @@ -2342,6 +2356,8 @@ enum qca_access_policy { * parameters * @QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER: Unsigned 8bit length attribute to update * power save config to turn off/on qpower + * @QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED: Ignore Assoc Disallowed + * [MBO] * @QCA_WLAN_VENDOR_ATTR_CONFIG_LAST: last config * @QCA_WLAN_VENDOR_ATTR_CONFIG_MAX: max config */ @@ -2396,6 +2412,7 @@ enum qca_wlan_vendor_config { QCA_WLAN_VENDOR_ATTR_CONFIG_IFINDEX, /* Unsigned 8-bit, for setting qpower dynamically */ QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER = 25, + QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED = 26, /* keep last */ QCA_WLAN_VENDOR_ATTR_CONFIG_LAST, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX = diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 9610a2274c47..9d01e419afe6 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2506,9 +2506,11 @@ typedef struct sSirUpdateAPWPSIEsReq { /* * enum sir_update_session_param_type - session param type * @SIR_PARAM_SSID_HIDDEN: ssidHidden parameter + * @SIR_PARAM_IGNORE_ASSOC_DISALLOWED: ignore_assoc_disallowed parameter */ enum sir_update_session_param_type { SIR_PARAM_SSID_HIDDEN, + SIR_PARAM_IGNORE_ASSOC_DISALLOWED, }; /* diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index 4b36c7ee704c..c0d7398e642c 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -484,6 +484,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ uint8_t beacon_tx_rate; uint8_t *access_policy_vendor_ie; uint8_t access_policy; + bool ignore_assoc_disallowed; } tPESession, *tpPESession; /*------------------------------------------------------------------------- diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 6fef5dca4475..8d914ee6e11c 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -3191,6 +3191,31 @@ lim_check_and_announce_join_success(tpAniSirGlobal mac_ctx, session_entry->defaultAuthFailureTimeout = 0; } + + /* + * Check if MBO Association disallowed subattr is present and post + * failure status to LIM if present + */ + if (!session_entry->ignore_assoc_disallowed && + beacon_probe_rsp->assoc_disallowed) { + lim_log(mac_ctx, LOGW, + FL("Connection fails due to assoc disallowed reason(%d):%pM PESessionID %d"), + beacon_probe_rsp->assoc_disallowed_reason, + session_entry->bssId, + session_entry->peSessionId); + mlm_join_cnf.resultCode = eSIR_SME_ASSOC_REFUSED; + mlm_join_cnf.protStatusCode = eSIR_MAC_UNSPEC_FAILURE_STATUS; + session_entry->limMlmState = eLIM_MLM_IDLE_STATE; + mlm_join_cnf.sessionId = session_entry->peSessionId; + if (session_entry->pLimMlmJoinReq) { + qdf_mem_free(session_entry->pLimMlmJoinReq); + session_entry->pLimMlmJoinReq = NULL; + } + lim_post_sme_message(mac_ctx, LIM_MLM_JOIN_CNF, + (uint32_t *) &mlm_join_cnf); + return; + } + /* Update Beacon Interval at CFG database */ if (beacon_probe_rsp->HTCaps.present) diff --git a/core/mac/src/pe/lim/lim_process_beacon_frame.c b/core/mac/src/pe/lim/lim_process_beacon_frame.c index f84c671d9d62..7ff7e61fa9c7 100644 --- a/core/mac/src/pe/lim/lim_process_beacon_frame.c +++ b/core/mac/src/pe/lim/lim_process_beacon_frame.c @@ -106,15 +106,6 @@ lim_process_beacon_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, return; } - if (bcn_ptr->assoc_disallowed) { - lim_log(mac_ctx, LOG1, - FL("Association disallowed in AP "MAC_ADDRESS_STR " Reason code %d"), - MAC_ADDR_ARRAY(mac_hdr->sa), - bcn_ptr->assoc_disallowed_reason); - qdf_mem_free(bcn_ptr); - return; - } - /* * during scanning, when any session is active, and * beacon/Pr belongs to one of the session, fill up the diff --git a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c index c47d7aab9bf0..daf93ffffadd 100644 --- a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c @@ -171,15 +171,6 @@ lim_process_probe_rsp_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_Packet_info, return; } - if (probe_rsp->assoc_disallowed) { - lim_log(mac_ctx, LOG1, - FL("Association disallowed by AP "MAC_ADDRESS_STR " Reason code %d"), - MAC_ADDR_ARRAY(header->bssId), - probe_rsp->assoc_disallowed_reason); - qdf_mem_free(probe_rsp); - return; - } - lim_check_and_add_bss_description(mac_ctx, probe_rsp, rx_Packet_info, false, true); /* To Support BT-AMP */ @@ -404,15 +395,6 @@ lim_process_probe_rsp_frame_no_session(tpAniSirGlobal mac_ctx, return; } - if (probe_rsp->assoc_disallowed) { - lim_log(mac_ctx, LOG1, - FL("Association disallowed by AP "MAC_ADDRESS_STR " Reason code %d"), - MAC_ADDR_ARRAY(header->bssId), - probe_rsp->assoc_disallowed_reason); - qdf_mem_free(probe_rsp); - return; - } - lim_log(mac_ctx, LOG2, FL("Save this probe rsp in LFR cache")); lim_check_and_add_bss_description(mac_ctx, probe_rsp, rx_packet_info, false, true); diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index df4cd348ad20..9739487e56ef 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -4256,6 +4256,9 @@ static void __lim_process_sme_session_update(tpAniSirGlobal mac_ctx, case SIR_PARAM_SSID_HIDDEN: lim_handle_update_ssid_hidden(mac_ctx, session, msg->param_val); break; + case SIR_PARAM_IGNORE_ASSOC_DISALLOWED: + session->ignore_assoc_disallowed = msg->param_val; + break; default: lim_log(mac_ctx, LOGE, FL("Unknown session param")); break; From b384d669ffe58bc9ada3ef655a0915d08bd862b4 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 23:30:34 -0700 Subject: [PATCH 028/179] Release 5.1.0.30U Release 5.1.0.30U Change-Id: Icbe0dedbd686adba1513d97c2609b0c8b52eec2c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5f68226fd7db..5ef4c31728a7 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "T" +#define QWLAN_VERSION_EXTRA "U" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30T" +#define QWLAN_VERSIONSTR "5.1.0.30U" #endif /* QWLAN_VERSION_H */ From f3a64e60817ab3e99f7c6e957d1ef8747ab9169a Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 12 Oct 2016 17:17:34 -0700 Subject: [PATCH 029/179] qcacld-3.0: Fix bad SSR protection in wakelock stats handler It was observed that it was taking an excessive time for Wi-Fi to unload from the UI. Logs showed that unload was waiting for an external thread to exit, giving the entry point as wlan_hdd_cfg80211_get_wakelock_stats(). Analysis of that function showed it is incorrectly using the SSR protection functions. Update that function to correctly "unprotect" on exit. Change-Id: Ic7476be656a7b0c8d09748c1e546fd1a33ce33c5 CRs-Fixed: 1077214 --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index fe547cdc7da6..115f69680fb6 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -7636,7 +7636,7 @@ static int wlan_hdd_cfg80211_get_wakelock_stats(struct wiphy *wiphy, cds_ssr_protect(__func__); ret = __wlan_hdd_cfg80211_get_wakelock_stats(wiphy, wdev, data, data_len); - cds_ssr_protect(__func__); + cds_ssr_unprotect(__func__); return ret; } From e50b2d2ded6782718e03dab3e1f61ca13013607d Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 07:32:02 -0700 Subject: [PATCH 030/179] Release 5.1.0.30V Release 5.1.0.30V Change-Id: I7440b59bd1e027f4069b4cb5c3b89e9f0db2e2bf CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5ef4c31728a7..4239770b3b40 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "U" +#define QWLAN_VERSION_EXTRA "V" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30U" +#define QWLAN_VERSIONSTR "5.1.0.30V" #endif /* QWLAN_VERSION_H */ From 1628188271aea2dbd2cf28e56d003d7de6db4b62 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:35:40 -0700 Subject: [PATCH 031/179] qcacld-3.0: Fix -Wmissing-prototypes in rrm_api We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in rrm_api. Change-Id: I401b58aba9b65e031c8b86d885777299b28ea238 CRs-Fixed: 1075090 --- core/mac/src/pe/rrm/rrm_api.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c index 1a072b4b3315..51a2712141e9 100644 --- a/core/mac/src/pe/rrm/rrm_api.c +++ b/core/mac/src/pe/rrm/rrm_api.c @@ -941,9 +941,10 @@ rrm_process_beacon_report_xmit(tpAniSirGlobal mac_ctx, return status; } -void rrm_process_beacon_request_failure(tpAniSirGlobal pMac, - tpPESession pSessionEntry, tSirMacAddr peer, - tRrmRetStatus status) +static void rrm_process_beacon_request_failure(tpAniSirGlobal pMac, + tpPESession pSessionEntry, + tSirMacAddr peer, + tRrmRetStatus status) { tpSirMacRadioMeasureReport pReport = NULL; tpRRMReq pCurrentReq = pMac->rrm.rrmPEContext.pCurrentReq; @@ -1000,6 +1001,7 @@ void rrm_process_beacon_request_failure(tpAniSirGlobal pMac, * * Return: tSirRetStatus */ +static tSirRetStatus rrm_process_beacon_req(tpAniSirGlobal mac_ctx, tSirMacAddr peer, tpPESession session_entry, tpRRMReq curr_req, tpSirMacRadioMeasureReport report, @@ -1071,7 +1073,7 @@ tSirRetStatus rrm_process_beacon_req(tpAniSirGlobal mac_ctx, tSirMacAddr peer, * * Return: tSirRetStatus */ - +static tSirRetStatus update_rrm_report(tpAniSirGlobal mac_ctx, tpSirMacRadioMeasureReport report, tDot11fRadioMeasurementRequest *rrm_req, From aeebe65c3d01373e6ff4d3848ba2e1339a19e55b Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:46:48 -0700 Subject: [PATCH 032/179] qcacld-3.0: Fix -Wmissing-prototypes in sch_beacon_gen We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sch_beacon_gen. Change-Id: Ife6bd447ef9e352d76fe06ba7679aa95d1d74556 CRs-Fixed: 1075090 --- core/mac/src/pe/sch/sch_beacon_gen.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c index 67afe53e43cb..082834e5e71d 100644 --- a/core/mac/src/pe/sch/sch_beacon_gen.c +++ b/core/mac/src/pe/sch/sch_beacon_gen.c @@ -53,15 +53,11 @@ #include "sch_debug.h" -/* */ -/* March 15, 2006 */ -/* Temporarily (maybe for all of Alpha-1), assuming TIM = 0 */ -/* */ - const uint8_t p2p_oui[] = { 0x50, 0x6F, 0x9A, 0x9 }; -tSirRetStatus sch_get_p2p_ie_offset(uint8_t *pExtraIe, uint32_t extraIeLen, - uint16_t *pP2pIeOffset) +static tSirRetStatus sch_get_p2p_ie_offset(uint8_t *pExtraIe, + uint32_t extraIeLen, + uint16_t *pP2pIeOffset) { tSirRetStatus status = eSIR_FAILURE; *pP2pIeOffset = 0; @@ -99,7 +95,7 @@ tSirRetStatus sch_get_p2p_ie_offset(uint8_t *pExtraIe, uint32_t extraIeLen, * * Return: status of operation */ -tSirRetStatus +static tSirRetStatus sch_append_addn_ie(tpAniSirGlobal mac_ctx, tpPESession session, uint8_t *frm, uint32_t max_bcn_size, uint32_t *num_bytes, uint8_t *addn_ie, uint16_t addn_ielen) @@ -799,8 +795,8 @@ void set_probe_rsp_ie_bitmap(uint32_t *IeBitmap, uint32_t pos) * @return None */ -void write_beacon_to_memory(tpAniSirGlobal pMac, uint16_t size, uint16_t length, - tpPESession psessionEntry) +static void write_beacon_to_memory(tpAniSirGlobal pMac, uint16_t size, + uint16_t length, tpPESession psessionEntry) { uint16_t i; tpAniBeaconStruct pBeacon; From 5bd0c4991d1378da640b93c3352f7aeebd21f1f2 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:47:45 -0700 Subject: [PATCH 033/179] qcacld-3.0: Fix -Wmissing-prototypes in sch_beacon_process We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sch_beacon_process. Change-Id: I9227f77bb7710a32d24072bb4961cd8db77acb8a CRs-Fixed: 1075090 --- core/mac/src/pe/sch/sch_beacon_process.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 9fa411a2be14..47157835a681 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -300,9 +300,12 @@ static void __sch_beacon_process_no_session(tpAniSirGlobal pMac, lim_handle_ibss_coalescing(pMac, pBeacon, pRxPacketInfo, psessionEntry); } - /* If station(STA/BT-STA/BT-AP/IBSS) mode, Always save the beacon in the scan results, if atleast one session is active */ - /* sch_beacon_processNoSession will be called only when there is atleast one session active, so not checking */ - /* it again here. */ + /* If station(STA/BT-STA/BT-AP/IBSS) mode, Always save the + * beacon in the scan results, if atleast one session is + * active. sch_beacon_process_no_session will be called only + * when there is atleast one session active, so not checking + * it again here. + */ lim_check_and_add_bss_description(pMac, pBeacon, pRxPacketInfo, false, false); return; @@ -310,14 +313,14 @@ static void __sch_beacon_process_no_session(tpAniSirGlobal pMac, /** * get_operating_channel_width() - Get operating channel width - * @pStaDs - station entry. + * @stads - station entry. * - * This function returns the oeprating channgl width based on + * This function returns the operating channel width based on * the supported channel width entry. * * Return: tSirMacHTChannelWidth on success */ -tSirMacHTChannelWidth get_operating_channel_width(tpDphHashNode stads) +static tSirMacHTChannelWidth get_operating_channel_width(tpDphHashNode stads) { tSirMacHTChannelWidth ch_width = eHT_CHANNEL_WIDTH_20MHZ; @@ -489,9 +492,9 @@ sch_bcn_process_sta(tpAniSirGlobal mac_ctx, * * Return: none */ -void update_nss(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, - tpSchBeaconStruct beacon, tpPESession session_entry, - tpSirMacMgmtHdr mgmt_hdr) +static void update_nss(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, + tpSchBeaconStruct beacon, tpPESession session_entry, + tpSirMacMgmtHdr mgmt_hdr) { if (sta_ds->vhtSupportedRxNss != (beacon->OperatingMode.rxNSS + 1)) { sta_ds->vhtSupportedRxNss = beacon->OperatingMode.rxNSS; From c1972f6eaff41841b744dd872f18608546037897 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:49:15 -0700 Subject: [PATCH 034/179] qcacld-3.0: Fix -Wmissing-prototypes in sch_message We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sch_message. Change-Id: I6c87ead4fd3fad0590a7a620d9af257621a48cd7 CRs-Fixed: 1075090 --- core/mac/src/pe/sch/sch_message.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/sch/sch_message.c b/core/mac/src/pe/sch/sch_message.c index e746f8b742ea..ff363a07254e 100644 --- a/core/mac/src/pe/sch/sch_message.c +++ b/core/mac/src/pe/sch/sch_message.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -210,9 +210,10 @@ void sch_process_message(tpAniSirGlobal pMac, tpSirMsgQ pSchMsg) /* get the local or broadcast parameters based on the profile sepcified in the config */ /* params are delivered in this order: BK, BE, VI, VO */ -tSirRetStatus +static tSirRetStatus sch_get_params(tpAniSirGlobal pMac, - uint32_t params[][WNI_CFG_EDCA_ANI_ACBK_LOCAL_LEN], uint8_t local) + uint32_t params[][WNI_CFG_EDCA_ANI_ACBK_LOCAL_LEN], + uint8_t local) { uint32_t val; uint32_t i, idx; From 583f101315e2ac47022ead972b8af38c1afe2f2a Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:50:10 -0700 Subject: [PATCH 035/179] qcacld-3.0: Fix -Wmissing-prototypes in wlan_qct_sys We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_qct_sys. Change-Id: I7e843d4404dbd2de9a6d6270c931432b3acf1812 CRs-Fixed: 1075090 --- core/mac/src/sys/common/src/wlan_qct_sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c index 6d83790c66cf..01bb4db41f17 100644 --- a/core/mac/src/sys/common/src/wlan_qct_sys.c +++ b/core/mac/src/sys/common/src/wlan_qct_sys.c @@ -74,7 +74,7 @@ QDF_STATUS sys_build_message_header(SYS_MSG_ID sysMsgId, cds_msg_t *pMsg) * Return: none */ #ifdef QDF_ENABLE_TRACING -void sys_stop_complete_cb(void *pUserData) +static void sys_stop_complete_cb(void *pUserData) { qdf_event_t *pStopEvt = (qdf_event_t *) pUserData; QDF_STATUS qdf_status = qdf_event_set(pStopEvt); @@ -83,7 +83,7 @@ void sys_stop_complete_cb(void *pUserData) } #else -void sys_stop_complete_cb(void *pUserData) +static void sys_stop_complete_cb(void *pUserData) { return; } From 0519291e8f2597379bc049f1b84a4f6318648aca Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 08:32:29 -0700 Subject: [PATCH 036/179] Release 5.1.0.30W Release 5.1.0.30W Change-Id: I069f7c5124792f408bda9c20f3f01c3e9aaf36af CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4239770b3b40..a806a5c859e1 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "V" +#define QWLAN_VERSION_EXTRA "W" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30V" +#define QWLAN_VERSIONSTR "5.1.0.30W" #endif /* QWLAN_VERSION_H */ From 15f0db18dbd0ea1ff5f6e21deccf501e928fd013 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Tue, 11 Oct 2016 18:53:37 -0700 Subject: [PATCH 037/179] qcacld-3.0: Populate correct PCL & ch numbers to avoid in case of SAP Incorrect PCL is given by policy manager because of incorrect merging of valid channel list & weight list which results in to unsafe channel selection. Driver notifies the list of channels to avoid in terms of frequencies rather than channel numbers which is not correct. Change-Id: Ic71766e8c917931d4f051b512fb8000cc34a04ad CRs-Fixed: 1077025 --- core/cds/src/cds_concurrency.c | 8 ++++++-- core/hdd/src/wlan_hdd_main.c | 9 ++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index d0034479540a..a2c6abd50907 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -4570,6 +4570,9 @@ void cds_update_with_safe_channel_list(uint8_t *pcl_channels, uint32_t *len, &unsafe_channel_count, sizeof(unsafe_channel_list)); + if (unsafe_channel_count == 0) + cds_notice("There are no unsafe channels"); + if (unsafe_channel_count) { qdf_mem_copy(current_channel_list, pcl_channels, current_channel_count); @@ -4592,11 +4595,12 @@ void cds_update_with_safe_channel_list(uint8_t *pcl_channels, uint32_t *len, } } if (!is_unsafe) { - pcl_channels[safe_channel_count++] = + pcl_channels[safe_channel_count] = current_channel_list[i]; if (safe_channel_count < weight_len) - weight_list[safe_channel_count++] = + weight_list[safe_channel_count] = org_weight_list[i]; + safe_channel_count++; } } *len = safe_channel_count; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 02d0140eea9f..291b0ab9077f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5784,8 +5784,8 @@ static uint8_t hdd_get_safe_channel_from_pcl_and_acs_range( hdd_info("chan[%d]:%d", i, pcl.pcl_list[i]); found = false; for (j = 0; j < hdd_ctx->unsafe_channel_count; j++) { - if (cds_chan_to_freq(pcl.pcl_list[i]) == - hdd_ctx->unsafe_channel_list[j]) { + if (pcl.pcl_list[i] == + hdd_ctx->unsafe_channel_list[j]) { hdd_info("unsafe chan:%d", pcl.pcl_list[i]); found = true; break; @@ -5887,8 +5887,7 @@ void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctxt) found = false; for (i = 0; i < hdd_ctxt->unsafe_channel_count; i++) { - if (cds_chan_to_freq( - adapter_temp->sessionCtx.ap.operatingChannel) == + if (adapter_temp->sessionCtx.ap.operatingChannel == hdd_ctxt->unsafe_channel_list[i]) { found = true; hdd_info("operating ch:%d is unsafe", @@ -6028,7 +6027,7 @@ void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) end_channel_idx; channel_loop++) { hdd_ctxt->unsafe_channel_list[ hdd_ctxt->unsafe_channel_count++] = - CDS_CHANNEL_FREQ(channel_loop); + CDS_CHANNEL_NUM(channel_loop); if (hdd_ctxt->unsafe_channel_count >= NUM_CHANNELS) { hdd_warn("LTECoex unsafe ch list full"); From 864ccdaaf727e112d9c2b14e4388bb18cd1d2ef7 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 09:13:42 -0700 Subject: [PATCH 038/179] Release 5.1.0.30X Release 5.1.0.30X Change-Id: Ifc0020054f72ac19d4c8724e69cce640dcbf9cd6 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index a806a5c859e1..9ddcc73c4d1e 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "W" +#define QWLAN_VERSION_EXTRA "X" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30W" +#define QWLAN_VERSIONSTR "5.1.0.30X" #endif /* QWLAN_VERSION_H */ From 043f4834a70ce0f98ae786fdffdeca690cff8de9 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Thu, 8 Sep 2016 18:21:50 +0530 Subject: [PATCH 039/179] qcacld-3.0: Don't Invoke cfg80211_scan_done during unload/SSR qcacld-2.0 to qcacld-3.0 propagation While netdev interface is closing the __cfg80211_scan_done() shall already be invoked, so in hdd_cfg80211_scan_done_callback() check for the interface flag before invoking the cfg80211_scan_done(). Change-Id: If88447acd4d13a4ba0ef84378f21e75669af6c71 CRs-Fixed: 908656 --- core/hdd/src/wlan_hdd_scan.c | 39 +++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 5feed800683e..7dbe6ecc1182 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1103,6 +1103,43 @@ nla_put_failure: return; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) +/** + * hdd_cfg80211_scan_done() - Scan completed callback to cfg80211 + * @adapter: Pointer to the adapter + * @req : Scan request + * @aborted : true scan aborted false scan success + * + * This function notifies scan done to cfg80211 + * + * Return: none + */ +static void hdd_cfg80211_scan_done(hdd_adapter_t *adapter, + struct cfg80211_scan_request *req, + bool aborted) +{ + if (adapter->dev->flags & IFF_UP) + cfg80211_scan_done(req, aborted); +} +#else +/** + * hdd_cfg80211_scan_done() - Scan completed callback to cfg80211 + * @adapter: Pointer to the adapter + * @req : Scan request + * @aborted : true scan aborted false scan success + * + * This function notifies scan done to cfg80211 + * + * Return: none + */ +static void hdd_cfg80211_scan_done(hdd_adapter_t *adapter, + struct cfg80211_scan_request *req, + bool aborted) +{ + cfg80211_scan_done(req, aborted); +} +#endif + /** * hdd_cfg80211_scan_done_callback() - scan done callback function called after * scan is finished @@ -1200,7 +1237,7 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle, * scan done event will be posted */ if (NL_SCAN == source) - cfg80211_scan_done(req, aborted); + hdd_cfg80211_scan_done(pAdapter, req, aborted); else hdd_vendor_scan_callback(pAdapter, req, aborted); From d6d19a42616b78a4d013f473fb9fa37cc18a74a2 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 09:52:43 -0700 Subject: [PATCH 040/179] Release 5.1.0.30Y Release 5.1.0.30Y Change-Id: I9d80e4e7b7f90889560fa2bc8f11ad619fb06e3c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 9ddcc73c4d1e..6c602f4d8f08 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "X" +#define QWLAN_VERSION_EXTRA "Y" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30X" +#define QWLAN_VERSIONSTR "5.1.0.30Y" #endif /* QWLAN_VERSION_H */ From fc37c6a1c72f45f656087cd29aadc4557cece087 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 11 Oct 2016 13:37:34 -0700 Subject: [PATCH 041/179] qcacld-3.0: Dump packet contents for RA_MATCH and Magic Packet Add RA Match and Magic Packet to the list of wakeup reasons that cause packet contents to be dumped to the log durring wow wakeup. Change-Id: Id7d5474b0d288ebaae3666e8da0dacc6eda4dc69 CRs-Fixed: 1076574 --- core/wma/src/wma_features.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 7bd92da1bd99..05777be24c10 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -3196,11 +3196,6 @@ int wma_wow_wakeup_host_event(void *handle, uint8_t *event, wake_info->vdev_id); wma_beacon_miss_handler(wma, wake_info->vdev_id); break; -#ifdef FEATURE_WLAN_RA_FILTERING - case WOW_REASON_RA_MATCH: - wma_wow_wake_up_stats(wma, NULL, 0, WOW_REASON_RA_MATCH); - break; -#endif /* FEATURE_WLAN_RA_FILTERING */ #ifdef FEATURE_WLAN_AUTO_SHUTDOWN case WOW_REASON_HOST_AUTO_SHUTDOWN: wake_lock_duration = WMA_AUTO_SHUTDOWN_WAKE_LOCK_DURATION; @@ -3251,6 +3246,10 @@ int wma_wow_wakeup_host_event(void *handle, uint8_t *event, case WOW_REASON_BPF_ALLOW: case WOW_REASON_PATTERN_MATCH_FOUND: +#ifdef FEATURE_WLAN_RA_FILTERING + case WOW_REASON_RA_MATCH: +#endif /* FEATURE_WLAN_RA_FILTERING */ + case WOW_REASON_RECV_MAGIC_PATTERN: wma_wow_wake_up_stats_display(wma); WMA_LOGD("Wake up for Rx packet, dump starting from ethernet hdr"); if (param_buf->wow_packet_buffer) { @@ -3263,7 +3262,7 @@ int wma_wow_wakeup_host_event(void *handle, uint8_t *event, wma_wow_wake_up_stats(wma, param_buf->wow_packet_buffer + 4, wow_buf_pkt_len, - WOW_REASON_PATTERN_MATCH_FOUND); + wake_info->wake_reason); qdf_trace_hex_dump(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG, param_buf->wow_packet_buffer + 4, From fbd2c99c3667f4fe8aca600c3a20cb7fd48d128d Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 10:28:23 -0700 Subject: [PATCH 042/179] Release 5.1.0.30Z Release 5.1.0.30Z Change-Id: I1beee86dbcff1255ebfb9599e7def6fadc632211 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 6c602f4d8f08..29e98077a07d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Y" +#define QWLAN_VERSION_EXTRA "Z" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30Y" +#define QWLAN_VERSIONSTR "5.1.0.30Z" #endif /* QWLAN_VERSION_H */ From e8c919fcc56ef3db6e878b2eafcbcbfe81a37803 Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Sun, 2 Oct 2016 20:35:15 +0530 Subject: [PATCH 043/179] qcacld-3.0: Enhance EPNO feature qcacld-2.0 to qcacld-3.0 propagation Make the following enhancements to the EPNO feature: 1) Implement the reset EPNO command handler 2) Add new parameters for candidate score calculation. Change-Id: Iad1ff9c2b003c9e3ddbc3373366686040ccb55ca CRs-Fixed: 956649 --- core/hdd/src/wlan_hdd_cfg80211.h | 33 ++++++++++ core/hdd/src/wlan_hdd_ext_scan.c | 104 ++++++++++++++++++++++++++----- core/mac/inc/sir_api.h | 24 +++++-- core/sme/src/common/sme_api.c | 34 ++++++---- core/wma/src/wma_scan_roam.c | 32 +++++++--- 5 files changed, 186 insertions(+), 41 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index c8d2f6b5c13f..2c9a81cfed79 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -1901,6 +1901,30 @@ enum qca_wlan_epno_type { * Unsigned 8-bit value; auth bit field for matching WPA IE * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE * Unsigned 8-bit to indicate ePNO type; values from qca_wlan_epno_type + *@QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_CHANNEL_LIST + * Nested attribute to send the channel list + *@QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_SCAN_INTERVAL + * Unsigned 32-bit value; indicates the Interval between PNO scan + * cycles in msec + *@QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI + * Signed 32-bit value; minimum 5GHz RSSI for a BSSID to be considered + *@QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI + * Signed 32-bit value; minimum 2.4GHz RSSI for a BSSID to be considered + * This attribute is obsolete now. + *@QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX + * Signed 32-bit value; the maximum score that a network + * can have before bonuses + *@QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS + * Signed 32-bit value; only report when there is a network's + * score this much higher han the current connection + *@QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS + * Signed 32-bit value; score bonus for all networks with + * the same network flag + *@QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS + * Signed 32-bit value; score bonus for networks that are not open + *@QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS + * Signed 32-bit value; 5GHz RSSI score bonus applied to all + * 5GHz networks * @QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST: After last * @QCA_WLAN_VENDOR_ATTR_PNO_MAX: max */ @@ -1921,6 +1945,15 @@ enum qca_wlan_vendor_attr_pno_config_params { QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS = 11, QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT = 12, QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE = 13, + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_CHANNEL_LIST = 14, + QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_SCAN_INTERVAL = 15, + QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI = 16, + QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI = 17, + QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX = 18, + QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS = 19, + QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS = 20, + QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS = 21, + QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS = 22, /* keep last */ QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST, diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index 7dd23a0dee59..b81bab3665de 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -116,8 +116,6 @@ static const struct nla_policy wlan_hdd_extscan_config_policy [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID] = { .type = NLA_BINARY, .len = IEEE80211_MAX_SSID_LEN }, - [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD] = { - .type = NLA_S8 }, [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS] = { .type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT] = { @@ -3795,16 +3793,6 @@ static int hdd_extscan_epno_fill_network_list( req_msg->networks[index].ssid.length, req_msg->networks[index].ssid.ssId); - /* Parse and fetch rssi threshold */ - if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD]) { - hdd_err("attr rssi threshold failed"); - return -EINVAL; - } - req_msg->networks[index].rssi_threshold = nla_get_s8( - network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD]); - hdd_notice("rssi threshold %d", - req_msg->networks[index].rssi_threshold); - /* Parse and fetch epno flags */ if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS]) { hdd_err("attr epno flags failed"); @@ -3883,12 +3871,24 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy, hdd_err("attr num networks failed"); return -EINVAL; } + + /* + * num_networks is also used as EPNO SET/RESET request. + * if num_networks is zero then it is treated as RESET. + */ num_networks = nla_get_u32( tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS]); - hdd_notice("num networks %u", num_networks); + if (num_networks > MAX_EPNO_NETWORKS) { + hdd_notice("num of nw: %d exceeded max: %d, resetting to: %d", + num_networks, MAX_EPNO_NETWORKS, MAX_EPNO_NETWORKS); + num_networks = MAX_EPNO_NETWORKS; + } + + hdd_notice("num networks %u", num_networks); len = sizeof(*req_msg) + - (num_networks * sizeof(struct wifi_epno_network)); + (num_networks * sizeof(struct wifi_epno_network)); + req_msg = qdf_mem_malloc(len); if (!req_msg) { hdd_err("qdf_mem_malloc failed"); @@ -3909,8 +3909,80 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy, req_msg->session_id = adapter->sessionId; hdd_notice("Session Id %d", req_msg->session_id); - if (hdd_extscan_epno_fill_network_list(hdd_ctx, req_msg, tb)) - goto fail; + if (num_networks) { + + /* Parse and fetch min_5ghz_rssi */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI]) { + hdd_err("min_5ghz_rssi id failed"); + goto fail; + } + req_msg->min_5ghz_rssi = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI]); + + /* Parse and fetch min_24ghz_rssi */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI]) { + hdd_err("min_24ghz_rssi id failed"); + goto fail; + } + req_msg->min_24ghz_rssi = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI]); + + /* Parse and fetch initial_score_max */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX]) { + hdd_err("initial_score_max id failed"); + goto fail; + } + req_msg->initial_score_max = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX]); + + /* Parse and fetch current_connection_bonus */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS]) { + hdd_err("current_connection_bonus id failed"); + goto fail; + } + req_msg->current_connection_bonus = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS] + ); + + /* Parse and fetch same_network_bonus */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS]) { + hdd_err("same_network_bonus id failed"); + goto fail; + } + req_msg->same_network_bonus = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS]); + + /* Parse and fetch secure_bonus */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS]) { + hdd_err("secure_bonus id failed"); + goto fail; + } + req_msg->secure_bonus = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS]); + + /* Parse and fetch band_5ghz_bonus */ + if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS]) { + hdd_err("band_5ghz_bonus id failed"); + goto fail; + } + req_msg->band_5ghz_bonus = nla_get_u32( + tb[QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS]); + + hdd_notice("min_5ghz_rssi: %d min_24ghz_rssi: %d", + req_msg->min_5ghz_rssi, + req_msg->min_24ghz_rssi); + hdd_notice("initial_score_max: %d current_connection_bonus:%d", + req_msg->initial_score_max, + req_msg->current_connection_bonus); + hdd_notice("Bonuses same_network: %d secure: %d band_5ghz: %d", + req_msg->same_network_bonus, + req_msg->secure_bonus, + req_msg->band_5ghz_bonus); + + if (hdd_extscan_epno_fill_network_list(hdd_ctx, req_msg, tb)) + goto fail; + + } status = sme_set_epno_list(hdd_ctx->hHal, req_msg); if (!QDF_IS_STATUS_SUCCESS(status)) { diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 9d01e419afe6..e2e3db5a829d 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -4701,29 +4701,45 @@ typedef struct { uint32_t buckets_scanned; } tSirExtScanOnScanEventIndParams, *tpSirExtScanOnScanEventIndParams; +#define MAX_EPNO_NETWORKS 64 + /** * struct wifi_epno_network - enhanced pno network block * @ssid: ssid - * @rssi_threshold: threshold for considering this SSID as found, required - * granularity for this threshold is 4dBm to 8dBm * @flags: WIFI_PNO_FLAG_XXX * @auth_bit_field: auth bit field for matching WPA IE */ struct wifi_epno_network { tSirMacSSid ssid; - int8_t rssi_threshold; uint8_t flags; uint8_t auth_bit_field; }; /** * struct wifi_epno_params - enhanced pno network params + * @request_id: request id number + * @session_id: session_id number + * @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered + * @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered + * @initial_score_max: maximum score that a network can have before bonuses + * @current_connection_bonus: only report when there is a network's score this + * much higher than the current connection + * @same_network_bonus: score bonus for all n/w with the same network flag + * @secure_bonus: score bonus for networks that are not open + * @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks) * @num_networks: number of ssids - * @networks: PNO networks + * @networks: EPNO networks */ struct wifi_epno_params { uint32_t request_id; uint32_t session_id; + uint32_t min_5ghz_rssi; + uint32_t min_24ghz_rssi; + uint32_t initial_score_max; + uint32_t current_connection_bonus; + uint32_t same_network_bonus; + uint32_t secure_bonus; + uint32_t band_5ghz_bonus; uint32_t num_networks; struct wifi_epno_network networks[]; }; diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index fe98f63d4264..e722c29895d1 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -13728,6 +13728,7 @@ QDF_STATUS sme_set_epno_list(tHalHandle hal, sms_log(mac, LOG1, FL("enter")); len = sizeof(*req_msg) + (input->num_networks * sizeof(struct wifi_epno_network)); + req_msg = qdf_mem_malloc(len); if (!req_msg) { sms_log(mac, LOGE, FL("qdf_mem_malloc failed")); @@ -13738,17 +13739,28 @@ QDF_STATUS sme_set_epno_list(tHalHandle hal, req_msg->num_networks = input->num_networks; req_msg->request_id = input->request_id; req_msg->session_id = input->session_id; - for (i = 0; i < req_msg->num_networks; i++) { - req_msg->networks[i].rssi_threshold = - input->networks[i].rssi_threshold; - req_msg->networks[i].flags = input->networks[i].flags; - req_msg->networks[i].auth_bit_field = - input->networks[i].auth_bit_field; - req_msg->networks[i].ssid.length = - input->networks[i].ssid.length; - qdf_mem_copy(req_msg->networks[i].ssid.ssId, - input->networks[i].ssid.ssId, - req_msg->networks[i].ssid.length); + + /* Fill only when num_networks are non zero */ + if (req_msg->num_networks) { + req_msg->min_5ghz_rssi = input->min_5ghz_rssi; + req_msg->min_24ghz_rssi = input->min_24ghz_rssi; + req_msg->initial_score_max = input->initial_score_max; + req_msg->same_network_bonus = input->same_network_bonus; + req_msg->secure_bonus = input->secure_bonus; + req_msg->band_5ghz_bonus = input->band_5ghz_bonus; + req_msg->current_connection_bonus = + input->current_connection_bonus; + + for (i = 0; i < req_msg->num_networks; i++) { + req_msg->networks[i].flags = input->networks[i].flags; + req_msg->networks[i].auth_bit_field = + input->networks[i].auth_bit_field; + req_msg->networks[i].ssid.length = + input->networks[i].ssid.length; + qdf_mem_copy(req_msg->networks[i].ssid.ssId, + input->networks[i].ssid.ssId, + req_msg->networks[i].ssid.length); + } } status = sme_acquire_global_lock(&mac->sme); diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 6394cae08551..cd9a03fca5fe 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -5412,16 +5412,28 @@ QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma, params->request_id = req->request_id; params->session_id = req->session_id; params->num_networks = req->num_networks; - for (i = 0; i < req->num_networks; i++) { - params->networks[i].rssi_threshold = - req->networks[i].rssi_threshold; - params->networks[i].auth_bit_field = - req->networks[i].auth_bit_field; - params->networks[i].flags = req->networks[i].flags; - params->networks[i].ssid.length = req->networks[i].ssid.length; - qdf_mem_copy(params->networks[i].ssid.mac_ssid, - req->networks[i].ssid.ssId, - WMI_MAC_MAX_SSID_LENGTH); + + /* Fill only when num_networks are non zero */ + if (req->num_networks) { + params->min_5ghz_rssi = req->min_5ghz_rssi; + params->min_24ghz_rssi = req->min_24ghz_rssi; + params->initial_score_max = req->initial_score_max; + params->same_network_bonus = req->same_network_bonus; + params->secure_bonus = req->secure_bonus; + params->band_5ghz_bonus = req->band_5ghz_bonus; + params->current_connection_bonus = + req->current_connection_bonus; + + for (i = 0; i < req->num_networks; i++) { + params->networks[i].flags = req->networks[i].flags; + params->networks[i].auth_bit_field = + req->networks[i].auth_bit_field; + params->networks[i].ssid.length = + req->networks[i].ssid.length; + qdf_mem_copy(params->networks[i].ssid.mac_ssid, + req->networks[i].ssid.ssId, + WMI_MAC_MAX_SSID_LENGTH); + } } status = wmi_unified_set_epno_network_list_cmd(wma->wmi_handle, params); From d257ccc6861afa8bbdc8e4573a84dd17b95cb745 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 11:46:56 -0700 Subject: [PATCH 044/179] Release 5.1.0.31 Release 5.1.0.31 Change-Id: Ia3aa3011e0824af2b05c7a939bf2f36b77f6b94d CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 29e98077a07d..9e6aa1fda27d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Z" -#define QWLAN_VERSION_BUILD 30 +#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.30Z" +#define QWLAN_VERSIONSTR "5.1.0.31" #endif /* QWLAN_VERSION_H */ From f7d000060f0039ddc9ad2c96b877aa75c59596c4 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Wed, 12 Oct 2016 10:55:58 -0700 Subject: [PATCH 045/179] qcacld-3.0: Clean up obsolete cds_shutdown API qcacld-3.0 recovery does not use cds_shutdown routine hence clean up this obsolete API. Change-Id: I4779c1336062a2cc6357b2a4cf82248d4c457aa8 CRs-Fixed: 1077094 --- core/cds/inc/cds_api.h | 2 - core/cds/src/cds_api.c | 92 ------------------------------------------ 2 files changed, 94 deletions(-) diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 140a453a11af..4a94baeee1af 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -215,8 +215,6 @@ void cds_flush_cache_rx_queue(void); QDF_STATUS cds_close(v_CONTEXT_t cds_context); -QDF_STATUS cds_shutdown(v_CONTEXT_t cds_context); - void cds_core_return_msg(void *pVContext, p_cds_msg_wrapper pMsgWrapper); void *cds_get_context(QDF_MODULE_ID moduleId); diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 69f68d76d42e..9f49466926b1 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1440,98 +1440,6 @@ void cds_core_return_msg(void *pVContext, p_cds_msg_wrapper pMsgWrapper) cds_mq_put(&p_cds_context->freeVosMq, pMsgWrapper); } /* cds_core_return_msg() */ - -/** - * cds_shutdown() - shutdown CDS - * @cds_context: global cds context - * - * Return: QDF status - */ -QDF_STATUS cds_shutdown(v_CONTEXT_t cds_context) -{ - QDF_STATUS qdf_status; - tpAniSirGlobal pmac = (((p_cds_contextType)cds_context)->pMACContext); - - ol_txrx_pdev_detach(gp_cds_context->pdev_txrx_ctx, 1); - cds_free_context(cds_context, QDF_MODULE_ID_TXRX, - gp_cds_context->pdev_txrx_ctx); - - qdf_status = sme_close(((p_cds_contextType) cds_context)->pMACContext); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to close SME", __func__); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - } - /* - * CAC timer will be initiated and started only when SAP starts on - * DFS channel and it will be stopped and destroyed immediately once the - * radar detected or timedout. So as per design CAC timer should be - * destroyed after stop - */ - if (pmac->sap.SapDfsInfo.is_dfs_cac_timer_running) { - qdf_mc_timer_stop(&pmac->sap.SapDfsInfo.sap_dfs_cac_timer); - pmac->sap.SapDfsInfo.is_dfs_cac_timer_running = 0; - qdf_mc_timer_destroy(&pmac->sap.SapDfsInfo.sap_dfs_cac_timer); - } - - qdf_status = mac_close(((p_cds_contextType) cds_context)->pMACContext); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to close MAC", __func__); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - } - - ((p_cds_contextType) cds_context)->pMACContext = NULL; - - if (false == wma_needshutdown(cds_context)) { - - qdf_status = wma_close(cds_context); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to close wma!", __func__); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - } - } - - qdf_status = wma_wmi_work_close(cds_context); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to close wma_wmi_work!", __func__); - QDF_ASSERT(0); - } - - if (gp_cds_context->htc_ctx) { - htc_stop(gp_cds_context->htc_ctx); - htc_destroy(gp_cds_context->htc_ctx); - gp_cds_context->htc_ctx = NULL; - } - - qdf_status = wma_wmi_service_close(cds_context); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to close wma_wmi_service!", __func__); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - } - - cds_mq_deinit(&((p_cds_contextType) cds_context)->freeVosMq); - - qdf_status = qdf_event_destroy(&gp_cds_context->wmaCompleteEvent); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: failed to destroy wmaCompleteEvent", __func__); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - } - - qdf_status = qdf_event_destroy(&gp_cds_context->ProbeEvent); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "%s: failed to destroy ProbeEvent", __func__); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - } - - return QDF_STATUS_SUCCESS; -} - /** * cds_get_vdev_types() - get vdev type * @mode: mode From a1dc0136c7388278d8b2387e5863c81ce14cf971 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 13:36:04 -0700 Subject: [PATCH 046/179] Release 5.1.0.31A Release 5.1.0.31A Change-Id: I60c9368131698f34ca503ebe25182a498dd682d2 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 9e6aa1fda27d..912d885cc07e 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_EXTRA "A" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31" +#define QWLAN_VERSIONSTR "5.1.0.31A" #endif /* QWLAN_VERSION_H */ From f731b30df83ddd7befaf811fda55e66a3d4ea583 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:00:55 -0700 Subject: [PATCH 047/179] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_ioctl We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_ioctl. Change-Id: I24089ef930e15af0180eefbf98ab86372684b79f CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 5fdab298fb8c..21a0117c1788 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -549,7 +549,7 @@ hdd_cfg80211_get_ibss_peer_info(hdd_adapter_t *adapter, uint8_t staIdx) } /* Function header is left blank intentionally */ -QDF_STATUS +static QDF_STATUS hdd_parse_get_ibss_peer_info(uint8_t *pValue, struct qdf_mac_addr *pPeerMacAddr) { uint8_t *inPtr = pValue; @@ -1647,7 +1647,7 @@ hdd_parse_set_roam_scan_channels(hdd_adapter_t *adapter, const char *command) * * Return: 0 for success non-zero for failure */ -QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) +static QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest) { uint8_t *cmdPtr = NULL; int count, content = 0, ret = 0; From 82b0c626dd2e888fa59a9f361ad26aa745c02629 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:53:55 -0700 Subject: [PATCH 048/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_api We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_api. Change-Id: Ie3defa164278d775759686a7f9508d42799a48e4 CRs-Fixed: 1075090 --- core/mac/src/pe/include/lim_api.h | 12 ++++++++++++ core/mac/src/pe/lim/lim_api.c | 17 ++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index dc78c170d79e..5c42317df51d 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -122,6 +122,18 @@ tSirRetStatus pe_start(tpAniSirGlobal pMac); void pe_stop(tpAniSirGlobal pMac); tSirRetStatus pe_post_msg_api(tpAniSirGlobal pMac, tSirMsgQ *pMsg); tSirRetStatus peProcessMsg(tpAniSirGlobal pMac, tSirMsgQ *limMsg); + +/** + * pe_register_callbacks_with_wma() - register SME and PE callback functions to + * WMA. + * @pMac: mac global ctx + * @ready_req: Ready request parameters, containing callback pointers + * + * Return: None + */ +void pe_register_callbacks_with_wma(tpAniSirGlobal pMac, + tSirSmeReadyReq *ready_req); + /** * Function to cleanup LIM state. * This called upon reset/persona change etc diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 136d0e920579..52615df03b3c 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -1014,7 +1014,7 @@ tSirRetStatus pe_process_messages(tpAniSirGlobal pMac, tSirMsgQ *pMsg) * @return None */ -QDF_STATUS pe_handle_mgmt_frame(void *p_cds_gctx, void *cds_buff) +static QDF_STATUS pe_handle_mgmt_frame(void *p_cds_gctx, void *cds_buff) { tpAniSirGlobal pMac; tpSirMacMgmtHdr mHdr; @@ -1091,10 +1091,7 @@ QDF_STATUS pe_handle_mgmt_frame(void *p_cds_gctx, void *cds_buff) /** * pe_register_callbacks_with_wma() - register SME and PE callback functions to * WMA. - * @pMac: mac global ctx - * @ready_req: Ready request parameters, containing callback pointers - * - * Return: None + * (function documentation in lim_api.h) */ void pe_register_callbacks_with_wma(tpAniSirGlobal pMac, tSirSmeReadyReq *ready_req) @@ -1748,9 +1745,10 @@ void lim_fill_join_rsp_ht_caps(tpPESession session, tpSirSmeJoinRsp join_rsp) #endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD -QDF_STATUS lim_roam_fill_bss_descr(tpAniSirGlobal pMac, - roam_offload_synch_ind *roam_offload_synch_ind_ptr, - tpSirBssDescription bss_desc_ptr) +static QDF_STATUS +lim_roam_fill_bss_descr(tpAniSirGlobal pMac, + roam_offload_synch_ind *roam_offload_synch_ind_ptr, + tpSirBssDescription bss_desc_ptr) { uint32_t ie_len = 0; tpSirProbeRespBeacon parsed_frm_ptr; @@ -2083,7 +2081,8 @@ QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx, } #endif -uint8_t lim_is_beacon_miss_scenario(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo) +static bool lim_is_beacon_miss_scenario(tpAniSirGlobal pMac, + uint8_t *pRxPacketInfo) { tpSirMacMgmtHdr pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo); uint8_t sessionId; From 801f1537ffb46160c09348af3e83e130012f4394 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:54:50 -0700 Subject: [PATCH 049/179] qcacld-3.0: Fix -Wmissing-prototypes in lim_process_sme_req_messages We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_process_sme_req_messages. Change-Id: I24b1bacd4ca1a795e3f7ebdc4af93afaf952dae6 CRs-Fixed: 1075090 --- .../src/pe/lim/lim_process_sme_req_messages.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 9739487e56ef..24475f611729 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -117,8 +117,6 @@ static void lim_process_modify_add_ies(tpAniSirGlobal pMac, uint32_t *pMsg); static void lim_process_update_add_ies(tpAniSirGlobal pMac, uint32_t *pMsg); -extern void pe_register_callbacks_with_wma(tpAniSirGlobal pMac, - tSirSmeReadyReq *ready_req); static void lim_process_ext_change_channel(tpAniSirGlobal mac_ctx, uint32_t *msg); @@ -3099,8 +3097,8 @@ end: * Return: None */ -void lim_process_sme_get_assoc_sta_info(tpAniSirGlobal mac_ctx, - uint32_t *msg_buf) +static void lim_process_sme_get_assoc_sta_info(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) { tSirSmeGetAssocSTAsReq get_assoc_stas_req; tpDphHashNode sta_ds = NULL; @@ -3206,8 +3204,8 @@ lim_assoc_sta_end: * * Return: None */ -void lim_process_sme_get_wpspbc_sessions(tpAniSirGlobal mac_ctx, - uint32_t *msg_buf) +static void lim_process_sme_get_wpspbc_sessions(tpAniSirGlobal mac_ctx, + uint32_t *msg_buf) { tSirSmeGetWPSPBCSessionsReq get_wps_pbc_sessions_req; tpPESession session_entry = NULL; @@ -3306,7 +3304,8 @@ static void __lim_counter_measures(tpAniSirGlobal pMac, tpPESession psessionEntr mac, psessionEntry, false); }; -void lim_process_tkip_counter_measures(tpAniSirGlobal pMac, uint32_t *pMsgBuf) +static void lim_process_tkip_counter_measures(tpAniSirGlobal pMac, + uint32_t *pMsgBuf) { tSirSmeTkipCntrMeasReq tkipCntrMeasReq; tpPESession psessionEntry; @@ -3948,7 +3947,8 @@ end: smesessionId, smetransactionId); } -void lim_process_sme_addts_rsp_timeout(tpAniSirGlobal pMac, uint32_t param) +static void lim_process_sme_addts_rsp_timeout(tpAniSirGlobal pMac, + uint32_t param) { /* fetch the sessionEntry based on the sessionId */ tpPESession psessionEntry; @@ -4513,7 +4513,7 @@ static void __lim_process_sme_set_ht2040_mode(tpAniSirGlobal pMac, * @return None */ -void __lim_process_report_message(tpAniSirGlobal pMac, tpSirMsgQ pMsg) +static void __lim_process_report_message(tpAniSirGlobal pMac, tpSirMsgQ pMsg) { switch (pMsg->type) { case eWNI_SME_NEIGHBOR_REPORT_REQ_IND: From c3ab4f1dd3c803bcbda2620b80a6fa7056ae659f Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 18:12:26 -0700 Subject: [PATCH 050/179] Release 5.1.0.31B Release 5.1.0.31B Change-Id: I20106cbedee34bef52b0d903bea66aee356d5da6 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 912d885cc07e..acc11106f049 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "A" +#define QWLAN_VERSION_EXTRA "B" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31A" +#define QWLAN_VERSIONSTR "5.1.0.31B" #endif /* QWLAN_VERSION_H */ From 16fd1ee609b9fdf78bf7778aa561eb098263812c Mon Sep 17 00:00:00 2001 From: Arun Khandavalli Date: Sat, 8 Oct 2016 17:47:07 +0530 Subject: [PATCH 051/179] qcacld-3.0: Cleanup handling of dynamic mode switching Cleanup all the interfaces in the present mode before switching to new mode. Also add support to comeback into MISSION_MODE from other modes, Set the load/unload flags during the con_mode switching. Change-Id: I03f7ec5d27c536ec1a3046d49d34ec421490e0bc CRs-Fixed: 1075546 --- core/hdd/src/wlan_hdd_main.c | 235 ++++++++++++++++++++++++++--------- 1 file changed, 175 insertions(+), 60 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 291b0ab9077f..ff90a7d4d70f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3209,6 +3209,7 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, case QDF_P2P_DEVICE_MODE: case QDF_OCB_MODE: case QDF_NDI_MODE: + case QDF_MONITOR_MODE: adapter = hdd_alloc_station_adapter(hdd_ctx, macAddr, name_assign_type, iface_name); @@ -3223,6 +3224,8 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, adapter->wdev.iftype = NL80211_IFTYPE_P2P_CLIENT; else if (QDF_P2P_DEVICE_MODE == session_type) adapter->wdev.iftype = NL80211_IFTYPE_P2P_DEVICE; + else if (QDF_MONITOR_MODE == session_type) + adapter->wdev.iftype = NL80211_IFTYPE_MONITOR; else adapter->wdev.iftype = NL80211_IFTYPE_STATION; @@ -3290,6 +3293,27 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); break; + case QDF_FTM_MODE: + adapter = hdd_alloc_station_adapter(hdd_ctx, macAddr, + name_assign_type, + "wlan0"); + if (NULL == adapter) { + hdd_err("Failed to allocate adapter for FTM mode"); + return NULL; + } + adapter->wdev.iftype = NL80211_IFTYPE_STATION; + adapter->device_mode = session_type; + status = hdd_register_interface(adapter, rtnl_held); + if (QDF_STATUS_SUCCESS != status) { + hdd_deinit_adapter(hdd_ctx, adapter, rtnl_held); + goto err_free_netdev; + } + /* Stop the Interface TX queue. */ + hdd_info("Disabling queues"); + wlan_hdd_netif_queue_control(adapter, + WLAN_NETIF_TX_DISABLE_N_CARRIER, + WLAN_CONTROL_PATH); + break; default: hdd_alert("Invalid session type %d", session_type); QDF_ASSERT(0); @@ -3390,6 +3414,7 @@ QDF_STATUS hdd_close_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, /* Fw will take care incase of concurrency */ return QDF_STATUS_SUCCESS; } + return QDF_STATUS_E_FAILURE; } @@ -3412,9 +3437,14 @@ QDF_STATUS hdd_close_all_adapters(hdd_context_t *hdd_ctx, bool rtnl_held) do { status = hdd_remove_front_adapter(hdd_ctx, &pHddAdapterNode); if (pHddAdapterNode && QDF_STATUS_SUCCESS == status) { + wlan_hdd_release_intf_addr(hdd_ctx, + pHddAdapterNode->pAdapter->macAddressCurrent.bytes); hdd_cleanup_adapter(hdd_ctx, pHddAdapterNode->pAdapter, rtnl_held); qdf_mem_free(pHddAdapterNode); + /* Adapter removed. Decrement vdev count */ + if (hdd_ctx->current_intf_count != 0) + hdd_ctx->current_intf_count--; } } while (NULL != pHddAdapterNode && QDF_STATUS_E_EMPTY != status); @@ -9229,6 +9259,7 @@ static bool is_con_mode_valid(enum tQDF_GLOBAL_CON_MODE mode) case QDF_GLOBAL_MONITOR_MODE: case QDF_GLOBAL_FTM_MODE: case QDF_GLOBAL_EPPING_MODE: + case QDF_GLOBAL_MISSION_MODE: return true; default: return false; @@ -9250,10 +9281,10 @@ static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode( return QDF_STA_MODE; case QDF_GLOBAL_MONITOR_MODE: return QDF_MONITOR_MODE; - case QDF_GLOBAL_FTM_MODE: - return QDF_FTM_MODE; case QDF_GLOBAL_EPPING_MODE: return QDF_EPPING_MODE; + case QDF_GLOBAL_FTM_MODE: + return QDF_FTM_MODE; case QDF_GLOBAL_QVIT_MODE: return QDF_QVIT_MODE; default: @@ -9261,6 +9292,87 @@ static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode( } } +static void hdd_cleanup_present_mode(hdd_context_t *hdd_ctx, + enum tQDF_GLOBAL_CON_MODE curr_mode) +{ + switch (curr_mode) { + case QDF_GLOBAL_MISSION_MODE: + case QDF_GLOBAL_MONITOR_MODE: + case QDF_GLOBAL_FTM_MODE: + hdd_abort_mac_scan_all_adapters(hdd_ctx); + hdd_stop_all_adapters(hdd_ctx); + hdd_deinit_all_adapters(hdd_ctx, false); + hdd_close_all_adapters(hdd_ctx, false); + break; + case QDF_GLOBAL_EPPING_MODE: + epping_disable(); + epping_close(); + break; + default: + return; + } +} + +static int hdd_register_req_mode(hdd_context_t *hdd_ctx, + enum tQDF_GLOBAL_CON_MODE mode) +{ + hdd_adapter_t *adapter; + int ret = 0; + bool rtnl_held; + qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + QDF_STATUS status; + + if (!qdf_dev) { + hdd_err("qdf device context is Null return!"); + return -EINVAL; + } + + rtnl_held = hdd_hold_rtnl_lock(); + switch (mode) { + case QDF_GLOBAL_MISSION_MODE: + adapter = hdd_open_interfaces(hdd_ctx, rtnl_held); + if (IS_ERR(adapter)) { + hdd_alert("Failed to open interface, adapter is NULL"); + ret = -EINVAL; + } + break; + case QDF_GLOBAL_FTM_MODE: + adapter = hdd_open_adapter(hdd_ctx, QDF_FTM_MODE, "wlan%d", + wlan_hdd_get_intf_addr(hdd_ctx), + NET_NAME_UNKNOWN, rtnl_held); + if (adapter == NULL) + ret = -EINVAL; + break; + case QDF_GLOBAL_MONITOR_MODE: + adapter = hdd_open_adapter(hdd_ctx, QDF_MONITOR_MODE, "wlan%d", + wlan_hdd_get_intf_addr(hdd_ctx), + NET_NAME_UNKNOWN, rtnl_held); + if (adapter == NULL) + ret = -EINVAL; + break; + case QDF_GLOBAL_EPPING_MODE: + status = epping_open(); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("Failed to open in eeping mode: %d", status); + ret = -EINVAL; + break; + } + ret = epping_enable(qdf_dev->dev); + if (ret) { + hdd_err("Failed to enable in epping mode : %d", ret); + epping_close(); + } + break; + default: + hdd_info("Mode not supported"); + ret = -ENOTSUPP; + break; + } + hdd_release_rtnl_lock(); + rtnl_held = false; + return ret; +} + /** * con_mode_handler() - Handles module param con_mode change * @kmessage: con mode name on which driver to be bring up @@ -9271,101 +9383,104 @@ static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode( * * Return - 0 on success and failure code on failure */ -static int con_mode_handler(const char *kmessage, struct kernel_param *kp) +static int __con_mode_handler(const char *kmessage, struct kernel_param *kp, + hdd_context_t *hdd_ctx) { int ret; - hdd_context_t *hdd_ctx; hdd_adapter_t *adapter; - qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); enum tQDF_GLOBAL_CON_MODE curr_mode; enum tQDF_ADAPTER_MODE adapter_mode; - QDF_STATUS status; + + cds_set_load_in_progress(true); hdd_info("con_mode handler: %s", kmessage); ret = param_set_int(kmessage, kp); - if (!qdf_dev) { - hdd_err("qdf device context is Null return!"); - return -EINVAL; - } - hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); - if (!hdd_ctx) { - hdd_err("Hdd context Null return!"); - return -EINVAL; - } if (!(is_con_mode_valid(con_mode))) { hdd_err("invlaid con_mode %d", con_mode); - return -EINVAL; + ret = -EINVAL; + goto reset_flags; } + curr_mode = hdd_get_conparam(); if (curr_mode == con_mode) { hdd_err("curr mode: %d is same as user triggered mode %d", curr_mode, con_mode); - return 0; + ret = 0; + goto reset_flags; } - adapter_mode = hdd_get_adpter_mode(curr_mode); - if (adapter_mode == QDF_MAX_NO_OF_MODE) { - hdd_err("invalid adapter"); - return -EINVAL; - } - - hdd_stop_all_adapters(hdd_ctx); - hdd_deinit_all_adapters(hdd_ctx, false); + /* Cleanup present mode before switching to new mode */ + hdd_cleanup_present_mode(hdd_ctx, curr_mode); ret = hdd_wlan_stop_modules(hdd_ctx); if (ret) { hdd_err("Stop wlan modules failed"); - return -EINVAL; + goto reset_flags; + } + + hdd_set_conparam(con_mode); + + /* Register for new con_mode & then kick_start modules again */ + ret = hdd_register_req_mode(hdd_ctx, con_mode); + if (ret) { + hdd_err("Failed to register for new mode"); + goto reset_flags; + } + + adapter_mode = hdd_get_adpter_mode(con_mode); + if (adapter_mode == QDF_MAX_NO_OF_MODE) { + hdd_err("invalid adapter"); + ret = -EINVAL; + goto reset_flags; } adapter = hdd_get_adapter(hdd_ctx, adapter_mode); if (!adapter) { - hdd_err("Failed to get adapter, mode: %d", curr_mode); - return -EINVAL; - } - - if (con_mode == QDF_GLOBAL_FTM_MODE) { - adapter->device_mode = QDF_FTM_MODE; - hdd_set_conparam(QDF_GLOBAL_FTM_MODE); - } else if (con_mode == QDF_GLOBAL_MONITOR_MODE) { - adapter->wdev.iftype = NL80211_IFTYPE_MONITOR; - adapter->device_mode = QDF_MONITOR_MODE; - hdd_set_conparam(QDF_GLOBAL_MONITOR_MODE); - hdd_set_station_ops(adapter->dev); - } else if (con_mode == QDF_GLOBAL_EPPING_MODE) { - hdd_set_conparam(QDF_GLOBAL_EPPING_MODE); - status = epping_open(); - if (status != QDF_STATUS_SUCCESS) { - hdd_err("Failed to open in eeping mode: %d", status); - return -EINVAL; - } - ret = epping_enable(qdf_dev->dev); - if (ret) { - hdd_err("Failed to enable in epping mode : %d", ret); - epping_close(); - return -EINVAL; - } - hdd_info("epping mode successfully enabled"); - return 0; + hdd_err("Failed to get adapter:%d", adapter_mode); + goto reset_flags; } ret = hdd_wlan_start_modules(hdd_ctx, adapter, false); if (ret) { hdd_err("Start wlan modules failed: %d", ret); - return -EINVAL; + goto reset_flags; } - if (hdd_start_adapter(adapter)) { - hdd_err("Failed to start %s adapter", kmessage); - return -EINVAL; - } else { - hdd_info("Mode successfully changed to %s", kmessage); - ret = 0; + if (con_mode == QDF_GLOBAL_MONITOR_MODE || + con_mode == QDF_GLOBAL_FTM_MODE) { + if (hdd_start_adapter(adapter)) { + hdd_err("Failed to start %s adapter", kmessage); + ret = -EINVAL; + goto reset_flags; + } } + hdd_info("Mode successfully changed to %s", kmessage); + ret = 0; + +reset_flags: + cds_set_load_in_progress(false); + return ret; +} + + +static int con_mode_handler(const char *kmessage, struct kernel_param *kp) +{ + int ret; + hdd_context_t *hdd_ctx; + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + ret = wlan_hdd_validate_context(hdd_ctx); + if (ret) + return ret; + + cds_ssr_protect(__func__); + ret = __con_mode_handler(kmessage, kp, hdd_ctx); + cds_ssr_unprotect(__func__); + return ret; } From d18de2eb673ea7224f7352678a98af59eed81c2d Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 22:38:44 -0700 Subject: [PATCH 052/179] Release 5.1.0.31C Release 5.1.0.31C Change-Id: I05381fb1c742ae2108d0d225185a696666f69fd7 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index acc11106f049..c7154623dd6d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "B" +#define QWLAN_VERSION_EXTRA "C" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31B" +#define QWLAN_VERSIONSTR "5.1.0.31C" #endif /* QWLAN_VERSION_H */ From a89be8d2b52c5037b6c543ae3840d34bde5e3b78 Mon Sep 17 00:00:00 2001 From: Komal Seelam Date: Thu, 29 Sep 2016 11:09:26 +0530 Subject: [PATCH 053/179] qcacld-3.0: Prevent Runtime PM when connection in progress Add logic to prevent runtime pm when connect and DHCP in progress. CRs-Fixed: 1072520 Change-Id: I3f44bb32aabe2d119c4bf3888f49891b44fc2c7b --- core/hdd/inc/wlan_hdd_main.h | 12 ++++++- core/hdd/src/wlan_hdd_cfg80211.c | 4 +++ core/hdd/src/wlan_hdd_main.c | 28 +++++++++++++++ core/hdd/src/wlan_hdd_power.c | 58 ++++++++++++++++++++++++-------- 4 files changed, 87 insertions(+), 15 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 41e16d0da753..b524f5385c16 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -854,8 +854,17 @@ struct hdd_chan_change_params { struct ch_params_s chan_params; }; -#define WLAN_HDD_ADAPTER_MAGIC 0x574c414e /* ASCII "WLAN" */ +/** + * struct hdd_connect_pm_context - Runtime PM connect context per adapter + * @connect: Runtime Connect Context + * + * Structure to hold runtime pm connect context for each adapter. + */ +struct hdd_connect_pm_context { + qdf_runtime_lock_t connect; +}; +#define WLAN_HDD_ADAPTER_MAGIC 0x574c414e /* ASCII "WLAN" */ struct hdd_adapter_s { /* Magic cookie for adapter sanity verification. Note that this @@ -1086,6 +1095,7 @@ struct hdd_adapter_s { * channel needs to be moved from the existing 2.4GHz channel. */ uint8_t pre_cac_chan; + struct hdd_connect_pm_context connect_rpm_ctx; }; #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 115f69680fb6..c01fee7bc818 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11436,6 +11436,8 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, hdd_conn_set_connection_state(pAdapter, eConnectionState_Connecting); + qdf_runtime_pm_prevent_suspend(pAdapter->connect_rpm_ctx. + connect); status = sme_roam_connect(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, pRoamProfile, &roamId); @@ -11449,6 +11451,8 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, /* change back to NotAssociated */ hdd_conn_set_connection_state(pAdapter, eConnectionState_NotConnected); + qdf_runtime_pm_allow_suspend(pAdapter->connect_rpm_ctx. + connect); } pRoamProfile->ChannelInfo.ChannelList = NULL; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ff90a7d4d70f..a287ac4f3fcf 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2451,6 +2451,25 @@ void hdd_set_station_ops(struct net_device *pWlanDev) pWlanDev->netdev_ops = &wlan_drv_ops; } +#ifdef FEATURE_RUNTIME_PM +static void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter) +{ + struct hdd_connect_pm_context *ctx = &adapter->connect_rpm_ctx; + + ctx->connect = qdf_runtime_lock_init("connect"); +} + +static void hdd_adapter_runtime_suspend_denit(hdd_adapter_t *adapter) +{ + struct hdd_connect_pm_context *ctx = &adapter->connect_rpm_ctx; + + qdf_runtime_lock_deinit(ctx->connect); + ctx->connect = NULL; +} +#else /* FEATURE_RUNTIME_PM */ +static inline void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter) {} +static inline void hdd_adapter_runtime_suspend_denit(hdd_adapter_t *adapter) {} +#endif /* FEATURE_RUNTIME_PM */ /** * hdd_alloc_station_adapter() - allocate the station hdd adapter * @hdd_ctx: global hdd context @@ -2542,6 +2561,7 @@ static hdd_adapter_t *hdd_alloc_station_adapter(hdd_context_t *hdd_ctx, /* set pWlanDev's parent to underlying device */ SET_NETDEV_DEV(pWlanDev, hdd_ctx->parent_dev); hdd_wmm_init(adapter); + hdd_adapter_runtime_suspend_init(adapter); spin_lock_init(&adapter->pause_map_lock); adapter->start_time = adapter->last_time = qdf_system_ticks(); } @@ -2916,6 +2936,8 @@ static void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, adapter->scan_info.default_scan_ies = NULL; } + hdd_adapter_runtime_suspend_denit(adapter); + /* * The adapter is marked as closed. When hdd_wlan_exit() call returns, * the driver is almost closed and cannot handle either control @@ -3943,9 +3965,12 @@ void hdd_connect_result(struct net_device *dev, const u8 *bssid, roam_info->u.pConnectedProfile->SSID.ssId, roam_info->u.pConnectedProfile->SSID.length); } + hdd_connect_bss(dev, bssid, bss, req_ie, req_ie_len, resp_ie, resp_ie_len, status, gfp, connect_timeout); + + qdf_runtime_pm_allow_suspend(padapter->connect_rpm_ctx.connect); } #else void hdd_connect_result(struct net_device *dev, const u8 *bssid, @@ -3954,8 +3979,11 @@ void hdd_connect_result(struct net_device *dev, const u8 *bssid, size_t resp_ie_len, u16 status, gfp_t gfp, bool connect_timeout) { + hdd_adapter_t *padapter = (hdd_adapter_t *) netdev_priv(dev); + cfg80211_connect_result(dev, bssid, req_ie, req_ie_len, resp_ie, resp_ie_len, status, gfp); + qdf_runtime_pm_allow_suspend(padapter->connect_rpm_ctx.connect); } #endif diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 2e625006e12c..207fbe78554c 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2051,6 +2051,48 @@ int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, return ret; } +/** + * hdd_stop_dhcp_ind() - API to stop DHCP sequence + * @adapter: Adapter on which DHCP needs to be stopped + * + * Release the wakelock held for DHCP process and allow + * the runtime pm to continue + * + * Return: None + */ +static void hdd_stop_dhcp_ind(hdd_adapter_t *adapter) +{ + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + hdd_warn("DHCP stop indicated through power save"); + sme_dhcp_stop_ind(hdd_ctx->hHal, adapter->device_mode, + adapter->macAddressCurrent.bytes, + adapter->sessionId); + hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DHCP); + qdf_runtime_pm_allow_suspend(adapter->connect_rpm_ctx.connect); +} + +/** + * hdd_start_dhcp_ind() - API to start DHCP sequence + * @adapter: Adapter on which DHCP needs to be stopped + * + * Prevent APPS suspend and the runtime suspend during + * DHCP sequence + * + * Return: None + */ +static void hdd_start_dhcp_ind(hdd_adapter_t *adapter) +{ + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + hdd_err("DHCP start indicated through power save"); + qdf_runtime_pm_prevent_suspend(adapter->connect_rpm_ctx.connect); + hdd_prevent_suspend_timeout(1000, WIFI_POWER_EVENT_WAKELOCK_DHCP); + sme_dhcp_start_ind(hdd_ctx->hHal, adapter->device_mode, + adapter->macAddressCurrent.bytes, + adapter->sessionId); +} + /** * __wlan_hdd_cfg80211_set_power_mgmt() - set cfg80211 power management config * @wiphy: Pointer to wiphy @@ -2117,20 +2159,8 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy, status = wlan_hdd_set_powersave(pAdapter, allow_power_save, timeout); - if (allow_power_save) { - hdd_warn("DHCP stop indicated through power save"); - sme_dhcp_stop_ind(pHddCtx->hHal, pAdapter->device_mode, - pAdapter->macAddressCurrent.bytes, - pAdapter->sessionId); - hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DHCP); - } else { - hdd_err("DHCP start indicated through power save"); - hdd_prevent_suspend_timeout(1000, - WIFI_POWER_EVENT_WAKELOCK_DHCP); - sme_dhcp_start_ind(pHddCtx->hHal, pAdapter->device_mode, - pAdapter->macAddressCurrent.bytes, - pAdapter->sessionId); - } + allow_power_save ? hdd_stop_dhcp_ind(pAdapter) : + hdd_start_dhcp_ind(pAdapter); EXIT(); return status; From 8634b7772ebb41f07a5d454681c4180ac88430af Mon Sep 17 00:00:00 2001 From: Komal Seelam Date: Thu, 29 Sep 2016 12:12:24 +0530 Subject: [PATCH 054/179] qcacld-3.0: Disable Runtime PM when scan in progress scan request and responses are async. So prevent runtime pm till scan is completed. Change-Id: I48dc835c0720213e2bc6e69f4dc5dd9eb084dd4a CRs-Fixed: 1072520 --- core/hdd/inc/wlan_hdd_main.h | 12 +++++++++++- core/hdd/src/wlan_hdd_main.c | 31 +++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_scan.c | 3 +++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index b524f5385c16..2f83159d779a 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -854,6 +854,16 @@ struct hdd_chan_change_params { struct ch_params_s chan_params; }; +/** + * struct hdd_runtime_pm_context - context to prevent/allow runtime pm + * @scan: scan context to prvent/allow runtime pm + * + * Prevent Runtime PM for scan + */ +struct hdd_runtime_pm_context { + qdf_runtime_lock_t scan; +}; + /** * struct hdd_connect_pm_context - Runtime PM connect context per adapter * @connect: Runtime Connect Context @@ -1537,9 +1547,9 @@ struct hdd_context_s { bool update_mac_addr_to_fw; struct acs_dfs_policy acs_policy; uint16_t wmi_max_len; - /* counters for failed suspend reasons */ uint32_t suspend_fail_stats[SUSPEND_FAIL_MAX_COUNT]; + struct hdd_runtime_pm_context runtime_context; }; /*--------------------------------------------------------------------------- diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a287ac4f3fcf..99ecaa22814c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2452,6 +2452,33 @@ void hdd_set_station_ops(struct net_device *pWlanDev) } #ifdef FEATURE_RUNTIME_PM +/** + * hdd_runtime_suspend_context_init() - API to initialize HDD Runtime Contexts + * @hdd_ctx: HDD context + * + * Return: None + */ +static void hdd_runtime_suspend_context_init(hdd_context_t *hdd_ctx) +{ + struct hdd_runtime_pm_context *ctx = &hdd_ctx->runtime_context; + + ctx->scan = qdf_runtime_lock_init("scan"); +} + +/** + * hdd_runtime_suspend_context_deinit() - API to deinit HDD runtime context + * @hdd_ctx: HDD Context + * + * Return: None + */ +static void hdd_runtime_suspend_context_deinit(hdd_context_t *hdd_ctx) +{ + struct hdd_runtime_pm_context *ctx = &hdd_ctx->runtime_context; + + qdf_runtime_lock_deinit(ctx->scan); + ctx->scan = NULL; +} + static void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter) { struct hdd_connect_pm_context *ctx = &adapter->connect_rpm_ctx; @@ -2467,6 +2494,8 @@ static void hdd_adapter_runtime_suspend_denit(hdd_adapter_t *adapter) ctx->connect = NULL; } #else /* FEATURE_RUNTIME_PM */ +static void hdd_runtime_suspend_context_init(hdd_context_t *hdd_ctx) {} +static void hdd_runtime_suspend_context_deinit(hdd_context_t *hdd_ctx) {} static inline void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter) {} static inline void hdd_adapter_runtime_suspend_denit(hdd_adapter_t *adapter) {} #endif /* FEATURE_RUNTIME_PM */ @@ -4842,6 +4871,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) hdd_green_ap_deinit(hdd_ctx); + hdd_runtime_suspend_context_deinit(hdd_ctx); hdd_close_all_adapters(hdd_ctx, false); hdd_ipa_cleanup(hdd_ctx); @@ -8031,6 +8061,7 @@ int hdd_wlan_startup(struct device *dev) if (QDF_IS_STATUS_ERROR(status)) goto err_debugfs_exit; + hdd_runtime_suspend_context_init(hdd_ctx); memdump_init(); hdd_driver_memdump_init(); diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 7dbe6ecc1182..441ba7ccc18f 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1242,6 +1242,7 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle, hdd_vendor_scan_callback(pAdapter, req, aborted); allow_suspend: + qdf_runtime_pm_allow_suspend(hddctx->runtime_context.scan); qdf_spin_lock(&hddctx->hdd_scan_req_q_lock); size = qdf_list_size(&hddctx->hdd_scan_req_q); if (!size) { @@ -1732,6 +1733,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, if (request->flags & NL80211_SCAN_FLAG_FLUSH) sme_scan_flush_result(WLAN_HDD_GET_HAL_CTX(pAdapter)); #endif + qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.scan); status = sme_scan_request(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, &scan_req, &hdd_cfg80211_scan_done_callback, dev); @@ -1745,6 +1747,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy, status = -EIO; } + qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.scan); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN); goto free_mem; } From aa75f26bff3877c8d4d707b92948e6c4bf021368 Mon Sep 17 00:00:00 2001 From: Komal Seelam Date: Thu, 29 Sep 2016 12:32:13 +0530 Subject: [PATCH 055/179] qcacld-3.0: Disable Runtime PM when ROC in progress During ROC, runtime pm needs to be disabled to allow FW send the packets to host. Change-Id: Ib51321f105b5a57df2d67c0ff1502dc4c051a5da CRs-Fixed: 1072520 --- core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_main.c | 3 +++ core/hdd/src/wlan_hdd_p2p.c | 14 +++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 2f83159d779a..eccc4de357b3 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -862,6 +862,7 @@ struct hdd_chan_change_params { */ struct hdd_runtime_pm_context { qdf_runtime_lock_t scan; + qdf_runtime_lock_t roc; }; /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 99ecaa22814c..a35ea1832bbe 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2463,6 +2463,7 @@ static void hdd_runtime_suspend_context_init(hdd_context_t *hdd_ctx) struct hdd_runtime_pm_context *ctx = &hdd_ctx->runtime_context; ctx->scan = qdf_runtime_lock_init("scan"); + ctx->roc = qdf_runtime_lock_init("roc"); } /** @@ -2477,6 +2478,8 @@ static void hdd_runtime_suspend_context_deinit(hdd_context_t *hdd_ctx) qdf_runtime_lock_deinit(ctx->scan); ctx->scan = NULL; + qdf_runtime_lock_deinit(ctx->roc); + ctx->roc = NULL; } static void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 1587d02fbb46..967cbc1638d3 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -193,6 +193,7 @@ QDF_STATUS wlan_hdd_remain_on_channel_callback(tHalHandle hHal, void *pCtx, * roc requests are immediately processed without being queued */ pAdapter->is_roc_inprogress = false; + qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc); /* * If the allow suspend is done later, the scheduled roc wil prevent * the system from going into suspend and immediately this logic @@ -266,6 +267,7 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) { hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter); hdd_remain_on_chan_ctx_t *pRemainChanCtx; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); unsigned long rc; mutex_lock(&cfgState->remain_on_chan_ctx_lock); @@ -340,6 +342,7 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter) if (!rc) { hdd_err("timeout waiting for cancel remain on channel ready indication"); } + qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); } else mutex_unlock(&cfgState->remain_on_chan_ctx_lock); @@ -468,6 +471,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data) hdd_adapter_t *pAdapter = (hdd_adapter_t *) data; hdd_remain_on_chan_ctx_t *pRemainChanCtx; hdd_cfg80211_state_t *cfgState; + hdd_context_t *hdd_ctx; if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { @@ -475,6 +479,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data) return; } + hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter); mutex_lock(&cfgState->remain_on_chan_ctx_lock); pRemainChanCtx = cfgState->remain_on_chan_ctx; @@ -510,8 +515,8 @@ static void wlan_hdd_remain_on_chan_timeout(void *data) pRemainChanCtx->scan_id); } + qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); - } static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, @@ -571,6 +576,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, duration = P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT * duration; hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); + qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.roc); INIT_COMPLETION(pAdapter->rem_on_chan_ready_event); /* call sme API to start remain on channel. */ @@ -598,6 +604,8 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, qdf_mc_timer_destroy( &pRemainChanCtx->hdd_remain_on_chan_timer); qdf_mem_free(pRemainChanCtx); + qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context. + roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); return -EINVAL; } @@ -629,6 +637,8 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, qdf_mc_timer_destroy( &pRemainChanCtx->hdd_remain_on_chan_timer); qdf_mem_free(pRemainChanCtx); + qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context. + roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); return -EINVAL; } @@ -641,6 +651,8 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, wlansap_cancel_remain_on_channel( WLAN_HDD_GET_SAP_CTX_PTR(pAdapter), pRemainChanCtx->scan_id); + qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context. + roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); return -EINVAL; } From 81cb16678fbc0b5943053e0dbbe8623e202f3fca Mon Sep 17 00:00:00 2001 From: Komal Seelam Date: Thu, 29 Sep 2016 12:39:08 +0530 Subject: [PATCH 056/179] qcacld-3.0: Disable Runtime PM when dfs channels are used During DFS scanning FW needs host access. Hence disable Runtime PM to ensure link is active. Change-Id: I307cec1c3e8451758bf2fa44a8dd43f257ab8780 CRs-Fixed: 1072520 --- core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_hostapd.c | 31 +++++++++++++++++-------------- core/hdd/src/wlan_hdd_main.c | 3 +++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index eccc4de357b3..e6d7cd9ee707 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -863,6 +863,7 @@ struct hdd_chan_change_params { struct hdd_runtime_pm_context { qdf_runtime_lock_t scan; qdf_runtime_lock_t roc; + qdf_runtime_lock_t dfs; }; /** diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index bf299934952b..3145b14a65e8 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -149,14 +149,16 @@ static void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, if (pHostapdState->bssState == BSS_STOP) return; + if (CHANNEL_STATE_DFS != cds_get_channel_state(channel)) + return; + /* Release wakelock when no more DFS channels are used */ - if (CHANNEL_STATE_DFS == cds_get_channel_state(channel)) { - if (atomic_dec_and_test(&pHddCtx->sap_dfs_ref_cnt)) { - hdd_err("DFS: allowing suspend (chan %d)", - channel); - qdf_wake_lock_release(&pHddCtx->sap_dfs_wakelock, - WIFI_POWER_EVENT_WAKELOCK_DFS); - } + if (atomic_dec_and_test(&pHddCtx->sap_dfs_ref_cnt)) { + hdd_err("DFS: allowing suspend (chan %d)", channel); + qdf_wake_lock_release(&pHddCtx->sap_dfs_wakelock, + WIFI_POWER_EVENT_WAKELOCK_DFS); + qdf_runtime_pm_allow_suspend(pHddCtx->runtime_context.dfs); + } } @@ -185,14 +187,15 @@ static void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter, (atomic_read(&pHddCtx->sap_dfs_ref_cnt) >= 1)) return; + if (CHANNEL_STATE_DFS != cds_get_channel_state(channel)) + return; + /* Acquire wakelock if we have at least one DFS channel in use */ - if (CHANNEL_STATE_DFS == cds_get_channel_state(channel)) { - if (atomic_inc_return(&pHddCtx->sap_dfs_ref_cnt) == 1) { - hdd_err("DFS: preventing suspend (chan %d)", - channel); - qdf_wake_lock_acquire(&pHddCtx->sap_dfs_wakelock, - WIFI_POWER_EVENT_WAKELOCK_DFS); - } + if (atomic_inc_return(&pHddCtx->sap_dfs_ref_cnt) == 1) { + hdd_err("DFS: preventing suspend (chan %d)", channel); + qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.dfs); + qdf_wake_lock_acquire(&pHddCtx->sap_dfs_wakelock, + WIFI_POWER_EVENT_WAKELOCK_DFS); } } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a35ea1832bbe..d480dab1f386 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2464,6 +2464,7 @@ static void hdd_runtime_suspend_context_init(hdd_context_t *hdd_ctx) ctx->scan = qdf_runtime_lock_init("scan"); ctx->roc = qdf_runtime_lock_init("roc"); + ctx->dfs = qdf_runtime_lock_init("dfs"); } /** @@ -2480,6 +2481,8 @@ static void hdd_runtime_suspend_context_deinit(hdd_context_t *hdd_ctx) ctx->scan = NULL; qdf_runtime_lock_deinit(ctx->roc); ctx->roc = NULL; + qdf_runtime_lock_deinit(ctx->dfs); + ctx->dfs = NULL; } static void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter) From 355b1474f985cae3c84d6d152ebd0064d897009a Mon Sep 17 00:00:00 2001 From: Komal Seelam Date: Fri, 2 Sep 2016 14:36:21 +0530 Subject: [PATCH 057/179] qcacld-3.0: Use PLD API to query MAC Address from Platform Driver Move CNSS API to PLD API to query WLAN MAC Address from Platform Driver Change-Id: I97724711cdf08824e0a46398284e40b798b4553d CRs-Fixed: 1063837 --- core/hdd/src/wlan_hdd_main.c | 10 +--------- core/pld/inc/pld_common.h | 1 + core/pld/src/pld_common.c | 30 ++++++++++++++++++++++++++++++ core/pld/src/pld_pcie.c | 1 - core/pld/src/pld_pcie.h | 15 ++++++++++++++- core/pld/src/pld_sdio.c | 1 - core/pld/src/pld_sdio.h | 11 +++++++++++ 7 files changed, 57 insertions(+), 12 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d480dab1f386..15d27321fe8c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7169,7 +7169,6 @@ QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void) } #endif -#ifdef CONFIG_CNSS /** * hdd_get_cnss_wlan_mac_buff() - API to query platform driver for MAC address * @dev: Device Pointer @@ -7179,15 +7178,8 @@ QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void) */ static uint8_t *hdd_get_cnss_wlan_mac_buff(struct device *dev, uint32_t *num) { - return cnss_common_get_wlan_mac_address(dev, num); + return pld_common_get_wlan_mac_address(dev, num); } -#else -static uint8_t *hdd_get_cnss_wlan_mac_buff(struct device *dev, uint32_t *num) -{ - *num = 0; - return NULL; -} -#endif /** * hdd_populate_random_mac_addr() - API to populate random mac addresses diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index bcf647b0b1a4..5d24f7949753 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -379,4 +379,5 @@ void *pld_smmu_get_mapping(struct device *dev); int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); unsigned int pld_socinfo_get_serial_number(struct device *dev); +uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num); #endif diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 737cc389c600..023e58324557 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1544,3 +1544,33 @@ unsigned int pld_socinfo_get_serial_number(struct device *dev) return ret; } + +/* + * pld_common_get_wlan_mac_address() - API to query MAC address from Platform + * Driver + * @dev: Device Structure + * @num: Pointer to number of MAC address supported + * + * Platform Driver can have MAC address stored. This API needs to be used + * to get those MAC address + * + * Return: Pointer to the list of MAC address + */ +uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num) +{ + switch (pld_get_bus_type(dev)) { + case PLD_BUS_TYPE_PCIE: + return pld_pcie_get_wlan_mac_address(dev, num); + case PLD_BUS_TYPE_SDIO: + return pld_sdio_get_wlan_mac_address(dev, num); + case PLD_BUS_TYPE_USB: + case PLD_BUS_TYPE_SNOC: + break; + default: + pr_err("Invalid device type\n"); + break; + } + + *num = 0; + return NULL; +} diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c index 54ff2e5cbec5..f95498154795 100644 --- a/core/pld/src/pld_pcie.c +++ b/core/pld/src/pld_pcie.c @@ -530,5 +530,4 @@ void pld_pcie_set_driver_status(enum pld_driver_status status) cnss_set_driver_status(cnss_status); } #endif - #endif diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index e94c9f69ddcd..dfba7b4d2fe6 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -220,12 +220,20 @@ static inline int pld_pcie_power_off(struct device *dev) { return 0; } + +static inline uint8_t *pld_pcie_get_wlan_mac_address(struct device *dev, + uint32_t *num) +{ + *num = 0; + return NULL; +} #else int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files, u32 target_type, u32 target_version); int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg); int pld_pcie_get_platform_cap(struct pld_platform_cap *cap); void pld_pcie_set_driver_status(enum pld_driver_status status); + static inline void pld_pcie_link_down(void) { cnss_wlan_pci_link_down(); @@ -304,6 +312,11 @@ static inline int pld_pcie_power_off(struct device *dev) { return cnss_power_down(dev); } -#endif +static inline uint8_t *pld_pcie_get_wlan_mac_address(struct device *dev, + uint32_t *num) +{ + return cnss_common_get_wlan_mac_address(dev, num); +} +#endif #endif diff --git a/core/pld/src/pld_sdio.c b/core/pld/src/pld_sdio.c index 8bd37115fcb1..14b17f989b26 100644 --- a/core/pld/src/pld_sdio.c +++ b/core/pld/src/pld_sdio.c @@ -380,6 +380,5 @@ int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files, return 0; } - #endif #endif diff --git a/core/pld/src/pld_sdio.h b/core/pld/src/pld_sdio.h index 619b3134b740..0f6786256dff 100644 --- a/core/pld/src/pld_sdio.h +++ b/core/pld/src/pld_sdio.h @@ -65,11 +65,22 @@ int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files, { return 0; } +static inline uint8_t *pld_sdio_get_wlan_mac_address(struct device *dev, + uint32_t *num) +{ + *num = 0; + return NULL; +} #else int pld_sdio_register_driver(void); void pld_sdio_unregister_driver(void); int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files, u32 target_type, u32 target_version); +static inline uint8_t *pld_sdio_get_wlan_mac_address(struct device *dev, + uint32_t *num) +{ + return cnss_common_get_wlan_mac_address(dev, num); +} #endif #endif From 5341d49f2574f32b47df99253da789bef0c1910c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 13 Oct 2016 23:46:32 -0700 Subject: [PATCH 058/179] Release 5.1.0.31D Release 5.1.0.31D Change-Id: Id038c52e956bade902de41fe64ba1e35f753f791 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c7154623dd6d..1ec8ee4d7a2c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "C" +#define QWLAN_VERSION_EXTRA "D" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31C" +#define QWLAN_VERSIONSTR "5.1.0.31D" #endif /* QWLAN_VERSION_H */ From 970a6336ee2996715e606fbfd6970802eecd68d0 Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Fri, 7 Oct 2016 18:09:32 -0700 Subject: [PATCH 059/179] qcacld-3.0: Fix HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE handler Currently we are queuing the message into rx thread for processing even if the RX thread is not enabled. Solution: Donot queue the message into Rx thread. Call the callback function directly (registered during ol_txrx_ipa_uc_register_op_cb) Change-Id: Iae45c059006592293ea61d04be89b1477daae514 CRs-Fixed: 1075151 --- core/dp/txrx/ol_txrx.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 8f1a565cba35..6562a310d314 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -4144,7 +4144,6 @@ void ol_txrx_ipa_uc_fw_op_event_handler(void *context, } } -#ifdef QCA_CONFIG_SMP /** * ol_txrx_ipa_uc_op_response() - Handle OP command response from firmware * @pdev: handle to the HTT instance @@ -4152,28 +4151,6 @@ void ol_txrx_ipa_uc_fw_op_event_handler(void *context, * * Return: none */ -void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg) -{ - p_cds_sched_context sched_ctx = get_cds_sched_ctxt(); - struct cds_ol_rx_pkt *pkt; - - if (qdf_unlikely(!sched_ctx)) - return; - - pkt = cds_alloc_ol_rx_pkt(sched_ctx); - if (qdf_unlikely(!pkt)) { - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - "%s: Not able to allocate context", __func__); - return; - } - - pkt->callback = (cds_ol_rx_thread_cb) ol_txrx_ipa_uc_fw_op_event_handler; - pkt->context = pdev; - pkt->Rxpkt = (void *)op_msg; - pkt->staId = 0; - cds_indicate_rxpkt(sched_ctx, pkt); -} -#else void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg) { @@ -4186,7 +4163,6 @@ void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, return; } } -#endif /** * ol_txrx_ipa_uc_register_op_cb() - Register OP handler function From fed835703b7a65b7daeb45eb681b506572c936aa Mon Sep 17 00:00:00 2001 From: Ravi Joshi Date: Fri, 7 Oct 2016 16:20:37 -0700 Subject: [PATCH 060/179] qcacld-3.0: Fix throughput regression in 5G TCP DL due to tcp delack Incorrect integration of a change caused tcp delayed ack not to trigger resulting in overall lower throughput. Change-Id: I3a35a70515e4e61a4c81f14f8881e989ac5ac039 CRs-Fixed: 1075723 --- core/hdd/src/wlan_hdd_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 15d27321fe8c..b0fc02c6397a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5305,10 +5305,11 @@ static void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, temp_rx = (rx_packets + hdd_ctx->prev_rx) / 2; hdd_ctx->prev_rx = rx_packets; - if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh && - (hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH && - ++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) { - next_rx_level = WLAN_SVC_TP_HIGH; + if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh) { + if ((hdd_ctx->cur_rx_level != WLAN_SVC_TP_HIGH) && + (++hdd_ctx->rx_high_ind_cnt == delack_timer_cnt)) { + next_rx_level = WLAN_SVC_TP_HIGH; + } } else { next_rx_level = WLAN_SVC_TP_LOW; hdd_ctx->rx_high_ind_cnt = 0; From b62b564728e6e457cbcf3a46a526a4b023fba164 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 14 Oct 2016 00:33:21 -0700 Subject: [PATCH 061/179] Release 5.1.0.31E Release 5.1.0.31E Change-Id: I75b2ff2e3c87f9b37eb49e6dfb4ded06a6205fa7 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 1ec8ee4d7a2c..4956b6105695 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "D" +#define QWLAN_VERSION_EXTRA "E" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31D" +#define QWLAN_VERSIONSTR "5.1.0.31E" #endif /* QWLAN_VERSION_H */ From 0a151cbb2e486bc3eec039d45ce6fe600803243c Mon Sep 17 00:00:00 2001 From: Deepthi Gowri Date: Thu, 13 Oct 2016 14:31:41 +0530 Subject: [PATCH 062/179] qcacld-3.0: Protect the ROC ctx with mutex during mgmt TX qcacld-2.0 to qcacld-3.0 propagation Protect access of remain_on_chan_ctx in __wlan_hdd_mgmt_tx under remain_on_chan_ctx_lock mutex. CRs-Fixed: 1054846 Change-Id: Ia96d1ea901bcbe95b5ecf608d63ba6a544a1465c --- core/hdd/src/wlan_hdd_p2p.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 967cbc1638d3..490e3665b59d 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1449,14 +1449,17 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, } else mutex_unlock(&cfgState->remain_on_chan_ctx_lock); + mutex_lock(&cfgState->remain_on_chan_ctx_lock); if ((cfgState->remain_on_chan_ctx != NULL) && (cfgState->current_freq == chan->center_freq) ) { + mutex_unlock(&cfgState->remain_on_chan_ctx_lock); hdd_notice("action frame: extending the wait time"); extendedWait = (uint16_t) wait; goto send_frame; } + mutex_unlock(&cfgState->remain_on_chan_ctx_lock); INIT_COMPLETION(pAdapter->offchannel_tx_event); status = wlan_hdd_request_remain_on_channel(wiphy, dev, chan, From 973890eeb99d1c70667d487c1e1053c83be50749 Mon Sep 17 00:00:00 2001 From: Deepthi Gowri Date: Wed, 12 Oct 2016 15:44:54 +0530 Subject: [PATCH 063/179] qcacld-3.0: Fix for crash caused by buffer overflow qcacld-2.0 to qcacld-3.0 propagation In sme_update_dsc_pto_up_mapping() function, we try to write into the array dscpmapping in 255th location, if the location index happens to be 255. But the size of dscpmapping array is 64 only which is causing out of boundary access resulting in crash. To address this, avoid writing in out of boundary. If the DSCP range is 255, there is no mapping for such priority, so there is no need assign anything for dscpmapping. CRs-Fixed: 1027457 Change-Id: Ic4299122b10a990d17816f864ef8415c1b75b230 --- core/sme/src/common/sme_api.c | 1 - 1 file changed, 1 deletion(-) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index e722c29895d1..8795191b7c43 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -13236,7 +13236,6 @@ QDF_STATUS sme_update_dsc_pto_up_mapping(tHalHandle hHal, if ((pSession->QosMapSet.dscp_range[i][0] == 255) && (pSession->QosMapSet.dscp_range[i][1] == 255)) { - dscpmapping[j] = 0; QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, FL("User Priority %d isn't used"), i); From ccfd918e7b48a952ec336b22fab2f2c5a3a4e4d5 Mon Sep 17 00:00:00 2001 From: Deepthi Gowri Date: Wed, 12 Oct 2016 16:00:49 +0530 Subject: [PATCH 064/179] qcacld-3.0: Set the Extcap present flag if Ext-caps element is present qcacld-2.0 to qcacld-3.0 propagation Currently the Extcap present flag is not set even if the extended capabilities are present in the assoc response, assoc req or reassoc req frames. To address this, set the extcap present flag in assoc response, assoc request or reassoc req Extcab structure. CRs-Fixed: 1073033 Change-Id: I84ffb04105af0c84d33e524814795dd30a5d62a5 --- .../src/sys/legacy/src/utils/src/parser_api.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 4cfb1fff3c6f..eea1199143ba 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -2789,9 +2789,8 @@ sir_convert_assoc_req_frame2_struct(tpAniSirGlobal pMac, } if (ar->ExtCap.present) { struct s_ext_cap *ext_cap; - qdf_mem_copy(&pAssocReq->ExtCap.bytes, &ar->ExtCap.bytes, - ar->ExtCap.num_bytes); - + qdf_mem_copy(&pAssocReq->ExtCap, &ar->ExtCap, + sizeof(tDot11fIEExtCap)); ext_cap = (struct s_ext_cap *)&pAssocReq->ExtCap.bytes; lim_log(pMac, LOG1, FL("timingMeas: %d, finetimingMeas Init: %d, Resp: %d"), @@ -2995,9 +2994,8 @@ sir_convert_assoc_resp_frame2_struct(tpAniSirGlobal pMac, if (ar.ExtCap.present) { struct s_ext_cap *ext_cap; - qdf_mem_copy(&pAssocRsp->ExtCap.bytes, &ar.ExtCap.bytes, - ar.ExtCap.num_bytes); - + qdf_mem_copy(&pAssocRsp->ExtCap, &ar.ExtCap, + sizeof(tDot11fIEExtCap)); ext_cap = (struct s_ext_cap *)&pAssocRsp->ExtCap.bytes; lim_log(pMac, LOG1, FL("timingMeas: %d, finetimingMeas Init: %d, Resp: %d"), @@ -3207,9 +3205,8 @@ sir_convert_reassoc_req_frame2_struct(tpAniSirGlobal pMac, } if (ar.ExtCap.present) { struct s_ext_cap *ext_cap; - qdf_mem_copy(&pAssocReq->ExtCap.bytes, &ar.ExtCap.bytes, - ar.ExtCap.num_bytes); - + qdf_mem_copy(&pAssocReq->ExtCap, &ar.ExtCap, + sizeof(tDot11fIEExtCap)); ext_cap = (struct s_ext_cap *)&pAssocReq->ExtCap.bytes; lim_log(pMac, LOG1, FL("timingMeas: %d, finetimingMeas Init: %d, Resp: %d"), @@ -3769,7 +3766,6 @@ sir_parse_beacon_ie(tpAniSirGlobal pMac, sizeof(tDot11fIEVHTOperation)); } if (pBies->ExtCap.present) { - pBeaconStruct->ext_cap.present = 1; qdf_mem_copy(&pBeaconStruct->ext_cap, &pBies->ExtCap, sizeof(tDot11fIEExtCap)); } From a3cd10b925e4c7e1c1aaf04c0d23e00a2992c57e Mon Sep 17 00:00:00 2001 From: Mahesh A Saptasagar Date: Thu, 21 Jul 2016 18:21:58 +0530 Subject: [PATCH 065/179] qcacld-3.0: Fix for PNO scan for 802.11A configured AP qcacld-2.0 to qcacld-3.0 propagation If Probe Responce received in PNO indication does not contain DSParam IE or HT Info IE then add dummy channel to the received BSS info so that Scan result received as a part of PNO is updated to the supplicant. Change-Id: I25ac973cc90fc9f5258ff8f012c90dd9e9394eb0 CRs-Fixed: 629288 --- core/sme/src/csr/csr_api_scan.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index a0f7a7efdc96..7ec0a0833f0e 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -7005,9 +7005,20 @@ QDF_STATUS csr_scan_save_preferred_network_found(tpAniSirGlobal pMac, pBssDescr->channelId = parsed_frm->channelNumber; else if (parsed_frm->HTInfo.present) pBssDescr->channelId = parsed_frm->HTInfo.primaryChannel; - else - pBssDescr->channelId = parsed_frm->channelNumber; - + else { + /* + * If Probe Responce received in PNO indication does not + * contain DSParam IE or HT Info IE then add dummy channel + * to the received BSS info so that Scan result received as + * a part of PNO is updated to the supplicant. Specially + * applicable in case of AP configured in 11A only mode. + */ + if ((pMac->roam.configParam.bandCapability == eCSR_BAND_ALL) || + (pMac->roam.configParam.bandCapability == eCSR_BAND_24)) + pBssDescr->channelId = 1; + else if (pMac->roam.configParam.bandCapability == eCSR_BAND_5G) + pBssDescr->channelId = 36; + } if ((pBssDescr->channelId > 0) && (pBssDescr->channelId < 15)) { int i; /* 11b or 11g packet */ From a9e08e99072ee69d3b1e02cc8dd90a070228f64d Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Wed, 12 Oct 2016 16:44:23 +0530 Subject: [PATCH 066/179] qcacld-3.0: Fix misleading comments qcacld-2.0 to qcacld-3.0 propagation Currently comments for enum HDD_WMM_USER_MODE_NO_QOS are misleading. It does not clearly say that uapsd is disabled when wmm mode is HDD_WMM_USER_MODE_NO_QOS. Fix this by adding appropriate comments. Change-Id: I6696c92f0a67b18c3ada6736f37ef498a68c881e CRs-Fixed: 1074503 --- core/hdd/inc/wlan_hdd_wmm.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_wmm.h b/core/hdd/inc/wlan_hdd_wmm.h index 3194d10bb8ac..3944386cfe66 100644 --- a/core/hdd/inc/wlan_hdd_wmm.h +++ b/core/hdd/inc/wlan_hdd_wmm.h @@ -89,10 +89,7 @@ typedef enum hdd_wmm_classification { * with QAP and acts accordingly * @HDD_WMM_USER_MODE_QBSS_ONLY - SME will add the extra logic to make sure * STA associates with a QAP only - * @HDD_WMM_USER_MODE_NO_QOS - SME will not join a QoS AP, unless the phy - * mode setting says "Auto". In that case, STA is free to join 11n AP. - * Although from HDD point of view, it will not be doing any packet - * classifications. + * @HDD_WMM_USER_MODE_NO_QOS - Join any AP, but uapsd is disabled */ typedef enum hdd_wmm_user_mode { HDD_WMM_USER_MODE_AUTO = 0, From 983107dafb6452c74221c7434d6d53aedd9a236d Mon Sep 17 00:00:00 2001 From: Pradeep Reddy POTTETI Date: Fri, 30 Sep 2016 15:03:41 +0530 Subject: [PATCH 067/179] qcacld-3.0: Send TDLS Teardown with proper AC This is qcacld-2.0 to qcacld-3.0 propagation. Transmit TDLS Teardown frame with VI AC on direct link if tdls peer supports qos. CRs-Fixed: 885035 Change-Id: I02cfd29ea1619b12b2ccb130aa7374e19b4f8491 --- core/mac/src/pe/lim/lim_process_tdls.c | 35 +++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index b2e15757fba5..7b2e5cae97a3 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -252,6 +252,9 @@ static uint32_t lim_prepare_tdls_frame_header(tpAniSirGlobal pMac, uint8_t *pFra ? link_iden->RespStaAddr : link_iden->InitStaAddr; uint8_t *staMac = (reqType == TDLS_INITIATOR) ? link_iden->InitStaAddr : link_iden->RespStaAddr; + tpDphHashNode sta_ds; + uint16_t aid = 0; + uint8_t qos_mode = 0; pMacHdr = (tpSirMacDataHdr3a) (pFrame); @@ -268,9 +271,17 @@ static uint32_t lim_prepare_tdls_frame_header(tpAniSirGlobal pMac, uint8_t *pFra */ pMacHdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION; pMacHdr->fc.type = SIR_MAC_DATA_FRAME; + + sta_ds = dph_lookup_hash_entry(pMac, peerMac, &aid, + &psessionEntry->dph.dphHashTable); + if (sta_ds) + qos_mode = sta_ds->qosMode; + pMacHdr->fc.subType = - IS_QOS_ENABLED(psessionEntry) ? SIR_MAC_DATA_QOS_DATA : - SIR_MAC_DATA_DATA; + ((IS_QOS_ENABLED(psessionEntry) && + (tdlsLinkType == TDLS_LINK_AP)) || + ((tdlsLinkType == TDLS_LINK_DIRECT) && qos_mode)) + ? SIR_MAC_DATA_QOS_DATA : SIR_MAC_DATA_DATA; /* * TL is not setting up below fields, so we are doing it here @@ -298,7 +309,7 @@ static uint32_t lim_prepare_tdls_frame_header(tpAniSirGlobal pMac, uint8_t *pFra MAC_ADDR_ARRAY(pMacHdr->addr2), MAC_ADDR_ARRAY(pMacHdr->addr3)); - if (IS_QOS_ENABLED(psessionEntry)) { + if (pMacHdr->fc.subType == SIR_MAC_DATA_QOS_DATA) { pMacHdr->qosControl.tid = tid; header_offset += sizeof(tSirMacDataHdr3a); } else @@ -1274,6 +1285,10 @@ tSirRetStatus lim_send_tdls_teardown_frame(tpAniSirGlobal pMac, uint32_t padLen = 0; #endif uint8_t smeSessionId = 0; + tpDphHashNode sta_ds; + uint16_t aid = 0; + uint8_t qos_mode = 0; + uint8_t tdls_link_type; if (NULL == psessionEntry) { lim_log(pMac, LOGE, FL("psessionEntry is NULL")); @@ -1320,8 +1335,15 @@ tSirRetStatus lim_send_tdls_teardown_frame(tpAniSirGlobal pMac, * 89-0d. * 8 bytes of RFC 1042 header */ - - nBytes = nPayload + ((IS_QOS_ENABLED(psessionEntry)) + sta_ds = dph_lookup_hash_entry(pMac, psessionEntry->bssId, &aid, + &psessionEntry->dph.dphHashTable); + if (sta_ds) + qos_mode = sta_ds->qosMode; + tdls_link_type = (reason == eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE) + ? TDLS_LINK_AP : TDLS_LINK_DIRECT; + nBytes = nPayload + (((IS_QOS_ENABLED(psessionEntry) && + (tdls_link_type == TDLS_LINK_AP)) || + ((tdls_link_type == TDLS_LINK_DIRECT) && qos_mode)) ? sizeof(tSirMacDataHdr3a) : sizeof(tSirMacMgmtHdr)) + sizeof(eth_890d_header) @@ -2461,7 +2483,8 @@ static void lim_tdls_update_hash_node_info(tpAniSirGlobal pMac, pSessStaDs = dph_lookup_hash_entry(pMac, psessionEntry->bssId, &aid, &psessionEntry->dph.dphHashTable); /* Lets enable QOS parameter */ - pStaDs->qosMode = 1; + pStaDs->qosMode = (pTdlsAddStaReq->capability & CAPABILITIES_QOS_OFFSET) + || pTdlsAddStaReq->htcap_present; pStaDs->wmeEnabled = 1; pStaDs->lleEnabled = 0; /* TDLS Dummy AddSTA does not have qosInfo , is it OK ?? From 88813478a1014b978edbbf5eb82feb55af9a4b99 Mon Sep 17 00:00:00 2001 From: Agrawal Ashish Date: Mon, 10 Oct 2016 13:01:09 +0530 Subject: [PATCH 068/179] qcacld-3.0: Remove redundant code for wma_set_cts2self_for_p2p_go SME is calling wma_set_cts2self_for_p2p_go directly. No need to post message to MC Thread. Change-Id: I335b1c8a6289560dbe6c0a3ccce60695922ff3ed CRs-Fixed: 1075981 --- core/mac/src/include/sir_params.h | 1 - core/sme/src/common/sme_api.c | 5 ----- core/wma/inc/wma_types.h | 1 - core/wma/src/wma_main.c | 2 -- 4 files changed, 9 deletions(-) diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index b11343f2be9b..bff7c7b1bc6c 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -635,7 +635,6 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 362) #define SIR_HAL_SET_DTIM_PERIOD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 363) #define SIR_HAL_ENCRYPT_DECRYPT_MSG (SIR_HAL_ITC_MSG_TYPES_BEGIN + 364) -#define SIR_HAL_SET_CTS2SELF_FOR_STA (SIR_HAL_ITC_MSG_TYPES_BEGIN + 368) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 8795191b7c43..16b2adbb1013 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16838,7 +16838,6 @@ QDF_STATUS sme_encrypt_decrypt_msg_deregister_callback(tHalHandle h_hal) QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal_handle) { - cds_msg_t message; void *wma_handle; wma_handle = cds_get_context(QDF_MODULE_ID_WMA); @@ -16847,10 +16846,6 @@ QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal_handle) "wma_handle is NULL"); return QDF_STATUS_E_FAILURE; } - - message.bodyptr = NULL; - message.type = WMA_SET_CTS2SELF_FOR_STA; - if (QDF_STATUS_SUCCESS != wma_set_cts2self_for_p2p_go(wma_handle, true)) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 143bc5b53d9a..89f06c9db0b5 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -467,7 +467,6 @@ #define WMA_ADD_BCN_FILTER_CMDID SIR_HAL_ADD_BCN_FILTER_CMDID #define WMA_REMOVE_BCN_FILTER_CMDID SIR_HAL_REMOVE_BCN_FILTER_CMDID #define WMA_SET_ADAPT_DWELLTIME_CONF_PARAMS SIR_HAL_SET_ADAPT_DWELLTIME_PARAMS -#define WMA_SET_CTS2SELF_FOR_STA SIR_HAL_SET_CTS2SELF_FOR_STA #define WDA_BPF_GET_CAPABILITIES_REQ SIR_HAL_BPF_GET_CAPABILITIES_REQ #define WDA_BPF_SET_INSTRUCTIONS_REQ SIR_HAL_BPF_SET_INSTRUCTIONS_REQ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index bc2b52d0b308..5f8bc9500eb3 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -6639,8 +6639,6 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) case WDA_BPF_SET_INSTRUCTIONS_REQ: wma_set_bpf_instructions(wma_handle, msg->bodyptr); qdf_mem_free(msg->bodyptr); - case WMA_SET_CTS2SELF_FOR_STA: - wma_set_cts2self_for_p2p_go(wma_handle, true); break; case SIR_HAL_NDP_INITIATOR_REQ: wma_handle_ndp_initiator_req(wma_handle, msg->bodyptr); From b4823b570c356e48b231c45b832d371cb184d743 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Mon, 26 Sep 2016 15:18:07 +0530 Subject: [PATCH 069/179] qcacld-3.0: Fix compilation issues on disabling LFR3.0 roaming Fix various compilation issues coming when LFR3.0 is disabled by undefining WLAN_FEATURE_ROAM_OFFLOAD macro in Kbuild. Change-Id: Id483dc9fcc57d359f13b385dd655e34c1823a77f CRs-fixed: 1071087 --- core/hdd/inc/wlan_hdd_assoc.h | 5 +++++ core/hdd/src/wlan_hdd_ioctl.c | 6 ------ core/wma/inc/wma.h | 2 -- core/wma/inc/wma_types.h | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index bf87fcf37fb1..22022df74105 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -346,6 +346,11 @@ QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *adapter, uint8_t sta_id); #ifdef WLAN_FEATURE_ROAM_OFFLOAD void hdd_wma_send_fastreassoc_cmd(int session_id, const tSirMacAddr bssid, int channel); +#else +static inline void hdd_wma_send_fastreassoc_cmd(int sessionId, + const tSirMacAddr bssid, int channel) +{ +} #endif #endif diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 21a0117c1788..b85e5a39a6b2 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -870,12 +870,6 @@ void hdd_wma_send_fastreassoc_cmd(int sessionId, const tSirMacAddr bssid, hdd_err("Not able to post ROAM_INVOKE_CMD message to WMA"); } } -#else -void hdd_wma_send_fastreassoc_cmd(int sessionId, const tSirMacAddr bssid, - int channel) -{ -} - #endif /** diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 91857844c36c..13080fefa6af 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1576,7 +1576,6 @@ typedef struct { * the serialized MC thread context with a timer. */ qdf_mc_timer_t service_ready_ext_timer; -#ifdef WLAN_FEATURE_ROAM_OFFLOAD void (*csr_roam_synch_cb)(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, @@ -1584,7 +1583,6 @@ typedef struct { QDF_STATUS (*pe_roam_synch_cb)(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr); -#endif qdf_wake_lock_t wmi_cmd_rsp_wake_lock; qdf_runtime_lock_t wmi_cmd_rsp_runtime_lock; qdf_runtime_lock_t wma_runtime_resume_lock; diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 89f06c9db0b5..4e6309e63172 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -709,8 +709,8 @@ QDF_STATUS wma_register_mgmt_frm_client(void *p_cds_gctx, wma_mgmt_frame_rx_callback mgmt_rx_cb); QDF_STATUS wma_de_register_mgmt_frm_client(void *p_cds_gctx); -QDF_STATUS wma_register_roaming_callbacks(void *cds_ctx, #ifdef WLAN_FEATURE_ROAM_OFFLOAD +QDF_STATUS wma_register_roaming_callbacks(void *cds_ctx, void (*csr_roam_synch_cb)(tpAniSirGlobal mac, roam_offload_synch_ind *roam_synch_data, tpSirBssDescription bss_desc_ptr, From bf4943c25e02c905419c07b0c4e13751f3fe2cd7 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Thu, 13 Oct 2016 12:15:39 +0530 Subject: [PATCH 070/179] qcacld-3.0: Remove excessive logging related to stats qcacld-2.0 to qcacld-3.0 propagation Lot of stats related info logs are periodic and cause log spam. Add changes to remove excessive logs. CRs-Fixed: 1066273 Change-Id: I7064630c9ee4e01eafe0b5f00626aa6f20c0403d --- core/hdd/src/wlan_hdd_p2p.c | 4 +- core/hdd/src/wlan_hdd_stats.c | 7 +-- core/mac/src/pe/lim/lim_session.c | 2 +- core/sme/src/common/sme_api.c | 7 --- core/sme/src/csr/csr_api_scan.c | 9 ++-- core/wma/src/wma_utils.c | 71 ------------------------------- 6 files changed, 6 insertions(+), 94 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 490e3665b59d..729fcd676ade 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -802,13 +802,12 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy, int ret; int status = 0; - ENTER(); - hdd_notice("Device_mode %s(%d)", hdd_device_mode_to_string(pAdapter->device_mode), pAdapter->device_mode); hdd_info("chan(hw_val)0x%x chan(centerfreq) %d, duration %d", chan->hw_value, chan->center_freq, duration); + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); ret = wlan_hdd_validate_context(pHddCtx); if (0 != ret) @@ -894,7 +893,6 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy, hdd_debug("scheduling delayed work: no connection/roc active"); schedule_delayed_work(&pHddCtx->roc_req_work, 0); } - EXIT(); return 0; } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 662aa3a2f5b8..6a1fc5a57085 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1225,7 +1225,7 @@ __wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, hdd_station_ctx_t *hddstactx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); int status; - ENTER_DEV(dev); + /* ENTER() intentionally not used in a frequently invoked API */ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); @@ -1273,11 +1273,6 @@ __wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, LinkLayerStatsGetReq.staId = pAdapter->sessionId; - hdd_notice("LL_STATS_GET reqId = %d, staId = %d, paramIdMask = %d", - LinkLayerStatsGetReq.reqId, - LinkLayerStatsGetReq.staId, - LinkLayerStatsGetReq.paramIdMask); - context = &ll_stats_context; spin_lock(&context->context_lock); context->request_id = LinkLayerStatsGetReq.reqId; diff --git a/core/mac/src/pe/lim/lim_session.c b/core/mac/src/pe/lim/lim_session.c index efd2482129db..7498c075a6dd 100644 --- a/core/mac/src/pe/lim/lim_session.c +++ b/core/mac/src/pe/lim/lim_session.c @@ -353,7 +353,7 @@ pe_create_session(tpAniSirGlobal pMac, uint8_t *bssid, uint8_t *sessionId, QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, FL("Create a new PE session(%d), BSSID: "MAC_ADDRESS_STR" Max No. of STA %d"), - session_ptr->peSessionId, MAC_ADDR_ARRAY(bssid), numSta); + *sessionId, MAC_ADDR_ARRAY(bssid), numSta); if (eSIR_INFRA_AP_MODE == bssType || eSIR_IBSS_MODE == bssType) { session_ptr->pSchProbeRspTemplate = diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 16b2adbb1013..fa4be71a5902 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -14102,13 +14102,6 @@ QDF_STATUS sme_ll_stats_get_req(tHalHandle hHal, tSirLLStatsGetReq *pgetStatsReq cds_msg_t cds_message; tSirLLStatsGetReq *get_stats_req; - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, - "reqId = %u", pgetStatsReq->reqId); - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, - "staId = %u", pgetStatsReq->staId); - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, - "Stats Type = %u", pgetStatsReq->paramIdMask); - get_stats_req = qdf_mem_malloc(sizeof(*get_stats_req)); if (!get_stats_req) { diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 7ec0a0833f0e..0b1bfe38ef68 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -4883,10 +4883,6 @@ bool csr_scan_age_out_bss(tpAniSirGlobal pMac, tCsrScanResult *pResult) (uint32_t) qdf_mc_timer_get_system_ticks(); return fRet; } - sms_log(pMac, LOGW, - "Aging out BSS " MAC_ADDRESS_STR " Channel %d", - MAC_ADDR_ARRAY(pResult->Result.BssDescriptor.bssId), - pResult->Result.BssDescriptor.channelId); /* * No need to hold the spin lock because caller should hold the lock for * pMac->scan.scanResultList @@ -5957,8 +5953,9 @@ static void csr_purge_scan_result_by_age(void *pv) ageout_time) { bssId = result->Result.BssDescriptor.bssId; sms_log(mac_ctx, LOGW, - FL("age out due to time out"MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(bssId)); + FL("age out for BSSID" MAC_ADDRESS_STR" Channel %d"), + MAC_ADDR_ARRAY(bssId), + result->Result.BssDescriptor.channelId); csr_scan_age_out_bss(mac_ctx, result); } entry = tmp_entry; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 29d9efe3c68f..15b312902e8a 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -514,7 +514,6 @@ static int wma_unified_link_peer_stats_event_handler(void *handle, return -EINVAL; } - WMA_LOGD("%s: Posting Peer Stats event to HDD", __func__); param_tlvs = (WMI_PEER_LINK_STATS_EVENTID_param_tlvs *) cmd_param_info; if (!param_tlvs) { WMA_LOGA("%s: Invalid stats event", __func__); @@ -561,12 +560,6 @@ static int wma_unified_link_peer_stats_event_handler(void *handle, return -ENOMEM; } - WMA_LOGD("Peer stats from FW event buf"); - WMA_LOGD("Fixed Param:"); - WMA_LOGD("request_id %u num_peers %u peer_event_number %u more_data %u", - fixed_param->request_id, fixed_param->num_peers, - fixed_param->peer_event_number, fixed_param->more_data); - qdf_mem_zero(link_stats_results, link_stats_results_size); link_stats_results->paramId = WMI_LINK_STATS_ALL_PEER; @@ -586,25 +579,12 @@ static int wma_unified_link_peer_stats_event_handler(void *handle, next_peer_offset = WMI_TLV_HDR_SIZE; next_rate_offset = WMI_TLV_HDR_SIZE; for (rate_cnt = 0; rate_cnt < fixed_param->num_peers; rate_cnt++) { - WMA_LOGD("Peer Info:"); - WMA_LOGD("peer_type %u capabilities %u num_rates %u", - peer_stats->peer_type, peer_stats->capabilities, - peer_stats->num_rates); - qdf_mem_copy(results + next_res_offset, t_peer_stats + next_peer_offset, peer_info_size); next_res_offset += peer_info_size; /* Copy rate stats associated with this peer */ for (count = 0; count < peer_stats->num_rates; count++) { - WMA_LOGD("Rate Stats Info:"); - WMA_LOGD("rate %u bitrate %u tx_mpdu %u rx_mpdu %u " - "mpdu_lost %u retries %u retries_short %u " - "retries_long %u", rate_stats->rate, - rate_stats->bitrate, rate_stats->tx_mpdu, - rate_stats->rx_mpdu, rate_stats->mpdu_lost, - rate_stats->retries, rate_stats->retries_short, - rate_stats->retries_long); rate_stats++; qdf_mem_copy(results + next_res_offset, @@ -624,7 +604,6 @@ static int wma_unified_link_peer_stats_event_handler(void *handle, pMac->sme.pLinkLayerStatsIndCallback(pMac->hHdd, WMA_LINK_LAYER_STATS_RESULTS_RSP, link_stats_results); - WMA_LOGD("%s: Peer Stats event posted to HDD", __func__); qdf_mem_free(link_stats_results); return 0; @@ -933,7 +912,6 @@ int wma_unified_link_iface_stats_event_handler(void *handle, return -EINVAL; } - WMA_LOGD("%s: Posting Iface Stats event to HDD", __func__); param_tlvs = (WMI_IFACE_LINK_STATS_EVENTID_param_tlvs *) cmd_param_info; if (!param_tlvs) { WMA_LOGA("%s: Invalid stats event", __func__); @@ -967,32 +945,6 @@ int wma_unified_link_iface_stats_event_handler(void *handle, return -ENOMEM; } - WMA_LOGD("Interface stats from FW event buf"); - WMA_LOGD("Fixed Param:"); - WMA_LOGD("request_id %u vdev_id %u", - fixed_param->request_id, fixed_param->vdev_id); - - WMA_LOGD("Iface Stats:"); - WMA_LOGD("beacon_rx %u mgmt_rx %u mgmt_action_rx %u mgmt_action_tx %u " - "rssi_mgmt %u rssi_data %u rssi_ack %u num_peers %u " - "num_peer_events %u num_ac %u roam_state %u" - " avg_bcn_spread_offset_high %u" - " avg_bcn_spread_offset_low %u" - " is leaky_ap %u" - " avg_rx_frames_leaked %u" - " rx_leak_window %u", - link_stats->beacon_rx, link_stats->mgmt_rx, - link_stats->mgmt_action_rx, link_stats->mgmt_action_tx, - link_stats->rssi_mgmt, link_stats->rssi_data, - link_stats->rssi_ack, link_stats->num_peers, - link_stats->num_peer_events, link_stats->num_ac, - link_stats->roam_state, - link_stats->avg_bcn_spread_offset_high, - link_stats->avg_bcn_spread_offset_low, - link_stats->is_leaky_ap, - link_stats->avg_rx_frms_leaked, - link_stats->rx_leak_window); - qdf_mem_zero(link_stats_results, link_stats_results_size); link_stats_results->paramId = WMI_LINK_STATS_IFACE; @@ -1021,22 +973,7 @@ int wma_unified_link_iface_stats_event_handler(void *handle, next_res_offset = link_stats_size - WIFI_AC_MAX * ac_stats_size; next_ac_offset = WMI_TLV_HDR_SIZE; - WMA_LOGD("AC Stats:"); for (count = 0; count < link_stats->num_ac; count++) { - WMA_LOGD("ac_type %u tx_mpdu %u rx_mpdu %u tx_mcast %u " - "rx_mcast %u rx_ampdu %u tx_ampdu %u mpdu_lost %u " - "retries %u retries_short %u retries_long %u " - "contention_time_min %u contention_time_max %u " - "contention_time_avg %u contention_num_samples %u", - ac_stats->ac_type, ac_stats->tx_mpdu, - ac_stats->rx_mpdu, ac_stats->tx_mcast, - ac_stats->rx_mcast, ac_stats->rx_ampdu, - ac_stats->tx_ampdu, ac_stats->mpdu_lost, - ac_stats->retries, ac_stats->retries_short, - ac_stats->retries_long, ac_stats->contention_time_min, - ac_stats->contention_time_max, - ac_stats->contention_time_avg, - ac_stats->contention_num_samples); ac_stats++; qdf_mem_copy(results + next_res_offset, @@ -1052,7 +989,6 @@ int wma_unified_link_iface_stats_event_handler(void *handle, pMac->sme.pLinkLayerStatsIndCallback(pMac->hHdd, WMA_LINK_LAYER_STATS_RESULTS_RSP, link_stats_results); - WMA_LOGD("%s: Iface Stats event posted to HDD", __func__); qdf_mem_free(link_stats_results); return 0; @@ -1286,16 +1222,11 @@ static void wma_update_peer_stats(tp_wma_handle wma, classa_stats->rx_frag_cnt = node->nss; classa_stats->promiscuous_rx_frag_cnt = mcsRateFlags; - WMA_LOGD("Computed mcs_idx:%d mcs_rate_flags:%d", - classa_stats->mcs_index, mcsRateFlags); } /* FW returns tx power in intervals of 0.5 dBm Convert it back to intervals of 1 dBm */ classa_stats->max_pwr = roundup(classa_stats->max_pwr, 2) >> 1; - WMA_LOGD("peer tx rate flags:%d nss:%d max_txpwr:%d", - node->rate_flags, node->nss, - classa_stats->max_pwr); } } } @@ -1553,8 +1484,6 @@ int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info, WMITLV_TAG_STRUC_wmi_per_chain_rssi_stats) && ((rssi_event->tlv_header & 0x0000FFFF) == WMITLV_GET_STRUCT_TLVLEN(wmi_per_chain_rssi_stats))) { - WMA_LOGD("%s: num_rssi_stats %u", __func__, - rssi_event->num_per_chain_rssi_stats); if (rssi_event->num_per_chain_rssi_stats > 0) { temp = (uint8_t *) rssi_event; temp += sizeof(*rssi_event); From e4f2b1586fa7fcd9657d35f6778b5b1ad2b1d915 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 14 Oct 2016 07:04:48 -0700 Subject: [PATCH 071/179] Release 5.1.0.31F Release 5.1.0.31F Change-Id: I1e55a374642cb9df25c98fa78997a637b13e9c9f CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4956b6105695..7b947b8d1257 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "E" +#define QWLAN_VERSION_EXTRA "F" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31E" +#define QWLAN_VERSIONSTR "5.1.0.31F" #endif /* QWLAN_VERSION_H */ From 0f3fce5816cf0d38ecfec0a6957896fcd56b30d1 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Thu, 13 Oct 2016 22:01:41 +0530 Subject: [PATCH 072/179] qcacld-3.0: Fix to clear pending scan id when scan is aborted In case of scan abort FW does not send WMI_SCAN_EVENT_COMPLETED event and directly sends WMI_SCAN_EVENT_DEQUEUED or WMI_SCAN_EVENT_START_FAILED. In this case the scan id does not get clear and hence block Host from power collapsing. Include WMI_SCAN_EVENT_DEQUEUED and WMI_SCAN_EVENT_START_FAILED when accounting for completed scans, and change to tracking pending scans with a counter instead of individual Ids. Change-Id: Iaa2977dd5899d214251cbf4f1f8caf768725f538 CRs-Fixed: 1077518 --- core/wma/inc/wma.h | 6 +- core/wma/src/wma_main.c | 1 + core/wma/src/wma_scan_roam.c | 103 ++++++++++------------------------- core/wma/src/wma_utils.c | 15 +---- 4 files changed, 36 insertions(+), 89 deletions(-) diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 13080fefa6af..ba11600b9fa8 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -477,6 +477,10 @@ enum ds_mode { WMA_HW_MODE_SBS_MODE_BITPOS) +#define WMA_SCAN_END_EVENT (WMI_SCAN_EVENT_COMPLETED | \ + WMI_SCAN_EVENT_DEQUEUED | \ + WMI_SCAN_EVENT_START_FAILED) + /** * struct probeTime_dwellTime - probe time, dwell time map * @dwell_time: dwell time @@ -1010,7 +1014,6 @@ struct wma_txrx_node { vdev_restart_params_t vdev_restart_params; vdev_cli_config_t config; struct scan_param scan_info; - struct p2p_scan_param p2p_scan_info; uint32_t type; uint32_t sub_type; #ifdef FEATURE_WLAN_SCAN_PNO @@ -1536,6 +1539,7 @@ typedef struct { uint32_t new_hw_mode_index; struct extended_caps phy_caps; qdf_atomic_t scan_id_counter; + qdf_atomic_t num_pending_scans; wma_peer_authorized_fp peer_authorized_cb; uint32_t wow_pno_match_wake_up_count; uint32_t wow_pno_complete_wake_up_count; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 5f8bc9500eb3..b4e27b1b95dd 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2116,6 +2116,7 @@ QDF_STATUS wma_open(void *cds_context, qdf_spinlock_create(&wma_handle->wma_hold_req_q_lock); qdf_atomic_init(&wma_handle->is_wow_bus_suspended); qdf_atomic_init(&wma_handle->scan_id_counter); + qdf_atomic_init(&wma_handle->num_pending_scans); /* Register vdev start response event handler */ wmi_unified_register_event_handler(wma_handle->wmi_handle, diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index cd9a03fca5fe..514696deba85 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -100,65 +100,34 @@ enum extscan_report_events_type { #endif /** - * wma_set_scan_info() - set scan info in wma handle - * @wma_handle: wma handle - * @scan_id: scan id - * @vdev_id: vdev id + * wma_dec_pending_scans() - Decrements the number of pending scans + * @wma: The WMA handle to operate on * * Return: none */ -static inline void wma_set_scan_info(tp_wma_handle wma_handle, - uint32_t scan_id, - uint32_t vdev_id) +static void wma_dec_pending_scans(tp_wma_handle wma) { - wma_handle->interfaces[vdev_id].scan_info.scan_id = scan_id; + int32_t scan_cnt = qdf_atomic_read(&wma->num_pending_scans); + + if (scan_cnt <= 0) { + WMA_LOGE("Stopping pending scan, but no scans were pending!"); + return; + } + + qdf_atomic_dec(&wma->num_pending_scans); + WMA_LOGI("Ending pending scan: %d <- %d", scan_cnt, scan_cnt - 1); } /** - * wma_reset_scan_info() - reset scan info from wma handle - * @wma_handle: wma handle - * @vdev_id: vdev id + * wma_inc_pending_scans() - Increments the number of pending scans + * @wma: The WMA handle to operate on * * Return: none */ -static inline void wma_reset_scan_info(tp_wma_handle wma_handle, - uint8_t vdev_id) +static void wma_inc_pending_scans(tp_wma_handle wma) { - qdf_mem_zero((void *)&(wma_handle->interfaces[vdev_id].scan_info), - sizeof(wma_handle->interfaces[vdev_id].scan_info)); -} - -/** - * wma_set_p2p_scan_info() - set p2p scan info in wma handle - * @wma_handle: wma handle - * @scan_id: scan id - * @vdev_id: vdev id - * @p2p_scan_type: p2p scan type - * - * Return: none - */ -static inline void wma_set_p2p_scan_info(tp_wma_handle wma_handle, - uint32_t scan_id, - uint32_t vdev_id, - tSirP2pScanType p2p_scan_type) -{ - wma_handle->interfaces[vdev_id].p2p_scan_info.scan_id = scan_id; - wma_handle->interfaces[vdev_id].p2p_scan_info.p2p_scan_type = - p2p_scan_type; -} - -/** - * wma_reset_p2p_scan_info() - reset scan info from wma handle - * @wma_handle: wma handle - * @vdev_id: vdev id - * - * Return: none - */ -static inline void wma_reset_p2p_scan_info(tp_wma_handle wma_handle, - uint8_t vdev_id) -{ - qdf_mem_zero((void *)&(wma_handle->interfaces[vdev_id].p2p_scan_info), - sizeof(struct p2p_scan_param)); + int32_t scan_cnt = qdf_atomic_inc_return(&wma->num_pending_scans); + WMA_LOGI("Starting pending scan: %d -> %d", scan_cnt - 1, scan_cnt); } /** @@ -559,11 +528,8 @@ QDF_STATUS wma_start_scan(tp_wma_handle wma_handle, goto error1; } - wma_set_scan_info(wma_handle, cmd.scan_id, cmd.vdev_id); + wma_inc_pending_scans(wma_handle); - if (scan_req->p2pScanType == P2P_SCAN_TYPE_LISTEN) - wma_set_p2p_scan_info(wma_handle, cmd.scan_id, - cmd.vdev_id, P2P_SCAN_TYPE_LISTEN); WMA_LOGI("scan_id 0x%x, vdev_id %d, p2pScanType %d, msg_type 0x%x", cmd.scan_id, cmd.vdev_id, scan_req->p2pScanType, msg_type); @@ -585,7 +551,7 @@ QDF_STATUS wma_start_scan(tp_wma_handle wma_handle, &cmd); if (QDF_IS_STATUS_ERROR(qdf_status)) { WMA_LOGE("wmi_unified_cmd_send returned Error %d", qdf_status); - goto error1; + goto dec_scans; } if (NULL != cmd.chan_list) @@ -595,6 +561,9 @@ QDF_STATUS wma_start_scan(tp_wma_handle wma_handle, return QDF_STATUS_SUCCESS; +dec_scans: + wma_dec_pending_scans(wma_handle); + error1: if (NULL != cmd.chan_list) qdf_mem_free(cmd.chan_list); @@ -5671,35 +5640,16 @@ int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, return -ENOMEM; } - scan_event->event = wmi_event->event; - WMA_LOGI("scan event %u, id 0x%x, requestor 0x%x, freq %u, reason %u", wmi_event->event, wmi_event->scan_id, wmi_event->requestor, wmi_event->channel_freq, wmi_event->reason); + scan_event->event = wmi_event->event; scan_event->scanId = wmi_event->scan_id; scan_event->requestor = wmi_event->requestor; scan_event->chanFreq = wmi_event->channel_freq; - - if (scan_event->scanId == - wma_handle->interfaces[vdev_id].scan_info.scan_id) { - if (scan_event->event == SIR_SCAN_EVENT_COMPLETED) - wma_reset_scan_info(wma_handle, vdev_id); - } - - if (scan_event->scanId == - wma_handle->interfaces[vdev_id].p2p_scan_info.scan_id) { - scan_event->p2pScanType = P2P_SCAN_TYPE_LISTEN; - if (scan_event->event == SIR_SCAN_EVENT_COMPLETED) - wma_reset_p2p_scan_info(wma_handle, vdev_id); - } scan_event->sessionId = vdev_id; - - if (wmi_event->reason == WMI_SCAN_REASON_COMPLETED || - wmi_event->reason == WMI_SCAN_REASON_TIMEDOUT) - scan_event->reasonCode = eSIR_SME_SUCCESS; - else - scan_event->reasonCode = eSIR_SME_SCAN_FAILED; + scan_event->reasonCode = eSIR_SME_SCAN_FAILED; switch (wmi_event->event) { case WMI_SCAN_EVENT_COMPLETED: @@ -5734,10 +5684,13 @@ int wma_scan_event_callback(WMA_HANDLE handle, uint8_t *data, } wma_send_msg(wma_handle, WMA_RX_SCAN_EVENT, (void *)scan_event, 0); + + if ((wmi_event->event & WMA_SCAN_END_EVENT) > 0) + wma_dec_pending_scans(wma_handle); + return 0; } - /** * wma_roam_better_ap_handler() - better ap event handler * @wma: wma handle diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 15b312902e8a..44501c96aa69 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -1640,19 +1640,8 @@ int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap, */ bool wma_check_scan_in_progress(WMA_HANDLE handle) { - tp_wma_handle wma_handle = handle; - int i; - - for (i = 0; i < wma_handle->max_bssid; i++) { - if (wma_handle->interfaces[i].scan_info.scan_id) { - - WMA_LOGE("%s: scan in progress on interface[%d],scanid = %d", - __func__, i, - wma_handle->interfaces[i].scan_info.scan_id); - return true; - } - } - return false; + tp_wma_handle wma = handle; + return qdf_atomic_read(&wma->num_pending_scans) > 0; } /** From 1345f45ad6db55bc70834ff7432743b3fc1722a1 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 14 Oct 2016 08:05:31 -0700 Subject: [PATCH 073/179] Release 5.1.0.31G Release 5.1.0.31G Change-Id: I1e6834c8018409f61ab85dd1567894024aa2be56 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7b947b8d1257..3855cdea89e9 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "F" +#define QWLAN_VERSION_EXTRA "G" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31F" +#define QWLAN_VERSIONSTR "5.1.0.31G" #endif /* QWLAN_VERSION_H */ From e7a435768879bc327b5f98e0af7cee1e8659ed25 Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Mon, 10 Oct 2016 17:34:21 -0700 Subject: [PATCH 074/179] qcacld-3.0: Use correct flag to compile USB-PLD file Currently we are using different flags to enable compilation of pld_usb.c and one to enable/disable PLD USB stub functions. Use the same flag for both cases - CONFIG_PLD_USB_CNSS Change-Id: Icc89405d785f3fc0ebc4a97d234013ac86ebd068 CRs-Fixed: 1076326 --- Kbuild | 6 ++++-- core/pld/src/pld_usb.c | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Kbuild b/Kbuild index c6ea5d2042d8..ac31affdb2a4 100644 --- a/Kbuild +++ b/Kbuild @@ -246,6 +246,7 @@ endif #Enable USB specific APIS ifeq ($(CONFIG_ROME_IF),usb) CONFIG_HIF_USB := 1 + CONFIG_PLD_USB_CNSS := y endif #Enable pci read/write config functions @@ -970,7 +971,7 @@ endif ifeq ($(CONFIG_CNSS_SDIO),y) PLD_OBJS += $(PLD_SRC_DIR)/pld_sdio.o endif -ifeq ($(CONFIG_USB), y) +ifeq ($(CONFIG_PLD_USB_CNSS), y) PLD_OBJS += $(PLD_SRC_DIR)/pld_usb.o endif @@ -1315,7 +1316,8 @@ endif #Enable USB specific APIS ifeq ($(CONFIG_HIF_USB), 1) CDEFINES += -DHIF_USB \ - -DCONFIG_HL_SUPPORT + -DCONFIG_PLD_USB_CNSS \ + -DCONFIG_HL_SUPPORT endif #Enable FW logs through ini diff --git a/core/pld/src/pld_usb.c b/core/pld/src/pld_usb.c index 76ac2fab46a8..26ce211722ee 100644 --- a/core/pld/src/pld_usb.c +++ b/core/pld/src/pld_usb.c @@ -16,7 +16,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#include "pld_common.h" +#include "pld_usb.h" #include "pld_internal.h" #include @@ -208,4 +208,3 @@ void pld_usb_unregister_driver(void) usb_deregister(&pld_usb_ops); pr_info("%s usb_deregister done!\n", __func__); } - From 0f0109110730715d4cf98700a5d6ea549fcabcd3 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 14 Oct 2016 08:43:47 -0700 Subject: [PATCH 075/179] Release 5.1.0.31H Release 5.1.0.31H Change-Id: Ica6a7d25910e20235b7e62adbeb5e668108dee8c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 3855cdea89e9..0b8319dcf65c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "G" +#define QWLAN_VERSION_EXTRA "H" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31G" +#define QWLAN_VERSIONSTR "5.1.0.31H" #endif /* QWLAN_VERSION_H */ From c98370ec35b394dd464226e060ff76c21397ea86 Mon Sep 17 00:00:00 2001 From: Yuanyuan Liu Date: Thu, 13 Oct 2016 11:22:13 -0700 Subject: [PATCH 076/179] qcacld-3.0: Update custom MAC address before creating interface Custom MAC address has to be updated before creating WLAN interface. Otherwise, custom MAC address won't take affect as WLAN interface will use the old MAC address auto-generated or from hw_addr/config INI file. Change-Id: Icd3feda96ffe45896fec2407f4ddb4351992ed81 CRs-Fixed: 1077588 --- core/hdd/src/wlan_hdd_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b0fc02c6397a..cf4c663ba24c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7413,8 +7413,6 @@ static int hdd_pre_enable_configure(hdd_context_t *hdd_ctx) goto out; } - hdd_initialize_mac_address(hdd_ctx); - /* * Set the MAC Address Currently this is used by HAL to add self sta. * Remove this once self sta is added as part of session open. @@ -7999,10 +7997,10 @@ int hdd_wlan_startup(struct device *dev) if (hdd_ipa_init(hdd_ctx) == QDF_STATUS_E_FAILURE) goto err_wiphy_unregister; + hdd_initialize_mac_address(hdd_ctx); rtnl_held = hdd_hold_rtnl_lock(); - adapter = hdd_open_interfaces(hdd_ctx, rtnl_held); if (IS_ERR(adapter)) { From e15c208e1787b4a0c3426e84262fb5d8aa911278 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 14 Oct 2016 12:04:22 -0700 Subject: [PATCH 077/179] Release 5.1.0.31I Release 5.1.0.31I Change-Id: I1e0ea3261de5263df6bf2a044888964b5136d1c2 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 0b8319dcf65c..a6d0952b1014 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "H" +#define QWLAN_VERSION_EXTRA "I" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31H" +#define QWLAN_VERSIONSTR "5.1.0.31I" #endif /* QWLAN_VERSION_H */ From 1620ecb8eee3571508cf3079a18ed6bad6ea4946 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Mon, 10 Oct 2016 15:25:50 -0700 Subject: [PATCH 078/179] qcacld-3.0: Fix HT/VHT channel width for 2.4/5Ghz band In function lim_send_ies_per_band, use ini configuration to fix HT channel width for 2.4/5 GHz band. For 2.4GHz set VHT channel width to 0. Change-Id: Ided8628cc78ffbea7c9c9f5a16815daffffca37c CRs-Fixed: 1076244 --- core/mac/src/pe/lim/lim_utils.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index f347e201eec3..4a818586ca21 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -6543,9 +6543,9 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, { uint8_t ht_caps[DOT11F_IE_HTCAPS_MIN_LEN + 2] = {0}; uint8_t vht_caps[DOT11F_IE_VHTCAPS_MAX_LEN + 2] = {0}; - tHtCaps *p_ht_cap = (tHtCaps *)ht_caps; + tHtCaps *p_ht_cap = (tHtCaps *)(&ht_caps[2]); tSirMacVHTCapabilityInfo *p_vht_cap = - (tSirMacVHTCapabilityInfo *)vht_caps; + (tSirMacVHTCapabilityInfo *)(&vht_caps[2]); /* * Note: Do not use Dot11f VHT structure, since 1 byte present flag in @@ -6558,6 +6558,14 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, DOT11F_IE_HTCAPS_MIN_LEN + 2); /* Get LDPC and over write for 2G */ p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6); + /* Get self cap for HT40 support in 2G */ + if (mac_ctx->roam.configParam.channelBondingMode24GHz) { + p_ht_cap->supportedChannelWidthSet = 1; + p_ht_cap->shortGI40MHz = 1; + } else { + p_ht_cap->supportedChannelWidthSet = 0; + p_ht_cap->shortGI40MHz = 0; + } lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, CDS_BAND_2GHZ, &ht_caps[2], DOT11F_IE_HTCAPS_MIN_LEN); /* @@ -6565,6 +6573,14 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, * is available in all reg domains. */ p_ht_cap->advCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64); + /* Get self cap for HT40 support in 5G */ + if (mac_ctx->roam.configParam.channelBondingMode5GHz) { + p_ht_cap->supportedChannelWidthSet = 1; + p_ht_cap->shortGI40MHz = 1; + } else { + p_ht_cap->supportedChannelWidthSet = 0; + p_ht_cap->shortGI40MHz = 0; + } lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HTCAPS, CDS_BAND_5GHZ, &ht_caps[2], DOT11F_IE_HTCAPS_MIN_LEN); @@ -6574,6 +6590,10 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, lim_set_vht_caps(mac_ctx, session, vht_caps, DOT11F_IE_VHTCAPS_MIN_LEN + 2); p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_6); + /* Self VHT 80/160/80+80 channel width for 2G is 0 */ + p_vht_cap->supportedChannelWidthSet = 0; + p_vht_cap->shortGI80MHz = 0; + p_vht_cap->shortGI160and80plus80MHz = 0; lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, CDS_BAND_2GHZ, &vht_caps[2], DOT11F_IE_VHTCAPS_MIN_LEN); @@ -6582,6 +6602,7 @@ QDF_STATUS lim_send_ies_per_band(tpAniSirGlobal mac_ctx, * is available in all reg domains. */ p_vht_cap->ldpcCodingCap = lim_get_rx_ldpc(mac_ctx, CHAN_ENUM_64); + /* Self VHT channel width for 5G is already negotiated with FW */ lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_VHTCAPS, CDS_BAND_5GHZ, &vht_caps[2], DOT11F_IE_VHTCAPS_MIN_LEN); From b5c194bcd5ae74227a65783025b276eb60f33e49 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 14 Oct 2016 14:39:05 -0700 Subject: [PATCH 079/179] Release 5.1.0.31J Release 5.1.0.31J Change-Id: I3e16cf93a07476dc454ff74424c8a346da0b9d51 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index a6d0952b1014..2fa33b310f73 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "I" +#define QWLAN_VERSION_EXTRA "J" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31I" +#define QWLAN_VERSIONSTR "5.1.0.31J" #endif /* QWLAN_VERSION_H */ From 099838379057a4e56d23a0189f86c9f20686439a Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Thu, 13 Oct 2016 16:26:03 +0530 Subject: [PATCH 080/179] qcacld-3.0: CL 1660720 - update fw common interface files Add wmi_pdev_band_to_mac TLVs to wmi_pdev_set_hw_mode and support > 32 vdevs in swba_event. Change-Id: I29e6513fae5a2aa6318ee8d65f77c289228efb6e CRs-Fixed: 865207 --- target/inc/wmi_tlv_defs.h | 13 +++++++- target/inc/wmi_unified.h | 65 +++++++++++++++++++++++++++++++++++++-- target/inc/wmi_version.h | 2 +- 3 files changed, 75 insertions(+), 5 deletions(-) diff --git a/target/inc/wmi_tlv_defs.h b/target/inc/wmi_tlv_defs.h index 49871296b8c0..a6bfac9a153c 100644 --- a/target/inc/wmi_tlv_defs.h +++ b/target/inc/wmi_tlv_defs.h @@ -752,6 +752,9 @@ typedef enum { WMITLV_TAG_STRUC_wmi_rx_aggr_failure_info, WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_req_cmd_fixed_param, WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param, + WMITLV_TAG_STRUC_wmi_pdev_band_to_mac, + WMITLV_TAG_STRUC_wmi_tbtt_offset_info, + WMITLV_TAG_STRUC_wmi_tbtt_offset_ext_event_fixed_param, } WMITLV_TAG_ID; /* @@ -1217,6 +1220,7 @@ typedef enum { OP(WMI_REPORT_STATS_EVENTID) \ OP(WMI_REPORT_RX_AGGR_FAILURE_EVENTID) \ OP(WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID) \ + OP(WMI_TBTTOFFSET_EXT_UPDATE_EVENTID) \ /* add new EVT_LIST elements above this line */ /* TLV definitions of WMI commands */ @@ -1226,7 +1230,8 @@ typedef enum { WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_init_cmd_fixed_param, wmi_init_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_resource_config, wmi_resource_config, resource_config, WMITLV_SIZE_FIX) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wlan_host_memory_chunk, host_mem_chunks, WMITLV_SIZE_VAR) \ - WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_set_hw_mode_cmd_fixed_param, wmi_pdev_set_hw_mode_cmd_fixed_param, hw_mode, WMITLV_SIZE_FIX) + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_set_hw_mode_cmd_fixed_param, wmi_pdev_set_hw_mode_cmd_fixed_param, hw_mode, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_band_to_mac, wmi_pdev_band_to_mac, band_to_mac, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_INIT_CMDID); @@ -3193,6 +3198,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_MGMT_RX_EVENTID); WMITLV_FXAR(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, tbttoffset_list, WMITLV_SIZE_FIX, WMI_MAX_AP_VDEV) WMITLV_CREATE_PARAM_STRUC(WMI_TBTTOFFSET_UPDATE_EVENTID); +/* TBTT EXT offset Event */ +#define WMITLV_TABLE_WMI_TBTTOFFSET_EXT_UPDATE_EVENTID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_tbtt_offset_ext_event_fixed_param, wmi_tbtt_offset_ext_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_STRUC, wmi_tbtt_offset_info, tbtt_offset_info, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_TBTTOFFSET_EXT_UPDATE_EVENTID); + /* TX DELBA Complete Event */ #define WMITLV_TABLE_WMI_TX_DELBA_COMPLETE_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_tx_delba_complete_event_fixed_param, wmi_tx_delba_complete_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index 56b618431784..427f7924b672 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -1176,7 +1176,10 @@ typedef enum { WMI_MGMT_TX_COMPLETION_EVENTID, /** Event for Mgmt TX bundle completion event */ WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID, - + /** vdev_map used in WMI_TBTTOFFSET_UPDATE_EVENTID supports max 32 vdevs + * Use this event if number of vdevs > 32. + */ + WMI_TBTTOFFSET_EXT_UPDATE_EVENTID, /*ADDBA Related WMI Events */ /** Indication the completion of the prior @@ -7187,13 +7190,17 @@ typedef struct { typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_tim_info */ - /** TIM bitmap len (in bytes)*/ + /** TIM bitmap len (in bytes) */ A_UINT32 tim_len; /** TIM Partial Virtual Bitmap */ A_UINT32 tim_mcast; A_UINT32 tim_bitmap[WMI_TIM_BITMAP_ARRAY_SIZE]; A_UINT32 tim_changed; A_UINT32 tim_num_ps_pending; + /** Use the vdev_id only if vdev_id_valid is set */ + A_UINT32 vdev_id_valid; + /** unique id identifying the VDEV */ + A_UINT32 vdev_id; } wmi_tim_info; typedef struct { @@ -7224,6 +7231,10 @@ typedef struct { A_UINT32 noa_attributes; wmi_p2p_noa_descriptor noa_descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS]; + /** Use the vdev_id only if vdev_id_valid is set */ + A_UINT32 vdev_id_valid; + /** unique id identifying the VDEV */ + A_UINT32 vdev_id; } wmi_p2p_noa_info; #define WMI_UNIFIED_NOA_ATTR_MODIFIED 0x1 @@ -7288,7 +7299,12 @@ typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_host_swba_event_fixed_param */ /** bitmap identifying the VDEVs, generated by the caller */ A_UINT32 vdev_map; - /* This TLV is followed by tim_info and p2p_noa_info for each vdev in vdevmap : + /** how many vdev's info is included in this message + * If this field is zero, then the number of vdevs is specified by + * the number of bits set in the vdev_map bitmap. + */ + A_UINT32 num_vdevs; + /* This TLV is followed by tim_info and p2p_noa_info for each vdev: * wmi_tim_info tim_info[]; * wmi_p2p_noa_info p2p_noa_info[]; * @@ -7307,6 +7323,29 @@ typedef struct { */ } wmi_tbtt_offset_event_fixed_param; +typedef struct { + /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_tbtt_offset_info */ + A_UINT32 tlv_header; + /** unique id identifying the VDEV */ + A_UINT32 vdev_id; + /** tbttoffset in TUs */ + A_UINT32 tbttoffset; +} wmi_tbtt_offset_info; + +/** Use this event if number of vdevs > 32 */ +typedef struct { + /* + * TLV tag and len; + * tag equals WMITLV_TAG_STRUC_wmi_tbtt_offset_ext_event_fixed_param + */ + A_UINT32 tlv_header; + A_UINT32 num_vdevs; + /* + * The TLVs for tbttoffset will follow this TLV. + * Of size num_vdevs * wmi_tbtt_offset_info + */ +} wmi_tbtt_offset_ext_event_fixed_param; + /* Peer Specific commands and events */ typedef struct { @@ -15317,6 +15356,19 @@ typedef struct { A_UINT32 hw_mode_index; } wmi_soc_set_hw_mode_cmd_fixed_param; +typedef struct { + /* TLV tag and len tag equals WMITLV_TAG_STRUC_wmi_pdev_band_to_mac */ + A_UINT32 tlv_header; + /** pdev_id for identifying the MAC + * See macros starting with WMI_PDEV_ID_ for values. + */ + A_UINT32 pdev_id; + /* start frequency in MHz */ + A_UINT32 start_freq; + /* end frequency in MHz */ + A_UINT32 end_freq; +} wmi_pdev_band_to_mac; + typedef struct { /* TLV tag and len; tag equals * WMITLV_TAG_STRUC_wmi_pdev_set_hw_mode_cmd_fixed_param @@ -15331,6 +15383,13 @@ typedef struct { /* Hardware Mode Index */ A_UINT32 hw_mode_index; + + /* Number of band to mac TLVs */ + A_UINT32 num_band_to_mac; + + /* Followed by TLVs of type + * num_band_to_mac * wmi_pdev_band_to_mac. + */ } wmi_pdev_set_hw_mode_cmd_fixed_param; /* DEPRECATED - use wmi_pdev_set_mac_config_cmd_fixed_param instead */ diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index f0d6a194305d..fa010ff8ffcd 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 300 +#define __WMI_REVISION_ 301 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work From bddb6676259b904502bddd45bab948cc2598e007 Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Mon, 10 Oct 2016 18:07:49 -0700 Subject: [PATCH 081/179] qcacld-3.0: CL 1661152 - update fw common interface files Add extended FW build version info to the WMI ready messages. Change-Id: I4b9a62c56e365825d4d8db91031888518f2509c7 CRs-Fixed: 865207 --- target/inc/wmi_unified.h | 6 ++++++ target/inc/wmi_version.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index 427f7924b672..5e409a2872df 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -2011,6 +2011,12 @@ typedef struct { * Value 0 means FW hasn't given any limit to host. */ A_UINT32 max_bssid_rx_filters; + /* + * Extended FW build version information: + * bits 27:0 -> reserved + * bits 31:28 -> CRM sub ID + */ + A_UINT32 fw_build_vers_ext; } wmi_service_ready_ext_event_fixed_param; typedef enum { diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index fa010ff8ffcd..67b42c15c1f6 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 301 +#define __WMI_REVISION_ 302 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work From b7dec7e0731bbba4329311d886d70b1dcae2474f Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Mon, 10 Oct 2016 21:53:50 -0700 Subject: [PATCH 082/179] qcacld-3.0: CL 1661761 - update fw common interface files Add IPA TX msdu_id space repartitioning. Change-Id: I2dd4d430c3ba4413c6b0629d2a97d06769ef0afd CRs-Fixed: 865207 --- target/inc/wmi_services.h | 10 ++++++++++ target/inc/wmi_unified.h | 9 +++++++++ target/inc/wmi_version.h | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/target/inc/wmi_services.h b/target/inc/wmi_services.h index e9d0d41ca177..949ea77018f0 100644 --- a/target/inc/wmi_services.h +++ b/target/inc/wmi_services.h @@ -260,6 +260,16 @@ typedef enum { WMI_SERVICE_FLASH_RDWR_SUPPORT = 110, WMI_SERVICE_WLAN_STATS_REPORT = 111, /* support WLAN stats report */ + /* WMI_SERVICE_TX_MSDU_ID_NEW_PARTITION_SUPPORT - + * FW supports bigger MSDU ID partition which is defined as + * HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN. When both host and FW support + * new partition, FW uses HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN. If host + * doesn't support, FW falls back to HTT_TX_IPA_MSDU_ID_SPACE_BEGIN + * Handshaking is done through WMI_INIT and WMI service ready + * + * support bigger MSDU ID partition + */ + WMI_SERVICE_TX_MSDU_ID_NEW_PARTITION_SUPPORT = 112, /*** ADD NEW SERVICES HERE UNTIL ALL VALUES UP TO 128 ARE USED ***/ diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index 5e409a2872df..89411eecaedf 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -2411,6 +2411,9 @@ typedef struct { #define WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_S 9 #define WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_M 0x200 + #define WMI_RSRC_CFG_FLAG_TX_MSDU_ID_NEW_PARTITION_SUPPORT_S 10 + #define WMI_RSRC_CFG_FLAG_TX_MSDU_ID_NEW_PARTITION_SUPPORT_M 0x400 + A_UINT32 flag1; /** @brief smart_ant_cap - Smart Antenna capabilities information @@ -2522,6 +2525,12 @@ typedef struct { #define WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_GET(word32) \ WMI_RSRC_CFG_FLAG_GET((word32), MGMT_COMP_EVT_BUNDLE_SUPPORT) +#define WMI_RSRC_CFG_FLAG_TX_MSDU_ID_NEW_PARTITION_SUPPORT_SET(word32, value) \ + WMI_RSRC_CFG_FLAG_SET((word32), \ + TX_MSDU_ID_NEW_PARTITION_SUPPORT, (value)) +#define WMI_RSRC_CFG_FLAG_TX_MSDU_ID_NEW_PARTITION_SUPPORT_GET(word32) \ + WMI_RSRC_CFG_FLAG_GET((word32), TX_MSDU_ID_NEW_PARTITION_SUPPORT) + typedef struct { A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_init_cmd_fixed_param */ diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index 67b42c15c1f6..292bd1d3e8ad 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 302 +#define __WMI_REVISION_ 303 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work From ac90a7d704766e7840ee19bcf333d174574e6e72 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 14 Oct 2016 15:49:23 -0700 Subject: [PATCH 083/179] Release 5.1.0.31K Release 5.1.0.31K Change-Id: I5a983e6b672cf1ee498414c249fa2233d7aa76a6 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 2fa33b310f73..4155d15f851a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "J" +#define QWLAN_VERSION_EXTRA "K" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31J" +#define QWLAN_VERSIONSTR "5.1.0.31K" #endif /* QWLAN_VERSION_H */ From 2154a71e825fbe59427f1c09d2eab88e29b023a9 Mon Sep 17 00:00:00 2001 From: Nishank Aggarwal Date: Thu, 13 Oct 2016 11:34:27 +0530 Subject: [PATCH 084/179] qcacld-3.0: Avoid initializing the pmfcomeback timer twice Currently pmfcomeback timer entry initializing twice. Remove the changes to initialize pmfcomeback timer entry from lim_fill_ft_session as it is already initialize in pe_create_session. Change-Id: I74d6997d9fe861f6e1cc69c233f0de754b3d040a CRs-Fixed: 1077346 --- core/mac/src/pe/lim/lim_ft.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/core/mac/src/pe/lim/lim_ft.c b/core/mac/src/pe/lim/lim_ft.c index d690218a2ce4..d4e02035613d 100644 --- a/core/mac/src/pe/lim/lim_ft.c +++ b/core/mac/src/pe/lim/lim_ft.c @@ -493,7 +493,6 @@ void lim_fill_ft_session(tpAniSirGlobal pMac, tSchBeaconStruct *pBeaconStruct; uint32_t selfDot11Mode; ePhyChanBondState cbEnabledMode; - QDF_STATUS status; pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct)); if (NULL == pBeaconStruct) { @@ -679,19 +678,6 @@ void lim_fill_ft_session(tpAniSirGlobal pMac, pftSessionEntry->encryptType = psessionEntry->encryptType; #ifdef WLAN_FEATURE_11W pftSessionEntry->limRmfEnabled = psessionEntry->limRmfEnabled; - - if (pftSessionEntry->limRmfEnabled) { - pftSessionEntry->pmfComebackTimerInfo.pMac = pMac; - pftSessionEntry->pmfComebackTimerInfo.sessionID = - psessionEntry->smeSessionId; - status = qdf_mc_timer_init(&pftSessionEntry->pmfComebackTimer, - QDF_TIMER_TYPE_SW, lim_pmf_comeback_timer_callback, - (void *)&pftSessionEntry->pmfComebackTimerInfo); - if (!QDF_IS_STATUS_SUCCESS(status)) - lim_log(pMac, LOGE, - FL("cannot init pmf comeback timer.")); - } - #endif if ((pftSessionEntry->limRFBand == SIR_BAND_2_4_GHZ) && (pftSessionEntry->htSupportedChannelWidthSet == From 61353074e5d9d0d29e4478ca221b9c65f5c1ec63 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Sun, 16 Oct 2016 22:50:39 -0700 Subject: [PATCH 085/179] Release 5.1.0.31L Release 5.1.0.31L Change-Id: I07564ead23f2a506470b36565397c1a66fe90283 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4155d15f851a..d98370eede9d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "K" +#define QWLAN_VERSION_EXTRA "L" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31K" +#define QWLAN_VERSIONSTR "5.1.0.31L" #endif /* QWLAN_VERSION_H */ From 8a621308c2b51c2058da1dfdefde2bb6e98e14a6 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:20:11 -0700 Subject: [PATCH 086/179] qcacld-3.0: Fix -Wmissing-prototypes in sap/dfs We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sap/dfs. Change-Id: I05b091f33d94a0219d4113d49c392828ed4350b8 CRs-Fixed: 1075555 --- core/sap/dfs/inc/dfs_interface.h | 4 ++-- core/sap/dfs/src/dfs_process_phyerr.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/sap/dfs/inc/dfs_interface.h b/core/sap/dfs/inc/dfs_interface.h index ce0a49bcf93b..e0bbf90bf285 100644 --- a/core/sap/dfs/inc/dfs_interface.h +++ b/core/sap/dfs/inc/dfs_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -68,7 +68,7 @@ * EXPORT_SYMBOL(dfs_init_radar_filters); * EXPORT_SYMBOL(dfs_getchanstate); */ - +uint16_t dfs_usenol(struct ieee80211com *ic); uint16_t dfs_isdfsregdomain(struct ieee80211com *ic); int dfs_attach(struct ieee80211com *ic); void dfs_detach(struct ieee80211com *ic); diff --git a/core/sap/dfs/src/dfs_process_phyerr.c b/core/sap/dfs/src/dfs_process_phyerr.c index 5290a70c0db9..efb0f0311871 100644 --- a/core/sap/dfs/src/dfs_process_phyerr.c +++ b/core/sap/dfs/src/dfs_process_phyerr.c @@ -143,7 +143,7 @@ dfs_get_event_freqcentre(struct ath_dfs *dfs, int is_pri, int is_ext, int is_dc) * * Return 1 on success or 0 on failure. */ -int +static int dfs_process_phyerr_owl(struct ath_dfs *dfs, void *buf, uint16_t datalen, uint8_t rssi, uint8_t ext_rssi, uint32_t rs_tstamp, uint64_t fulltsf, struct dfs_phy_err *e) @@ -205,7 +205,7 @@ dfs_process_phyerr_owl(struct ath_dfs *dfs, void *buf, uint16_t datalen, /* * Process a Sowl/Howl style phy error. */ -int +static int dfs_process_phyerr_sowl(struct ath_dfs *dfs, void *buf, uint16_t datalen, uint8_t rssi, uint8_t ext_rssi, uint32_t rs_tstamp, uint64_t fulltsf, struct dfs_phy_err *e) @@ -357,7 +357,7 @@ dfs_process_phyerr_sowl(struct ath_dfs *dfs, void *buf, uint16_t datalen, /* * Process a Merlin/Osprey style phy error. */ -int +static int dfs_process_phyerr_merlin(struct ath_dfs *dfs, void *buf, uint16_t datalen, uint8_t rssi, uint8_t ext_rssi, uint32_t rs_tstamp, uint64_t fulltsf, From 97d2b8f0d92b241d3bafede941ae97917d890868 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 17 Oct 2016 09:12:23 -0700 Subject: [PATCH 087/179] Release 5.1.0.31M Release 5.1.0.31M Change-Id: Idaefc60039bda6418320e28f219e71c87add84a1 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d98370eede9d..a2e25f4c395d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31L" +#define QWLAN_VERSIONSTR "5.1.0.31M" #endif /* QWLAN_VERSION_H */ From d9445780766121dfe5df2c0efdafc75644a208e1 Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Wed, 12 Oct 2016 13:42:43 -0700 Subject: [PATCH 088/179] qcacld-3.0: Add helper function cds_combine_channel_states cds_combine_channel_states to select final channel state based on the two channel states specially when operating on 80+80 MHZ. Change-Id: I5f470c96ce499c8d9aa2e41ceff59cdfc2f31151 CRs-Fixed: 1075098 --- core/cds/src/cds_reg_service.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c index 302c670c0aca..9b6b00d8d079 100644 --- a/core/cds/src/cds_reg_service.c +++ b/core/cds/src/cds_reg_service.c @@ -436,6 +436,23 @@ enum channel_state cds_get_5g_bonded_channel_state( return CHANNEL_STATE_DISABLE; } +/** + * cds_combine_channel_states() - combine channel states + * @chan_state1: channel state1 + * @chan_state2: channel state2 + * + * Return: enum channel_state + */ + static enum channel_state cds_combine_channel_states( + enum channel_state chan_state1, + enum channel_state chan_state2) +{ + if ((CHANNEL_STATE_INVALID == chan_state1) || + (CHANNEL_STATE_INVALID == chan_state2)) + return CHANNEL_STATE_INVALID; + else + return min(chan_state1, chan_state2); +} /** * cds_set_5g_channel_params() - set the 5G bonded channel parameters @@ -456,6 +473,8 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, ch_params->ch_width = CH_WIDTH_80P80MHZ; while (ch_params->ch_width != CH_WIDTH_INVALID) { + bonded_chan_ptr = NULL; + bonded_chan_ptr2 = NULL; chan_state = cds_search_5g_bonded_channel(oper_ch, ch_params->ch_width, &bonded_chan_ptr); @@ -468,14 +487,16 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, ch_params->center_freq_seg1 - 2, CH_WIDTH_80MHZ); - if (chan_state2 < chan_state) - chan_state = chan_state2; + chan_state = cds_combine_channel_states(chan_state, + chan_state2); + if ((CHANNEL_STATE_ENABLE == chan_state) || (CHANNEL_STATE_DFS == chan_state)) { if (CH_WIDTH_20MHZ >= ch_params->ch_width) { ch_params->sec_ch_offset = PHY_SINGLE_CHANNEL_CENTERED; ch_params->center_freq_seg0 = oper_ch; + break; } else if (CH_WIDTH_40MHZ <= ch_params->ch_width) { cds_search_5g_bonded_chan_array(oper_ch, bonded_chan_40mhz_array, @@ -493,9 +514,9 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, ch_params->center_freq_seg0 = (bonded_chan_ptr->start_ch + bonded_chan_ptr->end_ch)/2; + break; } } - break; } ch_params->ch_width = next_lower_bw[ch_params->ch_width]; } From 64f1d558fea1e08fe835344a3a0dbb39b96888ec Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 17 Oct 2016 14:17:43 -0700 Subject: [PATCH 089/179] Release 5.1.0.31N Release 5.1.0.31N Change-Id: Ibdd3dad1e0516660096c78714eb271f094a16d66 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index a2e25f4c395d..996c68fbe366 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31M" +#define QWLAN_VERSIONSTR "5.1.0.31N" #endif /* QWLAN_VERSION_H */ From 1046cccf52f083819aae3ae4a2e5430b5613c2d4 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Fri, 14 Oct 2016 14:33:44 +0530 Subject: [PATCH 090/179] qcacld-3.0: Return valid firmware version to upper layer When upper layer requests for firmware version using vendor command, QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO, after parsing vendor command attributes to tb_vendor structure, Host is checking for DRIVER version attribute(which will be invalid in case upper layer sends Firmware version attribute) leading Host to send firmware version as NULL. Check for firmware version attribute so that valid firmware version is returned to upper layer. Change-Id: I9da24e4b860e5da9ef5c7b7ecff6e67d272a66fc CRs-Fixed: 1078012 --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c01fee7bc818..c9f180bbb816 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3599,7 +3599,7 @@ __wlan_hdd_cfg80211_get_wifi_info(struct wiphy *wiphy, goto error_nla_fail; } - if (tb_vendor[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_DRIVER_VERSION]) { + if (tb_vendor[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION]) { if (nla_put_string(reply_skb, QCA_WLAN_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION, firmware_version)) From d9abce7a3324fea16ecd61f9ab14532bd9502624 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 17 Oct 2016 15:59:31 -0700 Subject: [PATCH 091/179] Release 5.1.0.31O Release 5.1.0.31O Change-Id: Ib451fdc92c5ef78b64fad065c749b5bb83ad70b3 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 996c68fbe366..924e7e3b95d8 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31N" +#define QWLAN_VERSIONSTR "5.1.0.31O" #endif /* QWLAN_VERSION_H */ From 464f7ea7b78c5d689803941e7f40a2588312c174 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:21:26 -0700 Subject: [PATCH 092/179] qcacld-3.0: Fix -Wmissing-prototypes in sap/src We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sap/src. Change-Id: I92193d6209c5e62468197a1aae8a4187f60b0891 CRs-Fixed: 1075555 --- core/sap/src/sap_ch_select.c | 133 ++++++++++++++++------------------- core/sap/src/sap_fsm.c | 30 ++++---- core/sap/src/sap_module.c | 2 +- 3 files changed, 78 insertions(+), 87 deletions(-) diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index b4a54dd5adab..fcf1b578b3b8 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -487,6 +487,7 @@ void sap_cleanup_channel_list(void *p_cds_gctx) * * Return: uint8_t best channel */ +static uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl, ptSapContext sap_ctx, tSapChSelSpectInfo *spectinfo_param) @@ -541,8 +542,9 @@ uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl, SIDE EFFECTS ============================================================================*/ -bool sap_chan_sel_init(tHalHandle halHandle, - tSapChSelSpectInfo *pSpectInfoParams, ptSapContext pSapCtx) +static bool sap_chan_sel_init(tHalHandle halHandle, + tSapChSelSpectInfo *pSpectInfoParams, + ptSapContext pSapCtx) { tSapSpectChInfo *pSpectCh = NULL; uint8_t *pChans = NULL; @@ -672,7 +674,7 @@ bool sap_chan_sel_init(tHalHandle halHandle, SIDE EFFECTS ============================================================================*/ -uint32_t sapweight_rssi_count(int8_t rssi, uint16_t count) +static uint32_t sapweight_rssi_count(int8_t rssi, uint16_t count) { int32_t rssiWeight = 0; int32_t countWeight = 0; @@ -716,8 +718,8 @@ uint32_t sapweight_rssi_count(int8_t rssi, uint16_t count) * Return: None. */ -void sap_update_rssi_bsscount(tSapSpectChInfo *pSpectCh, int32_t offset, - bool sap_24g) +static void sap_update_rssi_bsscount(tSapSpectChInfo *pSpectCh, int32_t offset, + bool sap_24g) { tSapSpectChInfo *pExtSpectCh = NULL; int32_t rssi, rsssi_effect; @@ -790,12 +792,12 @@ void sap_update_rssi_bsscount(tSapSpectChInfo *pSpectCh, int32_t offset, * Return: NA. */ -void sap_upd_chan_spec_params(tSirProbeRespBeacon *pBeaconStruct, - uint16_t *channelWidth, - uint16_t *secondaryChannelOffset, - uint16_t *vhtSupport, - uint16_t *centerFreq, - uint16_t *centerFreq_2) +static void sap_upd_chan_spec_params(tSirProbeRespBeacon *pBeaconStruct, + uint16_t *channelWidth, + uint16_t *secondaryChannelOffset, + uint16_t *vhtSupport, + uint16_t *centerFreq, + uint16_t *centerFreq_2) { if (NULL == pBeaconStruct) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -830,7 +832,7 @@ void sap_upd_chan_spec_params(tSirProbeRespBeacon *pBeaconStruct, /** * sap_update_rssi_bsscount_vht_5G() - updates bss count and rssi effect. * - * @pSpectCh: Channel Information + * @spect_ch: Channel Information * @offset: Channel Offset * @num_ch: no.of channels * @@ -840,8 +842,9 @@ void sap_upd_chan_spec_params(tSirProbeRespBeacon *pBeaconStruct, * Return: None. */ -void sap_update_rssi_bsscount_vht_5G(tSapSpectChInfo *spect_ch, int32_t offset, - uint16_t num_ch) +static void sap_update_rssi_bsscount_vht_5G(tSapSpectChInfo *spect_ch, + int32_t offset, + uint16_t num_ch) { int32_t ch_offset; uint16_t i, cnt; @@ -875,12 +878,12 @@ void sap_update_rssi_bsscount_vht_5G(tSapSpectChInfo *spect_ch, int32_t offset, * Return: NA. */ -void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, - uint16_t chan_width, - uint16_t sec_chan_offset, - uint16_t center_freq, - uint16_t center_freq_2, - uint8_t channel_id) +static void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, + uint16_t chan_width, + uint16_t sec_chan_offset, + uint16_t center_freq, + uint16_t center_freq_2, + uint8_t channel_id) { uint16_t num_ch; int32_t offset = 0; @@ -964,7 +967,7 @@ void sap_interference_rssi_count_5G(tSapSpectChInfo *spect_ch, * Return: None. */ -void sap_interference_rssi_count(tSapSpectChInfo *spect_ch) +static void sap_interference_rssi_count(tSapSpectChInfo *spect_ch) { if (NULL == spect_ch) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -1060,21 +1063,18 @@ void sap_interference_rssi_count(tSapSpectChInfo *spect_ch) } } -/*========================================================================== - Function ch_in_pcl - - Description - Check if a channel is in the preferred channel list - - Parameters - sap_ctx SAP context pointer - channel input channel number - - Return Value - true: channel is in PCL - false: channel is not in PCL - ==========================================================================*/ -bool ch_in_pcl(ptSapContext sap_ctx, uint8_t channel) +/** + * ch_in_pcl() - Is channel in the Preferred Channel List (PCL) + * @sap_ctx: SAP context which contains the current PCL + * @channel: Input channel number to be checked + * + * Check if a channel is in the preferred channel list + * + * Return: + * true: channel is in PCL, + * false: channel is not in PCL + */ +static bool ch_in_pcl(ptSapContext sap_ctx, uint8_t channel) { uint32_t i; @@ -1086,32 +1086,21 @@ bool ch_in_pcl(ptSapContext sap_ctx, uint8_t channel) return false; } -/*========================================================================== - FUNCTION sap_compute_spect_weight - - DESCRIPTION - Main function for computing the weight of each channel in the - spectrum based on the RSSI value of the BSSes on the channel - and number of BSS - - DEPENDENCIES - NA. - - PARAMETERS - - IN - pSpectInfoParams : Pointer to the tSpectInfoParams structure - halHandle : Pointer to HAL handle - pResult : Pointer to tScanResultHandle - - RETURN VALUE - void : NULL - - SIDE EFFECTS - ============================================================================*/ -void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, - tHalHandle halHandle, tScanResultHandle pResult, - ptSapContext sap_ctx) +/** + * sap_compute_spect_weight() - Compute spectrum weight + * @pSpectInfoParams: Pointer to the tSpectInfoParams structure + * @halHandle: Pointer to HAL handle + * @pResult: Pointer to tScanResultHandle + * @sap_ctx: Context of the SAP + * + * Main function for computing the weight of each channel in the + * spectrum based on the RSSI value of the BSSes on the channel + * and number of BSS + */ +static void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, + tHalHandle halHandle, + tScanResultHandle pResult, + ptSapContext sap_ctx) { int8_t rssi = 0; uint8_t chn_num = 0; @@ -1299,7 +1288,7 @@ void sap_compute_spect_weight(tSapChSelSpectInfo *pSpectInfoParams, SIDE EFFECTS ============================================================================*/ -void sap_chan_sel_exit(tSapChSelSpectInfo *pSpectInfoParams) +static void sap_chan_sel_exit(tSapChSelSpectInfo *pSpectInfoParams) { /* Free all the allocated memory */ qdf_mem_free(pSpectInfoParams->pSpectCh); @@ -1324,7 +1313,7 @@ void sap_chan_sel_exit(tSapChSelSpectInfo *pSpectInfoParams) SIDE EFFECTS ============================================================================*/ -void sap_sort_chl_weight(tSapChSelSpectInfo *pSpectInfoParams) +static void sap_sort_chl_weight(tSapChSelSpectInfo *pSpectInfoParams) { tSapSpectChInfo temp; @@ -1358,7 +1347,7 @@ void sap_sort_chl_weight(tSapChSelSpectInfo *pSpectInfoParams) * * Return: none */ -void sap_sort_chl_weight_ht80(tSapChSelSpectInfo *pSpectInfoParams) +static void sap_sort_chl_weight_ht80(tSapChSelSpectInfo *pSpectInfoParams) { uint8_t i, j, n; tSapSpectChInfo *pSpectInfo; @@ -1459,7 +1448,7 @@ void sap_sort_chl_weight_ht80(tSapChSelSpectInfo *pSpectInfoParams) * * Return: none */ -void sap_sort_chl_weight_vht160(tSapChSelSpectInfo *pSpectInfoParams) +static void sap_sort_chl_weight_vht160(tSapChSelSpectInfo *pSpectInfoParams) { uint8_t i, j, n, idx; tSapSpectChInfo *pSpectInfo; @@ -1598,7 +1587,7 @@ void sap_sort_chl_weight_vht160(tSapChSelSpectInfo *pSpectInfoParams) * * Return: none */ -void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams) +static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams) { uint8_t i, j; tSapSpectChInfo *pSpectInfo; @@ -1708,7 +1697,7 @@ void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams) SIDE EFFECTS ============================================================================*/ -void sap_sort_chl_weight_ht40_5_g(tSapChSelSpectInfo *pSpectInfoParams) +static void sap_sort_chl_weight_ht40_5_g(tSapChSelSpectInfo *pSpectInfoParams) { uint8_t i, j; tSapSpectChInfo *pSpectInfo; @@ -1790,9 +1779,9 @@ void sap_sort_chl_weight_ht40_5_g(tSapChSelSpectInfo *pSpectInfoParams) SIDE EFFECTS ============================================================================*/ -void sap_sort_chl_weight_all(ptSapContext pSapCtx, - tSapChSelSpectInfo *pSpectInfoParams, - uint32_t operatingBand) +static void sap_sort_chl_weight_all(ptSapContext pSapCtx, + tSapChSelSpectInfo *pSpectInfoParams, + uint32_t operatingBand) { tSapSpectChInfo *pSpectCh = NULL; uint32_t j = 0; @@ -1882,7 +1871,7 @@ void sap_sort_chl_weight_all(ptSapContext pSapCtx, SIDE EFFECTS ============================================================================*/ -bool sap_filter_over_lap_ch(ptSapContext pSapCtx, uint16_t chNum) +static bool sap_filter_over_lap_ch(ptSapContext pSapCtx, uint16_t chNum) { if (pSapCtx->enableOverLapCh) return eSAP_TRUE; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 1ed36bbdef35..25f2eb3886db 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -889,7 +889,7 @@ static inline void sap_event_init(ptWLAN_SAPEvent sapEvent) * * Return: TRUE or FALSE */ -bool +static bool sap_find_target_channel_in_channel_matrix(ptSapContext sapContext, enum phy_ch_width ch_width, uint8_t NOL_channel, @@ -954,7 +954,7 @@ sap_find_target_channel_in_channel_matrix(ptSapContext sapContext, * Return: QDF_STATUS */ -QDF_STATUS +static QDF_STATUS sap_mark_leaking_ch(ptSapContext sap_ctx, enum phy_ch_width ch_width, tSapDfsNolInfo *nol, @@ -1772,7 +1772,7 @@ bool sap_acs_channel_check(ptSapContext sapContext, uint8_t channelNumber) * * Return: none */ -void sap_mark_dfs_channels(ptSapContext sapContext, uint8_t *channels, +static void sap_mark_dfs_channels(ptSapContext sapContext, uint8_t *channels, uint8_t numChannels, uint64_t time) { int i, j; @@ -1843,9 +1843,10 @@ void sap_mark_dfs_channels(ptSapContext sapContext, uint8_t *channels, * This Function is to get bonding channels from primary channel. * */ -uint8_t sap_get_bonding_channels(ptSapContext sapContext, uint8_t channel, - uint8_t *channels, uint8_t size, - ePhyChanBondState chanBondState) +static uint8_t sap_get_bonding_channels(ptSapContext sapContext, + uint8_t channel, + uint8_t *channels, uint8_t size, + ePhyChanBondState chanBondState) { tHalHandle hHal = CDS_GET_HAL_CB(sapContext->p_cds_gctx); tpAniSirGlobal pMac; @@ -2507,8 +2508,9 @@ QDF_STATUS sap_open_session(tHalHandle hHal, ptSapContext sapContext, SIDE EFFECTS ============================================================================*/ -QDF_STATUS sap_goto_starting(ptSapContext sapContext, ptWLAN_SAPEvent sapEvent, - eCsrRoamBssType bssType) +static QDF_STATUS sap_goto_starting(ptSapContext sapContext, + ptWLAN_SAPEvent sapEvent, + eCsrRoamBssType bssType) { /* tHalHandle */ tHalHandle hHal = CDS_GET_HAL_CB(sapContext->p_cds_gctx); @@ -2568,7 +2570,7 @@ QDF_STATUS sap_goto_starting(ptSapContext sapContext, ptWLAN_SAPEvent sapEvent, SIDE EFFECTS ============================================================================*/ -QDF_STATUS sap_goto_disconnecting(ptSapContext sapContext) +static QDF_STATUS sap_goto_disconnecting(ptSapContext sapContext) { QDF_STATUS qdf_ret_status; tHalHandle hHal; @@ -2624,7 +2626,7 @@ static QDF_STATUS sap_roam_session_close_callback(void *pContext) SIDE EFFECTS ============================================================================*/ -QDF_STATUS sap_goto_disconnected(ptSapContext sapContext) +static QDF_STATUS sap_goto_disconnected(ptSapContext sapContext) { QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; tWLAN_SAPEvent sapEvent; @@ -2995,7 +2997,7 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx, SIDE EFFECTS NA ============================================================================*/ -ptSapContext sap_find_valid_concurrent_session(tHalHandle hHal) +static ptSapContext sap_find_valid_concurrent_session(tHalHandle hHal) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); uint8_t intf = 0; @@ -3020,7 +3022,7 @@ ptSapContext sap_find_valid_concurrent_session(tHalHandle hHal) * * Return: Valid SAP context on success, else NULL */ -ptSapContext sap_find_cac_wait_session(tHalHandle handle) +static ptSapContext sap_find_cac_wait_session(tHalHandle handle) { tpAniSirGlobal mac = PMAC_STRUCT(handle); uint8_t i = 0; @@ -3167,7 +3169,7 @@ void sap_cac_reset_notify(tHalHandle hHal) SIDE EFFECTS ============================================================================*/ -QDF_STATUS sap_cac_start_notify(tHalHandle hHal) +static QDF_STATUS sap_cac_start_notify(tHalHandle hHal) { uint8_t intf = 0; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); @@ -3253,7 +3255,7 @@ static QDF_STATUS wlansap_update_pre_cac_end(ptSapContext sap_context, SIDE EFFECTS ============================================================================*/ -QDF_STATUS sap_cac_end_notify(tHalHandle hHal, tCsrRoamInfo *roamInfo) +static QDF_STATUS sap_cac_end_notify(tHalHandle hHal, tCsrRoamInfo *roamInfo) { uint8_t intf; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 457fcf9ecf47..6c159697210c 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -626,7 +626,7 @@ uint16_t wlansap_check_cc_intf(void *Ctx) * Return: The result code associated with * performing the operation */ -QDF_STATUS +static QDF_STATUS wlansap_set_scan_acs_channel_params(tsap_Config_t *pconfig, ptSapContext psap_ctx, void *pusr_context) From 9ce2b4135faafe30e03a683690f4163f4ebbf3d7 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:30:09 -0700 Subject: [PATCH 093/179] qcacld-3.0: Fix -Wmissing-prototypes in sme_power_save We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sme_power_save. Change-Id: I8f6cb46337fc8bfcfd7614cf60dd3f5523d74f1d CRs-Fixed: 1075575 --- core/sme/src/common/sme_power_save.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index 8de99d434323..59d4cc962fd9 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -43,7 +43,7 @@ * * Return: QDF_STATUS */ -QDF_STATUS sme_post_ps_msg_to_wma(uint16_t type, void *body) +static QDF_STATUS sme_post_ps_msg_to_wma(uint16_t type, void *body) { cds_msg_t msg; @@ -142,7 +142,7 @@ static void sme_get_ps_state(tpAniSirGlobal mac_ctx, * * Return: QDF_STATUS */ -QDF_STATUS sme_ps_enable_ps_req_params(tpAniSirGlobal mac_ctx, +static QDF_STATUS sme_ps_enable_ps_req_params(tpAniSirGlobal mac_ctx, uint32_t session_id) { struct sEnablePsParams *enable_ps_req_params; @@ -186,7 +186,7 @@ QDF_STATUS sme_ps_enable_ps_req_params(tpAniSirGlobal mac_ctx, * * Return: QDF_STATUS */ -QDF_STATUS sme_ps_disable_ps_req_params(tpAniSirGlobal mac_ctx, +static QDF_STATUS sme_ps_disable_ps_req_params(tpAniSirGlobal mac_ctx, uint32_t session_id) { struct sDisablePsParams *disable_ps_req_params; @@ -218,7 +218,7 @@ QDF_STATUS sme_ps_disable_ps_req_params(tpAniSirGlobal mac_ctx, * * Return: QDF_STATUS */ -QDF_STATUS sme_ps_enable_uapsd_req_params(tpAniSirGlobal mac_ctx, +static QDF_STATUS sme_ps_enable_uapsd_req_params(tpAniSirGlobal mac_ctx, uint32_t session_id) { @@ -257,7 +257,7 @@ QDF_STATUS sme_ps_enable_uapsd_req_params(tpAniSirGlobal mac_ctx, * * Return: QDF_STATUS */ -QDF_STATUS sme_ps_disable_uapsd_req_params(tpAniSirGlobal mac_ctx, +static QDF_STATUS sme_ps_disable_uapsd_req_params(tpAniSirGlobal mac_ctx, uint32_t session_id) { struct sDisableUapsdParams *disable_uapsd_req_params; @@ -296,7 +296,7 @@ QDF_STATUS sme_ps_disable_uapsd_req_params(tpAniSirGlobal mac_ctx, * * Return: QDF_STATUS */ -QDF_STATUS sme_ps_enter_wowl_req_params(tpAniSirGlobal mac_ctx, +static QDF_STATUS sme_ps_enter_wowl_req_params(tpAniSirGlobal mac_ctx, uint32_t session_id) { struct sSirHalWowlEnterParams *hal_wowl_params; @@ -410,7 +410,7 @@ end: * * Return: QDF_STATUS */ -QDF_STATUS sme_ps_exit_wowl_req_params(tpAniSirGlobal mac_ctx, +static QDF_STATUS sme_ps_exit_wowl_req_params(tpAniSirGlobal mac_ctx, uint32_t session_id) { struct sSirHalWowlExitParams *hal_wowl_msg; From 29e2ca19406fe670328e18239ec5e73ebfded57f Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 14 Oct 2016 12:50:38 -0700 Subject: [PATCH 094/179] qcacld-3.0: Fix -Wmissing-prototypes in csr_api_roam We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in csr_api_roam. Change-Id: I8deb4cab8f7eb1fda11638bc28bbe8919f979335 CRs-Fixed: 1075575 --- core/sme/src/csr/csr_api_roam.c | 86 ++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 2fd7fc8f2775..7d26af4594b9 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -469,7 +469,7 @@ static int8_t csr_find_channel_pwr(struct channel_power * * * Return: None */ -void csr_roam_arrange_ch_list(tpAniSirGlobal mac_ctx, +static void csr_roam_arrange_ch_list(tpAniSirGlobal mac_ctx, tSirUpdateChanParam *chan_list, uint8_t num_channel) { bool prefer_5g = CSR_IS_ROAM_PREFER_5GHZ(mac_ctx); @@ -549,7 +549,7 @@ void csr_roam_arrange_ch_list(tpAniSirGlobal mac_ctx, * * Return: None */ -void csr_roam_sort_channel_for_early_stop(tpAniSirGlobal mac_ctx, +static void csr_roam_sort_channel_for_early_stop(tpAniSirGlobal mac_ctx, tSirUpdateChanList *chan_list, uint8_t num_channel) { tSirUpdateChanList *chan_list_greedy, *chan_list_non_greedy; @@ -1655,7 +1655,7 @@ bool csr_roam_is_ese_ini_feature_enabled(tpAniSirGlobal pMac) * * Return: None */ -void csr_tsm_stats_rsp_processor(tpAniSirGlobal pMac, void *pMsg) +static void csr_tsm_stats_rsp_processor(tpAniSirGlobal pMac, void *pMsg) { tAniGetTsmStatsRsp *pTsmStatsRsp = (tAniGetTsmStatsRsp *) pMsg; @@ -1701,7 +1701,7 @@ void csr_tsm_stats_rsp_processor(tpAniSirGlobal pMac, void *pMsg) * * Return: None */ -void csr_send_ese_adjacent_ap_rep_ind(tpAniSirGlobal pMac, +static void csr_send_ese_adjacent_ap_rep_ind(tpAniSirGlobal pMac, tCsrRoamSession *pSession) { uint32_t roamTS2 = 0; @@ -2028,6 +2028,7 @@ ePhyChanBondState csr_convert_cb_ini_value_to_phy_cb_state(uint32_t cbIniValue) return phyCbState; } +static uint32_t csr_convert_phy_cb_state_to_ini_value(ePhyChanBondState phyCbState) { @@ -2844,7 +2845,7 @@ end: * * Return: void */ -void csr_prune_ch_list(tCsrChannel *ch_lst, bool is_24_GHz) +static void csr_prune_ch_list(tCsrChannel *ch_lst, bool is_24_GHz) { uint8_t idx = 0, num_channels = 0; for ( ; idx < ch_lst->numChannels; idx++) { @@ -3503,11 +3504,13 @@ QDF_STATUS csr_roam_call_callback(tpAniSirGlobal pMac, uint32_t sessionId, } /* Returns whether handoff is currently in progress or not */ +static bool csr_roam_is_handoff_in_progress(tpAniSirGlobal pMac, uint8_t sessionId) { return csr_neighbor_roam_is_handoff_in_progress(pMac, sessionId); } +static QDF_STATUS csr_roam_issue_disassociate(tpAniSirGlobal pMac, uint32_t sessionId, eCsrRoamSubState NewSubstate, bool fMICFailure) @@ -3784,6 +3787,7 @@ csr_roam_get_wps_session_overlap(tpAniSirGlobal pMac, uint32_t sessionId, return status; } +static QDF_STATUS csr_roam_issue_deauth(tpAniSirGlobal pMac, uint32_t sessionId, eCsrRoamSubState NewSubstate) { @@ -3856,6 +3860,7 @@ QDF_STATUS csr_roam_save_connected_bss_desc(tpAniSirGlobal pMac, uint32_t sessio return status; } +static QDF_STATUS csr_roam_prepare_bss_config(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc, @@ -4294,8 +4299,8 @@ static void csr_set_cfg_ssid(tpAniSirGlobal pMac, tSirMacSSid *pSSID) cfg_set_str(pMac, WNI_CFG_SSID, (uint8_t *) pSSID->ssId, len); } -QDF_STATUS csr_set_qos_to_cfg(tpAniSirGlobal pMac, uint32_t sessionId, - eCsrMediaAccessType qosType) +static QDF_STATUS csr_set_qos_to_cfg(tpAniSirGlobal pMac, uint32_t sessionId, + eCsrMediaAccessType qosType) { QDF_STATUS status = QDF_STATUS_SUCCESS; uint32_t QoSEnabled; @@ -4781,6 +4786,7 @@ QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal pMac, uint32_t sessionId, return QDF_STATUS_SUCCESS; } +static QDF_STATUS csr_roam_stop_network(tpAniSirGlobal pMac, uint32_t sessionId, tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc, @@ -4907,9 +4913,9 @@ static eCsrJoinState csr_roam_state_for_same_profile(tpAniSirGlobal mac_ctx, } -eCsrJoinState csr_roam_join(tpAniSirGlobal pMac, uint32_t sessionId, - tCsrScanResultInfo *pScanResult, - tCsrRoamProfile *pProfile) +static eCsrJoinState csr_roam_join(tpAniSirGlobal pMac, uint32_t sessionId, + tCsrScanResultInfo *pScanResult, + tCsrRoamProfile *pProfile) { eCsrJoinState eRoamState = eCsrContinueRoaming; tSirBssDescription *pBssDesc = &pScanResult->BssDescriptor; @@ -4986,6 +4992,7 @@ eCsrJoinState csr_roam_join(tpAniSirGlobal pMac, uint32_t sessionId, return eRoamState; } +static QDF_STATUS csr_roam_should_roam(tpAniSirGlobal pMac, uint32_t sessionId, tSirBssDescription *pBssDesc, uint32_t roamId) { @@ -5492,6 +5499,7 @@ static QDF_STATUS csr_roam(tpAniSirGlobal pMac, tSmeCmd *pCommand) return status; } +static QDF_STATUS csr_process_ft_reassoc_roam_command(tpAniSirGlobal pMac, tSmeCmd *pCommand) { @@ -6074,7 +6082,7 @@ bool csr_roam_is_fast_roam_enabled(tpAniSirGlobal pMac, uint32_t sessionId) } #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH -eCsrPhyMode csr_roamdot11mode_to_phymode(uint8_t dot11mode) +static eCsrPhyMode csr_roamdot11mode_to_phymode(uint8_t dot11mode) { eCsrPhyMode phymode = eCSR_DOT11_MODE_abg; @@ -6115,7 +6123,7 @@ eCsrPhyMode csr_roamdot11mode_to_phymode(uint8_t dot11mode) #endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD -void csr_roam_synch_clean_up (tpAniSirGlobal mac, uint8_t session_id) +static void csr_roam_synch_clean_up (tpAniSirGlobal mac, uint8_t session_id) { cds_msg_t msg; struct roam_offload_synch_fail *roam_offload_failed = NULL; @@ -7889,7 +7897,8 @@ csr_roam_reassoc(tpAniSirGlobal mac_ctx, uint32_t session_id, return status; } -QDF_STATUS csr_roam_join_last_profile(tpAniSirGlobal pMac, uint32_t sessionId) +static QDF_STATUS csr_roam_join_last_profile(tpAniSirGlobal pMac, + uint32_t sessionId) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tScanResultHandle hBSSList = NULL; @@ -8567,10 +8576,11 @@ static void csr_roam_join_rsp_processor(tpAniSirGlobal pMac, } /*else: ( eSIR_SME_SUCCESS == pSmeJoinRsp->statusCode ) */ } -QDF_STATUS csr_roam_issue_join(tpAniSirGlobal pMac, uint32_t sessionId, - tSirBssDescription *pSirBssDesc, - tDot11fBeaconIEs *pIes, tCsrRoamProfile *pProfile, - uint32_t roamId) +static QDF_STATUS csr_roam_issue_join(tpAniSirGlobal pMac, uint32_t sessionId, + tSirBssDescription *pSirBssDesc, + tDot11fBeaconIEs *pIes, + tCsrRoamProfile *pProfile, + uint32_t roamId) { QDF_STATUS status; sms_log(pMac, LOG1, "Attempting to Join Bssid= " MAC_ADDRESS_STR, @@ -9211,6 +9221,7 @@ csr_check_profile_in_scan_cache(tpAniSirGlobal mac_ctx, return true; } +static void csr_roam_roaming_state_disassoc_rsp_processor(tpAniSirGlobal pMac, tSirSmeDisassocRsp *pSmeRsp) { @@ -10173,6 +10184,7 @@ free_filter: return status; } +static bool csr_roam_issue_wm_status_change(tpAniSirGlobal pMac, uint32_t sessionId, eCsrRoamWmStatusChangeTypes Type, tSirSmeRsp *pSmeRsp) @@ -11694,6 +11706,7 @@ void csr_roam_completion(tpAniSirGlobal pMac, uint32_t sessionId, } } +static QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId, uint32_t type, tSirSmeRsp *pSirMsg) { @@ -11809,7 +11822,7 @@ QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId, } -void csr_roam_wm_status_change_complete(tpAniSirGlobal pMac) +static void csr_roam_wm_status_change_complete(tpAniSirGlobal pMac) { tListElem *pEntry; tSmeCmd *pCommand; @@ -12315,9 +12328,9 @@ static ePhyChanBondState csr_get_cb_mode_from_ies(tpAniSirGlobal pMac, return eRet; } -bool csr_is_encryption_in_list(tpAniSirGlobal pMac, - tCsrEncryptionList *pCipherList, - eCsrEncryptionType encryptionType) +static bool csr_is_encryption_in_list(tpAniSirGlobal pMac, + tCsrEncryptionList *pCipherList, + eCsrEncryptionType encryptionType) { bool fFound = false; uint32_t idx; @@ -12330,8 +12343,8 @@ bool csr_is_encryption_in_list(tpAniSirGlobal pMac, return fFound; } -bool csr_is_auth_in_list(tpAniSirGlobal pMac, tCsrAuthList *pAuthList, - eCsrAuthType authType) +static bool csr_is_auth_in_list(tpAniSirGlobal pMac, tCsrAuthList *pAuthList, + eCsrAuthType authType) { bool fFound = false; uint32_t idx; @@ -12444,7 +12457,7 @@ bool csr_roam_is_same_profile_keys(tpAniSirGlobal pMac, /* IBSS */ -uint8_t csr_roam_get_ibss_start_channel_number50(tpAniSirGlobal pMac) +static uint8_t csr_roam_get_ibss_start_channel_number50(tpAniSirGlobal pMac) { uint8_t channel = 0; uint32_t idx; @@ -12503,7 +12516,7 @@ uint8_t csr_roam_get_ibss_start_channel_number50(tpAniSirGlobal pMac) return channel; } -uint8_t csr_roam_get_ibss_start_channel_number24(tpAniSirGlobal pMac) +static uint8_t csr_roam_get_ibss_start_channel_number24(tpAniSirGlobal pMac) { uint8_t channel = 1; uint32_t idx; @@ -15255,7 +15268,10 @@ void csr_get_vdev_type_nss(tpAniSirGlobal mac_ctx, sms_log(mac_ctx, LOG1, FL("mode - %d: nss_2g - %d, 5g - %d"), dev_mode, *nss_2g, *nss_5g); } -QDF_STATUS csr_issue_add_sta_for_session_req(tpAniSirGlobal pMac, uint32_t sessionId, + +static +QDF_STATUS csr_issue_add_sta_for_session_req(tpAniSirGlobal pMac, + uint32_t sessionId, tSirMacAddr sessionMacAddr, uint32_t type, uint32_t subType) { @@ -15595,10 +15611,11 @@ QDF_STATUS csr_process_del_sta_session_rsp(tpAniSirGlobal pMac, uint8_t *pMsg) } -QDF_STATUS csr_issue_del_sta_for_session_req(tpAniSirGlobal pMac, uint32_t sessionId, - tSirMacAddr sessionMacAddr, - csr_roamSessionCloseCallback callback, - void *pContext) +static QDF_STATUS +csr_issue_del_sta_for_session_req(tpAniSirGlobal pMac, uint32_t sessionId, + tSirMacAddr sessionMacAddr, + csr_roamSessionCloseCallback callback, + void *pContext) { QDF_STATUS status = QDF_STATUS_SUCCESS; tSmeCmd *pCommand; @@ -16242,6 +16259,7 @@ tListElem *csr_roam_find_in_pe_stats_req_list(tpAniSirGlobal pMac, uint32_t stat return pEntry; } +static tListElem *csr_roam_checkn_update_client_req_list(tpAniSirGlobal pMac, tCsrStatsClientReqInfo *pStaEntry, bool update) @@ -16386,6 +16404,7 @@ tCsrStatsClientReqInfo *csr_roam_insert_entry_into_list(tpAniSirGlobal pMac, return pNewStaEntry; } +static tCsrPeStatsReqInfo *csr_roam_insert_entry_into_pe_stats_req_list(tpAniSirGlobal pMac, tDblLinkList * pStaList, @@ -17461,8 +17480,8 @@ static void check_allowed_ssid_list(tSirRoamOffloadScanReq *req_buffer, #define RSO_ABORT_SCAN_ALLOW_MASK (RSO_START_BIT | RSO_RESTART_BIT | \ RSO_UPDATE_CFG_BIT | RSO_ABORT_SCAN_BIT) -bool csr_is_RSO_cmd_allowed(tpAniSirGlobal mac_ctx, uint8_t command, - uint8_t session_id) +static bool csr_is_RSO_cmd_allowed(tpAniSirGlobal mac_ctx, uint8_t command, + uint8_t session_id) { tpCsrNeighborRoamControlInfo neigh_roam_info = &mac_ctx->roam.neighborRoamInfo[session_id]; @@ -17502,7 +17521,8 @@ bool csr_is_RSO_cmd_allowed(tpAniSirGlobal mac_ctx, uint8_t command, * * Return: QDF_STATUS */ -QDF_STATUS csr_roam_send_rso_cmd(tpAniSirGlobal mac_ctx, uint8_t session_id, +static QDF_STATUS csr_roam_send_rso_cmd(tpAniSirGlobal mac_ctx, + uint8_t session_id, tSirRoamOffloadScanReq *request_buf) { QDF_STATUS status; From 00fa67df8177b64e54ddac9c751d39530960ee31 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 14 Oct 2016 08:07:36 -0700 Subject: [PATCH 095/179] qcacld-3.0: Fix -Wmissing-prototypes in csr_api_scan We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in csr_api_scan. Change-Id: Ib383b247ff466a5b99cb97cc504a2dddf79a8b66 CRs-Fixed: 1075575 --- core/sme/src/csr/csr_api_scan.c | 93 +++++++++++++++++---------------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 0b1bfe38ef68..966341a82a62 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -645,9 +645,9 @@ release_cmd: return status; } -QDF_STATUS csr_issue_roam_after_lostlink_scan(tpAniSirGlobal pMac, - uint32_t sessionId, - eCsrRoamReason reason) +static QDF_STATUS csr_issue_roam_after_lostlink_scan(tpAniSirGlobal pMac, + uint32_t sessionId, + eCsrRoamReason reason) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tScanResultHandle hBSSList = NULL; @@ -2157,7 +2157,7 @@ QDF_STATUS csr_scan_get_result(tpAniSirGlobal pMac, * csr_scan_get_result returns with a failure because * of not being able to find the roaming BSS. */ -bool csr_scan_flush_denied(tpAniSirGlobal pMac) +static bool csr_scan_flush_denied(tpAniSirGlobal pMac) { uint8_t sessionId; @@ -2265,7 +2265,7 @@ void csr_scan_flush_bss_entry(tpAniSirGlobal pMac, * @return Status */ -QDF_STATUS csr_check11d_channel(uint8_t channelId, uint8_t *pChannelList, +static QDF_STATUS csr_check11d_channel(uint8_t channelId, uint8_t *pChannelList, uint32_t numChannels) { QDF_STATUS status = QDF_STATUS_E_FAILURE; @@ -2526,8 +2526,9 @@ QDF_STATUS csr_scanning_state_msg_processor(tpAniSirGlobal pMac, return status; } -void csr_check_n_save_wsc_ie(tpAniSirGlobal pMac, tSirBssDescription *pNewBssDescr, - tSirBssDescription *pOldBssDescr) +static void csr_check_n_save_wsc_ie(tpAniSirGlobal pMac, + tSirBssDescription *pNewBssDescr, + tSirBssDescription *pOldBssDescr) { int idx, len; uint8_t *pbIe; @@ -2563,10 +2564,11 @@ void csr_check_n_save_wsc_ie(tpAniSirGlobal pMac, tSirBssDescription *pNewBssDes } /* pIes may be NULL */ -bool csr_remove_dup_bss_description(tpAniSirGlobal pMac, - tSirBssDescription *bss_dscp, - tDot11fBeaconIEs *pIes, tAniSSID *pSsid, - unsigned long *timer, bool fForced) +static bool csr_remove_dup_bss_description(tpAniSirGlobal pMac, + tSirBssDescription *bss_dscp, + tDot11fBeaconIEs *pIes, + tAniSSID *pSsid, + unsigned long *timer, bool fForced) { tListElem *pEntry; tCsrScanResult *scan_entry; @@ -2648,9 +2650,10 @@ bool csr_remove_dup_bss_description(tpAniSirGlobal pMac, return fRC; } -QDF_STATUS csr_add_pmkid_candidate_list(tpAniSirGlobal pMac, uint32_t sessionId, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) +static QDF_STATUS csr_add_pmkid_candidate_list(tpAniSirGlobal pMac, + uint32_t sessionId, + tSirBssDescription *pBssDesc, + tDot11fBeaconIEs *pIes) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); @@ -2709,10 +2712,10 @@ QDF_STATUS csr_add_pmkid_candidate_list(tpAniSirGlobal pMac, uint32_t sessionId, * profile. If it is found, it return the sessionId, else it return invalid * sessionID */ -QDF_STATUS csr_process_bss_desc_for_pmkid_list(tpAniSirGlobal pMac, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes, - uint8_t sessionId) +static QDF_STATUS csr_process_bss_desc_for_pmkid_list(tpAniSirGlobal pMac, + tSirBssDescription *pBssDesc, + tDot11fBeaconIEs *pIes, + uint8_t sessionId) { tCsrRoamSession *pSession; tDot11fBeaconIEs *pIesLocal = pIes; @@ -2753,9 +2756,10 @@ QDF_STATUS csr_process_bss_desc_for_pmkid_list(tpAniSirGlobal pMac, } #ifdef FEATURE_WLAN_WAPI -QDF_STATUS csr_add_bkid_candidate_list(tpAniSirGlobal pMac, uint32_t sessionId, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) +static QDF_STATUS csr_add_bkid_candidate_list(tpAniSirGlobal pMac, + uint32_t sessionId, + tSirBssDescription *pBssDesc, + tDot11fBeaconIEs *pIes) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); @@ -2803,9 +2807,9 @@ QDF_STATUS csr_add_bkid_candidate_list(tpAniSirGlobal pMac, uint32_t sessionId, * This function checks whether new AP is found for the current connected * profile, if so add to BKIDCandidateList */ -bool csr_process_bss_desc_for_bkid_list(tpAniSirGlobal pMac, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) +static bool csr_process_bss_desc_for_bkid_list(tpAniSirGlobal pMac, + tSirBssDescription *pBssDesc, + tDot11fBeaconIEs *pIes) { bool fRC = false; tDot11fBeaconIEs *pIesLocal = pIes; @@ -3485,9 +3489,9 @@ QDF_STATUS csr_set_country_code(tpAniSirGlobal pMac, uint8_t *pCountry) /* caller allocated memory for pNumChn and pChnPowerInfo */ /* As input, *pNumChn has the size of the array of pChnPowerInfo */ /* Upon return, *pNumChn has the number of channels assigned. */ -void csr_get_channel_power_info(tpAniSirGlobal pMac, tDblLinkList *list, - uint32_t *num_ch, - struct channel_power *chn_pwr_info) +static void csr_get_channel_power_info(tpAniSirGlobal pMac, tDblLinkList *list, + uint32_t *num_ch, + struct channel_power *chn_pwr_info) { tListElem *entry; uint32_t chn_idx = 0, idx; @@ -3512,7 +3516,7 @@ void csr_get_channel_power_info(tpAniSirGlobal pMac, tDblLinkList *list, } #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR -void csr_diag_apply_country_info(tpAniSirGlobal mac_ctx) +static void csr_diag_apply_country_info(tpAniSirGlobal mac_ctx) { host_log_802_11d_pkt_type *p11dLog; struct channel_power chnPwrInfo[WNI_CFG_VALID_CHANNEL_LIST_LEN]; @@ -3765,10 +3769,11 @@ void csr_reinit_scan_cmd(tpAniSirGlobal pMac, tSmeCmd *pCommand) qdf_mem_set(&pCommand->u.scanCmd, sizeof(tScanCmd), 0); } -eCsrScanCompleteNextCommand csr_scan_get_next_command_state(tpAniSirGlobal pMac, - tSmeCmd *pCommand, - bool fSuccess, - uint8_t *chan) +static eCsrScanCompleteNextCommand csr_scan_get_next_command_state( + tpAniSirGlobal pMac, + tSmeCmd *pCommand, + bool fSuccess, + uint8_t *chan) { eCsrScanCompleteNextCommand NextCommand = eCsrNextScanNothing; int8_t channel; @@ -3831,7 +3836,7 @@ eCsrScanCompleteNextCommand csr_scan_get_next_command_state(tpAniSirGlobal pMac, } /* Return whether the pCommand is finished. */ -bool csr_handle_scan11d1_failure(tpAniSirGlobal pMac, tSmeCmd *pCommand) +static bool csr_handle_scan11d1_failure(tpAniSirGlobal pMac, tSmeCmd *pCommand) { bool fRet = true; @@ -3930,8 +3935,8 @@ csr_diag_scan_complete(tpAniSirGlobal pMac, * * Return: QDF_STATUS */ -QDF_STATUS csr_save_profile(tpAniSirGlobal mac_ctx, - tSmeCmd *save_cmd, tSmeCmd *command) +static QDF_STATUS csr_save_profile(tpAniSirGlobal mac_ctx, + tSmeCmd *save_cmd, tSmeCmd *command) { tCsrScanResult *scan_result; tCsrScanResult *temp; @@ -4333,10 +4338,10 @@ csr_scan_remove_dup_bss_description_from_interim_list(tpAniSirGlobal mac_ctx, /* Caller allocated memory pfNewBssForConn to return whether new candidate for */ /* current connection is found. Cannot be NULL */ -tCsrScanResult *csr_scan_save_bss_description_to_interim_list(tpAniSirGlobal pMac, - tSirBssDescription * - pBSSDescription, - tDot11fBeaconIEs *pIes) +static tCsrScanResult *csr_scan_save_bss_description_to_interim_list( + tpAniSirGlobal pMac, + tSirBssDescription *pBSSDescription, + tDot11fBeaconIEs *pIes) { tCsrScanResult *pCsrBssDescription = NULL; uint32_t cbBSSDesc; @@ -4674,7 +4679,7 @@ QDF_STATUS csr_scan_process_single_bssdescr(tpAniSirGlobal mac_ctx, } -bool csr_scan_is_wild_card_scan(tpAniSirGlobal pMac, tSmeCmd *pCommand) +static bool csr_scan_is_wild_card_scan(tpAniSirGlobal pMac, tSmeCmd *pCommand) { uint8_t bssid[QDF_MAC_ADDR_SIZE] = {0}; /* @@ -4847,7 +4852,7 @@ QDF_STATUS csr_move_bss_to_head_from_bssid(tpAniSirGlobal pMac, /* Remove the BSS if possible. */ /* Return -- true == the BSS is remove. False == Fail to remove it */ /* This function is called when list lock is held. Be caution what functions it can call. */ -bool csr_scan_age_out_bss(tpAniSirGlobal pMac, tCsrScanResult *pResult) +static bool csr_scan_age_out_bss(tpAniSirGlobal pMac, tCsrScanResult *pResult) { bool fRet = false; uint32_t i; @@ -4949,9 +4954,9 @@ QDF_STATUS csr_scan_age_results(tpAniSirGlobal pMac, return status; } -QDF_STATUS csr_send_mb_scan_req(tpAniSirGlobal pMac, uint16_t sessionId, - tCsrScanRequest *pScanReq, - tScanReqParam *pScanReqParam) +static QDF_STATUS csr_send_mb_scan_req(tpAniSirGlobal pMac, uint16_t sessionId, + tCsrScanRequest *pScanReq, + tScanReqParam *pScanReqParam) { QDF_STATUS status = QDF_STATUS_SUCCESS; tSirSmeScanReq *pMsg; From 6b6d1894cb17094246ddd04d33785d3db50d4a39 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:34:09 -0700 Subject: [PATCH 096/179] qcacld-3.0: Fix -Wmissing-prototypes in csr_neighbor_roam We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in csr_neighbor_roam. Change-Id: Ifb153a2f1d3e24e687447e980b50bddb582f5344 CRs-Fixed: 1075575 --- core/sme/src/csr/csr_neighbor_roam.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index 535171b7f3f6..78d1d8661f4f 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -270,8 +270,9 @@ static void csr_neighbor_roam_reset_channel_info(tpCsrNeighborRoamChannelInfo * * Return: None */ -void csr_neighbor_roam_reset_connected_state_control_info(tpAniSirGlobal pMac, - uint8_t sessionId) +static void csr_neighbor_roam_reset_connected_state_control_info( + tpAniSirGlobal pMac, + uint8_t sessionId) { tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; @@ -294,8 +295,9 @@ void csr_neighbor_roam_reset_connected_state_control_info(tpAniSirGlobal pMac, sizeof(tCsrHandoffRequest)); } -void csr_neighbor_roam_reset_report_scan_state_control_info(tpAniSirGlobal pMac, - uint8_t sessionId) +static void csr_neighbor_roam_reset_report_scan_state_control_info( + tpAniSirGlobal pMac, + uint8_t sessionId) { tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; @@ -325,8 +327,8 @@ void csr_neighbor_roam_reset_report_scan_state_control_info(tpAniSirGlobal pMac, * * Return: None */ -void csr_neighbor_roam_reset_init_state_control_info(tpAniSirGlobal pMac, - uint8_t sessionId) +static void csr_neighbor_roam_reset_init_state_control_info(tpAniSirGlobal pMac, + uint8_t sessionId) { csr_neighbor_roam_reset_connected_state_control_info(pMac, sessionId); @@ -655,7 +657,7 @@ QDF_STATUS csr_neighbor_roam_merge_channel_lists(tpAniSirGlobal pMac, * * Return: bool */ -bool csr_neighbor_roam_is_ssid_and_security_match(tpAniSirGlobal pMac, +static bool csr_neighbor_roam_is_ssid_and_security_match(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pCurProfile, tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes) { @@ -1194,7 +1196,7 @@ QDF_STATUS csr_neighbor_roam_indicate_connect( \return QDF_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -QDF_STATUS csr_neighbor_roam_init11r_assoc_info(tpAniSirGlobal pMac) +static QDF_STATUS csr_neighbor_roam_init11r_assoc_info(tpAniSirGlobal pMac) { QDF_STATUS status; uint8_t i; @@ -1487,7 +1489,7 @@ bool csr_neighbor_middle_of_roaming(tpAniSirGlobal pMac, uint8_t sessionId) * * Return: status */ -QDF_STATUS csr_neighbor_roam_process_handoff_req( +static QDF_STATUS csr_neighbor_roam_process_handoff_req( tpAniSirGlobal mac_ctx, uint8_t session_id) { From 054d0285d080c79b6f09cc70c3347b98f0e7f5b4 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:35:54 -0700 Subject: [PATCH 097/179] qcacld-3.0: Fix -Wmissing-prototypes in csr_util We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in csr_util. Change-Id: Ie98337bbb04e4518500b75872aa092acfb7c70c6 CRs-Fixed: 1075575 --- core/sme/src/csr/csr_util.c | 159 ++++++++++++++++++++---------------- 1 file changed, 87 insertions(+), 72 deletions(-) diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 5aadb0a1f0b1..b1766b31b769 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -354,7 +354,7 @@ bool csr_is_conn_state_wds(tpAniSirGlobal pMac, uint32_t sessionId) csr_is_conn_state_disconnected_wds(pMac, sessionId); } -bool csr_is_conn_state_ap(tpAniSirGlobal pMac, uint32_t sessionId) +static bool csr_is_conn_state_ap(tpAniSirGlobal pMac, uint32_t sessionId) { tCsrRoamSession *pSession; pSession = CSR_GET_SESSION(pMac, sessionId); @@ -494,8 +494,10 @@ uint8_t csr_get_concurrent_operation_channel(tpAniSirGlobal mac_ctx) * * Return: none */ -void csr_get_ch_from_ht_profile(tpAniSirGlobal pMac, tCsrRoamHTProfile *htp, - uint16_t och, uint16_t *cfreq, uint16_t *hbw) +static void csr_get_ch_from_ht_profile(tpAniSirGlobal pMac, + tCsrRoamHTProfile *htp, + uint16_t och, uint16_t *cfreq, + uint16_t *hbw) { uint16_t cch, ch_bond; @@ -1089,7 +1091,7 @@ bool csr_is_ibss_bss_desc(tSirBssDescription *pSirBssDesc) return (bool) dot11Caps.ibss; } -bool csr_is_qo_s_bss_desc(tSirBssDescription *pSirBssDesc) +static bool csr_is_qos_bss_desc(tSirBssDescription *pSirBssDesc) { tSirMacCapabilityInfo dot11Caps = csr_get_bss_capabilities(pSirBssDesc); @@ -1180,8 +1182,9 @@ bool csr_is_ssid_equal(tHalHandle hHal, tSirBssDescription *pSirBssDesc1, } /* pIes can be passed in as NULL if the caller doesn't have one prepared */ -bool csr_is_bss_description_wme(tHalHandle hHal, tSirBssDescription *pSirBssDesc, - tDot11fBeaconIEs *pIes) +static bool csr_is_bss_description_wme(tHalHandle hHal, + tSirBssDescription *pSirBssDesc, + tDot11fBeaconIEs *pIes) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); /* Assume that WME is found... */ @@ -1234,7 +1237,7 @@ eCsrMediaAccessType csr_get_qo_s_from_bss_desc(tHalHandle hHal, qosType = eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP; } else { /* if the QoS bit is on, then the AP is advertising 11E QoS... */ - if (csr_is_qo_s_bss_desc(pSirBssDesc)) { + if (csr_is_qos_bss_desc(pSirBssDesc)) { qosType = eCSR_MEDIUM_ACCESS_11e_eDCF; } else { qosType = eCSR_MEDIUM_ACCESS_DCF; @@ -1357,7 +1360,8 @@ uint32_t csr_get_rts_thresh(tHalHandle hHal) return pMac->roam.configParam.RTSThreshold; } -eCsrPhyMode csr_translate_to_phy_mode_from_bss_desc(tSirBssDescription *pSirBssDesc) +static eCsrPhyMode csr_translate_to_phy_mode_from_bss_desc( + tSirBssDescription *pSirBssDesc) { eCsrPhyMode phyMode; @@ -1489,8 +1493,10 @@ QDF_STATUS csr_get_phy_mode_from_bss(tpAniSirGlobal pMac, * * Return: true or false */ -bool csr_get_phy_mode_in_use(eCsrPhyMode phyModeIn, eCsrPhyMode bssPhyMode, - bool f5GhzBand, eCsrCfgDot11Mode *pCfgDot11ModeToUse) +static bool csr_get_phy_mode_in_use(eCsrPhyMode phyModeIn, + eCsrPhyMode bssPhyMode, + bool f5GhzBand, + eCsrCfgDot11Mode *pCfgDot11ModeToUse) { bool fMatch = false; eCsrCfgDot11Mode cfgDot11Mode; @@ -1882,7 +1888,7 @@ bool csr_is_profile_rsn(tCsrRoamProfile *pProfile) * * Return: QDF_STATUS */ -QDF_STATUS csr_update_mcc_p2p_beacon_interval(tpAniSirGlobal mac_ctx) +static QDF_STATUS csr_update_mcc_p2p_beacon_interval(tpAniSirGlobal mac_ctx) { uint32_t session_id = 0; tCsrRoamSession *roam_session; @@ -1926,8 +1932,9 @@ QDF_STATUS csr_update_mcc_p2p_beacon_interval(tpAniSirGlobal mac_ctx) return QDF_STATUS_E_FAILURE; } -uint16_t csr_calculate_mcc_beacon_interval(tpAniSirGlobal pMac, uint16_t sta_bi, - uint16_t go_gbi) +static uint16_t csr_calculate_mcc_beacon_interval(tpAniSirGlobal pMac, + uint16_t sta_bi, + uint16_t go_gbi) { uint8_t num_beacons = 0; uint8_t is_multiple = 0; @@ -2560,7 +2567,7 @@ static bool csr_is_auth_wpa_psk(tpAniSirGlobal pMac, (pMac, AllSuites, cAllSuites, csr_wpa_oui[02], Oui); } -uint8_t csr_get_oui_index_from_cipher(eCsrEncryptionType enType) +static uint8_t csr_get_oui_index_from_cipher(eCsrEncryptionType enType) { uint8_t OUIIndex; @@ -2612,14 +2619,14 @@ uint8_t csr_get_oui_index_from_cipher(eCsrEncryptionType enType) * * Return: bool */ -bool csr_get_rsn_information(tHalHandle hal, tCsrAuthList *auth_type, - eCsrEncryptionType encr_type, - tCsrEncryptionList *mc_encryption, - tDot11fIERSN *rsn_ie, uint8_t *ucast_cipher, - uint8_t *mcast_cipher, uint8_t *auth_suite, - tCsrRSNCapabilities *capabilities, - eCsrAuthType *negotiated_authtype, - eCsrEncryptionType *negotiated_mccipher) +static bool csr_get_rsn_information(tHalHandle hal, tCsrAuthList *auth_type, + eCsrEncryptionType encr_type, + tCsrEncryptionList *mc_encryption, + tDot11fIERSN *rsn_ie, uint8_t *ucast_cipher, + uint8_t *mcast_cipher, uint8_t *auth_suite, + tCsrRSNCapabilities *capabilities, + eCsrAuthType *negotiated_authtype, + eCsrEncryptionType *negotiated_mccipher) { tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); bool acceptable_cipher = false; @@ -2860,14 +2867,14 @@ csr_is_pmf_capabilities_in_rsn_match(tHalHandle hHal, } #endif -bool csr_is_rsn_match(tHalHandle hHal, tCsrAuthList *pAuthType, - eCsrEncryptionType enType, - tCsrEncryptionList *pEnMcType, - bool *pMFPEnabled, uint8_t *pMFPRequired, - uint8_t *pMFPCapable, - tDot11fBeaconIEs *pIes, - eCsrAuthType *pNegotiatedAuthType, - eCsrEncryptionType *pNegotiatedMCCipher) +static bool csr_is_rsn_match(tHalHandle hHal, tCsrAuthList *pAuthType, + eCsrEncryptionType enType, + tCsrEncryptionList *pEnMcType, + bool *pMFPEnabled, uint8_t *pMFPRequired, + uint8_t *pMFPCapable, + tDot11fBeaconIEs *pIes, + eCsrAuthType *pNegotiatedAuthType, + eCsrEncryptionType *pNegotiatedMCCipher) { bool fRSNMatch = false; @@ -2888,8 +2895,8 @@ bool csr_is_rsn_match(tHalHandle hHal, tCsrAuthList *pAuthType, return fRSNMatch; } -bool csr_lookup_pmkid(tpAniSirGlobal pMac, uint32_t sessionId, uint8_t *pBSSId, - uint8_t *pPMKId) +static bool csr_lookup_pmkid(tpAniSirGlobal pMac, uint32_t sessionId, + uint8_t *pBSSId, uint8_t *pPMKId) { bool fRC = false, fMatchFound = false; uint32_t Index; @@ -3099,13 +3106,14 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, * * Return: bool */ -bool csr_get_wapi_information(tHalHandle hal, tCsrAuthList *auth_type, - eCsrEncryptionType encr_type, - tCsrEncryptionList *mc_encryption, - tDot11fIEWAPI *wapi_ie, uint8_t *ucast_cipher, - uint8_t *mcast_cipher, uint8_t *auth_suite, - eCsrAuthType *negotiated_authtype, - eCsrEncryptionType *negotiated_mccipher) +static bool csr_get_wapi_information(tHalHandle hal, tCsrAuthList *auth_type, + eCsrEncryptionType encr_type, + tCsrEncryptionList *mc_encryption, + tDot11fIEWAPI *wapi_ie, + uint8_t *ucast_cipher, + uint8_t *mcast_cipher, uint8_t *auth_suite, + eCsrAuthType *negotiated_authtype, + eCsrEncryptionType *negotiated_mccipher) { tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); bool acceptable_cipher = false; @@ -3215,10 +3223,12 @@ end: return acceptable_cipher; } -bool csr_is_wapi_match(tHalHandle hHal, tCsrAuthList *pAuthType, - eCsrEncryptionType enType, tCsrEncryptionList *pEnMcType, - tDot11fBeaconIEs *pIes, eCsrAuthType *pNegotiatedAuthType, - eCsrEncryptionType *pNegotiatedMCCipher) +static bool csr_is_wapi_match(tHalHandle hHal, tCsrAuthList *pAuthType, + eCsrEncryptionType enType, + tCsrEncryptionList *pEnMcType, + tDot11fBeaconIEs *pIes, + eCsrAuthType *pNegotiatedAuthType, + eCsrEncryptionType *pNegotiatedMCCipher) { bool fWapiMatch = false; @@ -3226,13 +3236,14 @@ bool csr_is_wapi_match(tHalHandle hHal, tCsrAuthList *pAuthType, fWapiMatch = csr_get_wapi_information(hHal, pAuthType, enType, pEnMcType, &pIes->WAPI, NULL, NULL, NULL, - pNegotiatedAuthType, pNegotiatedMCCipher); + pNegotiatedAuthType, + pNegotiatedMCCipher); return fWapiMatch; } -bool csr_lookup_bkid(tpAniSirGlobal pMac, uint32_t sessionId, uint8_t *pBSSId, - uint8_t *pBKId) +static bool csr_lookup_bkid(tpAniSirGlobal pMac, uint32_t sessionId, + uint8_t *pBSSId, uint8_t *pBKId) { bool fRC = false, fMatchFound = false; uint32_t Index; @@ -3391,12 +3402,13 @@ uint8_t csr_construct_wapi_ie(tpAniSirGlobal pMac, uint32_t sessionId, * * Return: bool */ -bool csr_get_wpa_cyphers(tpAniSirGlobal mac_ctx, tCsrAuthList *auth_type, - eCsrEncryptionType encr_type, tCsrEncryptionList *mc_encryption, - tDot11fIEWPA *wpa_ie, uint8_t *ucast_cipher, - uint8_t *mcast_cipher, uint8_t *auth_suite, - eCsrAuthType *negotiated_authtype, - eCsrEncryptionType *negotiated_mccipher) +static bool csr_get_wpa_cyphers(tpAniSirGlobal mac_ctx, tCsrAuthList *auth_type, + eCsrEncryptionType encr_type, + tCsrEncryptionList *mc_encryption, + tDot11fIEWPA *wpa_ie, uint8_t *ucast_cipher, + uint8_t *mcast_cipher, uint8_t *auth_suite, + eCsrAuthType *negotiated_authtype, + eCsrEncryptionType *negotiated_mccipher) { bool acceptable_cipher = false; uint8_t c_ucast_cipher = 0; @@ -3501,12 +3513,13 @@ end: return acceptable_cipher; } -bool csr_is_wpa_encryption_match(tpAniSirGlobal pMac, tCsrAuthList *pAuthType, - eCsrEncryptionType enType, - tCsrEncryptionList *pEnMcType, - tDot11fBeaconIEs *pIes, - eCsrAuthType *pNegotiatedAuthtype, - eCsrEncryptionType *pNegotiatedMCCipher) +static bool csr_is_wpa_encryption_match(tpAniSirGlobal pMac, + tCsrAuthList *pAuthType, + eCsrEncryptionType enType, + tCsrEncryptionList *pEnMcType, + tDot11fBeaconIEs *pIes, + eCsrAuthType *pNegotiatedAuthtype, + eCsrEncryptionType *pNegotiatedMCCipher) { bool fWpaMatch = false; @@ -3814,12 +3827,14 @@ tAniEdType csr_translate_encrypt_type_to_ed_type(eCsrEncryptionType EncryptType) * * Return: bool */ -bool csr_validate_wep(tpAniSirGlobal mac_ctx, eCsrEncryptionType uc_encry_type, - tCsrAuthList *auth_list, - tCsrEncryptionList *mc_encryption_list, - eCsrAuthType *negotiated_authtype, - eCsrEncryptionType *negotiated_mc_encry, - tSirBssDescription *bss_descr, tDot11fBeaconIEs *ie_ptr) +static bool csr_validate_wep(tpAniSirGlobal mac_ctx, + eCsrEncryptionType uc_encry_type, + tCsrAuthList *auth_list, + tCsrEncryptionList *mc_encryption_list, + eCsrAuthType *negotiated_authtype, + eCsrEncryptionType *negotiated_mc_encry, + tSirBssDescription *bss_descr, + tDot11fBeaconIEs *ie_ptr) { uint32_t idx; bool match = false; @@ -4302,8 +4317,8 @@ bool csr_is_bss_type_ibss(eCsrRoamBssType bssType) } -bool csr_is_bss_type_caps_match(eCsrRoamBssType bssType, - tSirBssDescription *pSirBssDesc) +static bool csr_is_bss_type_caps_match(eCsrRoamBssType bssType, + tSirBssDescription *pSirBssDesc) { bool fMatch = true; @@ -4359,7 +4374,7 @@ static bool csr_is_specific_channel_match(tpAniSirGlobal pMac, return fMatch; } -bool csr_is_channel_band_match(tpAniSirGlobal pMac, uint8_t channelId, +static bool csr_is_channel_band_match(tpAniSirGlobal pMac, uint8_t channelId, tSirBssDescription *pSirBssDesc) { bool fMatch = true; @@ -4772,10 +4787,10 @@ end: return rc; } -bool csr_match_connected_bss_security(tpAniSirGlobal pMac, - tCsrRoamConnectedProfile *pProfile, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) +static bool csr_match_connected_bss_security(tpAniSirGlobal pMac, + tCsrRoamConnectedProfile *pProfile, + tSirBssDescription *pBssDesc, + tDot11fBeaconIEs *pIes) { tCsrEncryptionList ucEncryptionList, mcEncryptionList; tCsrAuthList authList; @@ -4961,7 +4976,7 @@ bool csr_rates_is_dot11_rate_supported(tHalHandle hHal, uint8_t rate) return csr_is_aggregate_rate_supported(pMac, n); } -uint16_t csr_rates_mac_prop_to_dot11(uint16_t Rate) +static uint16_t csr_rates_mac_prop_to_dot11(uint16_t Rate) { uint16_t ConvertedRate = Rate; From d692c5f21152149728fb13b1a823d0fadfe04f3b Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:38:25 -0700 Subject: [PATCH 098/179] qcacld-3.0: Fix -Wmissing-prototypes in sme_rrm We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sme_rrm. Change-Id: Ie57c6a05f7e3975565ce2984f5d477b8bbe5a018 CRs-Fixed: 1075575 --- core/sme/src/rrm/sme_rrm.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c index 6e078386b116..9b86cf132557 100644 --- a/core/sme/src/rrm/sme_rrm.c +++ b/core/sme/src/rrm/sme_rrm.c @@ -113,7 +113,8 @@ static void rrm_ll_purge_neighbor_cache(tpAniSirGlobal pMac, * * Return: void */ -void rrm_indicate_neighbor_report_result(tpAniSirGlobal pMac, QDF_STATUS qdf_status) +static void rrm_indicate_neighbor_report_result(tpAniSirGlobal pMac, + QDF_STATUS qdf_status) { NeighborReportRspCallback callback; void *callbackContext; @@ -646,7 +647,7 @@ static QDF_STATUS sme_rrm_scan_request_callback(tHalHandle halHandle, * * Return: QDF_STATUS */ -QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) +static QDF_STATUS sme_rrm_issue_scan_req(tpAniSirGlobal mac_ctx) { /* Issue scan request. */ tCsrScanRequest scan_req; @@ -1078,8 +1079,8 @@ check_11r_assoc: * * Return: void. */ -void rrm_store_neighbor_rpt_by_roam_score(tpAniSirGlobal pMac, - tpRrmNeighborReportDesc pNeighborReportDesc) +static void rrm_store_neighbor_rpt_by_roam_score(tpAniSirGlobal pMac, + tpRrmNeighborReportDesc pNeighborReportDesc) { tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; tListElem *pEntry; @@ -1145,7 +1146,8 @@ void rrm_store_neighbor_rpt_by_roam_score(tpAniSirGlobal pMac, * * Return: QDF_STATUS_SUCCESS - Validation is successful */ -QDF_STATUS sme_rrm_process_neighbor_report(tpAniSirGlobal pMac, void *pMsgBuf) +static QDF_STATUS sme_rrm_process_neighbor_report(tpAniSirGlobal pMac, + void *pMsgBuf) { QDF_STATUS status = QDF_STATUS_SUCCESS; tpSirNeighborReportInd pNeighborRpt = (tpSirNeighborReportInd) pMsgBuf; @@ -1281,7 +1283,7 @@ QDF_STATUS sme_rrm_msg_processor(tpAniSirGlobal pMac, uint16_t msg_type, * * Return: NULL */ -void rrm_iter_meas_timer_handle(void *userData) +static void rrm_iter_meas_timer_handle(void *userData) { tpAniSirGlobal pMac = (tpAniSirGlobal) userData; sms_log(pMac, LOGE, @@ -1298,7 +1300,7 @@ void rrm_iter_meas_timer_handle(void *userData) * * Return: NULL */ -void rrm_neighbor_rsp_timeout_handler(void *userData) +static void rrm_neighbor_rsp_timeout_handler(void *userData) { tpAniSirGlobal pMac = (tpAniSirGlobal) userData; sms_log(pMac, LOGE, "Neighbor Response timed out "); From ec729da3bfa37090d5b5bd52b9e6a6f1dc1ced9b Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 17 Oct 2016 22:32:42 -0700 Subject: [PATCH 099/179] Release 5.1.0.31P Release 5.1.0.31P Change-Id: I20fadebbd67af0bcee5922c2a2130f0c0fe07525 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 924e7e3b95d8..b9f483166885 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "O" +#define QWLAN_VERSION_EXTRA "P" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31O" +#define QWLAN_VERSIONSTR "5.1.0.31P" #endif /* QWLAN_VERSION_H */ From 9d5b1feedb33424949e22938a8c7e3455269e887 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Sun, 16 Oct 2016 20:16:05 -0700 Subject: [PATCH 100/179] qcacld-3.0: Changes for 11d to not get disabled Currently, the regulatory callback does not know whether the country setting is due to 11d or user-space. Therefore, even for 11d country setting, 11d gets disabled. Fix this by maintaining variable for country code setting. Change-Id: Icc5f636de7245a9c65df56374cf99fb9c5c15f5f CRs-Fixed: 1077498 --- core/mac/inc/ani_global.h | 1 + core/sme/src/common/sme_api.c | 42 +++++++-------------------------- core/sme/src/csr/csr_api_scan.c | 5 ++++ 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 83d9cbd4067d..b1f76939dd1f 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -979,6 +979,7 @@ typedef struct sAniSirGlobal { enum auth_tx_ack_status auth_ack_status; uint8_t user_configured_nss; bool sta_prefer_80MHz_over_160MHz; + bool is_11d_hint; } tAniSirGlobal; typedef enum { diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index fa4be71a5902..c0ab9a29814a 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -7838,24 +7838,19 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx, { QDF_STATUS status = QDF_STATUS_SUCCESS; v_REGDOMAIN_t reg_domain_id = 0; - bool is_11d_country = false; bool supplicant_priority = mac_ctx->roam.configParam.fSupplicantCountryCodeHasPriority; tAniGenericChangeCountryCodeReq *msg = pMsgBuf; sms_log(mac_ctx, LOG1, FL(" called")); - if (memcmp(msg->countryCode, mac_ctx->scan.countryCode11d, - CDS_COUNTRY_CODE_LEN) == 0) { - is_11d_country = true; - } /* Set the country code given by userspace when 11dOriginal is false * when 11doriginal is True,is_11d_country =0 and * fSupplicantCountryCodeHasPriority = 0, then revert the country code, * and return failure */ if (mac_ctx->roam.configParam.Is11dSupportEnabledOriginal == true - && !is_11d_country && !supplicant_priority) { + && !mac_ctx->is_11d_hint && !supplicant_priority) { sms_log(mac_ctx, LOGW, FL("Incorrect country req, nullify this")); @@ -7879,37 +7874,14 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx, } /* if Supplicant country code has priority, disable 11d */ - if (!is_11d_country && supplicant_priority) + if (supplicant_priority && !mac_ctx->is_11d_hint) mac_ctx->roam.configParam.Is11dSupportEnabled = false; + + qdf_mem_copy(mac_ctx->scan.countryCode11d, msg->countryCode, + WNI_CFG_COUNTRY_CODE_LEN); qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, msg->countryCode, WNI_CFG_COUNTRY_CODE_LEN); - status = wma_set_reg_domain(mac_ctx, reg_domain_id); - if (false == is_11d_country) { - /* overwrite the defualt country code */ - qdf_mem_copy(mac_ctx->scan.countryCodeDefault, - mac_ctx->scan.countryCodeCurrent, - WNI_CFG_COUNTRY_CODE_LEN); - /* set to default domain ID */ - mac_ctx->scan.domainIdDefault = mac_ctx->scan.domainIdCurrent; - } - if (status != QDF_STATUS_SUCCESS) { - sms_log(mac_ctx, LOGE, FL("fail to set regId %d"), - reg_domain_id); - return status; - } else { - /* if 11d has priority, clear currentCountryBssid & - * countryCode11d to get set again if we find AP with 11d info - * during scan - */ - if (!supplicant_priority && (false == is_11d_country)) { - sms_log(mac_ctx, LOGW, - FL("Clearing currentCountryBssid, countryCode11d")); - qdf_mem_zero(&mac_ctx->scan.currentCountryBssid, - sizeof(struct qdf_mac_addr)); - qdf_mem_zero(mac_ctx->scan.countryCode11d, - sizeof(mac_ctx->scan.countryCode11d)); - } - } + /* get the channels based on new cc */ status = csr_get_channel_and_power_list(mac_ctx); @@ -7929,6 +7901,8 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx, * Country IE */ mac_ctx->scan.curScanType = eSIR_ACTIVE_SCAN; + mac_ctx->is_11d_hint = false; + sme_disconnect_connected_sessions(mac_ctx); sms_log(mac_ctx, LOG1, FL(" returned")); return QDF_STATUS_SUCCESS; diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 966341a82a62..f4e56542ca17 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -3716,6 +3716,11 @@ bool csr_learn_11dcountry_information(tpAniSirGlobal pMac, else pCountryCodeSelected = pMac->scan.countryCodeElected; + if (qdf_mem_cmp(pCountryCodeSelected, pMac->scan.countryCode11d, + CDS_COUNTRY_CODE_LEN) == 0) + goto free_ie; + + pMac->is_11d_hint = true; status = csr_get_regulatory_domain_for_country(pMac, pCountryCodeSelected, &domainId, SOURCE_11D); if (status != QDF_STATUS_SUCCESS) { From d6e5ba6fc6f92d911e7224db8a8ba6de2b572ac1 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 17 Oct 2016 23:09:10 -0700 Subject: [PATCH 101/179] Release 5.1.0.31Q Release 5.1.0.31Q Change-Id: I184fded694f1bee6325935b262e50d0f89b09efe CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b9f483166885..d3371e20281d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_EXTRA "Q" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31P" +#define QWLAN_VERSIONSTR "5.1.0.31Q" #endif /* QWLAN_VERSION_H */ From 00ed527a142eab7c77a74e4315ed8592bc7fe6f7 Mon Sep 17 00:00:00 2001 From: Anurag Chouhan Date: Mon, 17 Oct 2016 17:22:55 +0530 Subject: [PATCH 102/179] qcacld-3.0: Update uninitialized variables & error handling Currently, In failure case the spin unlock is not taken care which is locked before, also the variables are initailized in specific senarios, with this change the variables are initialised properly. Change-Id: Ic6c40065e312dcd2e76dbf50304dfa8f4fb506e9 CRs-Fixed: 1073567 --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- core/hdd/src/wlan_hdd_napi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c9f180bbb816..36a8a46a71f5 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -14461,7 +14461,7 @@ __wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy, hdd_context_t *pHddCtx; QDF_STATUS status; tSmeConfigParams sme_config; - bool cbModeChange; + bool cbModeChange = false; if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); diff --git a/core/hdd/src/wlan_hdd_napi.c b/core/hdd/src/wlan_hdd_napi.c index 4d4941a07dcf..3a20bff3e8db 100644 --- a/core/hdd/src/wlan_hdd_napi.c +++ b/core/hdd/src/wlan_hdd_napi.c @@ -275,7 +275,7 @@ int hdd_napi_apply_throughput_policy(struct hdd_context_s *hddctx, uint64_t packets = tx_packets + rx_packets; enum qca_napi_tput_state req_state; struct qca_napi_data *napid = hdd_napi_get_all(); - int enabled; + int enabled = 0; NAPI_DEBUG("-->%s(tx=%lld, rx=%lld)", __func__, tx_packets, rx_packets); From 082f257b2dfcfd26b5435de990ee3622c297fcc9 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 00:14:14 -0700 Subject: [PATCH 103/179] Release 5.1.0.31R Release 5.1.0.31R Change-Id: I09bc38a5f48222fcd774ee1d180be9976fca9dc3 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d3371e20281d..e55459cf352d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Q" +#define QWLAN_VERSION_EXTRA "R" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31Q" +#define QWLAN_VERSIONSTR "5.1.0.31R" #endif /* QWLAN_VERSION_H */ From d29e7603a982876ea983296538ac856f74d21ab2 Mon Sep 17 00:00:00 2001 From: Anurag Chouhan Date: Mon, 17 Oct 2016 15:20:22 +0530 Subject: [PATCH 104/179] qcacld-3.0: Fix existing incorrect error logs Existing error message are incorrect in __iw_set_retry and __iw_get_retry, this change provides corrected logs. Change-Id: I5076936fd21a3680ef2e6564820c2dfd5321aba0 CRs-Fixed: 1036544 --- core/hdd/src/wlan_hdd_wext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 445000efdb33..f81f9e1ccea3 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -4576,7 +4576,7 @@ static int __iw_set_retry(struct net_device *dev, struct iw_request_info *info, if (sme_cfg_set_int (hHal, WNI_CFG_SHORT_RETRY_LIMIT, wrqu->retry.value) != QDF_STATUS_SUCCESS) { - hdd_err("failed to set ini parameter, WNI_CFG_LONG_RETRY_LIMIT"); + hdd_err("failed to set ini parameter, WNI_CFG_SHORT_RETRY_LIMIT"); return -EIO; } } @@ -4653,7 +4653,7 @@ static int __iw_get_retry(struct net_device *dev, struct iw_request_info *info, if (sme_cfg_get_int(hHal, WNI_CFG_SHORT_RETRY_LIMIT, &retry) != QDF_STATUS_SUCCESS) { - hdd_warn("failed to get ini parameter, WNI_CFG_LONG_RETRY_LIMIT"); + hdd_warn("failed to get ini parameter, WNI_CFG_SHORT_RETRY_LIMIT"); return -EIO; } From aad589eb6ca955340c1c0bf5754a95ccdb476670 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 03:23:40 -0700 Subject: [PATCH 105/179] Release 5.1.0.31S Release 5.1.0.31S Change-Id: Ib1c882d0d9ed4ff202bb15cf05b61fc6b2e9770a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index e55459cf352d..7fbf0e4c0fe6 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "R" +#define QWLAN_VERSION_EXTRA "S" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31R" +#define QWLAN_VERSIONSTR "5.1.0.31S" #endif /* QWLAN_VERSION_H */ From 73050ff958817270ae6ced0567e72effd8f65ce6 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Wed, 12 Oct 2016 14:42:19 +0530 Subject: [PATCH 106/179] qcacld-3.0: Avoid setting hw_mode to SMM when already in SMM Whenever there is session disconnection, the device sets its hw_mode to SMM (Single MAC Mode) if the current connections are not using DBS mode. Thus, if the device is in SMM, it still sets its hw_mode to SMM after session disconnection. The enhancement is to check the if the device is already in SMM, then avoid setting again to SMM. Change-Id: I4ebb9b6d992e65667a06b3e68d322435c7ec2968 CRs-Fixed: 1076844 --- core/cds/src/cds_concurrency.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index a2c6abd50907..b6f8364b2143 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -3651,10 +3651,22 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void) uint32_t conn_index; enum cds_conc_next_action upgrade = CDS_NOP; uint8_t mac = 0; + struct sir_hw_mode_params hw_mode; + QDF_STATUS status = QDF_STATUS_E_FAILURE; if (wma_is_hw_dbs_capable() == false) { cds_err("driver isn't dbs capable, no further action needed"); - return upgrade; + goto done; + } + + status = wma_get_current_hw_mode(&hw_mode); + if (!QDF_IS_STATUS_SUCCESS(status)) { + cds_err("wma_get_current_hw_mode failed"); + goto done; + } + if (!hw_mode.dbs_cap) { + cds_info("current HW mode is non-DBS capable"); + goto done; } /* Are both mac's still in use */ From e22c4a0e678548013490787d1d29f7b0bfdc453d Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 05:31:32 -0700 Subject: [PATCH 107/179] Release 5.1.0.31T Release 5.1.0.31T Change-Id: I9855745a193ca38b1f740393082b4a3e6671ab66 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7fbf0e4c0fe6..d5361b972cfd 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "S" +#define QWLAN_VERSION_EXTRA "T" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31S" +#define QWLAN_VERSIONSTR "5.1.0.31T" #endif /* QWLAN_VERSION_H */ From 1f2b8a899bcff3f8803e356c1709a24e2259240e Mon Sep 17 00:00:00 2001 From: Hu Wang Date: Thu, 25 Aug 2016 15:15:54 +0800 Subject: [PATCH 108/179] qcacld-3.0: Report max MCS index 8 for VHT20 qcacld-2.0 to qcacld-3.0 propagation Currently driver reports max MCS index 9 for VHT20, but cfg802.11 doesn't support such case, which leads to link speed null returned to upper-layer. Update the driver to report max MCS index 8 for VHT20. Change-Id: I06c97db85d88decf418be602cb5f64135f61a686 CRs-Fixed: 1005141 --- core/hdd/src/wlan_hdd_stats.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 6a1fc5a57085..c24dfe39d2c2 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1864,8 +1864,15 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, maxMCSIdx = 8; else if (DATA_RATE_11AC_MAX_MCS_9 == vhtMaxMcs) { - /* VHT20 is supporting 0~8 */ - if (rate_flags & eHAL_TX_RATE_VHT20) + /* + * IEEE_P802.11ac_2013.pdf page 325, 326 + * - MCS9 is valid for VHT20 when + * Nss = 3 or Nss = 6 + * - MCS9 is not valid for VHT20 when + * Nss = 1,2,4,5,7,8 + */ + if ((rate_flags & eHAL_TX_RATE_VHT20) && + (nss != 3 && nss != 6)) maxMCSIdx = 8; else maxMCSIdx = 9; @@ -1973,6 +1980,18 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, maxSpeedMCS = 1; maxMCSIdx = pAdapter->hdd_stats.ClassA_stat.mcs_index; + /* + * IEEE_P802.11ac_2013.pdf page 325, 326 + * - MCS9 is valid for VHT20 when + * Nss = 3 or Nss = 6 + * - MCS9 is not valid for VHT20 when + * Nss = 1,2,4,5,7,8 + */ + if ((rate_flags & eHAL_TX_RATE_VHT20) && + (maxMCSIdx > 8) && + (nss != 3 && nss != 6)) { + maxMCSIdx = 8; + } } } From 4c2f9d9d90491007b59c7486484bb989520e106f Mon Sep 17 00:00:00 2001 From: gbian Date: Thu, 29 Sep 2016 17:27:04 +0800 Subject: [PATCH 109/179] qcacld-3.0: Change to calculate tx_retries from the right source qcacld-2.0 to qcacld-3.0 propagation Change the logic to get tx_retries from multiple_retry_cnt. Currently tx_retries calculate from summary_stat.retry_cnt[] which are not initialized in current code. FW will enable FW_REPORT_TX_STATS_PER_VDEV feature and add multiple_retry_cnt support. Change-Id: Idf3ba2cc7fa3ab287256a850555bb50e8a117bd2 CRs-Fixed: 1061540 --- core/hdd/src/wlan_hdd_stats.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index c24dfe39d2c2..f6ee0d00a6df 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -2112,10 +2112,10 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, pAdapter->hdd_stats.summary_stat.tx_frm_cnt[3]; sinfo->tx_retries = - pAdapter->hdd_stats.summary_stat.retry_cnt[0] + - pAdapter->hdd_stats.summary_stat.retry_cnt[1] + - pAdapter->hdd_stats.summary_stat.retry_cnt[2] + - pAdapter->hdd_stats.summary_stat.retry_cnt[3]; + pAdapter->hdd_stats.summary_stat.multiple_retry_cnt[0] + + pAdapter->hdd_stats.summary_stat.multiple_retry_cnt[1] + + pAdapter->hdd_stats.summary_stat.multiple_retry_cnt[2] + + pAdapter->hdd_stats.summary_stat.multiple_retry_cnt[3]; sinfo->tx_failed = pAdapter->hdd_stats.summary_stat.fail_cnt[0] + From 6d04e321238190f212df4ee71117d7c1f4c12119 Mon Sep 17 00:00:00 2001 From: wadesong Date: Mon, 10 Oct 2016 18:22:31 +0800 Subject: [PATCH 110/179] qcacld-3.0: Clear hostap key storage when BSS is stopped qcacld-2.0 to qcacld-3.0 propagation Invalidate the keys stored in the hostap context when BSS stop event is received, so that no old key will be wrongly issued to firmware when hostapd restarts the BSS with a different encryption mode. Change-Id: Ied1fa37cfcff32d3ee87ae26490e59ae59211952 CRs-Fixed: 1046965 --- core/hdd/src/wlan_hdd_hostapd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 3145b14a65e8..fb1777578e90 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1253,6 +1253,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, hdd_info("P2PGO is going down now"); hdd_issue_stored_joinreq(sta_adapter, pHddCtx); } + pHddApCtx->groupKey.keyLength = 0; + for (i = 0; i < CSR_MAX_NUM_KEY; i++) + pHddApCtx->wepKey[i].keyLength = 0; goto stopbss; case eSAP_DFS_CAC_START: From 86492dee0d5dba6bb8c9ed10b0caad638b0daf9d Mon Sep 17 00:00:00 2001 From: Yingying Tang Date: Wed, 28 Sep 2016 17:28:03 +0800 Subject: [PATCH 111/179] qcacld-3.0: Correct NULL pointer check in epping_cookie_init() Propagate from qcacld-2.0 to qcacld-3.0 Currently in epping_cookie_init() when the cookie array is allocated the wrong pointer is checked for a NULL allocation. Update the function to check the correct pointer. Change-Id: I56384197a8729996d7aa87d3c51903525b3be93c CRs-Fixed: 979671 --- core/utils/epping/src/epping_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/utils/epping/src/epping_helper.c b/core/utils/epping/src/epping_helper.c index ff82790012d5..43575ea132a1 100644 --- a/core/utils/epping/src/epping_helper.c +++ b/core/utils/epping/src/epping_helper.c @@ -62,7 +62,7 @@ int epping_cookie_init(epping_context_t *pEpping_ctx) pEpping_ctx->s_cookie_mem[i] = qdf_mem_malloc(sizeof(struct epping_cookie) * MAX_COOKIE_SLOT_SIZE); - if (pEpping_ctx->s_cookie_mem == NULL) { + if (pEpping_ctx->s_cookie_mem[i] == NULL) { EPPING_LOG(QDF_TRACE_LEVEL_FATAL, "%s: no mem for cookie (idx = %d)", __func__, i); From 7400c5b0cc8c3822468249894c9107a53a1f0fa8 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Thu, 29 Sep 2016 15:28:36 +0800 Subject: [PATCH 112/179] qcacld-3.0: Use heap memory for station_info instead of stack qcacld-2.0 to qcacld-3.0 propagation From kernel 3.19-rc4, size of struct station_info is around 600 bytes, so stack frame size of such routine use this struct will easily exceed 1024 bytes, the default value of stack frame size. So use heap memory for this struct instead. Change-Id: Ibe8a4f5189fcc9d5554f7a5d851c93be8fa8dbad CRs-Fixed: 1050323 --- core/hdd/src/wlan_hdd_assoc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index d8f35f4ecd79..5a40fb0bbfa2 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3292,7 +3292,7 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - struct station_info staInfo; + struct station_info *stainfo; hdd_err("IBSS New Peer indication from SME " "with peerMac " MAC_ADDRESS_STR " BSSID: " @@ -3322,13 +3322,18 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, qdf_status, qdf_status); } pHddStaCtx->ibss_sta_generation++; - memset(&staInfo, 0, sizeof(staInfo)); - staInfo.filled = 0; - staInfo.generation = pHddStaCtx->ibss_sta_generation; + stainfo = qdf_mem_malloc(sizeof(*stainfo)); + if (stainfo == NULL) { + hdd_err("memory allocation for station_info failed"); + return QDF_STATUS_E_NOMEM; + } + stainfo->filled = 0; + stainfo->generation = pHddStaCtx->ibss_sta_generation; cfg80211_new_sta(pAdapter->dev, (const u8 *)pRoamInfo->peerMac.bytes, - &staInfo, GFP_KERNEL); + stainfo, GFP_KERNEL); + qdf_mem_free(stainfo); if (eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pHddStaCtx->ibss_enc_key.encType From f95e81359c6a37063f25d6505ef1fe96697f2033 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Thu, 29 Sep 2016 19:01:30 +0800 Subject: [PATCH 113/179] qcacld-3.0: Fix set all-zero address mcast filter propagation from qcacld-2.0 to qcacld-3.0. There are IPv4/IPv6 filters, we just use IPv4 filter for RXFILTER-ADD/REMOVE now. Correctly update the filters from mc_addr_list. Change-Id: I3457b206fe24e2484ec1f5a6240cbd0bc4a5825a CRs-Fixed: 992500 --- core/hdd/src/wlan_hdd_ioctl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index b85e5a39a6b2..e08879e1a6f8 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -6449,7 +6449,7 @@ static int hdd_set_rx_filter(hdd_adapter_t *adapter, bool action, uint8_t pattern) { int ret; - uint8_t i; + uint8_t i, j; tHalHandle handle; tSirRcvFltMcAddrList *filter; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); @@ -6487,19 +6487,21 @@ static int hdd_set_rx_filter(hdd_adapter_t *adapter, bool action, return -ENOMEM; } filter->action = action; - for (i = 0; i < adapter->mc_addr_list.mc_cnt; i++) { + for (i = 0, j = 0; i < adapter->mc_addr_list.mc_cnt; i++) { if (!memcmp(adapter->mc_addr_list.addr[i], &pattern, 1)) { - memcpy(filter->multicastAddr[i].bytes, + memcpy(filter->multicastAddr[j].bytes, adapter->mc_addr_list.addr[i], sizeof(adapter->mc_addr_list.addr[i])); - filter->ulMulticastAddrCnt++; + hdd_info("%s RX filter : addr =" MAC_ADDRESS_STR, action ? "setting" : "clearing", - MAC_ADDR_ARRAY(filter->multicastAddr[i].bytes)); + MAC_ADDR_ARRAY(filter->multicastAddr[j].bytes)); + j++; } } + filter->ulMulticastAddrCnt = j; /* Set rx filter */ sme_8023_multicast_list(handle, adapter->sessionId, filter); qdf_mem_free(filter); From 5d82494ca5d94e697bbebee63887909c343cf527 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 09:03:15 -0700 Subject: [PATCH 114/179] Release 5.1.0.31U Release 5.1.0.31U Change-Id: I5ba667ef87e465795020c82decc186601abe86a1 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d5361b972cfd..fdecb357804c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "T" +#define QWLAN_VERSION_EXTRA "U" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31T" +#define QWLAN_VERSIONSTR "5.1.0.31U" #endif /* QWLAN_VERSION_H */ From f42c3c221e94bac6b0ec67d073479605f3a8b712 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Thu, 6 Oct 2016 15:27:10 -0700 Subject: [PATCH 115/179] qcacld-3.0: Update dot11f.* files Some functions under dot11f.* files are local and not referenced by other files. Add static keywords to the following function and update the dot11f.* files. dot11f_unpack_tlv_common_func dot11f_unpack_tlv_common_func2 dot11f_unpack_ff_common_func dot11f_unpack_ie_common_func Change-Id: Icc15b0570fe2ff900a16a83a4ce2a6a558c4e70b CRs-Fixed: 1075288 --- core/mac/src/include/dot11f.h | 10 +++++----- core/mac/src/sys/legacy/src/utils/src/dot11f.c | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 7d52f2508ba6..d9f9b36ab531 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -35,7 +35,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Oct 3 12:40:25 2016 from the following file(s): + * Thu Oct 6 17:32:00 2016 from the following file(s): * * dot11f.frms * @@ -3780,8 +3780,8 @@ uint32_t dot11f_get_packed_ie_ChanSwitchAnn( /* EID 196 (0xc4) */ typedef struct sDot11fIEChannelSwitchWrapper { - uint8_t present; - tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; + uint8_t present; + tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; tDot11fIEvht_transmit_power_env vht_transmit_power_env; } tDot11fIEChannelSwitchWrapper; @@ -5983,7 +5983,7 @@ typedef struct sDot11fIERSN { /* N.B. These #defines do *not* include the EID & length */ #define DOT11F_IE_RSN_MIN_LEN (6) -#define DOT11F_IE_RSN_MAX_LEN (255) +#define DOT11F_IE_RSN_MAX_LEN (114) #ifdef __cplusplus extern "C" { @@ -9281,7 +9281,7 @@ uint32_t dot11f_get_packed_wmm_del_ts_size(tpAniSirGlobal pCtx, } /* End extern "C". */ #endif /* C++ */ -typedef struct sDot11fext_channel_switch_action_frame { +typedef struct sDot11fext_channel_switch_action_frame{ tDot11fFfCategory Category; tDot11fFfAction Action; tDot11fFfext_chan_switch_ann_action ext_chan_switch_ann_action; diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index 458e073c088d..5461e6b4df12 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -33,7 +33,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Oct 3 12:40:25 2016 from the following file(s): + * Thu Oct 6 17:32:00 2016 from the following file(s): * * dot11f.frms * @@ -367,9 +367,9 @@ static uint32_t get_packed_size_core(tpAniSirGlobal pCtx, uint32_t *pnNeeded, const tIEDefn IEs[]); -uint32_t dot11f_unpack_tlv_common_func(tpAniSirGlobal pCtx, uint8_t *pBuf, - uint16_t tlvlen, uint8_t *pDstPresent, - uint8_t *pDstField) +static uint32_t dot11f_unpack_tlv_common_func(tpAniSirGlobal pCtx, + uint8_t *pBuf, uint16_t tlvlen, + uint8_t *pDstPresent, uint8_t *pDstField) { uint32_t status = DOT11F_PARSE_SUCCESS; (void)tlvlen; /* Shutup the compiler */ @@ -380,9 +380,9 @@ uint32_t dot11f_unpack_tlv_common_func(tpAniSirGlobal pCtx, uint8_t *pBuf, return status; } /* End dot11f_unpack_tlv_common_func. */ -uint32_t dot11f_unpack_tlv_common_func2(tpAniSirGlobal pCtx, uint8_t *pBuf, - uint16_t tlvlen, uint8_t *pDstPresent, - uint16_t *pDstState) +static uint32_t dot11f_unpack_tlv_common_func2(tpAniSirGlobal pCtx, + uint8_t *pBuf, uint16_t tlvlen, + uint8_t *pDstPresent, uint16_t *pDstState) { uint32_t status = DOT11F_PARSE_SUCCESS; (void)tlvlen; /* Shutup the compiler */ @@ -394,14 +394,14 @@ uint32_t dot11f_unpack_tlv_common_func2(tpAniSirGlobal pCtx, uint8_t *pBuf, } /* End dot11f_unpack_tlv_common_func2. */ -void dot11f_unpack_ff_common_func(tpAniSirGlobal pCtx, +static void dot11f_unpack_ff_common_func(tpAniSirGlobal pCtx, uint8_t *pBuf, uint16_t *pDstField) { framesntohs(pCtx, pDstField, pBuf, 0); (void)pCtx; } /* End dot11f_unpack_ff_common_func. */ -uint32_t dot11f_unpack_ie_common_func(tpAniSirGlobal pCtx, uint8_t *pBuf, +static uint32_t dot11f_unpack_ie_common_func(tpAniSirGlobal pCtx, uint8_t *pBuf, uint8_t ielen, uint8_t *pDstPresent , uint8_t *pDstField) { From 11d7cb6b8be1d5079b56a88426f1e4940a165114 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 12:03:05 -0700 Subject: [PATCH 116/179] Release 5.1.0.31V Release 5.1.0.31V Change-Id: Ie1709c7ae07c31d747dd6680b7fa12cbee917ec6 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index fdecb357804c..5efa2ccda4a6 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "U" +#define QWLAN_VERSION_EXTRA "V" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31U" +#define QWLAN_VERSIONSTR "5.1.0.31V" #endif /* QWLAN_VERSION_H */ From 044fd675f531d68b33be03efb380f99cefd11a63 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Thu, 13 Oct 2016 18:53:25 +0530 Subject: [PATCH 117/179] qcacld-3.0: Set SMM if all new/existing conns are in same band When the device is in DBS mode, and STA session gets disconnected, then the dbs_opportunistic_timer is started to wait for 10s and then sets back to SMM (Single MAC mode) after timeout if DBS mode is not required. The enhancement is to check the if the device is in DBS mode and the STA session disconnects and new STA session starts in the band in which existing connection are there, then stop the dbs_opportunistic_timer and set hw_mode to SMM. Change-Id: I16bfbb5135e36f2ab87bd09244d5eb6932846c72 CRs-Fixed: 1077488 --- core/cds/inc/cds_concurrency.h | 1 + core/cds/src/cds_concurrency.c | 39 ++++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg80211.c | 17 ++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index 951abffa6b0b..2378e8aa4f51 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -852,6 +852,7 @@ QDF_STATUS cds_get_valid_chan_weights(struct sir_pcl_chan_weights *weight); QDF_STATUS cds_set_hw_mode_on_channel_switch(uint8_t session_id); void cds_set_do_hw_mode_change_flag(bool flag); bool cds_is_hw_mode_change_after_vdev_up(void); +void cds_checkn_update_hw_mode_single_mac_mode(uint8_t channel); void cds_dump_connection_status_info(void); uint32_t cds_mode_specific_connection_count(enum cds_con_mode mode, uint32_t *list); diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index b6f8364b2143..e5519c4727c2 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -9116,6 +9116,45 @@ uint8_t cds_get_mcc_operating_channel(uint8_t session_id) return chan; } +/** + * cds_checkn_update_hw_mode_single_mac_mode() - Set hw_mode to SMM + * if required + * @channel: channel number for the new STA connection + * + * After the STA disconnection, if the hw_mode is in DBS and the new STA + * connection is coming in the band in which existing connections are + * present, then this function stops the dbs opportunistic timer and sets + * the hw_mode to Single MAC mode (SMM). + * + * Return: None + */ +void cds_checkn_update_hw_mode_single_mac_mode(uint8_t channel) +{ + uint8_t i; + cds_context_type *cds_ctx; + + cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); + if (!cds_ctx) { + cds_err("Invalid CDS Context"); + return; + } + + for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { + if (conc_connection_list[i].in_use) + if (!CDS_IS_SAME_BAND_CHANNELS(channel, + conc_connection_list[i].chan)) { + cds_info("DBS required"); + return; + } + } + + if (QDF_TIMER_STATE_RUNNING == + cds_ctx->dbs_opportunistic_timer.state) + qdf_mc_timer_stop(&cds_ctx->dbs_opportunistic_timer); + + cds_dbs_opportunistic_timer_handler((void *)cds_ctx); +} + /** * cds_set_do_hw_mode_change_flag() - Set flag to indicate hw mode change * @flag: Indicate if hw mode change is required or not diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 36a8a46a71f5..926d4f077678 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -11166,6 +11166,8 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, tCsrRoamProfile *pRoamProfile; eCsrAuthType RSNAuthType; tSmeConfigParams *sme_config; + uint8_t channel = 0; + struct sir_hw_mode_params hw_mode; ENTER(); @@ -11458,6 +11460,21 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, pRoamProfile->ChannelInfo.ChannelList = NULL; pRoamProfile->ChannelInfo.numOfChannels = 0; + if (!QDF_IS_STATUS_SUCCESS( + wma_get_current_hw_mode(&hw_mode))) { + hdd_err("wma_get_current_hw_mode failed"); + return status; + } + + if ((QDF_STA_MODE == pAdapter->device_mode) + && hw_mode.dbs_cap) { + cds_get_channel_from_scan_result(pAdapter, + pRoamProfile, &channel); + if (channel) + cds_checkn_update_hw_mode_single_mac_mode + (channel); + } + } else { hdd_err("No valid Roam profile"); return -EINVAL; From 3de9e373c94b7d3ee01a5dfaedd9cdfe464111aa Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 12:40:25 -0700 Subject: [PATCH 118/179] Release 5.1.0.31W Release 5.1.0.31W Change-Id: I04f4a387073821f9f4ba107b1248f706d93f57af CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5efa2ccda4a6..c8c6fd16a399 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "V" +#define QWLAN_VERSION_EXTRA "W" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31V" +#define QWLAN_VERSIONSTR "5.1.0.31W" #endif /* QWLAN_VERSION_H */ From e7d442a3157864ad5fc5d7a37e828f57f9ced51b Mon Sep 17 00:00:00 2001 From: Dhanashri Atre Date: Thu, 14 Jul 2016 18:20:29 -0700 Subject: [PATCH 119/179] qcacld-3.0: Add LRO Statistics Add the following statistics for LRO - packet count based on the number of packets aggregated - total number of LRO eligible and ineligible TCP packets - total number of packets aggregated - total number of flows flushed - number of times an LRO descriptor was not found Change-Id: Icea6b7745df9bda5b517c1a7f27c8395ede2cec6 CRs-Fixed: 1042116 --- core/dp/ol/inc/ol_txrx_ctrl_api.h | 1 + core/hdd/inc/wlan_hdd_lro.h | 58 +++++++++++++++- core/hdd/src/wlan_hdd_lro.c | 111 +++++++++++++++++++++++++++++- core/hdd/src/wlan_hdd_wext.c | 4 ++ 4 files changed, 172 insertions(+), 2 deletions(-) diff --git a/core/dp/ol/inc/ol_txrx_ctrl_api.h b/core/dp/ol/inc/ol_txrx_ctrl_api.h index a5dbcacbf3ec..bb7339d4d990 100644 --- a/core/dp/ol/inc/ol_txrx_ctrl_api.h +++ b/core/dp/ol/inc/ol_txrx_ctrl_api.h @@ -69,6 +69,7 @@ #define WLAN_DUMP_TX_FLOW_POOL_INFO 5 #define WLAN_TXRX_DESC_STATS 6 #define WLAN_HIF_STATS 7 +#define WLAN_LRO_STATS 8 #define WLAN_SCHEDULER_STATS 21 #define WLAN_TX_QUEUE_STATS 22 #define WLAN_BUNDLE_STATS 23 diff --git a/core/hdd/inc/wlan_hdd_lro.h b/core/hdd/inc/wlan_hdd_lro.h index 760347cc2f96..0eaecdba83e9 100644 --- a/core/hdd/inc/wlan_hdd_lro.h +++ b/core/hdd/inc/wlan_hdd_lro.h @@ -97,16 +97,62 @@ struct hdd_lro_desc_info { struct hdd_lro_desc_pool lro_desc_pool; }; +/** + * enum hdd_lro_pkt_aggr_bucket - idenitifies the bucket holding + * the count of the aggregated packets + * @HDD_LRO_BUCKET_0_7: identifies the packet count when the + * aggregate size is between 0 to 7 packets + * @HDD_LRO_BUCKET_8_15: identifies the packet count when the + * aggregate size is between 8 to 15 packets + * @HDD_LRO_BUCKET_16_23: identifies the packet count when the + * aggregate size is between 16 to 23 packets + * @HDD_LRO_BUCKET_24_31: identifies the packet count when the + * aggregate size is between 24 to 31 packets + * @HDD_LRO_BUCKET_32_39: identifies the packet count when the + * aggregate size is between 32 to 39 packets + * @HDD_LRO_BUCKET_40_47: identifies the packet count when the + * aggregate size is between 40 to 47 packets + * @HDD_LRO_BUCKET_48_OR_MORE: identifies the packet count when + * the aggregate size is 48 or more packets + * @HDD_LRO_BUCKET_MAX: identifies the packet count when the + * aggregate size is 48 or more packets + */ +enum hdd_lro_pkt_aggr_bucket { + HDD_LRO_BUCKET_0_7 = 0, + HDD_LRO_BUCKET_8_15 = 1, + HDD_LRO_BUCKET_16_23 = 2, + HDD_LRO_BUCKET_24_31 = 3, + HDD_LRO_BUCKET_32_39 = 4, + HDD_LRO_BUCKET_40_47 = 5, + HDD_LRO_BUCKET_48_OR_MORE = 6, + HDD_LRO_BUCKET_MAX = HDD_LRO_BUCKET_48_OR_MORE, +}; + +/** + * hdd_lro_stats - structure containing the LRO statistics + * information + * @pkt_aggr_hist: histogram of the number of aggregated packets + * @lro_eligible_tcp: number of LRO elgible TCP packets + * @lro_ineligible_tcp: number of LRO inelgible TCP packets + */ +struct hdd_lro_stats { + uint16_t pkt_aggr_hist[HDD_LRO_BUCKET_MAX + 1]; + uint32_t lro_eligible_tcp; + uint32_t lro_ineligible_tcp; +}; + /** * hdd_lro_s - LRO information per HDD adapter * @lro_mgr: LRO manager * @lro_desc_info: LRO descriptor information * @lro_mgr_arr_access_lock: Lock to access LRO manager array. + * @lro_stats: LRO statistics */ struct hdd_lro_s { struct net_lro_mgr *lro_mgr; struct hdd_lro_desc_info lro_desc_info; qdf_spinlock_t lro_mgr_arr_access_lock; + struct hdd_lro_stats lro_stats; }; int hdd_lro_init(hdd_context_t *hdd_ctx); @@ -121,6 +167,8 @@ enum hdd_lro_rx_status hdd_lro_rx(hdd_context_t *hdd_ctx, void hdd_lro_flush_all(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter); + +void hdd_lro_display_stats(hdd_context_t *hdd_ctx); #else struct hdd_lro_s {}; @@ -142,6 +190,14 @@ static inline int hdd_lro_init(hdd_context_t *hdd_ctx) } static inline void hdd_lro_disable(hdd_context_t *hdd_ctx, - hdd_adapter_t *adapter){} + hdd_adapter_t *adapter) +{ + return; +} + +static inline void hdd_lro_display_stats(hdd_context_t *hdd_ctx) +{ + return; +} #endif /* FEATURE_LRO */ #endif /* __WLAN_HDD_LRO_H__ */ diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index a312b8c548be..1f4a8f0256a2 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -53,6 +53,14 @@ (LRO_DESC | LRO_ELIGIBILITY_CHECKED | LRO_TCP_ACK_NUM | \ LRO_TCP_DATA_CSUM | LRO_TCP_SEQ_NUM | LRO_TCP_WIN) +#define LRO_HIST_UPDATE(lro_desc, adapter) \ + do { \ + uint8_t bucket = lro_desc->pkt_aggr_cnt >> 3; \ + if (unlikely(bucket > HDD_LRO_BUCKET_MAX)) \ + bucket = HDD_LRO_BUCKET_MAX; \ + adapter->lro_info.lro_stats.pkt_aggr_hist[bucket]++; \ + } while (0); + /** * hdd_lro_get_skb_header() - LRO callback function * @skb: network buffer @@ -260,7 +268,7 @@ static int hdd_lro_desc_find(hdd_adapter_t *adapter, qdf_spin_unlock_bh(&free_pool->lro_pool_lock); if (NULL == entry->lro_desc) { - hdd_err("entry->lro_desc is NULL!\n"); + hdd_err("entry->lro_desc is NULL!"); return -EINVAL; } @@ -421,6 +429,9 @@ static void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, lro_desc = hdd_lro_get_desc(lro_mgr, lro_mgr->lro_arr, iph, tcph); if (lro_desc) { + /* statistics */ + LRO_HIST_UPDATE(lro_desc, adapter); + hdd_lro_desc_free(lro_desc, adapter); lro_flush_desc(lro_mgr, lro_desc); } @@ -474,6 +485,8 @@ static void hdd_lro_flush(void *data) lro_flush_desc( hdd_lro->lro_mgr, &hdd_lro->lro_mgr->lro_arr[i]); + LRO_HIST_UPDATE((&hdd_lro->lro_mgr->lro_arr[i]), + adapter); } } qdf_spin_unlock_bh(&hdd_lro->lro_mgr_arr_access_lock); @@ -556,6 +569,7 @@ int hdd_lro_enable(hdd_context_t *hdd_ctx, hdd_lro = &adapter->lro_info; qdf_mem_zero((void *)hdd_lro, sizeof(struct hdd_lro_s)); + /* * Allocate all the LRO data structures at once and then carve * them up as needed @@ -693,12 +707,107 @@ enum hdd_lro_rx_status hdd_lro_rx(hdd_context_t *hdd_ctx, } status = HDD_LRO_RX; + adapter->lro_info.lro_stats.lro_eligible_tcp++; } else { hdd_lro_flush_pkt(adapter->lro_info.lro_mgr, iph, tcph, adapter); + adapter->lro_info.lro_stats.lro_ineligible_tcp++; } qdf_spin_unlock_bh( &hdd_lro->lro_mgr_arr_access_lock); } return status; } + +/** + * hdd_lro_bucket_to_string() - return string conversion of + * bucket + * @bucket: bucket + * + * This utility function helps log string conversion of bucket + * enum + * + * Return: string conversion of the LRO bucket, if match found; + * "Invalid" otherwise. + */ +static const char *hdd_lro_bucket_to_string(enum hdd_lro_pkt_aggr_bucket bucket) +{ + switch (bucket) { + CASE_RETURN_STRING(HDD_LRO_BUCKET_0_7); + CASE_RETURN_STRING(HDD_LRO_BUCKET_8_15); + CASE_RETURN_STRING(HDD_LRO_BUCKET_16_23); + CASE_RETURN_STRING(HDD_LRO_BUCKET_24_31); + CASE_RETURN_STRING(HDD_LRO_BUCKET_32_39); + CASE_RETURN_STRING(HDD_LRO_BUCKET_40_47); + CASE_RETURN_STRING(HDD_LRO_BUCKET_48_OR_MORE); + default: + return "Invalid"; + } +} + +/** + * wlan_hdd_display_lro_stats() - display LRO statistics + * @hdd_ctx: hdd context + * + * Return: none + */ +void hdd_lro_display_stats(hdd_context_t *hdd_ctx) +{ + + hdd_adapter_t *adapter = NULL; + hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; + QDF_STATUS status; + int i; + + if (!hdd_ctx->config->lro_enable) { + hdd_err("LRO Disabled"); + return; + } + + status = hdd_get_front_adapter(hdd_ctx, &adapter_node); + while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { + struct hdd_lro_stats *stats; + hdd_err("\nLRO statistics:"); + + adapter = adapter_node->pAdapter; + if (!adapter) { + status = hdd_get_next_adapter(hdd_ctx, + adapter_node, &next); + adapter_node = next; + continue; + } + + stats = &adapter->lro_info.lro_stats; + hdd_err("Session_id %d device mode %d", + adapter->sessionId, adapter->device_mode); + + if (NL80211_IFTYPE_STATION != adapter->wdev.iftype) { + hdd_err("No LRO on interface type %d", + adapter->wdev.iftype); + status = hdd_get_next_adapter(hdd_ctx, + adapter_node, &next); + adapter_node = next; + continue; + } + + for (i = 0; i <= HDD_LRO_BUCKET_MAX; i++) { + if (stats && stats->pkt_aggr_hist) + hdd_err("bucket %s: %d packets", + hdd_lro_bucket_to_string(i), + stats->pkt_aggr_hist[i]); + } + + hdd_err("LRO eligible TCP packets %d\n" + "LRO ineligible TCP packets %d", + stats->lro_eligible_tcp, stats->lro_ineligible_tcp); + + if (adapter->lro_info.lro_mgr) + hdd_err("LRO manager aggr %lu flushed %lu no desc %lu", + adapter->lro_info.lro_mgr->stats.aggregated, + adapter->lro_info.lro_mgr->stats.flushed, + adapter->lro_info.lro_mgr->stats.no_desc); + + status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next); + adapter_node = next; + } +} diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index f81f9e1ccea3..42fd9fa3cce3 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -94,6 +94,7 @@ #include "hif.h" #include "pld_common.h" #endif +#include "wlan_hdd_lro.h" #define HDD_FINISH_ULA_TIME_OUT 800 #define HDD_SET_MCBC_FILTERS_TO_FW 1 @@ -720,6 +721,9 @@ void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value) case WLAN_HIF_STATS: hdd_display_hif_stats(); break; + case WLAN_LRO_STATS: + hdd_lro_display_stats(hdd_ctx); + break; default: ol_txrx_display_stats(value); break; From 0c6a49c65144df28fee5cd605c7f9f8fdf48a94c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 15:09:41 -0700 Subject: [PATCH 120/179] Release 5.1.0.31X Release 5.1.0.31X Change-Id: Iabc4a5abef28e5f002055114ce2f3e8420b151d3 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c8c6fd16a399..e1452018b775 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "W" +#define QWLAN_VERSION_EXTRA "X" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31W" +#define QWLAN_VERSIONSTR "5.1.0.31X" #endif /* QWLAN_VERSION_H */ From 3d6a8e27e69d45c9823c0409840e25c017b7aba9 Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Tue, 11 Oct 2016 18:57:14 -0700 Subject: [PATCH 121/179] qcacld-3.0: Add support to log fw version subid Add support to log firmware version sub id in the logs and iwpriv command 'version' Change-Id: I1eaad763da55007d34e243509204acf12ec79955 CRs-Fixed: 1077115 --- core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_main.c | 1 + core/hdd/src/wlan_hdd_wext.c | 12 +++++++----- core/wma/inc/wma.h | 2 ++ core/wma/inc/wma_tgt_cfg.h | 2 ++ core/wma/src/wma_main.c | 3 ++- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index e6d7cd9ee707..ec6e5990dc08 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1417,6 +1417,7 @@ struct hdd_context_s { /* defining the firmware version */ uint32_t target_fw_version; + uint32_t target_fw_vers_ext; qdf_atomic_t dfs_radar_found; /* defining the chip/rom version */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cf4c663ba24c..d658e97bf6b9 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1448,6 +1448,7 @@ void hdd_update_tgt_cfg(void *context, void *param) } hdd_ctx->target_fw_version = cfg->target_fw_version; + hdd_ctx->target_fw_vers_ext = cfg->target_fw_vers_ext; hdd_ctx->max_intf_count = cfg->max_intf_count; diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 42fd9fa3cce3..7629c204152b 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -749,7 +749,7 @@ void hdd_wlan_get_version(hdd_context_t *hdd_ctx, union iwreq_data *wrqu, tSirVersionString wcnss_sw_version; const char *swversion; const char *hwversion; - uint32_t msp_id = 0, mspid = 0, siid = 0, crmid = 0; + uint32_t msp_id = 0, mspid = 0, siid = 0, crmid = 0, sub_id = 0; if (!hdd_ctx) { hdd_err("Invalid context, HDD context is null"); @@ -764,19 +764,21 @@ void hdd_wlan_get_version(hdd_context_t *hdd_ctx, union iwreq_data *wrqu, mspid = (hdd_ctx->target_fw_version & 0xf000000) >> 24; siid = (hdd_ctx->target_fw_version & 0xf00000) >> 20; crmid = hdd_ctx->target_fw_version & 0x7fff; + sub_id = (hdd_ctx->target_fw_vers_ext & 0xf0000000) >> 28; hwversion = hdd_ctx->target_hw_name; if (wrqu && extra) { wrqu->data.length = scnprintf(extra, WE_MAX_STR_LEN, - "Host SW:%s, FW:%d.%d.%d.%d, HW:%s", + "Host SW:%s, FW:%d.%d.%d.%d.%d, HW:%s", QWLAN_VERSIONSTR, - msp_id, mspid, siid, crmid, hwversion); + msp_id, mspid, siid, crmid, + sub_id, hwversion); } else { - pr_info("Host SW:%s, FW:%d.%d.%d.%d, HW:%s\n", + pr_info("Host SW:%s, FW:%d.%d.%d.%d.%d, HW:%s\n", QWLAN_VERSIONSTR, - msp_id, mspid, siid, crmid, hwversion); + msp_id, mspid, siid, crmid, sub_id, hwversion); } error: return; diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index ba11600b9fa8..b8468bb672e5 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1291,6 +1291,7 @@ struct extended_caps { * @target_abi_vers: target firmware version * @final_abi_vers: The final ABI version to be used for communicating * @target_fw_version: Target f/w build version + * @target_fw_vers_ext: Target f/w build version sub id * @lpss_support: LPSS feature is supported in target or not * @egap_support: Enhanced Green AP support flag * @wmi_ready: wmi status flag @@ -1422,6 +1423,7 @@ typedef struct { wmi_abi_version target_abi_vers; wmi_abi_version final_abi_vers; uint32_t target_fw_version; + uint32_t target_fw_vers_ext; #ifdef WLAN_FEATURE_LPSS uint8_t lpss_support; #endif diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index 7e9b68837142..5ce91f38425b 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -136,6 +136,7 @@ struct wma_dfs_radar_ind { /** * struct wma_tgt_cfg - target config * @target_fw_version: target fw version + * @target_fw_vers_ext: target fw extended sub version * @band_cap: band capability * @reg_domain: reg domain * @eeprom_rd_ext: eeprom rd ext @@ -151,6 +152,7 @@ struct wma_dfs_radar_ind { */ struct wma_tgt_cfg { uint32_t target_fw_version; + uint32_t target_fw_vers_ext; uint8_t band_cap; uint32_t reg_domain; uint32_t eeprom_rd_ext; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index b4e27b1b95dd..2f0ca115dfa5 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4189,6 +4189,7 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle) wma_update_target_ext_vht_cap(wma_handle, &tgt_cfg.vht_cap); tgt_cfg.target_fw_version = wma_handle->target_fw_version; + tgt_cfg.target_fw_vers_ext = wma_handle->target_fw_vers_ext; #ifdef WLAN_FEATURE_LPSS tgt_cfg.lpss_support = wma_handle->lpss_support; #endif /* WLAN_FEATURE_LPSS */ @@ -5359,7 +5360,7 @@ int wma_rx_service_ready_ext_event(void *handle, uint8_t *event, wma_init_scan_fw_mode_config(wma_handle, ev->default_conc_scan_config_bits, ev->default_fw_config_bits); - + wma_handle->target_fw_vers_ext = ev->fw_build_vers_ext; return 0; } From 769f6caace9617f40be385cc9398805f44e243b2 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 18:42:42 -0700 Subject: [PATCH 122/179] Release 5.1.0.31Y Release 5.1.0.31Y Change-Id: Ic3ada326801f4175c51d8d236d8187148056e81c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index e1452018b775..db5057027b2e 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "X" +#define QWLAN_VERSION_EXTRA "Y" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31X" +#define QWLAN_VERSIONSTR "5.1.0.31Y" #endif /* QWLAN_VERSION_H */ From 49c02f96459d87966ddc21f04a9cd39eaa20f976 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:29:09 -0700 Subject: [PATCH 123/179] qcacld-3.0: Fix -Wmissing-prototypes in sme_api We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sme_api. Change-Id: I7f896067d87f457ab58c64036155fbff2f546ea0 CRs-Fixed: 1075575 --- core/sme/src/common/sme_api.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index c0ab9a29814a..2afb1456d881 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -508,7 +508,7 @@ done: return status; } -void dump_csr_command_info(tpAniSirGlobal pMac, tSmeCmd *pCmd) +static void dump_csr_command_info(tpAniSirGlobal pMac, tSmeCmd *pCmd) { switch (pCmd->command) { case eSmeCommandScan: @@ -702,6 +702,7 @@ static void sme_abort_command(tpAniSirGlobal pMac, tSmeCmd *pCommand, } +static tListElem *csr_get_cmd_to_process(tpAniSirGlobal pMac, tDblLinkList *pList, uint8_t sessionId, bool fInterlocked) { @@ -726,7 +727,7 @@ tListElem *csr_get_cmd_to_process(tpAniSirGlobal pMac, tDblLinkList *pList, return NULL; } -bool sme_process_scan_queue(tpAniSirGlobal pMac) +static bool sme_process_scan_queue(tpAniSirGlobal pMac) { tListElem *pEntry; tSmeCmd *pCommand; @@ -823,7 +824,7 @@ end: * Return: true indicates that caller function can proceed to next cmd * false otherwise. */ -bool sme_process_command(tpAniSirGlobal pMac) +static bool sme_process_command(tpAniSirGlobal pMac) { bool fContinue = false; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -1082,7 +1083,7 @@ bool sme_command_pending(tpAniSirGlobal pMac) * * Return: returns session id */ -uint32_t sme_get_sessionid_from_activelist(tpAniSirGlobal mac) +static uint32_t sme_get_sessionid_from_activelist(tpAniSirGlobal mac) { tListElem *entry; tSmeCmd *command; @@ -1547,7 +1548,7 @@ QDF_STATUS sme_update_roam_params(tHalHandle hal, } #ifdef WLAN_FEATURE_GTK_OFFLOAD -void sme_process_get_gtk_info_rsp(tHalHandle hHal, +static void sme_process_get_gtk_info_rsp(tHalHandle hHal, tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) { @@ -1585,8 +1586,8 @@ void sme_process_get_gtk_info_rsp(tHalHandle hHal, \sa --------------------------------------------------------------------------*/ -void sme_process_ready_to_suspend(tHalHandle hHal, - tpSirReadyToSuspendInd pReadyToSuspend) +static void sme_process_ready_to_suspend(tHalHandle hHal, + tpSirReadyToSuspendInd pReadyToSuspend) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); @@ -1616,8 +1617,8 @@ void sme_process_ready_to_suspend(tHalHandle hHal, * * Return: None */ -void sme_process_ready_to_ext_wow(tHalHandle hHal, - tpSirReadyToExtWoWInd pReadyToExtWoW) +static void sme_process_ready_to_ext_wow(tHalHandle hHal, + tpSirReadyToExtWoWInd pReadyToExtWoW) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); @@ -2385,9 +2386,10 @@ QDF_STATUS sme_set_ese_roam_scan_channel_list(tHalHandle hHal, #endif /* FEATURE_WLAN_ESE */ -QDF_STATUS sme_ibss_peer_info_response_handleer(tHalHandle hHal, - tpSirIbssGetPeerInfoRspParams - pIbssPeerInfoParams) +static +QDF_STATUS sme_ibss_peer_info_response_handler(tHalHandle hHal, + tpSirIbssGetPeerInfoRspParams + pIbssPeerInfoParams) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); @@ -2794,9 +2796,8 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg) #endif /* FEATURE_WLAN_LPHB */ case eWNI_SME_IBSS_PEER_INFO_RSP: if (pMsg->bodyptr) { - sme_ibss_peer_info_response_handleer(pMac, - pMsg-> - bodyptr); + sme_ibss_peer_info_response_handler(pMac, + pMsg->bodyptr); qdf_mem_free(pMsg->bodyptr); } else { sms_log(pMac, LOGE, FL("Empty message for %d"), @@ -11802,7 +11803,7 @@ void sme_get_recovery_stats(tHalHandle hHal) * * Return: None */ -void sme_save_active_cmd_stats(tHalHandle hHal) +static void sme_save_active_cmd_stats(tHalHandle hHal) { tSmeCmd *pTempCmd = NULL; tListElem *pEntry; From f7135a227841a7ac87cd18174c21a8884bf1c212 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 19:16:46 -0700 Subject: [PATCH 124/179] Release 5.1.0.31Z Release 5.1.0.31Z Change-Id: I5810a0715fa725bd52ff7d513655f79ac2c6424a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index db5057027b2e..740309e3fe86 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Y" +#define QWLAN_VERSION_EXTRA "Z" #define QWLAN_VERSION_BUILD 31 -#define QWLAN_VERSIONSTR "5.1.0.31Y" +#define QWLAN_VERSIONSTR "5.1.0.31Z" #endif /* QWLAN_VERSION_H */ From 8292dcb0ac1d12bbc3b670bf111b325c2897d396 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Fri, 7 Oct 2016 16:46:06 -0700 Subject: [PATCH 125/179] qcacld-3.0: Check offload status before sending IPA enable_disable To avoid FW crash caused by sending the same IPA enable_disable WMI message twice, check the IPA offload enable status before sending it to FW. Fixed log to check both uc_op_code and stat_req_reason. Change-Id: I1fc5f4de8207872edf3c2c6ec908820ac819e4ae CRs-Fixed: 1073325 --- core/hdd/src/wlan_hdd_ipa.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index bb06854696c7..4bf1436322d6 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -244,6 +244,7 @@ struct hdd_ipa_iface_context { qdf_spinlock_t interface_lock; uint32_t ifa_address; struct hdd_ipa_iface_stats stats; + uint32_t offload_enabled; }; struct hdd_ipa_stats { @@ -1353,9 +1354,7 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) hdd_ipa->pending_cons_req = false; } qdf_mutex_release(&hdd_ipa->ipa_lock); - } - - if ((HDD_IPA_UC_OPCODE_TX_SUSPEND == msg->op_code) || + } else if ((HDD_IPA_UC_OPCODE_TX_SUSPEND == msg->op_code) || (HDD_IPA_UC_OPCODE_RX_SUSPEND == msg->op_code)) { qdf_mutex_acquire(&hdd_ipa->ipa_lock); hdd_ipa->activated_fw_pipe--; @@ -1371,9 +1370,7 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) hdd_ipa->pending_cons_req = false; } qdf_mutex_release(&hdd_ipa->ipa_lock); - } - - if ((HDD_IPA_UC_OPCODE_STATS == msg->op_code) && + } else if ((HDD_IPA_UC_OPCODE_STATS == msg->op_code) && (HDD_IPA_UC_STAT_REASON_DEBUG == hdd_ipa->stat_req_reason)) { struct ol_txrx_ipa_resources *res = &hdd_ipa->ipa_resource; /* STATs from host */ @@ -1572,8 +1569,8 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) uc_fw_stat->rx_num_pkts_indicated); qdf_mutex_release(&hdd_ipa->ipa_lock); } else { - HDD_IPA_LOG(LOGE, "INVALID REASON %d", - hdd_ipa->stat_req_reason); + HDD_IPA_LOG(LOGE, "Invalid message: op_code=%d, reason=%d", + msg->op_code, hdd_ipa->stat_req_reason); } qdf_mem_free(op_msg); } @@ -1591,10 +1588,22 @@ static void hdd_ipa_uc_offload_enable_disable(hdd_adapter_t *adapter, uint32_t offload_type, uint32_t enable) { struct sir_ipa_offload_enable_disable ipa_offload_enable_disable; + struct hdd_ipa_iface_context *iface_context = NULL; if (!adapter) return; + iface_context = adapter->ipa_context; + + if (!iface_context || (enable == iface_context->offload_enabled)) { + /* IPA offload status is already set as desired */ + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "offload_type=%d, vdev_id=%d, enable=%d", + offload_type, adapter->sessionId, enable); + WARN_ON(1); + return; + } + /* Lower layer may send multiple START_BSS_EVENT in DFS mode or during * channel change indication. Since these indications are sent by lower * layer as SAP updates and IPA doesn't have to do anything for these @@ -1610,7 +1619,7 @@ static void hdd_ipa_uc_offload_enable_disable(hdd_adapter_t *adapter, ipa_offload_enable_disable.enable = enable; HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, - "%s: offload_type=%d, vdev_id=%d, enable=%d", __func__, + "offload_type=%d, vdev_id=%d, enable=%d", ipa_offload_enable_disable.offload_type, ipa_offload_enable_disable.vdev_id, ipa_offload_enable_disable.enable); @@ -1624,6 +1633,10 @@ static void hdd_ipa_uc_offload_enable_disable(hdd_adapter_t *adapter, ipa_offload_enable_disable.offload_type, ipa_offload_enable_disable.vdev_id, ipa_offload_enable_disable.enable); + } else { + /* Update the IPA offload status */ + iface_context->offload_enabled = + ipa_offload_enable_disable.enable; } } @@ -4107,6 +4120,7 @@ QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx) hdd_ipa_adapter_2_client[i].prod_client; iface_context->iface_id = i; iface_context->adapter = NULL; + iface_context->offload_enabled = 0; qdf_spinlock_create(&iface_context->interface_lock); } From a27049adf39bd34e4744aa8db9bcb2f143507be0 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 11 Oct 2016 12:30:49 -0700 Subject: [PATCH 126/179] qcacld-3.0: Fix to disable MCC path for DBS and TX_FLOW_CONTROL_V2 Add code to check MCC for DBS case, and remove MCC mode switch message to IPA when TX_FLOW_CONTROL_V2 is defined. Change-Id: Ic09d1cbcb2df98b4b62b4fff27d44b67ce57c196 CRs-Fixed: 1077246 --- core/cds/src/cds_concurrency.c | 37 ++++++++++++++++++---------------- core/hdd/inc/wlan_hdd_ipa.h | 10 ++++++++- core/hdd/src/wlan_hdd_ipa.c | 2 ++ 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index e5519c4727c2..e8426415a1ee 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -3018,36 +3018,39 @@ static void cds_dump_current_concurrency(void) } /** - * cds_current_concurrency_is_scc() - To check the current - * concurrency combination if it is doing SCC + * cds_current_concurrency_is_mcc() - To check the current + * concurrency combination if it is doing MCC * - * This routine is called to check if it is doing SCC + * This routine is called to check if it is doing MCC * - * Return: True - SCC, False - Otherwise + * Return: True - MCC, False - Otherwise */ -static bool cds_current_concurrency_is_scc(void) +static bool cds_current_concurrency_is_mcc(void) { uint32_t num_connections = 0; - bool is_scc = false; + bool is_mcc = false; num_connections = cds_get_connection_count(); switch (num_connections) { case 1: - is_scc = true; break; case 2: - if (conc_connection_list[0].chan == - conc_connection_list[1].chan) { - is_scc = true; + if ((conc_connection_list[0].chan != + conc_connection_list[1].chan) && + (conc_connection_list[0].mac == + conc_connection_list[1].mac)) { + is_mcc = true; } break; case 3: - if ((conc_connection_list[0].chan == - conc_connection_list[1].chan) && - (conc_connection_list[0].chan == - conc_connection_list[2].chan)){ - is_scc = true; + if ((conc_connection_list[0].chan != + conc_connection_list[1].chan) || + (conc_connection_list[0].chan != + conc_connection_list[2].chan) || + (conc_connection_list[1].chan != + conc_connection_list[2].chan)){ + is_mcc = true; } break; default: @@ -3056,7 +3059,7 @@ static bool cds_current_concurrency_is_scc(void) break; } - return is_scc; + return is_mcc; } /** @@ -3342,7 +3345,7 @@ void cds_dump_concurrency_info(void) adapterNode = pNext; } cds_dump_current_concurrency(); - hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc(); + hdd_ctx->mcc_mode = cds_current_concurrency_is_mcc(); } #ifdef FEATURE_WLAN_TDLS diff --git a/core/hdd/inc/wlan_hdd_ipa.h b/core/hdd/inc/wlan_hdd_ipa.h index f7221a653daf..54e7b1d2ca67 100644 --- a/core/hdd/inc/wlan_hdd_ipa.h +++ b/core/hdd/inc/wlan_hdd_ipa.h @@ -88,7 +88,15 @@ void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx); void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason); bool hdd_ipa_is_enabled(hdd_context_t *pHddCtx); bool hdd_ipa_uc_is_enabled(hdd_context_t *pHddCtx); -int hdd_ipa_send_mcc_scc_msg(hdd_context_t *pHddCtx, bool mcc_mode); +#ifndef QCA_LL_TX_FLOW_CONTROL_V2 +int hdd_ipa_send_mcc_scc_msg(hdd_context_t *hdd_ctx, bool mcc_mode); +#else +static inline int hdd_ipa_send_mcc_scc_msg(hdd_context_t *hdd_ctx, + bool mcc_mode) +{ + return 0; +} +#endif int hdd_ipa_uc_ssr_reinit(void); int hdd_ipa_uc_ssr_deinit(void); void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 4bf1436322d6..f6e10a735b7a 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -3468,6 +3468,7 @@ static void hdd_ipa_msg_free_fn(void *buff, uint32_t len, uint32_t type) qdf_mem_free(buff); } +#ifndef QCA_LL_TX_FLOW_CONTROL_V2 /** * hdd_ipa_send_mcc_scc_msg() - send IPA WLAN_SWITCH_TO_MCC/SCC message * @mcc_mode: 0=MCC/1=SCC @@ -3526,6 +3527,7 @@ int hdd_ipa_send_mcc_scc_msg(hdd_context_t *pHddCtx, bool mcc_mode) return ret; } +#endif /** * hdd_ipa_wlan_event_to_str() - convert IPA WLAN event to string From f8d6a124389274198a77ceb2e74271be0e0ca4a8 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 11 Oct 2016 15:49:43 -0700 Subject: [PATCH 127/179] qcacld-3.0: Fix HDD IPA stability issues SKBs received through IPA exception path are not allocate by WLAN driver and we should not pass these SKBs to driver SKB debug hash infrastructure(for free clean up). So use kfree_skb instead of qdf_nbuf_free for IPA exception data path. Add ssr protection and wlan_hdd_validate_context in hdd_ipa_w2i_cb. Change-Id: I593efad97cbe2629bf0b96cbde587d092b81babb CRs-Fixed: 1076635 --- core/hdd/src/wlan_hdd_ipa.c | 46 +++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index f6e10a735b7a..8a2db979f68b 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -952,7 +952,7 @@ void hdd_ipa_uc_stat_query(hdd_context_t *pHddCtx, (false == hdd_ipa->resource_loading)) { *ipa_tx_diff = hdd_ipa->ipa_tx_packets_diff; *ipa_rx_diff = hdd_ipa->ipa_rx_packets_diff; - HDD_IPA_LOG(LOG1, "STAT Query TX DIFF %d, RX DIFF %d", + HDD_IPA_LOG(LOGOFF, "STAT Query TX DIFF %d, RX DIFF %d", *ipa_tx_diff, *ipa_rx_diff); } qdf_mutex_release(&hdd_ipa->ipa_lock); @@ -2482,13 +2482,13 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO_LOW, "Invalid adapter: 0x%p", adapter); HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); - qdf_nbuf_free(skb); + kfree_skb(skb); return; } if (cds_is_driver_unloading()) { HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); - qdf_nbuf_free(skb); + kfree_skb(skb); return; } @@ -2510,7 +2510,7 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, } /** - * hdd_ipa_w2i_cb() - WLAN to IPA callback handler + * __hdd_ipa_w2i_cb() - WLAN to IPA callback handler * @priv: pointer to private data registered with IPA (we register a * pointer to the global IPA context) * @evt: the IPA event which triggered the callback @@ -2518,7 +2518,7 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, * * Return: None */ -static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, +static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, unsigned long data) { struct hdd_ipa_priv *hdd_ipa = NULL; @@ -2530,12 +2530,27 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, qdf_nbuf_t copy; uint8_t fw_desc; int ret; + QDF_STATUS status = QDF_STATUS_SUCCESS; hdd_ipa = (struct hdd_ipa_priv *)priv; switch (evt) { case IPA_RECEIVE: skb = (qdf_nbuf_t) data; + + /* + * When SSR is going on or driver is unloading, + * just drop the packets. + */ + status = wlan_hdd_validate_context(hdd_ipa->hdd_ctx); + if (0 != status) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "Invalid context: drop packet"); + HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); + kfree_skb(skb); + return; + } + if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) { session_id = (uint8_t)skb->cb[0]; iface_id = vdev_to_iface[session_id]; @@ -2553,7 +2568,7 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, HDD_IPA_DBG_DUMP(QDF_TRACE_LEVEL_INFO_HIGH, "w2i -- skb", skb->data, 8); HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); - qdf_nbuf_free(skb); + kfree_skb(skb); return; } @@ -2613,7 +2628,7 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, if (fw_desc & HDD_IPA_FW_RX_DESC_DISCARD_M) { HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); hdd_ipa->ipa_rx_discard++; - qdf_nbuf_free(skb); + kfree_skb(skb); break; } @@ -2632,6 +2647,23 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, } } +/** + * hdd_ipa_w2i_cb() - SSR wrapper for __hdd_ipa_w2i_cb + * @priv: pointer to private data registered with IPA (we register a + * pointer to the global IPA context) + * @evt: the IPA event which triggered the callback + * @data: data associated with the event + * + * Return: None + */ +static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, + unsigned long data) +{ + cds_ssr_protect(__func__); + __hdd_ipa_w2i_cb(priv, evt, data); + cds_ssr_unprotect(__func__); +} + /** * hdd_ipa_nbuf_cb() - IPA TX complete callback * @skb: packet buffer which was transmitted From 4d968dfdc096017f2a642f951b4b4af4d0e0c225 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Tue, 11 Oct 2016 11:44:15 -0700 Subject: [PATCH 128/179] qcacld-3.0: Support bigger Tx MSDU ID partition When both host and FW support a new partition, FW uses host use the new parition HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN. If FW doesn't support a new partition, host falls back to use old HTT_TX_IPA_MSDU_ID_SPACE_BEGIN. Handshaking is done through WMI_READY and WMI_INIT. Change-Id: I974c931e1b4b2d84e809ec19537a09b679932568 CRs-Fixed: 1072812 --- core/dp/ol/inc/ol_cfg.h | 7 +++++++ core/dp/txrx/ol_cfg.c | 6 ++++++ core/wma/src/wma_main.c | 17 +++++++++++++++++ target/inc/htt_common.h | 15 ++++++++++++++- 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/core/dp/ol/inc/ol_cfg.h b/core/dp/ol/inc/ol_cfg.h index 6f776dd252e5..29ade0c7e055 100644 --- a/core/dp/ol/inc/ol_cfg.h +++ b/core/dp/ol/inc/ol_cfg.h @@ -516,6 +516,7 @@ unsigned int ol_cfg_ipa_uc_rx_ind_ring_size(ol_pdev_handle pdev); * @param pdev - handle to the physical device */ unsigned int ol_cfg_ipa_uc_tx_partition_base(ol_pdev_handle pdev); +void ol_cfg_set_ipa_uc_tx_partition_base(ol_pdev_handle pdev, uint32_t value); #else static inline unsigned int ol_cfg_ipa_uc_offload_enabled( ol_pdev_handle pdev) @@ -546,6 +547,12 @@ static inline unsigned int ol_cfg_ipa_uc_tx_partition_base( { return 0; } + +static inline void ol_cfg_set_ipa_uc_tx_partition_base( + ol_pdev_handle pdev, uint32_t value) +{ + return; +} #endif /* IPA_OFFLOAD */ /** diff --git a/core/dp/txrx/ol_cfg.c b/core/dp/txrx/ol_cfg.c index 1b4a5911c0b5..29140a5f93e2 100644 --- a/core/dp/txrx/ol_cfg.c +++ b/core/dp/txrx/ol_cfg.c @@ -403,6 +403,12 @@ unsigned int ol_cfg_ipa_uc_tx_partition_base(ol_pdev_handle pdev) struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev; return cfg->ipa_uc_rsc.tx_partition_base; } + +void ol_cfg_set_ipa_uc_tx_partition_base(ol_pdev_handle pdev, uint32_t val) +{ + struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev; + cfg->ipa_uc_rsc.tx_partition_base = val; +} #endif /* IPA_OFFLOAD */ /** diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 2f0ca115dfa5..fa9198feb700 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -241,6 +241,8 @@ static void wma_set_default_tgt_config(tp_wma_handle wma_handle) tgt_cfg.scan_max_pending_req = wma_handle->max_scan; WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_SET(tgt_cfg.flag1, 1); + WMI_RSRC_CFG_FLAG_TX_MSDU_ID_NEW_PARTITION_SUPPORT_SET(tgt_cfg.flag1, + 1); WMITLV_SET_HDR(&tgt_cfg.tlv_header, WMITLV_TAG_STRUC_wmi_resource_config, @@ -3723,6 +3725,21 @@ static inline void wma_update_target_services(tp_wma_handle wh, if (WMI_SERVICE_IS_ENABLED(wh->wmi_service_bitmap, WMI_SERVICE_RTT)) g_fw_wlan_feat_caps |= (1 << RTT); + + if (WMI_SERVICE_IS_ENABLED(wh->wmi_service_bitmap, + WMI_SERVICE_TX_MSDU_ID_NEW_PARTITION_SUPPORT)) { + ol_cfg_set_ipa_uc_tx_partition_base((ol_pdev_handle) + ((p_cds_contextType) wh->cds_context)->cfg_ctx, + HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN); + WMA_LOGI("%s: TX_MSDU_ID_NEW_PARTITION=%d", __func__, + HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN); + } else { + ol_cfg_set_ipa_uc_tx_partition_base((ol_pdev_handle) + ((p_cds_contextType) wh->cds_context)->cfg_ctx, + HTT_TX_IPA_MSDU_ID_SPACE_BEGIN); + WMA_LOGI("%s: TX_MSDU_ID_OLD_PARTITION=%d", __func__, + HTT_TX_IPA_MSDU_ID_SPACE_BEGIN); + } } /** diff --git a/target/inc/htt_common.h b/target/inc/htt_common.h index 0e9d7c357d64..8f4d82fe72e3 100644 --- a/target/inc/htt_common.h +++ b/target/inc/htt_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -113,8 +113,21 @@ enum htt_pkt_type { htt_pkt_num_types }; +/* + * TX MSDU ID partition - + * FW supports bigger MSDU ID partition which is defined as + * HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN + * When both host and FW support new partition, FW uses + * HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN + * If host doesn't support, FW falls back to HTT_TX_IPA_MSDU_ID_SPACE_BEGIN + * Handshaking is done through WMI_READY and WMI_INIT + */ #define HTT_TX_HOST_MSDU_ID_SPACE_BEGIN 0 #define HTT_TX_IPA_MSDU_ID_SPACE_BEGIN 3000 #define TGT_RX2TX_MSDU_ID_SPACE_BEGIN 6000 +/* 8192 = 0xr2000 */ +#define HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN 8192 +/* 12288 = 0x3000 */ +#define TGT_RX2TX_NEW_MSDU_ID_SPACE_BEGIN 12288 #endif /* _HTT_COMMON_H_ */ From 69c396913856533fa11b3eae346d5e16c33df80e Mon Sep 17 00:00:00 2001 From: Leo Chang Date: Wed, 12 Oct 2016 20:11:12 -0700 Subject: [PATCH 129/179] qcacld-3.0: ipa exception packet forwarding crash fix When WLAN subsystem is in suspend state, if packet deliever to WLAN FW, WLAN FW will crash with bad state. So, if WLAN subsystem is in suspend state, host should not pump down packet to FW. IPA subsystem could not know WLAN power state. Then WLAN HDD should inspect WLAN power state. If suspend state, packet should queueing into local queue and when resume, send packet to FW Change-Id: I60e1e8f0fff40c9f0ca4a798b76878548ca89ad7 CRs-fixed: 1077078 --- core/hdd/src/wlan_hdd_ipa.c | 100 +++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 8a2db979f68b..b2140c95d598 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -202,6 +202,8 @@ struct hdd_ipa_rx_hdr { } __packed; struct hdd_ipa_pm_tx_cb { + bool exception; + hdd_adapter_t *adapter; struct hdd_ipa_iface_context *iface_context; struct ipa_rx_data *ipa_tx_desc; }; @@ -2510,7 +2512,58 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, } /** - * __hdd_ipa_w2i_cb() - WLAN to IPA callback handler + * hdd_ipa_forward() - handle packet forwarding to wlan tx + * @hdd_ipa: pointer to hdd ipa context + * @adapter: network adapter + * @skb: data pointer + * + * if exception packet has set forward bit, copied new packet should be + * forwarded to wlan tx. if wlan subsystem is in suspend state, packet should + * put into pm queue and tx procedure will be differed + * + * Return: None + */ +void hdd_ipa_forward(struct hdd_ipa_priv *hdd_ipa, + hdd_adapter_t *adapter, qdf_nbuf_t skb) +{ + qdf_nbuf_t copy; + struct hdd_ipa_pm_tx_cb *pm_tx_cb; + + copy = qdf_nbuf_copy(skb); + if (!copy) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "copy packet alloc fail"); + return; + } + + qdf_spin_lock_bh(&hdd_ipa->pm_lock); + /* WLAN subsystem is in suspend, put int queue */ + if (hdd_ipa->suspended) { + qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "TX in SUSPEND PUT QUEUE"); + qdf_mem_set(copy->cb, sizeof(copy->cb), 0); + pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)copy->cb; + pm_tx_cb->exception = true; + pm_tx_cb->adapter = adapter; + qdf_spin_lock_bh(&hdd_ipa->pm_lock); + qdf_nbuf_queue_add(&hdd_ipa->pm_queue_head, copy); + qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + hdd_ipa->stats.num_tx_queued++; + } else { + /* Resume, put packet into WLAN TX */ + qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + if (hdd_softap_hard_start_xmit(copy, adapter->dev)) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "packet tx fail"); + } else { + hdd_ipa->stats.num_tx_bcmc++; + hdd_ipa->ipa_tx_forward++; + } + } +} + +/** + * hdd_ipa_w2i_cb() - WLAN to IPA callback handler * @priv: pointer to private data registered with IPA (we register a * pointer to the global IPA context) * @evt: the IPA event which triggered the callback @@ -2527,9 +2580,7 @@ static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, uint8_t iface_id; uint8_t session_id; struct hdd_ipa_iface_context *iface_context; - qdf_nbuf_t copy; uint8_t fw_desc; - int ret; QDF_STATUS status = QDF_STATUS_SUCCESS; hdd_ipa = (struct hdd_ipa_priv *)priv; @@ -2601,37 +2652,19 @@ static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, * only when DISCARD bit is not set. */ fw_desc = (uint8_t)skb->cb[1]; - if (fw_desc & HDD_IPA_FW_RX_DESC_FORWARD_M) { HDD_IPA_DP_LOG( QDF_TRACE_LEVEL_DEBUG, "Forward packet to Tx (fw_desc=%d)", fw_desc); - copy = qdf_nbuf_copy(skb); - if (copy) { - hdd_ipa->ipa_tx_forward++; - ret = hdd_softap_hard_start_xmit( - (struct sk_buff *)copy, - adapter->dev); - if (ret) { - HDD_IPA_LOG( - QDF_TRACE_LEVEL_DEBUG, - "Forward packet tx fail"); - hdd_ipa->stats. - num_tx_bcmc_err++; - } else { - hdd_ipa->stats.num_tx_bcmc++; - } - } + hdd_ipa_forward(hdd_ipa, adapter, skb); } - if (fw_desc & HDD_IPA_FW_RX_DESC_DISCARD_M) { HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); hdd_ipa->ipa_rx_discard++; kfree_skb(skb); break; } - } else { HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO_HIGH, "Intra-BSS FWD is disabled-skip forward to Tx"); @@ -2769,7 +2802,7 @@ static void hdd_ipa_send_pkt_to_tl( } /** - * hdd_ipa_pm_send_pkt_to_tl() - Send queued packets to TL + * hdd_ipa_pm_flush() - flush queued packets * @work: pointer to the scheduled work * * Called during PM resume to send packets to TL which were queued @@ -2777,7 +2810,7 @@ static void hdd_ipa_send_pkt_to_tl( * * Return: None */ -static void hdd_ipa_pm_send_pkt_to_tl(struct work_struct *work) +static void hdd_ipa_pm_flush(struct work_struct *work) { struct hdd_ipa_priv *hdd_ipa = container_of(work, struct hdd_ipa_priv, @@ -2786,23 +2819,28 @@ static void hdd_ipa_pm_send_pkt_to_tl(struct work_struct *work) qdf_nbuf_t skb; uint32_t dequeued = 0; + qdf_wake_lock_acquire(&hdd_ipa->wake_lock, + WIFI_POWER_EVENT_WAKELOCK_IPA); qdf_spin_lock_bh(&hdd_ipa->pm_lock); - while (((skb = qdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) != NULL)) { qdf_spin_unlock_bh(&hdd_ipa->pm_lock); pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; - dequeued++; - - hdd_ipa_send_pkt_to_tl(pm_tx_cb->iface_context, + if (pm_tx_cb->exception) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "FLUSH EXCEPTION"); + hdd_softap_hard_start_xmit(skb, pm_tx_cb->adapter->dev); + } else { + hdd_ipa_send_pkt_to_tl(pm_tx_cb->iface_context, pm_tx_cb->ipa_tx_desc); - + } qdf_spin_lock_bh(&hdd_ipa->pm_lock); } - qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + qdf_wake_lock_release(&hdd_ipa->wake_lock, + WIFI_POWER_EVENT_WAKELOCK_IPA); hdd_ipa->stats.num_tx_dequeued += dequeued; if (dequeued > hdd_ipa->stats.num_max_pm_queue) @@ -4158,7 +4196,7 @@ QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx) qdf_spinlock_create(&iface_context->interface_lock); } - INIT_WORK(&hdd_ipa->pm_work, hdd_ipa_pm_send_pkt_to_tl); + INIT_WORK(&hdd_ipa->pm_work, hdd_ipa_pm_flush); qdf_spinlock_create(&hdd_ipa->pm_lock); qdf_nbuf_queue_init(&hdd_ipa->pm_queue_head); From a202b52f06e46e5c524ae6e4c1286995df8e095e Mon Sep 17 00:00:00 2001 From: Leo Chang Date: Fri, 14 Oct 2016 16:13:50 -0700 Subject: [PATCH 130/179] qcacld-3.0: ipa offload data path only support STA and SAP ipa hardware data path should only support sap/sta mode. P2PGo, P2PCli and all other mode should not support IPA offload data path. Any ipa event came from non-sta/sap adapter should be ignored and return success. Change-Id: If2b6e9026d351ac5fb3c87e8f65df1615dfb154a CRs-fixed: 1078289 --- core/hdd/src/wlan_hdd_ipa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index b2140c95d598..a9f7bf2f4887 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -4080,7 +4080,12 @@ int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id, { enum ipa_wlan_event type = hdd_to_ipa_wlan_event(hdd_event_type); - return __hdd_ipa_wlan_evt(adapter, sta_id, type, mac_addr); + /* Data path offload only support for STA and SAP mode */ + if ((QDF_STA_MODE == adapter->device_mode) || + (QDF_SAP_MODE == adapter->device_mode)) + return __hdd_ipa_wlan_evt(adapter, sta_id, type, mac_addr); + + return 0; } /** From 11545d6679f6513ec4a721a6368e5a3a4cd8cb0a Mon Sep 17 00:00:00 2001 From: Leo Chang Date: Mon, 17 Oct 2016 14:53:50 -0700 Subject: [PATCH 131/179] qcacld-3.0: enable ipa hw dynamic detection capabiliry MODEM included platform and non-MODEM platform should use the same binary. Then WLAN cannot disable IPA data path through INI nor compile time. WLAN host driver should dynamically detect IPA HW status and should enable or disable IPA data path based on IPA HW status. Change-Id: I43a673fcfc7ecfbd2d3ca488034dc4a84e20b258 CRs-fixed: 1078825 --- core/hdd/inc/wlan_hdd_ipa.h | 17 +++++++++++++++++ core/hdd/src/wlan_hdd_ipa.c | 20 ++++++++++++++++++++ core/hdd/src/wlan_hdd_main.c | 3 +++ 3 files changed, 40 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_ipa.h b/core/hdd/inc/wlan_hdd_ipa.h index 54e7b1d2ca67..b2bf9803e6da 100644 --- a/core/hdd/inc/wlan_hdd_ipa.h +++ b/core/hdd/inc/wlan_hdd_ipa.h @@ -102,6 +102,7 @@ int hdd_ipa_uc_ssr_deinit(void); void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx); struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx, struct sk_buff *skb, uint8_t session_id); +bool hdd_ipa_is_present(hdd_context_t *hdd_ctx); #else static inline QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx) { @@ -208,5 +209,21 @@ static inline struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx, { return skb; } + +/** + * hdd_ipa_is_present() - get IPA hw status + * @hdd_ctx: pointer to hdd context + * + * ipa_uc_reg_rdyCB is not directly designed to check + * ipa hw status. This is an undocumented function which + * has confirmed with IPA team. + * + * Return: true - ipa hw present + * false - ipa hw not present + */ +bool hdd_ipa_is_present(hdd_context_t *hdd_ctx) +{ + return false; +} #endif /* IPA_OFFLOAD */ #endif /* #ifndef HDD_IPA_H__ */ diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index a9f7bf2f4887..66ee27f6cc8f 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -2801,6 +2801,26 @@ static void hdd_ipa_send_pkt_to_tl( } +/** + * hdd_ipa_is_present() - get IPA hw status + * @hdd_ctx: pointer to hdd context + * + * ipa_uc_reg_rdyCB is not directly designed to check + * ipa hw status. This is an undocumented function which + * has confirmed with IPA team. + * + * Return: true - ipa hw present + * false - ipa hw not present + */ +bool hdd_ipa_is_present(hdd_context_t *hdd_ctx) +{ + /* Check if ipa hw is enabled */ + if (ipa_uc_reg_rdyCB(NULL) != -EPERM) + return true; + else + return false; +} + /** * hdd_ipa_pm_flush() - flush queued packets * @work: pointer to the scheduled work diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d658e97bf6b9..7b5215ad65eb 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6319,6 +6319,9 @@ static void hdd_override_ini_config(hdd_context_t *hdd_ctx) hdd_ctx->config->Is11dSupportEnabled = enable_11d; hdd_notice("Module enable_11d set to %d", enable_11d); } + + if (!hdd_ipa_is_present(hdd_ctx)) + hdd_ctx->config->IpaConfig = 0; } /** From 63d736115248c99bdd953f849a900ceee22f110d Mon Sep 17 00:00:00 2001 From: Leo Chang Date: Tue, 18 Oct 2016 18:09:43 -0700 Subject: [PATCH 132/179] qcacld-3.0: enable ipa hw dynamic detection capabiliry Fix IPA V2 compile problem fix. MODEM included platform and non-MODEM platform should use the same binary. Then WLAN cannot disable IPA data path through INI nor compile time. WLAN host driver should dynamically detect IPA HW status and should enable or disable IPA data path based on IPA HW status. Change-Id: I2d34aaa9f1616e621ff9585c69c4618463e05c65 CRs-fixed: 1078825 --- core/hdd/src/wlan_hdd_ipa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 66ee27f6cc8f..4d361f8f4818 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -533,9 +533,12 @@ do { \ pipe_in.u.ul.rdy_comp_ring_wp_va = \ ipa_ctxt->ipa_resource.rx2_proc_done_idx_vaddr; \ } while (0) + +#define HDD_IPA_CHECK_HW() ipa_uc_reg_rdyCB(NULL) #else /* Do nothing */ #define HDD_IPA_WDI2_SET(pipe_in, ipa_ctxt) +#define HDD_IPA_CHECK_HW() 0 #endif /* IPA3 */ static struct hdd_ipa_adapter_2_client { @@ -2815,7 +2818,7 @@ static void hdd_ipa_send_pkt_to_tl( bool hdd_ipa_is_present(hdd_context_t *hdd_ctx) { /* Check if ipa hw is enabled */ - if (ipa_uc_reg_rdyCB(NULL) != -EPERM) + if (HDD_IPA_CHECK_HW() != -EPERM) return true; else return false; From 5c1eb5d42f46c1cbfdd3adb52473f42fba604f41 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 18 Oct 2016 19:54:28 -0700 Subject: [PATCH 133/179] Release 5.1.0.32 Release 5.1.0.32 Change-Id: I065378f438e83b4deec7f7aaa1962e0da4037d16 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 740309e3fe86..2e29293301e3 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Z" -#define QWLAN_VERSION_BUILD 31 +#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.31Z" +#define QWLAN_VERSIONSTR "5.1.0.32" #endif /* QWLAN_VERSION_H */ From 2dab3ec9fa5a58304e829967159d76a8b17a66cb Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Tue, 18 Oct 2016 16:10:15 +0530 Subject: [PATCH 134/179] qcacld-3.0: Avoid sending ENABLE RTSCTS cmd in FTM FTM mode doesn't have session ID and no need to send wma_cli_set_command for WMI_VDEV_PARAM_ENABLE_RTSCTS which is per vdev. Change-Id: I1583439e3d4a9f8c52f687c8f5bc1340860a1614 CRs-Fixed: 1079143 --- core/hdd/src/wlan_hdd_main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7b5215ad65eb..b0d34fa9b0e3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3188,19 +3188,19 @@ int hdd_set_fw_params(hdd_adapter_t *adapter) ret); goto error; } + + ret = wma_cli_set_command(adapter->sessionId, + WMI_VDEV_PARAM_ENABLE_RTSCTS, + hdd_ctx->config->rts_profile, + VDEV_CMD); + if (ret) { + hdd_err("FAILED TO SET RTSCTS Profile ret:%d", ret); + goto error; + } } hdd_set_fw_log_params(hdd_ctx, adapter); - ret = wma_cli_set_command(adapter->sessionId, - WMI_VDEV_PARAM_ENABLE_RTSCTS, - hdd_ctx->config->rts_profile, - VDEV_CMD); - if (ret) { - hdd_err("FAILED TO SET RTSCTS Profile ret:%d", ret); - goto error; - } - EXIT(); return 0; From 726a53539d74dcc76aa26b68eebd5a925717409a Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 19 Oct 2016 06:15:22 -0700 Subject: [PATCH 135/179] Release 5.1.0.32A Release 5.1.0.32A Change-Id: I975390fd0043adfc17120e9d5ddf50268f4aba9c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 2e29293301e3..d90a366aed7c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_EXTRA "A" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32" +#define QWLAN_VERSIONSTR "5.1.0.32A" #endif /* QWLAN_VERSION_H */ From 4a716ad992928c42dc10f3f4009c5bfd789989c0 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Tue, 18 Oct 2016 18:16:33 +0530 Subject: [PATCH 136/179] qcacld-3.0: Change max value of gEnableDynamicDTIM In the current code, maximum possible value of gEnableDynamicDTIM is 5, but for power save testing there is requirement to increase it by 4. Accordingly, CFG_ENABLE_DYNAMIC_DTIM_MAX is changed to 9. Change-Id: I93b8356bc703c3d1d4fa1a89601056cbd3c8b262 CRs-Fixed: 1079163 --- core/hdd/inc/wlan_hdd_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 9f3e1e44dc10..b44f8cf865d8 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1399,7 +1399,7 @@ typedef enum { * switch DTIM1 when host resumes */ #define CFG_ENABLE_DYNAMIC_DTIM_NAME "gEnableDynamicDTIM" #define CFG_ENABLE_DYNAMIC_DTIM_MIN (0) -#define CFG_ENABLE_DYNAMIC_DTIM_MAX (5) +#define CFG_ENABLE_DYNAMIC_DTIM_MAX (9) #define CFG_ENABLE_DYNAMIC_DTIM_DEFAULT (0) /* From d80e8d3a63c49082a2649053992d7c3c87450229 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 19 Oct 2016 06:53:33 -0700 Subject: [PATCH 137/179] Release 5.1.0.32B Release 5.1.0.32B Change-Id: If7961795fd5c54632c036bed1ed7eeb7d7238200 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d90a366aed7c..750b4ed59eeb 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "A" +#define QWLAN_VERSION_EXTRA "B" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32A" +#define QWLAN_VERSIONSTR "5.1.0.32B" #endif /* QWLAN_VERSION_H */ From b79b54628179601c017bfd5ca51942ae4cde94e3 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Tue, 6 Sep 2016 18:33:17 +0530 Subject: [PATCH 138/179] qcacld-3.0: Add ini to force sap into 11n for 11ac qcacld-2.0 to qcacld-3.0 propagation In the current implementation, there is no way to force softap to configure in 11n, when request from hostapd is for 11ac. This change adds the ini parameter gSapForce11NFor11AC, when enabled, configures softap in 11n mode if hostapd request is for 11ac. Change-Id: I22da3971c90726a13a4b7d9c2c9b9b535d0d6809 CRs-Fixed: 1019018 --- core/hdd/inc/wlan_hdd_cfg.h | 11 +++++++ core/hdd/src/wlan_hdd_cfg.c | 10 ++++++ core/hdd/src/wlan_hdd_cfg80211.c | 17 +++++++++- core/hdd/src/wlan_hdd_hostapd.c | 56 ++++++++++++++++++++++---------- 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index b44f8cf865d8..fcc481a5c7bb 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -3540,6 +3540,15 @@ enum dot11p_mode { #define CFG_INDOOR_CHANNEL_SUPPORT_MAX (1) #define CFG_INDOOR_CHANNEL_SUPPORT_DEFAULT (0) +/* + * Force softap to 11n, when gSapForce11NFor11AC is set to 1 from ini + * despite of hostapd.conf request for 11ac + */ +#define CFG_SAP_FORCE_11N_FOR_11AC_NAME "gSapForce11NFor11AC" +#define CFG_SAP_FORCE_11N_FOR_11AC_MIN (0) +#define CFG_SAP_FORCE_11N_FOR_11AC_MAX (1) +#define CFG_SAP_FORCE_11N_FOR_11AC_DEFAULT (0) + /* * Enable filtering of replayed multicast packets * In a typical infrastructure setup, it is quite normal to receive @@ -4226,6 +4235,8 @@ struct hdd_config { uint32_t tgt_gtx_usr_cfg; enum cfg_sub_20_channel_width enable_sub_20_channel_width; bool indoor_channel_support; + /* parameter to force sap into 11n */ + bool sap_force_11n_for_11ac; bool multicast_replay_filter; /* parameter for indicating sifs burst duration to fw */ uint8_t sifs_burst_duration; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 1b99f3c6ae1b..584830a1d62d 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3987,6 +3987,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_BUG_ON_REINIT_FAILURE_MIN, CFG_BUG_ON_REINIT_FAILURE_MAX), + REG_VARIABLE(CFG_SAP_FORCE_11N_FOR_11AC_NAME, WLAN_PARAM_Integer, + struct hdd_config, sap_force_11n_for_11ac, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SAP_FORCE_11N_FOR_11AC_DEFAULT, + CFG_SAP_FORCE_11N_FOR_11AC_MIN, + CFG_SAP_FORCE_11N_FOR_11AC_MAX), + REG_VARIABLE(CFG_INTERFACE_CHANGE_WAIT_NAME, WLAN_PARAM_Integer, struct hdd_config, iface_change_wait_time, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -5698,6 +5705,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_info("Name = [%s] Value = [%s]", CFG_RM_CAPABILITY_NAME, pHddCtx->config->rm_capability); + hdd_info("Name = [%s] Value = [%d]", + CFG_SAP_FORCE_11N_FOR_11AC_NAME, + pHddCtx->config->sap_force_11n_for_11ac); hdd_info("Name = [%s] Value = [%d]", CFG_BPF_PACKET_FILTER_OFFLOAD, pHddCtx->config->bpf_packet_filter_enable); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 926d4f077678..ac58c814d1b3 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1486,6 +1486,11 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, else vht_enabled = 0; + if (hdd_ctx->config->sap_force_11n_for_11ac) { + vht_enabled = 0; + hdd_log(LOG1, FL("VHT is Disabled in ACS")); + } + if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]) { ch_width = nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]); } else { @@ -1494,6 +1499,15 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, else ch_width = 20; } + + /* this may be possible, when sap_force_11n_for_11ac is set */ + if ((ch_width == 80 || ch_width == 160) && !vht_enabled) { + if (ht_enabled && ht40_enabled) + ch_width = 40; + else + ch_width = 20; + } + if (ch_width == 80) sap_config->acs_cfg.ch_width = CH_WIDTH_80MHZ; else if (ch_width == 40) @@ -1557,7 +1571,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, hdd_err("Get PCL failed"); /* ACS override for android */ - if (hdd_ctx->config->sap_p2p_11ac_override && ht_enabled) { + if (hdd_ctx->config->sap_p2p_11ac_override && ht_enabled && + !hdd_ctx->config->sap_force_11n_for_11ac) { hdd_notice("ACS Config override for 11AC"); vht_enabled = 1; sap_config->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac; diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index fb1777578e90..f44e2ce58c3a 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6799,7 +6799,8 @@ static int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) if (hdd_ctx->config->sap_p2p_11ac_override && (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac || - sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY)) { + sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) && + !hdd_ctx->config->sap_force_11n_for_11ac) { hdd_notice("** Driver force 11AC override for SAP/Go **"); /* 11n only shall not be overridden since it may be on purpose*/ @@ -6841,6 +6842,12 @@ setup_acs_overrides: if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_AUTO) sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11ac; + if (hdd_ctx->config->sap_force_11n_for_11ac) { + if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac || + sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) + sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11n; + } + if ((sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11b || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11g || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11g_ONLY) && @@ -7315,6 +7322,12 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, } wlan_hdd_set_sap_hwmode(pHostapdAdapter); + if (pHddCtx->config->sap_force_11n_for_11ac) { + if (pConfig->SapHw_mode == eCSR_DOT11_MODE_11ac || + pConfig->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) + pConfig->SapHw_mode = eCSR_DOT11_MODE_11n; + } + qdf_mem_zero(&sme_config, sizeof(tSmeConfigParams)); sme_get_config_param(pHddCtx->hHal, &sme_config); /* Override hostapd.conf wmm_enabled only for 11n and 11AC configs (IOT) @@ -7331,25 +7344,32 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, sme_config.csrConfig.WMMSupportMode = eCsrRoamWmmNoQos; sme_update_config(pHddCtx->hHal, &sme_config); - if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80P80) { - if (pHddCtx->isVHT80Allowed == false) + if (!pHddCtx->config->sap_force_11n_for_11ac) { + if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80P80) { + if (pHddCtx->isVHT80Allowed == false) + pConfig->ch_width_orig = CH_WIDTH_40MHZ; + else + pConfig->ch_width_orig = CH_WIDTH_80P80MHZ; + } else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_160) { + if (pHddCtx->isVHT80Allowed == false) + pConfig->ch_width_orig = CH_WIDTH_40MHZ; + else + pConfig->ch_width_orig = CH_WIDTH_160MHZ; + } else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80) { + if (pHddCtx->isVHT80Allowed == false) + pConfig->ch_width_orig = CH_WIDTH_40MHZ; + else + pConfig->ch_width_orig = CH_WIDTH_80MHZ; + } else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_40) { pConfig->ch_width_orig = CH_WIDTH_40MHZ; - else - pConfig->ch_width_orig = CH_WIDTH_80P80MHZ; - } else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_160) { - if (pHddCtx->isVHT80Allowed == false) - pConfig->ch_width_orig = CH_WIDTH_40MHZ; - else - pConfig->ch_width_orig = CH_WIDTH_160MHZ; - } else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80) { - if (pHddCtx->isVHT80Allowed == false) - pConfig->ch_width_orig = CH_WIDTH_40MHZ; - else - pConfig->ch_width_orig = CH_WIDTH_80MHZ; - } else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_40) { - pConfig->ch_width_orig = CH_WIDTH_40MHZ; + } else { + pConfig->ch_width_orig = CH_WIDTH_20MHZ; + } } else { - pConfig->ch_width_orig = CH_WIDTH_20MHZ; + if (pConfig->ch_width_orig >= NL80211_CHAN_WIDTH_40) + pConfig->ch_width_orig = CH_WIDTH_40MHZ; + else + pConfig->ch_width_orig = CH_WIDTH_20MHZ; } if (wlan_hdd_setup_driver_overrides(pHostapdAdapter)) { From c97f53922ed7c14e2c91607be28b51374babc7f8 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 19 Oct 2016 07:32:57 -0700 Subject: [PATCH 139/179] Release 5.1.0.32C Release 5.1.0.32C Change-Id: I16a37eda38164620f4414c9f964c2af1cf30cf9b CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 750b4ed59eeb..b38330e7f254 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "B" +#define QWLAN_VERSION_EXTRA "C" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32B" +#define QWLAN_VERSIONSTR "5.1.0.32C" #endif /* QWLAN_VERSION_H */ From 0855e869a2c9dd5c212ad5a1ff16a1ca23a24d1f Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 18 Oct 2016 11:22:40 -0700 Subject: [PATCH 140/179] qcacld-3.0: Remove hardcoded value and set qpower appropriately This is a qcacld-2.0 to qcacld-3.0 propagation. The issue is when host re-enables QPower after resume, it is setting WMI_STA_PS_ENABLE_QPOWER to 1 (which is for QPower = 2) always and never WMI_STA_PS_ENABLE_QPOWER to 2 (which is for QPower = 5). This means one suspend/resume is enough to disable QPower = 5 and change to QPower = 2. Fix this by removing the hardcoded value of 1 and use qpower_config instead. Change-Id: I553c1691d5d7e98c2db8c9e56e2ba68ae27af506 CRs-Fixed: 1040737 --- core/wma/src/wma_power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index e939c5267597..e5194ae626a7 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -1896,7 +1896,7 @@ static void wma_set_vdev_resume_dtim(tp_wma_handle wma, uint8_t vdev_id) ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, WMI_STA_PS_ENABLE_QPOWER, - 1); + qpower_config); if (QDF_IS_STATUS_ERROR(ret)) WMA_LOGE("Failed to enable Qpower in resume mode!"); } From 90cdd3cda25c21295ca5b54297f970b25bd02f84 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 18 Oct 2016 11:28:10 -0700 Subject: [PATCH 141/179] qcacld-3.0: Acquire read lock before accessing the address list This is a qcacld-2.0 to qcacld-3.0 propagation. WLAN host driver access the inet6_dev address list without acquiring the read lock, if the kernel network stack deletes the address while driver is accessing the list, it can lead to referencing already freed address by the driver. Hence, fix is to take the read lock before accessing the address list. Change-Id: I934e9f2039f3ab8540e439b9e8a87efced98807c CRs-Fixed: 1048897 --- core/hdd/src/wlan_hdd_power.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 207fbe78554c..c4dfdcb7666e 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -304,9 +304,12 @@ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, struct list_head *p; uint32_t scope; + read_lock_bh(&idev->lock); list_for_each(p, &idev->addr_list) { - if (*count >= SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA) + if (*count >= SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA) { + read_unlock_bh(&idev->lock); return -EINVAL; + } ifa = list_entry(p, struct inet6_ifaddr, if_list); if (ifa->flags & IFA_F_DADFAILED) continue; @@ -326,6 +329,8 @@ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, hdd_err("The Scope %d is not supported", scope); } } + + read_unlock_bh(&idev->lock); return 0; } @@ -347,9 +352,12 @@ static int hdd_fill_ipv6_ac_addr(struct inet6_dev *idev, struct ifacaddr6 *ifaca; uint32_t scope; + read_lock_bh(&idev->lock); for (ifaca = idev->ac_list; ifaca; ifaca = ifaca->aca_next) { - if (*count >= SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA) + if (*count >= SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA) { + read_unlock_bh(&idev->lock); return -EINVAL; + } /* For anycast addr no DAD */ scope = ipv6_addr_src_scope(&ifaca->aca_addr); switch (scope) { @@ -367,6 +375,8 @@ static int hdd_fill_ipv6_ac_addr(struct inet6_dev *idev, hdd_err("The Scope %d is not supported", scope); } } + + read_unlock_bh(&idev->lock); return 0; } From 6147c58dff00905c59dc4f432e6487aa8d278bb6 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 18 Oct 2016 12:26:15 -0700 Subject: [PATCH 142/179] qcacld-3.0: Replace DEBUG macro with WLAN_DEBUG This is a qcacld-2.0 to qcacld-3.0 propagation. pr_debug() should not appear by default in kernel log (kmsg). DEBUG is a kernel macro, since host driver is using the same name macro, pr_debug log statements are appearing in kmsg. Fix this by moving the code under DEBUG to WLAN_DEBUG and remove DEBUG macro from Kbuild. Change-Id: I5bb385f91f9b6ba15629a5878625fefc21d4a7e1 CRs-Fixed: 1003261 --- Kbuild | 3 +-- core/bmi/src/ol_fw.c | 2 +- core/hdd/inc/qc_sap_ioctl.h | 2 +- core/hdd/src/wlan_hdd_hostapd.c | 6 +++--- core/hdd/src/wlan_hdd_wext.c | 6 +++--- core/utils/fwlog/dbglog_host.c | 2 +- uapi/linux/a_debug.h | 4 ++-- uapi/linux/debug_linux.h | 4 ++-- uapi/linux/osapi_linux.h | 2 +- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Kbuild b/Kbuild index ac31affdb2a4..f8f2e9af635a 100644 --- a/Kbuild +++ b/Kbuild @@ -1168,8 +1168,7 @@ CDEFINES += -DWLAN_DEBUG \ -DSME_TRACE_RECORD \ -DHDD_TRACE_RECORD \ -DPE_DEBUG_LOGW \ - -DPE_DEBUG_LOGE \ - -DDEBUG + -DPE_DEBUG_LOGE endif ifeq ($(CONFIG_SLUB_DEBUG_ON),y) diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index a5fbb0222b62..6eb34d64391a 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -527,7 +527,7 @@ void ramdump_work_handler(void *data) } tgt_info = hif_get_target_info_handle(ramdump_scn); target_type = tgt_info->target_type; -#ifdef DEBUG +#ifdef WLAN_DEBUG ret = hif_check_soc_status(ramdump_scn); if (ret) goto out_fail; diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h index 60e61e42bb01..70467c2a913e 100644 --- a/core/hdd/inc/qc_sap_ioctl.h +++ b/core/hdd/inc/qc_sap_ioctl.h @@ -169,7 +169,7 @@ typedef struct { #define QCSAP_IOCTL_GET_INI_CFG (SIOCIWFIRSTPRIV + 25) #define QCSAP_IOCTL_SET_INI_CFG (SIOCIWFIRSTPRIV + 26) #define QCSAP_IOCTL_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) -#ifdef DEBUG +#ifdef WLAN_DEBUG #define QCSAP_IOCTL_SET_FW_CRASH_INJECT 1 #endif #define QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL 2 diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index f44e2ce58c3a..7b37910d138b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -68,7 +68,7 @@ #include "pld_common.h" #include "wma.h" -#ifdef DEBUG +#ifdef WLAN_DEBUG #include "wma_api.h" #endif #include "wlan_hdd_trace.h" @@ -2339,7 +2339,7 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev, goto out; switch (sub_cmd) { -#ifdef DEBUG +#ifdef WLAN_DEBUG case QCSAP_IOCTL_SET_FW_CRASH_INJECT: hdd_err("WE_SET_FW_CRASH_INJECT: %d %d", value[1], value[2]); @@ -5480,7 +5480,7 @@ static const struct iw_priv_args hostapd_private_args[] = { } , /* handlers for sub-ioctl */ -#ifdef DEBUG +#ifdef WLAN_DEBUG { QCSAP_IOCTL_SET_FW_CRASH_INJECT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 7629c204152b..f4af8b1e7619 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -433,7 +433,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) #define WE_SET_SMPS_PARAM 1 -#ifdef DEBUG +#ifdef WLAN_DEBUG #define WE_SET_FW_CRASH_INJECT 2 #endif #define WE_DUMP_DP_TRACE_LEVEL 3 @@ -9824,7 +9824,7 @@ static int __iw_set_two_ints_getnone(struct net_device *dev, | value[2], VDEV_CMD); break; -#ifdef DEBUG +#ifdef WLAN_DEBUG case WE_SET_FW_CRASH_INJECT: hdd_err("WE_SET_FW_CRASH_INJECT: %d %d", value[1], value[2]); @@ -11093,7 +11093,7 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_BYTE | sizeof(struct dot11p_channel_sched), 0, "set_dot11p" } , -#ifdef DEBUG +#ifdef WLAN_DEBUG {WE_SET_FW_CRASH_INJECT, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "crash_inject"} diff --git a/core/utils/fwlog/dbglog_host.c b/core/utils/fwlog/dbglog_host.c index c4c52b8760e0..07441d4c5009 100644 --- a/core/utils/fwlog/dbglog_host.c +++ b/core/utils/fwlog/dbglog_host.c @@ -53,7 +53,7 @@ #include #define FWLOG_DEBUG ATH_DEBUG_MAKE_MODULE_MASK(0) -#if defined(DEBUG) +#ifdef WLAN_DEBUG static int get_version; static int gprint_limiter; diff --git a/uapi/linux/a_debug.h b/uapi/linux/a_debug.h index 62931060cf08..3a5fd4c2204c 100644 --- a/uapi/linux/a_debug.h +++ b/uapi/linux/a_debug.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -147,7 +147,7 @@ typedef struct _ATH_DEBUG_MODULE_DBG_INFO { #define GET_ATH_MODULE_DEBUG_VAR_MASK(s) _XGET_ATH_MODULE_NAME_DEBUG_(s).CurrentMask #define _XGET_ATH_MODULE_NAME_DEBUG_(s) debug_ ## s -#ifdef DEBUG +#ifdef WLAN_DEBUG /* for source files that will instantiate the debug variables */ #define ATH_DEBUG_INSTANTIATE_MODULE_VAR(s,name,moddesc,initmask,count,descriptions) \ diff --git a/uapi/linux/debug_linux.h b/uapi/linux/debug_linux.h index 57c3590efba4..428c90b057f5 100644 --- a/uapi/linux/debug_linux.h +++ b/uapi/linux/debug_linux.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -31,7 +31,7 @@ /* macro to remove parens */ #define ATH_PRINTX_ARG(arg ...) arg -#ifdef DEBUG +#ifdef WLAN_DEBUG /* NOTE: the AR_DEBUG_PRINTF macro is defined here to handle special handling of variable arg macros * which may be compiler dependent. */ #define AR_DEBUG_PRINTF(mask, args) do { \ diff --git a/uapi/linux/osapi_linux.h b/uapi/linux/osapi_linux.h index 77de5272aac2..4e61a5e21f9e 100644 --- a/uapi/linux/osapi_linux.h +++ b/uapi/linux/osapi_linux.h @@ -133,7 +133,7 @@ typedef struct timer_list A_TIMER; }) #endif /* wait_event_interruptible_timeout */ -#ifdef DEBUG +#ifdef WLAN_DEBUG #ifdef A_SIMOS_DEVHOST extern unsigned int panic_on_assert; #define A_ASSERT(expr) \ From 02c084dd6c6526ae07d3892fb970ccd3c172a599 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 18 Oct 2016 15:27:21 -0700 Subject: [PATCH 143/179] qcacld-3.0: Delete SSR timer after WLAN reinitiation is complete This is a qcacld-2.0 to qcacld-3.0 propagation. In hdd_wlan_re_init(), SSR timer is deleted before WLAN reinitiation is fully complete. Between SSR timer delete and WLAN reinitiation is complete, there are NL socket related calls which can sleep under low memory conditions (or etc) because of which timer is deleted but isLogpInProgress is not reset to FALSE. This can potentially fail the south-bound requests for a brief amount of time. Hence it is always better to delete the SSR timer only after WLAN reinitiation is complete. Change-Id: I699438ff3e0c2f7b81e0bbf81be6f514841e194b CRs-Fixed: 1017011 --- core/hdd/src/wlan_hdd_power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index c4dfdcb7666e..7e6e0bd5571f 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1567,7 +1567,6 @@ QDF_STATUS hdd_wlan_re_init(void) pHddCtx->hdd_mcastbcast_filter_set = false; pHddCtx->btCoexModeSet = false; - hdd_ssr_timer_del(); wlan_hdd_send_svc_nlink_msg(pHddCtx->radio_index, WLAN_SVC_FW_CRASHED_IND, NULL, 0); @@ -1618,6 +1617,7 @@ err_re_init: return -EPERM; success: + hdd_ssr_timer_del(); return QDF_STATUS_SUCCESS; } From 0b555320f57cf896a3b678cc17f6f0cc2935ae74 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 19 Oct 2016 10:45:30 -0700 Subject: [PATCH 144/179] Release 5.1.0.32D Release 5.1.0.32D Change-Id: I0d2cd5ab5257e2719203c664878d07a69f2416f8 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b38330e7f254..e1ddb264e8f6 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "C" +#define QWLAN_VERSION_EXTRA "D" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32C" +#define QWLAN_VERSIONSTR "5.1.0.32D" #endif /* QWLAN_VERSION_H */ From ba175fc4134c50269311f76537e0acb5e04e0141 Mon Sep 17 00:00:00 2001 From: Orhan K AKYILDIZ Date: Fri, 16 Sep 2016 00:30:49 -0700 Subject: [PATCH 145/179] qcacld-3.0: Add a NAPI mode for roaming Add a new mode with a pair of new NAPI events, NAPI_EVT_USR_SERIAL and NAPI_EVT_USR_NORMAL, which allows client force NAPI to move all instances onto the same CPU and peg them there (blacklist); and to move back to normal mode of operation. This part implements the HDD portion. Goes with the corresponding HIF code. Change-Id: I4c45d18348ef27d8814c5d0321d1fd13c96fff34 CRs-Fixed: 1078976 --- core/hdd/inc/wlan_hdd_napi.h | 5 ++++ core/hdd/src/wlan_hdd_napi.c | 56 +++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_napi.h b/core/hdd/inc/wlan_hdd_napi.h index 1ad0ef9bec04..3e81ef6dae01 100644 --- a/core/hdd/inc/wlan_hdd_napi.h +++ b/core/hdd/inc/wlan_hdd_napi.h @@ -65,6 +65,7 @@ struct qca_napi_data *hdd_napi_get_all(void); int hdd_napi_apply_throughput_policy(struct hdd_context_s *hddctx, uint64_t tx_packets, uint64_t rx_packets); +int hdd_napi_serialize(int is_on); #else /* FEATURE_NAPI and NOT HELIUM */ static inline int hdd_napi_apply_throughput_policy(struct hdd_context_s *hddctx, uint64_t tx_packets, @@ -72,6 +73,10 @@ static inline int hdd_napi_apply_throughput_policy(struct hdd_context_s *hddctx, { return 0; } +static inline int hdd_napi_serialize(int is_on) +{ + return -EINVAL; +}; #endif /* HELIUMPLUS */ #else /* ! defined(FEATURE_NAPI) */ diff --git a/core/hdd/src/wlan_hdd_napi.c b/core/hdd/src/wlan_hdd_napi.c index 3a20bff3e8db..3e5766f96c40 100644 --- a/core/hdd/src/wlan_hdd_napi.c +++ b/core/hdd/src/wlan_hdd_napi.c @@ -267,6 +267,7 @@ int hdd_napi_event(enum qca_napi_event event, void *data) * Return: 0 : no action taken, or action return code * !0: error, or action error code */ +static int napi_tput_policy_delay; int hdd_napi_apply_throughput_policy(struct hdd_context_s *hddctx, uint64_t tx_packets, uint64_t rx_packets) @@ -279,6 +280,19 @@ int hdd_napi_apply_throughput_policy(struct hdd_context_s *hddctx, NAPI_DEBUG("-->%s(tx=%lld, rx=%lld)", __func__, tx_packets, rx_packets); + if (unlikely(napi_tput_policy_delay < 0)) + napi_tput_policy_delay = 0; + if (napi_tput_policy_delay > 0) { + NAPI_DEBUG("%s: delaying policy; delay-count=%d", + __func__, napi_tput_policy_delay); + napi_tput_policy_delay--; + + /* make sure the next timer call calls us */ + hddctx->cur_vote_level = -1; + + return rc; + } + if ((napid != NULL) && (enabled = hdd_napi_enabled(HDD_NAPI_ANY))) { if (packets > hddctx->config->busBandwidthHighThreshold) @@ -295,7 +309,47 @@ int hdd_napi_apply_throughput_policy(struct hdd_context_s *hddctx, } return rc; } -#endif + +/** + * hdd_napi_serialize() - serialize all NAPI activities + * @is_on: 1="serialize" or 0="de-serialize" + * + * Start/stop "serial-NAPI-mode". + * NAPI serial mode describes a state where all NAPI operations are forced to be + * run serially. This is achieved by ensuring all NAPI instances are run on the + * same CPU, so forced to be serial. + * NAPI life-cycle: + * - Interrupt is received for a given CE. + * - In the ISR, the interrupt is masked and corresponding NAPI instance + * is scheduled, to be run as a bottom-half. + * - Bottom-half starts with a poll call (by the net_rx softirq). There may be + * one of more subsequent calls until the work is complete. + * - Once the work is complete, the poll handler enables the interrupt and + * the cycle re-starts. + * + * Return: <0: error-code (operation failed) + * =0: success + * >0: status (not used) + */ +int hdd_napi_serialize(int is_on) +{ + int rc; + hdd_context_t *hdd_ctx; +#define POLICY_DELAY_FACTOR (1) + rc = hif_napi_serialize(cds_get_context(QDF_MODULE_ID_HIF), is_on); + if ((rc == 0) && (is_on == 0)) { + /* apply throughput policy after one timeout */ + napi_tput_policy_delay = POLICY_DELAY_FACTOR; + + /* make sure that bus_bandwidth trigger is executed */ + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (hdd_ctx != NULL) + hdd_ctx->cur_vote_level = -1; + + } + return rc; +} +#endif /* HELIUMPLUS */ /** * hdd_napi_poll() - NAPI poll function From 0425186793467924aafab46a322086eec67bbb22 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Fri, 16 Sep 2016 10:33:19 -0700 Subject: [PATCH 146/179] qcacld-3.0: LFR3: Fix to handle peer MAP/UNMAP events Enabling flow steering may send the peer map/unmap events from the target to the host in a random order.When host does not receive them in expected sequence, there is an issue with peer management.Fix the issue by making the firmware send the events through a single copy engine in the same order they were generated and thus host can handle the events properly Change-Id: If2396a0bf943f2833e1e3a44d778054a76c65ada CRs-Fixed: 1078976 --- core/hdd/src/wlan_hdd_assoc.c | 9 +++++++++ core/mac/inc/sir_api.h | 1 + core/sme/inc/csr_api.h | 1 + core/sme/src/csr/csr_api_roam.c | 7 +++++++ core/wma/src/wma_scan_roam.c | 2 ++ 5 files changed, 20 insertions(+) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 5a40fb0bbfa2..341ef18ea1ab 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -62,6 +62,7 @@ #include "ol_rx_fwd.h" #include "cdp_txrx_flow_ctrl_legacy.h" #include "cdp_txrx_peer_ops.h" +#include "wlan_hdd_napi.h" /* These are needed to recognize WPA and RSN suite types */ #define HDD_WPA_OUI_SIZE 4 @@ -4601,6 +4602,8 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, * after reassoc. */ hdd_info("Disabling queues"); + hdd_info("Roam Synch Ind: NAPI Serialize ON"); + hdd_napi_serialize(1); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE, WLAN_CONTROL_PATH); @@ -4613,6 +4616,10 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, hdd_info("hdd_ReassocScenario set to: %d, due to eCSR_ROAM_FT_START, session: %d", pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId); break; + case eCSR_ROAM_NAPI_OFF: + hdd_info("After Roam Synch Comp: NAPI Serialize OFF"); + hdd_napi_serialize(0); + break; case eCSR_ROAM_SHOULD_ROAM: /* notify apps that we can't pass traffic anymore */ hdd_info("Disabling queues"); @@ -4897,11 +4904,13 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE, WLAN_CONTROL_PATH); + hdd_napi_serialize(1); cds_set_connection_in_progress(true); cds_restart_opportunistic_timer(true); break; case eCSR_ROAM_ABORT: hdd_info("Firmware aborted roaming operation, previous connection is still valid"); + hdd_napi_serialize(0); wlan_hdd_netif_queue_control(pAdapter, WLAN_WAKE_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index e2e3db5a829d..c673d402d074 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -203,6 +203,7 @@ enum sir_roam_op_code { SIR_ROAMING_START, SIR_ROAMING_ABORT, SIR_ROAM_SYNCH_COMPLETE, + SIR_ROAM_SYNCH_NAPI_OFF, }; /** * Module ID definitions. diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index f36805226cb5..49f2b1b1d108 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -512,6 +512,7 @@ typedef enum { eCSR_ROAM_UPDATE_SCAN_RESULT, eCSR_ROAM_START, eCSR_ROAM_ABORT, + eCSR_ROAM_NAPI_OFF, } eRoamCmdStatus; /* comment inside indicates what roaming callback gets */ diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 7d26af4594b9..6c0f417ec805 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -18822,6 +18822,8 @@ void csr_process_ho_fail_ind(tpAniSirGlobal pMac, void *pMsgBuf) return; } cds_set_connection_in_progress(false); + csr_roam_call_callback(pMac, sessionId, NULL, 0, + eCSR_ROAM_NAPI_OFF, eSIR_SME_SUCCESS); csr_roam_synch_clean_up(pMac, sessionId); csr_roaming_report_diag_event(pMac, NULL, eCSR_REASON_ROAM_HO_FAIL); @@ -19560,6 +19562,11 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, eCSR_ROAM_ABORT, eSIR_SME_SUCCESS); sme_release_global_lock(&mac_ctx->sme); return; + case SIR_ROAM_SYNCH_NAPI_OFF: + csr_roam_call_callback(mac_ctx, session_id, NULL, 0, + eCSR_ROAM_NAPI_OFF, eSIR_SME_SUCCESS); + sme_release_global_lock(&mac_ctx->sme); + return; case SIR_ROAM_SYNCH_PROPAGATION: break; case SIR_ROAM_SYNCH_COMPLETE: diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 514696deba85..09ad59a89e40 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -2331,6 +2331,8 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, qdf_get_system_timestamp() - roam_synch_received; WMA_LOGD("LFR3: roam_synch_delay:%d", wma->interfaces[synch_event->vdev_id].roam_synch_delay); + wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context, + roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_NAPI_OFF); cleanup_label: if (roam_synch_ind_ptr->join_rsp) qdf_mem_free(roam_synch_ind_ptr->join_rsp); From 80393cdb64f42f9a0b07e85a5249ec821cda98e4 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 19 Oct 2016 15:18:20 -0700 Subject: [PATCH 147/179] Release 5.1.0.32E Release 5.1.0.32E Change-Id: I5df6d3c7dc43c86bb78ca252fc4a554ed624f19a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index e1ddb264e8f6..854f2fbcbeba 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "D" +#define QWLAN_VERSION_EXTRA "E" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32D" +#define QWLAN_VERSIONSTR "5.1.0.32E" #endif /* QWLAN_VERSION_H */ From 2fb1438bf3fdb575697376d9b61184a2b90bf37a Mon Sep 17 00:00:00 2001 From: Yingying Tang Date: Thu, 29 Sep 2016 14:47:56 +0800 Subject: [PATCH 148/179] qcacld-3.0: Add USB VID and PID for QCA9379 Propagate from qcacld-2.0 to qcacld-3.0 Currently there is no QCA9379 device id in USB device id table. Add USB VID and PID for QCA9379. Change-Id: I7ae39513ff5fc1f0b36f3c05dc0e783532a8d4a3 CRs-Fixed: 1048598 --- core/pld/src/pld_usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/pld/src/pld_usb.c b/core/pld/src/pld_usb.c index 26ce211722ee..07f87f5f1d16 100644 --- a/core/pld/src/pld_usb.c +++ b/core/pld/src/pld_usb.c @@ -30,6 +30,7 @@ #define VENDOR_ATHR 0x0CF3 static struct usb_device_id pld_usb_id_table[] = { {USB_DEVICE_AND_INTERFACE_INFO(VENDOR_ATHR, 0x9378, 0xFF, 0xFF, 0xFF)}, + {USB_DEVICE_AND_INTERFACE_INFO(VENDOR_ATHR, 0x9379, 0xFF, 0xFF, 0xFF)}, {} /* Terminating entry */ }; From 4f2dedec3f4a14d491ea2b3041d4127552e7428c Mon Sep 17 00:00:00 2001 From: Yingying Tang Date: Thu, 29 Sep 2016 16:26:46 +0800 Subject: [PATCH 149/179] qcacld-3.0: Avoid memory leak in htt_h2t_dbg_stats_get() Propagate from qcacld-2.0 to qcacld-3.0 Add htt_htc_pkt_free() in htt_h2t_dbg_stats_get() to avoid memory leak in the error case. Change-Id: Ie0cd4939706046370c7a0ce4053be1103637f769 CRs-Fixed: 979671 --- core/dp/htt/htt_h2t.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/dp/htt/htt_h2t.c b/core/dp/htt/htt_h2t.c index b2a8c0393d37..e4b7511f311b 100644 --- a/core/dp/htt/htt_h2t.c +++ b/core/dp/htt/htt_h2t.c @@ -748,6 +748,7 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev, /* FIX THIS - add more details? */ qdf_print("%#x %#x stats not supported\n", stats_type_upload_mask, stats_type_reset_mask); + htt_htc_pkt_free(pdev, pkt); return -EINVAL; /* failure */ } From 5047d513abd1fa7952c093c24e6fa8bfecab9891 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Tue, 11 Oct 2016 00:24:26 -0400 Subject: [PATCH 150/179] qcacld-3.0: fix wlan suspend fail after switch to non-dfs channel qcacld-2.0 to qcacld-3.0 propagation In SAP DFS test, DUT can't goto suspend if SAP started on DFS channel and later switched to non-dfs channel due to Radar detected. During SAP Starting, driver will acquire the wake lock for dfs channel by hdd_hostapd_channel_prevent_suspend in the eSAP_CHANNEL_CHANGE_EVENT event handler. But the SAP is still in STOPPED state. We acquire the wake lock again after SAP started in eSAP_START_BSS_EVENT event handler. This causes driver to acquire wake lock twice for the same dfs channel. And finally causes the device can't suspend normally. This change add check in eSAP_CHANNEL_CHANGE_EVENT handler to only call hdd_hostapd_channel_prevent_suspend when SAP is in started state to avoid lock/unlock mismatch. Change-Id: Ief90697b7b6f19f6fcf0ab94f973a37e74ca3366 CRs-Fixed: 972657 --- core/hdd/src/wlan_hdd_hostapd.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 7b37910d138b..3ec30f4352bb 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1810,12 +1810,14 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, case eSAP_CHANNEL_CHANGE_EVENT: hdd_notice("Received eSAP_CHANNEL_CHANGE_EVENT event"); - /* Prevent suspend for new channel */ - hdd_hostapd_channel_prevent_suspend(pHostapdAdapter, - pSapEvent->sapevt.sap_ch_selected.pri_ch); - /* Allow suspend for old channel */ - hdd_hostapd_channel_allow_suspend(pHostapdAdapter, - pHddApCtx->operatingChannel); + if (pHostapdState->bssState != BSS_STOP) { + /* Prevent suspend for new channel */ + hdd_hostapd_channel_prevent_suspend(pHostapdAdapter, + pSapEvent->sapevt.sap_ch_selected.pri_ch); + /* Allow suspend for old channel */ + hdd_hostapd_channel_allow_suspend(pHostapdAdapter, + pHddApCtx->operatingChannel); + } /* SME/PE is already updated for new operation channel. So update * HDD layer also here. This resolves issue in AP-AP mode where * AP1 channel is changed due to RADAR then CAC is going on and From bdd5fcb83f160ce0213ebaf4af326171b2db8168 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Wed, 28 Sep 2016 22:55:44 +0800 Subject: [PATCH 151/179] qcacld-3.0: Add interface to get channel width in sap mode qcacld-2.0 to qcacld-3.0 propagation Add iwpriv interface to get channel width when working in sap mode. Change-Id: I9900655861032636af1b4147ec6322e5aa76e614 CRs-Fixed: 1009861 --- core/hdd/inc/qc_sap_ioctl.h | 1 + core/hdd/src/wlan_hdd_hostapd.c | 30 ++++++++++++++++++++++++++++++ core/sap/inc/sap_api.h | 2 ++ core/sap/src/sap_module.c | 17 +++++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h index 70467c2a913e..6ef7ba1c0d65 100644 --- a/core/hdd/inc/qc_sap_ioctl.h +++ b/core/hdd/inc/qc_sap_ioctl.h @@ -246,6 +246,7 @@ enum { QCASAP_PARAM_LDPC, QCASAP_PARAM_TX_STBC, QCASAP_PARAM_RX_STBC, + QCSAP_PARAM_CHAN_WIDTH, }; int iw_get_channel_list(struct net_device *dev, diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 3ec30f4352bb..35e96c32627e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2277,6 +2277,27 @@ static iw_softap_set_ini_cfg(struct net_device *dev, return ret; } +static int hdd_sap_get_chan_width(hdd_adapter_t *adapter, int *value) +{ + void *cds_ctx; + hdd_hostapd_state_t *hostapdstate; + + ENTER(); + hostapdstate = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter); + + if (hostapdstate->bssState != BSS_START) { + *value = -EINVAL; + return -EINVAL; + } + + cds_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter); + + *value = wlansap_get_chan_width(cds_ctx); + hdd_notice("chan_width = %d", *value); + + return 0; +} + int static __iw_softap_get_ini_cfg(struct net_device *dev, struct iw_request_info *info, @@ -3373,6 +3394,11 @@ static __iw_softap_getparam(struct net_device *dev, ret = hdd_get_rx_stbc(pHostapdAdapter, value); break; } + case QCSAP_PARAM_CHAN_WIDTH: + { + ret = hdd_sap_get_chan_width(pHostapdAdapter, value); + break; + } default: hdd_err("Invalid getparam command %d", sub_cmd); ret = -EINVAL; @@ -5323,6 +5349,10 @@ static const struct iw_priv_args hostapd_private_args[] = { QCASAP_PARAM_RX_STBC, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rx_stbc" + }, { + QCSAP_PARAM_CHAN_WIDTH, 0, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, + "get_chwidth" }, { QCASAP_TX_CHAINMASK_CMD, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 1087fe2c44e0..7e251d3c6264 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -953,6 +953,8 @@ QDF_STATUS wlansap_acs_chselect(void *pvos_gctx, tpWLAN_SAPEventCB pacs_event_callback, tsap_Config_t *pconfig, void *pusr_context); +uint32_t wlansap_get_chan_width(void *cds_ctx); + #ifdef __cplusplus } #endif diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 6c159697210c..ef5f63c2fdd2 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -3619,3 +3619,20 @@ 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_chan_width() - get sap channel width. + * @cds_ctx: pointer of global cds context + * + * This function get channel width of sap. + * + * Return: sap channel width + */ +uint32_t wlansap_get_chan_width(void *cds_ctx) +{ + ptSapContext sapcontext; + + sapcontext = CDS_GET_SAP_CB(cds_ctx); + return wlan_sap_get_vht_ch_width(sapcontext); +} From 9f98f6a6f704bcad52c18ffe1331bf984a811004 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 19 Oct 2016 17:42:27 -0700 Subject: [PATCH 152/179] Release 5.1.0.32F Release 5.1.0.32F Change-Id: Ia8a2a414d7ebd7de4d78cf58bbd80954f9341319 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 854f2fbcbeba..f2fa61a4deef 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "E" +#define QWLAN_VERSION_EXTRA "F" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32E" +#define QWLAN_VERSIONSTR "5.1.0.32F" #endif /* QWLAN_VERSION_H */ From 2cb788d39174563ac2bb71db4a729073c6c0d091 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Tue, 11 Oct 2016 17:44:44 -0700 Subject: [PATCH 153/179] qcacld-3.0: Remove SNR and RSSI request from get station stats Remove redundant request get_rssi and get_snr from function __wlan_hdd_cfg80211_get_station. Get Stats request being sent to firmware in same function is super set of these two request. Change-Id: I3b478db41da10d9112437415be4775d07decb550 CRs-Fixed: 1078877 --- core/hdd/src/wlan_hdd_stats.c | 9 ++++++--- core/sme/inc/csr_api.h | 2 ++ core/wma/src/wma_utils.c | 27 +++++++++++++++++++-------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index f6ee0d00a6df..9061136c7940 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1683,8 +1683,12 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, if (0 != status) return status; - wlan_hdd_get_rssi(pAdapter, &sinfo->signal); - wlan_hdd_get_snr(pAdapter, &snr); + wlan_hdd_get_station_stats(pAdapter); + sinfo->signal = pAdapter->hdd_stats.summary_stat.rssi; + snr = pAdapter->hdd_stats.summary_stat.snr; + hdd_info("snr: %d, rssi: %d", + pAdapter->hdd_stats.summary_stat.snr, + pAdapter->hdd_stats.summary_stat.rssi); pHddStaCtx->conn_info.signal = sinfo->signal; pHddStaCtx->conn_info.noise = pHddStaCtx->conn_info.signal - snr; @@ -1703,7 +1707,6 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, */ hdd_lpass_notify_connect(pAdapter); - wlan_hdd_get_station_stats(pAdapter); rate_flags = pAdapter->hdd_stats.ClassA_stat.tx_rate_flags; /* convert to the UI units of 100kbps */ diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 49f2b1b1d108..1d619eb78221 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1468,6 +1468,8 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf { } tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf; typedef struct tagCsrSummaryStatsInfo { + uint32_t snr; + uint32_t rssi; uint32_t retry_cnt[4]; uint32_t multiple_retry_cnt[4]; uint32_t tx_frm_cnt[4]; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 44501c96aa69..a5958f0e5e1a 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -1054,6 +1054,11 @@ static void wma_update_vdev_stats(tp_wma_handle wma, cds_msg_t sme_msg = { 0 }; int8_t bcn_snr, dat_snr; + bcn_snr = vdev_stats->vdev_snr.bcn_snr; + dat_snr = vdev_stats->vdev_snr.dat_snr; + WMA_LOGD("vdev id %d beancon snr %d data snr %d", + vdev_stats->vdev_id, bcn_snr, dat_snr); + node = &wma->interfaces[vdev_stats->vdev_id]; stats_rsp_params = node->stats_rsp; if (stats_rsp_params) { @@ -1079,13 +1084,21 @@ static void wma_update_vdev_stats(tp_wma_handle wma, summary_stats->ack_fail_cnt = vdev_stats->ack_fail_cnt; summary_stats->rts_succ_cnt = vdev_stats->rts_succ_cnt; summary_stats->rts_fail_cnt = vdev_stats->rts_fail_cnt; + /* Update SNR and RSSI in SummaryStats */ + if (bcn_snr != WMA_TGT_INVALID_SNR) { + summary_stats->snr = bcn_snr; + summary_stats->rssi = + bcn_snr + WMA_TGT_NOISE_FLOOR_DBM; + } else if (dat_snr != WMA_TGT_INVALID_SNR) { + summary_stats->snr = dat_snr; + summary_stats->rssi = + bcn_snr + WMA_TGT_NOISE_FLOOR_DBM; + } else { + summary_stats->snr = WMA_TGT_INVALID_SNR; + summary_stats->rssi = 0; + } } } - bcn_snr = vdev_stats->vdev_snr.bcn_snr; - dat_snr = vdev_stats->vdev_snr.dat_snr; - - WMA_LOGD("vdev id %d beancon snr %d data snr %d", - vdev_stats->vdev_id, bcn_snr, dat_snr); if (pGetRssiReq && pGetRssiReq->sessionId == vdev_stats->vdev_id) { if ((bcn_snr == WMA_TGT_INVALID_SNR) && @@ -1132,10 +1145,8 @@ static void wma_update_vdev_stats(tp_wma_handle wma, if (bcn_snr != WMA_TGT_INVALID_SNR) p_snr_req->snr = bcn_snr; - else if (dat_snr != WMA_TGT_INVALID_SNR) - p_snr_req->snr = dat_snr; else - p_snr_req->snr = (int8_t)WMA_TGT_INVALID_SNR; + p_snr_req->snr = dat_snr; sme_msg.type = eWNI_SME_SNR_IND; sme_msg.bodyptr = p_snr_req; From 30b845095ecf02e5296b545a6e70e59e860ac788 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Thu, 13 Oct 2016 17:44:48 -0700 Subject: [PATCH 154/179] qcacld-3.0: Send only one WFA_TPC IE to firmware in scan request Strip out WFA TPC if present in additional IEs from supplicant and include that from host driver in scan request sent to firmware. Without this there will be duplicate WFA TPC IE present in probe requests. Change-Id: I3a9045eb647c7579b25b5ee2a81ed60d7b12a1b6 CRs-Fixed: 1077793 --- .../src/pe/lim/lim_process_sme_req_messages.c | 8 ++- core/mac/src/pe/lim/lim_utils.c | 57 +++++++++++++------ core/mac/src/pe/lim/lim_utils.h | 5 ++ 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 24475f611729..8528b912e356 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1276,7 +1276,6 @@ static QDF_STATUS lim_send_hal_start_scan_offload_req(tpAniSirGlobal pMac, len = sizeof(tSirScanOffloadReq) + (pScanReq->channelList.numChannels - 1) + pScanReq->uIEFieldLen; - if (lim_11h_enable) { addn_ie_len += DOT11F_IE_WFATPC_MAX_LEN + 2; len += DOT11F_IE_WFATPC_MAX_LEN + 2; @@ -1370,6 +1369,13 @@ static QDF_STATUS lim_send_hal_start_scan_offload_req(tpAniSirGlobal pMac, ((uint8_t *)&wfa_tpc) + 1, DOT11F_IE_WFATPC_MAX_LEN - SIR_MAC_WFA_TPC_OUI_SIZE); pScanOffloadReq->uIEFieldLen += DOT11F_IE_WFATPC_MAX_LEN + 2; + if (pScanReq->uIEFieldLen) + lim_strip_ie(pMac, + (uint8_t *) pScanReq + pScanReq->uIEFieldOffset, + &pScanReq->uIEFieldLen, + DOT11F_EID_WFATPC, ONE_BYTE, + SIR_MAC_WFA_TPC_OUI, SIR_MAC_WFA_TPC_OUI_SIZE, + NULL); } rc = wma_post_ctrl_msg(pMac, &msg); diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 4a818586ca21..f76cf455e1fc 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -6691,25 +6691,32 @@ QDF_STATUS lim_send_ext_cap_ie(tpAniSirGlobal mac_ctx, } /** - * lim_strip_extcap_ie() - strip extended capability IE from IE buffer + * lim_strip_ie() - strip requested IE from IE buffer * @mac_ctx: global MAC context * @addn_ie: Additional IE buffer * @addn_ielen: Length of additional IE + * @eid: EID of IE to strip + * @size_of_len_field: lenght of IE length field + * @oui: if present matches OUI also + * @oui_length: if previous present, this is length of oui * @extracted_ie: if not NULL, copy the stripped IE to this buffer * - * This utility function is used to strip of the extended capability IE present - * in additional IE buffer. + * This utility function is used to strip of the requested IE if present + * in IE buffer. * * Return: tSirRetStatus */ -tSirRetStatus lim_strip_extcap_ie(tpAniSirGlobal mac_ctx, - uint8_t *addn_ie, uint16_t *addn_ielen, uint8_t *extracted_ie) +tSirRetStatus lim_strip_ie(tpAniSirGlobal mac_ctx, + uint8_t *addn_ie, uint16_t *addn_ielen, + uint8_t eid, eSizeOfLenField size_of_len_field, + uint8_t *oui, uint8_t oui_length, uint8_t *extracted_ie) { uint8_t *tempbuf = NULL; uint16_t templen = 0; int left = *addn_ielen; uint8_t *ptr = addn_ie; - uint8_t elem_id, elem_len; + uint8_t elem_id; + uint16_t elem_len; if (NULL == addn_ie) { lim_log(mac_ctx, LOG1, FL("NULL addn_ie pointer")); @@ -6724,8 +6731,14 @@ tSirRetStatus lim_strip_extcap_ie(tpAniSirGlobal mac_ctx, while (left >= 2) { elem_id = ptr[0]; - elem_len = ptr[1]; - left -= 2; + left -= 1; + if (size_of_len_field == TWO_BYTE) { + elem_len = *((uint16_t *)&ptr[1]); + left -= 2; + } else { + elem_len = ptr[1]; + left -= 1; + } if (elem_len > left) { lim_log(mac_ctx, LOGE, FL("Invalid IEs eid = %d elem_len=%d left=%d"), @@ -6733,20 +6746,31 @@ tSirRetStatus lim_strip_extcap_ie(tpAniSirGlobal mac_ctx, qdf_mem_free(tempbuf); return eSIR_FAILURE; } - if (!(DOT11F_EID_EXTCAP == elem_id)) { - qdf_mem_copy(tempbuf + templen, &ptr[0], elem_len + 2); - templen += (elem_len + 2); + + if (eid != elem_id || + (oui && qdf_mem_cmp(oui, + &ptr[size_of_len_field + 1], + oui_length))) { + qdf_mem_copy(tempbuf + templen, &ptr[0], + elem_len + size_of_len_field + 1); + templen += (elem_len + size_of_len_field + 1); } else { + /* + * eid matched and if provided OUI also matched + * take oui IE and store in provided buffer. + */ if (NULL != extracted_ie) { qdf_mem_set(extracted_ie, - DOT11F_IE_EXTCAP_MAX_LEN + 2, 0); + DOT11F_IE_EXTCAP_MAX_LEN + + size_of_len_field + 1, 0); if (elem_len <= DOT11F_IE_EXTCAP_MAX_LEN) qdf_mem_copy(extracted_ie, &ptr[0], - elem_len + 2); + elem_len + + size_of_len_field + 1); } } left -= elem_len; - ptr += (elem_len + 2); + ptr += (elem_len + size_of_len_field + 1); } qdf_mem_copy(addn_ie, tempbuf, templen); @@ -6817,8 +6841,9 @@ tSirRetStatus lim_strip_extcap_update_struct(tpAniSirGlobal mac_ctx, qdf_mem_set((uint8_t *)&extracted_buff[0], DOT11F_IE_EXTCAP_MAX_LEN + 2, 0); - status = lim_strip_extcap_ie(mac_ctx, addn_ie, addn_ielen, - extracted_buff); + status = lim_strip_ie(mac_ctx, addn_ie, addn_ielen, + DOT11F_EID_EXTCAP, ONE_BYTE, + NULL, 0, extracted_buff); if (eSIR_SUCCESS != status) { lim_log(mac_ctx, LOG1, FL("Failed to strip extcap IE status = (%d)."), status); diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 6c26d923518f..80a37c3f8605 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -614,4 +614,9 @@ void lim_update_caps_info_for_bss(tpAniSirGlobal mac_ctx, uint16_t *caps, uint16_t bss_caps); void lim_send_set_dtim_period(tpAniSirGlobal mac_ctx, uint8_t dtim_period, tpPESession session); + +tSirRetStatus lim_strip_ie(tpAniSirGlobal mac_ctx, + uint8_t *addn_ie, uint16_t *addn_ielen, + uint8_t eid, eSizeOfLenField size_of_len_field, + uint8_t *oui, uint8_t out_len, uint8_t *extracted_ie); #endif /* __LIM_UTILS_H */ From 6d4e09ed8f733089e1d6b548ac3bdac280cbad80 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 20 Oct 2016 00:21:29 -0700 Subject: [PATCH 155/179] Release 5.1.0.32G Release 5.1.0.32G Change-Id: I5afee8edd3699ff8db10a51ec719a4b45090c25f CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index f2fa61a4deef..be8871e6d648 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "F" +#define QWLAN_VERSION_EXTRA "G" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32F" +#define QWLAN_VERSIONSTR "5.1.0.32G" #endif /* QWLAN_VERSION_H */ From 3f89891ddaacf431634cc9b6e0292636ebacdb34 Mon Sep 17 00:00:00 2001 From: Nishank Aggarwal Date: Thu, 13 Oct 2016 17:36:16 +0530 Subject: [PATCH 156/179] qcacld-3.0: Change default value of gTDLSExternalControl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qcacld-2.0 to qcacld-3.0 propagation Currently wpa_supplicant.conf have enabled external control (“tdls_external_control=1”) & INI settings as Explicit Trigger by default. So, here is the mismatch of the wpa_supplicant.conf & INI setting which leads in failure of some test case manually as well these settings. Fix the issue by making the default value of gTDLSExternalControl same as wpa_supplicant.conf. Change-Id: Ifb187768ac387b6ae5f6bb3283efb48225e1e909 CRs-Fixed: 1074998 --- core/hdd/inc/wlan_hdd_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index fcc481a5c7bb..63b2b0f5c05a 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1844,7 +1844,7 @@ typedef enum { #define CFG_TDLS_EXTERNAL_CONTROL "gTDLSExternalControl" #define CFG_TDLS_EXTERNAL_CONTROL_MIN (0) #define CFG_TDLS_EXTERNAL_CONTROL_MAX (1) -#define CFG_TDLS_EXTERNAL_CONTROL_DEFAULT (0) +#define CFG_TDLS_EXTERNAL_CONTROL_DEFAULT (1) #define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE "gEnableTDLSOffChannel" #define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_MIN (0) From fc967593df49944198d59df59b1dd5b760f53f7e Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 20 Oct 2016 00:51:50 -0700 Subject: [PATCH 157/179] Release 5.1.0.32H Release 5.1.0.32H Change-Id: I5171ca51c4ce4ce7025665a0c9cf6c051f2e4c1b CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index be8871e6d648..6cb7ad573793 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "G" +#define QWLAN_VERSION_EXTRA "H" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32G" +#define QWLAN_VERSIONSTR "5.1.0.32H" #endif /* QWLAN_VERSION_H */ From 3f65167a02306a302ef013182df1dc85c94d17d1 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 20 Oct 2016 04:25:34 -0700 Subject: [PATCH 158/179] Release 5.1.0.32I Release 5.1.0.32I Change-Id: I56acfe2103bf277d4ed2901e6986bfc7912584fc CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 6cb7ad573793..2d1b48a811c1 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "H" +#define QWLAN_VERSION_EXTRA "I" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32H" +#define QWLAN_VERSIONSTR "5.1.0.32I" #endif /* QWLAN_VERSION_H */ From 52f7133d2765122142513e7bcbfb931481955329 Mon Sep 17 00:00:00 2001 From: Dhanashri Atre Date: Mon, 22 Aug 2016 12:12:36 -0700 Subject: [PATCH 159/179] qcacld-3.0: API change for per vdev fw stats Changed the API to support per vdev firmware statistics. This API change is needed by the WIN team. Change-Id: If50a767e031e6f203abc01e3dfa26dc59249bb95 CRs-Fixed: 1057751 --- core/dp/txrx/ol_txrx.c | 2 +- core/wma/src/wma_utils.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 6562a310d314..5ea86231b7e9 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -3256,7 +3256,7 @@ ol_txrx_fw_stats_cfg(ol_txrx_vdev_handle vdev, A_STATUS ol_txrx_fw_stats_get(ol_txrx_vdev_handle vdev, struct ol_txrx_stats_req *req, - bool response_expected) + bool per_vdev, bool response_expected) { struct ol_txrx_pdev_t *pdev = vdev->pdev; uint64_t cookie; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index a5958f0e5e1a..6c87a5a19e2f 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -1825,7 +1825,7 @@ int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle, } qdf_mem_zero(&req, sizeof(req)); req.stats_type_reset_mask = value; - ol_txrx_fw_stats_get(vdev, &req, false); + ol_txrx_fw_stats_get(vdev, &req, false, false); return 0; } @@ -1895,7 +1895,7 @@ int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle, l_up_mask = 1 << (value - 1); req.stats_type_upload_mask = l_up_mask; - ol_txrx_fw_stats_get(vdev, &req, true); + ol_txrx_fw_stats_get(vdev, &req, false, true); return 0; } From 8f9032a48912aabcb777ce76df4a3156cc461a80 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 20 Oct 2016 12:17:10 -0700 Subject: [PATCH 160/179] Release 5.1.0.32J Release 5.1.0.32J Change-Id: I6b0373d14b0c2307b5143323c18bdeb8f4518f0a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 2d1b48a811c1..047f0b880f96 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "I" +#define QWLAN_VERSION_EXTRA "J" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32I" +#define QWLAN_VERSIONSTR "5.1.0.32J" #endif /* QWLAN_VERSION_H */ From 414f7ea28f0434acbbffc87049c6e9ddd2b50e0f Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 19 Oct 2016 18:50:02 -0700 Subject: [PATCH 161/179] qcacld-3.0: Make hdd_ipa_forward() static Recently change "qcacld-3.0: ipa exception packet forwarding crash fix" introduced new code including function hdd_ipa_forward(). This function is only accessed from within wlan_hdd_ipa.c so it should have been made static, however it wasn't. And in addition a public protototype was not defined. This causes a build failure when the -Wmissing-prototypes switch is used. To fix this issue make hdd_ipa_forward() static. Change-Id: I8432ab734a0305f3d515a17ef324c7f8f60c0ba0 CRs-Fixed: 1080027 --- core/hdd/src/wlan_hdd_ipa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 4d361f8f4818..8cdf2eb68eaf 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -2526,8 +2526,8 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, * * Return: None */ -void hdd_ipa_forward(struct hdd_ipa_priv *hdd_ipa, - hdd_adapter_t *adapter, qdf_nbuf_t skb) +static void hdd_ipa_forward(struct hdd_ipa_priv *hdd_ipa, + hdd_adapter_t *adapter, qdf_nbuf_t skb) { qdf_nbuf_t copy; struct hdd_ipa_pm_tx_cb *pm_tx_cb; From 2f368192434a7ca56168bc95a7fca3e22b9e2ae0 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 18 Oct 2016 12:14:11 -0700 Subject: [PATCH 162/179] qcacld-3.0: Properly export SME P2P APIs There are currently several SME P2P APIs which do not have their prototypes exported in header files; instead sme_api.c has "extern" declarations for these APIs. This prevents the compiler from verifying that the implementations match the declarations, and causes a warning when the driver is built using -Wmissing-prototypes. To address this issue properly export all P2P APIs. Change-Id: I0389ad753993bf9a8a37d8d9ad5ec466b29c74df CRs-Fixed: 1075575 --- core/sme/inc/p2p_api.h | 2 ++ core/sme/inc/sme_inside.h | 2 ++ core/sme/src/common/sme_api.c | 4 ---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/sme/inc/p2p_api.h b/core/sme/inc/p2p_api.h index 971496f8632e..df3568694846 100644 --- a/core/sme/inc/p2p_api.h +++ b/core/sme/inc/p2p_api.h @@ -80,6 +80,8 @@ typedef struct sp2pContext { uint32_t probeRspIeLength; } tp2pContext, *tPp2pContext; +QDF_STATUS sme_remain_on_chn_rsp(tpAniSirGlobal pMac, uint8_t *pMsg); +QDF_STATUS sme_remain_on_chn_ready(tHalHandle hHal, uint8_t *pMsg); QDF_STATUS sme_remain_on_channel(tHalHandle hHal, uint8_t sessionId, uint8_t channel, uint32_t duration, remainOnChanCallback callback, diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h index b02bc7deaed1..f99ecdd4167d 100644 --- a/core/sme/inc/sme_inside.h +++ b/core/sme/inc/sme_inside.h @@ -271,6 +271,8 @@ QDF_STATUS csr_create_roam_scan_channel_list(tpAniSirGlobal pMac, const eCsrBand eBand); #endif +QDF_STATUS p2p_process_remain_on_channel_cmd(tpAniSirGlobal pMac, + tSmeCmd *p2pRemainonChn); ePhyChanBondState csr_convert_cb_ini_value_to_phy_cb_state(uint32_t cbIniValue); void active_list_cmd_timeout_handle(void *userData); void csr_process_set_dual_mac_config(tpAniSirGlobal mac, tSmeCmd *command); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 2afb1456d881..0c6cf0acc201 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -73,10 +73,6 @@ extern QDF_STATUS pmc_prepare_command(tpAniSirGlobal pMac, uint32_t sessionId, uint32_t size, tSmeCmd **ppCmd); extern void pmc_release_command(tpAniSirGlobal pMac, tSmeCmd *pCommand); extern void qos_release_command(tpAniSirGlobal pMac, tSmeCmd *pCommand); -extern QDF_STATUS p2p_process_remain_on_channel_cmd(tpAniSirGlobal pMac, - tSmeCmd *p2pRemainonChn); -extern QDF_STATUS sme_remain_on_chn_rsp(tpAniSirGlobal pMac, uint8_t *pMsg); -extern QDF_STATUS sme_remain_on_chn_ready(tHalHandle hHal, uint8_t *pMsg); static QDF_STATUS init_sme_cmd_list(tpAniSirGlobal pMac); static void sme_abort_command(tpAniSirGlobal pMac, tSmeCmd *pCommand, From 4ae7506db1aedb0ce4e5c3edad3ce37733bece6a Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 10:37:31 -0700 Subject: [PATCH 163/179] qcacld-3.0: Fix -Wmissing-prototypes in sme_qos We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in sme_qos. Change-Id: Ic9b42f91eb9a2563c146965581b5ef321c201bee CRs-Fixed: 1075575 --- core/sme/src/qos/sme_qos.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/sme/src/qos/sme_qos.c b/core/sme/src/qos/sme_qos.c index 3ad7a41f372b..6a097f9cbe74 100644 --- a/core/sme/src/qos/sme_qos.c +++ b/core/sme/src/qos/sme_qos.c @@ -2933,9 +2933,10 @@ QDF_STATUS sme_qos_process_set_key_success_ind(tpAniSirGlobal pMac, * * Return: QDF_STATUS_SUCCESS - Release is successful. */ -QDF_STATUS sme_qos_ese_save_tspec_response(tpAniSirGlobal pMac, uint8_t sessionId, - tDot11fIEWMMTSPEC *pTspec, uint8_t ac, - uint8_t tspecIndex) +static QDF_STATUS +sme_qos_ese_save_tspec_response(tpAniSirGlobal pMac, uint8_t sessionId, + tDot11fIEWMMTSPEC *pTspec, uint8_t ac, + uint8_t tspecIndex) { tpSirAddtsRsp pAddtsRsp = &sme_qos_cb.sessionInfo[sessionId].ac_info[ac].addTsRsp[tspecIndex]; @@ -2977,6 +2978,7 @@ QDF_STATUS sme_qos_ese_save_tspec_response(tpAniSirGlobal pMac, uint8_t sessionI * * Return: QDF_STATUS_SUCCESS - Release is successful. */ +static QDF_STATUS sme_qos_ese_process_reassoc_tspec_rsp(tpAniSirGlobal pMac, uint8_t sessionId, void *pEvent_info) @@ -3192,7 +3194,7 @@ uint8_t sme_qos_ese_retrieve_tspec_info(tpAniSirGlobal mac_ctx, #endif - +static QDF_STATUS sme_qos_create_tspec_ricie(tpAniSirGlobal pMac, sme_QosWmmTspecInfo *pTspec_Info, uint8_t *pRICBuffer, uint32_t *pRICLength, @@ -3540,7 +3542,9 @@ QDF_STATUS sme_qos_ft_aggr_qos_req(tpAniSirGlobal mac_ctx, uint8_t session_id) return status; } -QDF_STATUS sme_qos_process_ftric_response(tpAniSirGlobal pMac, uint8_t sessionId, +static +QDF_STATUS sme_qos_process_ftric_response(tpAniSirGlobal pMac, + uint8_t sessionId, tDot11fIERICDataDesc *pRicDataDesc, uint8_t ac, uint8_t tspecIndex) { @@ -3813,6 +3817,7 @@ sme_qos_next_ric: } #endif /* WLAN_FEATURE_ROAM_OFFLOAD */ +static QDF_STATUS sme_qos_process_ft_reassoc_rsp_ev(tpAniSirGlobal mac_ctx, uint8_t sessionid, void *event_info) { @@ -4510,6 +4515,7 @@ QDF_STATUS sme_qos_process_reassoc_req_ev(tpAniSirGlobal pMac, uint8_t sessionId * * Return: QDF_STATUS */ +static QDF_STATUS sme_qos_handle_handoff_state(tpAniSirGlobal mac_ctx, sme_QosSessionInfo *qos_session, sme_QosACInfo *ac_info, sme_QosEdcaAcType ac, uint8_t sessionid) From bbaf4e4f62c4cbfc57b4028c27f1d4667bbf1bfd Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 12:33:22 -0700 Subject: [PATCH 164/179] qcacld-3.0: Fix -Wmissing-prototypes in PLD We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in core/pld. Change-Id: Icef77666d1d1ef214491dcf1fcd56741091cec4f CRs-Fixed: 1078826 --- core/pld/src/pld_common.c | 2 +- core/pld/src/pld_pcie.c | 1 + core/pld/src/pld_pcie.h | 6 +++--- core/pld/src/pld_sdio.h | 1 + core/pld/src/pld_snoc.c | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 023e58324557..da6e7dfabddb 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -176,7 +176,7 @@ void pld_del_dev(struct pld_context *pld_context, * * Return: PLD bus type */ -enum pld_bus_type pld_get_bus_type(struct device *dev) +static enum pld_bus_type pld_get_bus_type(struct device *dev) { struct pld_context *pld_context; struct dev_node *dev_node; diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c index f95498154795..ada4fd1126b5 100644 --- a/core/pld/src/pld_pcie.c +++ b/core/pld/src/pld_pcie.c @@ -36,6 +36,7 @@ #endif #include "pld_internal.h" +#include "pld_pcie.h" #ifdef CONFIG_PCI diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index dfba7b4d2fe6..f14f555d5628 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -160,7 +160,7 @@ static inline int pld_pcie_wlan_get_dfs_nol(void *info, u16 info_len) { return 0; } -static void pld_pcie_schedule_recovery_work(void) +static inline void pld_pcie_schedule_recovery_work(void) { return; } @@ -204,11 +204,11 @@ static inline int pld_pcie_auto_resume(void) { return 0; } -static void pld_pcie_lock_pm_sem(void) +static inline void pld_pcie_lock_pm_sem(void) { return; } -static void pld_pcie_release_pm_sem(void) +static inline void pld_pcie_release_pm_sem(void) { return; } diff --git a/core/pld/src/pld_sdio.h b/core/pld/src/pld_sdio.h index 0f6786256dff..5db8bb90e180 100644 --- a/core/pld/src/pld_sdio.h +++ b/core/pld/src/pld_sdio.h @@ -60,6 +60,7 @@ static inline void pld_sdio_unregister_driver(void) { } +static inline int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files, u32 target_type, u32 target_version) { diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c index 8a68aabbab31..03aa4ec61904 100644 --- a/core/pld/src/pld_snoc.c +++ b/core/pld/src/pld_snoc.c @@ -35,6 +35,7 @@ #endif #include "pld_internal.h" +#include "pld_snoc.h" #ifdef CONFIG_PLD_SNOC_ICNSS /** From 550c29e6f1ca4e8fbe93bfb10506eff20ce02593 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 20 Oct 2016 14:34:27 -0700 Subject: [PATCH 165/179] Release 5.1.0.32K Release 5.1.0.32K Change-Id: I88e4e629ae1f910e98b90ffce36711ae18a293af CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 047f0b880f96..72cbe7dc3a0c 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "J" +#define QWLAN_VERSION_EXTRA "K" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32J" +#define QWLAN_VERSIONSTR "5.1.0.32K" #endif /* QWLAN_VERSION_H */ From feb36ba5b1cffff5b7c2c7318023738c335d597a Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 10 Oct 2016 16:40:44 -0700 Subject: [PATCH 166/179] qcacld-3.0: Continue cds_deinit_policy_mgr despite failures Cleanup should ignore errors without modifying execution as much as possible. If one item was not initialized propperly the driver should still try to cleanup the rest. Change-Id: If132c40dffc801972ba801bb4a269b5dd9b954ff CRs-Fixed: 1079503 --- core/cds/src/cds_concurrency.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index e8426415a1ee..a23a56b51ef7 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -3958,23 +3958,27 @@ static void cds_dbs_opportunistic_timer_handler(void *data) QDF_STATUS cds_deinit_policy_mgr(void) { cds_context_type *cds_ctx; + QDF_STATUS status = QDF_STATUS_SUCCESS; cds_ctx = cds_get_context(QDF_MODULE_ID_QDF); if (!cds_ctx) { cds_err("Invalid CDS Context"); - return QDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); } if (!QDF_IS_STATUS_SUCCESS(qdf_event_destroy (&cds_ctx->connection_update_done_evt))) { cds_err("Failed to destroy connection_update_done_evt"); - return QDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); } if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_destroy( &cds_ctx->qdf_conc_list_lock))) { cds_err("Failed to destroy qdf_conc_list_lock"); - return QDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); } if (QDF_TIMER_STATE_RUNNING == @@ -3986,7 +3990,8 @@ QDF_STATUS cds_deinit_policy_mgr(void) if (!QDF_IS_STATUS_SUCCESS(qdf_mc_timer_destroy( &cds_ctx->dbs_opportunistic_timer))) { cds_err("Cannot deallocate dbs opportunistic timer"); - return QDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); } cds_ctx->sme_get_valid_channels = NULL; @@ -3994,10 +3999,11 @@ QDF_STATUS cds_deinit_policy_mgr(void) if (QDF_IS_STATUS_ERROR(cds_reset_sap_mandatory_channels())) { cds_err("failed to reset sap mandatory channels"); - return QDF_STATUS_E_FAILURE; + status = QDF_STATUS_E_FAILURE; + QDF_ASSERT(0); } - return QDF_STATUS_SUCCESS; + return status; } /** From 6640cf3cbef260802b1b9032d52dcc833e0b696a Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 10 Oct 2016 16:44:29 -0700 Subject: [PATCH 167/179] qcacld-3.0: Continue hdd_deconfigure_cds despite failures Cleanup should ignore errors without modifying execution as much as possible. If one item was not initialized propperly the driver should still try to cleanup the rest. Also continue the driver unload when this api returns an error. Change-Id: Ifdda135fe1baaad39c14c1e3d0843ccf964554e0 CRs-Fixed: 1079503 --- core/hdd/src/wlan_hdd_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b0d34fa9b0e3..97213841f769 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7711,6 +7711,7 @@ out: static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) { QDF_STATUS qdf_status; + int ret = 0; ENTER(); /* De-register the SME callbacks */ @@ -7721,18 +7722,18 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) if (!QDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) { hdd_err("Failed to deinit policy manager"); /* Proceed and complete the clean up */ - return -EINVAL; + ret = -EINVAL; } qdf_status = cds_disable(hdd_ctx->pcds_context); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_err("Failed to Disable the CDS Modules! :%d", qdf_status); - return -EINVAL; + ret = -EINVAL; } EXIT(); - return 0; + return ret; } @@ -7786,7 +7787,6 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx) hdd_alert("Failed to de-configure CDS"); QDF_ASSERT(0); ret = -EINVAL; - goto done; } hdd_info("successfully Disabled the CDS modules!"); hdd_ctx->driver_status = DRIVER_MODULES_OPENED; @@ -7815,7 +7815,6 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx) if (!hif_ctx) { hdd_err("Hif context is Null"); ret = -EINVAL; - goto done; } hdd_hif_close(hif_ctx); From 160db394b30aca301ee75cf323650a89ea8da8f6 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 10 Oct 2016 17:37:51 -0700 Subject: [PATCH 168/179] qcacld-3.0: use hdd_context_deinit in hdd_context_destroy Using hdd_context_deinit in hdd_context_destroy reduces redundant code and ensures that wlan_hdd_cfg80211_deinit is called in all error casesses. Change-Id: I7cb98d2934213446c6453e310a3883ffb653f1e6 CRs-Fixed: 1079503 --- core/hdd/src/wlan_hdd_main.c | 64 +++++++++++++++--------------------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 97213841f769..affac218eac9 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4747,17 +4747,18 @@ static void hdd_roc_context_destroy(hdd_context_t *hdd_ctx) } /** - * hdd_context_destroy() - Destroy HDD context - * @hdd_ctx: HDD context to be destroyed. + * hdd_context_deinit() - Deinitialize HDD context + * @hdd_ctx: HDD context. * - * Free config and HDD context as well as destroy all the resources. + * Deinitialize HDD context along with all the feature specific contexts but + * do not free hdd context itself. Caller of this API is supposed to free + * HDD context. * - * Return: None + * return: 0 on success and errno on failure. */ -static void hdd_context_destroy(hdd_context_t *hdd_ctx) +static int hdd_context_deinit(hdd_context_t *hdd_ctx) { - if (QDF_GLOBAL_FTM_MODE != hdd_get_conparam()) - hdd_logging_sock_deactivate_svc(hdd_ctx); + wlan_hdd_cfg80211_deinit(hdd_ctx->wiphy); hdd_roc_context_destroy(hdd_ctx); @@ -4771,6 +4772,24 @@ static void hdd_context_destroy(hdd_context_t *hdd_ctx) qdf_list_destroy(&hdd_ctx->hddAdapters); + return 0; +} + +/** + * hdd_context_destroy() - Destroy HDD context + * @hdd_ctx: HDD context to be destroyed. + * + * Free config and HDD context as well as destroy all the resources. + * + * Return: None + */ +static void hdd_context_destroy(hdd_context_t *hdd_ctx) +{ + if (QDF_GLOBAL_FTM_MODE != hdd_get_conparam()) + hdd_logging_sock_deactivate_svc(hdd_ctx); + + hdd_context_deinit(hdd_ctx); + qdf_mem_free(hdd_ctx->config); hdd_ctx->config = NULL; @@ -6374,36 +6393,6 @@ static void hdd_set_trace_level_for_each(hdd_context_t *hdd_ctx) hdd_cfg_print(hdd_ctx); } -/** - * hdd_context_deinit() - Deinitialize HDD context - * @hdd_ctx: HDD context. - * - * Deinitialize HDD context along with all the feature specific contexts but - * do not free hdd context itself. Caller of this API is supposed to free - * HDD context. - * - * return: 0 on success and errno on failure. - */ -static int hdd_context_deinit(hdd_context_t *hdd_ctx) -{ - wlan_hdd_cfg80211_deinit(hdd_ctx->wiphy); - - hdd_roc_context_destroy(hdd_ctx); - - hdd_sap_context_destroy(hdd_ctx); - - hdd_rx_wake_lock_destroy(hdd_ctx); - - hdd_tdls_context_destroy(hdd_ctx); - - hdd_scan_context_destroy(hdd_ctx); - - qdf_list_destroy(&hdd_ctx->hddAdapters); - - return 0; -} - - /** * hdd_context_init() - Initialize HDD context * @hdd_ctx: HDD context. @@ -8102,7 +8091,6 @@ err_ipa_cleanup: err_wiphy_unregister: wiphy_unregister(hdd_ctx->wiphy); - wlan_hdd_cfg80211_deinit(hdd_ctx->wiphy); err_stop_modules: hdd_wlan_stop_modules(hdd_ctx); From 8d1a6f09c8918cfb6b3b38616473f4582995382d Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 10 Oct 2016 17:48:58 -0700 Subject: [PATCH 169/179] qcacld-3.0: Cleanup error handling in hdd_configure_cds Error paths were missing cleanup steps. Change-Id: I9178e795f1ff9c3439c3ad43957d111e590f0603 CRs-Fixed: 1079503 --- core/hdd/src/wlan_hdd_main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index affac218eac9..2fbd8c8b881c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7669,22 +7669,29 @@ int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) status = hdd_post_cds_enable_config(hdd_ctx); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_alert("hdd_post_cds_enable_config failed"); - goto out; + goto cds_disable; } ret = hdd_features_init(hdd_ctx, adapter); if (ret) - goto out; + goto cds_disable; sme_cbacks.sme_get_valid_channels = sme_get_cfg_valid_channels; sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss; status = cds_init_policy_mgr(&sme_cbacks); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Policy manager initialization failed"); - goto out; + goto hdd_features_deinit; } return 0; + +hdd_features_deinit: + hdd_deregister_cb(hdd_ctx); + wlan_hdd_cfg80211_deregister_frames(adapter); +cds_disable: + cds_disable(hdd_ctx->pcds_context); + out: return -EINVAL; } From 5d3f74c518df7d535df578705d5e635d3a47fd16 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 10 Oct 2016 17:51:06 -0700 Subject: [PATCH 170/179] qcacld-3.0: Remove duplicate cds_deinit_policy_mgr in error handling hdd_wlan_stop_modules takes care of the cds_deinit_policy_mgr call. Therefore hdd_wlan_startup doesn not need to directly call this api. Change-Id: Ic9abbeb44697e6e9a02208eadad48e9a4cdcc16a CRs-Fixed: 1079503 --- core/hdd/src/wlan_hdd_main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2fbd8c8b881c..203eddfb7781 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8112,10 +8112,6 @@ err_stop_modules: err_exit_nl_srv: hdd_exit_netlink_services(hdd_ctx); - if (!QDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) { - hdd_err("Failed to deinit policy manager"); - /* Proceed and complete the clean up */ - } cds_deinit_ini_config(); err_hdd_free_context: qdf_mc_timer_destroy(&hdd_ctx->iface_change_timer); From 2741d152641746339fdea3505139c3deb5155d8c Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Wed, 12 Oct 2016 20:55:29 -0700 Subject: [PATCH 171/179] qcacld-3.0: do cds_sched_deinit_mqs if cds_alloc_ol_rx_pkt_freeq fails Fix error handling to not leave deinit undone after init. Change-Id: Ic00aa99f52ecfbc866332b71f5902b9261d8c319 CRs-Fixed: 1079503 --- core/cds/src/cds_sched.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index 08cebb9feb53..46b76761bb94 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -505,9 +505,8 @@ QDF_STATUS cds_sched_open(void *p_cds_context, spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); INIT_LIST_HEAD(&pSchedContext->cds_ol_rx_pkt_freeq); spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock); - if (cds_alloc_ol_rx_pkt_freeq(pSchedContext) != QDF_STATUS_SUCCESS) { - return QDF_STATUS_E_FAILURE; - } + if (cds_alloc_ol_rx_pkt_freeq(pSchedContext) != QDF_STATUS_SUCCESS) + goto pkt_freeqalloc_failure; register_hotcpu_notifier(&cds_cpu_hotplug_notifier); pSchedContext->cpu_hot_plug_notifier = &cds_cpu_hotplug_notifier; mutex_init(&pSchedContext->affinity_lock); @@ -572,13 +571,14 @@ OL_RX_THREAD_START_FAILURE: #endif MC_THREAD_START_FAILURE: - /* De-initialize all the message queues */ - cds_sched_deinit_mqs(pSchedContext); #ifdef QCA_CONFIG_SMP unregister_hotcpu_notifier(&cds_cpu_hotplug_notifier); cds_free_ol_rx_pkt_freeq(gp_cds_sched_context); +pkt_freeqalloc_failure: #endif + /* De-initialize all the message queues */ + cds_sched_deinit_mqs(pSchedContext); return QDF_STATUS_E_RESOURCES; From bf70d020dc66e97a97d719f30d0160e5e309b7d5 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 20 Oct 2016 15:12:15 -0700 Subject: [PATCH 172/179] Release 5.1.0.32L Release 5.1.0.32L Change-Id: I5bd6d11e927bba2f7db4d4b231d62cf507c83dd8 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 72cbe7dc3a0c..3a1b0f5ad55a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "K" +#define QWLAN_VERSION_EXTRA "L" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32K" +#define QWLAN_VERSIONSTR "5.1.0.32L" #endif /* QWLAN_VERSION_H */ From 72a1c609afd1a5b8c0a85ceca9c0997fef286f79 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Mon, 10 Oct 2016 10:15:59 -0700 Subject: [PATCH 173/179] qcacld-3.0: Fix double free memory in sme_power_save.c In sme_ps_enter_wowl_req_params() and sme_ps_exit_wowl_req_params(), if call to sme_post_ps_msg_to_wma() fails, both caller and callee frees the message buffer causing double free of memory. Do not free the memory again in caller function if sme_post_ps_msg_to_wma returns error. Change-Id: I92bab9477a07016c44f099e4286178c9d5487a4c CRs-Fixed: 1076087 --- core/sme/src/common/sme_power_save.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index 59d4cc962fd9..48b298c653d6 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -394,8 +394,9 @@ static QDF_STATUS sme_ps_enter_wowl_req_params(tpAniSirGlobal mac_ctx, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, FL("Msg WMA_WOWL_ENTER_REQ Successfully sent to WMA")); return QDF_STATUS_SUCCESS; - } else - goto end; + } else { + return QDF_STATUS_E_FAILURE; + } end: if (hal_wowl_params != NULL) @@ -429,10 +430,9 @@ static QDF_STATUS sme_ps_exit_wowl_req_params(tpAniSirGlobal mac_ctx, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, FL("Msg WMA_WOWL_EXIT_REQ Successfully sent to WMA")); return QDF_STATUS_SUCCESS; + } else { + return QDF_STATUS_E_FAILURE; } - if (hal_wowl_msg != NULL) - qdf_mem_free(hal_wowl_msg); - return QDF_STATUS_E_FAILURE; } /** From 968c351dd79c9be779a3a622b6afb739fe6a3622 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Mon, 10 Oct 2016 09:33:13 -0700 Subject: [PATCH 174/179] qcacld-3.0: Set csr_prune_channel_list_for_mode prototype in header file csr_prune_channel_list_for_mode() is implemented in csr_api_roam.c but is referenced from both csr_api_roam.c and csr_api_scan.c Set prototype of csr_prune_channel_list_for_mode in csr_inside_api.h which is included by both files. Change-Id: I106d8e25265bcbd16a67ebb23aff030826a02aed CRs-Fixed: 1076076 --- core/sme/src/csr/csr_api_scan.c | 2 -- core/sme/src/csr/csr_inside_api.h | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index f4e56542ca17..3edaca4b8e9f 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -104,8 +104,6 @@ static bool csr_scan_validate_scan_result(tpAniSirGlobal pMac, uint8_t *pChannel tSirBssDescription *pBssDesc, tDot11fBeaconIEs **ppIes); bool csr_roam_is_valid_channel(tpAniSirGlobal pMac, uint8_t channel); -void csr_prune_channel_list_for_mode(tpAniSirGlobal pMac, - tCsrChannel *pChannelList); static void csr_purge_scan_result_by_age(void *pv); #define CSR_IS_SOCIAL_CHANNEL(channel) \ diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index b8ee71bc58f5..9c66909c0255 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -1077,4 +1077,5 @@ QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal mac_ctx, tCsrRoamProfile *profile, tSirBssDescription *bss_desc, tBssConfigParam *bss_cfg, tDot11fBeaconIEs *ies, bool reset_country); - +void csr_prune_channel_list_for_mode(tpAniSirGlobal pMac, + tCsrChannel *pChannelList); From 1a8dee02eb7edb7fb523b65d1335ecf8fbd4b3d2 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 20 Oct 2016 15:48:17 -0700 Subject: [PATCH 175/179] Release 5.1.0.32M Release 5.1.0.32M Change-Id: I7700df9562e7be2539724b49243a3361444777d4 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 3a1b0f5ad55a..8d0041991f98 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32L" +#define QWLAN_VERSIONSTR "5.1.0.32M" #endif /* QWLAN_VERSION_H */ From 91df30a19130165b5b12b7629855d567e3229df4 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Wed, 12 Oct 2016 21:26:18 -0700 Subject: [PATCH 176/179] qcacld-3.0: Trigger BUG ON only if recovery is disabled When firmware event times out, panic only if recovery is disabled else return failure so that driver load can fail gracefully. Change-Id: I90d110af370842fcd2bc8cc11008d1524c99332e CRs-Fixed: 1077315 --- core/cds/inc/cds_api.h | 1 + core/cds/inc/cds_config.h | 1 + core/cds/src/cds_api.c | 30 +++++++++++++++++++++++++++++- core/hdd/src/wlan_hdd_main.c | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 4a94baeee1af..fa048f1d72ea 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -291,4 +291,5 @@ struct cds_config_info *cds_get_ini_config(void); bool cds_is_5_mhz_enabled(void); bool cds_is_10_mhz_enabled(void); bool cds_is_sub_20_mhz_enabled(void); +bool cds_is_self_recovery_enabled(void); #endif /* if !defined __CDS_API_H */ diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h index 892181b9fc43..c6e969196d27 100644 --- a/core/cds/inc/cds_config.h +++ b/core/cds/inc/cds_config.h @@ -147,5 +147,6 @@ struct cds_config_info { uint16_t self_gen_frm_pwr; enum cfg_sub_20_channel_width sub_20_channel_width; bool flow_steering_enabled; + bool self_recovery_enabled; }; #endif /* !defined( __CDS_CONFIG_H ) */ diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 9f49466926b1..0914b0620f1b 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -520,7 +520,14 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context) if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "Failed to get ready event from target firmware"); - QDF_BUG(0); + /* + * Panic only if recovery is disabled, else return failure so + * that driver load can fail gracefully. We cannot trigger self + * recovery here because driver is not fully loaded yet. + */ + if (!cds_is_self_recovery_enabled()) + QDF_BUG(0); + htc_stop(gp_cds_context->htc_ctx); return QDF_STATUS_E_FAILURE; } @@ -2254,6 +2261,27 @@ bool cds_is_sub_20_mhz_enabled(void) return false; } +/** + * cds_is_self_recovery_enabled() - API to get self recovery enabled + * + * Return: true if self recovery enabled, false otherwise + */ +bool cds_is_self_recovery_enabled(void) +{ + p_cds_contextType p_cds_context; + + p_cds_context = cds_get_context(QDF_MODULE_ID_QDF); + if (!p_cds_context) { + cds_err("%s: cds context is invalid", __func__); + return false; + } + + if (p_cds_context->cds_cfg) + return p_cds_context->cds_cfg->self_recovery_enabled; + + return false; +} + /** * cds_svc_fw_shutdown_ind() - API to send userspace about FW crash * diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 203eddfb7781..505746971f98 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6964,6 +6964,7 @@ static int hdd_update_cds_config(hdd_context_t *hdd_ctx) cds_cfg->max_station = hdd_ctx->config->maxNumberOfPeers; cds_cfg->sub_20_channel_width = WLAN_SUB_20_CH_WIDTH_NONE; cds_cfg->flow_steering_enabled = hdd_ctx->config->flow_steering_enable; + cds_cfg->self_recovery_enabled = hdd_ctx->config->enableSelfRecovery; hdd_ra_populate_cds_config(cds_cfg, hdd_ctx); hdd_txrx_populate_cds_config(cds_cfg, hdd_ctx); From 6733b7fb498883314e823ef27a4df1f3e6264594 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 24 Oct 2016 09:56:29 -0700 Subject: [PATCH 177/179] Release 5.1.0.32N Release 5.1.0.32N Change-Id: I6fcb0e323415a22144c23eadf65c2e1f48646bae CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 8d0041991f98..c51c5a01469a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32M" +#define QWLAN_VERSIONSTR "5.1.0.32N" #endif /* QWLAN_VERSION_H */ From 2dc0c9658a207f0817c21f8d6d19f7fe2fb3c792 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Thu, 20 Oct 2016 12:37:26 +0530 Subject: [PATCH 178/179] qcacld-3.0: Protect con mode change with possible race condition Presently there is a small window where there is a possible race condition when con mode change happens at the same time as a ssr. Protect the same by validating the context. Also move the hdd_init to module_init so that ssr/qdf infrastructure are always present when the driver is loaded. Change-Id: Id14ebef7b5bbafaa799752620973ce03ab0bdd8c CRs-Fixed: 1078405 --- core/hdd/src/wlan_hdd_driver_ops.c | 13 ++----------- core/hdd/src/wlan_hdd_main.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 57b1ce695434..7861b503b4c5 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -351,15 +351,10 @@ static int wlan_hdd_probe(struct device *dev, void *bdev, const hif_bus_id *bid, */ hdd_request_pm_qos(dev, DISABLE_KRAIT_IDLE_PS_VAL); - if (reinit) { + if (reinit) cds_set_recovery_in_progress(true); - } else { - ret = hdd_init(); - - if (ret) - goto out; + else cds_set_load_in_progress(true); - } hdd_init_qdf_ctx(dev, bdev, bus_type, (const struct hif_bus_id *)bid); @@ -390,8 +385,6 @@ err_hdd_deinit: cds_set_recovery_in_progress(false); else cds_set_load_in_progress(false); - hdd_deinit(); -out: hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT); hdd_remove_pm_qos(dev); return ret; @@ -431,8 +424,6 @@ static void wlan_hdd_remove(struct device *dev) __hdd_wlan_exit(); } - hdd_deinit(); - pr_info("%s: Driver De-initialized\n", WLAN_MODULE_NAME); } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 505746971f98..af549d3ad93d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9050,6 +9050,12 @@ static int __hdd_module_init(void) pld_init(); + ret = hdd_init(); + if (ret) { + pr_err("hdd_init failed %x\n", ret); + goto err_hdd_init; + } + qdf_wake_lock_create(&wlan_wake_lock, "wlan"); hdd_set_conparam((uint32_t) con_mode); @@ -9066,6 +9072,8 @@ static int __hdd_module_init(void) return 0; out: qdf_wake_lock_destroy(&wlan_wake_lock); + hdd_deinit(); +err_hdd_init: pld_deinit(); return ret; } @@ -9108,6 +9116,7 @@ static void __hdd_module_exit(void) qdf_wake_lock_destroy(&wlan_wake_lock); + hdd_deinit(); pld_deinit(); return; @@ -9425,9 +9434,10 @@ static int hdd_register_req_mode(hdd_context_t *hdd_ctx, } /** - * con_mode_handler() - Handles module param con_mode change + * __con_mode_handler() - Handles module param con_mode change * @kmessage: con mode name on which driver to be bring up * @kp: The associated kernel parameter + * @hdd_ctx: Pointer to the global HDD context * * This function is invoked when user updates con mode using sys entry, * to initialize and bring-up driver in that specific mode. @@ -9442,6 +9452,10 @@ static int __con_mode_handler(const char *kmessage, struct kernel_param *kp, enum tQDF_GLOBAL_CON_MODE curr_mode; enum tQDF_ADAPTER_MODE adapter_mode; + ret = wlan_hdd_validate_context(hdd_ctx); + if (ret) + return ret; + cds_set_load_in_progress(true); hdd_info("con_mode handler: %s", kmessage); From c1b06710ed7a98cfe8b2ecf573c9adcf8093c9f2 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 24 Oct 2016 10:28:41 -0700 Subject: [PATCH 179/179] Release 5.1.0.32O Release 5.1.0.32O Change-Id: I01f93a142506296e8f0f58cc0f54cc0df5d9e31c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c51c5a01469a..2482107417c5 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 32 -#define QWLAN_VERSIONSTR "5.1.0.32N" +#define QWLAN_VERSIONSTR "5.1.0.32O" #endif /* QWLAN_VERSION_H */