From a95b324a8c9b441ec814d2f2d8a3b001013cb52e Mon Sep 17 00:00:00 2001 From: Venkateswara Swamy Bandaru Date: Fri, 19 May 2017 20:20:30 +0530 Subject: [PATCH 1/6] qcacmn: Add CDP APIs for configuring interrupt Add CDP API for interrupt configuration to decouple interrupt setup from soc attach / detach. Change-Id: I422205ff5687fdc4a0936c68850455cc4e733e4d CRs-fixed: 2046055 --- dp/inc/cdp_txrx_cmn.h | 22 ++++++++++++++++++++++ dp/inc/cdp_txrx_ops.h | 2 ++ dp/wifi3.0/dp_main.c | 6 ++---- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 0adcd4d7127d..fae142f96a7f 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -507,6 +507,28 @@ int cdp_txrx_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, return 0; } +/** + * cdp_txrx_intr_attach(): function to attach and configure interrupt + * @soc: soc handle + */ +static inline QDF_STATUS cdp_txrx_intr_attach(ol_txrx_soc_handle soc) +{ + if (soc->ops->cmn_drv_ops->txrx_intr_attach) + return soc->ops->cmn_drv_ops->txrx_intr_attach(soc); + + return 0; +} + +/** + * cdp_txrx_intr_detach(): function to detach interrupt + * @soc: soc handle + */ +static inline void cdp_txrx_intr_detach(ol_txrx_soc_handle soc) +{ + if (soc->ops->cmn_drv_ops->txrx_intr_detach) + soc->ops->cmn_drv_ops->txrx_intr_detach(soc); +} + /** * cdp_display_stats(): function to map to dump stats * @soc: soc handle diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 789a4d5c6fad..1f142b4ed6dc 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -206,6 +206,8 @@ struct cdp_cmn_ops { void (*txrx_soc_set_nss_cfg)(ol_txrx_soc_handle soc, int config); int(*txrx_soc_get_nss_cfg)(ol_txrx_soc_handle soc); + QDF_STATUS (*txrx_intr_attach)(void *soc); + void (*txrx_intr_detach)(void *soc); }; struct cdp_ctrl_ops { diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 424a81fe282a..a05dc16f1b8b 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -965,8 +965,6 @@ static int dp_soc_cmn_setup(struct dp_soc *soc) goto fail1; } - dp_soc_interrupt_attach(soc); - /* Setup HW REO */ qdf_mem_zero(&reo_params, sizeof(reo_params)); @@ -1413,8 +1411,6 @@ static void dp_soc_detach_wifi3(void *txrx_soc) qdf_atomic_set(&soc->cmn_init_done, 0); - dp_soc_interrupt_detach(soc); - for (i = 0; i < MAX_PDEV_CNT; i++) { if (soc->pdev_list[i]) dp_pdev_detach_wifi3( @@ -3779,6 +3775,8 @@ static struct cdp_cmn_ops dp_ops_cmn = { .display_stats = dp_txrx_dump_stats, .txrx_soc_set_nss_cfg = dp_soc_set_nss_cfg_wifi3, .txrx_soc_get_nss_cfg = dp_soc_get_nss_cfg_wifi3, + .txrx_intr_attach = dp_soc_interrupt_attach, + .txrx_intr_detach = dp_soc_interrupt_detach, /* TODO: Add other functions */ }; From 60ff932b3810f00dde494158d005a9465e61965c Mon Sep 17 00:00:00 2001 From: Houston Hoffman Date: Thu, 6 Apr 2017 14:23:20 -0700 Subject: [PATCH 2/6] qcacmn: Mask failures in hif_post_recv_buffers Mask failures in hif_post_recv_buffers as the oom_allocation_work provides a recovery mechanism. Change-Id: Ib495b96f9d72b25c732c3b85f982db5dc20adca7 CRs-Fixed: 2030393 --- hif/src/ce/ce_main.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 1b25d6c96c50..5377e67464c5 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -1874,9 +1874,8 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info) /* * Try to post all desired receive buffers for all pipes. - * Returns 0 if all desired buffers are posted, - * non-zero if were were unable to completely - * replenish receive buffers. + * returns 0 as oom_allocation_work will be scheduled + * to recover any failures. */ static int hif_post_recv_buffers(struct hif_softc *scn) { @@ -1895,13 +1894,9 @@ static int hif_post_recv_buffers(struct hif_softc *scn) ce_state && (ce_state->htt_rx_data)) continue; - if (hif_post_recv_buffers_for_pipe(pipe_info)) { - rv = 1; - goto done; - } + hif_post_recv_buffers_for_pipe(pipe_info); } -done: A_TARGET_ACCESS_UNLIKELY(scn); return rv; From a09e859ba0585e54e8028d64400f7e41b2df0b77 Mon Sep 17 00:00:00 2001 From: Ajit Pal Singh Date: Fri, 12 May 2017 14:31:11 +0530 Subject: [PATCH 3/6] qcacmn: Always enable AVOID_FREQUENCIES vendor subcmd Since AVOID_FREQUENCIES vendor subcmd might be needed even when FEATURE_WLAN_CH_AVOID is disabled, always enable QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX in the vendor subcmd list. Change-Id: I4ac774d16540306fdb1301f9f182eeea8571388b CRs-Fixed: 2045120 --- os_if/linux/qca_vendor.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/os_if/linux/qca_vendor.h b/os_if/linux/qca_vendor.h index 596ff094aa07..91aa93a1338d 100644 --- a/os_if/linux/qca_vendor.h +++ b/os_if/linux/qca_vendor.h @@ -652,9 +652,7 @@ enum qca_wlan_vendor_attr_get_station_info { */ enum qca_nl80211_vendor_subcmds_index { -#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC) QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX = 0, -#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */ #ifdef WLAN_FEATURE_NAN QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX, From 4881d6d5433fb3867d2e26e468b989cc5f3af5ee Mon Sep 17 00:00:00 2001 From: "Baila, Shashikala Prabhu" Date: Tue, 23 May 2017 11:17:55 +0530 Subject: [PATCH 4/6] qcacmn: Fix setcountry code and getcountry code failure offload_enabled flag is set to true for full-offload. Currently full-offload is using HOST regdb, therefore set country code and get country is failing. Change-Id: Idd3a7300bcc1ec1934e7258c87d5bd989ecaf5bf CRs-Fixed: 2047212 --- umac/regulatory/core/src/reg_services.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 0d692425e79e..18c9e1a101b1 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -2638,9 +2638,6 @@ QDF_STATUS reg_program_chan_list(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - if (soc_reg->offload_enabled) - return QDF_STATUS_E_FAILURE; - reg_info = (struct cur_regulatory_info *)qdf_mem_malloc (sizeof(struct cur_regulatory_info)); if (reg_info == NULL) { @@ -2705,9 +2702,6 @@ QDF_STATUS reg_get_current_cc(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - if (soc_reg->offload_enabled) - return QDF_STATUS_E_FAILURE; - if (rd->flags == CC_IS_SET) { rd->cc.country_code = soc_reg->ctry_code; } else if (rd->flags == ALPHA_IS_SET) { From bc3efea88525aca39499ba67d5f88a5dd229487e Mon Sep 17 00:00:00 2001 From: "Baila, Shashikala Prabhu" Date: Tue, 23 May 2017 11:54:45 +0530 Subject: [PATCH 5/6] qcacmn: Add API to get 2GHz/5GHz freq range and wireless modes Offload layer uses low and high 2GHz/5GHz freq ranges and chip supported wireless modes to populate umac ic channel list. Change-Id: I899edd83548d68e67659b3a9273ddaaaf740540b CRs-Fixed: 2047212 --- target_if/core/src/target_if_main.c | 6 +-- target_if/regulatory/src/target_if_reg.c | 3 ++ .../lmac_if/inc/wlan_lmac_if_def.h | 2 + umac/regulatory/core/src/reg_db_parser.c | 6 +++ umac/regulatory/core/src/reg_priv.h | 1 + umac/regulatory/core/src/reg_services.c | 16 ++++---- .../dispatcher/inc/wlan_reg_services_api.h | 25 +++++++++++ .../dispatcher/src/wlan_reg_services_api.c | 41 +++++++++++++++++++ 8 files changed, 88 insertions(+), 12 deletions(-) diff --git a/target_if/core/src/target_if_main.c b/target_if/core/src/target_if_main.c index 30a15b29ec77..4f74ad29245e 100644 --- a/target_if/core/src/target_if_main.c +++ b/target_if/core/src/target_if_main.c @@ -211,6 +211,9 @@ static void target_if_sptrl_tx_ops_register( static QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) { + /* call regulatory callback to register tx ops */ + target_if_register_regulatory_tx_ops(tx_ops); + /* call umac callback to register legacy tx ops */ wlan_lmac_if_umac_tx_ops_register(tx_ops); @@ -227,9 +230,6 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) target_if_dfs_tx_ops_register(tx_ops); - /* call regulatory callback to register tx ops */ - target_if_register_regulatory_tx_ops(tx_ops); - target_if_son_tx_ops_register(tx_ops); target_if_tdls_tx_ops_register(tx_ops); diff --git a/target_if/regulatory/src/target_if_reg.c b/target_if/regulatory/src/target_if_reg.c index 180e8858efcb..e44a6d857074 100644 --- a/target_if/regulatory/src/target_if_reg.c +++ b/target_if/regulatory/src/target_if_reg.c @@ -148,6 +148,9 @@ QDF_STATUS target_if_register_regulatory_tx_ops(struct wlan_lmac_if_tx_ops tgt_if_regulatory_unregister_master_list_handler; reg_ops->set_country_code = tgt_if_regulatory_set_country_code; + + reg_ops->fill_umac_legacy_chanlist = NULL; + return QDF_STATUS_SUCCESS; } diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 3bf877809498..c48ffa876d62 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -544,6 +544,8 @@ struct wlan_lmac_if_reg_tx_ops { void *arg); QDF_STATUS (*set_country_code)(struct wlan_objmgr_psoc *psoc, void *arg); + QDF_STATUS (*fill_umac_legacy_chanlist)(struct wlan_objmgr_pdev *pdev, + struct regulatory_channel *cur_chan_list); }; /** diff --git a/umac/regulatory/core/src/reg_db_parser.c b/umac/regulatory/core/src/reg_db_parser.c index 2644056c6c4a..7bae7a933525 100644 --- a/umac/regulatory/core/src/reg_db_parser.c +++ b/umac/regulatory/core/src/reg_db_parser.c @@ -212,6 +212,9 @@ static inline QDF_STATUS reg_get_reginfo_form_country_code_and_regdmn_pair( g_all_countries[country_index].alpha2_11d, sizeof(g_all_countries[country_index].alpha2_11d)); + reg_info->ctry_code = + g_all_countries[country_index].country_code; + reg_info->reg_dmn_pair = 0; reg_info->dfs_region = regdomains_5g[dmn_id_5g].dfs_region; reg_info->phybitmap = g_all_countries[country_index].phymode_bitmap; @@ -276,6 +279,9 @@ static inline QDF_STATUS reg_get_reginfo_form_regdmn_pair( qdf_mem_zero(reg_info->alpha2, sizeof(reg_info->alpha2)); + reg_info->reg_dmn_pair = + g_reg_dmn_pairs[regdmn_pair].reg_dmn_pair_id; + reg_info->ctry_code = 0; reg_info->dfs_region = regdomains_5g[dmn_id_5g].dfs_region; reg_info->phybitmap = 0; diff --git a/umac/regulatory/core/src/reg_priv.h b/umac/regulatory/core/src/reg_priv.h index ae83a0206163..762e23fb31d9 100644 --- a/umac/regulatory/core/src/reg_priv.h +++ b/umac/regulatory/core/src/reg_priv.h @@ -84,6 +84,7 @@ struct wlan_regulatory_pdev_priv_obj { bool set_fcc_channel; enum band_info band_capability; bool indoor_chan_enabled; + uint32_t wireless_modes; }; #endif diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 18c9e1a101b1..ec02bd151318 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -1716,6 +1716,7 @@ static void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc, struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; enum direction *dir = arg; + struct wlan_lmac_if_reg_tx_ops *reg_tx_ops; wlan_psoc_obj_lock(psoc); psoc_priv_obj = (struct wlan_regulatory_psoc_priv_obj *) @@ -1740,6 +1741,11 @@ static void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc, compute_pdev_current_chan_list(pdev_priv_obj); + reg_tx_ops = reg_get_psoc_tx_ops(psoc); + if(reg_tx_ops->fill_umac_legacy_chanlist) + reg_tx_ops->fill_umac_legacy_chanlist(pdev, + pdev_priv_obj->cur_chan_list); + if (*dir == NORTHBOUND) send_scheduler_msg_nb(psoc, pdev); else @@ -2171,6 +2177,7 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification( pdev_priv_obj->range_2g_high = range_2g_high; pdev_priv_obj->range_5g_low = range_5g_low; pdev_priv_obj->range_5g_high = range_5g_high; + pdev_priv_obj->wireless_modes = reg_cap_ptr->wireless_modes; init_pdev_chan_list(psoc_priv_obj, pdev_priv_obj); @@ -2669,15 +2676,6 @@ QDF_STATUS reg_program_chan_list(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - if (rd->flags == CC_IS_SET || - rd->flags == ALPHA_IS_SET) { - soc_reg->ctry_code = - g_all_countries[country_index].country_code; - } - - if (rd->flags == REGDMN_IS_SET) - soc_reg->reg_dmn_pair = rd->cc.regdmn_id; - reg_info->offload_enabled = false; reg_process_master_chan_list(reg_info); diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 32bb754203ac..851d00cba9c1 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -360,4 +360,29 @@ void wlan_reg_register_chan_change_callback(struct wlan_objmgr_psoc *psoc, void wlan_reg_unregister_chan_change_callback(struct wlan_objmgr_psoc *psoc, reg_chan_change_callback cbk); +/** + * wlan_reg_get_chip_mode() - get supported chip mode + * @pdev: pdev pointer + * @chip_mode: chip mode + * + * Return: QDF STATUS + */ +QDF_STATUS wlan_reg_get_chip_mode(struct wlan_objmgr_pdev *pdev, + uint32_t *chip_mode); + +/** + * wlan_reg_get_freq_range() - Get 2GHz and 5GHz frequency range + * @pdev: pdev pointer + * @low_2g: low 2GHz frequency range + * @high_2g: high 2GHz frequency range + * @low_5g: low 5GHz frequency range + * @high_5g: high 5GHz frequency range + * + * Return: QDF status + */ +QDF_STATUS wlan_reg_get_freq_range(struct wlan_objmgr_pdev *pdev, + uint32_t *low_2g, + uint32_t *high_2g, + uint32_t *low_5g, + uint32_t *high_5g); #endif diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index 2e685a8e9e70..810b8fad569b 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -409,3 +409,44 @@ void wlan_reg_unregister_chan_change_callback(struct wlan_objmgr_psoc *psoc, } +QDF_STATUS wlan_reg_get_chip_mode(struct wlan_objmgr_pdev *pdev, + uint32_t *chip_mode) +{ + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + + pdev_priv_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev, + WLAN_UMAC_COMP_REGULATORY); + + if (NULL == pdev_priv_obj) { + reg_err("reg pdev private obj is NULL"); + return QDF_STATUS_E_FAULT; + } + + *chip_mode = pdev_priv_obj->wireless_modes; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_reg_get_freq_range(struct wlan_objmgr_pdev *pdev, + uint32_t *low_2g, + uint32_t *high_2g, + uint32_t *low_5g, + uint32_t *high_5g) +{ + struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + + pdev_priv_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev, + WLAN_UMAC_COMP_REGULATORY); + + if (NULL == pdev_priv_obj) { + reg_err("reg pdev private obj is NULL"); + return QDF_STATUS_E_FAULT; + } + + *low_2g = pdev_priv_obj->range_2g_low; + *high_2g = pdev_priv_obj->range_2g_high; + *low_5g = pdev_priv_obj->range_5g_low; + *high_5g = pdev_priv_obj->range_5g_high; + + return QDF_STATUS_SUCCESS; +} From 9737bd7da56dafffc133bc203e306c9f1192e76a Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Fri, 26 May 2017 20:59:19 -0700 Subject: [PATCH 6/6] qcacmn: Make WLAN_LRO_ENABLE as 1 to enable LRO WLAN_LRO_ENABLE is checked for 1 in enabled case. So change macro WLAN_LRO_ENABLE to 1 enable LRO Change-Id: Ic1be57596633a5998c7a1db6c0d611ea3c5867cf CRs-Fixed: 2042812 --- wlan_cfg/wlan_cfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index ba78a6945e79..f1a9c959c754 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -81,9 +81,11 @@ #ifdef CONFIG_MCL #define WLAN_CFG_PER_PDEV_RX_RING 0 #define NUM_RXDMA_RINGS_PER_PDEV 2 +#define WLAN_LRO_ENABLE 1 #else #define WLAN_CFG_PER_PDEV_RX_RING 1 #define NUM_RXDMA_RINGS_PER_PDEV 1 +#define WLAN_LRO_ENABLE 0 #endif #ifdef WLAN_RX_HASH @@ -91,7 +93,6 @@ #else #define WLAN_RX_HASH_ENABLE 0 #endif -#define WLAN_LRO_ENABLE 0 static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { WLAN_CFG_TX_RING_MASK_0,