1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef __BFA_MODULES_H__
23#define __BFA_MODULES_H__
24
25#include "bfa_cs.h"
26#include "bfa.h"
27#include "bfa_svc.h"
28#include "bfa_fcpim.h"
29#include "bfa_port.h"
30
31struct bfa_modules_s {
32 struct bfa_fcdiag_s fcdiag;
33 struct bfa_fcport_s fcport;
34 struct bfa_fcxp_mod_s fcxp_mod;
35 struct bfa_lps_mod_s lps_mod;
36 struct bfa_uf_mod_s uf_mod;
37 struct bfa_rport_mod_s rport_mod;
38 struct bfa_fcp_mod_s fcp_mod;
39 struct bfa_sgpg_mod_s sgpg_mod;
40 struct bfa_port_s port;
41 struct bfa_ablk_s ablk;
42 struct bfa_cee_s cee;
43 struct bfa_sfp_s sfp;
44 struct bfa_flash_s flash;
45 struct bfa_diag_s diag_mod;
46 struct bfa_phy_s phy;
47 struct bfa_dconf_mod_s dconf_mod;
48 struct bfa_fru_s fru;
49};
50
51
52
53
54
55enum {
56 BFA_TRC_HAL_CORE = 1,
57 BFA_TRC_HAL_FCXP = 2,
58 BFA_TRC_HAL_FCPIM = 3,
59 BFA_TRC_HAL_IOCFC_CT = 4,
60 BFA_TRC_HAL_IOCFC_CB = 5,
61};
62
63
64
65
66#define BFA_MODULE(__mod) \
67 static void bfa_ ## __mod ## _meminfo( \
68 struct bfa_iocfc_cfg_s *cfg, \
69 struct bfa_meminfo_s *meminfo, \
70 struct bfa_s *bfa); \
71 static void bfa_ ## __mod ## _attach(struct bfa_s *bfa, \
72 void *bfad, struct bfa_iocfc_cfg_s *cfg, \
73 struct bfa_pcidev_s *pcidev); \
74 static void bfa_ ## __mod ## _detach(struct bfa_s *bfa); \
75 static void bfa_ ## __mod ## _start(struct bfa_s *bfa); \
76 static void bfa_ ## __mod ## _stop(struct bfa_s *bfa); \
77 static void bfa_ ## __mod ## _iocdisable(struct bfa_s *bfa); \
78 \
79 extern struct bfa_module_s hal_mod_ ## __mod; \
80 struct bfa_module_s hal_mod_ ## __mod = { \
81 bfa_ ## __mod ## _meminfo, \
82 bfa_ ## __mod ## _attach, \
83 bfa_ ## __mod ## _detach, \
84 bfa_ ## __mod ## _start, \
85 bfa_ ## __mod ## _stop, \
86 bfa_ ## __mod ## _iocdisable, \
87 }
88
89#define BFA_CACHELINE_SZ (256)
90
91
92
93
94
95
96
97struct bfa_module_s {
98 void (*meminfo) (struct bfa_iocfc_cfg_s *cfg,
99 struct bfa_meminfo_s *meminfo,
100 struct bfa_s *bfa);
101 void (*attach) (struct bfa_s *bfa, void *bfad,
102 struct bfa_iocfc_cfg_s *cfg,
103 struct bfa_pcidev_s *pcidev);
104 void (*detach) (struct bfa_s *bfa);
105 void (*start) (struct bfa_s *bfa);
106 void (*stop) (struct bfa_s *bfa);
107 void (*iocdisable) (struct bfa_s *bfa);
108};
109
110
111struct bfa_s {
112 void *bfad;
113 struct bfa_plog_s *plog;
114 struct bfa_trc_mod_s *trcmod;
115 struct bfa_ioc_s ioc;
116 struct bfa_iocfc_s iocfc;
117 struct bfa_timer_mod_s timer_mod;
118 struct bfa_modules_s modules;
119 struct list_head comp_q;
120 bfa_boolean_t queue_process;
121 struct list_head reqq_waitq[BFI_IOC_MAX_CQS];
122 bfa_boolean_t fcs;
123 struct bfa_msix_s msix;
124 int bfa_aen_seq;
125 bfa_boolean_t intr_enabled;
126};
127
128extern bfa_boolean_t bfa_auto_recover;
129extern struct bfa_module_s hal_mod_fcdiag;
130extern struct bfa_module_s hal_mod_sgpg;
131extern struct bfa_module_s hal_mod_fcport;
132extern struct bfa_module_s hal_mod_fcxp;
133extern struct bfa_module_s hal_mod_lps;
134extern struct bfa_module_s hal_mod_uf;
135extern struct bfa_module_s hal_mod_rport;
136extern struct bfa_module_s hal_mod_fcp;
137extern struct bfa_module_s hal_mod_dconf;
138
139#endif
140