1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
32struct bfa_modules_s {
33 struct bfa_fcdiag_s fcdiag;
34 struct bfa_fcport_s fcport;
35 struct bfa_fcxp_mod_s fcxp_mod;
36 struct bfa_lps_mod_s lps_mod;
37 struct bfa_uf_mod_s uf_mod;
38 struct bfa_rport_mod_s rport_mod;
39 struct bfa_fcp_mod_s fcp_mod;
40 struct bfa_sgpg_mod_s sgpg_mod;
41 struct bfa_port_s port;
42 struct bfa_ablk_s ablk;
43 struct bfa_cee_s cee;
44 struct bfa_sfp_s sfp;
45 struct bfa_flash_s flash;
46 struct bfa_diag_s diag_mod;
47 struct bfa_phy_s phy;
48 struct bfa_dconf_mod_s dconf_mod;
49 struct bfa_fru_s fru;
50};
51
52
53
54
55
56enum {
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};
63
64
65
66
67#define BFA_MODULE(__mod) \
68 static void bfa_ ## __mod ## _meminfo( \
69 struct bfa_iocfc_cfg_s *cfg, \
70 struct bfa_meminfo_s *meminfo, \
71 struct bfa_s *bfa); \
72 static void bfa_ ## __mod ## _attach(struct bfa_s *bfa, \
73 void *bfad, struct bfa_iocfc_cfg_s *cfg, \
74 struct bfa_pcidev_s *pcidev); \
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, \
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
92
93
94
95
96
97
98struct bfa_module_s {
99 void (*meminfo) (struct bfa_iocfc_cfg_s *cfg,
100 struct bfa_meminfo_s *meminfo,
101 struct bfa_s *bfa);
102 void (*attach) (struct bfa_s *bfa, void *bfad,
103 struct bfa_iocfc_cfg_s *cfg,
104 struct bfa_pcidev_s *pcidev);
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
111
112struct bfa_s {
113 void *bfad;
114 struct bfa_plog_s *plog;
115 struct bfa_trc_mod_s *trcmod;
116 struct bfa_ioc_s ioc;
117 struct bfa_iocfc_s iocfc;
118 struct bfa_timer_mod_s timer_mod;
119 struct bfa_modules_s modules;
120 struct list_head comp_q;
121 bfa_boolean_t queue_process;
122 struct list_head reqq_waitq[BFI_IOC_MAX_CQS];
123 bfa_boolean_t fcs;
124 struct bfa_msix_s msix;
125 int bfa_aen_seq;
126 bfa_boolean_t intr_enabled;
127};
128
129extern bfa_boolean_t bfa_auto_recover;
130extern struct bfa_module_s hal_mod_fcdiag;
131extern struct bfa_module_s hal_mod_sgpg;
132extern struct bfa_module_s hal_mod_fcport;
133extern struct bfa_module_s hal_mod_fcxp;
134extern struct bfa_module_s hal_mod_lps;
135extern struct bfa_module_s hal_mod_uf;
136extern struct bfa_module_s hal_mod_rport;
137extern struct bfa_module_s hal_mod_fcp;
138extern struct bfa_module_s hal_mod_dconf;
139
140#endif
141