bfa: Brocade BFA FC SCSI driver (include part3)
Subsystems (2)
PATCH 12/14 bfa: Brocade BFA FC SCSI driver (include part3)
From: Jing Huang <[email protected]>
This patch contains common header files for linux driver, hardware/firmeare interface, and FC state machines. part-3
--- fcs/bfa_fcs.h | 73 ++ fcs/bfa_fcs_fcpim.h | 131 ++++ fcs/bfa_fcs_fdmi.h | 63 + fcs/bfa_fcs_lport.h | 226 +++++++ fcs/bfa_fcs_rport.h | 104 +++ fcs/bfa_fcs_vport.h | 63 + log/bfa_log_fcs.h | 28 log/bfa_log_hal.h | 30 log/bfa_log_linux.h | 44 + log/bfa_log_wdrv.h | 36 + protocol/ct.h | 492 +++++++++++++++ protocol/fc.h | 1105 ++++++++++++++++++++++++++++++++++ protocol/fc_sp.h | 224 +++++++ protocol/fcp.h | 186 +++++ protocol/fdmi.h | 163 +++++ protocol/pcifw.h | 75 ++ protocol/scsi.h | 1648 ++++++++++++++++++++++++++++++++++++++++++++++++++++ protocol/types.h | 42 + 18 files changed, 4733 insertions(+)
drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h +131 -0
@@ -0,0 +1,131 @@ +/* +* Copyright (c) 2005-2008 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +* +* Linux driver for Brocade Fibre Channel Host Bus Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ + +/** +* bfa_fcs_fcpim.h BFA FCS FCP Initiator Mode interfaces/defines. +*/ + +#ifndef __BFA_FCS_FCPIM_H__ +#define __BFA_FCS_FCPIM_H__ + +#include <defs/bfa_defs_status.h> +#include <defs/bfa_defs_itnim.h> +#include <fcs/bfa_fcs.h> +#include <fcs/bfa_fcs_rport.h> +#include <fcs/bfa_fcs_lport.h> +#include <bfa_fcpim.h> + +/* +* forward declarations +*/ +struct bfad_itnim_s ; + +struct bfa_fcs_itnim_s { +bfa_sm_t sm;/* state machine */ +struct bfa_fcs_rport_s *rport;/* parent remote rport */ +struct bfad_itnim_s *itnim_drv;/* driver peer instance */ +struct bfa_fcs_s *fcs;/* fcs instance */ +struct bfa_timer_s timer;/* timer functions */ +struct bfa_itnim_s *bfa_itnim;/* BFA itnim struct */ +bfa_boolean_t seq_rec;/* seq recovery support */ +bfa_boolean_t rec_support;/* REC supported */ +bfa_boolean_t conf_comp;/* FCP_CONF support */ +bfa_boolean_t task_retry_id;/* task retry id supp */ +struct bfa_fcxp_wqe_s fcxp_wqe;/* wait qelem for fcxp */ +struct bfa_fcxp_s *fcxp;/* FCXP in use */ +struct bfa_itnim_stats_s stats;/* itn statistics */ +}; + + +static inline struct bfad_port_s * +bfa_fcs_itnim_get_drvport (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->rport->port->bfad_port; +} + + +static inline struct bfa_fcs_port_s * +bfa_fcs_itnim_get_port (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->rport->port; +} + + +static inline wwn_t +bfa_fcs_itnim_get_nwwn (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->rport->nwwn; +} + + +static inline wwn_t +bfa_fcs_itnim_get_pwwn (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->rport->pwwn; +} + + +static inline u32 +bfa_fcs_itnim_get_fcid (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->rport->pid; +} + + +static inline u32 +bfa_fcs_itnim_get_maxfrsize (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->rport->maxfrsize; +} + + +static inline enum fc_cos +bfa_fcs_itnim_get_cos (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->rport->fc_cos; +} + + +static inline struct bfad_itnim_s * +bfa_fcs_itnim_get_drvitn (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->itnim_drv; +} + + +static inline struct bfa_itnim_s * +bfa_fcs_itnim_get_halitn (struct bfa_fcs_itnim_s *itnim) +{ +return itnim->bfa_itnim; +} + +/** +* bfa fcs FCP Initiator mode API functions +*/ +void bfa_fcs_itnim_get_attr (struct bfa_fcs_itnim_s *itnim, +struct bfa_itnim_attr_s *attr); +void bfa_fcs_itnim_get_stats (struct bfa_fcs_itnim_s *itnim, +struct bfa_itnim_stats_s *stats); +struct bfa_fcs_itnim_s *bfa_fcs_itnim_lookup (struct bfa_fcs_port_s *port, +wwn_t rpwwn); +bfa_status_t bfa_fcs_itnim_attr_get (struct bfa_fcs_port_s *port,wwn_t rpwwn, +struct bfa_itnim_attr_s *attr); +bfa_status_t bfa_fcs_itnim_stats_get (struct bfa_fcs_port_s *port,wwn_t rpwwn, +struct bfa_itnim_stats_s *stats); +bfa_status_t bfa_fcs_itnim_stats_clear (struct bfa_fcs_port_s *port, +wwn_t rpwwn); +#endif /* __BFA_FCS_FCPIM_H__ */
drivers/scsi/bfa/include/fcs/bfa_fcs_fdmi.h +63 -0
63 lines not on this page · raw message
drivers/scsi/bfa/include/fcs/bfa_fcs.h +73 -0
73 lines not on this page · raw message
drivers/scsi/bfa/include/fcs/bfa_fcs_lport.h +226 -0
226 lines not on this page · raw message
drivers/scsi/bfa/include/fcs/bfa_fcs_rport.h +104 -0
104 lines not on this page · raw message
drivers/scsi/bfa/include/fcs/bfa_fcs_vport.h +63 -0
63 lines not on this page · raw message
drivers/scsi/bfa/include/log/bfa_log_fcs.h +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005-2008 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +* +* Linux driver for Brocade Fibre Channel Host Bus Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ + +/* +* messages define for FCS Module +*/ +#ifndef __BFA_LOG_FCS_H__ +#define __BFA_LOG_FCS_H__ +#include <cs/bfa_log.h> +#define BFA_LOG_FCS_FABRIC_NOSWITCH \ + (((u32) BFA_LOG_FCS_ID << BFA_LOG_MODID_OFFSET) | 1) +#define BFA_LOG_FCS_FABRIC_ISOLATED \ + (((u32) BFA_LOG_FCS_ID << BFA_LOG_MODID_OFFSET) | 2) +#endif
drivers/scsi/bfa/include/log/bfa_log_hal.h +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2008 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +* +* Linux driver for Brocade Fibre Channel Host Bus Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ + +/* messages define for HAL Module */ +#ifndef __BFA_LOG_HAL_H__ +#define __BFA_LOG_HAL_H__ +#include <cs/bfa_log.h> +#define BFA_LOG_HAL_ASSERT \ + (((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 1) +#define BFA_LOG_HAL_HEARTBEAT_FAILURE \ + (((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 2) +#define BFA_LOG_HAL_FCPIM_PARM_INVALID \ + (((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 3) +#define BFA_LOG_HAL_SM_ASSERT \ + (((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 4) +#endif
drivers/scsi/bfa/include/log/bfa_log_linux.h +44 -0
44 lines not on this page · raw message
drivers/scsi/bfa/include/log/bfa_log_wdrv.h +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (c) 2005-2008 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +* +* Linux driver for Brocade Fibre Channel Host Bus Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ + +/* +* messages define for WDRV Module +*/ +#ifndef __BFA_LOG_WDRV_H__ +#define __BFA_LOG_WDRV_H__ +#include <cs/bfa_log.h> +#define BFA_LOG_WDRV_IOC_INIT_ERROR \ + (((u32) BFA_LOG_WDRV_ID << BFA_LOG_MODID_OFFSET) | 1) +#define BFA_LOG_WDRV_IOC_INTERNAL_ERROR \ + (((u32) BFA_LOG_WDRV_ID << BFA_LOG_MODID_OFFSET) | 2) +#define BFA_LOG_WDRV_IOC_START_ERROR \ + (((u32) BFA_LOG_WDRV_ID << BFA_LOG_MODID_OFFSET) | 3) +#define BFA_LOG_WDRV_IOC_STOP_ERROR \ + (((u32) BFA_LOG_WDRV_ID << BFA_LOG_MODID_OFFSET) | 4) +#define BFA_LOG_WDRV_INSUFFICIENT_RESOURCES \ + (((u32) BFA_LOG_WDRV_ID << BFA_LOG_MODID_OFFSET) | 5) +#define BFA_LOG_WDRV_BASE_ADDRESS_MAP_ERROR \ + (((u32) BFA_LOG_WDRV_ID << BFA_LOG_MODID_OFFSET) | 6) +#endif
drivers/scsi/bfa/include/protocol/ct.h +492 -0
492 lines not on this page · raw message
drivers/scsi/bfa/include/protocol/fc.h +1105 -0
1,105 lines not on this page · raw message
drivers/scsi/bfa/include/protocol/fcp.h +186 -0
186 lines not on this page · raw message
drivers/scsi/bfa/include/protocol/fc_sp.h +224 -0
224 lines not on this page · raw message
drivers/scsi/bfa/include/protocol/fdmi.h +163 -0
163 lines not on this page · raw message
drivers/scsi/bfa/include/protocol/pcifw.h +75 -0
32 lines not on this page · raw message
drivers/scsi/bfa/include/protocol/scsi.h +1648 -0
1,648 lines not on this page · raw message
drivers/scsi/bfa/include/protocol/types.h +42 -0
42 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.