Skip to contentSkip to conversation

bfa: Brocade BFA FC SCSI driver (include part2)

PATCH In review Jing Huang 1 participant 1 message Aug 20, 2009

Subsystems (2)
lore
Share & tools
lore

Jing Huang

author
#0 lore raw

PATCH 11/14 bfa: Brocade BFA FC SCSI driver (include part2)

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_checksum.h         |   60 +++++++
 cs/bfa_debug.h            |   44 +++++
 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_auth.h        |   82 +++++++++
 fcs/bfa_fcs_fabric.h      |  112 +++++++++++++
 49 files changed, 4798 insertions(+)
drivers/scsi/bfa/include/cs/bfa_checksum.h +60 -0
diff -urpN orig/drivers/scsi/bfa/include/cs/bfa_checksum.h patch/drivers/scsi/bfa/include/cs/bfa_checksum.h
@@ -0,0 +1,60 @@
+/*
+ * 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_checksum.h BFA checksum utilities
+ */
+
+#ifndef __BFA_CHECKSUM_H__
+#define __BFA_CHECKSUM_H__
+
+static inline u32
+bfa_checksum_u32(u32 *buf, int sz)
+{
+	int		i, m = sz >> 2;
+	u32	sum = 0;
+
+	for (i = 0; i < m; i++)
+		sum ^= buf[i];
+
+	return (sum);
+}
+
+static inline u16
+bfa_checksum_u16(u16 *buf, int sz)
+{
+	int             i, m = sz >> 1;
+	u16        sum = 0;
+
+	for (i = 0; i < m; i++)
+		sum ^= buf[i];
+
+	return (sum);
+}
+
+static inline u8
+bfa_checksum_u8(u8 *buf, int sz)
+{
+	int             i;
+	u8         sum = 0;
+
+	for (i = 0; i < sz; i++)
+		sum ^= buf[i];
+
+	return (sum);
+}
+#endif
drivers/scsi/bfa/include/cs/bfa_debug.h +44 -0

44 lines not on this page · raw message

drivers/scsi/bfa/include/cs/bfa_log.h +184 -0

184 lines not on this page · raw message

drivers/scsi/bfa/include/cs/bfa_perf.h +34 -0
diff -urpN orig/drivers/scsi/bfa/include/cs/bfa_perf.h patch/drivers/scsi/bfa/include/cs/bfa_perf.h
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+#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
diff -urpN orig/drivers/scsi/bfa/include/defs/bfa_defs_audit.h patch/drivers/scsi/bfa/include/defs/bfa_defs_audit.h
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+#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
diff -urpN orig/drivers/scsi/bfa/include/defs/bfa_defs_driver.h patch/drivers/scsi/bfa/include/defs/bfa_defs_driver.h
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+#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
diff -urpN orig/drivers/scsi/bfa/include/defs/bfa_defs_im_common.h patch/drivers/scsi/bfa/include/defs/bfa_defs_im_common.h
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+#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_iocfc.h +310 -0

310 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_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
diff -urpN orig/drivers/scsi/bfa/include/defs/bfa_defs_led.h patch/drivers/scsi/bfa/include/defs/bfa_defs_led.h
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+#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
diff -urpN orig/drivers/scsi/bfa/include/defs/bfa_defs_pm.h patch/drivers/scsi/bfa/include/defs/bfa_defs_pm.h
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+#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

106 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
diff -urpN orig/drivers/scsi/bfa/include/defs/bfa_defs_types.h patch/drivers/scsi/bfa/include/defs/bfa_defs_types.h

Lines of this file are not shown. View the raw message.

drivers/scsi/bfa/include/defs/bfa_defs_version.h +22 -0
diff -urpN orig/drivers/scsi/bfa/include/defs/bfa_defs_version.h patch/drivers/scsi/bfa/include/defs/bfa_defs_version.h

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_fcpim.h +76 -0

76 lines not on this page · raw message

drivers/scsi/bfa/include/fcb/bfa_fcb.h +33 -0
diff -urpN orig/drivers/scsi/bfa/include/fcb/bfa_fcb.h patch/drivers/scsi/bfa/include/fcb/bfa_fcb.h

Lines of this file are not shown. View the 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_auth.h +82 -0

82 lines not on this page · raw message

drivers/scsi/bfa/include/fcs/bfa_fcs_fabric.h +112 -0

112 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.