diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2009-03-24 12:08:01 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-03 10:22:46 -0400 |
commit | b64b0e8fd964ce637794d4aaa772db1ae4298ea9 (patch) | |
tree | 676892927a4ec44afdb682ab30a58a30e1d50bfd /drivers/scsi | |
parent | dda772e8e3b9832d3368f84df3a3b7ec7dfbd9f0 (diff) |
[SCSI] qla2xxx: Pass in optional extended-initialization control block.
Recent ISPs use this data to configure FCF information.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_fw.h | 23 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 16 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 17 |
5 files changed, 54 insertions, 7 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c2bc67c42648..5e7389d4010a 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2440,6 +2440,8 @@ struct qla_hw_data { | |||
2440 | dma_addr_t init_cb_dma; | 2440 | dma_addr_t init_cb_dma; |
2441 | init_cb_t *init_cb; | 2441 | init_cb_t *init_cb; |
2442 | int init_cb_size; | 2442 | int init_cb_size; |
2443 | dma_addr_t ex_init_cb_dma; | ||
2444 | struct ex_init_cb_81xx *ex_init_cb; | ||
2443 | 2445 | ||
2444 | /* These are used by mailbox operations. */ | 2446 | /* These are used by mailbox operations. */ |
2445 | volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; | 2447 | volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; |
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index ffff42554087..05cf8380a486 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h | |||
@@ -1440,7 +1440,17 @@ struct nvram_81xx { | |||
1440 | uint16_t reserved_6[24]; | 1440 | uint16_t reserved_6[24]; |
1441 | 1441 | ||
1442 | /* Offset 128. */ | 1442 | /* Offset 128. */ |
1443 | uint16_t reserved_7[64]; | 1443 | uint16_t ex_version; |
1444 | uint8_t prio_fcf_matching_flags; | ||
1445 | uint8_t reserved_6_1[3]; | ||
1446 | uint16_t pri_fcf_vlan_id; | ||
1447 | uint8_t pri_fcf_fabric_name[8]; | ||
1448 | uint16_t reserved_6_2[7]; | ||
1449 | uint8_t spma_mac_addr[6]; | ||
1450 | uint16_t reserved_6_3[14]; | ||
1451 | |||
1452 | /* Offset 192. */ | ||
1453 | uint16_t reserved_7[32]; | ||
1444 | 1454 | ||
1445 | /* | 1455 | /* |
1446 | * BIT 0 = Enable spinup delay | 1456 | * BIT 0 = Enable spinup delay |
@@ -1664,6 +1674,17 @@ struct mid_init_cb_81xx { | |||
1664 | struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC]; | 1674 | struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC]; |
1665 | }; | 1675 | }; |
1666 | 1676 | ||
1677 | struct ex_init_cb_81xx { | ||
1678 | uint16_t ex_version; | ||
1679 | uint8_t prio_fcf_matching_flags; | ||
1680 | uint8_t reserved_1[3]; | ||
1681 | uint16_t pri_fcf_vlan_id; | ||
1682 | uint8_t pri_fcf_fabric_name[8]; | ||
1683 | uint16_t reserved_2[7]; | ||
1684 | uint8_t spma_mac_addr[6]; | ||
1685 | uint16_t reserved_3[14]; | ||
1686 | }; | ||
1687 | |||
1667 | #define FARX_ACCESS_FLASH_CONF_81XX 0x7FFD0000 | 1688 | #define FARX_ACCESS_FLASH_CONF_81XX 0x7FFD0000 |
1668 | #define FARX_ACCESS_FLASH_DATA_81XX 0x7F800000 | 1689 | #define FARX_ACCESS_FLASH_DATA_81XX 0x7F800000 |
1669 | 1690 | ||
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a8a0f138bc26..e79338750e39 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -4455,6 +4455,9 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) | |||
4455 | icb->enode_mac[5] = 0x06 + PCI_FUNC(ha->pdev->devfn); | 4455 | icb->enode_mac[5] = 0x06 + PCI_FUNC(ha->pdev->devfn); |
4456 | } | 4456 | } |
4457 | 4457 | ||
4458 | /* Use extended-initialization control block. */ | ||
4459 | memcpy(ha->ex_init_cb, &nv->ex_version, sizeof(*ha->ex_init_cb)); | ||
4460 | |||
4458 | /* | 4461 | /* |
4459 | * Setup driver NVRAM options. | 4462 | * Setup driver NVRAM options. |
4460 | */ | 4463 | */ |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 4aab7acf7525..91e133bd8e60 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -1043,14 +1043,22 @@ qla2x00_init_firmware(scsi_qla_host_t *vha, uint16_t size) | |||
1043 | else | 1043 | else |
1044 | mcp->mb[0] = MBC_INITIALIZE_FIRMWARE; | 1044 | mcp->mb[0] = MBC_INITIALIZE_FIRMWARE; |
1045 | 1045 | ||
1046 | mcp->mb[1] = 0; | ||
1046 | mcp->mb[2] = MSW(ha->init_cb_dma); | 1047 | mcp->mb[2] = MSW(ha->init_cb_dma); |
1047 | mcp->mb[3] = LSW(ha->init_cb_dma); | 1048 | mcp->mb[3] = LSW(ha->init_cb_dma); |
1048 | mcp->mb[4] = 0; | ||
1049 | mcp->mb[5] = 0; | ||
1050 | mcp->mb[6] = MSW(MSD(ha->init_cb_dma)); | 1049 | mcp->mb[6] = MSW(MSD(ha->init_cb_dma)); |
1051 | mcp->mb[7] = LSW(MSD(ha->init_cb_dma)); | 1050 | mcp->mb[7] = LSW(MSD(ha->init_cb_dma)); |
1052 | mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0; | 1051 | mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; |
1053 | mcp->in_mb = MBX_5|MBX_4|MBX_0; | 1052 | if (IS_QLA81XX(ha) && ha->ex_init_cb->ex_version) { |
1053 | mcp->mb[1] = BIT_0; | ||
1054 | mcp->mb[10] = MSW(ha->ex_init_cb_dma); | ||
1055 | mcp->mb[11] = LSW(ha->ex_init_cb_dma); | ||
1056 | mcp->mb[12] = MSW(MSD(ha->ex_init_cb_dma)); | ||
1057 | mcp->mb[13] = LSW(MSD(ha->ex_init_cb_dma)); | ||
1058 | mcp->mb[14] = sizeof(*ha->ex_init_cb); | ||
1059 | mcp->out_mb |= MBX_14|MBX_13|MBX_12|MBX_11|MBX_10; | ||
1060 | } | ||
1061 | mcp->in_mb = MBX_0; | ||
1054 | mcp->buf_size = size; | 1062 | mcp->buf_size = size; |
1055 | mcp->flags = MBX_DMA_OUT; | 1063 | mcp->flags = MBX_DMA_OUT; |
1056 | mcp->tov = MBX_TOV_SECONDS; | 1064 | mcp->tov = MBX_TOV_SECONDS; |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 41ff7d69bd64..dad624e11717 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -2203,9 +2203,19 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, | |||
2203 | } else | 2203 | } else |
2204 | ha->npiv_info = NULL; | 2204 | ha->npiv_info = NULL; |
2205 | 2205 | ||
2206 | /* Get consistent memory allocated for EX-INIT-CB. */ | ||
2207 | if (IS_QLA81XX(ha)) { | ||
2208 | ha->ex_init_cb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, | ||
2209 | &ha->ex_init_cb_dma); | ||
2210 | if (!ha->ex_init_cb) | ||
2211 | goto fail_ex_init_cb; | ||
2212 | } | ||
2213 | |||
2206 | INIT_LIST_HEAD(&ha->vp_list); | 2214 | INIT_LIST_HEAD(&ha->vp_list); |
2207 | return 1; | 2215 | return 1; |
2208 | 2216 | ||
2217 | fail_ex_init_cb: | ||
2218 | kfree(ha->npiv_info); | ||
2209 | fail_npiv_info: | 2219 | fail_npiv_info: |
2210 | dma_free_coherent(&ha->pdev->dev, ((*rsp)->length + 1) * | 2220 | dma_free_coherent(&ha->pdev->dev, ((*rsp)->length + 1) * |
2211 | sizeof(response_t), (*rsp)->ring, (*rsp)->dma); | 2221 | sizeof(response_t), (*rsp)->ring, (*rsp)->dma); |
@@ -2291,15 +2301,16 @@ qla2x00_mem_free(struct qla_hw_data *ha) | |||
2291 | if (ha->ms_iocb) | 2301 | if (ha->ms_iocb) |
2292 | dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma); | 2302 | dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma); |
2293 | 2303 | ||
2304 | if (ha->ex_init_cb) | ||
2305 | dma_pool_free(ha->s_dma_pool, ha->ex_init_cb, ha->ex_init_cb_dma); | ||
2306 | |||
2294 | if (ha->s_dma_pool) | 2307 | if (ha->s_dma_pool) |
2295 | dma_pool_destroy(ha->s_dma_pool); | 2308 | dma_pool_destroy(ha->s_dma_pool); |
2296 | 2309 | ||
2297 | |||
2298 | if (ha->gid_list) | 2310 | if (ha->gid_list) |
2299 | dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list, | 2311 | dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list, |
2300 | ha->gid_list_dma); | 2312 | ha->gid_list_dma); |
2301 | 2313 | ||
2302 | |||
2303 | if (ha->init_cb) | 2314 | if (ha->init_cb) |
2304 | dma_free_coherent(&ha->pdev->dev, ha->init_cb_size, | 2315 | dma_free_coherent(&ha->pdev->dev, ha->init_cb_size, |
2305 | ha->init_cb, ha->init_cb_dma); | 2316 | ha->init_cb, ha->init_cb_dma); |
@@ -2318,6 +2329,8 @@ qla2x00_mem_free(struct qla_hw_data *ha) | |||
2318 | ha->ms_iocb_dma = 0; | 2329 | ha->ms_iocb_dma = 0; |
2319 | ha->init_cb = NULL; | 2330 | ha->init_cb = NULL; |
2320 | ha->init_cb_dma = 0; | 2331 | ha->init_cb_dma = 0; |
2332 | ha->ex_init_cb = NULL; | ||
2333 | ha->ex_init_cb_dma = 0; | ||
2321 | 2334 | ||
2322 | ha->s_dma_pool = NULL; | 2335 | ha->s_dma_pool = NULL; |
2323 | 2336 | ||