diff --git a/hal/wifi3.0/hal_srng.c b/hal/wifi3.0/hal_srng.c index 2c0f73a599..c5bae9e05d 100644 --- a/hal/wifi3.0/hal_srng.c +++ b/hal/wifi3.0/hal_srng.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,6 +28,7 @@ */ #include "hal_api.h" +#include "target_type.h" #include "wcss_version.h" /** diff --git a/hif/inc/hif.h b/hif/inc/hif.h index bd211b2024..7e70121062 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -70,45 +70,6 @@ typedef void *hif_handle_t; #define HIF_TYPE_QCA8074 15 #define HIF_TYPE_QCA6290 16 -/* TARGET definition needs to be abstracted in fw common - * header files, below is the placeholder till WIN codebase - * moved to latest copy of fw common header files. - */ -#ifdef CONFIG_WIN -#if ENABLE_10_4_FW_HDR -#define TARGET_TYPE_UNKNOWN 0 -#define TARGET_TYPE_AR6001 1 -#define TARGET_TYPE_AR6002 2 -#define TARGET_TYPE_AR6003 3 -#define TARGET_TYPE_AR6004 5 -#define TARGET_TYPE_AR6006 6 -#define TARGET_TYPE_AR9888 7 -#define TARGET_TYPE_AR6320 8 -#define TARGET_TYPE_AR900B 9 -#define TARGET_TYPE_QCA9984 10 -#define TARGET_TYPE_IPQ4019 11 -#define TARGET_TYPE_QCA9888 12 -/* For attach Peregrine 2.0 board target_reg_tbl only */ -#define TARGET_TYPE_AR9888V2 13 -/* For attach Rome1.0 target_reg_tbl only*/ -#define TARGET_TYPE_AR6320V1 14 -/* For Rome2.0/2.1 target_reg_tbl ID*/ -#define TARGET_TYPE_AR6320V2 15 -/* For Rome3.0 target_reg_tbl ID*/ -#define TARGET_TYPE_AR6320V3 16 -/* For Tufello1.0 target_reg_tbl ID*/ -#define TARGET_TYPE_QCA9377V1 17 -#endif /* ENABLE_10_4_FW_HDR */ -#endif /* CONFIG_WIN */ -/* For Adrastea target */ -#define TARGET_TYPE_ADRASTEA 19 -#ifndef TARGET_TYPE_QCA8074 -#define TARGET_TYPE_QCA8074 20 -#endif -#ifndef TARGET_TYPE_QCA6290 -#define TARGET_TYPE_QCA6290 21 -#endif - #ifdef IPA_OFFLOAD #define DMA_COHERENT_MASK_IPA_VER_3_AND_ABOVE 37 #define DMA_COHERENT_MASK_BELOW_IPA_VER_3 32 @@ -494,7 +455,7 @@ QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, uint8_t *pSendMessage, uint32_t Length, uint8_t *pResponseMessage, uint32_t *pResponseLength, uint32_t TimeoutMS); - +void hif_register_bmi_callbacks(struct hif_softc *hif_sc); /* * APIs to handle HIF specific diagnostic read accesses. These APIs are * synchronous and only allowed to be called from a context that diff --git a/hif/inc/target_type.h b/hif/inc/target_type.h new file mode 100644 index 0000000000..da5958b5d6 --- /dev/null +++ b/hif/inc/target_type.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. + * + * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file was originally distributed by Qualcomm Atheros, Inc. + * under proprietary terms before Copyright ownership was assigned + * to the Linux Foundation. + */ + +#ifndef _TARGET_TYPE_H_ +#define _TARGET_TYPE_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Header files */ + +/* TARGET definition needs to be abstracted in fw common + * header files, below is the placeholder till WIN codebase + * moved to latest copy of fw common header files. + */ +#ifdef CONFIG_WIN +#define TARGET_TYPE_UNKNOWN 0 +#define TARGET_TYPE_AR6001 1 +#define TARGET_TYPE_AR6002 2 +#define TARGET_TYPE_AR6003 3 +#define TARGET_TYPE_AR6004 5 +#define TARGET_TYPE_AR6006 6 +#define TARGET_TYPE_AR9888 7 +#define TARGET_TYPE_AR6320 8 +#define TARGET_TYPE_AR900B 9 +#define TARGET_TYPE_QCA9984 10 +#define TARGET_TYPE_IPQ4019 11 +#define TARGET_TYPE_QCA9888 12 +/* For attach Peregrine 2.0 board target_reg_tbl only */ +#define TARGET_TYPE_AR9888V2 13 +/* For attach Rome1.0 target_reg_tbl only*/ +#define TARGET_TYPE_AR6320V1 14 +/* For Rome2.0/2.1 target_reg_tbl ID*/ +#define TARGET_TYPE_AR6320V2 15 +/* For Rome3.0 target_reg_tbl ID*/ +#define TARGET_TYPE_AR6320V3 16 +/* For Tufello1.0 target_reg_tbl ID*/ +#define TARGET_TYPE_QCA9377V1 17 +#endif /* CONFIG_WIN */ +/* For Adrastea target */ +#define TARGET_TYPE_ADRASTEA 19 +#ifndef TARGET_TYPE_QCA8074 +#define TARGET_TYPE_QCA8074 20 +#endif +#ifndef TARGET_TYPE_QCA6290 +#define TARGET_TYPE_QCA6290 21 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _TARGET_TYPE_H_ */ diff --git a/hif/src/ath_procfs.c b/hif/src/ath_procfs.c index d18b82a3f5..f5ed31d328 100644 --- a/hif/src/ath_procfs.c +++ b/hif/src/ath_procfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014, 2016-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,6 +41,7 @@ #endif #include "hif_debug.h" #include "pld_common.h" +#include "target_type.h" #define PROCFS_NAME "athdiagpfs" #ifdef MULTI_IF_NAME diff --git a/hif/src/ce/ce_bmi.c b/hif/src/ce/ce_bmi.c index e5124da870..48f849a59b 100644 --- a/hif/src/ce/ce_bmi.c +++ b/hif/src/ce/ce_bmi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,6 +41,7 @@ #include "ce_bmi.h" #include "qdf_trace.h" #include "hif_debug.h" +#include "bmi_msg.h" /* Track a BMI transaction that is in progress */ #ifndef BIT @@ -282,3 +283,34 @@ QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx, qdf_mem_free(transaction); return status; } + +#ifdef BMI_RSP_POLLING +#define BMI_RSP_CB_REGISTER 0 +#else +#define BMI_RSP_CB_REGISTER 1 +#endif + +/** + * hif_register_bmi_callbacks() - register bmi callbacks + * @hif_sc: hif context + * + * Bmi phase uses different copy complete callbacks than mission mode. + */ +void hif_register_bmi_callbacks(struct hif_softc *hif_sc) +{ + struct HIF_CE_pipe_info *pipe_info; + struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_sc); + + /* + * Initially, establish CE completion handlers for use with BMI. + * These are overwritten with generic handlers after we exit BMI phase. + */ + pipe_info = &hif_state->pipe_info[BMI_CE_NUM_TO_TARG]; + ce_send_cb_register(pipe_info->ce_hdl, hif_bmi_send_done, pipe_info, 0); + + if (BMI_RSP_CB_REGISTER) { + pipe_info = &hif_state->pipe_info[BMI_CE_NUM_TO_HOST]; + ce_recv_cb_register( + pipe_info->ce_hdl, hif_bmi_recv_data, pipe_info, 0); + } +} diff --git a/hif/src/ce/ce_diag.c b/hif/src/ce/ce_diag.c index 06b914e4ed..2368633df8 100644 --- a/hif/src/ce/ce_diag.c +++ b/hif/src/ce/ce_diag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -26,6 +26,7 @@ */ #include "targcfg.h" +#include "target_type.h" #include "qdf_lock.h" #include "qdf_status.h" #include "qdf_status.h" diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 6a9348fe8a..173b56796c 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -32,6 +32,7 @@ #include #include "hif_io32.h" #include +#include #include "regtable.h" #define ATH_MODULE_NAME hif #include diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 84ffb702b2..56519b063b 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -33,6 +33,7 @@ #include #include "hif_io32.h" #include +#include #include "regtable.h" #define ATH_MODULE_NAME hif #include diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c index 6a3d6263c1..153271c11a 100644 --- a/hif/src/pcie/if_pci.c +++ b/hif/src/pcie/if_pci.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -35,6 +35,7 @@ #include "hif_io32.h" #include "if_pci.h" #include "hif.h" +#include "target_type.h" #include "hif_main.h" #include "ce_main.h" #include "ce_api.h" @@ -1440,37 +1441,6 @@ QDF_STATUS hif_pci_open(struct hif_softc *hif_ctx, enum qdf_bus_type bus_type) return hif_ce_open(hif_ctx); } -#ifdef BMI_RSP_POLLING -#define BMI_RSP_CB_REGISTER 0 -#else -#define BMI_RSP_CB_REGISTER 1 -#endif - -/** - * hif_register_bmi_callbacks() - register bmi callbacks - * @hif_sc: hif context - * - * Bmi phase uses different copy complete callbacks than mission mode. - */ -static void hif_register_bmi_callbacks(struct hif_softc *hif_sc) -{ - struct HIF_CE_pipe_info *pipe_info; - struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_sc); - - /* - * Initially, establish CE completion handlers for use with BMI. - * These are overwritten with generic handlers after we exit BMI phase. - */ - pipe_info = &hif_state->pipe_info[BMI_CE_NUM_TO_TARG]; - ce_send_cb_register(pipe_info->ce_hdl, hif_bmi_send_done, pipe_info, 0); - - if (BMI_RSP_CB_REGISTER) { - pipe_info = &hif_state->pipe_info[BMI_CE_NUM_TO_HOST]; - ce_recv_cb_register( - pipe_info->ce_hdl, hif_bmi_recv_data, pipe_info, 0); - } -} - /** * hif_wake_target_cpu() - wake the target's cpu * @scn: hif context diff --git a/hif/src/regtable.c b/hif/src/regtable.c index 5baf876ee8..327a0085f8 100644 --- a/hif/src/regtable.c +++ b/hif/src/regtable.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -26,6 +26,7 @@ */ #include "targaddrs.h" +#include "target_type.h" #include "cepci.h" #include "regtable.h" #include "ar6320def.h" diff --git a/hif/src/sdio/if_sdio.c b/hif/src/sdio/if_sdio.c index 5b02e94166..622b0d5614 100644 --- a/hif/src/sdio/if_sdio.c +++ b/hif/src/sdio/if_sdio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,7 +42,6 @@ #include #include #include -#include "bmi_msg.h" /* TARGET_TYPE_ */ #include "if_sdio.h" #include #include @@ -53,6 +52,7 @@ #include "pktlog_ac_api.h" #include "pktlog_ac.h" #endif +#include "target_type.h" #include "epping_main.h" #include "pld_sdio.h" #include "targaddrs.h" diff --git a/hif/src/sdio/regtable_sdio.c b/hif/src/sdio/regtable_sdio.c index 12c925458e..6798b1a11f 100644 --- a/hif/src/sdio/regtable_sdio.c +++ b/hif/src/sdio/regtable_sdio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -25,7 +25,7 @@ * to the Linux Foundation. */ -#include "bmi_msg.h" +#include "target_type.h" #include "cepci.h" #define MISSING 0 diff --git a/hif/src/snoc/if_ahb.c b/hif/src/snoc/if_ahb.c index 18a04cfd27..f04cc1364b 100644 --- a/hif/src/snoc/if_ahb.c +++ b/hif/src/snoc/if_ahb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -23,6 +23,7 @@ */ #include "hif.h" +#include "target_type.h" #include "hif_main.h" #include "hif_debug.h" #include "hif_io32.h" diff --git a/hif/src/snoc/if_ahb_reset.c b/hif/src/snoc/if_ahb_reset.c index 8a45cc53e7..a6f13bfdcf 100644 --- a/hif/src/snoc/if_ahb_reset.c +++ b/hif/src/snoc/if_ahb_reset.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -23,6 +23,7 @@ */ #include "hif.h" +#include "target_type.h" #include "hif_main.h" #include "hif_debug.h" #include "hif_io32.h" diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c index 7055f049b4..c30b24e9ac 100644 --- a/hif/src/snoc/if_snoc.c +++ b/hif/src/snoc/if_snoc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -45,6 +45,7 @@ #ifdef IPA_OFFLOAD #include #endif +#include "target_type.h" /** * hif_disable_isr(): disable isr diff --git a/hif/src/usb/if_usb.c b/hif/src/usb/if_usb.c index 176e1a0e3c..6bd64857e2 100644 --- a/hif/src/usb/if_usb.c +++ b/hif/src/usb/if_usb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -29,7 +29,7 @@ #include #include "if_usb.h" #include "hif_usb_internal.h" -#include "bmi_msg.h" /* TARGET_TYPE_ */ +#include "target_type.h" /* TARGET_TYPE_ */ #include "regtable_usb.h" #include "ol_fw.h" #include "hif_debug.h" diff --git a/hif/src/usb/regtable_usb.c b/hif/src/usb/regtable_usb.c index 1e9ea190ed..625f8cd03a 100644 --- a/hif/src/usb/regtable_usb.c +++ b/hif/src/usb/regtable_usb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -25,7 +25,7 @@ * to the Linux Foundation. */ -#include "bmi_msg.h" +#include "target_type.h" #include "targaddrs.h" #include "regtable_usb.h" #include "ar9888def.h" diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index d61960933d..053ac22749 100644 --- a/target_if/core/inc/target_if.h +++ b/target_if/core/inc/target_if.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -59,11 +59,12 @@ #define GET_WMI_HDL_FROM_PDEV(pdev) ((pdev)->tgt_if_handle) #endif - +#ifdef CONFIG_MCL #define TARGET_TYPE_AR900B 9 #define TARGET_TYPE_QCA9984 15 /* cascade */ #define TARGET_TYPE_IPQ4019 16 /* dakota */ #define TARGET_TYPE_QCA9888 17 /* besra */ +#endif typedef struct wlan_objmgr_psoc *(*get_psoc_handle_callback)( void *scn_handle); diff --git a/target_if/core/src/target_if_main.c b/target_if/core/src/target_if_main.c index 202a5659bc..bdcec2a807 100644 --- a/target_if/core/src/target_if_main.c +++ b/target_if/core/src/target_if_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -22,6 +22,7 @@ */ #include "target_if.h" +#include "target_type.h" #ifdef WLAN_ATF_ENABLE #include "target_if_atf.h" #endif diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c index 586bcfd3fe..25275cbc2f 100644 --- a/target_if/spectral/target_if_spectral.c +++ b/target_if/spectral/target_if_spectral.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011,2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011,2017-2018 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index 646f084491..cbbf7958fa 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -27,7 +27,7 @@ #include "wmi_unified_api.h" #include "wmi_unified_priv.h" -#include "hif.h" +#include "target_type.h" #if defined(WMI_NON_TLV_SUPPORT) || defined(WMI_TLV_AND_NON_TLV_SUPPORT) #include "wmi.h"