aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2007-09-20 17:07:33 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 14:49:38 -0400
commit338c9161e406591afbc1a6635a68d3b6d5362e00 (patch)
tree6bb711ac12bac66447ca924e56a9b616d6acd1e6 /drivers/scsi/qla2xxx/qla_mbx.c
parentc81d04c9e27966c0e4c5650d130f209bff9671f9 (diff)
[SCSI] qla2xxx: Add flash burst-read/write support.
Newer ISPs support a mechanism to read and write flash-memory via the firmware LOAD/DUMP memory mailbox command routines. When supported, utilizing these mechanisms significantly reduces overall access times. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index d3746ec80a85..e4f4b1fc2b29 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -2980,3 +2980,51 @@ qla2x00_send_change_request(scsi_qla_host_t *ha, uint16_t format,
2980 2980
2981 return rval; 2981 return rval;
2982} 2982}
2983
2984int
2985qla2x00_dump_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t addr,
2986 uint32_t size)
2987{
2988 int rval;
2989 mbx_cmd_t mc;
2990 mbx_cmd_t *mcp = &mc;
2991
2992 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
2993
2994 if (MSW(addr) || IS_FWI2_CAPABLE(ha)) {
2995 mcp->mb[0] = MBC_DUMP_RISC_RAM_EXTENDED;
2996 mcp->mb[8] = MSW(addr);
2997 mcp->out_mb = MBX_8|MBX_0;
2998 } else {
2999 mcp->mb[0] = MBC_DUMP_RISC_RAM;
3000 mcp->out_mb = MBX_0;
3001 }
3002 mcp->mb[1] = LSW(addr);
3003 mcp->mb[2] = MSW(req_dma);
3004 mcp->mb[3] = LSW(req_dma);
3005 mcp->mb[6] = MSW(MSD(req_dma));
3006 mcp->mb[7] = LSW(MSD(req_dma));
3007 mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1;
3008 if (IS_FWI2_CAPABLE(ha)) {
3009 mcp->mb[4] = MSW(size);
3010 mcp->mb[5] = LSW(size);
3011 mcp->out_mb |= MBX_5|MBX_4;
3012 } else {
3013 mcp->mb[4] = LSW(size);
3014 mcp->out_mb |= MBX_4;
3015 }
3016
3017 mcp->in_mb = MBX_0;
3018 mcp->tov = 30;
3019 mcp->flags = 0;
3020 rval = qla2x00_mailbox_command(ha, mcp);
3021
3022 if (rval != QLA_SUCCESS) {
3023 DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x.\n", __func__,
3024 ha->host_no, rval, mcp->mb[0]));
3025 } else {
3026 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
3027 }
3028
3029 return rval;
3030}