diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 94ff3a591471..094af74989d6 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -2135,7 +2135,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2135 | char pci_info[30]; | 2135 | char pci_info[30]; |
2136 | char fw_str[30]; | 2136 | char fw_str[30]; |
2137 | struct scsi_host_template *sht; | 2137 | struct scsi_host_template *sht; |
2138 | int bars, max_id, mem_only = 0; | 2138 | int bars, mem_only = 0; |
2139 | uint16_t req_length = 0, rsp_length = 0; | 2139 | uint16_t req_length = 0, rsp_length = 0; |
2140 | struct req_que *req = NULL; | 2140 | struct req_que *req = NULL; |
2141 | struct rsp_que *rsp = NULL; | 2141 | struct rsp_que *rsp = NULL; |
@@ -2200,9 +2200,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2200 | ha->optrom_size = OPTROM_SIZE_2300; | 2200 | ha->optrom_size = OPTROM_SIZE_2300; |
2201 | 2201 | ||
2202 | /* Assign ISP specific operations. */ | 2202 | /* Assign ISP specific operations. */ |
2203 | max_id = MAX_TARGETS_2200; | ||
2204 | if (IS_QLA2100(ha)) { | 2203 | if (IS_QLA2100(ha)) { |
2205 | max_id = MAX_TARGETS_2100; | 2204 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2100; |
2206 | ha->mbx_count = MAILBOX_REGISTER_COUNT_2100; | 2205 | ha->mbx_count = MAILBOX_REGISTER_COUNT_2100; |
2207 | req_length = REQUEST_ENTRY_CNT_2100; | 2206 | req_length = REQUEST_ENTRY_CNT_2100; |
2208 | rsp_length = RESPONSE_ENTRY_CNT_2100; | 2207 | rsp_length = RESPONSE_ENTRY_CNT_2100; |
@@ -2214,6 +2213,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2214 | ha->nvram_data_off = ~0; | 2213 | ha->nvram_data_off = ~0; |
2215 | ha->isp_ops = &qla2100_isp_ops; | 2214 | ha->isp_ops = &qla2100_isp_ops; |
2216 | } else if (IS_QLA2200(ha)) { | 2215 | } else if (IS_QLA2200(ha)) { |
2216 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2100; | ||
2217 | ha->mbx_count = MAILBOX_REGISTER_COUNT_2200; | 2217 | ha->mbx_count = MAILBOX_REGISTER_COUNT_2200; |
2218 | req_length = REQUEST_ENTRY_CNT_2200; | 2218 | req_length = REQUEST_ENTRY_CNT_2200; |
2219 | rsp_length = RESPONSE_ENTRY_CNT_2100; | 2219 | rsp_length = RESPONSE_ENTRY_CNT_2100; |
@@ -2225,6 +2225,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2225 | ha->nvram_data_off = ~0; | 2225 | ha->nvram_data_off = ~0; |
2226 | ha->isp_ops = &qla2100_isp_ops; | 2226 | ha->isp_ops = &qla2100_isp_ops; |
2227 | } else if (IS_QLA23XX(ha)) { | 2227 | } else if (IS_QLA23XX(ha)) { |
2228 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2100; | ||
2228 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2229 | ha->mbx_count = MAILBOX_REGISTER_COUNT; |
2229 | req_length = REQUEST_ENTRY_CNT_2200; | 2230 | req_length = REQUEST_ENTRY_CNT_2200; |
2230 | rsp_length = RESPONSE_ENTRY_CNT_2300; | 2231 | rsp_length = RESPONSE_ENTRY_CNT_2300; |
@@ -2238,6 +2239,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2238 | ha->nvram_data_off = ~0; | 2239 | ha->nvram_data_off = ~0; |
2239 | ha->isp_ops = &qla2300_isp_ops; | 2240 | ha->isp_ops = &qla2300_isp_ops; |
2240 | } else if (IS_QLA24XX_TYPE(ha)) { | 2241 | } else if (IS_QLA24XX_TYPE(ha)) { |
2242 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2400; | ||
2241 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2243 | ha->mbx_count = MAILBOX_REGISTER_COUNT; |
2242 | req_length = REQUEST_ENTRY_CNT_24XX; | 2244 | req_length = REQUEST_ENTRY_CNT_24XX; |
2243 | rsp_length = RESPONSE_ENTRY_CNT_2300; | 2245 | rsp_length = RESPONSE_ENTRY_CNT_2300; |
@@ -2252,6 +2254,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2252 | ha->nvram_conf_off = FARX_ACCESS_NVRAM_CONF; | 2254 | ha->nvram_conf_off = FARX_ACCESS_NVRAM_CONF; |
2253 | ha->nvram_data_off = FARX_ACCESS_NVRAM_DATA; | 2255 | ha->nvram_data_off = FARX_ACCESS_NVRAM_DATA; |
2254 | } else if (IS_QLA25XX(ha)) { | 2256 | } else if (IS_QLA25XX(ha)) { |
2257 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2400; | ||
2255 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2258 | ha->mbx_count = MAILBOX_REGISTER_COUNT; |
2256 | req_length = REQUEST_ENTRY_CNT_24XX; | 2259 | req_length = REQUEST_ENTRY_CNT_24XX; |
2257 | rsp_length = RESPONSE_ENTRY_CNT_2300; | 2260 | rsp_length = RESPONSE_ENTRY_CNT_2300; |
@@ -2266,6 +2269,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2266 | ha->nvram_conf_off = FARX_ACCESS_NVRAM_CONF; | 2269 | ha->nvram_conf_off = FARX_ACCESS_NVRAM_CONF; |
2267 | ha->nvram_data_off = FARX_ACCESS_NVRAM_DATA; | 2270 | ha->nvram_data_off = FARX_ACCESS_NVRAM_DATA; |
2268 | } else if (IS_QLA81XX(ha)) { | 2271 | } else if (IS_QLA81XX(ha)) { |
2272 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2400; | ||
2269 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2273 | ha->mbx_count = MAILBOX_REGISTER_COUNT; |
2270 | req_length = REQUEST_ENTRY_CNT_24XX; | 2274 | req_length = REQUEST_ENTRY_CNT_24XX; |
2271 | rsp_length = RESPONSE_ENTRY_CNT_2300; | 2275 | rsp_length = RESPONSE_ENTRY_CNT_2300; |
@@ -2280,6 +2284,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2280 | ha->nvram_conf_off = ~0; | 2284 | ha->nvram_conf_off = ~0; |
2281 | ha->nvram_data_off = ~0; | 2285 | ha->nvram_data_off = ~0; |
2282 | } else if (IS_QLA82XX(ha)) { | 2286 | } else if (IS_QLA82XX(ha)) { |
2287 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2400; | ||
2283 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2288 | ha->mbx_count = MAILBOX_REGISTER_COUNT; |
2284 | req_length = REQUEST_ENTRY_CNT_82XX; | 2289 | req_length = REQUEST_ENTRY_CNT_82XX; |
2285 | rsp_length = RESPONSE_ENTRY_CNT_82XX; | 2290 | rsp_length = RESPONSE_ENTRY_CNT_82XX; |
@@ -2294,6 +2299,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2294 | ha->nvram_conf_off = FARX_ACCESS_NVRAM_CONF; | 2299 | ha->nvram_conf_off = FARX_ACCESS_NVRAM_CONF; |
2295 | ha->nvram_data_off = FARX_ACCESS_NVRAM_DATA; | 2300 | ha->nvram_data_off = FARX_ACCESS_NVRAM_DATA; |
2296 | } else if (IS_QLA83XX(ha)) { | 2301 | } else if (IS_QLA83XX(ha)) { |
2302 | ha->max_fibre_devices = MAX_FIBRE_DEVICES_2400; | ||
2297 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | 2303 | ha->mbx_count = MAILBOX_REGISTER_COUNT; |
2298 | req_length = REQUEST_ENTRY_CNT_24XX; | 2304 | req_length = REQUEST_ENTRY_CNT_24XX; |
2299 | rsp_length = RESPONSE_ENTRY_CNT_2300; | 2305 | rsp_length = RESPONSE_ENTRY_CNT_2300; |
@@ -2312,10 +2318,11 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2312 | ql_dbg_pci(ql_dbg_init, pdev, 0x001e, | 2318 | ql_dbg_pci(ql_dbg_init, pdev, 0x001e, |
2313 | "mbx_count=%d, req_length=%d, " | 2319 | "mbx_count=%d, req_length=%d, " |
2314 | "rsp_length=%d, max_loop_id=%d, init_cb_size=%d, " | 2320 | "rsp_length=%d, max_loop_id=%d, init_cb_size=%d, " |
2315 | "gid_list_info_size=%d, optrom_size=%d, nvram_npiv_size=%d, .\n", | 2321 | "gid_list_info_size=%d, optrom_size=%d, nvram_npiv_size=%d, " |
2322 | "max_fibre_devices=%d.\n", | ||
2316 | ha->mbx_count, req_length, rsp_length, ha->max_loop_id, | 2323 | ha->mbx_count, req_length, rsp_length, ha->max_loop_id, |
2317 | ha->init_cb_size, ha->gid_list_info_size, ha->optrom_size, | 2324 | ha->init_cb_size, ha->gid_list_info_size, ha->optrom_size, |
2318 | ha->nvram_npiv_size); | 2325 | ha->nvram_npiv_size, ha->max_fibre_devices); |
2319 | ql_dbg_pci(ql_dbg_init, pdev, 0x001f, | 2326 | ql_dbg_pci(ql_dbg_init, pdev, 0x001f, |
2320 | "isp_ops=%p, flash_conf_off=%d, " | 2327 | "isp_ops=%p, flash_conf_off=%d, " |
2321 | "flash_data_off=%d, nvram_conf_off=%d, nvram_data_off=%d.\n", | 2328 | "flash_data_off=%d, nvram_conf_off=%d, nvram_data_off=%d.\n", |
@@ -2389,7 +2396,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2389 | "mgmt_svr_loop_id=%d, sg_tablesize=%d.\n", | 2396 | "mgmt_svr_loop_id=%d, sg_tablesize=%d.\n", |
2390 | host->can_queue, base_vha->req, | 2397 | host->can_queue, base_vha->req, |
2391 | base_vha->mgmt_svr_loop_id, host->sg_tablesize); | 2398 | base_vha->mgmt_svr_loop_id, host->sg_tablesize); |
2392 | host->max_id = max_id; | 2399 | host->max_id = ha->max_fibre_devices; |
2393 | host->this_id = 255; | 2400 | host->this_id = 255; |
2394 | host->cmd_per_lun = 3; | 2401 | host->cmd_per_lun = 3; |
2395 | host->unique_id = host->host_no; | 2402 | host->unique_id = host->host_no; |
@@ -2939,8 +2946,8 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, | |||
2939 | if (!ha->init_cb) | 2946 | if (!ha->init_cb) |
2940 | goto fail; | 2947 | goto fail; |
2941 | 2948 | ||
2942 | ha->gid_list = dma_alloc_coherent(&ha->pdev->dev, GID_LIST_SIZE, | 2949 | ha->gid_list = dma_alloc_coherent(&ha->pdev->dev, |
2943 | &ha->gid_list_dma, GFP_KERNEL); | 2950 | qla2x00_gid_list_size(ha), &ha->gid_list_dma, GFP_KERNEL); |
2944 | if (!ha->gid_list) | 2951 | if (!ha->gid_list) |
2945 | goto fail_free_init_cb; | 2952 | goto fail_free_init_cb; |
2946 | 2953 | ||
@@ -3155,7 +3162,8 @@ fail_free_srb_mempool: | |||
3155 | mempool_destroy(ha->srb_mempool); | 3162 | mempool_destroy(ha->srb_mempool); |
3156 | ha->srb_mempool = NULL; | 3163 | ha->srb_mempool = NULL; |
3157 | fail_free_gid_list: | 3164 | fail_free_gid_list: |
3158 | dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list, | 3165 | dma_free_coherent(&ha->pdev->dev, qla2x00_gid_list_size(ha), |
3166 | ha->gid_list, | ||
3159 | ha->gid_list_dma); | 3167 | ha->gid_list_dma); |
3160 | ha->gid_list = NULL; | 3168 | ha->gid_list = NULL; |
3161 | ha->gid_list_dma = 0; | 3169 | ha->gid_list_dma = 0; |
@@ -3247,8 +3255,8 @@ qla2x00_mem_free(struct qla_hw_data *ha) | |||
3247 | dma_pool_destroy(ha->s_dma_pool); | 3255 | dma_pool_destroy(ha->s_dma_pool); |
3248 | 3256 | ||
3249 | if (ha->gid_list) | 3257 | if (ha->gid_list) |
3250 | dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list, | 3258 | dma_free_coherent(&ha->pdev->dev, qla2x00_gid_list_size(ha), |
3251 | ha->gid_list_dma); | 3259 | ha->gid_list, ha->gid_list_dma); |
3252 | 3260 | ||
3253 | if (IS_QLA82XX(ha)) { | 3261 | if (IS_QLA82XX(ha)) { |
3254 | if (!list_empty(&ha->gbl_dsd_list)) { | 3262 | if (!list_empty(&ha->gbl_dsd_list)) { |