aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2006-05-17 18:09:50 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-05-20 10:50:11 -0400
commitd4e3e04d789ba23027c66e176b10ac7477906948 (patch)
treee98c514c2b3505af6f0c0a2e48f697899735ff15 /drivers/scsi/qla2xxx/qla_init.c
parentcb63067a772c0149184309a1f232d62c81a93673 (diff)
[SCSI] qla2xxx: Consolidate firmware-dump handling across ISPs.
Simplify and centralise buffer allocation/deallocation, as there's no point in having two memory request methods. 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_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 748be95c51a7..011e8795545a 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -773,16 +773,26 @@ qla24xx_chip_diag(scsi_qla_host_t *ha)
773static void 773static void
774qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) 774qla2x00_alloc_fw_dump(scsi_qla_host_t *ha)
775{ 775{
776 uint32_t dump_size = 0;
777
776 ha->fw_dumped = 0; 778 ha->fw_dumped = 0;
777 ha->fw_dump24_len = sizeof(struct qla24xx_fw_dump); 779 if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
778 ha->fw_dump24_len += (ha->fw_memory_size - 0x100000) * sizeof(uint32_t); 780 dump_size = sizeof(struct qla2100_fw_dump);
779 ha->fw_dump24 = vmalloc(ha->fw_dump24_len); 781 } else if (IS_QLA23XX(ha)) {
780 if (ha->fw_dump24) 782 dump_size = sizeof(struct qla2300_fw_dump);
783 dump_size += (ha->fw_memory_size - 0x11000) * sizeof(uint16_t);
784 } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
785 dump_size = sizeof(struct qla24xx_fw_dump);
786 dump_size += (ha->fw_memory_size - 0x100000) * sizeof(uint32_t);
787 }
788
789 ha->fw_dump = vmalloc(dump_size);
790 if (ha->fw_dump)
781 qla_printk(KERN_INFO, ha, "Allocated (%d KB) for firmware " 791 qla_printk(KERN_INFO, ha, "Allocated (%d KB) for firmware "
782 "dump...\n", ha->fw_dump24_len / 1024); 792 "dump...\n", dump_size / 1024);
783 else 793 else
784 qla_printk(KERN_WARNING, ha, "Unable to allocate (%d KB) for " 794 qla_printk(KERN_WARNING, ha, "Unable to allocate (%d KB) for "
785 "firmware dump!!!\n", ha->fw_dump24_len / 1024); 795 "firmware dump!!!\n", dump_size / 1024);
786} 796}
787 797
788/** 798/**
@@ -800,13 +810,12 @@ qla2x00_resize_request_q(scsi_qla_host_t *ha)
800 dma_addr_t request_dma; 810 dma_addr_t request_dma;
801 request_t *request_ring; 811 request_t *request_ring;
802 812
813 qla2x00_alloc_fw_dump(ha);
814
803 /* Valid only on recent ISPs. */ 815 /* Valid only on recent ISPs. */
804 if (IS_QLA2100(ha) || IS_QLA2200(ha)) 816 if (IS_QLA2100(ha) || IS_QLA2200(ha))
805 return; 817 return;
806 818
807 if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
808 qla2x00_alloc_fw_dump(ha);
809
810 /* Retrieve IOCB counts available to the firmware. */ 819 /* Retrieve IOCB counts available to the firmware. */
811 rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, &fw_iocb_cnt); 820 rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, &fw_iocb_cnt);
812 if (rval) 821 if (rval)