tree-wide: fix assorted typos all over the place
[safe/jmp/linux-2.6] / drivers / scsi / lpfc / lpfc_init.c
index 8c30f57..82f8ab5 100644 (file)
@@ -211,7 +211,7 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
                goto out_free_mbox;
 
        do {
-               lpfc_dump_mem(phba, pmb, offset);
+               lpfc_dump_mem(phba, pmb, offset, DMP_REGION_VPD);
                rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
 
                if (rc != MBX_SUCCESS) {
@@ -385,6 +385,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
        /* Update the fc_host data structures with new wwn. */
        fc_host_node_name(shost) = wwn_to_u64(vport->fc_nodename.u.wwn);
        fc_host_port_name(shost) = wwn_to_u64(vport->fc_portname.u.wwn);
+       fc_host_max_npiv_vports(shost) = phba->max_vpi;
 
        /* If no serial number in VPD data, use low 6 bytes of WWNN */
        /* This should be consolidated into parse_vpd ? - mr */
@@ -424,10 +425,14 @@ lpfc_config_port_post(struct lpfc_hba *phba)
                return -EIO;
        }
 
+       /* Check if the port is disabled */
+       lpfc_sli_read_link_ste(phba);
+
        /* Reset the DFT_HBA_Q_DEPTH to the max xri  */
        if (phba->cfg_hba_queue_depth > (mb->un.varRdConfig.max_xri+1))
                phba->cfg_hba_queue_depth =
-                       mb->un.varRdConfig.max_xri + 1;
+                       (mb->un.varRdConfig.max_xri + 1) -
+                                       lpfc_sli4_get_els_iocb_cnt(phba);
 
        phba->lmt = mb->un.varRdConfig.lmt;
 
@@ -522,27 +527,46 @@ lpfc_config_port_post(struct lpfc_hba *phba)
        /* Set up error attention (ERATT) polling timer */
        mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL);
 
-       lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed);
-       pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
-       lpfc_set_loopback_flag(phba);
-       rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
-       if (rc != MBX_SUCCESS) {
-               lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+       if (phba->hba_flag & LINK_DISABLED) {
+               lpfc_printf_log(phba,
+                       KERN_ERR, LOG_INIT,
+                       "2598 Adapter Link is disabled.\n");
+               lpfc_down_link(phba, pmb);
+               pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
+               rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
+               if ((rc != MBX_SUCCESS) && (rc != MBX_BUSY)) {
+                       lpfc_printf_log(phba,
+                       KERN_ERR, LOG_INIT,
+                       "2599 Adapter failed to issue DOWN_LINK"
+                       " mbox command rc 0x%x\n", rc);
+
+                       mempool_free(pmb, phba->mbox_mem_pool);
+                       return -EIO;
+               }
+       } else {
+               lpfc_init_link(phba, pmb, phba->cfg_topology,
+                       phba->cfg_link_speed);
+               pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
+               lpfc_set_loopback_flag(phba);
+               rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
+               if (rc != MBX_SUCCESS) {
+                       lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
                                "0454 Adapter failed to init, mbxCmd x%x "
                                "INIT_LINK, mbxStatus x%x\n",
                                mb->mbxCommand, mb->mbxStatus);
 
-               /* Clear all interrupt enable conditions */
-               writel(0, phba->HCregaddr);
-               readl(phba->HCregaddr); /* flush */
-               /* Clear all pending interrupts */
-               writel(0xffffffff, phba->HAregaddr);
-               readl(phba->HAregaddr); /* flush */
+                       /* Clear all interrupt enable conditions */
+                       writel(0, phba->HCregaddr);
+                       readl(phba->HCregaddr); /* flush */
+                       /* Clear all pending interrupts */
+                       writel(0xffffffff, phba->HAregaddr);
+                       readl(phba->HAregaddr); /* flush */
 
-               phba->link_state = LPFC_HBA_ERROR;
-               if (rc != MBX_BUSY)
-                       mempool_free(pmb, phba->mbox_mem_pool);
-               return -EIO;
+                       phba->link_state = LPFC_HBA_ERROR;
+                       if (rc != MBX_BUSY)
+                               mempool_free(pmb, phba->mbox_mem_pool);
+                       return -EIO;
+               }
        }
        /* MBOX buffer will be freed in mbox compl */
        pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
