1*52fa7bf9SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2a36c61f9SKrishna Gudipati /* 3889d0d42SAnil Gurumurthy * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. 4889d0d42SAnil Gurumurthy * Copyright (c) 2014- QLogic Corporation. 5a36c61f9SKrishna Gudipati * All rights reserved 6889d0d42SAnil Gurumurthy * www.qlogic.com 7a36c61f9SKrishna Gudipati * 831e1d569SAnil Gurumurthy * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter. 9a36c61f9SKrishna Gudipati */ 10a36c61f9SKrishna Gudipati 11acdc79a6SJing Huang /* 12a36c61f9SKrishna Gudipati * bfa_modules.h BFA modules 13a36c61f9SKrishna Gudipati */ 14a36c61f9SKrishna Gudipati 15a36c61f9SKrishna Gudipati #ifndef __BFA_MODULES_H__ 16a36c61f9SKrishna Gudipati #define __BFA_MODULES_H__ 17a36c61f9SKrishna Gudipati 18a36c61f9SKrishna Gudipati #include "bfa_cs.h" 19a36c61f9SKrishna Gudipati #include "bfa.h" 20a36c61f9SKrishna Gudipati #include "bfa_svc.h" 21a36c61f9SKrishna Gudipati #include "bfa_fcpim.h" 22a36c61f9SKrishna Gudipati #include "bfa_port.h" 23a36c61f9SKrishna Gudipati 24a36c61f9SKrishna Gudipati struct bfa_modules_s { 253d7fc66dSKrishna Gudipati struct bfa_fcdiag_s fcdiag; /* fcdiag module */ 26a36c61f9SKrishna Gudipati struct bfa_fcport_s fcport; /* fc port module */ 27a36c61f9SKrishna Gudipati struct bfa_fcxp_mod_s fcxp_mod; /* fcxp module */ 28a36c61f9SKrishna Gudipati struct bfa_lps_mod_s lps_mod; /* fcxp module */ 29a36c61f9SKrishna Gudipati struct bfa_uf_mod_s uf_mod; /* unsolicited frame module */ 30a36c61f9SKrishna Gudipati struct bfa_rport_mod_s rport_mod; /* remote port module */ 31e2187d7fSKrishna Gudipati struct bfa_fcp_mod_s fcp_mod; /* FCP initiator module */ 32a36c61f9SKrishna Gudipati struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */ 33a36c61f9SKrishna Gudipati struct bfa_port_s port; /* Physical port module */ 341a4d8e1bSKrishna Gudipati struct bfa_ablk_s ablk; /* ASIC block config module */ 35148d6103SKrishna Gudipati struct bfa_cee_s cee; /* CEE Module */ 3651e569aaSKrishna Gudipati struct bfa_sfp_s sfp; /* SFP module */ 375a54b1d5SKrishna Gudipati struct bfa_flash_s flash; /* flash module */ 383d7fc66dSKrishna Gudipati struct bfa_diag_s diag_mod; /* diagnostics module */ 393350d98dSKrishna Gudipati struct bfa_phy_s phy; /* phy module */ 4045c5dc1dSKrishna Gudipati struct bfa_dconf_mod_s dconf_mod; /* DCONF common module */ 41e6826c96SKrishna Gudipati struct bfa_fru_s fru; /* fru module */ 42a36c61f9SKrishna Gudipati }; 43a36c61f9SKrishna Gudipati 44a36c61f9SKrishna Gudipati /* 45a36c61f9SKrishna Gudipati * !!! Only append to the enums defined here to avoid any versioning 46a36c61f9SKrishna Gudipati * !!! needed between trace utility and driver version 47a36c61f9SKrishna Gudipati */ 48a36c61f9SKrishna Gudipati enum { 49a36c61f9SKrishna Gudipati BFA_TRC_HAL_CORE = 1, 50a36c61f9SKrishna Gudipati BFA_TRC_HAL_FCXP = 2, 51a36c61f9SKrishna Gudipati BFA_TRC_HAL_FCPIM = 3, 52a36c61f9SKrishna Gudipati BFA_TRC_HAL_IOCFC_CT = 4, 53a36c61f9SKrishna Gudipati BFA_TRC_HAL_IOCFC_CB = 5, 54a36c61f9SKrishna Gudipati }; 55a36c61f9SKrishna Gudipati 56a36c61f9SKrishna Gudipati #define BFA_CACHELINE_SZ (256) 57a36c61f9SKrishna Gudipati 58a36c61f9SKrishna Gudipati struct bfa_s { 59a36c61f9SKrishna Gudipati void *bfad; /* BFA driver instance */ 60a36c61f9SKrishna Gudipati struct bfa_plog_s *plog; /* portlog buffer */ 61a36c61f9SKrishna Gudipati struct bfa_trc_mod_s *trcmod; /* driver tracing */ 62a36c61f9SKrishna Gudipati struct bfa_ioc_s ioc; /* IOC module */ 63a36c61f9SKrishna Gudipati struct bfa_iocfc_s iocfc; /* IOCFC module */ 64a36c61f9SKrishna Gudipati struct bfa_timer_mod_s timer_mod; /* timer module */ 65a36c61f9SKrishna Gudipati struct bfa_modules_s modules; /* BFA modules */ 66a36c61f9SKrishna Gudipati struct list_head comp_q; /* pending completions */ 67775c7742SKrishna Gudipati bfa_boolean_t queue_process; /* queue processing enabled */ 68a36c61f9SKrishna Gudipati struct list_head reqq_waitq[BFI_IOC_MAX_CQS]; 69a36c61f9SKrishna Gudipati bfa_boolean_t fcs; /* FCS is attached to BFA */ 70a36c61f9SKrishna Gudipati struct bfa_msix_s msix; 717826f304SKrishna Gudipati int bfa_aen_seq; 729aec0249SKrishna Gudipati bfa_boolean_t intr_enabled; /* Status of interrupts */ 73a36c61f9SKrishna Gudipati }; 74a36c61f9SKrishna Gudipati 75a36c61f9SKrishna Gudipati extern bfa_boolean_t bfa_auto_recover; 76c7c3524cSChristoph Hellwig 77c7c3524cSChristoph Hellwig void bfa_dconf_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *); 78c7c3524cSChristoph Hellwig void bfa_dconf_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 79c7c3524cSChristoph Hellwig struct bfa_s *); 80c7c3524cSChristoph Hellwig void bfa_dconf_iocdisable(struct bfa_s *); 81c7c3524cSChristoph Hellwig void bfa_fcp_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, 82c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 83c7c3524cSChristoph Hellwig void bfa_fcp_iocdisable(struct bfa_s *bfa); 84c7c3524cSChristoph Hellwig void bfa_fcp_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 85c7c3524cSChristoph Hellwig struct bfa_s *); 86c7c3524cSChristoph Hellwig void bfa_fcpim_iocdisable(struct bfa_fcp_mod_s *); 87c7c3524cSChristoph Hellwig void bfa_fcport_start(struct bfa_s *); 88c7c3524cSChristoph Hellwig void bfa_fcport_iocdisable(struct bfa_s *); 89c7c3524cSChristoph Hellwig void bfa_fcport_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 90c7c3524cSChristoph Hellwig struct bfa_s *); 91c7c3524cSChristoph Hellwig void bfa_fcport_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, 92c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 93c7c3524cSChristoph Hellwig void bfa_fcxp_iocdisable(struct bfa_s *); 94c7c3524cSChristoph Hellwig void bfa_fcxp_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 95c7c3524cSChristoph Hellwig struct bfa_s *); 96c7c3524cSChristoph Hellwig void bfa_fcxp_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, 97c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 98c7c3524cSChristoph Hellwig void bfa_fcdiag_iocdisable(struct bfa_s *); 99c7c3524cSChristoph Hellwig void bfa_fcdiag_attach(struct bfa_s *bfa, void *, struct bfa_iocfc_cfg_s *, 100c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 101c7c3524cSChristoph Hellwig void bfa_ioim_lm_init(struct bfa_s *); 102c7c3524cSChristoph Hellwig void bfa_lps_iocdisable(struct bfa_s *bfa); 103c7c3524cSChristoph Hellwig void bfa_lps_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 104c7c3524cSChristoph Hellwig struct bfa_s *); 105c7c3524cSChristoph Hellwig void bfa_lps_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, 106c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 107c7c3524cSChristoph Hellwig void bfa_rport_iocdisable(struct bfa_s *bfa); 108c7c3524cSChristoph Hellwig void bfa_rport_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 109c7c3524cSChristoph Hellwig struct bfa_s *); 110c7c3524cSChristoph Hellwig void bfa_rport_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, 111c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 112c7c3524cSChristoph Hellwig void bfa_sgpg_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 113c7c3524cSChristoph Hellwig struct bfa_s *); 114c7c3524cSChristoph Hellwig void bfa_sgpg_attach(struct bfa_s *, void *bfad, struct bfa_iocfc_cfg_s *, 115c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 116c7c3524cSChristoph Hellwig void bfa_uf_iocdisable(struct bfa_s *); 117c7c3524cSChristoph Hellwig void bfa_uf_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, 118c7c3524cSChristoph Hellwig struct bfa_s *); 119c7c3524cSChristoph Hellwig void bfa_uf_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, 120c7c3524cSChristoph Hellwig struct bfa_pcidev_s *); 121c7c3524cSChristoph Hellwig void bfa_uf_start(struct bfa_s *); 122a36c61f9SKrishna Gudipati 123a36c61f9SKrishna Gudipati #endif /* __BFA_MODULES_H__ */ 124