Loading...
1/*
2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
5 *
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 */
17
18/*
19 * Contains base driver definitions.
20 */
21
22/*
23 * bfa_drv.h Linux driver data structures.
24 */
25
26#ifndef __BFAD_DRV_H__
27#define __BFAD_DRV_H__
28
29#include <linux/types.h>
30#include <linux/version.h>
31#include <linux/pci.h>
32#include <linux/dma-mapping.h>
33#include <linux/idr.h>
34#include <linux/interrupt.h>
35#include <linux/cdev.h>
36#include <linux/fs.h>
37#include <linux/delay.h>
38#include <linux/vmalloc.h>
39#include <linux/workqueue.h>
40#include <linux/bitops.h>
41#include <scsi/scsi.h>
42#include <scsi/scsi_host.h>
43#include <scsi/scsi_tcq.h>
44#include <scsi/scsi_transport_fc.h>
45#include <scsi/scsi_transport.h>
46#include <scsi/scsi_bsg_fc.h>
47
48#include "bfa_modules.h"
49#include "bfa_fcs.h"
50#include "bfa_defs_fcs.h"
51
52#include "bfa_plog.h"
53#include "bfa_cs.h"
54
55#define BFAD_DRIVER_NAME "bfa"
56#ifdef BFA_DRIVER_VERSION
57#define BFAD_DRIVER_VERSION BFA_DRIVER_VERSION
58#else
59#define BFAD_DRIVER_VERSION "3.0.2.2"
60#endif
61
62#define BFAD_PROTO_NAME FCPI_NAME
63#define BFAD_IRQ_FLAGS IRQF_SHARED
64
65#ifndef FC_PORTSPEED_8GBIT
66#define FC_PORTSPEED_8GBIT 0x10
67#endif
68
69/*
70 * BFAD flags
71 */
72#define BFAD_MSIX_ON 0x00000001
73#define BFAD_HAL_INIT_DONE 0x00000002
74#define BFAD_DRV_INIT_DONE 0x00000004
75#define BFAD_CFG_PPORT_DONE 0x00000008
76#define BFAD_HAL_START_DONE 0x00000010
77#define BFAD_PORT_ONLINE 0x00000020
78#define BFAD_RPORT_ONLINE 0x00000040
79#define BFAD_FCS_INIT_DONE 0x00000080
80#define BFAD_HAL_INIT_FAIL 0x00000100
81#define BFAD_FC4_PROBE_DONE 0x00000200
82#define BFAD_PORT_DELETE 0x00000001
83#define BFAD_INTX_ON 0x00000400
84/*
85 * BFAD related definition
86 */
87#define SCSI_SCAN_DELAY HZ
88#define BFAD_STOP_TIMEOUT 30
89#define BFAD_SUSPEND_TIMEOUT BFAD_STOP_TIMEOUT
90
91/*
92 * BFAD configuration parameter default values
93 */
94#define BFAD_LUN_QUEUE_DEPTH 32
95#define BFAD_IO_MAX_SGE SG_ALL
96#define BFAD_MIN_SECTORS 128 /* 64k */
97#define BFAD_MAX_SECTORS 0xFFFF /* 32 MB */
98
99#define bfad_isr_t irq_handler_t
100
101#define MAX_MSIX_ENTRY 22
102
103struct bfad_msix_s {
104 struct bfad_s *bfad;
105 struct msix_entry msix;
106 char name[32];
107};
108
109/*
110 * Only append to the enums defined here to avoid any versioning
111 * needed between trace utility and driver version
112 */
113enum {
114 BFA_TRC_LDRV_BFAD = 1,
115 BFA_TRC_LDRV_IM = 2,
116 BFA_TRC_LDRV_BSG = 3,
117};
118
119enum bfad_port_pvb_type {
120 BFAD_PORT_PHYS_BASE = 0,
121 BFAD_PORT_PHYS_VPORT = 1,
122 BFAD_PORT_VF_BASE = 2,
123 BFAD_PORT_VF_VPORT = 3,
124};
125
126/*
127 * PORT data structure
128 */
129struct bfad_port_s {
130 struct list_head list_entry;
131 struct bfad_s *bfad;
132 struct bfa_fcs_lport_s *fcs_port;
133 u32 roles;
134 s32 flags;
135 u32 supported_fc4s;
136 enum bfad_port_pvb_type pvb_type;
137 struct bfad_im_port_s *im_port; /* IM specific data */
138 /* port debugfs specific data */
139 struct dentry *port_debugfs_root;
140};
141
142/*
143 * VPORT data structure
144 */
145struct bfad_vport_s {
146 struct bfad_port_s drv_port;
147 struct bfa_fcs_vport_s fcs_vport;
148 struct completion *comp_del;
149 struct list_head list_entry;
150};
151
152/*
153 * VF data structure
154 */
155struct bfad_vf_s {
156 bfa_fcs_vf_t fcs_vf;
157 struct bfad_port_s base_port; /* base port for vf */
158 struct bfad_s *bfad;
159};
160
161struct bfad_cfg_param_s {
162 u32 rport_del_timeout;
163 u32 ioc_queue_depth;
164 u32 lun_queue_depth;
165 u32 io_max_sge;
166 u32 binding_method;
167};
168
169union bfad_tmp_buf {
170 /* From struct bfa_adapter_attr_s */
171 char manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
172 char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
173 char model[BFA_ADAPTER_MODEL_NAME_LEN];
174 char fw_ver[BFA_VERSION_LEN];
175 char optrom_ver[BFA_VERSION_LEN];
176
177 /* From struct bfa_ioc_pci_attr_s */
178 u8 chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
179
180 wwn_t wwn[BFA_FCS_MAX_LPORTS];
181};
182
183/*
184 * BFAD (PCI function) data structure
185 */
186struct bfad_s {
187 bfa_sm_t sm; /* state machine */
188 struct list_head list_entry;
189 struct bfa_s bfa;
190 struct bfa_fcs_s bfa_fcs;
191 struct pci_dev *pcidev;
192 const char *pci_name;
193 struct bfa_pcidev_s hal_pcidev;
194 struct bfa_ioc_pci_attr_s pci_attr;
195 void __iomem *pci_bar0_kva;
196 void __iomem *pci_bar2_kva;
197 struct completion comp;
198 struct completion suspend;
199 struct completion enable_comp;
200 struct completion disable_comp;
201 bfa_boolean_t disable_active;
202 struct bfad_port_s pport; /* physical port of the BFAD */
203 struct bfa_meminfo_s meminfo;
204 struct bfa_iocfc_cfg_s ioc_cfg;
205 u32 inst_no; /* BFAD instance number */
206 u32 bfad_flags;
207 spinlock_t bfad_lock;
208 struct task_struct *bfad_tsk;
209 struct bfad_cfg_param_s cfg_data;
210 struct bfad_msix_s msix_tab[MAX_MSIX_ENTRY];
211 int nvec;
212 char adapter_name[BFA_ADAPTER_SYM_NAME_LEN];
213 char port_name[BFA_ADAPTER_SYM_NAME_LEN];
214 struct timer_list hal_tmo;
215 unsigned long hs_start;
216 struct bfad_im_s *im; /* IM specific data */
217 struct bfa_trc_mod_s *trcmod;
218 struct bfa_plog_s plog_buf;
219 int ref_count;
220 union bfad_tmp_buf tmp_buf;
221 struct fc_host_statistics link_stats;
222 struct list_head pbc_vport_list;
223 /* debugfs specific data */
224 char *regdata;
225 u32 reglen;
226 struct dentry *bfad_dentry_files[5];
227 struct list_head free_aen_q;
228 struct list_head active_aen_q;
229 struct bfa_aen_entry_s aen_list[BFA_AEN_MAX_ENTRY];
230 spinlock_t bfad_aen_spinlock;
231};
232
233/* BFAD state machine events */
234enum bfad_sm_event {
235 BFAD_E_CREATE = 1,
236 BFAD_E_KTHREAD_CREATE_FAILED = 2,
237 BFAD_E_INIT = 3,
238 BFAD_E_INIT_SUCCESS = 4,
239 BFAD_E_INIT_FAILED = 5,
240 BFAD_E_INTR_INIT_FAILED = 6,
241 BFAD_E_FCS_EXIT_COMP = 7,
242 BFAD_E_EXIT_COMP = 8,
243 BFAD_E_STOP = 9
244};
245
246/*
247 * RPORT data structure
248 */
249struct bfad_rport_s {
250 struct bfa_fcs_rport_s fcs_rport;
251};
252
253struct bfad_buf_info {
254 void *virt;
255 dma_addr_t phys;
256 u32 size;
257};
258
259struct bfad_fcxp {
260 struct bfad_port_s *port;
261 struct bfa_rport_s *bfa_rport;
262 bfa_status_t req_status;
263 u16 tag;
264 u16 rsp_len;
265 u16 rsp_maxlen;
266 u8 use_ireqbuf;
267 u8 use_irspbuf;
268 u32 num_req_sgles;
269 u32 num_rsp_sgles;
270 struct fchs_s fchs;
271 void *reqbuf_info;
272 void *rspbuf_info;
273 struct bfa_sge_s *req_sge;
274 struct bfa_sge_s *rsp_sge;
275 fcxp_send_cb_t send_cbfn;
276 void *send_cbarg;
277 void *bfa_fcxp;
278 struct completion comp;
279};
280
281struct bfad_hal_comp {
282 bfa_status_t status;
283 struct completion comp;
284};
285
286#define BFA_LOG(level, bfad, mask, fmt, arg...) \
287do { \
288 if (((mask) == 4) || (level[1] <= '4')) \
289 dev_printk(level, &((bfad)->pcidev)->dev, fmt, ##arg); \
290} while (0)
291
292bfa_status_t bfad_vport_create(struct bfad_s *bfad, u16 vf_id,
293 struct bfa_lport_cfg_s *port_cfg,
294 struct device *dev);
295bfa_status_t bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
296 struct bfa_lport_cfg_s *port_cfg);
297bfa_status_t bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role);
298bfa_status_t bfad_drv_init(struct bfad_s *bfad);
299bfa_status_t bfad_start_ops(struct bfad_s *bfad);
300void bfad_drv_start(struct bfad_s *bfad);
301void bfad_uncfg_pport(struct bfad_s *bfad);
302void bfad_stop(struct bfad_s *bfad);
303void bfad_fcs_stop(struct bfad_s *bfad);
304void bfad_remove_intr(struct bfad_s *bfad);
305void bfad_hal_mem_release(struct bfad_s *bfad);
306void bfad_hcb_comp(void *arg, bfa_status_t status);
307
308int bfad_setup_intr(struct bfad_s *bfad);
309void bfad_remove_intr(struct bfad_s *bfad);
310void bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg);
311bfa_status_t bfad_hal_mem_alloc(struct bfad_s *bfad);
312void bfad_bfa_tmo(unsigned long data);
313void bfad_init_timer(struct bfad_s *bfad);
314int bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad);
315void bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
316void bfad_drv_uninit(struct bfad_s *bfad);
317int bfad_worker(void *ptr);
318void bfad_debugfs_init(struct bfad_port_s *port);
319void bfad_debugfs_exit(struct bfad_port_s *port);
320
321void bfad_pci_remove(struct pci_dev *pdev);
322int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid);
323void bfad_rport_online_wait(struct bfad_s *bfad);
324int bfad_get_linkup_delay(struct bfad_s *bfad);
325int bfad_install_msix_handler(struct bfad_s *bfad);
326
327extern struct idr bfad_im_port_index;
328extern struct pci_device_id bfad_id_table[];
329extern struct list_head bfad_list;
330extern char *os_name;
331extern char *os_patch;
332extern char *host_name;
333extern int num_rports;
334extern int num_ios;
335extern int num_tms;
336extern int num_fcxps;
337extern int num_ufbufs;
338extern int reqq_size;
339extern int rspq_size;
340extern int num_sgpgs;
341extern int rport_del_timeout;
342extern int bfa_lun_queue_depth;
343extern int bfa_io_max_sge;
344extern int bfa_log_level;
345extern int ioc_auto_recover;
346extern int bfa_linkup_delay;
347extern int msix_disable_cb;
348extern int msix_disable_ct;
349extern int fdmi_enable;
350extern int supported_fc4s;
351extern int pcie_max_read_reqsz;
352extern int max_xfer_size;
353extern int bfa_debugfs_enable;
354extern struct mutex bfad_mutex;
355
356#endif /* __BFAD_DRV_H__ */
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
4 * Copyright (c) 2014- QLogic Corporation.
5 * All rights reserved
6 * www.qlogic.com
7 *
8 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
9 */
10
11/*
12 * Contains base driver definitions.
13 */
14
15/*
16 * bfa_drv.h Linux driver data structures.
17 */
18
19#ifndef __BFAD_DRV_H__
20#define __BFAD_DRV_H__
21
22#include <linux/types.h>
23#include <linux/pci.h>
24#include <linux/dma-mapping.h>
25#include <linux/idr.h>
26#include <linux/interrupt.h>
27#include <linux/cdev.h>
28#include <linux/fs.h>
29#include <linux/delay.h>
30#include <linux/vmalloc.h>
31#include <linux/workqueue.h>
32#include <linux/bitops.h>
33#include <linux/aer.h>
34#include <scsi/scsi.h>
35#include <scsi/scsi_host.h>
36#include <scsi/scsi_tcq.h>
37#include <scsi/scsi_transport_fc.h>
38#include <scsi/scsi_transport.h>
39#include <scsi/scsi_bsg_fc.h>
40#include <scsi/scsi_devinfo.h>
41
42#include "bfa_modules.h"
43#include "bfa_fcs.h"
44#include "bfa_defs_fcs.h"
45
46#include "bfa_plog.h"
47#include "bfa_cs.h"
48
49#define BFAD_DRIVER_NAME "bfa"
50#ifdef BFA_DRIVER_VERSION
51#define BFAD_DRIVER_VERSION BFA_DRIVER_VERSION
52#else
53#define BFAD_DRIVER_VERSION "3.2.25.1"
54#endif
55
56#define BFAD_PROTO_NAME FCPI_NAME
57#define BFAD_IRQ_FLAGS IRQF_SHARED
58
59#ifndef FC_PORTSPEED_8GBIT
60#define FC_PORTSPEED_8GBIT 0x10
61#endif
62
63/*
64 * BFAD flags
65 */
66#define BFAD_MSIX_ON 0x00000001
67#define BFAD_HAL_INIT_DONE 0x00000002
68#define BFAD_DRV_INIT_DONE 0x00000004
69#define BFAD_CFG_PPORT_DONE 0x00000008
70#define BFAD_HAL_START_DONE 0x00000010
71#define BFAD_PORT_ONLINE 0x00000020
72#define BFAD_RPORT_ONLINE 0x00000040
73#define BFAD_FCS_INIT_DONE 0x00000080
74#define BFAD_HAL_INIT_FAIL 0x00000100
75#define BFAD_FC4_PROBE_DONE 0x00000200
76#define BFAD_PORT_DELETE 0x00000001
77#define BFAD_INTX_ON 0x00000400
78#define BFAD_EEH_BUSY 0x00000800
79#define BFAD_EEH_PCI_CHANNEL_IO_PERM_FAILURE 0x00001000
80/*
81 * BFAD related definition
82 */
83#define SCSI_SCAN_DELAY HZ
84#define BFAD_STOP_TIMEOUT 30
85#define BFAD_SUSPEND_TIMEOUT BFAD_STOP_TIMEOUT
86
87/*
88 * BFAD configuration parameter default values
89 */
90#define BFAD_LUN_QUEUE_DEPTH 32
91#define BFAD_IO_MAX_SGE SG_ALL
92#define BFAD_MIN_SECTORS 128 /* 64k */
93#define BFAD_MAX_SECTORS 0xFFFF /* 32 MB */
94
95#define bfad_isr_t irq_handler_t
96
97#define MAX_MSIX_ENTRY 22
98
99struct bfad_msix_s {
100 struct bfad_s *bfad;
101 struct msix_entry msix;
102 char name[32];
103};
104
105/*
106 * Only append to the enums defined here to avoid any versioning
107 * needed between trace utility and driver version
108 */
109enum {
110 BFA_TRC_LDRV_BFAD = 1,
111 BFA_TRC_LDRV_IM = 2,
112 BFA_TRC_LDRV_BSG = 3,
113};
114
115enum bfad_port_pvb_type {
116 BFAD_PORT_PHYS_BASE = 0,
117 BFAD_PORT_PHYS_VPORT = 1,
118 BFAD_PORT_VF_BASE = 2,
119 BFAD_PORT_VF_VPORT = 3,
120};
121
122/*
123 * PORT data structure
124 */
125struct bfad_port_s {
126 struct list_head list_entry;
127 struct bfad_s *bfad;
128 struct bfa_fcs_lport_s *fcs_port;
129 u32 roles;
130 s32 flags;
131 u32 supported_fc4s;
132 enum bfad_port_pvb_type pvb_type;
133 struct bfad_im_port_s *im_port; /* IM specific data */
134 /* port debugfs specific data */
135 struct dentry *port_debugfs_root;
136};
137
138/*
139 * VPORT data structure
140 */
141struct bfad_vport_s {
142 struct bfad_port_s drv_port;
143 struct bfa_fcs_vport_s fcs_vport;
144 struct completion *comp_del;
145 struct list_head list_entry;
146};
147
148/*
149 * VF data structure
150 */
151struct bfad_vf_s {
152 bfa_fcs_vf_t fcs_vf;
153 struct bfad_port_s base_port; /* base port for vf */
154 struct bfad_s *bfad;
155};
156
157struct bfad_cfg_param_s {
158 u32 rport_del_timeout;
159 u32 ioc_queue_depth;
160 u32 lun_queue_depth;
161 u32 io_max_sge;
162 u32 binding_method;
163};
164
165union bfad_tmp_buf {
166 /* From struct bfa_adapter_attr_s */
167 char manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
168 char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
169 char model[BFA_ADAPTER_MODEL_NAME_LEN];
170 char fw_ver[BFA_VERSION_LEN];
171 char optrom_ver[BFA_VERSION_LEN];
172
173 /* From struct bfa_ioc_pci_attr_s */
174 u8 chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
175
176 wwn_t wwn[BFA_FCS_MAX_LPORTS];
177};
178
179/*
180 * BFAD (PCI function) data structure
181 */
182struct bfad_s {
183 bfa_sm_t sm; /* state machine */
184 struct list_head list_entry;
185 struct bfa_s bfa;
186 struct bfa_fcs_s bfa_fcs;
187 struct pci_dev *pcidev;
188 const char *pci_name;
189 struct bfa_pcidev_s hal_pcidev;
190 struct bfa_ioc_pci_attr_s pci_attr;
191 void __iomem *pci_bar0_kva;
192 void __iomem *pci_bar2_kva;
193 struct completion comp;
194 struct completion suspend;
195 struct completion enable_comp;
196 struct completion disable_comp;
197 bfa_boolean_t disable_active;
198 struct bfad_port_s pport; /* physical port of the BFAD */
199 struct bfa_meminfo_s meminfo;
200 struct bfa_iocfc_cfg_s ioc_cfg;
201 u32 inst_no; /* BFAD instance number */
202 u32 bfad_flags;
203 spinlock_t bfad_lock;
204 struct task_struct *bfad_tsk;
205 struct bfad_cfg_param_s cfg_data;
206 struct bfad_msix_s msix_tab[MAX_MSIX_ENTRY];
207 int nvec;
208 char adapter_name[BFA_ADAPTER_SYM_NAME_LEN];
209 char port_name[BFA_ADAPTER_SYM_NAME_LEN];
210 struct timer_list hal_tmo;
211 unsigned long hs_start;
212 struct bfad_im_s *im; /* IM specific data */
213 struct bfa_trc_mod_s *trcmod;
214 struct bfa_plog_s plog_buf;
215 int ref_count;
216 union bfad_tmp_buf tmp_buf;
217 struct fc_host_statistics link_stats;
218 struct list_head pbc_vport_list;
219 /* debugfs specific data */
220 char *regdata;
221 u32 reglen;
222 struct dentry *bfad_dentry_files[5];
223 struct list_head free_aen_q;
224 struct list_head active_aen_q;
225 struct bfa_aen_entry_s aen_list[BFA_AEN_MAX_ENTRY];
226 spinlock_t bfad_aen_spinlock;
227 struct list_head vport_list;
228};
229
230/* BFAD state machine events */
231enum bfad_sm_event {
232 BFAD_E_CREATE = 1,
233 BFAD_E_KTHREAD_CREATE_FAILED = 2,
234 BFAD_E_INIT = 3,
235 BFAD_E_INIT_SUCCESS = 4,
236 BFAD_E_HAL_INIT_FAILED = 5,
237 BFAD_E_INIT_FAILED = 6,
238 BFAD_E_FCS_EXIT_COMP = 7,
239 BFAD_E_EXIT_COMP = 8,
240 BFAD_E_STOP = 9
241};
242
243/*
244 * RPORT data structure
245 */
246struct bfad_rport_s {
247 struct bfa_fcs_rport_s fcs_rport;
248};
249
250struct bfad_buf_info {
251 void *virt;
252 dma_addr_t phys;
253 u32 size;
254};
255
256struct bfad_fcxp {
257 struct bfad_port_s *port;
258 struct bfa_rport_s *bfa_rport;
259 bfa_status_t req_status;
260 u16 tag;
261 u16 rsp_len;
262 u16 rsp_maxlen;
263 u8 use_ireqbuf;
264 u8 use_irspbuf;
265 u32 num_req_sgles;
266 u32 num_rsp_sgles;
267 struct fchs_s fchs;
268 void *reqbuf_info;
269 void *rspbuf_info;
270 struct bfa_sge_s *req_sge;
271 struct bfa_sge_s *rsp_sge;
272 fcxp_send_cb_t send_cbfn;
273 void *send_cbarg;
274 void *bfa_fcxp;
275 struct completion comp;
276};
277
278struct bfad_hal_comp {
279 bfa_status_t status;
280 struct completion comp;
281};
282
283#define BFA_LOG(level, bfad, mask, fmt, arg...) \
284do { \
285 if (((mask) == 4) || (level[1] <= '4')) \
286 dev_printk(level, &((bfad)->pcidev)->dev, fmt, ##arg); \
287} while (0)
288
289bfa_status_t bfad_vport_create(struct bfad_s *bfad, u16 vf_id,
290 struct bfa_lport_cfg_s *port_cfg,
291 struct device *dev);
292bfa_status_t bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
293 struct bfa_lport_cfg_s *port_cfg);
294bfa_status_t bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role);
295bfa_status_t bfad_drv_init(struct bfad_s *bfad);
296bfa_status_t bfad_start_ops(struct bfad_s *bfad);
297void bfad_drv_start(struct bfad_s *bfad);
298void bfad_uncfg_pport(struct bfad_s *bfad);
299void bfad_stop(struct bfad_s *bfad);
300void bfad_fcs_stop(struct bfad_s *bfad);
301void bfad_remove_intr(struct bfad_s *bfad);
302void bfad_hal_mem_release(struct bfad_s *bfad);
303void bfad_hcb_comp(void *arg, bfa_status_t status);
304
305int bfad_setup_intr(struct bfad_s *bfad);
306void bfad_remove_intr(struct bfad_s *bfad);
307void bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg);
308bfa_status_t bfad_hal_mem_alloc(struct bfad_s *bfad);
309void bfad_bfa_tmo(struct timer_list *t);
310void bfad_init_timer(struct bfad_s *bfad);
311int bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad);
312void bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
313void bfad_drv_uninit(struct bfad_s *bfad);
314int bfad_worker(void *ptr);
315void bfad_debugfs_init(struct bfad_port_s *port);
316void bfad_debugfs_exit(struct bfad_port_s *port);
317
318void bfad_pci_remove(struct pci_dev *pdev);
319int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid);
320void bfad_rport_online_wait(struct bfad_s *bfad);
321int bfad_get_linkup_delay(struct bfad_s *bfad);
322int bfad_install_msix_handler(struct bfad_s *bfad);
323
324extern struct idr bfad_im_port_index;
325extern struct pci_device_id bfad_id_table[];
326extern struct list_head bfad_list;
327extern char *os_name;
328extern char *os_patch;
329extern char *host_name;
330extern int num_rports;
331extern int num_ios;
332extern int num_tms;
333extern int num_fcxps;
334extern int num_ufbufs;
335extern int reqq_size;
336extern int rspq_size;
337extern int num_sgpgs;
338extern int rport_del_timeout;
339extern int bfa_lun_queue_depth;
340extern int bfa_io_max_sge;
341extern int bfa_log_level;
342extern int ioc_auto_recover;
343extern int bfa_linkup_delay;
344extern int msix_disable_cb;
345extern int msix_disable_ct;
346extern int fdmi_enable;
347extern int supported_fc4s;
348extern int pcie_max_read_reqsz;
349extern int max_xfer_size;
350extern int bfa_debugfs_enable;
351extern struct mutex bfad_mutex;
352
353#endif /* __BFAD_DRV_H__ */