From edc1f370b3d64ee85bb6c7bf8acb210fdc61c52f Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Thu, 21 Jul 2016 15:02:44 -0700 Subject: [PATCH 01/17] qcacmn: Correct len size of oem data request qcacld-2.0 to qcacmn propagation. oem data request len size should be of 4 byte instead of 1 byte. Add changes to correct len size in wmi unified API. Change-Id: I9b377420c50ff1160964f94be5eaa0072df0f63d CRs-Fixed: 1013488 --- wmi/inc/wmi_unified_api.h | 2 +- wmi/inc/wmi_unified_priv.h | 2 +- wmi/inc/wmi_unified_tlv.h | 2 +- wmi/src/wmi_unified_api.c | 2 +- wmi/src/wmi_unified_tlv.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 1bd40a0325b0..55951f42f034 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -629,7 +629,7 @@ QDF_STATUS wmi_unified_nat_keepalive_en_cmd(void *wmi_hdl, uint8_t vdev_id); QDF_STATUS wmi_unified_csa_offload_enable(void *wmi_hdl, uint8_t vdev_id); QDF_STATUS wmi_unified_start_oem_data_cmd(void *wmi_hdl, - uint8_t data_len, + uint32_t data_len, uint8_t *data); QDF_STATUS wmi_unified_dfs_phyerr_filter_offload_en_cmd(void *wmi_hdl, diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 69c16abc5825..bae209b3a7a3 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -518,7 +518,7 @@ QDF_STATUS (*send_wow_sta_ra_filter_cmd)(wmi_unified_t wmi_handle, QDF_STATUS (*send_nat_keepalive_en_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id); QDF_STATUS (*send_start_oem_data_cmd)(wmi_unified_t wmi_handle, - uint8_t data_len, + uint32_t data_len, uint8_t *data); QDF_STATUS diff --git a/wmi/inc/wmi_unified_tlv.h b/wmi/inc/wmi_unified_tlv.h index aa5a959a9c0e..5de7bae37952 100644 --- a/wmi/inc/wmi_unified_tlv.h +++ b/wmi/inc/wmi_unified_tlv.h @@ -364,7 +364,7 @@ QDF_STATUS send_csa_offload_enable_cmd_tlv(wmi_unified_t wmi_handle, uint8_t vdev_id); QDF_STATUS send_start_oem_data_cmd_tlv(wmi_unified_t wmi_handle, - uint8_t data_len, + uint32_t data_len, uint8_t *data); QDF_STATUS diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 462f4f6945c8..f9b5884d97d9 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -2264,7 +2264,7 @@ QDF_STATUS wmi_unified_csa_offload_enable(void *wmi_hdl, uint8_t vdev_id) * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ QDF_STATUS wmi_unified_start_oem_data_cmd(void *wmi_hdl, - uint8_t data_len, + uint32_t data_len, uint8_t *data) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index ba67a6ecf47c..76287d8745c1 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -6774,7 +6774,7 @@ QDF_STATUS send_csa_offload_enable_cmd_tlv(wmi_unified_t wmi_handle, * Return: CDF status */ QDF_STATUS send_start_oem_data_cmd_tlv(wmi_unified_t wmi_handle, - uint8_t data_len, + uint32_t data_len, uint8_t *data) { wmi_buf_t buf; From 16546b6a57baa9d3567556057ee8d132fe7d26d0 Mon Sep 17 00:00:00 2001 From: Vishwajith Upendra Date: Fri, 29 Jul 2016 18:15:30 -0700 Subject: [PATCH 02/17] Release 5.1.0.22E Release 5.1.0.22E Change-Id: I50003e8fd2ce390cbfa4648b7aab2d391b7a798b CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 3be76e56e577..0077bdb6ecf7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22D +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22E Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 9ff543f7db3f4cfe90c346f9f62fd2f66972cbaa Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Thu, 21 Jul 2016 17:25:55 +0530 Subject: [PATCH 03/17] qcacmn: CL 1597848 - update fw common interface files Propagation from qcacld-2.0 to qcacld-3.0 Adding WMI defs for pdev and peer GET_ANTDIV_STATUS_CMD, ANTDIV_INFO_EVENT msgs. Change-Id: Iad3c57f0b4e10e68c86cef175b8cadcfd9e7fe1e CRs-fixed: 865207 --- wmi/src/wmi_unified.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index fe17c5974678..1804b44bdd29 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1581,6 +1581,8 @@ static uint8_t *wmi_id_to_name(WMI_CMD_ID wmi_command) CASE_RETURN_STRING(WMI_PDEV_SET_REORDER_TIMEOUT_VAL_CMDID); CASE_RETURN_STRING(WMI_PEER_SET_RX_BLOCKSIZE_CMDID); CASE_RETURN_STRING(WMI_PDEV_SET_WAKEUP_CONFIG_CMDID); + CASE_RETURN_STRING(WMI_PDEV_GET_ANTDIV_STATUS_CMDID); + CASE_RETURN_STRING(WMI_PEER_ANTDIV_INFO_REQ_CMDID); } return "Invalid WMI cmd"; From b9a7e4cedd7dcafcd410d901920aaff4e08255db Mon Sep 17 00:00:00 2001 From: Vishwajith Upendra Date: Mon, 1 Aug 2016 16:31:48 -0700 Subject: [PATCH 04/17] Release 5.1.0.22F Release 5.1.0.22F Change-Id: Icf0c1acb7c0428b37ff434dd4dad061b525a9143 CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 0077bdb6ecf7..1db809b91645 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22E +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22F Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 66597e4cc5ae3e55d6454b4205413fb7715ac12b Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Thu, 26 May 2016 18:57:46 +0530 Subject: [PATCH 05/17] qcacmn: Remove unnecessary locking during WMI detach HOST driver unload sequence does following 1) Kill WLAN tasklet 2) Disable CE interrupts 3) Flush WMI RX work Hence its unncessory to acquire eventq_lock as no one will be using the shared resource during wmi detach. Change-Id: I5c549358aeefc460c794c35659915d3b966c7350 CRs-Fixed: 1021376 --- wmi/src/wmi_unified.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 1804b44bdd29..26006ab06b49 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -2221,7 +2221,6 @@ void wmi_unified_detach(struct wmi_unified *wmi_handle) wmi_debugfs_remove(wmi_handle); - qdf_spin_lock_bh(&wmi_handle->eventq_lock); buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); while (buf) { qdf_nbuf_free(buf); @@ -2232,7 +2231,6 @@ void wmi_unified_detach(struct wmi_unified *wmi_handle) wmi_log_buffer_free(wmi_handle); #endif - qdf_spin_unlock_bh(&wmi_handle->eventq_lock); qdf_spinlock_destroy(&wmi_handle->eventq_lock); qdf_spinlock_destroy(&wmi_handle->ctx_lock); OS_FREE(wmi_handle); From 3e52419f67fd59495297a1a9feea58c33a3f83d6 Mon Sep 17 00:00:00 2001 From: Vishwajith Upendra Date: Mon, 1 Aug 2016 23:42:26 -0700 Subject: [PATCH 06/17] Release 5.1.0.22G Release 5.1.0.22G Change-Id: I5ff8dc9120d9799066ee464e2e462d53a980cabe CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 1db809b91645..90f88997a721 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22F +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22G Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 5bac30f5e6052417b3294707f6bdda9d32985dfa Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 14 Jul 2016 17:31:29 -0700 Subject: [PATCH 07/17] qcacmn: Add unit test framework to validate WLAN suspend/resume features WLAN suspend/resume feature has tight dependency on APPS platform suspend/resume support. On new targets APPS suspend/resume is not supported until target is feature complete. In absence of APPS suspend/resume support testing WLAN offload features become difficult. Add unit test framework to test WLAN suspend/resume features using private IOCTL command by simulating APPS suspend/resume behaviour. Trigger WLAN suspend: iwpriv wlan0 wlan_suspend 0 0 To resume WLAN run a ping test from access point side and very 1st ping request unicast packet should trigger wake up. If FW is not waking up APPS then use below command to do a manual wake up: Trigger WLAN resume: iwpriv wlan0 wlan_resume 0 0 This framework is only for SNOC platform. Change-Id: I177a0047f460aa2a305a9e4e46fbfaa94a81dced CRs-Fixed: 1042205 --- hif/inc/hif.h | 5 ++++ hif/src/ce/ce_tasklet.c | 62 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/hif/inc/hif.h b/hif/inc/hif.h index b6db21d98fbc..d30de2d75ec4 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -615,6 +615,11 @@ uint32_t hif_set_nss_wifiol_mode(struct hif_opaque_softc *osc, int32_t hif_get_nss_wifiol_bypass_nw_process(struct hif_opaque_softc *osc); #endif +#ifdef WLAN_SUSPEND_RESUME_TEST +typedef void (*hdd_fake_resume_callback)(uint32_t val); +void hif_fake_apps_suspend(hdd_fake_resume_callback callback); +#endif + #ifdef __cplusplus } #endif diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c index f393f3f7dae6..27bfba18b3ab 100644 --- a/hif/src/ce/ce_tasklet.c +++ b/hif/src/ce/ce_tasklet.c @@ -243,6 +243,61 @@ void ce_tasklet_kill(struct hif_softc *scn) qdf_atomic_set(&scn->active_tasklet_cnt, 0); } +#ifdef WLAN_SUSPEND_RESUME_TEST +static bool g_hif_apps_fake_suspended; +static hdd_fake_resume_callback hdd_fake_aps_resume; + +static void hif_wlan_resume_work_handler(struct work_struct *work) +{ + hdd_fake_aps_resume(0); +} + +static DECLARE_WORK(hif_resume_work, hif_wlan_resume_work_handler); + +/** + * hif_fake_apps_suspend(): Suspend WLAN + * + * Set the fake suspend flag such that hif knows that it will need + * to fake the aps resume process using the hdd_fake_aps_resume + * + * Return: none + */ +void hif_fake_apps_suspend(hdd_fake_resume_callback callback) +{ + hdd_fake_aps_resume = callback; + g_hif_apps_fake_suspended = true; +} + +/** + * hif_fake_aps_resume(): check if WLAN resume is needed + * + * Return: true if a fake apps resume has been been triggered + * returns false if regular interrupt processing is needed + */ +static bool hif_fake_aps_resume(void) +{ + if (g_hif_apps_fake_suspended) { + g_hif_apps_fake_suspended = false; + schedule_work(&hif_resume_work); + return true; + } else { + return false; + } +} + +#else + +/** + * hif_fake_aps_resume(): check if WLAN resume is needed + * + * Return: always false if WLAN_SUSPEND_RESUME_TEST is not defined + */ +static bool hif_fake_aps_resume(void) +{ + return false; +} +#endif /* End of WLAN_SUSPEND_RESUME_TEST */ + /** * hif_snoc_interrupt_handler() - hif_snoc_interrupt_handler * @irq: irq coming from kernel @@ -341,6 +396,13 @@ irqreturn_t ce_dispatch_interrupt(int ce_id, qdf_atomic_inc(&scn->active_tasklet_cnt); hif_record_ce_desc_event(scn, ce_id, HIF_IRQ_EVENT, NULL, NULL, 0); hif_ce_increment_interrupt_count(hif_ce_state, ce_id); + + if (unlikely(hif_fake_aps_resume())) { + HIF_ERROR("received resume interrupt"); + hif_irq_enable(scn, ce_id); + return IRQ_HANDLED; + } + if (hif_napi_enabled(hif_hdl, ce_id)) hif_napi_schedule(hif_hdl, ce_id); else From 8dc5bf5e84f1a9c402d5637e909d46664d5a5b36 Mon Sep 17 00:00:00 2001 From: Vishwajith Upendra Date: Wed, 3 Aug 2016 01:07:51 -0700 Subject: [PATCH 08/17] Release 5.1.0.22H Release 5.1.0.22H Change-Id: I516634ad1992f87206b9617f5c5074e16a2a6e7a CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 90f88997a721..17ab56842c15 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22G +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22H Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 489c7193ec8c3bb454fed5c5746545e3ae1927af Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Tue, 19 Jul 2016 13:20:57 -0700 Subject: [PATCH 09/17] qcacmn: Fix compilation with WMI_INTERFACE_EVENT_LOGGING disabled Compilation error occurs due to undefined struct when WMI_INTERFACE_EVENT_LOGGING disabled. Use void pointer as argument to wmi_mgmt_cmd_record() and cast as header struct inside logging function to avoid casting as undeclared type. Change-Id: I7d0922ee2009b235473febdbcbc3317e432a1386 CRs-Fixed: 1043597 --- wmi/inc/wmi_unified_api.h | 14 ++++++++++++-- wmi/src/wmi_unified.c | 14 +++++++------- wmi/src/wmi_unified_tlv.c | 4 +--- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 55951f42f034..8086231c5834 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -112,9 +112,19 @@ void *wmi_unified_attach(void *scn_handle, bool use_cookie, struct wmi_rx_ops *ops); +/** + * wmi_mgmt_cmd_record() - Wrapper function for mgmt command logging macro + * + * @wmi_handle: wmi handle + * @cmd: mgmt command + * @header: pointer to 802.11 header + * @vdev_id: vdev id + * @chanfreq: channel frequency + * + * Return: none + */ void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, WMI_CMD_ID cmd, - uint32_t type, uint32_t subtype, - uint32_t vdev_id, uint32_t chanfreq); + void *header, uint32_t vdev_id, uint32_t chanfreq); /** * detach for unified WMI diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 26006ab06b49..fa51a843e4e6 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -892,20 +892,21 @@ static QDF_STATUS wmi_debugfs_init(wmi_unified_t wmi_handle) * * @wmi_handle: wmi handle * @cmd: mgmt command - * @type: 802.11 frame type - * @subtype: 802.11 fram subtype + * @header: pointer to 802.11 header * @vdev_id: vdev id * @chanfreq: channel frequency * * Return: none */ void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, WMI_CMD_ID cmd, - uint32_t type, uint32_t subtype, - uint32_t vdev_id, uint32_t chanfreq) + void *header, uint32_t vdev_id, uint32_t chanfreq) { qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock); - WMI_MGMT_COMMAND_RECORD(cmd, type, subtype, vdev_id, chanfreq); + WMI_MGMT_COMMAND_RECORD(cmd, + ((struct wmi_command_header *)header)->type, + ((struct wmi_command_header *)header)->sub_type, + vdev_id, chanfreq); qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock); } @@ -920,8 +921,7 @@ void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, WMI_CMD_ID cmd, */ static void wmi_debugfs_remove(wmi_unified_t wmi_handle) { } void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, WMI_CMD_ID cmd, - uint32_t type, uint32_t subtype, - uint32_t vdev_id, uint32_t chanfreq) { } + void *header, uint32_t vdev_id, uint32_t chanfreq) { } #endif /*WMI_INTERFACE_EVENT_LOGGING */ int wmi_get_host_credits(wmi_unified_t wmi_handle); diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 76287d8745c1..c9f0b0da7ca8 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -1641,9 +1641,7 @@ QDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle, cmd->buf_len = bufp_len; wmi_mgmt_cmd_record(wmi_handle, WMI_MGMT_TX_SEND_CMDID, - ((struct wmi_command_header *)bufp)->type, - ((struct wmi_command_header *)bufp)->sub_type, - cmd->vdev_id, cmd->chanfreq); + bufp, cmd->vdev_id, cmd->chanfreq); if (wmi_unified_cmd_send(wmi_handle, buf, cmd_len, WMI_MGMT_TX_SEND_CMDID)) { From 64ccc85878c17755a187172915b7ee9d66b70acd Mon Sep 17 00:00:00 2001 From: Vishwajith Upendra Date: Wed, 3 Aug 2016 02:28:05 -0700 Subject: [PATCH 10/17] Release 5.1.0.22I Release 5.1.0.22I Change-Id: I424a7cca05a11fc4a2cc61830523973cc0115667 CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 17ab56842c15..ded1c0c72b73 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22H +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22I Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 6296c3e8f06c6aeee84b550765f582973e387eaa Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Tue, 12 Jul 2016 18:43:32 -0700 Subject: [PATCH 11/17] qcacmn: Compilation fixes for AP135 platform 1. AP135 platform uses 3.4.104 kernel. Fixed API names for the kernel. 2. Implicit declaration function errors fixed. 3. Stack frame size exceed error fixed for hif_dump_ce_registers function. 4. BIG Endian #define fixed. Change-Id: I761762f6e51c0890e672f76817a911ade7126dd5 Acked-by: Venkateswara Swamy Bandaru CRs-Fixed: 1040617 --- hif/src/ce/ce_main.c | 6 +++--- hif/src/ce/ce_reg.h | 4 ++-- hif/src/snoc/if_ahb.c | 8 ++++++++ hif/src/snoc/if_ahb_reset.c | 24 ++++++++++++++++++++++-- hif/src/snoc/if_snoc.c | 4 ++++ 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 60ff55618e98..7fd2b1c0d63a 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -2736,7 +2736,7 @@ int hif_dump_ce_registers(struct hif_softc *scn) { struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); uint32_t ce_reg_address = CE0_BASE_ADDRESS; - uint32_t ce_reg_values[CE_COUNT_MAX][CE_USEFUL_SIZE >> 2]; + uint32_t ce_reg_values[CE_USEFUL_SIZE >> 2]; uint32_t ce_reg_word_size = CE_USEFUL_SIZE >> 2; uint16_t i; QDF_STATUS status; @@ -2748,7 +2748,7 @@ int hif_dump_ce_registers(struct hif_softc *scn) } status = hif_diag_read_mem(hif_hdl, ce_reg_address, - (uint8_t *) &ce_reg_values[i][0], + (uint8_t *) &ce_reg_values[0], ce_reg_word_size * sizeof(uint32_t)); if (status != QDF_STATUS_SUCCESS) { @@ -2757,7 +2757,7 @@ int hif_dump_ce_registers(struct hif_softc *scn) } HIF_ERROR("CE%d Registers:", i); qdf_trace_hex_dump(QDF_MODULE_ID_HIF, QDF_TRACE_LEVEL_DEBUG, - (uint8_t *) &ce_reg_values[i][0], + (uint8_t *) &ce_reg_values[0], ce_reg_word_size * sizeof(uint32_t)); } return 0; diff --git a/hif/src/ce/ce_reg.h b/hif/src/ce/ce_reg.h index 9651f756d9b9..297e88f7c25b 100644 --- a/hif/src/ce/ce_reg.h +++ b/hif/src/ce/ce_reg.h @@ -351,14 +351,14 @@ unsigned int hif_get_dst_ring_read_index(struct hif_softc *scn, #define CE_SRC_RING_BYTE_SWAP_SET(scn, CE_ctrl_addr, n) \ A_TARGET_WRITE(scn, (CE_ctrl_addr) + CE_CTRL1_ADDRESS, \ - (A_TARGET_READ((targid), \ + (A_TARGET_READ(scn, \ (CE_ctrl_addr) + CE_CTRL1_ADDRESS) \ & ~CE_CTRL1_SRC_RING_BYTE_SWAP_EN_MASK) | \ CE_CTRL1_SRC_RING_BYTE_SWAP_EN_SET(n)) #define CE_DEST_RING_BYTE_SWAP_SET(scn, CE_ctrl_addr, n) \ A_TARGET_WRITE(scn, (CE_ctrl_addr)+CE_CTRL1_ADDRESS, \ - (A_TARGET_READ((targid), \ + (A_TARGET_READ(scn, \ (CE_ctrl_addr) + CE_CTRL1_ADDRESS) \ & ~CE_CTRL1_DST_RING_BYTE_SWAP_EN_MASK) | \ CE_CTRL1_DST_RING_BYTE_SWAP_EN_SET(n)) diff --git a/hif/src/snoc/if_ahb.c b/hif/src/snoc/if_ahb.c index 362584ff0aba..dc6077841894 100644 --- a/hif/src/snoc/if_ahb.c +++ b/hif/src/snoc/if_ahb.c @@ -298,7 +298,11 @@ QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc, goto err_cleanup1; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); +#else + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); +#endif if (ret) { HIF_ERROR("%s: failed to set dma mask error = %d", __func__, ret); @@ -306,7 +310,11 @@ QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc, } /* Arrange for access to Target SoC registers. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) mem = devm_ioremap_resource(&pdev->dev, memres); +#else + mem = devm_request_and_ioremap(&pdev->dev, memres); +#endif if (IS_ERR(mem)) { HIF_INFO("ath: ioremap error\n"); ret = PTR_ERR(mem); diff --git a/hif/src/snoc/if_ahb_reset.c b/hif/src/snoc/if_ahb_reset.c index 5cb1040929cb..6901f4251fee 100644 --- a/hif/src/snoc/if_ahb_reset.c +++ b/hif/src/snoc/if_ahb_reset.c @@ -32,11 +32,13 @@ #include "if_ahb.h" #include -#include #include #include #include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) +#include +#endif /** * clk_enable_disable() - Enable/disable clock @@ -115,6 +117,7 @@ int hif_ahb_clk_enable_disable(struct device *dev, int enable) * * Return : zero on success, non-zero incase of error. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) int hif_ahb_enable_radio(struct hif_pci_softc *sc, struct platform_device *pdev, const struct platform_device_id *id) @@ -237,8 +240,17 @@ int hif_ahb_enable_radio(struct hif_pci_softc *sc, err_reset: return -EIO; - } +#else +int hif_ahb_enable_radio(struct hif_pci_softc *sc, + struct platform_device *pdev, + const struct platform_device_id *id) +{ + qdf_print("%s:%d:Reset routines not available in kernel version.\n", + __func__, __LINE__); + return -EIO; +} +#endif /* "wifi_core_warm" is the other reset type */ #define AHB_RESET_TYPE "wifi_core_cold" @@ -252,6 +264,7 @@ err_reset: * * Return : n/a. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) void hif_ahb_device_reset(struct hif_softc *scn) { struct reset_control *resetctl = NULL; @@ -367,6 +380,13 @@ void hif_ahb_device_reset(struct hif_softc *scn) iounmap(mem_tcsr); HIF_INFO("Reset complete for wifi core id : %d\n", wifi_core_id); } +#else +void hif_ahb_device_reset(struct hif_softc *scn) +{ + qdf_print("%s:%d:Reset routines not available in kernel version.\n", + __func__, __LINE__); +} +#endif diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c index e0227251d0ef..df7937f62f5c 100644 --- a/hif/src/snoc/if_snoc.c +++ b/hif/src/snoc/if_snoc.c @@ -220,7 +220,11 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc, int ret; int hif_type; int target_type; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(37)); +#else + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(37)); +#endif if (ret) { HIF_ERROR("%s: failed to set dma mask error = %d", __func__, ret); From e421a3c06d183e0f399d9be44c924f8c87f38215 Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Tue, 12 Jul 2016 18:38:55 -0700 Subject: [PATCH 12/17] qcacmn: Compilation fix in DP layer caused due to transport layer define QCA_OL_11AC_FAST_PATH is changed to WLAN_FEATURE_FASTPATH Change-Id: I9f6cbddf4a4975d940c822fa90d24350d83f7a96 Acked-by: Venkateswara Swamy Bandaru CRs-Fixed: 1040617 --- dp/inc/cdp_txrx_host_stats.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dp/inc/cdp_txrx_host_stats.h b/dp/inc/cdp_txrx_host_stats.h index 3dc738bd92eb..e87ca3b1e074 100644 --- a/dp/inc/cdp_txrx_host_stats.h +++ b/dp/inc/cdp_txrx_host_stats.h @@ -38,7 +38,7 @@ /* Need to rename the function to reflect the functionality "show" / "display" * WIN -- to figure out whether to change OSIF to converge (not an immediate AI) * */ -#if QCA_OL_11AC_FAST_PATH +#if WLAN_FEATURE_FASTPATH int ol_txrx_host_stats_get( ol_txrx_vdev_handle vdev, struct ol_txrx_stats_req *req); @@ -82,7 +82,7 @@ ol_txrx_disable_enhanced_stats(ol_txrx_pdev_handle pdev); uint32_t *ol_txrx_get_stats_base(ol_txrx_pdev_handle pdev, uint32_t *stats_base, uint32_t msg_len, uint8_t type); #endif -#endif /* QCA_OL_11AC_FAST_PATH*/ +#endif /* WLAN_FEATURE_FASTPATH*/ #if (HOST_SW_TSO_ENABLE || HOST_SW_TSO_SG_ENABLE) void ol_tx_print_tso_stats( @@ -110,15 +110,15 @@ void ol_rst_rx_cksum_stats(ol_txrx_vdev_handle vdev); #endif /* RX_CHECKSUM_OFFLOAD */ -#if (ATH_SUPPORT_IQUE && QCA_OL_11AC_FAST_PATH) +#if (ATH_SUPPORT_IQUE && WLAN_FEATURE_FASTPATH) A_STATUS ol_txrx_host_me_stats(ol_txrx_vdev_handle vdev); -#endif /* QCA_OL_11AC_FAST_PATH */ +#endif /* WLAN_FEATURE_FASTPATH */ #if PEER_FLOW_CONTROL extern void ol_txrx_per_peer_stats(struct ol_txrx_pdev_t *pdev, char *addr); #endif -#if QCA_OL_11AC_FAST_PATH && PEER_FLOW_CONTROL +#if WLAN_FEATURE_FASTPATH && PEER_FLOW_CONTROL int ol_txrx_host_msdu_ttl_stats( ol_txrx_vdev_handle vdev, struct ol_txrx_stats_req *req); From d2d23bdd4b175c558778db793bdd889f87e42c9d Mon Sep 17 00:00:00 2001 From: Vishwajith Upendra Date: Wed, 3 Aug 2016 14:25:49 -0700 Subject: [PATCH 13/17] Release 5.1.0.22J Release 5.1.0.22J Change-Id: I76a30293382d046c6298a650c75e99d8cec7f116 CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index ded1c0c72b73..cbf18978362f 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22I +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22J Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From faf8ab598385906d14147a5ced9671bd44886a1d Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Fri, 1 Jul 2016 04:22:40 -0700 Subject: [PATCH 14/17] qcacmn: Fix Q_TARGET_ACCESS in hif_fastpath_resume Q_TARGET_ACCESS return value check was incorrect. Fixed to match usage in the rest of the driver. Change-Id: I73631536c9670edcb5014f3e850985dfc6fc4d16 CRs-Fixed: 1046067 --- hif/src/pcie/if_pci.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 59b919c1ed28..e28dab98b400 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -2910,16 +2910,17 @@ static void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx) return; if (scn->fastpath_mode_on) { - if (Q_TARGET_ACCESS_BEGIN(scn)) { - ce_state = scn->ce_id_to_state[CE_HTT_H2T_MSG]; - qdf_spin_lock_bh(&ce_state->ce_index_lock); + if (Q_TARGET_ACCESS_BEGIN(scn) < 0) + return; - /*war_ce_src_ring_write_idx_set */ - CE_SRC_RING_WRITE_IDX_SET(scn, ce_state->ctrl_addr, - ce_state->src_ring->write_index); - qdf_spin_unlock_bh(&ce_state->ce_index_lock); - Q_TARGET_ACCESS_END(scn); - } + ce_state = scn->ce_id_to_state[CE_HTT_H2T_MSG]; + qdf_spin_lock_bh(&ce_state->ce_index_lock); + + /*war_ce_src_ring_write_idx_set */ + CE_SRC_RING_WRITE_IDX_SET(scn, ce_state->ctrl_addr, + ce_state->src_ring->write_index); + qdf_spin_unlock_bh(&ce_state->ce_index_lock); + Q_TARGET_ACCESS_END(scn); } } #else From 9538fefe710c403980ec3c3915e2efcf5a9f7eec Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Thu, 7 Jul 2016 11:17:36 -0700 Subject: [PATCH 15/17] qcacmn: Initialize ce ring base address high registers for adrastea Because the register values were not defined in the target defs table, The values were defaulting to 0 or missing. The code to write to these registers checks if they exist before trying to write to them. Without these registers defined, the base addresses of the dma rings would be truncated to 32 bits. Change-Id: Iabb49df50c2452522b6da30154e4d7d7221e22ac CRs-Fixed: 1049424 --- hif/src/adrastea_reg_def.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hif/src/adrastea_reg_def.h b/hif/src/adrastea_reg_def.h index f50659ca9ba1..a9cd309a3c21 100644 --- a/hif/src/adrastea_reg_def.h +++ b/hif/src/adrastea_reg_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -1413,9 +1413,9 @@ #define ADRASTEA_SR_BA_OFFSET (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_SR_BA_LOW\ - ADRASTEA_CE0_BASE_ADDRESS) -#define ADRASTEA_SR_BA_ADDRESS_HIGH_OFFSET \ - (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_SR_BA_HIGH \ - - ADRASTEA_CE0_BASE_ADDRESS) +#define ADRASTEA_SR_BA_HIGH_OFFSET \ + (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_SR_BA_HIGH \ + - ADRASTEA_CE0_BASE_ADDRESS) #define ADRASTEA_SR_SIZE_OFFSET (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_SR_SIZE \ - ADRASTEA_CE0_BASE_ADDRESS) @@ -1429,8 +1429,9 @@ #define ADRASTEA_DR_BA_OFFSET (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_DR_BA_LOW\ - ADRASTEA_CE0_BASE_ADDRESS) -#define ADRASTEA_DR_BA_ADDRESS_HIGH_OFFSET (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_DR_BA_HIGH\ - - ADRASTEA_CE0_BASE_ADDRESS) +#define ADRASTEA_DR_BA_HIGH_OFFSET \ + (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_DR_BA_HIGH\ + - ADRASTEA_CE0_BASE_ADDRESS) #define ADRASTEA_DR_SIZE_OFFSET (ADRASTEA_A_WCSS_HM_A_WIFI_APB_1_A_WFSS_CE0_DR_SIZE\ - ADRASTEA_CE0_BASE_ADDRESS) @@ -2216,10 +2217,12 @@ struct ce_reg_def adrastea_ce_targetdef = { .d_HOST_IE_ADDRESS = ADRASTEA_HOST_IE_OFFSET, .d_HOST_IE_COPY_COMPLETE_MASK = ADRASTEA_HOST_IE_COPY_COMPLETE_MASK, .d_SR_BA_ADDRESS = ADRASTEA_SR_BA_OFFSET, + .d_SR_BA_ADDRESS_HIGH = ADRASTEA_SR_BA_HIGH_OFFSET, .d_SR_SIZE_ADDRESS = ADRASTEA_SR_SIZE_OFFSET, .d_CE_CTRL1_ADDRESS = ADRASTEA_CE_CTRL1_OFFSET, .d_CE_CTRL1_DMAX_LENGTH_MASK = ADRASTEA_CE_CTRL1_DMAX_LENGTH_MASK, .d_DR_BA_ADDRESS = ADRASTEA_DR_BA_OFFSET, + .d_DR_BA_ADDRESS_HIGH = ADRASTEA_DR_BA_HIGH_OFFSET, .d_DR_SIZE_ADDRESS = ADRASTEA_DR_SIZE_OFFSET, .d_CE_CMD_REGISTER = ADRASTEA_CE_CMD_REGISTER_OFFSET, .d_CE_MSI_ADDRESS = MISSING_FOR_ADRASTEA, From 3af34357417fc349c7c44ad0faf41cee0531a237 Mon Sep 17 00:00:00 2001 From: Vishwajith Upendra Date: Wed, 3 Aug 2016 18:12:59 -0700 Subject: [PATCH 16/17] Release 5.1.0.22K Release 5.1.0.22K Change-Id: I4f63010b7ff55f292eee656389174337869a3408 CRs-Fixed: 688141 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index cbf18978362f..c759ce1ae864 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22J +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22K Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C From 75ea891eca545b07303b0b29a80dbe49cd2dc7f2 Mon Sep 17 00:00:00 2001 From: Arun Khandavalli Date: Tue, 2 Aug 2016 16:35:00 +0530 Subject: [PATCH 17/17] qcacmn: Add bus_id memeber to qdf_device With Load once unload never architecture, the cds modules will be opened/closed several times. As part of configuration of modules bus id needs to passed. So, add a new member to save the bus_id passed by the platform driver during the driver intialization, Change-Id: Ic580e03076e5e8c557dde1879e223606a14f79b8 CRs-Fixed: 1049224 --- qdf/linux/src/i_qdf_types.h | 3 +++ qdf/linux/src/qdf_mc_timer.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/qdf/linux/src/i_qdf_types.h b/qdf/linux/src/i_qdf_types.h index 0e9aafbb9272..74325b7b64f5 100644 --- a/qdf/linux/src/i_qdf_types.h +++ b/qdf/linux/src/i_qdf_types.h @@ -185,6 +185,9 @@ struct __qdf_device { __qdf_os_intr func; struct __qdf_mempool_ctxt *mem_pool[MAX_MEM_POOLS]; enum qdf_bus_type bus_type; +#ifdef CONFIG_MCL + const struct hif_bus_id *bid; +#endif }; typedef struct __qdf_device *__qdf_device_t; diff --git a/qdf/linux/src/qdf_mc_timer.c b/qdf/linux/src/qdf_mc_timer.c index 8d10d09ad327..80143ea5888d 100644 --- a/qdf/linux/src/qdf_mc_timer.c +++ b/qdf/linux/src/qdf_mc_timer.c @@ -687,3 +687,17 @@ unsigned long qdf_mc_timer_get_system_time(void) return tv.tv_sec * 1000 + tv.tv_usec / 1000; } EXPORT_SYMBOL(qdf_mc_timer_get_system_time); + +/** + * qdf_timer_module_deinit() - Deinitializes a QDF timer module. + * + * This API deinitializes the QDF timer module. + * Return: none + */ +void qdf_timer_module_deinit(void) +{ + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH, + "De-Initializing the QDF MC timer module"); + qdf_mutex_destroy(&persistent_timer_count_lock); +} +EXPORT_SYMBOL(qdf_timer_module_deinit);