diff --git a/VERSION.txt b/VERSION.txt index 463a8da44682..6b25f8b6d358 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23C +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23K Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C diff --git a/hif/inc/hif.h b/hif/inc/hif.h index 9e6ddb439e0c..10a9445e1588 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -126,6 +126,7 @@ struct qca_napi_stat { */ struct qca_napi_info { struct net_device netdev; /* dummy net_dev */ + void *hif_ctx; struct napi_struct napi; /* one NAPI Instance per CE in phase I */ uint8_t scale; /* currently same on all instances */ uint8_t id; diff --git a/hif/src/ce/ce_assignment.h b/hif/src/ce/ce_assignment.h index 4745e174b94c..7df730618642 100644 --- a/hif/src/ce/ce_assignment.h +++ b/hif/src/ce/ce_assignment.h @@ -91,7 +91,7 @@ static struct CE_attr host_ce_config_wlan[] = { /* target->host HTT + HTC control */ { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, /* target->host WMI */ - { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 32, NULL,}, + { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 64, NULL,}, /* host->target WMI */ { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,}, /* host->target HTT */ @@ -121,7 +121,7 @@ static struct CE_pipe_config target_ce_config_wlan[] = { /* target->host HTT */ { /* CE1 */ 1, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}, /* target->host WMI + HTC control */ - { /* CE2 */ 2, PIPEDIR_IN, 32, 2048, CE_ATTR_FLAGS, 0,}, + { /* CE2 */ 2, PIPEDIR_IN, 64, 2048, CE_ATTR_FLAGS, 0,}, /* host->target WMI */ { /* CE3 */ 3, PIPEDIR_OUT, 32, 2048, CE_ATTR_FLAGS, 0,}, /* host->target HTT */ diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index d809b0006f0f..c7fe8d55e408 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -576,7 +576,7 @@ int ce_send_fast(struct CE_handle *copyeng, qdf_nbuf_t msdu, hif_record_ce_desc_event(scn, ce_state->id, FAST_TX_SOFTWARE_INDEX_UPDATE, - NULL, NULL, write_index); + NULL, NULL, sw_index); if (qdf_unlikely(CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) < SLOTS_PER_DATAPATH_TX)) { diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c index 2f6809fa4935..958efdba090a 100644 --- a/hif/src/ce/ce_tasklet.c +++ b/hif/src/ce/ce_tasklet.c @@ -271,11 +271,11 @@ int hif_drain_tasklets(struct hif_softc *scn) #ifdef WLAN_SUSPEND_RESUME_TEST static bool g_hif_apps_fake_suspended; -static hdd_fake_resume_callback hdd_fake_aps_resume; +static hdd_fake_resume_callback hdd_fake_apps_resume; static void hif_wlan_resume_work_handler(struct work_struct *work) { - hdd_fake_aps_resume(0); + hdd_fake_apps_resume(0); } static DECLARE_WORK(hif_resume_work, hif_wlan_resume_work_handler); @@ -284,41 +284,66 @@ 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 + * to fake the apps resume process using the hdd_fake_apps_resume * * Return: none */ void hif_fake_apps_suspend(hdd_fake_resume_callback callback) { - hdd_fake_aps_resume = callback; + hdd_fake_apps_resume = callback; g_hif_apps_fake_suspended = true; } /** - * hif_fake_aps_resume(): check if WLAN resume is needed + * hif_fake_apps_resume(): trigger WLAN resume if needed + * @fid_hdl: hif context + * @ce_id: copy engine Id * - * Return: true if a fake apps resume has been been triggered - * returns false if regular interrupt processing is needed + * Return: True if a fake apps resume has been been triggered, + * returns false if regular interrupt processing is needed. + * Ensures copy engine Id matches mapped Irq */ -static bool hif_fake_aps_resume(void) +static bool hif_fake_apps_resume(struct hif_opaque_softc *hif_hdl, int ce_id) { - if (g_hif_apps_fake_suspended) { - g_hif_apps_fake_suspended = false; - schedule_work(&hif_resume_work); - return true; - } else { + uint8_t ul_pipe, dl_pipe; + int ul_is_polled, dl_is_polled; + QDF_STATUS status; + + /* can't resume if not already suspended */ + if (!g_hif_apps_fake_suspended) + return false; + + /* ensure passed copy engine Id matches Id from irq map */ + + status = hif_map_service_to_pipe(hif_hdl, HTC_CTRL_RSVD_SVC, + &ul_pipe, &dl_pipe, + &ul_is_polled, &dl_is_polled); + + if (status) { + HIF_ERROR("%s: pipe_mapping failure", __func__); return false; } + + /* dl_pipe is equivalent to a copy engine Id at this point */ + if (ce_id != dl_pipe) + return false; + + /* trigger fake apps resume */ + g_hif_apps_fake_suspended = false; + schedule_work(&hif_resume_work); + return true; } #else /** - * hif_fake_aps_resume(): check if WLAN resume is needed + * hif_fake_apps_resume(): trigger WLAN resume if needed + * @hif_hdl: hif context + * @ce_id: copy engine Id * * Return: always false if WLAN_SUSPEND_RESUME_TEST is not defined */ -static bool hif_fake_aps_resume(void) +static bool hif_fake_apps_resume(struct hif_opaque_softc *hif_hdl, int ce_id) { return false; } @@ -426,7 +451,7 @@ irqreturn_t ce_dispatch_interrupt(int ce_id, 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())) { + if (unlikely(hif_fake_apps_resume(hif_hdl, ce_id))) { HIF_ERROR("received resume interrupt"); hif_irq_enable(scn, ce_id); return IRQ_HANDLED; diff --git a/hif/src/dispatcher/ahb_api.h b/hif/src/dispatcher/ahb_api.h index 8ba0c754d2d9..2bba2ff92d8e 100644 --- a/hif/src/dispatcher/ahb_api.h +++ b/hif/src/dispatcher/ahb_api.h @@ -26,6 +26,7 @@ void hif_ahb_close(struct hif_softc *hif_ctx); void hif_ahb_disable_isr(struct hif_softc *hif_ctx); void hif_ahb_nointrs(struct hif_softc *scn); +void hif_ahb_reset_soc(struct hif_softc *hif_ctx); QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc, struct device *dev, void *bdev, const hif_bus_id *bid, diff --git a/hif/src/dispatcher/multibus_ahb.c b/hif/src/dispatcher/multibus_ahb.c index b543e8fb420b..d1bee78d6070 100644 --- a/hif/src/dispatcher/multibus_ahb.c +++ b/hif/src/dispatcher/multibus_ahb.c @@ -38,7 +38,7 @@ QDF_STATUS hif_initialize_ahb_ops(struct hif_bus_ops *bus_ops) bus_ops->hif_bus_open = &hif_ahb_open; bus_ops->hif_bus_close = &hif_ahb_close; bus_ops->hif_bus_prevent_linkdown = &hif_dummy_bus_prevent_linkdown; - bus_ops->hif_reset_soc = &hif_dummy_reset_soc; + bus_ops->hif_reset_soc = &hif_ahb_reset_soc; bus_ops->hif_bus_suspend = &hif_dummy_bus_suspend; bus_ops->hif_bus_resume = &hif_dummy_bus_resume; bus_ops->hif_target_sleep_state_adjust = diff --git a/hif/src/hif_napi.c b/hif/src/hif_napi.c index 0f14ab26fb1b..fa7db82ce781 100644 --- a/hif/src/hif_napi.c +++ b/hif/src/hif_napi.c @@ -31,8 +31,6 @@ * HIF NAPI interface implementation */ -#include /* memset */ - #include #include #include @@ -96,7 +94,7 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx, } for (i = 0; i < hif->ce_count; i++) { ce_state = hif->ce_id_to_state[i]; - NAPI_DEBUG("ce %d: htt_rx=%d htt_rx=%d", + NAPI_DEBUG("ce %d: htt_rx=%d htt_tx=%d", i, ce_state->htt_rx_data, ce_state->htt_tx_data); if (!ce_state->htt_rx_data) @@ -109,6 +107,7 @@ int hif_napi_create(struct hif_opaque_softc *hif_ctx, memset(napii, 0, sizeof(struct qca_napi_info)); napii->scale = scale; napii->id = NAPI_PIPE2ID(i); + napii->hif_ctx = hif_ctx; init_dummy_netdev(&(napii->netdev)); NAPI_DEBUG("adding napi=%p to netdev=%p (poll=%p, bdgt=%d)", diff --git a/hif/src/snoc/if_ahb.c b/hif/src/snoc/if_ahb.c index dc6077841894..6f986fd14bbe 100644 --- a/hif/src/snoc/if_ahb.c +++ b/hif/src/snoc/if_ahb.c @@ -233,15 +233,29 @@ void hif_ahb_disable_bus(struct hif_softc *scn) struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); void __iomem *mem; struct platform_device *pdev = (struct platform_device *)sc->pdev; + struct resource *memres = NULL; + int mem_pa_size = 0; /*Disable WIFI clock input*/ - hif_ahb_clk_enable_disable(&pdev->dev, 0); + if (sc->mem) { + memres = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!memres) { + HIF_INFO("%s: Failed to get IORESOURCE_MEM\n", + __func__); + return; + } + mem_pa_size = memres->end - memres->start + 1; - hif_ahb_device_reset(scn); - mem = (void __iomem *)sc->mem; - if (mem) { - devm_iounmap(&pdev->dev, mem); - sc->mem = NULL; + hif_ahb_clk_enable_disable(&pdev->dev, 0); + + hif_ahb_device_reset(scn); + mem = (void __iomem *)sc->mem; + if (mem) { + devm_iounmap(&pdev->dev, mem); + devm_release_mem_region(&pdev->dev, scn->mem_pa, + mem_pa_size); + sc->mem = NULL; + } } scn->mem = NULL; } @@ -324,6 +338,7 @@ QDF_STATUS hif_ahb_enable_bus(struct hif_softc *ol_sc, sc->mem = mem; ol_sc->mem = mem; ol_sc->mem_pa = memres->start; + tgt_info = hif_get_target_info_handle((struct hif_opaque_softc *)ol_sc); tgt_info->target_type = target_type; @@ -362,10 +377,9 @@ err_cleanup1: * Return: void */ /* Function to reset SoC */ -void hif_ahb_reset_soc(struct hif_opaque_softc *hif_ctx) +void hif_ahb_reset_soc(struct hif_softc *hif_ctx) { - struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx); - hif_ahb_device_reset((struct hif_softc *)sc); + hif_ahb_device_reset(hif_ctx); } diff --git a/qdf/inc/qdf_util.h b/qdf/inc/qdf_util.h index a80df5bb44dc..cc7ae313481b 100644 --- a/qdf/inc/qdf_util.h +++ b/qdf/inc/qdf_util.h @@ -439,4 +439,32 @@ uint64_t qdf_get_totalramsize(void) return __qdf_get_totalramsize(); } +/** + * qdf_get_lower_32_bits() - get lower 32 bits from an address. + * @addr: address + * + * This api returns the lower 32 bits of an address. + * + * Return: lower 32 bits. + */ +static inline +uint32_t qdf_get_lower_32_bits(qdf_dma_addr_t addr) +{ + return __qdf_get_lower_32_bits(addr); +} + +/** + * qdf_get_upper_32_bits() - get upper 32 bits from an address. + * @addr: address + * + * This api returns the upper 32 bits of an address. + * + * Return: upper 32 bits. + */ +static inline +uint32_t qdf_get_upper_32_bits(qdf_dma_addr_t addr) +{ + return __qdf_get_upper_32_bits(addr); +} + #endif /*_QDF_UTIL_H*/ diff --git a/qdf/linux/src/i_qdf_util.h b/qdf/linux/src/i_qdf_util.h index a496573e46f9..228f91f4ffa8 100644 --- a/qdf/linux/src/i_qdf_util.h +++ b/qdf/linux/src/i_qdf_util.h @@ -292,4 +292,33 @@ __qdf_get_totalramsize(void) return MEMINFO_KB(meminfo.totalram); } +/** + * __qdf_get_lower_32_bits() - get lower 32 bits from an address. + * @addr: address + * + * This api returns the lower 32 bits of an address. + * + * Return: lower 32 bits. + */ +static inline +uint32_t __qdf_get_lower_32_bits(__qdf_dma_addr_t addr) +{ + return lower_32_bits(addr); +} + +/** + * __qdf_get_upper_32_bits() - get upper 32 bits from an address. + * @addr: address + * + * This api returns the upper 32 bits of an address. + * + * Return: upper 32 bits. + */ +static inline +uint32_t __qdf_get_upper_32_bits(__qdf_dma_addr_t addr) +{ + return upper_32_bits(addr); +} + + #endif /*_I_QDF_UTIL_H*/ diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 5ef8b5a7325c..7082ed1cdeec 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1258,4 +1258,7 @@ QDF_STATUS wmi_unified_send_power_dbg_cmd(void *wmi_hdl, QDF_STATUS wmi_unified_send_adapt_dwelltime_params_cmd(void *wmi_hdl, struct wmi_adaptive_dwelltime_params * wmi_param); +QDF_STATUS wmi_unified_fw_test_cmd(void *wmi_hdl, + struct set_fwtest_params *wmi_fwtest); + #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 306aad6ed988..324e13c4e7f5 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -1693,6 +1693,7 @@ typedef struct { * @rokh_id: r0kh id * @roam_key_mgmt_offload_enabled: roam offload flag * @auth_mode: authentication mode + * @okc_enabled: enable opportunistic key caching * @is_ese_assoc: flag to determine ese assoc * @mdid: mobility domain info * @roam_offload_params: roam offload tlv params @@ -1715,6 +1716,7 @@ struct roam_offload_scan_params { uint8_t rokh_id[WMI_ROAM_R0KH_ID_MAX_LEN]; uint8_t roam_key_mgmt_offload_enabled; int auth_mode; + bool okc_enabled; #endif bool is_ese_assoc; struct mobility_domain_info mdid; diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index d8b19b715cc3..b9f1c8785abb 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -676,7 +676,7 @@ QDF_STATUS (*send_process_roam_synch_complete_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id); QDF_STATUS (*send_unit_test_cmd)(wmi_unified_t wmi_handle, - struct wmi_unit_test_cmd *wmi_utest); + struct wmi_unit_test_cmd *wmi_utest); QDF_STATUS (*send_roam_invoke_cmd)(wmi_unified_t wmi_handle, struct wmi_roam_invoke_cmd *roaminvoke, @@ -1124,6 +1124,9 @@ QDF_STATUS (*send_power_dbg_cmd)(wmi_unified_t wmi_handle, QDF_STATUS (*send_adapt_dwelltime_params_cmd)(wmi_unified_t wmi_handle, struct wmi_adaptive_dwelltime_params *dwelltime_params); + +QDF_STATUS (*send_fw_test_cmd)(wmi_unified_t wmi_handle, + struct set_fwtest_params *wmi_fwtest); }; struct target_abi_version { diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 3fd8618808df..fb3da5de26f0 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -3233,6 +3233,28 @@ QDF_STATUS wmi_unified_roam_synch_complete_cmd(void *wmi_hdl, return QDF_STATUS_E_FAILURE; } +/** + * wmi_unified_fw_test_cmd() - send fw test command to fw. + * @wmi_hdl: wmi handle + * @wmi_fwtest: fw test command + * + * This function sends fw test command to fw. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS wmi_unified_fw_test_cmd(void *wmi_hdl, + struct set_fwtest_params *wmi_fwtest) +{ + wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; + + if (wmi_handle->ops->send_fw_test_cmd) + return wmi_handle->ops->send_fw_test_cmd(wmi_handle, + wmi_fwtest); + + return QDF_STATUS_E_FAILURE; + +} + /** * wmi_unified_unit_test_cmd() - send unit test command to fw. * @wmi_hdl: wmi handle diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index a81d462398cc..9b442f7bbeca 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -4282,7 +4282,8 @@ QDF_STATUS send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle, buf_ptr += WMI_TLV_HDR_SIZE; roam_offload_11i = (wmi_roam_11i_offload_tlv_param *) buf_ptr; - if (roam_req->roam_key_mgmt_offload_enabled) { + if (roam_req->roam_key_mgmt_offload_enabled && + roam_req->okc_enabled) { WMI_SET_ROAM_OFFLOAD_OKC_ENABLED (roam_offload_11i->flags); WMI_LOGE("LFR3:OKC Enabled"); @@ -10104,6 +10105,48 @@ QDF_STATUS send_process_roam_synch_complete_cmd_tlv(wmi_unified_t wmi_handle, return QDF_STATUS_SUCCESS; } +/** + * send_fw_test_cmd_tlv() - send fw test command to fw. + * @wmi_handle: wmi handle + * @wmi_fwtest: fw test command + * + * This function sends fw test command to fw. + * + * Return: CDF STATUS + */ +QDF_STATUS send_fw_test_cmd_tlv(wmi_unified_t wmi_handle, + struct set_fwtest_params *wmi_fwtest) +{ + wmi_fwtest_set_param_cmd_fixed_param *cmd; + wmi_buf_t wmi_buf; + uint16_t len; + + len = sizeof(*cmd); + + wmi_buf = wmi_buf_alloc(wmi_handle, len); + if (!wmi_buf) { + WMI_LOGE("%s: wmai_buf_alloc failed", __func__); + return QDF_STATUS_E_NOMEM; + } + + cmd = (wmi_fwtest_set_param_cmd_fixed_param *) wmi_buf_data(wmi_buf); + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_fwtest_set_param_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_fwtest_set_param_cmd_fixed_param)); + cmd->param_id = wmi_fwtest->arg; + cmd->param_value = wmi_fwtest->value; + + if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len, + WMI_FWTEST_CMDID)) { + WMI_LOGP("%s: failed to send fw test command", __func__); + qdf_nbuf_free(wmi_buf); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + /** * send_unit_test_cmd_tlv() - send unit test command to fw. * @wmi_handle: wmi handle @@ -12095,6 +12138,7 @@ struct wmi_ops tlv_ops = { .extract_profile_data = extract_profile_data_tlv, .extract_chan_info_event = extract_chan_info_event_tlv, .extract_channel_hopping_event = extract_channel_hopping_event_tlv, + .send_fw_test_cmd = send_fw_test_cmd_tlv, }; #ifdef WMI_TLV_AND_NON_TLV_SUPPORT