Thomas Gleixner | 52fa7bf | 2019-05-29 07:18:06 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 2 | /* |
Anil Gurumurthy | 889d0d4 | 2015-11-26 03:54:45 -0500 | [diff] [blame] | 3 | * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. |
| 4 | * Copyright (c) 2014- QLogic Corporation. |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 5 | * All rights reserved |
Anil Gurumurthy | 889d0d4 | 2015-11-26 03:54:45 -0500 | [diff] [blame] | 6 | * www.qlogic.com |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 7 | * |
Anil Gurumurthy | 31e1d56 | 2015-11-26 03:54:46 -0500 | [diff] [blame] | 8 | * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter. |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 11 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 12 | * bfa_modules.h BFA modules |
| 13 | */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 14 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 15 | #ifndef __BFA_MODULES_H__ |
| 16 | #define __BFA_MODULES_H__ |
| 17 | |
| 18 | #include "bfa_cs.h" |
| 19 | #include "bfa.h" |
| 20 | #include "bfa_svc.h" |
| 21 | #include "bfa_fcpim.h" |
| 22 | #include "bfa_port.h" |
| 23 | |
| 24 | struct bfa_modules_s { |
Krishna Gudipati | 3d7fc66 | 2011-06-24 20:28:17 -0700 | [diff] [blame] | 25 | struct bfa_fcdiag_s fcdiag; /* fcdiag module */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 26 | struct bfa_fcport_s fcport; /* fc port module */ |
| 27 | struct bfa_fcxp_mod_s fcxp_mod; /* fcxp module */ |
| 28 | struct bfa_lps_mod_s lps_mod; /* fcxp module */ |
| 29 | struct bfa_uf_mod_s uf_mod; /* unsolicited frame module */ |
| 30 | struct bfa_rport_mod_s rport_mod; /* remote port module */ |
Krishna Gudipati | e2187d7 | 2011-06-13 15:53:58 -0700 | [diff] [blame] | 31 | struct bfa_fcp_mod_s fcp_mod; /* FCP initiator module */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 32 | struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */ |
| 33 | struct bfa_port_s port; /* Physical port module */ |
Krishna Gudipati | 1a4d8e1 | 2011-06-24 20:22:28 -0700 | [diff] [blame] | 34 | struct bfa_ablk_s ablk; /* ASIC block config module */ |
Krishna Gudipati | 148d610 | 2011-06-24 20:25:36 -0700 | [diff] [blame] | 35 | struct bfa_cee_s cee; /* CEE Module */ |
Krishna Gudipati | 51e569a | 2011-06-24 20:26:25 -0700 | [diff] [blame] | 36 | struct bfa_sfp_s sfp; /* SFP module */ |
Krishna Gudipati | 5a54b1d | 2011-06-24 20:27:13 -0700 | [diff] [blame] | 37 | struct bfa_flash_s flash; /* flash module */ |
Krishna Gudipati | 3d7fc66 | 2011-06-24 20:28:17 -0700 | [diff] [blame] | 38 | struct bfa_diag_s diag_mod; /* diagnostics module */ |
Krishna Gudipati | 3350d98 | 2011-06-24 20:28:37 -0700 | [diff] [blame] | 39 | struct bfa_phy_s phy; /* phy module */ |
Krishna Gudipati | 45c5dc1 | 2011-07-20 17:03:46 -0700 | [diff] [blame] | 40 | struct bfa_dconf_mod_s dconf_mod; /* DCONF common module */ |
Krishna Gudipati | e6826c9 | 2012-09-21 17:27:14 -0700 | [diff] [blame] | 41 | struct bfa_fru_s fru; /* fru module */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | /* |
| 45 | * !!! Only append to the enums defined here to avoid any versioning |
| 46 | * !!! needed between trace utility and driver version |
| 47 | */ |
| 48 | enum { |
| 49 | BFA_TRC_HAL_CORE = 1, |
| 50 | BFA_TRC_HAL_FCXP = 2, |
| 51 | BFA_TRC_HAL_FCPIM = 3, |
| 52 | BFA_TRC_HAL_IOCFC_CT = 4, |
| 53 | BFA_TRC_HAL_IOCFC_CB = 5, |
| 54 | }; |
| 55 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 56 | #define BFA_CACHELINE_SZ (256) |
| 57 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 58 | struct bfa_s { |
| 59 | void *bfad; /* BFA driver instance */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 60 | struct bfa_plog_s *plog; /* portlog buffer */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 61 | struct bfa_trc_mod_s *trcmod; /* driver tracing */ |
| 62 | struct bfa_ioc_s ioc; /* IOC module */ |
| 63 | struct bfa_iocfc_s iocfc; /* IOCFC module */ |
| 64 | struct bfa_timer_mod_s timer_mod; /* timer module */ |
| 65 | struct bfa_modules_s modules; /* BFA modules */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 66 | struct list_head comp_q; /* pending completions */ |
Krishna Gudipati | 775c774 | 2011-06-13 15:52:12 -0700 | [diff] [blame] | 67 | bfa_boolean_t queue_process; /* queue processing enabled */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 68 | struct list_head reqq_waitq[BFI_IOC_MAX_CQS]; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 69 | bfa_boolean_t fcs; /* FCS is attached to BFA */ |
| 70 | struct bfa_msix_s msix; |
Krishna Gudipati | 7826f30 | 2011-07-20 16:59:13 -0700 | [diff] [blame] | 71 | int bfa_aen_seq; |
Krishna Gudipati | 9aec024 | 2012-08-22 19:52:18 -0700 | [diff] [blame] | 72 | bfa_boolean_t intr_enabled; /* Status of interrupts */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 73 | }; |
| 74 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 75 | extern bfa_boolean_t bfa_auto_recover; |
Christoph Hellwig | c7c3524 | 2017-04-13 10:02:56 +0200 | [diff] [blame] | 76 | |
| 77 | void bfa_dconf_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *); |
| 78 | void bfa_dconf_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 79 | struct bfa_s *); |
| 80 | void bfa_dconf_iocdisable(struct bfa_s *); |
| 81 | void bfa_fcp_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, |
| 82 | struct bfa_pcidev_s *); |
| 83 | void bfa_fcp_iocdisable(struct bfa_s *bfa); |
| 84 | void bfa_fcp_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 85 | struct bfa_s *); |
| 86 | void bfa_fcpim_iocdisable(struct bfa_fcp_mod_s *); |
| 87 | void bfa_fcport_start(struct bfa_s *); |
| 88 | void bfa_fcport_iocdisable(struct bfa_s *); |
| 89 | void bfa_fcport_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 90 | struct bfa_s *); |
| 91 | void bfa_fcport_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, |
| 92 | struct bfa_pcidev_s *); |
| 93 | void bfa_fcxp_iocdisable(struct bfa_s *); |
| 94 | void bfa_fcxp_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 95 | struct bfa_s *); |
| 96 | void bfa_fcxp_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, |
| 97 | struct bfa_pcidev_s *); |
| 98 | void bfa_fcdiag_iocdisable(struct bfa_s *); |
| 99 | void bfa_fcdiag_attach(struct bfa_s *bfa, void *, struct bfa_iocfc_cfg_s *, |
| 100 | struct bfa_pcidev_s *); |
| 101 | void bfa_ioim_lm_init(struct bfa_s *); |
| 102 | void bfa_lps_iocdisable(struct bfa_s *bfa); |
| 103 | void bfa_lps_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 104 | struct bfa_s *); |
| 105 | void bfa_lps_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, |
| 106 | struct bfa_pcidev_s *); |
| 107 | void bfa_rport_iocdisable(struct bfa_s *bfa); |
| 108 | void bfa_rport_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 109 | struct bfa_s *); |
| 110 | void bfa_rport_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, |
| 111 | struct bfa_pcidev_s *); |
| 112 | void bfa_sgpg_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 113 | struct bfa_s *); |
| 114 | void bfa_sgpg_attach(struct bfa_s *, void *bfad, struct bfa_iocfc_cfg_s *, |
| 115 | struct bfa_pcidev_s *); |
| 116 | void bfa_uf_iocdisable(struct bfa_s *); |
| 117 | void bfa_uf_meminfo(struct bfa_iocfc_cfg_s *, struct bfa_meminfo_s *, |
| 118 | struct bfa_s *); |
| 119 | void bfa_uf_attach(struct bfa_s *, void *, struct bfa_iocfc_cfg_s *, |
| 120 | struct bfa_pcidev_s *); |
| 121 | void bfa_uf_start(struct bfa_s *); |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 122 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 123 | #endif /* __BFA_MODULES_H__ */ |