aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-03-15 11:25:07 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:23:48 -0400
commitcb5172eafd9ffdab6bb7b1eec628ea706d5817c8 (patch)
tree9e87cd6a91ade79cf24bed529bc2702157391580 /drivers/scsi/lpfc/lpfc_init.c
parent999d813f227435c35b44362ee82211a1458844fc (diff)
[SCSI] lpfc 8.3.11: SLI4 Improvements
- Correct all SLI4 code to work on big endian systems. - Move read of sli4 params earlier so returned values are used correctly. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 25ee8cc6ab7a..f8e88bb423cb 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2566,7 +2566,7 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
2566 shost->max_cmd_len = 16; 2566 shost->max_cmd_len = 16;
2567 if (phba->sli_rev == LPFC_SLI_REV4) { 2567 if (phba->sli_rev == LPFC_SLI_REV4) {
2568 shost->dma_boundary = 2568 shost->dma_boundary =
2569 phba->sli4_hba.pc_sli4_params.sge_supp_len; 2569 phba->sli4_hba.pc_sli4_params.sge_supp_len-1;
2570 shost->sg_tablesize = phba->cfg_sg_seg_cnt; 2570 shost->sg_tablesize = phba->cfg_sg_seg_cnt;
2571 } 2571 }
2572 2572
@@ -4039,6 +4039,43 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
4039 if (unlikely(rc)) 4039 if (unlikely(rc))
4040 goto out_free_bsmbx; 4040 goto out_free_bsmbx;
4041 4041
4042 mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
4043 GFP_KERNEL);
4044 if (!mboxq) {
4045 rc = -ENOMEM;
4046 goto out_free_bsmbx;
4047 }
4048
4049 /* Get the Supported Pages. It is always available. */
4050 lpfc_supported_pages(mboxq);
4051 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
4052 if (unlikely(rc)) {
4053 rc = -EIO;
4054 mempool_free(mboxq, phba->mbox_mem_pool);
4055 goto out_free_bsmbx;
4056 }
4057
4058 mqe = &mboxq->u.mqe;
4059 memcpy(&pn_page[0], ((uint8_t *)&mqe->un.supp_pages.word3),
4060 LPFC_MAX_SUPPORTED_PAGES);
4061 for (i = 0; i < LPFC_MAX_SUPPORTED_PAGES; i++) {
4062 switch (pn_page[i]) {
4063 case LPFC_SLI4_PARAMETERS:
4064 phba->sli4_hba.pc_sli4_params.supported = 1;
4065 break;
4066 default:
4067 break;
4068 }
4069 }
4070
4071 /* Read the port's SLI4 Parameters capabilities if supported. */
4072 if (phba->sli4_hba.pc_sli4_params.supported)
4073 rc = lpfc_pc_sli4_params_get(phba, mboxq);
4074 mempool_free(mboxq, phba->mbox_mem_pool);
4075 if (rc) {
4076 rc = -EIO;
4077 goto out_free_bsmbx;
4078 }
4042 /* Create all the SLI4 queues */ 4079 /* Create all the SLI4 queues */
4043 rc = lpfc_sli4_queue_create(phba); 4080 rc = lpfc_sli4_queue_create(phba);
4044 if (rc) 4081 if (rc)
@@ -4099,43 +4136,6 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
4099 goto out_free_fcp_eq_hdl; 4136 goto out_free_fcp_eq_hdl;
4100 } 4137 }
4101 4138
4102 mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
4103 GFP_KERNEL);
4104 if (!mboxq) {
4105 rc = -ENOMEM;
4106 goto out_free_fcp_eq_hdl;
4107 }
4108
4109 /* Get the Supported Pages. It is always available. */
4110 lpfc_supported_pages(mboxq);
4111 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
4112 if (unlikely(rc)) {
4113 rc = -EIO;
4114 mempool_free(mboxq, phba->mbox_mem_pool);
4115 goto out_free_fcp_eq_hdl;
4116 }
4117
4118 mqe = &mboxq->u.mqe;
4119 memcpy(&pn_page[0], ((uint8_t *)&mqe->un.supp_pages.word3),
4120 LPFC_MAX_SUPPORTED_PAGES);
4121 for (i = 0; i < LPFC_MAX_SUPPORTED_PAGES; i++) {
4122 switch (pn_page[i]) {
4123 case LPFC_SLI4_PARAMETERS:
4124 phba->sli4_hba.pc_sli4_params.supported = 1;
4125 break;
4126 default:
4127 break;
4128 }
4129 }
4130
4131 /* Read the port's SLI4 Parameters capabilities if supported. */
4132 if (phba->sli4_hba.pc_sli4_params.supported)
4133 rc = lpfc_pc_sli4_params_get(phba, mboxq);
4134 mempool_free(mboxq, phba->mbox_mem_pool);
4135 if (rc) {
4136 rc = -EIO;
4137 goto out_free_fcp_eq_hdl;
4138 }
4139 return rc; 4139 return rc;
4140 4140
4141out_free_fcp_eq_hdl: 4141out_free_fcp_eq_hdl: