[SCSI] qla2xxx: Pass in optional extended-initialization control block.
authorAndrew Vasquez <andrew.vasquez@qlogic.com>
Tue, 24 Mar 2009 16:08:01 +0000 (09:08 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 3 Apr 2009 14:22:46 +0000 (09:22 -0500)
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>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_fw.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c

index c2bc67c42648d1f33bdfb0dd6926f84720743d80..5e7389d4010acf4e176c23ee9d7d3c41a8b567bb 100644 (file)
@@ -2440,6 +2440,8 @@ struct qla_hw_data {
        dma_addr_t      init_cb_dma;
        init_cb_t       *init_cb;
        int             init_cb_size;
+       dma_addr_t      ex_init_cb_dma;
+       struct ex_init_cb_81xx *ex_init_cb;
 
        /* These are used by mailbox operations. */
        volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT];
index ffff4255408784ffe24c1a2753a9654950e5ca6d..05cf8380a4862d22b3aacee69bc3afe9f9357bbf 100644 (file)
@@ -1440,7 +1440,17 @@ struct nvram_81xx {
        uint16_t reserved_6[24];
 
        /* Offset 128. */
-       uint16_t reserved_7[64];
+       uint16_t ex_version;
+       uint8_t prio_fcf_matching_flags;
+       uint8_t reserved_6_1[3];
+       uint16_t pri_fcf_vlan_id;
+       uint8_t pri_fcf_fabric_name[8];
+       uint16_t reserved_6_2[7];
+       uint8_t spma_mac_addr[6];
+       uint16_t reserved_6_3[14];
+
+       /* Offset 192. */
+       uint16_t reserved_7[32];
 
        /*
         * BIT 0  = Enable spinup delay
@@ -1664,6 +1674,17 @@ struct mid_init_cb_81xx {
        struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC];
 };
 
+struct ex_init_cb_81xx {
+       uint16_t ex_version;
+       uint8_t prio_fcf_matching_flags;
+       uint8_t reserved_1[3];
+       uint16_t pri_fcf_vlan_id;
+       uint8_t pri_fcf_fabric_name[8];
+       uint16_t reserved_2[7];
+       uint8_t spma_mac_addr[6];
+       uint16_t reserved_3[14];
+};
+
 #define FARX_ACCESS_FLASH_CONF_81XX    0x7FFD0000
 #define FARX_ACCESS_FLASH_DATA_81XX    0x7F800000
 
index a8a0f138bc260bc985dee06dbdb93ba1ce6fb261..e79338750e39cef03f5942390f7c9cf2202fe770 100644 (file)
@@ -4455,6 +4455,9 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
                icb->enode_mac[5] = 0x06 + PCI_FUNC(ha->pdev->devfn);
        }
 
+       /* Use extended-initialization control block. */
+       memcpy(ha->ex_init_cb, &nv->ex_version, sizeof(*ha->ex_init_cb));
+
        /*
         * Setup driver NVRAM options.
         */
index 4aab7acf752550abf7942875df557c273ed0f0cc..91e133bd8e602ec4e32ea5ec0ac9707c4c5afe85 100644 (file)
@@ -1043,14 +1043,22 @@ qla2x00_init_firmware(scsi_qla_host_t *vha, uint16_t size)
        else
                mcp->mb[0] = MBC_INITIALIZE_FIRMWARE;
 
+       mcp->mb[1] = 0;
        mcp->mb[2] = MSW(ha->init_cb_dma);
        mcp->mb[3] = LSW(ha->init_cb_dma);
-       mcp->mb[4] = 0;
-       mcp->mb[5] = 0;
        mcp->mb[6] = MSW(MSD(ha->init_cb_dma));
        mcp->mb[7] = LSW(MSD(ha->init_cb_dma));
-       mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0;
-       mcp->in_mb = MBX_5|MBX_4|MBX_0;
+       mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+       if (IS_QLA81XX(ha) && ha->ex_init_cb->ex_version) {
+               mcp->mb[1] = BIT_0;
+               mcp->mb[10] = MSW(ha->ex_init_cb_dma);
+               mcp->mb[11] = LSW(ha->ex_init_cb_dma);
+               mcp->mb[12] = MSW(MSD(ha->ex_init_cb_dma));
+               mcp->mb[13] = LSW(MSD(ha->ex_init_cb_dma));
+               mcp->mb[14] = sizeof(*ha->ex_init_cb);
+               mcp->out_mb |= MBX_14|MBX_13|MBX_12|MBX_11|MBX_10;
+       }
+       mcp->in_mb = MBX_0;
        mcp->buf_size = size;
        mcp->flags = MBX_DMA_OUT;
        mcp->tov = MBX_TOV_SECONDS;
index 41ff7d69bd64de9f5b1b540c81f2df9dea9058e4..dad624e117171d4092a620aa5b95cf6a46cc8595 100644 (file)
@@ -2203,9 +2203,19 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
        } else
                ha->npiv_info = NULL;
 
+       /* Get consistent memory allocated for EX-INIT-CB. */
+       if (IS_QLA81XX(ha)) {
+               ha->ex_init_cb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL,
+                   &ha->ex_init_cb_dma);
+               if (!ha->ex_init_cb)
+                       goto fail_ex_init_cb;
+       }
+
        INIT_LIST_HEAD(&ha->vp_list);
        return 1;
 
+fail_ex_init_cb:
+       kfree(ha->npiv_info);
 fail_npiv_info:
        dma_free_coherent(&ha->pdev->dev, ((*rsp)->length + 1) *
                sizeof(response_t), (*rsp)->ring, (*rsp)->dma);
@@ -2291,15 +2301,16 @@ qla2x00_mem_free(struct qla_hw_data *ha)
        if (ha->ms_iocb)
                dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma);
 
+       if (ha->ex_init_cb)
+               dma_pool_free(ha->s_dma_pool, ha->ex_init_cb, ha->ex_init_cb_dma);
+
        if (ha->s_dma_pool)
                dma_pool_destroy(ha->s_dma_pool);
 
-
        if (ha->gid_list)
                dma_free_coherent(&ha->pdev->dev, GID_LIST_SIZE, ha->gid_list,
                ha->gid_list_dma);
 
-
        if (ha->init_cb)
                dma_free_coherent(&ha->pdev->dev, ha->init_cb_size,
                ha->init_cb, ha->init_cb_dma);
@@ -2318,6 +2329,8 @@ qla2x00_mem_free(struct qla_hw_data *ha)
        ha->ms_iocb_dma = 0;
        ha->init_cb = NULL;
        ha->init_cb_dma = 0;
+       ha->ex_init_cb = NULL;
+       ha->ex_init_cb_dma = 0;
 
        ha->s_dma_pool = NULL;