@@ -556,7 +580,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
                                KERN_ERR,
                                LOG_INIT,
                                "0456 Adapter failed to issue "
-                               "ASYNCEVT_ENABLE mbox status x%x \n.",
+                               "ASYNCEVT_ENABLE mbox status x%x\n",
                                rc);
                mempool_free(pmb, phba->mbox_mem_pool);
        }
@@ -570,7 +594,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
 
        if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) {
                lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "0435 Adapter failed "
-                               "to get Option ROM version status x%x\n.", rc);
+                               "to get Option ROM version status x%x\n", rc);
                mempool_free(pmb, phba->mbox_mem_pool);
        }
 
@@ -621,7 +645,7 @@ lpfc_hba_down_prep(struct lpfc_hba *phba)
  * down the SLI Layer.
  *
  * Return codes
- *   0 - sucess.
+ *   0 - success.
  *   Any other value - error.
  **/
 static int
@@ -676,7 +700,7 @@ lpfc_hba_down_post_s3(struct lpfc_hba *phba)
  * down the SLI Layer.
  *
  * Return codes
- *   0 - sucess.
+ *   0 - success.
  *   Any other value - error.
  **/
 static int
@@ -731,7 +755,7 @@ lpfc_hba_down_post_s4(struct lpfc_hba *phba)
  * uninitialization after the HBA is reset when bring down the SLI Layer.
  *
  * Return codes
- *   0 - sucess.
+ *   0 - success.
  *   Any other value - error.
  **/
 int
@@ -906,7 +930,7 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
                                        "taking this port offline.\n");
 
                        spin_lock_irq(&phba->hbalock);
-                       psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
+                       psli->sli_flag &= ~LPFC_SLI_ACTIVE;
                        spin_unlock_irq(&phba->hbalock);
 
                        lpfc_offline_prep(phba);
@@ -931,13 +955,15 @@ lpfc_offline_eratt(struct lpfc_hba *phba)
        struct lpfc_sli   *psli = &phba->sli;
 
        spin_lock_irq(&phba->hbalock);
-       psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
+       psli->sli_flag &= ~LPFC_SLI_ACTIVE;
        spin_unlock_irq(&phba->hbalock);
        lpfc_offline_prep(phba);
 
        lpfc_offline(phba);
        lpfc_reset_barrier(phba);
+       spin_lock_irq(&phba->hbalock);
        lpfc_sli_brdreset(phba);
+       spin_unlock_irq(&phba->hbalock);
        lpfc_hba_down_post(phba);
        lpfc_sli_brdready(phba, HS_MBRDY);
        lpfc_unblock_mgmt_io(phba);
@@ -980,6 +1006,16 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba)
        struct lpfc_sli_ring  *pring;
        struct lpfc_sli *psli = &phba->sli;
 
+       /* If the pci channel is offline, ignore possible errors,
+        * since we cannot communicate with the pci card anyway.
+        */
+       if (pci_channel_offline(phba->pcidev)) {
+               spin_lock_irq(&phba->hbalock);
+               phba->hba_flag &= ~DEFER_ERATT;
+               spin_unlock_irq(&phba->hbalock);
+               return;
+       }
+
        lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
                "0479 Deferred Adapter Hardware Error "
                "Data: x%x x%x x%x\n",
@@ -987,7 +1023,7 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba)
                phba->work_status[0], phba->work_status[1]);
 
        spin_lock_irq(&phba->hbalock);
-       psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
+       psli->sli_flag &= ~LPFC_SLI_ACTIVE;
        spin_unlock_irq(&phba->hbalock);
 
 
@@ -1097,7 +1133,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba)
                                phba->work_status[0], phba->work_status[1]);
 
                spin_lock_irq(&phba->hbalock);
