From bc1c547b8e944ee7a5088a3f98db5ca8cceb7cb4 Mon Sep 17 00:00:00 2001 From: Kiran Venkatappa Date: Tue, 24 Apr 2018 18:09:09 +0530 Subject: [PATCH 1/9] qcacmn: Add timekeeping.h inclusion under correct kernel version timekeeping.h is available from kernel version 3.17. Add header inclusion and ktime_get_boot_ns call under correct version check flag. Change-Id: I2a1a127e1716b52af56d14c39e2e646e34b05fa3 CRs-Fixed: 2230949 --- qdf/inc/qdf_time.h | 12 ++---------- qdf/linux/src/i_qdf_time.h | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/qdf/inc/qdf_time.h b/qdf/inc/qdf_time.h index 60051919e8b2..ae67ffd92d1a 100644 --- a/qdf/inc/qdf_time.h +++ b/qdf/inc/qdf_time.h @@ -168,19 +168,11 @@ static inline qdf_time_t qdf_get_system_uptime(void) * The time since system booted in nanoseconds */ -#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 10, 0)) -static inline s64 qdf_get_bootbased_boottime_ns(void) +static inline uint64_t qdf_get_bootbased_boottime_ns(void) { - return ktime_get_boot_ns(); + return __qdf_get_bootbased_boottime_ns(); } -#else -static inline s64 qdf_get_bootbased_boottime_ns(void) -{ - return ktime_to_ns(ktime_get_boottime()); -} -#endif - /** * qdf_get_system_timestamp - Return current timestamp * diff --git a/qdf/linux/src/i_qdf_time.h b/qdf/linux/src/i_qdf_time.h index 2352a9daec17..4080f26155dc 100644 --- a/qdf/linux/src/i_qdf_time.h +++ b/qdf/linux/src/i_qdf_time.h @@ -36,7 +36,9 @@ #include #include #include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) #include +#endif #ifdef MSM_PLATFORM #include #endif @@ -305,4 +307,28 @@ static inline uint64_t __qdf_get_log_timestamp(void) } #endif /* QCA_WIFI_3_0_ADRASTEA */ +/** + * __qdf_get_bootbased_boottime_ns() - Get the bootbased time in nanoseconds + * + * __qdf_get_bootbased_boottime_ns() function returns the number of nanoseconds + * that have elapsed since the system was booted. It also includes the time when + * system was suspended. + * + * Return: + * The time since system booted in nanoseconds + */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) +static inline uint64_t __qdf_get_bootbased_boottime_ns(void) +{ + return ktime_get_boot_ns(); +} + +#else +static inline uint64_t __qdf_get_bootbased_boottime_ns(void) +{ + return ktime_to_ns(ktime_get_boottime()); +} +#endif + #endif From c61d48d88635b671e676ed0020cd4218cc9816d0 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 27 Apr 2018 16:40:13 -0700 Subject: [PATCH 2/9] qcacmn: Add NULL pointer check in tgt_scan_pno_start() API Add NULL pointer check in tgt_scan_pno_start() API. CRs-Fixed: 2232784 Change-Id: Ie63ac4eea9d45e9bf8ea305fd26abed1361a03f8 --- umac/scan/dispatcher/src/wlan_scan_tgt_api.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/umac/scan/dispatcher/src/wlan_scan_tgt_api.c b/umac/scan/dispatcher/src/wlan_scan_tgt_api.c index d7703a175580..41a356c93512 100644 --- a/umac/scan/dispatcher/src/wlan_scan_tgt_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_tgt_api.c @@ -77,7 +77,15 @@ QDF_STATUS tgt_scan_pno_start(struct wlan_objmgr_vdev *vdev, psoc = wlan_vdev_get_psoc(vdev); + if (!psoc) { + scm_err("NULL PSOC"); + return QDF_STATUS_E_FAILURE; + } scan_ops = wlan_psoc_get_scan_txops(psoc); + if (!scan_ops) { + scm_err("NULL scan_ops"); + return QDF_STATUS_E_FAILURE; + } /* invoke wmi_unified_pno_start_cmd() */ QDF_ASSERT(scan_ops->pno_start); if (scan_ops->pno_start) From acd250c4af4b2e7d466fb77be8bbee8cd0a87e5d Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 27 Apr 2018 16:42:52 -0700 Subject: [PATCH 3/9] qcacmn: Add NULL pointer check in tgt_scan_pno_stop() API Add NULL pointer check in tgt_scan_pno_stop() API. CRs-Fixed: 2232787 Change-Id: I9b3c88af8d4d719a4a6fe097e7994ecd4bbddcbd --- umac/scan/dispatcher/src/wlan_scan_tgt_api.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/umac/scan/dispatcher/src/wlan_scan_tgt_api.c b/umac/scan/dispatcher/src/wlan_scan_tgt_api.c index 41a356c93512..b2a84d29354f 100644 --- a/umac/scan/dispatcher/src/wlan_scan_tgt_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_tgt_api.c @@ -102,7 +102,15 @@ QDF_STATUS tgt_scan_pno_stop(struct wlan_objmgr_vdev *vdev, psoc = wlan_vdev_get_psoc(vdev); + if (!psoc) { + scm_err("NULL PSOC"); + return QDF_STATUS_E_FAILURE; + } scan_ops = wlan_psoc_get_scan_txops(psoc); + if (!scan_ops) { + scm_err("NULL scan_ops"); + return QDF_STATUS_E_FAILURE; + } /* invoke wmi_unified_pno_stop_cmd() */ QDF_ASSERT(scan_ops->pno_stop); if (scan_ops->pno_stop) From cf2db1bee207691dc5ba3d3c50aa1f4717986b34 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 27 Apr 2018 16:44:53 -0700 Subject: [PATCH 4/9] qcacmn: Add NULL pointer check in p2p_remove_tx_context() API Add NULL pointer check in p2p_remove_tx_context() API. CRs-Fixed: 2232786 Change-Id: I67e541573d704f313a48c16c195a626a4040402c --- umac/p2p/core/src/wlan_p2p_off_chan_tx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/umac/p2p/core/src/wlan_p2p_off_chan_tx.c b/umac/p2p/core/src/wlan_p2p_off_chan_tx.c index 75fbcd3c54e8..6af91f761b67 100644 --- a/umac/p2p/core/src/wlan_p2p_off_chan_tx.c +++ b/umac/p2p/core/src/wlan_p2p_off_chan_tx.c @@ -1214,8 +1214,10 @@ static QDF_STATUS p2p_remove_tx_context( &is_ack_q); /* for not off channel tx case, won't find from queue */ - if (!cur_tx_ctx) + if (!cur_tx_ctx) { p2p_debug("Do not find tx context from queue"); + goto end; + } if (is_roc_q) { status = qdf_list_remove_node( @@ -1233,6 +1235,7 @@ static QDF_STATUS p2p_remove_tx_context( p2p_err("Failed to tx context from wait ack req queue"); } +end: qdf_mem_free(tx_ctx->buf); qdf_mem_free(tx_ctx); From 3370ea52d1194eb55723852b551215e8e3628a6b Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 27 Apr 2018 16:46:08 -0700 Subject: [PATCH 5/9] qcacmn: Fix uninitialize variables in few policy manager APIs Few variables are left uninitialized and they are being used with some random value. Fix by initializing to default value. CRs-Fixed: 2232791 Change-Id: I3351cae52c58e963601d53376f42ca8ebf0d3b9a --- umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c | 2 +- umac/dfs/dispatcher/src/wlan_dfs_utils_api.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 7851c6070ba3..2179993f73c2 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -1357,7 +1357,7 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, * under 5G MCC scenario */ uint8_t channel = PM_24_GHZ_CHANNEL_6; - uint32_t i, pcl_len; + uint32_t i, pcl_len = 0; pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c index bcac33118fd9..04fcfe2457e0 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c @@ -536,8 +536,8 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev, static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev, struct dfs_channel *chan_list, uint32_t *num_chan) { - uint8_t pcl_ch[NUM_CHANNELS]; - uint8_t weight_list[NUM_CHANNELS]; + uint8_t pcl_ch[NUM_CHANNELS] = {0}; + uint8_t weight_list[NUM_CHANNELS] = {0}; uint32_t len; uint32_t weight_len; int i; From 7095e2e8836dfce9ebf16ffc63dfff0722d1ec74 Mon Sep 17 00:00:00 2001 From: Kiran Venkatappa Date: Tue, 1 May 2018 20:53:43 +0530 Subject: [PATCH 6/9] qcacmn: Increase num_peers to include bss_peers bss peer are used for each vdev. Include this count also in the num_peer count sent to FW. Change-Id: I71c4858ebe416a644f9e100a8d28ac1fd7989757 CRs-Fixed: 2233009 --- target_if/init_deinit/src/init_event_handler.c | 2 +- umac/cmn_services/inc/wlan_cmn.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index 1948b09c1a2a..d98bdd57118d 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -355,7 +355,7 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle, /* FW allocated number of peers is different than host * requested. Update host max with FW reported value. */ - target_if_info("Host Requested %d peers. FW Supports %d peers", + target_if_err("Host Requested %d peers. FW Supports %d peers", info->wlan_res_cfg.num_peers, ready_ev.num_total_peer); info->wlan_res_cfg.num_peers = ready_ev.num_total_peer; diff --git a/umac/cmn_services/inc/wlan_cmn.h b/umac/cmn_services/inc/wlan_cmn.h index 3e306161c59e..9dbd55fed836 100644 --- a/umac/cmn_services/inc/wlan_cmn.h +++ b/umac/cmn_services/inc/wlan_cmn.h @@ -33,7 +33,7 @@ /* Max no. of VDEVs, a PDEV can support */ #define WLAN_UMAC_PDEV_MAX_VDEVS 17 /* Max no. of Peers, a device can support */ -#define WLAN_UMAC_PSOC_MAX_PEERS 1024 +#define WLAN_UMAC_PSOC_MAX_PEERS (1024 + WLAN_UMAC_PSOC_MAX_VDEVS) /* Max length of a SSID */ #define WLAN_SSID_MAX_LEN 32 From 2755048d7d2178a0be305fb6a284d3d7109e7334 Mon Sep 17 00:00:00 2001 From: "Ruchi, Agrawal" Date: Tue, 20 Feb 2018 19:43:41 +0530 Subject: [PATCH 7/9] qcacmn: Remove NAWDS Rx Drop Count length counter Remove NAWDS Rx Drop Count as it is not required, drop packets in rx where length is not available. Change-Id: Ib4b41eefe88410137c3845090783ee43adb9147c CRs-Fixed: 2191474 --- dp/inc/cdp_txrx_stats_struct.h | 2 +- dp/wifi3.0/dp_main.c | 4 +--- dp/wifi3.0/dp_rx.c | 3 +-- dp/wifi3.0/dp_rx_err.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index e54be62edaf5..16fc9f76e74e 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -185,7 +185,7 @@ struct cdp_rx_stats { /* Raw Pakets received */ struct cdp_pkt_info raw; /* Total multicast packets */ - struct cdp_pkt_info nawds_mcast_drop; + uint32_t nawds_mcast_drop; struct { /* Intra BSS packets received */ diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index ba2b3af73f4d..41b0f0dad73d 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -5705,9 +5705,7 @@ static inline void dp_print_peer_stats(struct dp_peer *peer) peer->stats.rx.amsdu_cnt); DP_PRINT_STATS("NAWDS : "); DP_PRINT_STATS(" Nawds multicast Drop Rx Packet = %d", - peer->stats.rx.nawds_mcast_drop.num); - DP_PRINT_STATS(" Nawds multicast Drop Rx Packet Bytes = %llu", - peer->stats.rx.nawds_mcast_drop.bytes); + peer->stats.rx.nawds_mcast_drop); DP_PRINT_STATS("SGI =" " 0.8us %d" " 0.4us %d" diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index b31d50ac497d..c3195e8cb036 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -1510,8 +1510,7 @@ done: if (qdf_unlikely(peer && (peer->nawds_enabled == true) && (hal_rx_msdu_end_da_is_mcbc_get(rx_tlv_hdr)) && (hal_rx_get_mpdu_mac_ad4_valid(rx_tlv_hdr) == false))) { - DP_STATS_INC_PKT(peer, rx.nawds_mcast_drop, 1, - qdf_nbuf_len(nbuf)); + DP_STATS_INC(peer, rx.nawds_mcast_drop, 1); qdf_nbuf_free(nbuf); nbuf = next; continue; diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index 1dd2f1235769..3bff6cf98bfb 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -583,8 +583,7 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, QDF_TRACE_LEVEL_DEBUG, "%s free buffer for multicast packet", __func__); - DP_STATS_INC_PKT(peer, rx.nawds_mcast_drop, - 1, qdf_nbuf_len(nbuf)); + DP_STATS_INC(peer, rx.nawds_mcast_drop, 1); qdf_nbuf_free(nbuf); return; } From c26dfc85f4246ad92fb583d57e0d9461c62dcdb5 Mon Sep 17 00:00:00 2001 From: jiad Date: Thu, 3 May 2018 16:09:03 +0800 Subject: [PATCH 8/9] qcacmn: Fix return buffer manager for REO error ring Return buffer manager for error packets has been changed from HAL_RX_BUF_RBM_SW3_BM to HAL_RX_BUF_RBM_SW1_BM. Fix is to use DP_WBM2SW_RBM to check correct rbm. Change-Id: Ib5ffe7161f85fe6a374f16a06a1f6f4f701abe0b CRs-Fixed: 2231571 --- dp/wifi3.0/dp_rx_defrag.c | 3 +-- dp/wifi3.0/dp_rx_err.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dp/wifi3.0/dp_rx_defrag.c b/dp/wifi3.0/dp_rx_defrag.c index fa13b20f21be..1d38bec05291 100644 --- a/dp/wifi3.0/dp_rx_defrag.c +++ b/dp/wifi3.0/dp_rx_defrag.c @@ -991,8 +991,7 @@ dp_rx_defrag_nwifi_to_8023(qdf_nbuf_t nbuf, uint16_t hdrsize) return QDF_STATUS_E_FAILURE; } - hal_rxdma_buff_addr_info_set(msdu0, paddr, cookie, - HAL_RX_BUF_RBM_SW3_BM); + hal_rxdma_buff_addr_info_set(msdu0, paddr, cookie, DP_WBM2SW_RBM); /* Lets fill entrance ring now !!! */ if (qdf_unlikely(hal_srng_access_start(soc->hal_soc, hal_srng))) { diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index 3bff6cf98bfb..7fdae3b0720d 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -918,15 +918,14 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota) link_desc_va = dp_rx_cookie_2_link_desc_va(soc, &hbi); hal_rx_msdu_list_get(link_desc_va, &msdu_list, &num_msdus); - if (qdf_unlikely((msdu_list.rbm[0] != - HAL_RX_BUF_RBM_SW3_BM) && + if (qdf_unlikely((msdu_list.rbm[0] != DP_WBM2SW_RBM) && (msdu_list.rbm[0] != HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST))) { /* TODO */ /* Call appropriate handler */ DP_STATS_INC(soc, rx.err.invalid_rbm, 1); QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - FL("Invalid RBM %d"), rbm); + FL("Invalid RBM %d"), msdu_list.rbm[0]); /* Return link descriptor through WBM ring (SW2WBM)*/ dp_rx_link_desc_return(soc, ring_desc, @@ -934,7 +933,6 @@ dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota) continue; } - /* Get the MPDU DESC info */ hal_rx_mpdu_desc_info_get(ring_desc, &mpdu_desc_info); From 49dd1d9143c31f60d03fa8b0d4ebfc004b9d861b Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sat, 28 Apr 2018 12:06:59 -0700 Subject: [PATCH 9/9] qcacmn: Add missing entry to VERBOSE_STR[] In qdf_trace_msg_cmn() the VERBOSE_STR array is used to convert a trace level into a string. This array is missing an entry for QDF_TRACE_LEVEL_ALL, so add it. Change-Id: Iee6337cda7e54c429d36b2fd42bbd0c143c7d5a5 CRs-Fixed: 2232820 --- qdf/linux/src/qdf_trace.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qdf/linux/src/qdf_trace.c b/qdf/linux/src/qdf_trace.c index a4e7f87c12ae..75ef6e9b68c2 100644 --- a/qdf/linux/src/qdf_trace.c +++ b/qdf/linux/src/qdf_trace.c @@ -2690,17 +2690,17 @@ void qdf_trace_msg_cmn(unsigned int idx, */ if (print_ctrl_obj[idx].cat_info[category].category_verbose_mask & QDF_TRACE_LEVEL_TO_MODULE_BITMASK(verbose)) { - /* - * The verbose strings are in an array. These are ordered in - * the same order as the verbose levels are defined in the enum - * (see QDF_TRACE_LEVEL) so we can index into this array with - * the level and get the right string. The qdf verbose - * are... Off, Fatal, Error, Warning, Info, Info_high, - * Info_med, Info_low, Debug - */ - static const char * const VERBOSE_STR[] = { " ", "F", "E", "W", - "I", "IH", "IM", "IL", - "D" }; + static const char * const VERBOSE_STR[] = { + [QDF_TRACE_LEVEL_NONE] = "", + [QDF_TRACE_LEVEL_FATAL] = "F", + [QDF_TRACE_LEVEL_ERROR] = "E", + [QDF_TRACE_LEVEL_WARN] = "W", + [QDF_TRACE_LEVEL_INFO] = "I", + [QDF_TRACE_LEVEL_INFO_HIGH] = "IH", + [QDF_TRACE_LEVEL_INFO_MED] = "IM", + [QDF_TRACE_LEVEL_INFO_LOW] = "IL", + [QDF_TRACE_LEVEL_DEBUG] = "D", + [QDF_TRACE_LEVEL_ALL] = "" }; /* print the prefix string into the string buffer... */ n = scnprintf(str_buffer, QDF_TRACE_BUFFER_SIZE,