aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorJoe Carnuccio <joe.carnuccio@qlogic.com>2009-03-24 12:08:12 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:22:51 -0400
commitad0ecd61f4ad3260ca8f7216765ddbb1a10677ea (patch)
tree4a228bd11305a1c07647b948e571542ac9b9389c /drivers/scsi/qla2xxx/qla_mbx.c
parentfbcbb5d0cf69ba8b59028ec3c5b9f9ff04409b88 (diff)
[SCSI] qla2xxx: Add EDC-update support.
Interface allows for the update of onboard EDC firmware present on mezzanine ISP25xx type cards. 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.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 7af9bd73a10d..951537e30294 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -3347,3 +3347,81 @@ qla81xx_restart_mpi_firmware(scsi_qla_host_t *vha)
3347 3347
3348 return rval; 3348 return rval;
3349} 3349}
3350
3351int
3352qla2x00_read_edc(scsi_qla_host_t *vha, uint16_t dev, uint16_t adr,
3353 dma_addr_t sfp_dma, uint8_t *sfp, uint16_t len, uint16_t opt)
3354{
3355 int rval;
3356 mbx_cmd_t mc;
3357 mbx_cmd_t *mcp = &mc;
3358
3359 DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no));
3360
3361 mcp->mb[0] = MBC_READ_SFP;
3362 mcp->mb[1] = dev;
3363 mcp->mb[2] = MSW(sfp_dma);
3364 mcp->mb[3] = LSW(sfp_dma);
3365 mcp->mb[6] = MSW(MSD(sfp_dma));
3366 mcp->mb[7] = LSW(MSD(sfp_dma));
3367 mcp->mb[8] = len;
3368 mcp->mb[9] = adr;
3369 mcp->mb[10] = opt;
3370 mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
3371 mcp->in_mb = MBX_0;
3372 mcp->tov = MBX_TOV_SECONDS;
3373 mcp->flags = 0;
3374 rval = qla2x00_mailbox_command(vha, mcp);
3375
3376 if (opt & BIT_0)
3377 if (sfp)
3378 *sfp = mcp->mb[8];
3379
3380 if (rval != QLA_SUCCESS) {
3381 DEBUG2_3_11(printk("%s(%ld): failed=%x (%x).\n", __func__,
3382 vha->host_no, rval, mcp->mb[0]));
3383 } else {
3384 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
3385 }
3386
3387 return rval;
3388}
3389
3390int
3391qla2x00_write_edc(scsi_qla_host_t *vha, uint16_t dev, uint16_t adr,
3392 dma_addr_t sfp_dma, uint8_t *sfp, uint16_t len, uint16_t opt)
3393{
3394 int rval;
3395 mbx_cmd_t mc;
3396 mbx_cmd_t *mcp = &mc;
3397
3398 DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no));
3399
3400 if (opt & BIT_0)
3401 if (sfp)
3402 len = *sfp;
3403
3404 mcp->mb[0] = MBC_WRITE_SFP;
3405 mcp->mb[1] = dev;
3406 mcp->mb[2] = MSW(sfp_dma);
3407 mcp->mb[3] = LSW(sfp_dma);
3408 mcp->mb[6] = MSW(MSD(sfp_dma));
3409 mcp->mb[7] = LSW(MSD(sfp_dma));
3410 mcp->mb[8] = len;
3411 mcp->mb[9] = adr;
3412 mcp->mb[10] = opt;
3413 mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
3414 mcp->in_mb = MBX_0;
3415 mcp->tov = MBX_TOV_SECONDS;
3416 mcp->flags = 0;
3417 rval = qla2x00_mailbox_command(vha, mcp);
3418
3419 if (rval != QLA_SUCCESS) {
3420 DEBUG2_3_11(printk("%s(%ld): failed=%x (%x).\n", __func__,
3421 vha->host_no, rval, mcp->mb[0]));
3422 } else {
3423 DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no));
3424 }
3425
3426 return rval;
3427}