Commit | Line | Data |
---|---|---|
7725ccfd | 1 | /* |
889d0d42 AG |
2 | * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. |
3 | * Copyright (c) 2014- QLogic Corporation. | |
7725ccfd | 4 | * All rights reserved |
889d0d42 | 5 | * www.qlogic.com |
7725ccfd | 6 | * |
31e1d569 | 7 | * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter. |
7725ccfd JH |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License (GPL) Version 2 as | |
11 | * published by the Free Software Foundation | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | */ | |
18 | ||
acdc79a6 | 19 | /* |
a36c61f9 KG |
20 | * bfa_modules.h BFA modules |
21 | */ | |
22 | ||
23 | #ifndef __BFA_MODULES_H__ | |
24 | #define __BFA_MODULES_H__ | |
25 | ||
26 | #include "bfa_cs.h" | |
27 | #include "bfa.h" | |
28 | #include "bfa_svc.h" | |
29 | #include "bfa_fcpim.h" | |
30 | #include "bfa_port.h" | |
31 | ||
32 | struct bfa_modules_s { | |
3d7fc66d | 33 | struct bfa_fcdiag_s fcdiag; /* fcdiag module */ |
a36c61f9 KG |
34 | struct bfa_fcport_s fcport; /* fc port module */ |
35 | struct bfa_fcxp_mod_s fcxp_mod; /* fcxp module */ | |
36 | struct bfa_lps_mod_s lps_mod; /* fcxp module */ | |
37 | struct bfa_uf_mod_s uf_mod; /* unsolicited frame module */ | |
38 | struct bfa_rport_mod_s rport_mod; /* remote port module */ | |
e2187d7f | 39 | struct bfa_fcp_mod_s fcp_mod; /* FCP initiator module */ |
a36c61f9 KG |
40 | struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */ |
41 | struct bfa_port_s port; /* Physical port module */ | |
1a4d8e1b | 42 | struct bfa_ablk_s ablk; /* ASIC block config module */ |
148d6103 | 43 | struct bfa_cee_s cee; /* CEE Module */ |
51e569aa | 44 | struct bfa_sfp_s sfp; /* SFP module */ |
5a54b1d5 | 45 | struct bfa_flash_s flash; /* flash module */ |
3d7fc66d | 46 | struct bfa_diag_s diag_mod; /* diagnostics module */ |
3350d98d | 47 | struct bfa_phy_s phy; /* phy module */ |
45c5dc1d | 48 | struct bfa_dconf_mod_s dconf_mod; /* DCONF common module */ |
e6826c96 | 49 | struct bfa_fru_s fru; /* fru module */ |
a36c61f9 KG |
50 | }; |
51 | ||
52 | /* | |
53 | * !!! Only append to the enums defined here to avoid any versioning | |
54 | * !!! needed between trace utility and driver version | |
55 | */ | |
56 | enum { | |
57 | BFA_TRC_HAL_CORE = 1, | |
58 | BFA_TRC_HAL_FCXP = 2, | |
59 | BFA_TRC_HAL_FCPIM = 3, | |
60 | BFA_TRC_HAL_IOCFC_CT = 4, | |
61 | BFA_TRC_HAL_IOCFC_CB = 5, | |
62 | }; | |
7725ccfd | 63 | |
acdc79a6 | 64 | /* |
7725ccfd JH |
65 | * Macro to define a new BFA module |
66 | */ | |
a36c61f9 | 67 | #define BFA_MODULE(__mod) \ |
7725ccfd | 68 | static void bfa_ ## __mod ## _meminfo( \ |
4507025d KG |
69 | struct bfa_iocfc_cfg_s *cfg, \ |
70 | struct bfa_meminfo_s *meminfo, \ | |
71 | struct bfa_s *bfa); \ | |
7725ccfd | 72 | static void bfa_ ## __mod ## _attach(struct bfa_s *bfa, \ |
a36c61f9 | 73 | void *bfad, struct bfa_iocfc_cfg_s *cfg, \ |
7725ccfd | 74 | struct bfa_pcidev_s *pcidev); \ |
7725ccfd JH |
75 | static void bfa_ ## __mod ## _detach(struct bfa_s *bfa); \ |
76 | static void bfa_ ## __mod ## _start(struct bfa_s *bfa); \ | |
77 | static void bfa_ ## __mod ## _stop(struct bfa_s *bfa); \ | |
78 | static void bfa_ ## __mod ## _iocdisable(struct bfa_s *bfa); \ | |
79 | \ | |
80 | extern struct bfa_module_s hal_mod_ ## __mod; \ | |
81 | struct bfa_module_s hal_mod_ ## __mod = { \ | |
82 | bfa_ ## __mod ## _meminfo, \ | |
83 | bfa_ ## __mod ## _attach, \ | |
7725ccfd JH |
84 | bfa_ ## __mod ## _detach, \ |
85 | bfa_ ## __mod ## _start, \ | |
86 | bfa_ ## __mod ## _stop, \ | |
87 | bfa_ ## __mod ## _iocdisable, \ | |
88 | } | |
89 | ||
90 | #define BFA_CACHELINE_SZ (256) | |
91 | ||
acdc79a6 | 92 | /* |
7725ccfd JH |
93 | * Structure used to interact between different BFA sub modules |
94 | * | |
95 | * Each sub module needs to implement only the entry points relevant to it (and | |
96 | * can leave entry points as NULL) | |
97 | */ | |
98 | struct bfa_module_s { | |
4507025d KG |
99 | void (*meminfo) (struct bfa_iocfc_cfg_s *cfg, |
100 | struct bfa_meminfo_s *meminfo, | |
101 | struct bfa_s *bfa); | |
7725ccfd JH |
102 | void (*attach) (struct bfa_s *bfa, void *bfad, |
103 | struct bfa_iocfc_cfg_s *cfg, | |
7725ccfd | 104 | struct bfa_pcidev_s *pcidev); |
7725ccfd JH |
105 | void (*detach) (struct bfa_s *bfa); |
106 | void (*start) (struct bfa_s *bfa); | |
107 | void (*stop) (struct bfa_s *bfa); | |
108 | void (*iocdisable) (struct bfa_s *bfa); | |
109 | }; | |
110 | ||
7725ccfd JH |
111 | |
112 | struct bfa_s { | |
113 | void *bfad; /* BFA driver instance */ | |
7725ccfd | 114 | struct bfa_plog_s *plog; /* portlog buffer */ |
7725ccfd JH |
115 | struct bfa_trc_mod_s *trcmod; /* driver tracing */ |
116 | struct bfa_ioc_s ioc; /* IOC module */ | |
117 | struct bfa_iocfc_s iocfc; /* IOCFC module */ | |
118 | struct bfa_timer_mod_s timer_mod; /* timer module */ | |
119 | struct bfa_modules_s modules; /* BFA modules */ | |
a36c61f9 | 120 | struct list_head comp_q; /* pending completions */ |
775c7742 | 121 | bfa_boolean_t queue_process; /* queue processing enabled */ |
a36c61f9 | 122 | struct list_head reqq_waitq[BFI_IOC_MAX_CQS]; |
7725ccfd JH |
123 | bfa_boolean_t fcs; /* FCS is attached to BFA */ |
124 | struct bfa_msix_s msix; | |
7826f304 | 125 | int bfa_aen_seq; |
9aec0249 | 126 | bfa_boolean_t intr_enabled; /* Status of interrupts */ |
7725ccfd JH |
127 | }; |
128 | ||
7725ccfd | 129 | extern bfa_boolean_t bfa_auto_recover; |
3d7fc66d | 130 | extern struct bfa_module_s hal_mod_fcdiag; |
7725ccfd | 131 | extern struct bfa_module_s hal_mod_sgpg; |
1c8a4c37 | 132 | extern struct bfa_module_s hal_mod_fcport; |
7725ccfd JH |
133 | extern struct bfa_module_s hal_mod_fcxp; |
134 | extern struct bfa_module_s hal_mod_lps; | |
135 | extern struct bfa_module_s hal_mod_uf; | |
136 | extern struct bfa_module_s hal_mod_rport; | |
e2187d7f | 137 | extern struct bfa_module_s hal_mod_fcp; |
45c5dc1d | 138 | extern struct bfa_module_s hal_mod_dconf; |
7725ccfd | 139 | |
a36c61f9 | 140 | #endif /* __BFA_MODULES_H__ */ |