-               psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
+               psli->sli_flag &= ~LPFC_SLI_ACTIVE;
                spin_unlock_irq(&phba->hbalock);
 
                /*
@@ -1218,7 +1254,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba)
  * routine from the API jump table function pointer from the lpfc_hba struct.
  *
  * Return codes
- *   0 - sucess.
+ *   0 - success.
  *   Any other value - error.
  **/
 void
@@ -1633,10 +1669,6 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp)
                oneConnect = 1;
                m = (typeof(m)) {"OCe10100-F", max_speed, "PCIe"};
                break;
-       case PCI_DEVICE_ID_TIGERSHARK_S:
-               oneConnect = 1;
-               m = (typeof(m)) {"OCe10100-F-S", max_speed, "PCIe"};
-               break;
        default:
                m = (typeof(m)){ NULL };
                break;
@@ -2123,6 +2155,8 @@ lpfc_online(struct lpfc_hba *phba)
                        vports[i]->fc_flag &= ~FC_OFFLINE_MODE;
                        if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)
                                vports[i]->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
+                       if (phba->sli_rev == LPFC_SLI_REV4)
+                               vports[i]->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
                        spin_unlock_irq(shost->host_lock);
                }
                lpfc_destroy_vport_work_array(phba, vports);
@@ -2797,6 +2831,7 @@ lpfc_sli4_async_link_evt(struct lpfc_hba *phba,
        att_type = lpfc_sli4_parse_latt_type(phba, acqe_link);
        if (att_type != AT_LINK_DOWN && att_type != AT_LINK_UP)
                return;
+       phba->fcoe_eventtag = acqe_link->event_tag;
        pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
        if (!pmb) {
                lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
@@ -2884,18 +2919,20 @@ lpfc_sli4_async_fcoe_evt(struct lpfc_hba *phba,
        uint8_t event_type = bf_get(lpfc_acqe_fcoe_event_type, acqe_fcoe);
        int rc;
 
+       phba->fcoe_eventtag = acqe_fcoe->event_tag;
        switch (event_type) {
        case LPFC_FCOE_EVENT_TYPE_NEW_FCF:
                lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
-                       "2546 New FCF found index 0x%x tag 0x%x \n",
+                       "2546 New FCF found index 0x%x tag 0x%x\n",
                        acqe_fcoe->fcf_index,
                        acqe_fcoe->event_tag);
                /*
-                * If the current FCF is in discovered state,
-                * do nothing.
+                * If the current FCF is in discovered state, or
+                * FCF discovery is in progress do nothing.
                 */
                spin_lock_irq(&phba->hbalock);
-               if (phba->fcf.fcf_flag & FCF_DISCOVERED) {
+               if ((phba->fcf.fcf_flag & FCF_DISCOVERED) ||
+                  (phba->hba_flag & FCF_DISC_INPROGRESS)) {
                        spin_unlock_irq(&phba->hbalock);
                        break;
                }
@@ -2912,7 +2949,7 @@ lpfc_sli4_async_fcoe_evt(struct lpfc_hba *phba,
 
        case LPFC_FCOE_EVENT_TYPE_FCF_TABLE_FULL:
                lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
-                       "2548 FCF Table full count 0x%x tag 0x%x \n",
+                       "2548 FCF Table full count 0x%x tag 0x%x\n",
                        bf_get(lpfc_acqe_fcoe_fcf_count, acqe_fcoe),
                        acqe_fcoe->event_tag);
                break;
@@ -2920,7 +2957,7 @@ lpfc_sli4_async_fcoe_evt(struct lpfc_hba *phba,
        case LPFC_FCOE_EVENT_TYPE_FCF_DEAD:
                lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
                        "2549 FCF disconnected fron network index 0x%x"
-                       " tag 0x%x \n", acqe_fcoe->fcf_index,
+                       " tag 0x%x\n", acqe_fcoe->fcf_index,
                        acqe_fcoe->event_tag);
                /* If the event is not for currently used fcf do nothing */
                if (phba->fcf.fcf_indx != acqe_fcoe->fcf_index)
@@ -3087,7 +3124,7 @@ static void lpfc_log_intr_mode(struct lpfc_hba *phba, uint32_t intr_mode)
  * PCI devices.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -3183,7 +3220,7 @@ lpfc_reset_hba(struct lpfc_hba *phba)
  * support the SLI-3 HBA device it attached to.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -3284,7 +3321,7 @@ lpfc_sli_driver_resource_unset(struct lpfc_hba *phba)
  * support the SLI-4 HBA device it attached to.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -3530,6 +3567,7 @@ lpfc_sli4_driver_resource_unset(struct lpfc_hba *phba)
 
        /* Free the allocated rpi headers. */
        lpfc_sli4_remove_rpi_hdrs(phba);
+       lpfc_sli4_remove_rpis(phba);
 
        /* Free the ELS sgl list */
        lpfc_free_active_sgl(phba);
@@ -3604,7 +3642,7 @@ lpfc_init_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp)
  * device specific resource setup to support the HBA device it attached to.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -3650,7 +3688,7 @@ lpfc_setup_driver_resource_phase1(struct lpfc_hba *phba)
  * device specific resource setup to support the HBA device it attached to.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -3715,7 +3753,7 @@ lpfc_free_iocb_list(struct lpfc_hba *phba)
  * list and set up the IOCB tag array accordingly.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -3834,7 +3872,7 @@ lpfc_free_active_sgl(struct lpfc_hba *phba)
  * list and set up the sgl xritag tag array accordingly.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -3948,7 +3986,7 @@ out_free_mem:
  * enabled and the driver is reinitializing the device.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -4108,7 +4146,7 @@ lpfc_sli4_remove_rpi_hdrs(struct lpfc_hba *phba)
  * PCI device data structure is set.
  *
  * Return codes
- *      pointer to @phba - sucessful
+ *      pointer to @phba - successful
  *      NULL - error
  **/
 static struct lpfc_hba *
@@ -4119,8 +4157,7 @@ lpfc_hba_alloc(struct pci_dev *pdev)
        /* Allocate memory for HBA structure */
        phba = kzalloc(sizeof(struct lpfc_hba), GFP_KERNEL);
        if (!phba) {
-               lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
-                               "1417 Failed to allocate hba struct.\n");
+               dev_err(&pdev->dev, "failed to allocate hba struct\n");
                return NULL;
        }
 
@@ -4134,6 +4171,9 @@ lpfc_hba_alloc(struct pci_dev *pdev)
                return NULL;
        }
 
+       mutex_init(&phba->ct_event_mutex);
+       INIT_LIST_HEAD(&phba->ct_ev_waiters);
+
        return phba;
 }
 
