diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2008-01-17 12:02:17 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-23 12:29:32 -0500 |
commit | df613b96077cee826b14089ae6e75eeabf71faa3 (patch) | |
tree | 262f0b96f1dc94da58f837e5446b02da52d80471 /drivers/scsi/qla2xxx/qla_mbx.c | |
parent | 00b6bd25166e2a4bad23c614c10c55993bb2489e (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_mbx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7c6aa4ec8f4f..99d29fff836d 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -2415,6 +2415,93 @@ qla2x00_disable_eft_trace(scsi_qla_host_t *ha) | |||
2415 | } | 2415 | } |
2416 | 2416 | ||
2417 | int | 2417 | int |
2418 | qla2x00_enable_fce_trace(scsi_qla_host_t *ha, dma_addr_t fce_dma, | ||
2419 | uint16_t buffers, uint16_t *mb, uint32_t *dwords) | ||
2420 | { | ||
2421 | int rval; | ||
2422 | mbx_cmd_t mc; | ||
2423 | mbx_cmd_t *mcp = &mc; | ||
2424 | |||
2425 | if (!IS_QLA25XX(ha)) | ||
2426 | return QLA_FUNCTION_FAILED; | ||
2427 | |||
2428 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); | ||
2429 | |||
2430 | mcp->mb[0] = MBC_TRACE_CONTROL; | ||
2431 | mcp->mb[1] = TC_FCE_ENABLE; | ||
2432 | mcp->mb[2] = LSW(fce_dma); | ||
2433 | mcp->mb[3] = MSW(fce_dma); | ||
2434 | mcp->mb[4] = LSW(MSD(fce_dma)); | ||
2435 | mcp->mb[5] = MSW(MSD(fce_dma)); | ||
2436 | mcp->mb[6] = buffers; | ||
2437 | mcp->mb[7] = TC_AEN_DISABLE; | ||
2438 | mcp->mb[8] = 0; | ||
2439 | mcp->mb[9] = TC_FCE_DEFAULT_RX_SIZE; | ||
2440 | mcp->mb[10] = TC_FCE_DEFAULT_TX_SIZE; | ||
2441 | mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2| | ||
2442 | MBX_1|MBX_0; | ||
2443 | mcp->in_mb = MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; | ||
2444 | mcp->tov = 30; | ||
2445 | mcp->flags = 0; | ||
2446 | rval = qla2x00_mailbox_command(ha, mcp); | ||
2447 | if (rval != QLA_SUCCESS) { | ||
2448 | DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n", | ||
2449 | __func__, ha->host_no, rval, mcp->mb[0], mcp->mb[1])); | ||
2450 | } else { | ||
2451 | DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); | ||
2452 | |||
2453 | if (mb) | ||
2454 | memcpy(mb, mcp->mb, 8 * sizeof(*mb)); | ||
2455 | if (dwords) | ||
2456 | *dwords = mcp->mb[6]; | ||
2457 | } | ||
2458 | |||
2459 | return rval; | ||
2460 | } | ||
2461 | |||
2462 | int | ||
2463 | qla2x00_disable_fce_trace(scsi_qla_host_t *ha, uint64_t *wr, uint64_t *rd) | ||
2464 | { | ||
2465 | int rval; | ||
2466 | mbx_cmd_t mc; | ||
2467 | mbx_cmd_t *mcp = &mc; | ||
2468 | |||
2469 | if (!IS_FWI2_CAPABLE(ha)) | ||
2470 | return QLA_FUNCTION_FAILED; | ||
2471 | |||
2472 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); | ||
2473 | |||
2474 | mcp->mb[0] = MBC_TRACE_CONTROL; | ||
2475 | mcp->mb[1] = TC_FCE_DISABLE; | ||
2476 | mcp->mb[2] = TC_FCE_DISABLE_TRACE; | ||
2477 | mcp->out_mb = MBX_2|MBX_1|MBX_0; | ||
2478 | mcp->in_mb = MBX_9|MBX_8|MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2| | ||
2479 | MBX_1|MBX_0; | ||
2480 | mcp->tov = 30; | ||
2481 | mcp->flags = 0; | ||
2482 | rval = qla2x00_mailbox_command(ha, mcp); | ||
2483 | if (rval != QLA_SUCCESS) { | ||
2484 | DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n", | ||
2485 | __func__, ha->host_no, rval, mcp->mb[0], mcp->mb[1])); | ||
2486 | } else { | ||
2487 | DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); | ||
2488 | |||
2489 | if (wr) | ||
2490 | *wr = (uint64_t) mcp->mb[5] << 48 | | ||
2491 | (uint64_t) mcp->mb[4] << 32 | | ||
2492 | (uint64_t) mcp->mb[3] << 16 | | ||
2493 | (uint64_t) mcp->mb[2]; | ||
2494 | if (rd) | ||
2495 | *rd = (uint64_t) mcp->mb[9] << 48 | | ||
2496 | (uint64_t) mcp->mb[8] << 32 | | ||
2497 | (uint64_t) mcp->mb[7] << 16 | | ||
2498 | (uint64_t) mcp->mb[6]; | ||
2499 | } | ||
2500 | |||
2501 | return rval; | ||
2502 | } | ||
2503 | |||
2504 | int | ||
2418 | qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr, | 2505 | qla2x00_read_sfp(scsi_qla_host_t *ha, dma_addr_t sfp_dma, uint16_t addr, |
2419 | uint16_t off, uint16_t count) | 2506 | uint16_t off, uint16_t count) |
2420 | { | 2507 | { |