diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index ccaad0b08d35..c16154c51298 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -54,6 +54,13 @@ module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR); | |||
54 | MODULE_PARM_DESC(ql2xloginretrycount, | 54 | MODULE_PARM_DESC(ql2xloginretrycount, |
55 | "Specify an alternate value for the NVRAM login retry count."); | 55 | "Specify an alternate value for the NVRAM login retry count."); |
56 | 56 | ||
57 | int ql2xallocfwdump = 1; | ||
58 | module_param(ql2xallocfwdump, int, S_IRUGO|S_IRUSR); | ||
59 | MODULE_PARM_DESC(ql2xallocfwdump, | ||
60 | "Option to enable allocation of memory for a firmware dump " | ||
61 | "during HBA initialization. Memory allocation requirements " | ||
62 | "vary by ISP type. Default is 1 - allocate memory."); | ||
63 | |||
57 | static void qla2x00_free_device(scsi_qla_host_t *); | 64 | static void qla2x00_free_device(scsi_qla_host_t *); |
58 | 65 | ||
59 | static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); | 66 | static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha); |
@@ -1405,7 +1412,6 @@ static int qla2x00_probe_one(struct pci_dev *pdev) | |||
1405 | ha->isp_ops.read_nvram = qla2x00_read_nvram_data; | 1412 | ha->isp_ops.read_nvram = qla2x00_read_nvram_data; |
1406 | ha->isp_ops.write_nvram = qla2x00_write_nvram_data; | 1413 | ha->isp_ops.write_nvram = qla2x00_write_nvram_data; |
1407 | ha->isp_ops.fw_dump = qla2100_fw_dump; | 1414 | ha->isp_ops.fw_dump = qla2100_fw_dump; |
1408 | ha->isp_ops.ascii_fw_dump = qla2100_ascii_fw_dump; | ||
1409 | ha->isp_ops.read_optrom = qla2x00_read_optrom_data; | 1415 | ha->isp_ops.read_optrom = qla2x00_read_optrom_data; |
1410 | ha->isp_ops.write_optrom = qla2x00_write_optrom_data; | 1416 | ha->isp_ops.write_optrom = qla2x00_write_optrom_data; |
1411 | if (IS_QLA2100(ha)) { | 1417 | if (IS_QLA2100(ha)) { |
@@ -1432,7 +1438,6 @@ static int qla2x00_probe_one(struct pci_dev *pdev) | |||
1432 | ha->isp_ops.pci_config = qla2300_pci_config; | 1438 | ha->isp_ops.pci_config = qla2300_pci_config; |
1433 | ha->isp_ops.intr_handler = qla2300_intr_handler; | 1439 | ha->isp_ops.intr_handler = qla2300_intr_handler; |
1434 | ha->isp_ops.fw_dump = qla2300_fw_dump; | 1440 | ha->isp_ops.fw_dump = qla2300_fw_dump; |
1435 | ha->isp_ops.ascii_fw_dump = qla2300_ascii_fw_dump; | ||
1436 | ha->isp_ops.beacon_on = qla2x00_beacon_on; | 1441 | ha->isp_ops.beacon_on = qla2x00_beacon_on; |
1437 | ha->isp_ops.beacon_off = qla2x00_beacon_off; | 1442 | ha->isp_ops.beacon_off = qla2x00_beacon_off; |
1438 | ha->isp_ops.beacon_blink = qla2x00_beacon_blink; | 1443 | ha->isp_ops.beacon_blink = qla2x00_beacon_blink; |
@@ -1469,7 +1474,6 @@ static int qla2x00_probe_one(struct pci_dev *pdev) | |||
1469 | ha->isp_ops.read_nvram = qla24xx_read_nvram_data; | 1474 | ha->isp_ops.read_nvram = qla24xx_read_nvram_data; |
1470 | ha->isp_ops.write_nvram = qla24xx_write_nvram_data; | 1475 | ha->isp_ops.write_nvram = qla24xx_write_nvram_data; |
1471 | ha->isp_ops.fw_dump = qla24xx_fw_dump; | 1476 | ha->isp_ops.fw_dump = qla24xx_fw_dump; |
1472 | ha->isp_ops.ascii_fw_dump = qla24xx_ascii_fw_dump; | ||
1473 | ha->isp_ops.read_optrom = qla24xx_read_optrom_data; | 1477 | ha->isp_ops.read_optrom = qla24xx_read_optrom_data; |
1474 | ha->isp_ops.write_optrom = qla24xx_write_optrom_data; | 1478 | ha->isp_ops.write_optrom = qla24xx_write_optrom_data; |
1475 | ha->isp_ops.beacon_on = qla24xx_beacon_on; | 1479 | ha->isp_ops.beacon_on = qla24xx_beacon_on; |
@@ -1678,6 +1682,9 @@ qla2x00_free_device(scsi_qla_host_t *ha) | |||
1678 | kthread_stop(t); | 1682 | kthread_stop(t); |
1679 | } | 1683 | } |
1680 | 1684 | ||
1685 | if (ha->eft) | ||
1686 | qla2x00_trace_control(ha, TC_DISABLE, 0, 0); | ||
1687 | |||
1681 | /* Stop currently executing firmware. */ | 1688 | /* Stop currently executing firmware. */ |
1682 | qla2x00_stop_firmware(ha); | 1689 | qla2x00_stop_firmware(ha); |
1683 | 1690 | ||
@@ -2012,6 +2019,13 @@ qla2x00_mem_free(scsi_qla_host_t *ha) | |||
2012 | /* free sp pool */ | 2019 | /* free sp pool */ |
2013 | qla2x00_free_sp_pool(ha); | 2020 | qla2x00_free_sp_pool(ha); |
2014 | 2021 | ||
2022 | if (ha->fw_dump) { | ||
2023 | if (ha->eft) | ||
2024 | dma_free_coherent(&ha->pdev->dev, | ||
2025 | ntohl(ha->fw_dump->eft_size), ha->eft, ha->eft_dma); | ||
2026 | vfree(ha->fw_dump); | ||
2027 | } | ||
2028 | |||
2015 | if (ha->sns_cmd) | 2029 | if (ha->sns_cmd) |
2016 | dma_free_coherent(&ha->pdev->dev, sizeof(struct sns_cmd_pkt), | 2030 | dma_free_coherent(&ha->pdev->dev, sizeof(struct sns_cmd_pkt), |
2017 | ha->sns_cmd, ha->sns_cmd_dma); | 2031 | ha->sns_cmd, ha->sns_cmd_dma); |
@@ -2043,6 +2057,8 @@ qla2x00_mem_free(scsi_qla_host_t *ha) | |||
2043 | (ha->request_q_length + 1) * sizeof(request_t), | 2057 | (ha->request_q_length + 1) * sizeof(request_t), |
2044 | ha->request_ring, ha->request_dma); | 2058 | ha->request_ring, ha->request_dma); |
2045 | 2059 | ||
2060 | ha->eft = NULL; | ||
2061 | ha->eft_dma = 0; | ||
2046 | ha->sns_cmd = NULL; | 2062 | ha->sns_cmd = NULL; |
2047 | ha->sns_cmd_dma = 0; | 2063 | ha->sns_cmd_dma = 0; |
2048 | ha->ct_sns = NULL; | 2064 | ha->ct_sns = NULL; |
@@ -2071,13 +2087,9 @@ qla2x00_mem_free(scsi_qla_host_t *ha) | |||
2071 | } | 2087 | } |
2072 | INIT_LIST_HEAD(&ha->fcports); | 2088 | INIT_LIST_HEAD(&ha->fcports); |
2073 | 2089 | ||
2074 | vfree(ha->fw_dump); | ||
2075 | vfree(ha->fw_dump_buffer); | ||
2076 | |||
2077 | ha->fw_dump = NULL; | 2090 | ha->fw_dump = NULL; |
2078 | ha->fw_dumped = 0; | 2091 | ha->fw_dumped = 0; |
2079 | ha->fw_dump_reading = 0; | 2092 | ha->fw_dump_reading = 0; |
2080 | ha->fw_dump_buffer = NULL; | ||
2081 | 2093 | ||
2082 | vfree(ha->optrom_buffer); | 2094 | vfree(ha->optrom_buffer); |
2083 | } | 2095 | } |