diff options
author | Joe Carnuccio <joe.carnuccio@qlogic.com> | 2011-05-10 14:30:15 -0400 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-17 03:36:23 -0400 |
commit | 6766df9e8ae2ab29459381ade1ca91b28688ab13 (patch) | |
tree | 2065424e4518d33bf08feed3aa0876dbae2cf91d /drivers/scsi/qla2xxx/qla_attr.c | |
parent | 773120e4df1d2bf543345ad850cc92dc1f1bad8a (diff) |
[SCSI] qla2xxx: Unify the read/write sfp mailbox command routines.
Make the read/write sfp mailbox command routines uniform, and remove redundancy.
Also protect against attempting to do a single byte dma in these routines.
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 4e51124899fd..532313e0725e 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -496,8 +496,8 @@ do_read: | |||
496 | offset = 0; | 496 | offset = 0; |
497 | } | 497 | } |
498 | 498 | ||
499 | rval = qla2x00_read_sfp(vha, ha->sfp_data_dma, addr, offset, | 499 | rval = qla2x00_read_sfp(vha, ha->sfp_data_dma, ha->sfp_data, |
500 | SFP_BLOCK_SIZE); | 500 | addr, offset, SFP_BLOCK_SIZE, 0); |
501 | if (rval != QLA_SUCCESS) { | 501 | if (rval != QLA_SUCCESS) { |
502 | qla_printk(KERN_WARNING, ha, | 502 | qla_printk(KERN_WARNING, ha, |
503 | "Unable to read SFP data (%x/%x/%x).\n", rval, | 503 | "Unable to read SFP data (%x/%x/%x).\n", rval, |
@@ -628,8 +628,8 @@ qla2x00_sysfs_write_edc(struct file *filp, struct kobject *kobj, | |||
628 | 628 | ||
629 | memcpy(ha->edc_data, &buf[8], len); | 629 | memcpy(ha->edc_data, &buf[8], len); |
630 | 630 | ||
631 | rval = qla2x00_write_edc(vha, dev, adr, ha->edc_data_dma, | 631 | rval = qla2x00_write_sfp(vha, ha->edc_data_dma, ha->edc_data, |
632 | ha->edc_data, len, opt); | 632 | dev, adr, len, opt); |
633 | if (rval != QLA_SUCCESS) { | 633 | if (rval != QLA_SUCCESS) { |
634 | DEBUG2(qla_printk(KERN_INFO, ha, | 634 | DEBUG2(qla_printk(KERN_INFO, ha, |
635 | "Unable to write EDC (%x) %02x:%02x:%04x:%02x:%02x.\n", | 635 | "Unable to write EDC (%x) %02x:%02x:%04x:%02x:%02x.\n", |
@@ -685,8 +685,8 @@ qla2x00_sysfs_write_edc_status(struct file *filp, struct kobject *kobj, | |||
685 | return -EINVAL; | 685 | return -EINVAL; |
686 | 686 | ||
687 | memset(ha->edc_data, 0, len); | 687 | memset(ha->edc_data, 0, len); |
688 | rval = qla2x00_read_edc(vha, dev, adr, ha->edc_data_dma, | 688 | rval = qla2x00_read_sfp(vha, ha->edc_data_dma, ha->edc_data, |
689 | ha->edc_data, len, opt); | 689 | dev, adr, len, opt); |
690 | if (rval != QLA_SUCCESS) { | 690 | if (rval != QLA_SUCCESS) { |
691 | DEBUG2(qla_printk(KERN_INFO, ha, | 691 | DEBUG2(qla_printk(KERN_INFO, ha, |
692 | "Unable to write EDC status (%x) %02x:%02x:%04x:%02x.\n", | 692 | "Unable to write EDC status (%x) %02x:%02x:%04x:%02x.\n", |