Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
bfad.c File Reference
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/pci.h>
#include <linux/firmware.h>
#include <asm/uaccess.h>
#include <asm/fcntl.h>
#include "bfad_drv.h"
#include "bfad_im.h"
#include "bfa_fcs.h"
#include "bfa_defs.h"
#include "bfa.h"

Go to the source code of this file.

Macros

#define BFAD_FW_FILE_CB   "cbfw-3.1.0.0.bin"
 
#define BFAD_FW_FILE_CT   "ctfw-3.1.0.0.bin"
 
#define BFAD_FW_FILE_CT2   "ct2fw-3.1.0.0.bin"
 

Functions

 BFA_TRC_FILE (LDRV, BFAD)
 
 DEFINE_MUTEX (bfad_mutex)
 
 LIST_HEAD (bfad_list)
 
 MODULE_FIRMWARE (BFAD_FW_FILE_CB)
 
 MODULE_FIRMWARE (BFAD_FW_FILE_CT)
 
 MODULE_FIRMWARE (BFAD_FW_FILE_CT2)
 
 module_param (os_name, charp, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (os_name,"OS name of the hba host machine")
 
 module_param (os_patch, charp, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (os_patch,"OS patch level of the hba host machine")
 
 module_param (host_name, charp, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (host_name,"Hostname of the hba host machine")
 
 module_param (num_rports, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (num_rports,"Max number of rports supported per port ""(physical/logical), default=1024")
 
 module_param (num_ios, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (num_ios,"Max number of ioim requests, default=2000")
 
 module_param (num_tms, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (num_tms,"Max number of task im requests, default=128")
 
 module_param (num_fcxps, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (num_fcxps,"Max number of fcxp requests, default=64")
 
 module_param (num_ufbufs, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (num_ufbufs,"Max number of unsolicited frame ""buffers, default=64")
 
 module_param (reqq_size, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (reqq_size,"Max number of request queue elements, ""default=256")
 
 module_param (rspq_size, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (rspq_size,"Max number of response queue elements, ""default=64")
 
 module_param (num_sgpgs, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (num_sgpgs,"Number of scatter/gather pages, default=2048")
 
 module_param (rport_del_timeout, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (rport_del_timeout,"Rport delete timeout, default=90 secs, ""Range[>0]")
 
 module_param (bfa_lun_queue_depth, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (bfa_lun_queue_depth,"Lun queue depth, default=32, Range[>0]")
 
 module_param (bfa_io_max_sge, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (bfa_io_max_sge,"Max io scatter/gather elements, default=255")
 
 module_param (bfa_log_level, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (bfa_log_level,"Driver log level, default=3, ""Range[Critical:1|Error:2|Warning:3|Info:4]")
 
 module_param (ioc_auto_recover, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (ioc_auto_recover,"IOC auto recovery, default=1, ""Range[off:0|on:1]")
 
 module_param (bfa_linkup_delay, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (bfa_linkup_delay,"Link up delay, default=30 secs for ""boot port. Otherwise 10 secs in RHEL4 & 0 for ""[RHEL5, SLES10, ESX40] Range[>0]")
 
 module_param (msix_disable_cb, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (msix_disable_cb,"Disable Message Signaled Interrupts ""for Brocade-415/425/815/825 cards, default=0, "" Range[false:0|true:1]")
 
 module_param (msix_disable_ct, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (msix_disable_ct,"Disable Message Signaled Interrupts ""if possible for Brocade-1010/1020/804/1007/902/1741 ""cards, default=0, Range[false:0|true:1]")
 
 module_param (fdmi_enable, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (fdmi_enable,"Enables fdmi registration, default=1, ""Range[false:0|true:1]")
 
 module_param (pcie_max_read_reqsz, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (pcie_max_read_reqsz,"PCIe max read request size, default=0 ""(use system setting), Range[128|256|512|1024|2048|4096]")
 
 module_param (bfa_debugfs_enable, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (bfa_debugfs_enable,"Enables debugfs feature, default=1,"" Range[false:0|true:1]")
 
 module_param (max_xfer_size, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (max_xfer_size,"default=32MB,"" Range[64k|128k|256k|512k|1024k|2048k]")
 
 module_param (max_rport_logins, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (max_rport_logins,"Max number of logins to initiator and target rports on a port (physical/logical), default=1024")
 
void bfad_hcb_comp (void *arg, bfa_status_t status)
 
void bfa_cb_init (void *drv, bfa_status_t init_status)
 
struct bfad_port_sbfa_fcb_lport_new (struct bfad_s *bfad, struct bfa_fcs_lport_s *port, enum bfa_lport_role roles, struct bfad_vf_s *vf_drv, struct bfad_vport_s *vp_drv)
 
bfa_status_t bfa_fcb_rport_alloc (struct bfad_s *bfad, struct bfa_fcs_rport_s **rport, struct bfad_rport_s **rport_drv)
 
void bfa_fcb_pbc_vport_create (struct bfad_s *bfad, struct bfi_pbc_vport_s pbc_vport)
 
void bfad_hal_mem_release (struct bfad_s *bfad)
 
void bfad_update_hal_cfg (struct bfa_iocfc_cfg_s *bfa_cfg)
 
bfa_status_t bfad_hal_mem_alloc (struct bfad_s *bfad)
 
bfa_status_t bfad_vport_create (struct bfad_s *bfad, u16 vf_id, struct bfa_lport_cfg_s *port_cfg, struct device *dev)
 
void bfad_bfa_tmo (unsigned long data)
 
void bfad_init_timer (struct bfad_s *bfad)
 
int bfad_pci_init (struct pci_dev *pdev, struct bfad_s *bfad)
 
void bfad_pci_uninit (struct pci_dev *pdev, struct bfad_s *bfad)
 
bfa_status_t bfad_drv_init (struct bfad_s *bfad)
 
void bfad_drv_uninit (struct bfad_s *bfad)
 
void bfad_drv_start (struct bfad_s *bfad)
 
void bfad_fcs_stop (struct bfad_s *bfad)
 
void bfad_stop (struct bfad_s *bfad)
 
bfa_status_t bfad_cfg_pport (struct bfad_s *bfad, enum bfa_lport_role role)
 
void bfad_uncfg_pport (struct bfad_s *bfad)
 
bfa_status_t bfad_start_ops (struct bfad_s *bfad)
 
int bfad_worker (void *ptr)
 
irqreturn_t bfad_intx (int irq, void *dev_id)
 
int bfad_install_msix_handler (struct bfad_s *bfad)
 
int bfad_setup_intr (struct bfad_s *bfad)
 
void bfad_remove_intr (struct bfad_s *bfad)
 
int bfad_pci_probe (struct pci_dev *pdev, const struct pci_device_id *pid)
 
void bfad_pci_remove (struct pci_dev *pdev)
 
int restart_bfa (struct bfad_s *bfad)
 
 MODULE_DEVICE_TABLE (pci, bfad_id_table)
 
 module_init (bfad_init)
 
 module_exit (bfad_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("Brocade Fibre Channel HBA Driver"BFAD_PROTO_NAME)
 
 MODULE_AUTHOR ("Brocade Communications Systems, Inc.")
 
 MODULE_VERSION (BFAD_DRIVER_VERSION)
 

Variables

int supported_fc4s
 
charhost_name
 
charos_name
 
charos_patch
 
int num_rports
 
int num_ios
 
int num_tms
 
int num_fcxps
 
int num_ufbufs
 
int reqq_size
 
int rspq_size
 
int num_sgpgs
 
int rport_del_timeout = BFA_FCS_RPORT_DEF_DEL_TIMEOUT
 
int bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH
 
int bfa_io_max_sge = BFAD_IO_MAX_SGE
 
int bfa_log_level = 3
 
int ioc_auto_recover = BFA_TRUE
 
int bfa_linkup_delay = -1
 
int fdmi_enable = BFA_TRUE
 
int pcie_max_read_reqsz
 
int bfa_debugfs_enable = 1
 
int msix_disable_cb = 0
 
int msix_disable_ct = 0
 
int max_xfer_size = BFAD_MAX_SECTORS >> 1
 
int max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS
 
u32 bfi_image_cb_size
 
u32 bfi_image_ct_size
 
u32 bfi_image_ct2_size
 
u32bfi_image_cb
 
u32bfi_image_ct
 
u32bfi_image_ct2
 
struct pci_device_id bfad_id_table []
 

Macro Definition Documentation

#define BFAD_FW_FILE_CB   "cbfw-3.1.0.0.bin"

Definition at line 66 of file bfad.c.

#define BFAD_FW_FILE_CT   "ctfw-3.1.0.0.bin"

Definition at line 67 of file bfad.c.

#define BFAD_FW_FILE_CT2   "ct2fw-3.1.0.0.bin"

Definition at line 68 of file bfad.c.

Function Documentation

void bfa_cb_init ( void drv,
bfa_status_t  init_status 
)

Definition at line 402 of file bfad.c.

struct bfad_port_s* bfa_fcb_lport_new ( struct bfad_s bfad,
struct bfa_fcs_lport_s port,
enum bfa_lport_role  roles,
struct bfad_vf_s vf_drv,
struct bfad_vport_s vp_drv 
)
read

Definition at line 427 of file bfad.c.

void bfa_fcb_pbc_vport_create ( struct bfad_s bfad,
struct bfi_pbc_vport_s  pbc_vport 
)

Definition at line 487 of file bfad.c.

bfa_status_t bfa_fcb_rport_alloc ( struct bfad_s bfad,
struct bfa_fcs_rport_s **  rport,
struct bfad_rport_s **  rport_drv 
)

Definition at line 466 of file bfad.c.

BFA_TRC_FILE ( LDRV  ,
BFAD   
)
void bfad_bfa_tmo ( unsigned long  data)

Definition at line 682 of file bfad.c.

bfa_status_t bfad_cfg_pport ( struct bfad_s bfad,
enum bfa_lport_role  role 
)

Definition at line 968 of file bfad.c.

bfa_status_t bfad_drv_init ( struct bfad_s bfad)

Definition at line 840 of file bfad.c.

void bfad_drv_start ( struct bfad_s bfad)

Definition at line 922 of file bfad.c.

void bfad_drv_uninit ( struct bfad_s bfad)

Definition at line 902 of file bfad.c.

void bfad_fcs_stop ( struct bfad_s bfad)

Definition at line 938 of file bfad.c.

bfa_status_t bfad_hal_mem_alloc ( struct bfad_s bfad)

Definition at line 580 of file bfad.c.

void bfad_hal_mem_release ( struct bfad_s bfad)

Definition at line 518 of file bfad.c.

void bfad_hcb_comp ( void arg,
bfa_status_t  status 
)

Definition at line 390 of file bfad.c.

void bfad_init_timer ( struct bfad_s bfad)

Definition at line 707 of file bfad.c.

int bfad_install_msix_handler ( struct bfad_s bfad)

Definition at line 1216 of file bfad.c.

irqreturn_t bfad_intx ( int  irq,
void dev_id 
)

Definition at line 1138 of file bfad.c.

int bfad_pci_init ( struct pci_dev pdev,
struct bfad_s bfad 
)

Definition at line 718 of file bfad.c.

int bfad_pci_probe ( struct pci_dev pdev,
const struct pci_device_id pid 
)

Definition at line 1353 of file bfad.c.

void bfad_pci_remove ( struct pci_dev pdev)

Definition at line 1455 of file bfad.c.

void bfad_pci_uninit ( struct pci_dev pdev,
struct bfad_s bfad 
)

Definition at line 828 of file bfad.c.

void bfad_remove_intr ( struct bfad_s bfad)

Definition at line 1333 of file bfad.c.

int bfad_setup_intr ( struct bfad_s bfad)

Definition at line 1252 of file bfad.c.

bfa_status_t bfad_start_ops ( struct bfad_s bfad)

Definition at line 1009 of file bfad.c.

void bfad_stop ( struct bfad_s bfad)

Definition at line 953 of file bfad.c.

void bfad_uncfg_pport ( struct bfad_s bfad)

Definition at line 995 of file bfad.c.

void bfad_update_hal_cfg ( struct bfa_iocfc_cfg_s bfa_cfg)

Definition at line 546 of file bfad.c.

bfa_status_t bfad_vport_create ( struct bfad_s bfad,
u16  vf_id,
struct bfa_lport_cfg_s port_cfg,
struct device dev 
)

Definition at line 631 of file bfad.c.

int bfad_worker ( void ptr)

Definition at line 1112 of file bfad.c.

DEFINE_MUTEX ( bfad_mutex  )
LIST_HEAD ( bfad_list  )
MODULE_AUTHOR ( "Brocade Communications  Systems,
Inc."   
)
MODULE_DESCRIPTION ( "Brocade Fibre Channel HBA Driver"  BFAD_PROTO_NAME)
MODULE_DEVICE_TABLE ( pci  ,
bfad_id_table   
)
module_exit ( bfad_exit  )
MODULE_FIRMWARE ( BFAD_FW_FILE_CB  )
MODULE_FIRMWARE ( BFAD_FW_FILE_CT  )
MODULE_FIRMWARE ( BFAD_FW_FILE_CT2  )
module_init ( bfad_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( os_name  ,
charp  ,
S_IRUGO S_IWUSR 
)
module_param ( os_patch  ,
charp  ,
S_IRUGO S_IWUSR 
)
module_param ( host_name  ,
charp  ,
S_IRUGO S_IWUSR 
)
module_param ( num_rports  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( num_ios  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( num_tms  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( num_fcxps  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( num_ufbufs  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( reqq_size  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( rspq_size  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( num_sgpgs  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( rport_del_timeout  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( bfa_lun_queue_depth  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( bfa_io_max_sge  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( bfa_log_level  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( ioc_auto_recover  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( bfa_linkup_delay  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( msix_disable_cb  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( msix_disable_ct  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( fdmi_enable  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( pcie_max_read_reqsz  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( bfa_debugfs_enable  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( max_xfer_size  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param ( max_rport_logins  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( os_name  ,
"OS name of the hba host machine  
)
MODULE_PARM_DESC ( os_patch  ,
"OS patch level of the hba host machine  
)
MODULE_PARM_DESC ( host_name  ,
"Hostname of the hba host machine  
)
MODULE_PARM_DESC ( num_rports  ,
"Max number of rports supported per port ""  physical/logical 
)
MODULE_PARM_DESC ( num_ios  ,
"Max number of ioim  requests 
)
MODULE_PARM_DESC ( num_tms  ,
"Max number of task im  requests 
)
MODULE_PARM_DESC ( num_fcxps  ,
"Max number of fcxp  requests 
)
MODULE_PARM_DESC ( num_ufbufs  ,
"Max number of unsolicited frame ""  buffers 
)
MODULE_PARM_DESC ( reqq_size  ,
"Max number of request queue  elements 
)
MODULE_PARM_DESC ( rspq_size  ,
"Max number of response queue  elements 
)
MODULE_PARM_DESC ( num_sgpgs  ,
"Number of scatter/gather  pages 
)
MODULE_PARM_DESC ( rport_del_timeout  ,
"Rport delete  timeout,
default  = 90 secs,
""Range"  [>0] 
)
MODULE_PARM_DESC ( bfa_lun_queue_depth  ,
"Lun queue  depth,
default  = 32,
Range"  [>0] 
)
MODULE_PARM_DESC ( bfa_io_max_sge  ,
"Max io scatter/gather  elements 
)
MODULE_PARM_DESC ( bfa_log_level  ,
"Driver log  level,
default  = 3,
""Range"  [Critical:1|Error:2|Warning:3|Info:4] 
)
MODULE_PARM_DESC ( ioc_auto_recover  ,
"IOC auto  recovery,
default  = 1,
""Range"  [off:0|on:1] 
)
MODULE_PARM_DESC ( bfa_linkup_delay  ,
"Link up  delay,
default  = 30 secs for ""boot port. Otherwise 10 secs in RHEL4 & 0 for ""[RHEL5,
SLES10  ,
ESX40] Range"  [>0] 
)
MODULE_PARM_DESC ( msix_disable_cb  ,
"Disable Message Signaled Interrupts ""for Brocade-415/425/815/825  cards,
default  = 0,
""Range"  [false:0|true:1] 
)
MODULE_PARM_DESC ( msix_disable_ct  ,
"Disable Message Signaled Interrupts ""if possible for Brocade-1010/1020/804/1007/902/1741 ""  cards,
default  = 0,
Range"  [false:0|true:1] 
)
MODULE_PARM_DESC ( fdmi_enable  ,
"Enables fdmi  registration,
default  = 1,
""Range"  [false:0|true:1] 
)
MODULE_PARM_DESC ( pcie_max_read_reqsz  ,
"PCIe max read request  size,
default  = 0 ""(use system setting),
Range"  [128|256|512|1024|2048|4096] 
)
MODULE_PARM_DESC ( bfa_debugfs_enable  ,
"Enables debugfs  feature,
default  = 1,
""Range"  [false:0|true:1] 
)
MODULE_PARM_DESC ( max_xfer_size  ,
default = 32MB,
""Range"  [64k|128k|256k|512k|1024k|2048k] 
)
MODULE_PARM_DESC ( max_rport_logins  ,
"Max number of logins to initiator and target rports on a port   physical/logical 
)
MODULE_VERSION ( BFAD_DRIVER_VERSION  )
int restart_bfa ( struct bfad_s bfad)

Definition at line 1555 of file bfad.c.

Variable Documentation

int bfa_debugfs_enable = 1

Definition at line 57 of file bfad.c.

int bfa_io_max_sge = BFAD_IO_MAX_SGE

Definition at line 51 of file bfad.c.

int bfa_linkup_delay = -1

Definition at line 54 of file bfad.c.

int bfa_log_level = 3

Definition at line 52 of file bfad.c.

int bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH

Definition at line 50 of file bfad.c.

struct pci_device_id bfad_id_table[]

Definition at line 1685 of file bfad.c.

u32* bfi_image_cb

Definition at line 64 of file bfad.c.

u32 bfi_image_cb_size

Definition at line 63 of file bfad.c.

u32 * bfi_image_ct

Definition at line 64 of file bfad.c.

u32 * bfi_image_ct2

Definition at line 64 of file bfad.c.

u32 bfi_image_ct2_size

Definition at line 63 of file bfad.c.

u32 bfi_image_ct_size

Definition at line 63 of file bfad.c.

int fdmi_enable = BFA_TRUE

Definition at line 55 of file bfad.c.

char* host_name

Definition at line 45 of file bfad.c.

int ioc_auto_recover = BFA_TRUE

Definition at line 53 of file bfad.c.

int max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS

Definition at line 60 of file bfad.c.

int max_xfer_size = BFAD_MAX_SECTORS >> 1

Definition at line 59 of file bfad.c.

int msix_disable_cb = 0

Definition at line 58 of file bfad.c.

int msix_disable_ct = 0

Definition at line 58 of file bfad.c.

int num_fcxps

Definition at line 47 of file bfad.c.

int num_ios

Definition at line 46 of file bfad.c.

int num_rports

Definition at line 46 of file bfad.c.

int num_sgpgs

Definition at line 48 of file bfad.c.

int num_tms

Definition at line 46 of file bfad.c.

int num_ufbufs

Definition at line 47 of file bfad.c.

char * os_name

Definition at line 45 of file bfad.c.

char * os_patch

Definition at line 45 of file bfad.c.

int pcie_max_read_reqsz

Definition at line 56 of file bfad.c.

int reqq_size

Definition at line 48 of file bfad.c.

int rport_del_timeout = BFA_FCS_RPORT_DEF_DEL_TIMEOUT

Definition at line 49 of file bfad.c.

int rspq_size

Definition at line 48 of file bfad.c.

int supported_fc4s

Definition at line 44 of file bfad.c.