diff options
| author | Rajeev Kumar <rajekuma@qca.qualcomm.com> | 2014-04-24 12:23:45 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-04-26 19:24:26 -0700 |
| commit | a32d0cb2b5b6253ad2bc6e59e4bfe89d35be8759 (patch) | |
| tree | 20ce7e811b012ffaa06d31f9d0c77d13a0cc6a53 | |
| parent | 90dad76e2604b7c77e5dd80b60f92df7bba5a6c6 (diff) | |
qcacld: Proper API usage for packet log config
Add proper API usage for packet log configuration
Change-Id: I9f8a9d300e80841a3d5fe40923bc1b5bc17eb08a
CRs-fixed: 654721
| -rw-r--r-- | CORE/CLD_TXRX/HTT/htt.c | 8 | ||||
| -rw-r--r-- | CORE/CLD_TXRX/HTT/htt_h2t.c | 57 | ||||
| -rw-r--r-- | CORE/CLD_TXRX/HTT/htt_internal.h | 4 | ||||
| -rw-r--r-- | CORE/CLD_TXRX/TXRX/ol_cfg.c | 14 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/htc_api.h | 4 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/ol_cfg.h | 11 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wdi_in.h | 1 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/if_pci.c | 23 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/if_pci.h | 6 | ||||
| -rw-r--r-- | CORE/SERVICES/HTC/htc_services.c | 11 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 5 | ||||
| -rw-r--r-- | CORE/UTILS/PKTLOG/pktlog_ac.c | 2 |
12 files changed, 99 insertions, 47 deletions
diff --git a/CORE/CLD_TXRX/HTT/htt.c b/CORE/CLD_TXRX/HTT/htt.c index f4c0e47b0b6e..aec084192633 100644 --- a/CORE/CLD_TXRX/HTT/htt.c +++ b/CORE/CLD_TXRX/HTT/htt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -429,3 +429,9 @@ htt_display(htt_pdev_handle pdev, int indent) pdev->rx_ring.sw_rd_idx.msdu_payld); } #endif + +/* Disable ASPM : Disable PCIe low power */ +void htt_htc_disable_aspm(void) +{ + htc_disable_aspm(); +} diff --git a/CORE/CLD_TXRX/HTT/htt_h2t.c b/CORE/CLD_TXRX/HTT/htt_h2t.c index 9e0b2146daf3..a88512815888 100644 --- a/CORE/CLD_TXRX/HTT/htt_h2t.c +++ b/CORE/CLD_TXRX/HTT/htt_h2t.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -49,9 +49,6 @@ #include <htt.h> /* HTT host->target msg defs */ #include <ol_txrx_htt_api.h> /* ol_tx_completion_handler, htt_tx_status */ #include <ol_htt_tx_api.h> -#include "vos_api.h" -#include "vos_sched.h" -#include "if_pci.h" #include <htt_internal.h> @@ -228,36 +225,30 @@ htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev) msg_word++; *msg_word = 0; #ifndef REMOVE_PKT_LOG - { - void *vos_context = NULL; - - vos_context = vos_get_global_context(VOS_MODULE_ID_HIF, NULL); - - if ((NULL != vos_context) && (vos_is_packet_log_enabled())) - { - enable_ctrl_data = 1; - enable_mgmt_data = 1; - enable_null_data = 1; - enable_phy_data = 1; - enable_hdr = 1; - enable_ppdu_start= 1; - enable_ppdu_end = 1; - adf_os_print("Pkt log is enabled -> disable ASPM\n"); - hif_disable_aspm(((VosContextType*)vos_context)->pHIFContext); - /*Disable ASPM when pkt log is enabled*/ - } - else - { - adf_os_print("Pkt log is disabled \n"); - enable_ctrl_data = 0; - enable_mgmt_data = 0; - enable_null_data = 0; - enable_phy_data = 0; - enable_hdr = 0; - enable_ppdu_start= 0; - enable_ppdu_end = 0; + if (ol_cfg_is_packet_log_enabled(pdev->ctrl_pdev)) + { + enable_ctrl_data = 1; + enable_mgmt_data = 1; + enable_null_data = 1; + enable_phy_data = 1; + enable_hdr = 1; + enable_ppdu_start= 1; + enable_ppdu_end = 1; + /* Disable ASPM when pkt log is enabled */ + adf_os_print("Pkt log is enabled\n"); + htt_htc_disable_aspm(); + } + else + { + adf_os_print("Pkt log is disabled\n"); + enable_ctrl_data = 0; + enable_mgmt_data = 0; + enable_null_data = 0; + enable_phy_data = 0; + enable_hdr = 0; + enable_ppdu_start= 0; + enable_ppdu_end = 0; } -} #else enable_ctrl_data = 0; enable_mgmt_data = 0; diff --git a/CORE/CLD_TXRX/HTT/htt_internal.h b/CORE/CLD_TXRX/HTT/htt_internal.h index 9e50d4fb83e2..72eee990b943 100644 --- a/CORE/CLD_TXRX/HTT/htt_internal.h +++ b/CORE/CLD_TXRX/HTT/htt_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -392,4 +392,6 @@ void htt_htc_misc_pkt_pool_free(struct htt_pdev_t *pdev); #endif +void htt_htc_disable_aspm(void); + #endif /* _HTT_INTERNAL__H_ */ diff --git a/CORE/CLD_TXRX/TXRX/ol_cfg.c b/CORE/CLD_TXRX/TXRX/ol_cfg.c index 7610ae7925a2..7b3968130b2e 100644 --- a/CORE/CLD_TXRX/TXRX/ol_cfg.c +++ b/CORE/CLD_TXRX/TXRX/ol_cfg.c @@ -76,6 +76,8 @@ ol_pdev_handle ol_pdev_cfg_attach(adf_os_device_t osdev) cfg_ctx->target_tx_credit = CFG_TGT_NUM_MSDU_DESC; cfg_ctx->throttle_period_ms = 40; cfg_ctx->rx_fwd_disabled = 0; + cfg_ctx->is_packet_log_enabled = 0; + return (ol_pdev_handle) cfg_ctx; } @@ -119,6 +121,18 @@ void ol_set_cfg_rx_fwd_disabled(ol_pdev_handle pdev, u_int8_t disable_rx_fwd) cfg->rx_fwd_disabled = disable_rx_fwd; } +void ol_set_cfg_packet_log_enabled(ol_pdev_handle pdev, u_int8_t val) +{ + struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev; + cfg->is_packet_log_enabled = val; +} + +u_int8_t ol_cfg_is_packet_log_enabled(ol_pdev_handle pdev) +{ + struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev; + return cfg->is_packet_log_enabled; +} + int ol_cfg_rx_fwd_disabled(ol_pdev_handle pdev) { #if defined(ATHR_WIN_NWF) diff --git a/CORE/SERVICES/COMMON/htc_api.h b/CORE/SERVICES/COMMON/htc_api.h index d359e24100ef..93e3dfa72881 100644 --- a/CORE/SERVICES/COMMON/htc_api.h +++ b/CORE/SERVICES/COMMON/htc_api.h @@ -688,4 +688,8 @@ void HTC_dump_counter_info(HTC_HANDLE HTCHandle); void *htc_get_targetdef(HTC_HANDLE htc_handle); void HTCSetTargetToSleep(void *context); void HTCCancelDeferredTargetSleep(void *context); + +/* Disable ASPM : Disable PCIe low power */ +void htc_disable_aspm(void); + #endif /* _HTC_API_H_ */ diff --git a/CORE/SERVICES/COMMON/ol_cfg.h b/CORE/SERVICES/COMMON/ol_cfg.h index c7797137d1c8..508ed9f200e7 100644 --- a/CORE/SERVICES/COMMON/ol_cfg.h +++ b/CORE/SERVICES/COMMON/ol_cfg.h @@ -68,6 +68,7 @@ struct txrx_pdev_cfg_t { u32 throttle_period_ms; enum wlan_frm_fmt frame_type; u8 rx_fwd_disabled; + u8 is_packet_log_enabled; }; /** @@ -429,4 +430,14 @@ ol_tx_cfg_max_tx_queue_depth_ll(ol_pdev_handle pdev) return 1500; } +/** + * @brief Set packet log config in HTT config based on CFG ini configuration + */ +void ol_set_cfg_packet_log_enabled(ol_pdev_handle pdev, u_int8_t val); + +/** + * @brief Get packet log config from HTT config + */ +u_int8_t ol_cfg_is_packet_log_enabled(ol_pdev_handle pdev); + #endif /* _OL_CFG__H_ */ diff --git a/CORE/SERVICES/COMMON/wdi_in.h b/CORE/SERVICES/COMMON/wdi_in.h index 202984785fc5..bedc09137594 100644 --- a/CORE/SERVICES/COMMON/wdi_in.h +++ b/CORE/SERVICES/COMMON/wdi_in.h @@ -1263,6 +1263,7 @@ ol_tx_queue_log_display(ol_txrx_pdev_handle pdev); #define wdi_in_event_sub wdi_event_sub #define wdi_in_event_unsub wdi_event_unsub #define wdi_in_set_cfg_rx_fwd_disabled ol_set_cfg_rx_fwd_disabled +#define wdi_in_set_cfg_pakcet_log_enabled ol_set_cfg_packet_log_enabled #endif /* WDI_API_AS_FUNCS / MACROS */ diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c index 9269750d46a3..5784c721e7d6 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.c +++ b/CORE/SERVICES/HIF/PCIe/if_pci.c @@ -1783,13 +1783,22 @@ void hif_reset_soc(void *ol_sc) #endif } -void hif_disable_aspm(void *ol_sc) +void hif_disable_aspm(void) { - u_int32_t lcr_val = 0; - struct ol_softc *scn = (struct ol_softc *)ol_sc; - struct hif_pci_softc *sc = scn->hif_sc; + u_int32_t lcr_val = 0; + void *vos_context = vos_get_global_context(VOS_MODULE_ID_HIF, NULL); + struct ol_softc *scn = vos_get_context(VOS_MODULE_ID_HIF, vos_context); + struct hif_pci_softc *sc; + + if (NULL == scn) + { + printk(KERN_ERR "%s: Could not disable ASPM scn is null\n", __func__); + return; + } + + sc = scn->hif_sc; - /*Disable ASPM when pkt log is enabled*/ - pci_read_config_dword(sc->pdev, 0x80, &lcr_val); - pci_write_config_dword(sc->pdev, 0x80, (lcr_val & 0xffffff00)); + /* Disable ASPM when pkt log is enabled */ + pci_read_config_dword(sc->pdev, 0x80, &lcr_val); + pci_write_config_dword(sc->pdev, 0x80, (lcr_val & 0xffffff00)); } diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.h b/CORE/SERVICES/HIF/PCIe/if_pci.h index c6850444847f..fd5ffe2b98ea 100644 --- a/CORE/SERVICES/HIF/PCIe/if_pci.h +++ b/CORE/SERVICES/HIF/PCIe/if_pci.h @@ -115,11 +115,11 @@ adf_os_size_t initBufferCount(adf_os_size_t maxSize); void hif_init_pdev_txrx_handle(void *ol_sc, void *txrx_handle); void hif_disable_isr(void *ol_sc); -/* Function to reset SoC*/ +/* Function to reset SoC */ void hif_reset_soc(void *ol_sc); -/* Function to disable ASPM*/ -void hif_disable_aspm(void *ol_sc); +/* Function to disable ASPM */ +void hif_disable_aspm(void); void hif_init_adf_ctx(adf_os_device_t adf_dev, void *ol_sc); diff --git a/CORE/SERVICES/HTC/htc_services.c b/CORE/SERVICES/HTC/htc_services.c index a19f0054ba2e..c12009dd8d59 100644 --- a/CORE/SERVICES/HTC/htc_services.c +++ b/CORE/SERVICES/HTC/htc_services.c @@ -28,6 +28,9 @@ #include "htc_internal.h" #include <adf_nbuf.h> /* adf_nbuf_t */ +#if defined(HIF_PCI) +#include "if_pci.h" +#endif extern unsigned int htc_credit_flow; @@ -317,3 +320,11 @@ void HTCFwEventHandler(void *context) initInfo->TargetFailure(initInfo->pContext, A_ERROR); } } + +/* Disable ASPM : disable PCIe low power */ +void htc_disable_aspm(void) +{ +#if defined(HIF_PCI) + hif_disable_aspm(); +#endif +} diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index c08bc6e954b8..8c67150d5418 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -2877,6 +2877,11 @@ VOS_STATUS WDA_open(v_VOID_t *vos_context, v_VOID_t *os_ctx, wdi_in_set_cfg_rx_fwd_disabled((ol_pdev_handle)((pVosContextType)vos_context)->cfg_ctx, (u_int8_t)mac_params->apDisableIntraBssFwd); + /* adjust the packet log enable default value based on CFG INI setting */ + wdi_in_set_cfg_pakcet_log_enabled((ol_pdev_handle) + ((pVosContextType)vos_context)->cfg_ctx, (u_int8_t)vos_is_packet_log_enabled()); + + /* Allocate dfs_ic and initialize DFS */ wma_handle->dfs_ic = wma_dfs_attach(wma_handle->dfs_ic); if(wma_handle->dfs_ic == NULL) { diff --git a/CORE/UTILS/PKTLOG/pktlog_ac.c b/CORE/UTILS/PKTLOG/pktlog_ac.c index 8c8e14b9e72d..3ff3ac427b9d 100644 --- a/CORE/UTILS/PKTLOG/pktlog_ac.c +++ b/CORE/UTILS/PKTLOG/pktlog_ac.c @@ -304,8 +304,6 @@ pktlog_init(struct ol_softc *scn) PKTLOG_RX_REMOTE_SUBSCRIBER.callback = pktlog_callback; PKTLOG_RCFIND_SUBSCRIBER.callback = pktlog_callback; PKTLOG_RCUPDATE_SUBSCRIBER.callback = pktlog_callback; - - printk("pktlog initialized\n"); } int |
