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