@@ -4162,7 +4202,7 @@ lpfc_hba_free(struct lpfc_hba *phba)
  * host with it.
  *
  * Return codes
- *      0 - sucessful
+ *      0 - successful
  *      other values - error
  **/
 static int
@@ -4325,7 +4365,7 @@ lpfc_post_init_setup(struct lpfc_hba *phba)
  * with SLI-3 interface spec.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -4478,23 +4518,6 @@ lpfc_sli4_post_status_check(struct lpfc_hba *phba)
        if (!phba->sli4_hba.STAregaddr)
                return -ENODEV;
 
-       /* With uncoverable error, log the error message and return error */
-       onlnreg0 = readl(phba->sli4_hba.ONLINE0regaddr);
-       onlnreg1 = readl(phba->sli4_hba.ONLINE1regaddr);
-       if ((onlnreg0 != LPFC_ONLINE_NERR) || (onlnreg1 != LPFC_ONLINE_NERR)) {
-               uerrlo_reg.word0 = readl(phba->sli4_hba.UERRLOregaddr);
-               uerrhi_reg.word0 = readl(phba->sli4_hba.UERRHIregaddr);
-               if (uerrlo_reg.word0 || uerrhi_reg.word0) {
-                       lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
-                                       "1422 HBA Unrecoverable error: "
-                                       "uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, "
-                                       "online0_reg=0x%x, online1_reg=0x%x\n",
-                                       uerrlo_reg.word0, uerrhi_reg.word0,
-                                       onlnreg0, onlnreg1);
-               }
-               return -ENODEV;
-       }
-
        /* Wait up to 30 seconds for the SLI Port POST done and ready */
        for (i = 0; i < 3000; i++) {
                sta_reg.word0 = readl(phba->sli4_hba.STAregaddr);
@@ -4534,6 +4557,23 @@ lpfc_sli4_post_status_check(struct lpfc_hba *phba)
                        bf_get(lpfc_scratchpad_featurelevel1, &scratchpad),
                        bf_get(lpfc_scratchpad_featurelevel2, &scratchpad));
 
