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 | /* |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 12 | * Contains base driver definitions. |
| 13 | */ |
| 14 | |
Jing Huang | acdc79a | 2010-10-18 17:15:55 -0700 | [diff] [blame] | 15 | /* |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 16 | * bfa_drv.h Linux driver data structures. |
| 17 | */ |
| 18 | |
| 19 | #ifndef __BFAD_DRV_H__ |
| 20 | #define __BFAD_DRV_H__ |
| 21 | |
Maggie Zhang | f16a175 | 2010-12-09 19:12:32 -0800 | [diff] [blame] | 22 | #include <linux/types.h> |
Maggie Zhang | f16a175 | 2010-12-09 19:12:32 -0800 | [diff] [blame] | 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> |
Krishna Gudipati | 881c1b3 | 2012-08-22 19:52:02 -0700 | [diff] [blame] | 33 | #include <linux/aer.h> |
Maggie Zhang | f16a175 | 2010-12-09 19:12:32 -0800 | [diff] [blame] | 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> |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 39 | #include <scsi/scsi_bsg_fc.h> |
Krishna Gudipati | 5b7db7a | 2011-12-20 18:58:32 -0800 | [diff] [blame] | 40 | #include <scsi/scsi_devinfo.h> |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 41 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 42 | #include "bfa_modules.h" |
| 43 | #include "bfa_fcs.h" |
| 44 | #include "bfa_defs_fcs.h" |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 45 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 46 | #include "bfa_plog.h" |
| 47 | #include "bfa_cs.h" |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 48 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 49 | #define BFAD_DRIVER_NAME "bfa" |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 50 | #ifdef BFA_DRIVER_VERSION |
| 51 | #define BFAD_DRIVER_VERSION BFA_DRIVER_VERSION |
| 52 | #else |
Benjamin Poirier | 2d1148f | 2016-12-23 20:40:19 -0800 | [diff] [blame] | 53 | #define BFAD_DRIVER_VERSION "3.2.25.1" |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 54 | #endif |
| 55 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 56 | #define BFAD_PROTO_NAME FCPI_NAME |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 57 | #define BFAD_IRQ_FLAGS IRQF_SHARED |
| 58 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 59 | #ifndef FC_PORTSPEED_8GBIT |
| 60 | #define FC_PORTSPEED_8GBIT 0x10 |
| 61 | #endif |
| 62 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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 |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 73 | #define BFAD_FCS_INIT_DONE 0x00000080 |
| 74 | #define BFAD_HAL_INIT_FAIL 0x00000100 |
| 75 | #define BFAD_FC4_PROBE_DONE 0x00000200 |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 76 | #define BFAD_PORT_DELETE 0x00000001 |
Krishna Gudipati | 61e62e2 | 2011-06-24 20:29:07 -0700 | [diff] [blame] | 77 | #define BFAD_INTX_ON 0x00000400 |
Krishna Gudipati | 881c1b3 | 2012-08-22 19:52:02 -0700 | [diff] [blame] | 78 | #define BFAD_EEH_BUSY 0x00000800 |
| 79 | #define BFAD_EEH_PCI_CHANNEL_IO_PERM_FAILURE 0x00001000 |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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 | */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 90 | #define BFAD_LUN_QUEUE_DEPTH 32 |
| 91 | #define BFAD_IO_MAX_SGE SG_ALL |
Krishna Gudipati | 61e62e2 | 2011-06-24 20:29:07 -0700 | [diff] [blame] | 92 | #define BFAD_MIN_SECTORS 128 /* 64k */ |
| 93 | #define BFAD_MAX_SECTORS 0xFFFF /* 32 MB */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 94 | |
| 95 | #define bfad_isr_t irq_handler_t |
| 96 | |
| 97 | #define MAX_MSIX_ENTRY 22 |
| 98 | |
| 99 | struct bfad_msix_s { |
| 100 | struct bfad_s *bfad; |
| 101 | struct msix_entry msix; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 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 | */ |
| 109 | enum { |
| 110 | BFA_TRC_LDRV_BFAD = 1, |
| 111 | BFA_TRC_LDRV_IM = 2, |
Krishna Gudipati | b85daaf | 2011-06-13 15:55:11 -0700 | [diff] [blame] | 112 | BFA_TRC_LDRV_BSG = 3, |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 113 | }; |
| 114 | |
| 115 | enum 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 | */ |
| 125 | struct bfad_port_s { |
| 126 | struct list_head list_entry; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 127 | struct bfad_s *bfad; |
| 128 | struct bfa_fcs_lport_s *fcs_port; |
| 129 | u32 roles; |
| 130 | s32 flags; |
| 131 | u32 supported_fc4s; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 132 | enum bfad_port_pvb_type pvb_type; |
| 133 | struct bfad_im_port_s *im_port; /* IM specific data */ |
Jing Huang | ab2a9ba | 2010-07-08 20:02:55 -0700 | [diff] [blame] | 134 | /* port debugfs specific data */ |
| 135 | struct dentry *port_debugfs_root; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 136 | }; |
| 137 | |
| 138 | /* |
| 139 | * VPORT data structure |
| 140 | */ |
| 141 | struct bfad_vport_s { |
| 142 | struct bfad_port_s drv_port; |
| 143 | struct bfa_fcs_vport_s fcs_vport; |
| 144 | struct completion *comp_del; |
Jing Huang | d988354 | 2010-07-08 19:46:26 -0700 | [diff] [blame] | 145 | struct list_head list_entry; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 146 | }; |
| 147 | |
| 148 | /* |
| 149 | * VF data structure |
| 150 | */ |
| 151 | struct 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 | |
| 157 | struct bfad_cfg_param_s { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 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 | |
| 165 | union 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]; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 177 | }; |
| 178 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 179 | /* |
| 180 | * BFAD (PCI function) data structure |
| 181 | */ |
| 182 | struct bfad_s { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 183 | bfa_sm_t sm; /* state machine */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 184 | struct list_head list_entry; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 185 | struct bfa_s bfa; |
| 186 | struct bfa_fcs_s bfa_fcs; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 191 | void __iomem *pci_bar0_kva; |
Krishna Gudipati | 1118920 | 2011-06-13 15:50:35 -0700 | [diff] [blame] | 192 | void __iomem *pci_bar2_kva; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 193 | struct completion comp; |
| 194 | struct completion suspend; |
Krishna Gudipati | 6013806 | 2011-06-24 20:25:15 -0700 | [diff] [blame] | 195 | struct completion enable_comp; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 201 | u32 inst_no; /* BFAD instance number */ |
| 202 | u32 bfad_flags; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 203 | spinlock_t bfad_lock; |
Krishna Gudipati | e671432 | 2010-03-03 17:44:02 -0800 | [diff] [blame] | 204 | struct task_struct *bfad_tsk; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 205 | struct bfad_cfg_param_s cfg_data; |
| 206 | struct bfad_msix_s msix_tab[MAX_MSIX_ENTRY]; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 207 | int nvec; |
| 208 | char adapter_name[BFA_ADAPTER_SYM_NAME_LEN]; |
| 209 | char port_name[BFA_ADAPTER_SYM_NAME_LEN]; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 210 | struct timer_list hal_tmo; |
| 211 | unsigned long hs_start; |
| 212 | struct bfad_im_s *im; /* IM specific data */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 213 | struct bfa_trc_mod_s *trcmod; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 214 | struct bfa_plog_s plog_buf; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 215 | int ref_count; |
| 216 | union bfad_tmp_buf tmp_buf; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 217 | struct fc_host_statistics link_stats; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 218 | struct list_head pbc_vport_list; |
Jing Huang | ab2a9ba | 2010-07-08 20:02:55 -0700 | [diff] [blame] | 219 | /* debugfs specific data */ |
| 220 | char *regdata; |
| 221 | u32 reglen; |
| 222 | struct dentry *bfad_dentry_files[5]; |
Krishna Gudipati | 7826f30 | 2011-07-20 16:59:13 -0700 | [diff] [blame] | 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; |
Krishna Gudipati | 5b7db7a | 2011-12-20 18:58:32 -0800 | [diff] [blame] | 227 | struct list_head vport_list; |
Jing Huang | d988354 | 2010-07-08 19:46:26 -0700 | [diff] [blame] | 228 | }; |
| 229 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 230 | /* BFAD state machine events */ |
| 231 | enum 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, |
Vijaya Mohan Guvva | da3e0be | 2013-11-21 01:37:33 -0800 | [diff] [blame] | 236 | BFAD_E_HAL_INIT_FAILED = 5, |
| 237 | BFAD_E_INIT_FAILED = 6, |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 238 | BFAD_E_FCS_EXIT_COMP = 7, |
| 239 | BFAD_E_EXIT_COMP = 8, |
| 240 | BFAD_E_STOP = 9 |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 241 | }; |
| 242 | |
| 243 | /* |
| 244 | * RPORT data structure |
| 245 | */ |
| 246 | struct bfad_rport_s { |
| 247 | struct bfa_fcs_rport_s fcs_rport; |
| 248 | }; |
| 249 | |
| 250 | struct bfad_buf_info { |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 251 | void *virt; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 252 | dma_addr_t phys; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 253 | u32 size; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 254 | }; |
| 255 | |
| 256 | struct bfad_fcxp { |
| 257 | struct bfad_port_s *port; |
| 258 | struct bfa_rport_s *bfa_rport; |
| 259 | bfa_status_t req_status; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 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; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 270 | struct bfa_sge_s *req_sge; |
| 271 | struct bfa_sge_s *rsp_sge; |
| 272 | fcxp_send_cb_t send_cbfn; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 273 | void *send_cbarg; |
| 274 | void *bfa_fcxp; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 275 | struct completion comp; |
| 276 | }; |
| 277 | |
| 278 | struct bfad_hal_comp { |
| 279 | bfa_status_t status; |
| 280 | struct completion comp; |
| 281 | }; |
| 282 | |
Maggie Zhang | f16a175 | 2010-12-09 19:12:32 -0800 | [diff] [blame] | 283 | #define BFA_LOG(level, bfad, mask, fmt, arg...) \ |
| 284 | do { \ |
| 285 | if (((mask) == 4) || (level[1] <= '4')) \ |
| 286 | dev_printk(level, &((bfad)->pcidev)->dev, fmt, ##arg); \ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 287 | } while (0) |
| 288 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 289 | bfa_status_t bfad_vport_create(struct bfad_s *bfad, u16 vf_id, |
| 290 | struct bfa_lport_cfg_s *port_cfg, |
| 291 | struct device *dev); |
| 292 | bfa_status_t bfad_vf_create(struct bfad_s *bfad, u16 vf_id, |
| 293 | struct bfa_lport_cfg_s *port_cfg); |
| 294 | bfa_status_t bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role); |
| 295 | bfa_status_t bfad_drv_init(struct bfad_s *bfad); |
Krishna Gudipati | e671432 | 2010-03-03 17:44:02 -0800 | [diff] [blame] | 296 | bfa_status_t bfad_start_ops(struct bfad_s *bfad); |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 297 | void bfad_drv_start(struct bfad_s *bfad); |
| 298 | void bfad_uncfg_pport(struct bfad_s *bfad); |
| 299 | void bfad_stop(struct bfad_s *bfad); |
| 300 | void bfad_fcs_stop(struct bfad_s *bfad); |
| 301 | void bfad_remove_intr(struct bfad_s *bfad); |
| 302 | void bfad_hal_mem_release(struct bfad_s *bfad); |
| 303 | void bfad_hcb_comp(void *arg, bfa_status_t status); |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 304 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 305 | int bfad_setup_intr(struct bfad_s *bfad); |
| 306 | void bfad_remove_intr(struct bfad_s *bfad); |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 307 | void bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg); |
| 308 | bfa_status_t bfad_hal_mem_alloc(struct bfad_s *bfad); |
Kees Cook | e99e88a | 2017-10-16 14:43:17 -0700 | [diff] [blame] | 309 | void bfad_bfa_tmo(struct timer_list *t); |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 310 | void bfad_init_timer(struct bfad_s *bfad); |
| 311 | int bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad); |
| 312 | void bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad); |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 313 | void bfad_drv_uninit(struct bfad_s *bfad); |
Jing Huang | ab2a9ba | 2010-07-08 20:02:55 -0700 | [diff] [blame] | 314 | int bfad_worker(void *ptr); |
| 315 | void bfad_debugfs_init(struct bfad_port_s *port); |
| 316 | void bfad_debugfs_exit(struct bfad_port_s *port); |
Krishna Gudipati | e671432 | 2010-03-03 17:44:02 -0800 | [diff] [blame] | 317 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 318 | void bfad_pci_remove(struct pci_dev *pdev); |
| 319 | int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid); |
Maggie Zhang | f16a175 | 2010-12-09 19:12:32 -0800 | [diff] [blame] | 320 | void bfad_rport_online_wait(struct bfad_s *bfad); |
| 321 | int bfad_get_linkup_delay(struct bfad_s *bfad); |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 322 | int bfad_install_msix_handler(struct bfad_s *bfad); |
| 323 | |
| 324 | extern struct idr bfad_im_port_index; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 325 | extern struct pci_device_id bfad_id_table[]; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 326 | extern struct list_head bfad_list; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 327 | extern char *os_name; |
| 328 | extern char *os_patch; |
| 329 | extern char *host_name; |
| 330 | extern int num_rports; |
| 331 | extern int num_ios; |
| 332 | extern int num_tms; |
| 333 | extern int num_fcxps; |
| 334 | extern int num_ufbufs; |
| 335 | extern int reqq_size; |
| 336 | extern int rspq_size; |
| 337 | extern int num_sgpgs; |
| 338 | extern int rport_del_timeout; |
| 339 | extern int bfa_lun_queue_depth; |
| 340 | extern int bfa_io_max_sge; |
Jing Huang | 8816624 | 2010-12-09 17:11:53 -0800 | [diff] [blame] | 341 | extern int bfa_log_level; |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame] | 342 | extern int ioc_auto_recover; |
| 343 | extern int bfa_linkup_delay; |
| 344 | extern int msix_disable_cb; |
| 345 | extern int msix_disable_ct; |
| 346 | extern int fdmi_enable; |
| 347 | extern int supported_fc4s; |
| 348 | extern int pcie_max_read_reqsz; |
Krishna Gudipati | 61e62e2 | 2011-06-24 20:29:07 -0700 | [diff] [blame] | 349 | extern int max_xfer_size; |
Jing Huang | ab2a9ba | 2010-07-08 20:02:55 -0700 | [diff] [blame] | 350 | extern int bfa_debugfs_enable; |
Jing Huang | 42b426e | 2010-03-19 11:07:09 -0700 | [diff] [blame] | 351 | extern struct mutex bfad_mutex; |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 352 | |
| 353 | #endif /* __BFAD_DRV_H__ */ |