diff --git a/hif/inc/hif.h b/hif/inc/hif.h index f2d25427e7..b5cda40aa9 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -33,9 +33,6 @@ extern "C" { #endif /* __cplusplus */ /* Header files */ -#include "athdefs.h" -#include "a_types.h" -#include "osapi_linux.h" #include #include "qdf_nbuf.h" #include "ol_if_athvar.h" @@ -234,10 +231,20 @@ struct htc_callbacks { int (*dsrHandler)(void *context); }; -struct hif_callbacks { +/** + * struct hif_driver_state_callbacks - Callbacks for HIF to query Driver state + * @context: Private data context + * @set_recovery_in_progress: To Set Driver state for recovery in progress + * @is_recovery_in_progress: Query if driver state is recovery in progress + * @is_load_unload_in_progress: Query if driver state Load/Unload in Progress + * @is_driver_unloading: Query if driver is unloading. + * + * This Structure provides callback pointer for HIF to query hdd for driver + * states. + */ +struct hif_driver_state_callbacks { void *context; void (*set_recovery_in_progress)(void *context, uint8_t val); - uint64_t (*get_monotonic_boottime)(void); bool (*is_recovery_in_progress)(void *context); bool (*is_load_unload_in_progress)(void *context); bool (*is_driver_unloading)(void *context); @@ -406,7 +413,7 @@ void hif_save_htc_htt_config_endpoint(struct hif_opaque_softc *hif_ctx, int htc_endpoint); struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx, uint32_t mode, enum qdf_bus_type bus_type, - struct hif_callbacks *cbk); + struct hif_driver_state_callbacks *cbk); void hif_close(struct hif_opaque_softc *hif_ctx); QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev, void *bdev, const hif_bus_id *bid, diff --git a/hif/inc/regtable_pcie.h b/hif/inc/regtable_pcie.h index 81f7a5c17a..7c22c706bf 100644 --- a/hif/inc/regtable_pcie.h +++ b/hif/inc/regtable_pcie.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -700,65 +700,65 @@ struct targetdef_s { #endif struct hostdef_s { - A_UINT32 d_INT_STATUS_ENABLE_ERROR_LSB; - A_UINT32 d_INT_STATUS_ENABLE_ERROR_MASK; - A_UINT32 d_INT_STATUS_ENABLE_CPU_LSB; - A_UINT32 d_INT_STATUS_ENABLE_CPU_MASK; - A_UINT32 d_INT_STATUS_ENABLE_COUNTER_LSB; - A_UINT32 d_INT_STATUS_ENABLE_COUNTER_MASK; - A_UINT32 d_INT_STATUS_ENABLE_MBOX_DATA_LSB; - A_UINT32 d_INT_STATUS_ENABLE_MBOX_DATA_MASK; - A_UINT32 d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB; - A_UINT32 d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK; - A_UINT32 d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB; - A_UINT32 d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK; - A_UINT32 d_COUNTER_INT_STATUS_ENABLE_BIT_LSB; - A_UINT32 d_COUNTER_INT_STATUS_ENABLE_BIT_MASK; - A_UINT32 d_INT_STATUS_ENABLE_ADDRESS; - A_UINT32 d_CPU_INT_STATUS_ENABLE_BIT_LSB; - A_UINT32 d_CPU_INT_STATUS_ENABLE_BIT_MASK; - A_UINT32 d_HOST_INT_STATUS_ADDRESS; - A_UINT32 d_CPU_INT_STATUS_ADDRESS; - A_UINT32 d_ERROR_INT_STATUS_ADDRESS; - A_UINT32 d_ERROR_INT_STATUS_WAKEUP_MASK; - A_UINT32 d_ERROR_INT_STATUS_WAKEUP_LSB; - A_UINT32 d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK; - A_UINT32 d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB; - A_UINT32 d_ERROR_INT_STATUS_TX_OVERFLOW_MASK; - A_UINT32 d_ERROR_INT_STATUS_TX_OVERFLOW_LSB; - A_UINT32 d_COUNT_DEC_ADDRESS; - A_UINT32 d_HOST_INT_STATUS_CPU_MASK; - A_UINT32 d_HOST_INT_STATUS_CPU_LSB; - A_UINT32 d_HOST_INT_STATUS_ERROR_MASK; - A_UINT32 d_HOST_INT_STATUS_ERROR_LSB; - A_UINT32 d_HOST_INT_STATUS_COUNTER_MASK; - A_UINT32 d_HOST_INT_STATUS_COUNTER_LSB; - A_UINT32 d_RX_LOOKAHEAD_VALID_ADDRESS; - A_UINT32 d_WINDOW_DATA_ADDRESS; - A_UINT32 d_WINDOW_READ_ADDR_ADDRESS; - A_UINT32 d_WINDOW_WRITE_ADDR_ADDRESS; - A_UINT32 d_SOC_GLOBAL_RESET_ADDRESS; - A_UINT32 d_RTC_STATE_ADDRESS; - A_UINT32 d_RTC_STATE_COLD_RESET_MASK; - A_UINT32 d_PCIE_LOCAL_BASE_ADDRESS; - A_UINT32 d_PCIE_SOC_WAKE_RESET; - A_UINT32 d_PCIE_SOC_WAKE_ADDRESS; - A_UINT32 d_PCIE_SOC_WAKE_V_MASK; - A_UINT32 d_RTC_STATE_V_MASK; - A_UINT32 d_RTC_STATE_V_LSB; - A_UINT32 d_FW_IND_EVENT_PENDING; - A_UINT32 d_FW_IND_INITIALIZED; - A_UINT32 d_FW_IND_HELPER; - A_UINT32 d_RTC_STATE_V_ON; + uint32_t d_INT_STATUS_ENABLE_ERROR_LSB; + uint32_t d_INT_STATUS_ENABLE_ERROR_MASK; + uint32_t d_INT_STATUS_ENABLE_CPU_LSB; + uint32_t d_INT_STATUS_ENABLE_CPU_MASK; + uint32_t d_INT_STATUS_ENABLE_COUNTER_LSB; + uint32_t d_INT_STATUS_ENABLE_COUNTER_MASK; + uint32_t d_INT_STATUS_ENABLE_MBOX_DATA_LSB; + uint32_t d_INT_STATUS_ENABLE_MBOX_DATA_MASK; + uint32_t d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB; + uint32_t d_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK; + uint32_t d_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB; + uint32_t d_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK; + uint32_t d_COUNTER_INT_STATUS_ENABLE_BIT_LSB; + uint32_t d_COUNTER_INT_STATUS_ENABLE_BIT_MASK; + uint32_t d_INT_STATUS_ENABLE_ADDRESS; + uint32_t d_CPU_INT_STATUS_ENABLE_BIT_LSB; + uint32_t d_CPU_INT_STATUS_ENABLE_BIT_MASK; + uint32_t d_HOST_INT_STATUS_ADDRESS; + uint32_t d_CPU_INT_STATUS_ADDRESS; + uint32_t d_ERROR_INT_STATUS_ADDRESS; + uint32_t d_ERROR_INT_STATUS_WAKEUP_MASK; + uint32_t d_ERROR_INT_STATUS_WAKEUP_LSB; + uint32_t d_ERROR_INT_STATUS_RX_UNDERFLOW_MASK; + uint32_t d_ERROR_INT_STATUS_RX_UNDERFLOW_LSB; + uint32_t d_ERROR_INT_STATUS_TX_OVERFLOW_MASK; + uint32_t d_ERROR_INT_STATUS_TX_OVERFLOW_LSB; + uint32_t d_COUNT_DEC_ADDRESS; + uint32_t d_HOST_INT_STATUS_CPU_MASK; + uint32_t d_HOST_INT_STATUS_CPU_LSB; + uint32_t d_HOST_INT_STATUS_ERROR_MASK; + uint32_t d_HOST_INT_STATUS_ERROR_LSB; + uint32_t d_HOST_INT_STATUS_COUNTER_MASK; + uint32_t d_HOST_INT_STATUS_COUNTER_LSB; + uint32_t d_RX_LOOKAHEAD_VALID_ADDRESS; + uint32_t d_WINDOW_DATA_ADDRESS; + uint32_t d_WINDOW_READ_ADDR_ADDRESS; + uint32_t d_WINDOW_WRITE_ADDR_ADDRESS; + uint32_t d_SOC_GLOBAL_RESET_ADDRESS; + uint32_t d_RTC_STATE_ADDRESS; + uint32_t d_RTC_STATE_COLD_RESET_MASK; + uint32_t d_PCIE_LOCAL_BASE_ADDRESS; + uint32_t d_PCIE_SOC_WAKE_RESET; + uint32_t d_PCIE_SOC_WAKE_ADDRESS; + uint32_t d_PCIE_SOC_WAKE_V_MASK; + uint32_t d_RTC_STATE_V_MASK; + uint32_t d_RTC_STATE_V_LSB; + uint32_t d_FW_IND_EVENT_PENDING; + uint32_t d_FW_IND_INITIALIZED; + uint32_t d_FW_IND_HELPER; + uint32_t d_RTC_STATE_V_ON; #if defined(SDIO_3_0) - A_UINT32 d_HOST_INT_STATUS_MBOX_DATA_MASK; - A_UINT32 d_HOST_INT_STATUS_MBOX_DATA_LSB; + uint32_t d_HOST_INT_STATUS_MBOX_DATA_MASK; + uint32_t d_HOST_INT_STATUS_MBOX_DATA_LSB; #endif - A_UINT32 d_PCIE_SOC_RDY_STATUS_ADDRESS; - A_UINT32 d_PCIE_SOC_RDY_STATUS_BAR_MASK; - A_UINT32 d_SOC_PCIE_BASE_ADDRESS; - A_UINT32 d_MSI_MAGIC_ADR_ADDRESS; - A_UINT32 d_MSI_MAGIC_ADDRESS; + uint32_t d_PCIE_SOC_RDY_STATUS_ADDRESS; + uint32_t d_PCIE_SOC_RDY_STATUS_BAR_MASK; + uint32_t d_SOC_PCIE_BASE_ADDRESS; + uint32_t d_MSI_MAGIC_ADR_ADDRESS; + uint32_t d_MSI_MAGIC_ADDRESS; uint32_t d_HOST_CE_COUNT; uint32_t d_ENABLE_MSI; uint32_t d_MUX_ID_MASK; diff --git a/hif/src/ce/ce_bmi.c b/hif/src/ce/ce_bmi.c index fb3d43b0ee..88515e4fd9 100644 --- a/hif/src/ce/ce_bmi.c +++ b/hif/src/ce/ce_bmi.c @@ -25,10 +25,6 @@ * to the Linux Foundation. */ -#include -#include "a_types.h" -#include "athdefs.h" -#include "osapi_linux.h" #include "targcfg.h" #include "qdf_lock.h" #include "qdf_status.h" diff --git a/hif/src/ce/ce_diag.c b/hif/src/ce/ce_diag.c index 3ac963c5cd..14d8910703 100644 --- a/hif/src/ce/ce_diag.c +++ b/hif/src/ce/ce_diag.c @@ -25,10 +25,6 @@ * to the Linux Foundation. */ -#include -#include "a_types.h" -#include "athdefs.h" -#include "osapi_linux.h" #include "targcfg.h" #include "qdf_lock.h" #include "qdf_status.h" diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 84aee3fe9c..c83a618ed2 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -24,10 +24,6 @@ * under proprietary terms before Copyright ownership was assigned * to the Linux Foundation. */ -#include -#include "a_types.h" -#include "athdefs.h" -#include "osapi_linux.h" #include "targcfg.h" #include "qdf_lock.h" #include "qdf_status.h" diff --git a/hif/src/ce/ce_service.c b/hif/src/ce/ce_service.c index 2341f83364..2f1c0a4b98 100644 --- a/hif/src/ce/ce_service.c +++ b/hif/src/ce/ce_service.c @@ -25,10 +25,6 @@ * to the Linux Foundation. */ -#include -#include "a_types.h" -#include -#include "osapi_linux.h" #include "hif.h" #include "hif_io32.h" #include "ce_api.h" @@ -138,19 +134,13 @@ void hif_record_ce_desc_event(struct hif_softc *scn, int ce_id, union ce_desc *descriptor, void *memory, int index) { - struct hif_callbacks *cbk = hif_get_callbacks_handle(scn); int record_index = get_next_record_index( &hif_ce_desc_history_index[ce_id], HIF_CE_HISTORY_MAX); struct hif_ce_desc_event *event = &hif_ce_desc_history[ce_id][record_index]; event->type = type; - - if (cbk && cbk->get_monotonic_boottime) - event->time = cbk->get_monotonic_boottime(); - else - event->time = ((uint64_t)qdf_system_ticks_to_msecs( - qdf_system_ticks()) * 1000); + event->time = qdf_get_monotonic_boottime(); if (descriptor != NULL) event->descriptor = *descriptor; diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c index 449645d2b9..df87f4bc09 100644 --- a/hif/src/ce/ce_tasklet.c +++ b/hif/src/ce/ce_tasklet.c @@ -25,13 +25,10 @@ * to the Linux Foundation. */ -#include #include #include #include #include -#include "a_types.h" -#include "athdefs.h" #include "qdf_lock.h" #include "qdf_types.h" #include "qdf_status.h" diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index bab578225e..99748c0328 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -25,10 +25,6 @@ * to the Linux Foundation. */ -#include -#include "a_types.h" -#include "athdefs.h" -#include "osapi_linux.h" #include "targcfg.h" #include "qdf_lock.h" #include "qdf_status.h" @@ -407,7 +403,7 @@ void hif_get_hw_info(struct hif_opaque_softc *scn, u32 *version, u32 *revision, */ struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx, uint32_t mode, enum qdf_bus_type bus_type, - struct hif_callbacks *cbk) + struct hif_driver_state_callbacks *cbk) { struct hif_softc *scn; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -432,7 +428,7 @@ struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx, uint32_t mode, qdf_atomic_init(&scn->active_tasklet_cnt); qdf_atomic_init(&scn->link_suspended); qdf_atomic_init(&scn->tasklet_from_intr); - qdf_mem_copy(&scn->callbacks, cbk, sizeof(struct hif_callbacks)); + qdf_mem_copy(&scn->callbacks, cbk, sizeof(struct hif_driver_state_callbacks)); status = hif_bus_open(scn, bus_type); if (status != QDF_STATUS_SUCCESS) { @@ -891,7 +887,7 @@ uint32_t hif_get_conparam(struct hif_softc *scn) * * Return: pointer to HIF Callbacks */ -struct hif_callbacks *hif_get_callbacks_handle(struct hif_softc *scn) +struct hif_driver_state_callbacks *hif_get_callbacks_handle(struct hif_softc *scn) { return &scn->callbacks; } @@ -904,7 +900,7 @@ struct hif_callbacks *hif_get_callbacks_handle(struct hif_softc *scn) */ bool hif_is_driver_unloading(struct hif_softc *scn) { - struct hif_callbacks *cbk = hif_get_callbacks_handle(scn); + struct hif_driver_state_callbacks *cbk = hif_get_callbacks_handle(scn); if (cbk && cbk->is_driver_unloading) return cbk->is_driver_unloading(cbk->context); @@ -921,7 +917,7 @@ bool hif_is_driver_unloading(struct hif_softc *scn) */ bool hif_is_load_or_unload_in_progress(struct hif_softc *scn) { - struct hif_callbacks *cbk = hif_get_callbacks_handle(scn); + struct hif_driver_state_callbacks *cbk = hif_get_callbacks_handle(scn); if (cbk && cbk->is_load_unload_in_progress) return cbk->is_load_unload_in_progress(cbk->context); @@ -938,7 +934,7 @@ bool hif_is_load_or_unload_in_progress(struct hif_softc *scn) */ bool hif_is_recovery_in_progress(struct hif_softc *scn) { - struct hif_callbacks *cbk = hif_get_callbacks_handle(scn); + struct hif_driver_state_callbacks *cbk = hif_get_callbacks_handle(scn); if (cbk && cbk->is_recovery_in_progress) return cbk->is_recovery_in_progress(cbk->context); diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index cdcc3a2d4f..87881ade47 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -146,7 +146,7 @@ struct hif_softc { #ifdef FEATURE_NAPI struct qca_napi_data napi_data; #endif /* FEATURE_NAPI */ - struct hif_callbacks callbacks; + struct hif_driver_state_callbacks callbacks; uint32_t hif_con_param; }; @@ -183,7 +183,7 @@ void hif_bus_prevent_linkdown(struct hif_softc *scn, bool flag); int hif_bus_get_context_size(enum qdf_bus_type bus_type); void hif_read_phy_mem_base(struct hif_softc *scn, qdf_dma_addr_t *bar_value); uint32_t hif_get_conparam(struct hif_softc *scn); -struct hif_callbacks *hif_get_callbacks_handle(struct hif_softc *scn); +struct hif_driver_state_callbacks *hif_get_callbacks_handle(struct hif_softc *scn); bool hif_is_driver_unloading(struct hif_softc *scn); bool hif_is_load_or_unload_in_progress(struct hif_softc *scn); bool hif_is_recovery_in_progress(struct hif_softc *scn); diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 36fe7347b6..9acce4adfc 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -25,7 +25,6 @@ * to the Linux Foundation. */ -#include #include #include #include @@ -41,18 +40,13 @@ #include "ce_api.h" #include "ce_internal.h" #include "ce_reg.h" -#include "bmi_msg.h" /* TARGET_TYPE_ */ #include "ce_bmi.h" #include "regtable.h" #include "ol_fw.h" #include #include -#include #include "qdf_status.h" -#include "wma_api.h" #include "qdf_atomic.h" -#include "wlan_hdd_power.h" -#include "wlan_hdd_main.h" #ifdef CONFIG_CNSS #include #else @@ -62,11 +56,6 @@ #include "mp_dev.h" #include "hif_debug.h" -#ifndef REMOVE_PKT_LOG -#include "ol_txrx_types.h" -#include "pktlog_ac_api.h" -#include "pktlog_ac.h" -#endif #include "if_pci_internal.h" #include "icnss_stub.h" #include "ce_tasklet.h" @@ -78,14 +67,6 @@ #define PCIE_WAKE_TIMEOUT 1000 #define RAMDUMP_EVENT_TIMEOUT 2500 -unsigned int msienable = 0; -module_param(msienable, int, 0644); - - -#ifndef REMOVE_PKT_LOG -struct ol_pl_os_dep_funcs *g_ol_pl_os_dep_funcs = NULL; -#endif - /* Setting SOC_GLOBAL_RESET during driver unload causes intermittent * PCIe data bus error * As workaround for this issue - changing the reset sequence to @@ -2778,7 +2759,7 @@ static int hif_log_soc_wakeup_timeout(struct hif_pci_softc *sc) struct hif_softc *scn = HIF_GET_SOFTC(sc); struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(sc); struct hif_config_info *cfg = hif_get_ini_handle(hif_hdl); - struct hif_callbacks *cbk = hif_get_callbacks_handle(scn); + struct hif_driver_state_callbacks *cbk = hif_get_callbacks_handle(scn); A_target_id_t pci_addr = scn->mem; HIF_ERROR("%s: keep_awake_count = %d", diff --git a/hif/src/pcie/if_pci.h b/hif/src/pcie/if_pci.h index 5f573b2847..86e45bd4ad 100644 --- a/hif/src/pcie/if_pci.h +++ b/hif/src/pcie/if_pci.h @@ -33,10 +33,7 @@ #include #define ATH_DBG_DEFAULT 0 -#include #include -#include -#include "osapi_linux.h" #include "hif.h" #include "cepci.h" #include "ce_main.h" diff --git a/htc/htc_api.h b/htc/htc_api.h index 78a866796b..6f922c6133 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -28,7 +28,6 @@ #ifndef _HTC_API_H_ #define _HTC_API_H_ -#include #include "osapi_linux.h" #include "htc_packet.h" #include diff --git a/htc/htc_internal.h b/htc/htc_internal.h index 0a78e634a9..8d817c7e3b 100644 --- a/htc/htc_internal.h +++ b/htc/htc_internal.h @@ -32,9 +32,6 @@ extern "C" { #endif /* __cplusplus */ -#include -#include "a_types.h" -#include "osapi_linux.h" #include #include #include diff --git a/htc/htc_packet.h b/htc/htc_packet.h index 9e8993e017..46c3de8f7f 100644 --- a/htc/htc_packet.h +++ b/htc/htc_packet.h @@ -29,7 +29,6 @@ #define HTC_PACKET_H_ #include -#include /* A_UINT16, etc. */ #include "dl_list.h" /* ------ Endpoint IDS ------ */