+       /* With uncoverable error, log the error message and return error */
+       onlnreg0 = readl(phba->sli4_hba.ONLINE0regaddr);
+       onlnreg1 = readl(phba->sli4_hba.ONLINE1regaddr);
+       if ((onlnreg0 != LPFC_ONLINE_NERR) || (onlnreg1 != LPFC_ONLINE_NERR)) {
+               uerrlo_reg.word0 = readl(phba->sli4_hba.UERRLOregaddr);
+               uerrhi_reg.word0 = readl(phba->sli4_hba.UERRHIregaddr);
+               if (uerrlo_reg.word0 || uerrhi_reg.word0) {
+                       lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+                                       "1422 HBA Unrecoverable error: "
+                                       "uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, "
+                                       "online0_reg=0x%x, online1_reg=0x%x\n",
+                                       uerrlo_reg.word0, uerrhi_reg.word0,
+                                       onlnreg0, onlnreg1);
+               }
+               return -ENODEV;
+       }
+
        return port_error;
 }
 
@@ -4622,7 +4662,7 @@ lpfc_sli4_bar2_register_memmap(struct lpfc_hba *phba, uint32_t vf)
  * this routine.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     ENOMEM - could not allocated memory.
  **/
 static int
@@ -4721,7 +4761,7 @@ lpfc_destroy_bootstrap_mbox(struct lpfc_hba *phba)
  * allocation for the port.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -4821,7 +4861,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba)
  * HBA consistent with the SLI-4 interface spec.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -4870,7 +4910,7 @@ lpfc_setup_endian_order(struct lpfc_hba *phba)
  * we just use some constant number as place holder.
  *
  * Return codes
- *      0 - sucessful
+ *      0 - successful
  *      ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -5178,7 +5218,7 @@ out_error:
  * operation.
  *
  * Return codes
- *      0 - sucessful
+ *      0 - successful
  *      ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -5246,7 +5286,7 @@ lpfc_sli4_queue_destroy(struct lpfc_hba *phba)
  * operation.
  *
  * Return codes
- *      0 - sucessful
+ *      0 - successful
  *      ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -5512,7 +5552,7 @@ out_error:
  * operation.
  *
  * Return codes
- *      0 - sucessful
+ *      0 - successful
  *      ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -5559,7 +5599,7 @@ lpfc_sli4_queue_unset(struct lpfc_hba *phba)
  * Later, this can be used for all the slow-path events.
  *
  * Return codes
- *      0 - sucessful
+ *      0 - successful
  *      -ENOMEM - No availble memory
  **/
 static int
@@ -5720,7 +5760,7 @@ lpfc_sli4_cq_event_release_all(struct lpfc_hba *phba)
  * all resources assigned to the PCI function which originates this request.
  *
  * Return codes
- *      0 - sucessful
+ *      0 - successful
  *      ENOMEM - No availble memory
  *      EIO - The mailbox failed to complete successfully.
  **/
@@ -5883,7 +5923,7 @@ lpfc_sli4_fcfi_unreg(struct lpfc_hba *phba, uint16_t fcfi)
  * with SLI-4 interface spec.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -6012,7 +6052,7 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
  * will be left with MSI-X enabled and leaks its vectors.
  *
  * Return codes
