From 039acc1e70ba354a430023c3c997f680d7c098b9 Mon Sep 17 00:00:00 2001 From: Adheer Chandravanshi Date: Fri, 5 Apr 2013 07:06:06 -0400 Subject: [SCSI] qla4xxx: Use correct flash ddb offset for ISP40XX Use correct flash ddb offset to add and delete flash target entries for ISP40XX Signed-off-by: Adheer Chandravanshi Signed-off-by: Vikas Chaudhary Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- drivers/scsi/qla4xxx/ql4_mbx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c') diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index 8985997de576..a501beab3ffe 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c @@ -1421,7 +1421,7 @@ int qla4xxx_flashdb_by_index(struct scsi_qla_host *ha, struct dev_db_entry *fw_ddb_entry, dma_addr_t fw_ddb_entry_dma, uint16_t ddb_index) { - uint32_t dev_db_start_offset = FLASH_OFFSET_DB_INFO; + uint32_t dev_db_start_offset; uint32_t dev_db_end_offset; int status = QLA_ERROR; @@ -1429,6 +1429,7 @@ int qla4xxx_flashdb_by_index(struct scsi_qla_host *ha, if (is_qla40XX(ha)) { dev_db_start_offset = FLASH_OFFSET_DB_INFO; + dev_db_end_offset = FLASH_OFFSET_DB_END; } else { dev_db_start_offset = FLASH_RAW_ACCESS_ADDR + (ha->hw.flt_region_ddb << 2); @@ -1437,9 +1438,11 @@ int qla4xxx_flashdb_by_index(struct scsi_qla_host *ha, */ if (ha->port_num == 1) dev_db_start_offset += (ha->hw.flt_ddb_size / 2); + + dev_db_end_offset = dev_db_start_offset + + (ha->hw.flt_ddb_size / 2); } - dev_db_end_offset = dev_db_start_offset + (ha->hw.flt_ddb_size / 2); dev_db_start_offset += (ddb_index * sizeof(*fw_ddb_entry)); if (dev_db_start_offset > dev_db_end_offset) { -- cgit v1.2.3