aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_defs.h
diff options
context:
space:
mode:
authorVijaya Mohan Guvva <vmohan@brocade.com>2013-05-13 05:33:21 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-06-26 14:44:20 -0400
commit1a898a794d5913c899a329c5dec39d28e6065672 (patch)
treebf5ec13403df005157a3ac053dcf82c8044cd1b7 /drivers/scsi/bfa/bfa_defs.h
parent4e1e0d8d71810fb5e4c294299ab35c30a746353d (diff)
[SCSI] bfa: Add dynamic diagnostic port support
D-Port is a new port type created with the intention of running link level diagnostic tests like loopback, traffic test. In static D-port mode, user configures the port to D-port mode and starts the test, but in dynamic D-port, once the Brocade switch port is configured to D-port, it will reject the regular FLOGI from HBA with reason that it is in D-port mode. So based on the reason code HBA port will turn itself into D-port and start diagnostic test. Signed-off-by: Sudarsana Reddy Kalluru <skalluru@brocade.com> Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_defs.h')
-rw-r--r--drivers/scsi/bfa/bfa_defs.h79
1 files changed, 68 insertions, 11 deletions
diff --git a/drivers/scsi/bfa/bfa_defs.h b/drivers/scsi/bfa/bfa_defs.h
index bdd1bae971ef..d65a9b4a6f65 100644
--- a/drivers/scsi/bfa/bfa_defs.h
+++ b/drivers/scsi/bfa/bfa_defs.h
@@ -199,15 +199,34 @@ enum bfa_status {
199 BFA_STATUS_DPORT_DISABLED = 236, /* D-port mode is already disabled */ 199 BFA_STATUS_DPORT_DISABLED = 236, /* D-port mode is already disabled */
200 BFA_STATUS_CMD_NOTSUPP_MEZZ = 239, /* Cmd not supported for MEZZ card */ 200 BFA_STATUS_CMD_NOTSUPP_MEZZ = 239, /* Cmd not supported for MEZZ card */
201 BFA_STATUS_FRU_NOT_PRESENT = 240, /* fru module not present */ 201 BFA_STATUS_FRU_NOT_PRESENT = 240, /* fru module not present */
202 BFA_STATUS_DPORT_NO_SFP = 243, /* SFP is not present.\n D-port will be
203 * enabled but it will be operational
204 * only after inserting a valid SFP. */
202 BFA_STATUS_DPORT_ERR = 245, /* D-port mode is enabled */ 205 BFA_STATUS_DPORT_ERR = 245, /* D-port mode is enabled */
206 BFA_STATUS_DPORT_ENOSYS = 254, /* Switch has no D_Port functionality */
207 BFA_STATUS_DPORT_CANT_PERF = 255, /* Switch port is not D_Port capable
208 * or D_Port is disabled */
209 BFA_STATUS_DPORT_LOGICALERR = 256, /* Switch D_Port fail */
210 BFA_STATUS_DPORT_SWBUSY = 257, /* Switch port busy */
203 BFA_STATUS_ERR_BBCR_SPEED_UNSUPPORT = 258, /*!< BB credit recovery is 211 BFA_STATUS_ERR_BBCR_SPEED_UNSUPPORT = 258, /*!< BB credit recovery is
204 * supported at max port speed alone */ 212 * supported at max port speed alone */
205 BFA_STATUS_ERROR_BBCR_ENABLED = 259, /*!< BB credit recovery 213 BFA_STATUS_ERROR_BBCR_ENABLED = 259, /*!< BB credit recovery
206 * is enabled */ 214 * is enabled */
207 BFA_STATUS_INVALID_BBSCN = 260, /*!< Invalid BBSCN value. 215 BFA_STATUS_INVALID_BBSCN = 260, /*!< Invalid BBSCN value.
208 * Valid range is [1-15] */ 216 * Valid range is [1-15] */
217 BFA_STATUS_DDPORT_ERR = 261, /* Dynamic D_Port mode is active.\n To
218 * exit dynamic mode, disable D_Port on
219 * the remote port */
220 BFA_STATUS_DPORT_SFPWRAP_ERR = 262, /* Clear e/o_wrap fail, check or
221 * replace SFP */
209 BFA_STATUS_BBCR_CFG_NO_CHANGE = 265, /*!< BBCR is operational. 222 BFA_STATUS_BBCR_CFG_NO_CHANGE = 265, /*!< BBCR is operational.
210 * Disable BBCR and try this operation again. */ 223 * Disable BBCR and try this operation again. */
224 BFA_STATUS_DPORT_SW_NOTREADY = 268, /* Remote port is not ready to
225 * start dport test. Check remote
226 * port status. */
227 BFA_STATUS_DPORT_INV_SFP = 271, /* Invalid SFP for D-PORT mode. */
228 BFA_STATUS_DPORT_CMD_NOTSUPP = 273, /* Dport is not supported by
229 * remote port */
211 BFA_STATUS_MAX_VAL /* Unknown error code */ 230 BFA_STATUS_MAX_VAL /* Unknown error code */
212}; 231};
213#define bfa_status_t enum bfa_status 232#define bfa_status_t enum bfa_status
@@ -527,17 +546,6 @@ struct bfa_ioc_aen_data_s {
527}; 546};
528 547
529/* 548/*
530 * D-port states
531 *
532*/
533enum bfa_dport_state {
534 BFA_DPORT_ST_DISABLED = 0, /* D-port is Disabled */
535 BFA_DPORT_ST_DISABLING = 1, /* D-port is Disabling */
536 BFA_DPORT_ST_ENABLING = 2, /* D-port is Enabling */
537 BFA_DPORT_ST_ENABLED = 3, /* D-port is Enabled */
538};
539
540/*
541 * ---------------------- mfg definitions ------------ 549 * ---------------------- mfg definitions ------------
542 */ 550 */
543 551
@@ -1136,6 +1144,7 @@ struct bfa_flash_attr_s {
1136#define LB_PATTERN_DEFAULT 0xB5B5B5B5 1144#define LB_PATTERN_DEFAULT 0xB5B5B5B5
1137#define QTEST_CNT_DEFAULT 10 1145#define QTEST_CNT_DEFAULT 10
1138#define QTEST_PAT_DEFAULT LB_PATTERN_DEFAULT 1146#define QTEST_PAT_DEFAULT LB_PATTERN_DEFAULT
1147#define DPORT_ENABLE_LOOPCNT_DEFAULT (1024 * 1024)
1139 1148
1140struct bfa_diag_memtest_s { 1149struct bfa_diag_memtest_s {
1141 u8 algo; 1150 u8 algo;
@@ -1164,6 +1173,54 @@ struct bfa_diag_loopback_result_s {
1164 u8 rsvd[3]; 1173 u8 rsvd[3];
1165}; 1174};
1166 1175
1176enum bfa_diag_dport_test_status {
1177 DPORT_TEST_ST_IDLE = 0, /* the test has not started yet. */
1178 DPORT_TEST_ST_FINAL = 1, /* the test done successfully */
1179 DPORT_TEST_ST_SKIP = 2, /* the test skipped */
1180 DPORT_TEST_ST_FAIL = 3, /* the test failed */
1181 DPORT_TEST_ST_INPRG = 4, /* the testing is in progress */
1182 DPORT_TEST_ST_RESPONDER = 5, /* test triggered from remote port */
1183 DPORT_TEST_ST_STOPPED = 6, /* the test stopped by user. */
1184 DPORT_TEST_ST_MAX
1185};
1186
1187enum bfa_diag_dport_test_type {
1188 DPORT_TEST_ELOOP = 0,
1189 DPORT_TEST_OLOOP = 1,
1190 DPORT_TEST_ROLOOP = 2,
1191 DPORT_TEST_LINK = 3,
1192 DPORT_TEST_MAX
1193};
1194
1195enum bfa_diag_dport_test_opmode {
1196 BFA_DPORT_OPMODE_AUTO = 0,
1197 BFA_DPORT_OPMODE_MANU = 1,
1198};
1199
1200struct bfa_diag_dport_subtest_result_s {
1201 u8 status; /* bfa_diag_dport_test_status */
1202 u8 rsvd[7]; /* 64bit align */
1203 u64 start_time; /* timestamp */
1204};
1205
1206struct bfa_diag_dport_result_s {
1207 wwn_t rp_pwwn; /* switch port wwn */
1208 wwn_t rp_nwwn; /* switch node wwn */
1209 u64 start_time; /* user/sw start time */
1210 u64 end_time; /* timestamp */
1211 u8 status; /* bfa_diag_dport_test_status */
1212 u8 mode; /* bfa_diag_dport_test_opmode */
1213 u8 rsvd; /* 64bit align */
1214 u8 speed; /* link speed for buf_reqd */
1215 u16 buffer_required;
1216 u16 frmsz; /* frame size for buf_reqd */
1217 u32 lpcnt; /* Frame count */
1218 u32 pat; /* Pattern */
1219 u32 roundtrip_latency; /* in nano sec */
1220 u32 est_cable_distance; /* in meter */
1221 struct bfa_diag_dport_subtest_result_s subtest[DPORT_TEST_MAX];
1222};
1223
1167struct bfa_diag_ledtest_s { 1224struct bfa_diag_ledtest_s {
1168 u32 cmd; /* bfa_led_op_t */ 1225 u32 cmd; /* bfa_led_op_t */
1169 u32 color; /* bfa_led_color_t */ 1226 u32 color; /* bfa_led_color_t */