- *   0 - sucessful
+ *   0 - successful
  *   other values - error
  **/
 static int
@@ -6144,7 +6184,7 @@ lpfc_sli_disable_msix(struct lpfc_hba *phba)
  * is done in this function.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  */
 static int
@@ -6203,7 +6243,7 @@ lpfc_sli_disable_msi(struct lpfc_hba *phba)
  * MSI-X -> MSI -> IRQ.
  *
  * Return codes
- *   0 - sucessful
+ *   0 - successful
  *   other values - error
  **/
 static uint32_t
@@ -6293,7 +6333,7 @@ lpfc_sli_disable_intr(struct lpfc_hba *phba)
  * enabled and leaks its vectors.
  *
  * Return codes
- * 0 - sucessful
+ * 0 - successful
  * other values - error
  **/
 static int
@@ -6403,7 +6443,7 @@ lpfc_sli4_disable_msix(struct lpfc_hba *phba)
  * which is done in this function.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static int
@@ -6468,7 +6508,7 @@ lpfc_sli4_disable_msi(struct lpfc_hba *phba)
  * MSI-X -> MSI -> IRQ.
  *
  * Return codes
- *     0 - sucessful
+ *     0 - successful
  *     other values - error
  **/
 static uint32_t
@@ -7171,16 +7211,19 @@ lpfc_sli4_get_els_iocb_cnt(struct lpfc_hba *phba)
 {
        int max_xri = phba->sli4_hba.max_cfg_param.max_xri;
 
-       if (max_xri <= 100)
-               return 4;
-       else if (max_xri <= 256)
-               return 8;
-       else if (max_xri <= 512)
-               return 16;
-       else if (max_xri <= 1024)
-               return 32;
-       else
-               return 48;
+       if (phba->sli_rev == LPFC_SLI_REV4) {
+               if (max_xri <= 100)
+                       return 4;
+               else if (max_xri <= 256)
+                       return 8;
+               else if (max_xri <= 512)
+                       return 16;
+               else if (max_xri <= 1024)
+                       return 32;
+               else
+                       return 48;
+       } else
+               return 0;
 }
 
 /**
@@ -7333,6 +7376,9 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
        /* Perform post initialization setup */
        lpfc_post_init_setup(phba);
 
+       /* Check if there are static vports to be created. */
+       lpfc_create_static_vport(phba);
+
        return 0;
 
 out_disable_intr:
@@ -7622,20 +7668,17 @@ static int __devinit
 lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
 {
        int rc;
-       uint16_t dev_id;
+       struct lpfc_sli_intf intf;
 
-       if (pci_read_config_word(pdev, PCI_DEVICE_ID, &dev_id))
+       if (pci_read_config_dword(pdev, LPFC_SLIREV_CONF_WORD, &intf.word0))
                return -ENODEV;
 
-       switch (dev_id) {
-       case PCI_DEVICE_ID_TIGERSHARK:
-       case PCI_DEVICE_ID_TIGERSHARK_S:
+       if ((bf_get(lpfc_sli_intf_valid, &intf) == LPFC_SLI_INTF_VALID) &&
+               (bf_get(lpfc_sli_intf_rev, &intf) == LPFC_SLIREV_CONF_SLI4))
                rc = lpfc_pci_probe_one_s4(pdev, pid);
-               break;
-       default:
+       else
                rc = lpfc_pci_probe_one_s3(pdev, pid);
-               break;
-       }
+
        return rc;
 }
 
@@ -7928,8 +7971,6 @@ static struct pci_device_id lpfc_id_table[] = {
                PCI_ANY_ID, PCI_ANY_ID, },
        {PCI_VENDOR_ID_SERVERENGINE, PCI_DEVICE_ID_TIGERSHARK,
                PCI_ANY_ID, PCI_ANY_ID, },
-       {PCI_VENDOR_ID_SERVERENGINE, PCI_DEVICE_ID_TIGERSHARK_S,
-               PCI_ANY_ID, PCI_ANY_ID, },
        { 0 }
 };