diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7d0eeec9ba57..2497fe4ce5aa 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -3462,3 +3462,41 @@ qla2x00_write_edc(scsi_qla_host_t *vha, uint16_t dev, uint16_t adr, | |||
3462 | 3462 | ||
3463 | return rval; | 3463 | return rval; |
3464 | } | 3464 | } |
3465 | |||
3466 | int | ||
3467 | qla2x00_get_xgmac_stats(scsi_qla_host_t *vha, dma_addr_t stats_dma, | ||
3468 | uint16_t size_in_bytes, uint16_t *actual_size) | ||
3469 | { | ||
3470 | int rval; | ||
3471 | mbx_cmd_t mc; | ||
3472 | mbx_cmd_t *mcp = &mc; | ||
3473 | |||
3474 | if (!IS_QLA81XX(vha->hw)) | ||
3475 | return QLA_FUNCTION_FAILED; | ||
3476 | |||
3477 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); | ||
3478 | |||
3479 | mcp->mb[0] = MBC_GET_XGMAC_STATS; | ||
3480 | mcp->mb[2] = MSW(stats_dma); | ||
3481 | mcp->mb[3] = LSW(stats_dma); | ||
3482 | mcp->mb[6] = MSW(MSD(stats_dma)); | ||
3483 | mcp->mb[7] = LSW(MSD(stats_dma)); | ||
3484 | mcp->mb[8] = size_in_bytes >> 2; | ||
3485 | mcp->out_mb = MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_0; | ||
3486 | mcp->in_mb = MBX_2|MBX_1|MBX_0; | ||
3487 | mcp->tov = MBX_TOV_SECONDS; | ||
3488 | mcp->flags = 0; | ||
3489 | rval = qla2x00_mailbox_command(vha, mcp); | ||
3490 | |||
3491 | if (rval != QLA_SUCCESS) { | ||
3492 | DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=0x%x " | ||
3493 | "mb[1]=0x%x mb[2]=0x%x.\n", __func__, vha->host_no, rval, | ||
3494 | mcp->mb[0], mcp->mb[1], mcp->mb[2])); | ||
3495 | } else { | ||
3496 | DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no)); | ||
3497 | |||
3498 | *actual_size = mcp->mb[2] << 2; | ||
3499 | } | ||
3500 | |||
3501 | return rval; | ||
3502 | } | ||