bfa: Brocade BFA FC SCSI driver (include2)
Subsystems (2)
PATCH 11/14 bfa: Brocade BFA FC SCSI driver (include2)
From: Jing Huang <[email protected]>
This patch contains common header files for linux driver, hardware/firmeare interface, and FC state machines. part-2
--- cs/bfa_log.h | 184 ++++++++++++++++++++++ cs/bfa_perf.h | 34 ++++ cs/bfa_plog.h | 162 +++++++++++++++++++ cs/bfa_q.h | 81 +++++++++ cs/bfa_sm.h | 69 ++++++++ cs/bfa_trc.h | 176 +++++++++++++++++++++ cs/bfa_wc.h | 68 ++++++++ defs/bfa_defs_adapter.h | 82 +++++++++ defs/bfa_defs_aen.h | 73 ++++++++ defs/bfa_defs_audit.h | 38 ++++ defs/bfa_defs_auth.h | 112 +++++++++++++ defs/bfa_defs_boot.h | 71 ++++++++ defs/bfa_defs_cee.h | 159 +++++++++++++++++++ defs/bfa_defs_driver.h | 40 ++++ defs/bfa_defs_ethport.h | 98 +++++++++++ defs/bfa_defs_fcpim.h | 45 +++++ defs/bfa_defs_im_common.h | 32 +++ defs/bfa_defs_im_team.h | 72 ++++++++ defs/bfa_defs_ioc.h | 152 ++++++++++++++++++ defs/bfa_defs_iocfc.h | 310 +++++++++++++++++++++++++++++++++++++ defs/bfa_defs_ipfc.h | 70 ++++++++ defs/bfa_defs_itnim.h | 126 +++++++++++++++ defs/bfa_defs_led.h | 35 ++++ defs/bfa_defs_lport.h | 68 ++++++++ defs/bfa_defs_mfg.h | 58 ++++++ defs/bfa_defs_pci.h | 41 ++++ defs/bfa_defs_pm.h | 33 +++ defs/bfa_defs_pom.h | 56 ++++++ defs/bfa_defs_port.h | 245 +++++++++++++++++++++++++++++ defs/bfa_defs_pport.h | 383 ++++++++++++++++++++++++++++++++++++++++++++++ defs/bfa_defs_qos.h | 99 +++++++++++ defs/bfa_defs_rport.h | 199 +++++++++++++++++++++++ defs/bfa_defs_status.h | 255 ++++++++++++++++++++++++++++++ defs/bfa_defs_tin.h | 118 ++++++++++++++ defs/bfa_defs_tsensor.h | 43 +++++ defs/bfa_defs_types.h | 30 +++ defs/bfa_defs_version.h | 22 ++ defs/bfa_defs_vf.h | 74 ++++++++ defs/bfa_defs_vport.h | 91 ++++++++++ fcb/bfa_fcb.h | 33 +++ fcb/bfa_fcb_fcpim.h | 76 +++++++++ fcb/bfa_fcb_port.h | 113 +++++++++++++ fcb/bfa_fcb_rport.h | 80 +++++++++ fcb/bfa_fcb_vf.h | 47 +++++ fcb/bfa_fcb_vport.h | 47 +++++ fcs/bfa_fcs.h | 73 ++++++++ 46 files changed, 4573 insertions(+)
drivers/scsi/bfa/include/cs/bfa_log.h +184 -0
@@ -0,0 +1,184 @@ +/* +* Copyright (c) 2005-2009 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_log.h BFA log library data structure and function definition +*/ + +#ifndef __BFA_LOG_H__ +#define __BFA_LOG_H__ + +#include <bfa_os_inc.h> +#include <defs/bfa_defs_status.h> +#include <defs/bfa_defs_aen.h> + +/* +* BFA log module definition +* +* To create a new module id: +* Add a #define at the end of the list below. Select a value for your +* definition so that it is one (1) greater than the previous +* definition. Modify the definition of BFA_LOG_MODULE_ID_MAX to become +* your new definition. +* Should have no gaps in between the values because this is used in arrays. +* IMPORTANT: AEN_IDs must be at the begining, otherwise update bfa_defs_aen.h +*/ + +enum bfa_log_module_id { +BFA_LOG_UNUSED_ID =0 , + +/* AEN defs begin */ +BFA_LOG_AEN_MIN =BFA_LOG_UNUSED_ID , + +BFA_LOG_AEN_ID_ADAPTER =BFA_LOG_AEN_MIN +BFA_AEN_CAT_ADAPTER ,/* 1 */ +BFA_LOG_AEN_ID_PORT =BFA_LOG_AEN_MIN +BFA_AEN_CAT_PORT ,/* 2 */ +BFA_LOG_AEN_ID_LPORT =BFA_LOG_AEN_MIN +BFA_AEN_CAT_LPORT ,/* 3 */ +BFA_LOG_AEN_ID_RPORT =BFA_LOG_AEN_MIN +BFA_AEN_CAT_RPORT ,/* 4 */ +BFA_LOG_AEN_ID_ITNIM =BFA_LOG_AEN_MIN +BFA_AEN_CAT_ITNIM ,/* 5 */ +BFA_LOG_AEN_ID_TIN =BFA_LOG_AEN_MIN +BFA_AEN_CAT_TIN ,/* 6 */ +BFA_LOG_AEN_ID_IPFC =BFA_LOG_AEN_MIN +BFA_AEN_CAT_IPFC ,/* 7 */ +BFA_LOG_AEN_ID_AUDIT =BFA_LOG_AEN_MIN +BFA_AEN_CAT_AUDIT ,/* 8 */ +BFA_LOG_AEN_ID_IOC =BFA_LOG_AEN_MIN +BFA_AEN_CAT_IOC ,/* 9 */ +BFA_LOG_AEN_ID_ETHPORT =BFA_LOG_AEN_MIN +BFA_AEN_CAT_ETHPORT ,/* 10 */ + +BFA_LOG_AEN_MAX =BFA_LOG_AEN_ID_ETHPORT , +/* AEN defs end */ + +BFA_LOG_MODULE_ID_MIN =BFA_LOG_AEN_MAX , + +BFA_LOG_FW_ID =BFA_LOG_MODULE_ID_MIN +1 , +BFA_LOG_HAL_ID =BFA_LOG_MODULE_ID_MIN +2 , +BFA_LOG_FCS_ID =BFA_LOG_MODULE_ID_MIN +3 , +BFA_LOG_WDRV_ID =BFA_LOG_MODULE_ID_MIN +4 , +BFA_LOG_LINUX_ID =BFA_LOG_MODULE_ID_MIN +5 , +BFA_LOG_SOLARIS_ID =BFA_LOG_MODULE_ID_MIN +6 , + +BFA_LOG_MODULE_ID_MAX =BFA_LOG_SOLARIS_ID , + +/* Not part of any arrays */ +BFA_LOG_MODULE_ID_ALL =BFA_LOG_MODULE_ID_MAX +1 , +BFA_LOG_AEN_ALL =BFA_LOG_MODULE_ID_MAX +2 , +BFA_LOG_DRV_ALL =BFA_LOG_MODULE_ID_MAX +3 , +}; + +/* +* BFA log catalog name +*/ +#define BFA_LOG_CAT_NAME "BFA" + +/* +* bfa log severity values +*/ +enum bfa_log_severity { +BFA_LOG_INVALID =0 , +BFA_LOG_CRITICAL =1 , +BFA_LOG_ERROR =2 , +BFA_LOG_WARNING =3 , +BFA_LOG_INFO =4 , +BFA_LOG_NONE =5 , +BFA_LOG_LEVEL_MAX =BFA_LOG_NONE +}; + +#define BFA_LOG_MODID_OFFSET 16 + + +struct bfa_log_msgdef_s { +u32 msg_id;/* message id */ +int attributes;/* attributes */ +int severity;/* severity level */ +char *msg_value; +/* msg string */ +char *message; +/* msg format string */ +int arg_type;/* argument type */ +int arg_num;/* number of argument */ +}; + +/* +* supported argument type +*/ +enum bfa_log_arg_type { +BFA_LOG_S =0 ,/* string */ +BFA_LOG_D ,/* decimal */ +BFA_LOG_I ,/* integer */ +BFA_LOG_O ,/* oct number */ +BFA_LOG_U ,/* unsigned integer */ +BFA_LOG_X ,/* hex number */ +BFA_LOG_F ,/* floating */ +BFA_LOG_C ,/* character */ +BFA_LOG_L ,/* double */ +BFA_LOG_P /* pointer */ +}; + +#define BFA_LOG_ARG_TYPE 2 +#define BFA_LOG_ARG0 (0 * BFA_LOG_ARG_TYPE) +#define BFA_LOG_ARG1 (1 * BFA_LOG_ARG_TYPE) +#define BFA_LOG_ARG2 (2 * BFA_LOG_ARG_TYPE) +#define BFA_LOG_ARG3 (3 * BFA_LOG_ARG_TYPE) + +#define BFA_LOG_GET_MOD_ID (msgid) ((msgid >> BFA_LOG_MODID_OFFSET) & 0xff) +#define BFA_LOG_GET_MSG_IDX (msgid) (msgid & 0xffff) +#define BFA_LOG_GET_MSG_ID (msgdef) ((msgdef)->msg_id) +#define BFA_LOG_GET_MSG_FMT_STRING (msgdef) ((msgdef)->message) +#define BFA_LOG_GET_SEVERITY (msgdef) ((msgdef)->severity) + +/* +* Event attributes +*/ +#define BFA_LOG_ATTR_NONE 0 +#define BFA_LOG_ATTR_AUDIT 1 +#define BFA_LOG_ATTR_LOG 2 +#define BFA_LOG_ATTR_FFDC 4 + +#define BFA_LOG_CREATE_ID (msw, lsw) \ + (((u32)msw << BFA_LOG_MODID_OFFSET) | lsw) + +struct bfa_log_mod_s ; + +/** +* callback function +*/ +typedef void (*bfa_log_cb_t )(struct bfa_log_mod_s *log_mod,u32 msg_id, +const char *format, ...); + + +struct bfa_log_mod_s { +char instance_info[16 ];/* instance info */ +int log_level[BFA_LOG_MODULE_ID_MAX +1 ]; +/* log level for modules */ +bfa_log_cb_t cbfn;/* callback function */ +}; + +extern int bfa_log_init (struct bfa_log_mod_s *log_mod, +char *instance_name,bfa_log_cb_t cbfn); +extern int bfa_log (struct bfa_log_mod_s *log_mod,u32 msg_id, ...); +extern bfa_status_t bfa_log_set_level (struct bfa_log_mod_s *log_mod, +int mod_id,enum bfa_log_severity log_level); +extern bfa_status_t bfa_log_set_level_all (struct bfa_log_mod_s *log_mod, +enum bfa_log_severity log_level); +extern bfa_status_t bfa_log_set_level_aen (struct bfa_log_mod_s *log_mod, +enum bfa_log_severity log_level); +extern enum bfa_log_severity bfa_log_get_level (struct bfa_log_mod_s *log_mod, +int mod_id); +extern enum bfa_log_severity bfa_log_get_msg_level ( +struct bfa_log_mod_s *log_mod,u32 msg_id); +/* +* array of messages generated from xml files +*/ +extern struct bfa_log_msgdef_s bfa_log_msg_array[]; + +#endif
drivers/scsi/bfa/include/cs/bfa_perf.h +34 -0
@@ -0,0 +1,34 @@ +/* +* Copyright (c) 2005-2009 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. +*/ +#ifndef __BFAD_PERF_H__ +#define __BFAD_PERF_H__ + +#ifdef BFAD_PERF_BUILD + +#undef bfa_trc +#undef bfa_trc32 +#undef bfa_assert +#undef BFA_TRC_FILE + +#define bfa_trc (_trcp, _data) +#define bfa_trc32 (_trcp, _data) +#define bfa_assert (__cond) +#define BFA_TRC_FILE (__mod, __submod) + +#endif + +#endif /* __BFAD_PERF_H__ */
drivers/scsi/bfa/include/cs/bfa_plog.h +162 -0
162 lines not on this page · raw message
drivers/scsi/bfa/include/cs/bfa_q.h +81 -0
81 lines not on this page · raw message
drivers/scsi/bfa/include/cs/bfa_sm.h +69 -0
69 lines not on this page · raw message
drivers/scsi/bfa/include/cs/bfa_trc.h +176 -0
176 lines not on this page · raw message
drivers/scsi/bfa/include/cs/bfa_wc.h +68 -0
68 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_adapter.h +82 -0
82 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_aen.h +73 -0
73 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_audit.h +38 -0
@@ -0,0 +1,38 @@ +/* +* Copyright (c) 2005-2009 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. +*/ + +#ifndef __BFA_DEFS_AUDIT_H__ +#define __BFA_DEFS_AUDIT_H__ + +#include <bfa_os_inc.h> + +/** +* BFA audit events +*/ +enum bfa_audit_aen_event { +BFA_AUDIT_AEN_AUTH_ENABLE =1 , +BFA_AUDIT_AEN_AUTH_DISABLE =2 , +}; + +/** +* audit event data +*/ +struct bfa_audit_aen_data_s { +wwn_t pwwn; +}; + +#endif /* __BFA_DEFS_AUDIT_H__ */
drivers/scsi/bfa/include/defs/bfa_defs_auth.h +112 -0
112 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_boot.h +71 -0
71 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_cee.h +159 -0
159 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_driver.h +40 -0
@@ -0,0 +1,40 @@ +/* +* Copyright (c) 2005-2009 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. +*/ + +#ifndef __BFA_DEFS_DRIVER_H__ +#define __BFA_DEFS_DRIVER_H__ + +/** +* Driver statistics +*/ +u16 tm_io_abort; +u16 tm_io_abort_comp; +u16 tm_lun_reset; +u16 tm_lun_reset_comp; +u16 tm_target_reset; +u16 tm_bus_reset; +u16 ioc_restart;/* IOC restart count */ +u16 io_pending;/* outstanding io count per-IOC */ +u64 control_req; +u64 input_req; +u64 output_req; +u64 input_words; + u64 output_words; +} bfa_driver_stats_t; + + +#endif /* __BFA_DEFS_DRIVER_H__ */
drivers/scsi/bfa/include/defs/bfa_defs_ethport.h +98 -0
98 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_fcpim.h +45 -0
45 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_im_common.h +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (c) 2005-2009 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. +*/ + +#ifndef __BFA_DEFS_IM_COMMON_H__ +#define __BFA_DEFS_IM_COMMON_H__ + +#define BFA_ADAPTER_NAME_LEN 256 +#define BFA_ADAPTER_GUID_LEN 256 +#define RESERVED_VLAN_NAME L"PORT VLAN" +#define PASSTHRU_VLAN_NAME L"PASSTHRU VLAN" + +u64 tx_pkt_cnt; +u64 rx_pkt_cnt; +u32 duration; + u8 status; +} bfa_im_stats_t, *pbfa_im_stats_t; + +#endif /* __BFA_DEFS_IM_COMMON_H__ */
drivers/scsi/bfa/include/defs/bfa_defs_im_team.h +72 -0
72 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_ioc.h +152 -0
152 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h +310 -0
310 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_ipfc.h +70 -0
70 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_itnim.h +126 -0
126 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_led.h +35 -0
@@ -0,0 +1,35 @@ +/* +* Copyright (c) 2005-2009 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. +*/ + +#ifndef __BFA_DEFS_LED_H__ +#define __BFA_DEFS_LED_H__ + +#define BFA_LED_MAX_NUM 3 + +enum bfa_led_op { +BFA_LED_OFF =0 , +BFA_LED_ON =1 , +BFA_LED_FLICK =2 , +BFA_LED_BLINK =3 , +}; + +enum bfa_led_color { +BFA_LED_GREEN =0 , +BFA_LED_AMBER =1 , +}; + +#endif /* __BFA_DEFS_LED_H__ */
drivers/scsi/bfa/include/defs/bfa_defs_lport.h +68 -0
68 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_mfg.h +58 -0
58 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_pci.h +41 -0
41 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_pm.h +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (c) 2005-2009 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. +*/ + +#ifndef __BFA_DEFS_PM_H__ +#define __BFA_DEFS_PM_H__ + +#include <bfa_os_inc.h> + +/** +* BFA power management device states +*/ +enum bfa_pm_ds { +BFA_PM_DS_D0 =0 ,/* full power mode */ +BFA_PM_DS_D1 =1 ,/* power save state 1 */ +BFA_PM_DS_D2 =2 ,/* power save state 2 */ +BFA_PM_DS_D3 =3 ,/* power off state */ +}; + +#endif /* __BFA_DEFS_PM_H__ */
drivers/scsi/bfa/include/defs/bfa_defs_pom.h +56 -0
56 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_port.h +245 -0
245 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_pport.h +383 -0
210 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_qos.h +99 -0
99 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_rport.h +199 -0
199 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_status.h +255 -0
255 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_tin.h +118 -0
118 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_tsensor.h +43 -0
43 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_types.h +30 -0
Lines of this file are not shown. View the raw message.
drivers/scsi/bfa/include/defs/bfa_defs_version.h +22 -0
Lines of this file are not shown. View the raw message.
drivers/scsi/bfa/include/defs/bfa_defs_vf.h +74 -0
74 lines not on this page · raw message
drivers/scsi/bfa/include/defs/bfa_defs_vport.h +91 -0
91 lines not on this page · raw message
drivers/scsi/bfa/include/fcb/bfa_fcb.h +33 -0
Lines of this file are not shown. View the raw message.
drivers/scsi/bfa/include/fcb/bfa_fcb_fcpim.h +76 -0
76 lines not on this page · raw message
drivers/scsi/bfa/include/fcb/bfa_fcb_port.h +113 -0
113 lines not on this page · raw message
drivers/scsi/bfa/include/fcb/bfa_fcb_rport.h +80 -0
80 lines not on this page · raw message
drivers/scsi/bfa/include/fcb/bfa_fcb_vf.h +47 -0
47 lines not on this page · raw message
drivers/scsi/bfa/include/fcb/bfa_fcb_vport.h +47 -0
47 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
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.