diff options
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 | { |