From af630c25c0aaaee4992fafe2352bb8966eadb78b Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 30 Aug 2016 23:28:36 -0700 Subject: [PATCH 01/12] Release 5.1.0.22Z Release 5.1.0.22Z Change-Id: I206d3008cf84d2d28050286b1f194ee9e22ac92e CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 7132fab1889b..b0156a3467be 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22Y +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22Z Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 4fcafd4990c0918300d392f61441fc22772c56b8 Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Mon, 8 Aug 2016 12:37:31 +0530 Subject: [PATCH 02/12] qcacmn: unmap buffer for CE destination ring en-queue error Unmap a previously mapped buffer if host fails to en-queue buffer to CE destination ring. Propagation from qcacld-2.0 to qcacmn. Change-Id: If23398b01124638cfb266f5755fc9e45d3969ac9 CRs-Fixed: 1033307 --- hif/src/ce/ce_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 1a7d3a5a5123..1f5201d742e4 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -1647,6 +1647,8 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) __func__, pipe_info->pipe_num, atomic_read(&pipe_info->recv_bufs_needed), pipe_info->nbuf_ce_enqueue_err_count); + qdf_nbuf_unmap_single(scn->qdf_dev, nbuf, + QDF_DMA_FROM_DEVICE); atomic_inc(&pipe_info->recv_bufs_needed); qdf_nbuf_free(nbuf); return 1; From 2d9bcb1ade33e88379feca56fbaa8346c943fd09 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 31 Aug 2016 05:14:43 -0700 Subject: [PATCH 03/12] Release 5.1.0.23 Release 5.1.0.23 Change-Id: Ic44825f4290c028337751a7773e4f8dbf4a79cba CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index b0156a3467be..7fddbef4ef4b 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22Z +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23 Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 7252e4304838b464329867e78c5be20bec30876b Mon Sep 17 00:00:00 2001 From: Sathish Kumar Date: Tue, 9 Aug 2016 16:50:46 +0530 Subject: [PATCH 04/12] qcacmn: Add WMI API for setting bandwidth fairness This change implements the Non-TLV WMI API for setting bandwidth fairness. This WMI command was implemented as part of the recent WIN SW release. This change ensures it is adapted to convergence code structure. Change-Id: Ib9984c43b91b105bfb4687a7591f4fab509febc4 CRs-Fixed: 1060577 --- wmi/inc/wmi_unified_api.h | 3 +++ wmi/inc/wmi_unified_param.h | 26 +++++++++++++++++++++ wmi/inc/wmi_unified_priv.h | 3 +++ wmi/src/wmi_unified_api.c | 18 ++++++++++++++ wmi/src/wmi_unified_non_tlv.c | 44 +++++++++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 7108b298876c..5ef8b5a7325c 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -854,6 +854,9 @@ QDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl, QDF_STATUS wmi_unified_pdev_get_tpc_config_cmd_send(void *wmi_hdl, uint32_t param); +QDF_STATUS wmi_unified_set_bwf_cmd_send(void *wmi_hdl, + struct set_bwf_params *param); + QDF_STATUS wmi_unified_set_atf_cmd_send(void *wmi_hdl, struct set_atf_params *param); diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index b42bdd3b0842..306aad6ed988 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -3725,6 +3725,32 @@ typedef struct { uint32_t percentage_peer; } atf_peer_info; +/** + * struct bwf_peer_info_t - BWF peer info params + * @peer_macaddr: peer mac addr + * @throughput: Throughput + * @max_airtime: Max airtime + * @priority: Priority level + * @reserved: Reserved array + */ +typedef struct { + struct wmi_macaddr_t peer_macaddr; + uint32_t throughput; + uint32_t max_airtime; + uint32_t priority; + uint32_t reserved[4]; +} bwf_peer_info; + +/** + * struct set_bwf_params - BWF params + * @num_peers: number of peers + * @atf_peer_info: BWF peer info + */ +struct set_bwf_params { + uint32_t num_peers; + bwf_peer_info peer_info[1]; +}; + /** * struct set_atf_params - ATF params * @num_peers: number of peers diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index f54202822980..d8b19b715cc3 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -708,6 +708,9 @@ QDF_STATUS (*send_get_buf_extscan_hotlist_cmd)(wmi_unified_t wmi_handle, QDF_STATUS (*send_pdev_get_tpc_config_cmd)(wmi_unified_t wmi_handle, uint32_t param); +QDF_STATUS (*send_set_bwf_cmd)(wmi_unified_t wmi_handle, + struct set_bwf_params *param); + QDF_STATUS (*send_set_atf_cmd)(wmi_unified_t wmi_handle, struct set_atf_params *param); diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 86a79f31f94f..3fd8618808df 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -3443,6 +3443,24 @@ QDF_STATUS wmi_unified_pdev_get_tpc_config_cmd_send(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } +/** + * wmi_unified_set_bwf_cmd_send() - WMI set bwf function + * @param wmi_handle : handle to WMI. + * @param param : pointer to set bwf param + * + * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_set_bwf_cmd_send(void *wmi_hdl, + struct set_bwf_params *param) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_set_bwf_cmd) + return wmi_handle->ops->send_set_bwf_cmd(wmi_handle, param); + + return QDF_STATUS_E_FAILURE; +} + /** * wmi_unified_set_atf_cmd_send() - WMI set atf function * @param wmi_handle : handle to WMI. diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index 0cb850ba577b..499c39f32bd7 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -3140,6 +3140,49 @@ send_pdev_get_tpc_config_cmd_non_tlv(wmi_unified_t wmi_handle, WMI_PDEV_GET_TPC_CONFIG_CMDID); } +/** + * send_set_bwf_cmd_non_tlv() - send set bwf command to fw + * @wmi_handle: wmi handle + * @param: pointer to set bwf param + * + * Return: 0 for success or error code + */ +QDF_STATUS +send_set_bwf_cmd_non_tlv(wmi_unified_t wmi_handle, + struct set_bwf_params *param) +{ + struct wmi_bwf_peer_info *peer_info; + wmi_peer_bwf_request *cmd; + wmi_buf_t buf; + int len = sizeof(wmi_peer_bwf_request); + int i, retval = 0; + + len += param->num_peers * sizeof(struct wmi_bwf_peer_info); + buf = wmi_buf_alloc(wmi_handle, len); + if (!buf) { + qdf_print("%s:wmi_buf_alloc failed\n", __func__); + return QDF_STATUS_E_FAILURE; + } + cmd = (wmi_peer_bwf_request *)wmi_buf_data(buf); + qdf_mem_copy((void *)&(cmd->num_peers), + (void *)&(param->num_peers), + sizeof(u_int32_t)); + peer_info = (struct wmi_bwf_peer_info *)&(cmd->peer_info[0]); + for (i = 0; i < param->num_peers; i++) { + qdf_mem_copy((void *)&(peer_info[i]), + (void *)&(param->peer_info[i]), + sizeof(struct wmi_bwf_peer_info)); + } + + retval = wmi_unified_cmd_send(wmi_handle, buf, len, + WMI_PEER_BWF_REQUEST_CMDID); + + if (retval) + wmi_buf_free(buf); + + return retval; +} + /** * send_set_atf_cmd_non_tlv() - send set atf command to fw * @wmi_handle: wmi handle @@ -7207,6 +7250,7 @@ struct wmi_ops non_tlv_ops = { .send_scan_chan_list_cmd = send_scan_chan_list_cmd_non_tlv, .send_pdev_get_tpc_config_cmd = send_pdev_get_tpc_config_cmd_non_tlv, .send_set_atf_cmd = send_set_atf_cmd_non_tlv, + .send_set_bwf_cmd = send_set_bwf_cmd_non_tlv, .send_pdev_fips_cmd = send_pdev_fips_cmd_non_tlv, .send_wlan_profile_enable_cmd = send_wlan_profile_enable_cmd_non_tlv, .send_wlan_profile_trigger_cmd = send_wlan_profile_trigger_cmd_non_tlv, From bcb90fbcfb04f9050d0abe5ae5726df90188b12a Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 31 Aug 2016 06:28:05 -0700 Subject: [PATCH 05/12] Release 5.1.0.23A Release 5.1.0.23A Change-Id: Ib952643aa117eee548bc3b4423cbf3d5e4d2e43d CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 7fddbef4ef4b..fa01472f4e44 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23 +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23A Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From cc277f9791fab6a04f01a49dad09ee94451f279b Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Mon, 8 Aug 2016 19:07:00 +0530 Subject: [PATCH 06/12] qcacmn: Free WMI HB command buffer in case of errors WMI HB command buffer is not freed in case of tx error, Free WMI HB command buffer in case of errors. Propagation from qcacld-2.0 to qcacmn. Change-Id: I15577c50cefc0cc2e9129f175cf874f17acc430e CRs-Fixed: 1001068 --- wmi/src/wmi_unified_tlv.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index f709315bda70..a81d462398cc 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -6372,6 +6372,7 @@ QDF_STATUS send_lphb_config_tcp_params_cmd_tlv(wmi_unified_t wmi_handle, if (QDF_IS_STATUS_ERROR(status)) { WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_TCP_PARAMS returned Error %d", status); + wmi_buf_free(buf); } return status; @@ -6421,6 +6422,7 @@ QDF_STATUS send_lphb_config_tcp_pkt_filter_cmd_tlv(wmi_unified_t wmi_handle, if (QDF_IS_STATUS_ERROR(status)) { WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_TCP_PKT_FILTER returned Error %d", status); + wmi_buf_free(buf); } return status; @@ -6470,9 +6472,11 @@ QDF_STATUS send_lphb_config_udp_params_cmd_tlv(wmi_unified_t wmi_handle, status = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_HB_SET_UDP_PARAMS_CMDID); - if (QDF_IS_STATUS_ERROR(status)) + if (QDF_IS_STATUS_ERROR(status)) { WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_UDP_PARAMS returned Error %d", status); + wmi_buf_free(buf); + } return status; } @@ -6518,9 +6522,11 @@ QDF_STATUS send_lphb_config_udp_pkt_filter_cmd_tlv(wmi_unified_t wmi_handle, status = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_HB_SET_UDP_PKT_FILTER_CMDID); - if (QDF_IS_STATUS_ERROR(status)) + if (QDF_IS_STATUS_ERROR(status)) { WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_UDP_PKT_FILTER returned Error %d", status); + wmi_buf_free(buf); + } return status; } @@ -6566,9 +6572,11 @@ QDF_STATUS send_process_dhcp_ind_cmd_tlv(wmi_unified_t wmi_handle, status = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_PEER_SET_PARAM_CMDID); - if (QDF_IS_STATUS_ERROR(status)) + if (QDF_IS_STATUS_ERROR(status)) { WMI_LOGE("%s: wmi_unified_cmd_send WMI_PEER_SET_PARAM_CMD" " returned Error %d", __func__, status); + wmi_buf_free(buf); + } return status; } From 6a9cf7bd168d2dc4ac17c0cdb55784ddc46134a7 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 31 Aug 2016 07:06:48 -0700 Subject: [PATCH 07/12] Release 5.1.0.23B Release 5.1.0.23B Change-Id: I22928dea7a4756d49fc83310d58a0163665bf188 CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa01472f4e44..f4848d243291 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23A +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23B Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From fa291a78517fb94e5397d755281693356603e950 Mon Sep 17 00:00:00 2001 From: Venkateswara Swamy Bandaru Date: Thu, 28 Jul 2016 18:55:23 +0530 Subject: [PATCH 08/12] qcacmn: Fix for kernel panic in wifi down path for peregrine Warm reset is done in wifi down path for peregrine Change-Id: Id187b8e60859f9936e4761bdce9ae7f744bd79d7 --- hif/src/hif_hw_version.h | 1 + hif/src/pcie/hif_io32_pci.h | 2 ++ hif/src/pcie/if_pci.c | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/hif/src/hif_hw_version.h b/hif/src/hif_hw_version.h index 7630776e260f..c60db25aec79 100644 --- a/hif/src/hif_hw_version.h +++ b/hif/src/hif_hw_version.h @@ -31,6 +31,7 @@ #define AR6004_VERSION_REV1_3 0x31c8088a #define AR9888_REV2_VERSION 0x4100016c +#define AR9887_REV1_VERSION 0x4100016d #define AR6320_REV1_VERSION 0x5000000 #define AR6320_REV1_1_VERSION 0x5000001 #define AR6320_REV1_3_VERSION 0x5000003 diff --git a/hif/src/pcie/hif_io32_pci.h b/hif/src/pcie/hif_io32_pci.h index ce2c22faa246..d1bf2759acde 100644 --- a/hif/src/pcie/hif_io32_pci.h +++ b/hif/src/pcie/hif_io32_pci.h @@ -39,7 +39,9 @@ * For maximum performance and no power management, set this to 1. * For power management at the cost of performance, set this to 0. */ +#ifndef CONFIG_ATH_PCIE_MAX_PERF #define CONFIG_ATH_PCIE_MAX_PERF 0 +#endif /* * For keeping the target awake till the driver is diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index a37d5f3c66a7..1b124fdf99f1 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -2417,6 +2417,7 @@ void hif_pci_disable_bus(struct hif_softc *scn) struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); struct pci_dev *pdev; void __iomem *mem; + struct hif_target_info *tgt_info = &scn->target_info; /* Attach did not succeed, all resources have been * freed in error handler @@ -2431,7 +2432,18 @@ void hif_pci_disable_bus(struct hif_softc *scn) HOST_GROUP0_MASK); } +#if defined(CPU_WARM_RESET_WAR) + /* Currently CPU warm reset sequence is tested only for AR9888_REV2 + * Need to enable for AR9888_REV1 once CPU warm reset sequence is + * verified for AR9888_REV1 + */ + if ((tgt_info->target_version == AR9888_REV2_VERSION) || (tgt_info->target_version == AR9887_REV1_VERSION)) + hif_pci_device_warm_reset(sc); + else + hif_pci_device_reset(sc); +#else hif_pci_device_reset(sc); +#endif mem = (void __iomem *)sc->mem; if (mem) { pci_disable_msi(pdev); From 50a5518cd64e959e5f1703d9cfa90219951b02b3 Mon Sep 17 00:00:00 2001 From: Sathish Kumar Date: Wed, 27 Jul 2016 12:13:02 +0530 Subject: [PATCH 09/12] qcacmn: Fixing incorrect qdf_mem_set API usage in wmi_unified_non_tlv.c The qdf_mem_set API is used incorrectly in a few instances inside wmi_unified_non_tlv.c The argument list is - However, some places, it is sent as - This change fixes such incorrect function calls to qdf_mem_set(). Change-Id: Id50136f630022b1fdeaddbdefcad9f637f917e9e CRs-Fixed: 1048504 --- wmi/src/wmi_unified_non_tlv.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index 499c39f32bd7..aac8757571e3 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -4471,7 +4471,7 @@ send_rtt_meas_req_test_cmd_non_tlv(wmi_unified_t wmi_handle, } p = (u_int8_t *) wmi_buf_data(buf); - qdf_mem_set(p, 0, len); + qdf_mem_set(p, len, 0); head = (wmi_rtt_measreq_head *) p; WMI_RTT_REQ_ID_SET(head->req_id, param->req_id); @@ -4609,7 +4609,7 @@ send_rtt_meas_req_cmd_non_tlv(wmi_unified_t wmi_handle, } p = (uint8_t *) wmi_buf_data(buf); - qdf_mem_set(p, 0, len); + qdf_mem_set(p, len, 0); /* encode header */ head = (wmi_rtt_measreq_head *) p; @@ -4679,7 +4679,7 @@ send_rtt_meas_req_cmd_non_tlv(wmi_unified_t wmi_handle, WMI_SET_CHANNEL_FLAG(w_chan, WMI_CHAN_FLAG_DFS); WMI_CHAR_ARRAY_TO_MAC_ADDR(((uint8_t *)peer), &body->dest_mac); - qdf_mem_set(spoof, 0 , 6); + qdf_mem_set(spoof, IEEE80211_ADDR_LEN, 0); WMI_CHAR_ARRAY_TO_MAC_ADDR(((uint8_t *)param->spoof_mac_addr), &body->spoof_bssid); @@ -4777,7 +4777,7 @@ send_lci_set_cmd_non_tlv(wmi_unified_t wmi_handle, } p = (uint8_t *) wmi_buf_data(buf); - qdf_mem_set(p, 0, len); + qdf_mem_set(p, len, 0); head = (wmi_oem_measreq_head *)p; head->sub_type = TARGET_OEM_CONFIGURE_LCI; @@ -4847,7 +4847,7 @@ send_lcr_set_cmd_non_tlv(wmi_unified_t wmi_handle, } p = (uint8_t *) wmi_buf_data(buf); - qdf_mem_set(p, 0, len); + qdf_mem_set(p, len, 0); head = (wmi_oem_measreq_head *)p; head->sub_type = TARGET_OEM_CONFIGURE_LCR; From 59471382375e3d6f264c5180c9204f2365bf2eaa Mon Sep 17 00:00:00 2001 From: Sathish Kumar Date: Wed, 31 Aug 2016 16:01:57 +0530 Subject: [PATCH 10/12] qcacmn: Implement QDF API to get queue mapping and total ram size This change adds the following QDF APIs - qdf_nbuf_get_queue_mapping: To get the queue mapping set by linux kernel qdf_get_totalramsize: To get total ram size in Kb Change-Id: I86daffebba759c086d15951dfcc72ea626c74bb4 CRs-Fixed: 1055387 --- qdf/inc/qdf_nbuf.h | 6 ++++++ qdf/inc/qdf_util.h | 5 +++++ qdf/linux/src/i_qdf_nbuf.h | 12 ++++++++++++ qdf/linux/src/i_qdf_util.h | 16 ++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/qdf/inc/qdf_nbuf.h b/qdf/inc/qdf_nbuf.h index 3221164012fc..505d084385bd 100644 --- a/qdf/inc/qdf_nbuf.h +++ b/qdf/inc/qdf_nbuf.h @@ -2041,6 +2041,12 @@ static inline void qdf_nbuf_set_priority(qdf_nbuf_t buf, uint32_t p) __qdf_nbuf_set_priority(buf, p); } +static inline uint16_t +qdf_nbuf_get_queue_mapping(qdf_nbuf_t buf) +{ + return __qdf_nbuf_get_queue_mapping(buf); +} + static inline uint8_t * qdf_nbuf_get_priv_ptr(qdf_nbuf_t buf) { diff --git a/qdf/inc/qdf_util.h b/qdf/inc/qdf_util.h index 44d0450264a4..a80df5bb44dc 100644 --- a/qdf/inc/qdf_util.h +++ b/qdf/inc/qdf_util.h @@ -433,5 +433,10 @@ static inline int qdf_device_init_wakeup(qdf_device_t qdf_dev, bool enable) return __qdf_device_init_wakeup(qdf_dev, enable); } +static inline +uint64_t qdf_get_totalramsize(void) +{ + return __qdf_get_totalramsize(); +} #endif /*_QDF_UTIL_H*/ diff --git a/qdf/linux/src/i_qdf_nbuf.h b/qdf/linux/src/i_qdf_nbuf.h index 050f73cc37ec..404275cda581 100644 --- a/qdf/linux/src/i_qdf_nbuf.h +++ b/qdf/linux/src/i_qdf_nbuf.h @@ -1670,4 +1670,16 @@ __qdf_nbuf_mark_wakeup_frame(__qdf_nbuf_t buf) buf->mark |= QDF_MARK_FIRST_WAKEUP_PACKET; } +/** + * __qdf_nbuf_get_queue_mapping() - get the queue mapping set by linux kernel + * + * @buf: sk buff + * + * Return: Queue mapping + */ +static inline uint16_t +__qdf_nbuf_get_queue_mapping(struct sk_buff *skb) +{ + return skb->queue_mapping; +} #endif /*_I_QDF_NET_BUF_H */ diff --git a/qdf/linux/src/i_qdf_util.h b/qdf/linux/src/i_qdf_util.h index 9894e1c2a368..a496573e46f9 100644 --- a/qdf/linux/src/i_qdf_util.h +++ b/qdf/linux/src/i_qdf_util.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -195,6 +196,8 @@ static inline bool __qdf_is_macaddr_equal(struct qdf_mac_addr *mac_addr1, #define __qdf_min(_a, _b) ((_a) < (_b) ? _a : _b) #define __qdf_max(_a, _b) ((_a) > (_b) ? _a : _b) +#define MEMINFO_KB(x) ((x) << (PAGE_SHIFT - 10)) /* In kilobytes */ + /** * @brief Assert */ @@ -276,4 +279,17 @@ static inline int __qdf_device_init_wakeup(__qdf_device_t qdf_dev, bool enable) return device_init_wakeup(qdf_dev->dev, enable); } +/** + * __qdf_get_totalramsize() - Get total ram size in Kb + * + * Return: Total ram size in Kb + */ +static inline uint64_t +__qdf_get_totalramsize(void) +{ + struct sysinfo meminfo; + si_meminfo(&meminfo); + return MEMINFO_KB(meminfo.totalram); +} + #endif /*_I_QDF_UTIL_H*/ From e28261fdb1d58257333033b7c56b7bdd562b0780 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 1 Sep 2016 13:27:56 -0700 Subject: [PATCH 11/12] Release 5.1.0.23C Release 5.1.0.23C Change-Id: If129b9c75ac642a1bbd65ad58fda1ec051e509cb CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index f4848d243291..463a8da44682 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23B +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23C Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 7fdff0c52f98ce6b49fbf8b3b5572b5b2d5a91d5 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Mon, 29 Aug 2016 12:31:58 -0700 Subject: [PATCH 12/12] qcacmn: Use suspend_noirq callback instead of disabling irqs Disabling the interrupts and setting them as wakeup sources does not work as expected. The pending interrupt gets trapped in sw and kernel does not check for it before finishing the suspend. Instead, use the suspend_noirq callback to guarantee that wakeup messages don't get processed without rejecting the suspend. Change-Id: I5ec5ce2a7e1b14c3d8477fe7aa0372c9ffd4dc0d CRs-Fixed: 1060880 --- hif/inc/hif.h | 2 + hif/src/dispatcher/dummy.c | 28 ++++++++ hif/src/dispatcher/dummy.h | 2 + hif/src/dispatcher/multibus.c | 18 ++++- hif/src/dispatcher/multibus.h | 2 + hif/src/dispatcher/multibus_snoc.c | 3 + hif/src/dispatcher/snoc_api.h | 1 + hif/src/snoc/if_snoc.c | 107 +++++------------------------ 8 files changed, 72 insertions(+), 91 deletions(-) diff --git a/hif/inc/hif.h b/hif/inc/hif.h index 5b24ef8a64e6..9e6ddb439e0c 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -573,6 +573,8 @@ bool hif_can_suspend_link(struct hif_opaque_softc *); int hif_bus_resume(struct hif_opaque_softc *); int hif_bus_suspend(struct hif_opaque_softc *); +int hif_bus_resume_noirq(struct hif_opaque_softc *); +int hif_bus_suspend_noirq(struct hif_opaque_softc *); #ifdef FEATURE_RUNTIME_PM int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx); diff --git a/hif/src/dispatcher/dummy.c b/hif/src/dispatcher/dummy.c index e9362f96d5ef..1690e058d8de 100644 --- a/hif/src/dispatcher/dummy.c +++ b/hif/src/dispatcher/dummy.c @@ -83,6 +83,34 @@ int hif_dummy_bus_resume(struct hif_softc *hif_ctx) return 0; } +/** + * hif_dummy_suspend_noirq() - suspend the bus + * @hif_ctx: hif context + * + * dummy for busses that don't need to syncronize + * with interrupt disable. + * + * Return: 0 for success and non-zero for failure + */ +int hif_dummy_bus_suspend_noirq(struct hif_softc *hif_ctx) +{ + return 0; +} + +/** + * hif_dummy_resume_noirq() - resume the bus + * @hif_ctx: hif context + * + * dummy for busses that don't need to syncronize + * with interrupt disable. + * + * Return: 0 for success and non-zero for failure + */ +int hif_dummy_bus_resume_noirq(struct hif_softc *hif_ctx) +{ + return 0; +} + /** * hif_dummy_target_sleep_state_adjust() - api to adjust state of target * @scn: hif context diff --git a/hif/src/dispatcher/dummy.h b/hif/src/dispatcher/dummy.h index 049fa1a5333c..b531c1dd4e5b 100644 --- a/hif/src/dispatcher/dummy.h +++ b/hif/src/dispatcher/dummy.h @@ -30,6 +30,8 @@ void hif_dummy_bus_prevent_linkdown(struct hif_softc *scn, bool flag); void hif_dummy_reset_soc(struct hif_softc *scn); int hif_dummy_bus_suspend(struct hif_softc *hif_ctx); int hif_dummy_bus_resume(struct hif_softc *hif_ctx); +int hif_dummy_bus_suspend_noirq(struct hif_softc *hif_ctx); +int hif_dummy_bus_resume_noirq(struct hif_softc *hif_ctx); int hif_dummy_target_sleep_state_adjust(struct hif_softc *scn, bool sleep_ok, bool wait_for_it); void hif_dummy_enable_power_management(struct hif_softc *hif_ctx, diff --git a/hif/src/dispatcher/multibus.c b/hif/src/dispatcher/multibus.c index 416d997a5b4d..5643b6f05715 100644 --- a/hif/src/dispatcher/multibus.c +++ b/hif/src/dispatcher/multibus.c @@ -55,8 +55,10 @@ static void hif_intialize_default_ops(struct hif_softc *hif_sc) &hif_dummy_display_stats; bus_ops->hif_clear_stats = &hif_dummy_clear_stats; - bus_ops->hif_set_bundle_mode = hif_dummy_set_bundle_mode; - bus_ops->hif_bus_reset_resume = hif_dummy_bus_reset_resume; + bus_ops->hif_set_bundle_mode = &hif_dummy_set_bundle_mode; + bus_ops->hif_bus_reset_resume = &hif_dummy_bus_reset_resume; + bus_ops->hif_bus_suspend_noirq = &hif_dummy_bus_suspend_noirq; + bus_ops->hif_bus_resume_noirq = &hif_dummy_bus_resume_noirq; } #define NUM_OPS (sizeof(struct hif_bus_ops) / sizeof(void *)) @@ -195,6 +197,18 @@ int hif_bus_resume(struct hif_opaque_softc *hif_ctx) return hif_sc->bus_ops.hif_bus_resume(hif_sc); } +int hif_bus_suspend_noirq(struct hif_opaque_softc *hif_ctx) +{ + struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); + return hif_sc->bus_ops.hif_bus_suspend_noirq(hif_sc); +} + +int hif_bus_resume_noirq(struct hif_opaque_softc *hif_ctx) +{ + struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); + return hif_sc->bus_ops.hif_bus_resume_noirq(hif_sc); +} + int hif_target_sleep_state_adjust(struct hif_softc *hif_sc, bool sleep_ok, bool wait_for_it) { diff --git a/hif/src/dispatcher/multibus.h b/hif/src/dispatcher/multibus.h index 71b7a3c76bd7..63423630c1da 100644 --- a/hif/src/dispatcher/multibus.h +++ b/hif/src/dispatcher/multibus.h @@ -42,6 +42,8 @@ struct hif_bus_ops { void (*hif_reset_soc)(struct hif_softc *hif_sc); int (*hif_bus_suspend)(struct hif_softc *hif_ctx); int (*hif_bus_resume)(struct hif_softc *hif_ctx); + int (*hif_bus_suspend_noirq)(struct hif_softc *hif_ctx); + int (*hif_bus_resume_noirq)(struct hif_softc *hif_ctx); int (*hif_target_sleep_state_adjust)(struct hif_softc *scn, bool sleep_ok, bool wait_for_it); void (*hif_disable_isr)(struct hif_softc *hif_sc); diff --git a/hif/src/dispatcher/multibus_snoc.c b/hif/src/dispatcher/multibus_snoc.c index ae292709fecd..2dc80d62e6b4 100644 --- a/hif/src/dispatcher/multibus_snoc.c +++ b/hif/src/dispatcher/multibus_snoc.c @@ -47,6 +47,9 @@ QDF_STATUS hif_initialize_snoc_ops(struct hif_bus_ops *bus_ops) bus_ops->hif_reset_soc = &hif_dummy_reset_soc; bus_ops->hif_bus_suspend = &hif_snoc_bus_suspend; bus_ops->hif_bus_resume = &hif_snoc_bus_resume; + bus_ops->hif_bus_suspend_noirq = &hif_snoc_bus_suspend_noirq; + /* snoc_bus_resume_noirq had no side effects, use dummy resume_noirq */ + bus_ops->hif_bus_resume_noirq = &hif_dummy_bus_resume_noirq; bus_ops->hif_target_sleep_state_adjust = &hif_dummy_target_sleep_state_adjust; diff --git a/hif/src/dispatcher/snoc_api.h b/hif/src/dispatcher/snoc_api.h index 813171f119dd..06fc43d5aefd 100644 --- a/hif/src/dispatcher/snoc_api.h +++ b/hif/src/dispatcher/snoc_api.h @@ -32,6 +32,7 @@ QDF_STATUS hif_snoc_open(struct hif_softc *hif_ctx, void hif_snoc_close(struct hif_softc *hif_ctx); int hif_snoc_bus_suspend(struct hif_softc *hif_ctx); int hif_snoc_bus_resume(struct hif_softc *hif_ctx); +int hif_snoc_bus_suspend_noirq(struct hif_softc *scn); void hif_snoc_disable_isr(struct hif_softc *hif_ctx); void hif_snoc_nointrs(struct hif_softc *scn); QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc, diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c index 77bc554936d7..201eb7c8fd8d 100644 --- a/hif/src/snoc/if_snoc.c +++ b/hif/src/snoc/if_snoc.c @@ -380,75 +380,6 @@ QDF_STATUS hif_snoc_setup_wakeup_sources(struct hif_softc *scn, bool enable) return QDF_STATUS_SUCCESS; } -/** - * __hif_snoc_irq_state_vote() - enable/disable all the ce interrupts - * @scn: hif context pointer - * @enble: true to enable the interrupts false to disable - * - * takes care of unwinding partial successes. - * - * Return: QDF_STATUS_SUCCESS on success - */ - -static QDF_STATUS __hif_snoc_irq_state_vote(struct hif_softc *scn, bool enable) -{ - int num_ce = scn->ce_count; - int ce_id = 0; - int irq; - - while (ce_id < num_ce) { - irq = icnss_get_irq(ce_id); - if (irq < 0) - goto error; - - if (enable) - enable_irq(irq); - else - disable_irq(irq); - - ce_id++; - } - - return QDF_STATUS_SUCCESS; - -error: - HIF_ERROR("%s: failed to map ce to irq", __func__); - - while (--ce_id >= 0) { - irq = icnss_get_irq(ce_id); - if (irq < 0) - continue; - - if (enable) - disable_irq(irq); - else - enable_irq(irq); - } - return QDF_STATUS_E_FAULT; -} - -/** - * hif_snoc_enable_irqs() - enable the ce irqs - * @scn: hif context - * - * Return: QDF_STATUS_SUCCESS on success - */ -static QDF_STATUS hif_snoc_enable_irqs(struct hif_softc *scn) -{ - return __hif_snoc_irq_state_vote(scn, true); -} - -/** - * hif_snoc_enable_irqs() - enable the ce irqs - * @scn: hif context - * - * Return: QDF_STATUS_SUCCESS on success - */ -static QDF_STATUS hif_snoc_disable_irqs(struct hif_softc *scn) -{ - return __hif_snoc_irq_state_vote(scn, false); -} - /** * hif_snoc_bus_suspend() - prepare to suspend the bus * @scn: hif context @@ -463,24 +394,8 @@ static QDF_STATUS hif_snoc_disable_irqs(struct hif_softc *scn) int hif_snoc_bus_suspend(struct hif_softc *scn) { if (hif_snoc_setup_wakeup_sources(scn, true) != QDF_STATUS_SUCCESS) - goto error; - - if (hif_snoc_disable_irqs(scn) != QDF_STATUS_SUCCESS) - goto wakeup_sources; - - if (hif_drain_tasklets(scn) != 0) - goto enable_irqs; + return -EFAULT; return 0; - -enable_irqs: - if (hif_snoc_enable_irqs(scn) != QDF_STATUS_SUCCESS) - QDF_BUG(0); -wakeup_sources: - if (hif_snoc_setup_wakeup_sources(scn, false) != QDF_STATUS_SUCCESS) - QDF_BUG(0); -error: - return -EFAULT; - } /** @@ -497,8 +412,22 @@ int hif_snoc_bus_resume(struct hif_softc *scn) if (hif_snoc_setup_wakeup_sources(scn, false) != QDF_STATUS_SUCCESS) QDF_BUG(0); - if (hif_snoc_enable_irqs(scn) != QDF_STATUS_SUCCESS) - QDF_BUG(0); - return 0; } + +/** + * hif_snoc_bus_suspend_noirq() - ensure there are no pending transactions + * @scn: hif context + * + * Ensure that if we recieved the wakeup message before the irq + * was disabled that the message is pocessed before suspending. + * + * Return: -EBUSY if we fail to flush the tasklets. + */ +int hif_snoc_bus_suspend_noirq(struct hif_softc *scn) +{ + if (hif_drain_tasklets(scn) != 0) + return -EBUSY; + return 0; +} +