aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_dbg.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2008-01-17 12:02:17 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 12:29:32 -0500
commitdf613b96077cee826b14089ae6e75eeabf71faa3 (patch)
tree262f0b96f1dc94da58f837e5446b02da52d80471 /drivers/scsi/qla2xxx/qla_dbg.c
parent00b6bd25166e2a4bad23c614c10c55993bb2489e (diff)
[SCSI] qla2xxx: Add Fibre Channel Event (FCE) tracing support.
FCE support enables the firmware to record FC extended link services and basic link services frames which have been transmitted and received by the ISP. This allows for a limited view of the FC traffic through the ISP without using a FC analyzer. This can be useful in situations where a physical connection to the FC bus is not possible. The driver exports this information in two ways -- first, via a debugfs node exported for all supported ISPs under: <debugfs_mount_point>/qla2xxx/qla2xxx_<host_no>/fce where a read of the 'fce' file will provide a snapshot of the firmware's FCE buffer; and finally, the FCE buffer will be extracted during a firmware-dump scenario. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_dbg.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 796c4ce87831..d88e98c476b0 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -1051,6 +1051,7 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
1051 struct qla25xx_fw_dump *fw; 1051 struct qla25xx_fw_dump *fw;
1052 uint32_t ext_mem_cnt; 1052 uint32_t ext_mem_cnt;
1053 void *nxt; 1053 void *nxt;
1054 struct qla2xxx_fce_chain *fcec;
1054 1055
1055 risc_address = ext_mem_cnt = 0; 1056 risc_address = ext_mem_cnt = 0;
1056 flags = 0; 1057 flags = 0;
@@ -1321,10 +1322,31 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
1321 if (rval != QLA_SUCCESS) 1322 if (rval != QLA_SUCCESS)
1322 goto qla25xx_fw_dump_failed_0; 1323 goto qla25xx_fw_dump_failed_0;
1323 1324
1325 /* Fibre Channel Trace Buffer. */
1324 nxt = qla2xxx_copy_queues(ha, nxt); 1326 nxt = qla2xxx_copy_queues(ha, nxt);
1325 if (ha->eft) 1327 if (ha->eft)
1326 memcpy(nxt, ha->eft, ntohl(ha->fw_dump->eft_size)); 1328 memcpy(nxt, ha->eft, ntohl(ha->fw_dump->eft_size));
1327 1329
1330 /* Fibre Channel Event Buffer. */
1331 if (!ha->fce)
1332 goto qla25xx_fw_dump_failed_0;
1333
1334 ha->fw_dump->version |= __constant_htonl(DUMP_CHAIN_VARIANT);
1335
1336 fcec = nxt + ntohl(ha->fw_dump->eft_size);
1337 fcec->type = __constant_htonl(DUMP_CHAIN_FCE | DUMP_CHAIN_LAST);
1338 fcec->chain_size = htonl(sizeof(struct qla2xxx_fce_chain) +
1339 fce_calc_size(ha->fce_bufs));
1340 fcec->size = htonl(fce_calc_size(ha->fce_bufs));
1341 fcec->addr_l = htonl(LSD(ha->fce_dma));
1342 fcec->addr_h = htonl(MSD(ha->fce_dma));
1343
1344 iter_reg = fcec->eregs;
1345 for (cnt = 0; cnt < 8; cnt++)
1346 *iter_reg++ = htonl(ha->fce_mb[cnt]);
1347
1348 memcpy(iter_reg, ha->fce, ntohl(fcec->size));
1349
1328qla25xx_fw_dump_failed_0: 1350qla25xx_fw_dump_failed_0:
1329 if (rval != QLA_SUCCESS) { 1351 if (rval != QLA_SUCCESS) {
1330 qla_printk(KERN_WARNING, ha, 1352 qla_printk(KERN_WARNING, ha,