aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hbadisc.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2009-05-22 14:50:54 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-08 12:18:10 -0400
commit3772a99175f5378b5001e8da364341a8b8226a4a (patch)
treedd710f890c5bc097c874ad1783cd26ea56e88f57 /drivers/scsi/lpfc/lpfc_hbadisc.c
parenta366695592ebc9151dd5a248681270f0925d8324 (diff)
[SCSI] lpfc 8.3.2 : Reorganization for SLI4
Preps the organization of the driver so that the bottom half, which interacts with the hardware, can share common code sequences for attachment, detachment, initialization, teardown, etc with new hardware. For very common code sections, which become specific to the interface type, the driver uses an indirect function call. The function is set at initialization. For less common sections, such as initialization, the driver looks at the interface type and calls the routines relative to the interface. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c69
1 files changed, 38 insertions, 31 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index e764ce0bf704..25fc96c9081f 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -555,23 +555,24 @@ lpfc_work_done(struct lpfc_hba *phba)
555 /* 555 /*
556 * Turn on Ring interrupts 556 * Turn on Ring interrupts
557 */ 557 */
558 spin_lock_irq(&phba->hbalock); 558 if (phba->sli_rev <= LPFC_SLI_REV3) {
559 control = readl(phba->HCregaddr); 559 spin_lock_irq(&phba->hbalock);
560 if (!(control & (HC_R0INT_ENA << LPFC_ELS_RING))) { 560 control = readl(phba->HCregaddr);
561 lpfc_debugfs_slow_ring_trc(phba, 561 if (!(control & (HC_R0INT_ENA << LPFC_ELS_RING))) {
562 "WRK Enable ring: cntl:x%x hacopy:x%x", 562 lpfc_debugfs_slow_ring_trc(phba,
563 control, ha_copy, 0); 563 "WRK Enable ring: cntl:x%x hacopy:x%x",
564 564 control, ha_copy, 0);
565 control |= (HC_R0INT_ENA << LPFC_ELS_RING); 565
566 writel(control, phba->HCregaddr); 566 control |= (HC_R0INT_ENA << LPFC_ELS_RING);
567 readl(phba->HCregaddr); /* flush */ 567 writel(control, phba->HCregaddr);
568 } 568 readl(phba->HCregaddr); /* flush */
569 else { 569 } else {
570 lpfc_debugfs_slow_ring_trc(phba, 570 lpfc_debugfs_slow_ring_trc(phba,
571 "WRK Ring ok: cntl:x%x hacopy:x%x", 571 "WRK Ring ok: cntl:x%x hacopy:x%x",
572 control, ha_copy, 0); 572 control, ha_copy, 0);
573 }
574 spin_unlock_irq(&phba->hbalock);
573 } 575 }
574 spin_unlock_irq(&phba->hbalock);
575 } 576 }
576 lpfc_work_list_done(phba); 577 lpfc_work_list_done(phba);
577} 578}
@@ -689,7 +690,7 @@ lpfc_port_link_failure(struct lpfc_vport *vport)
689 lpfc_can_disctmo(vport); 690 lpfc_can_disctmo(vport);
690} 691}
691 692
692static void 693void
693lpfc_linkdown_port(struct lpfc_vport *vport) 694lpfc_linkdown_port(struct lpfc_vport *vport)
694{ 695{
695 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 696 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
@@ -1147,10 +1148,12 @@ lpfc_enable_la(struct lpfc_hba *phba)
1147 struct lpfc_sli *psli = &phba->sli; 1148 struct lpfc_sli *psli = &phba->sli;
1148 spin_lock_irq(&phba->hbalock); 1149 spin_lock_irq(&phba->hbalock);
1149 psli->sli_flag |= LPFC_PROCESS_LA; 1150 psli->sli_flag |= LPFC_PROCESS_LA;
1150 control = readl(phba->HCregaddr); 1151 if (phba->sli_rev <= LPFC_SLI_REV3) {
1151 control |= HC_LAINT_ENA; 1152 control = readl(phba->HCregaddr);
1152 writel(control, phba->HCregaddr); 1153 control |= HC_LAINT_ENA;
1153 readl(phba->HCregaddr); /* flush */ 1154 writel(control, phba->HCregaddr);
1155 readl(phba->HCregaddr); /* flush */
1156 }
1154 spin_unlock_irq(&phba->hbalock); 1157 spin_unlock_irq(&phba->hbalock);
1155} 1158}
1156 1159
@@ -2919,11 +2922,13 @@ restart_disc:
2919 * set port_state to PORT_READY if SLI2. 2922 * set port_state to PORT_READY if SLI2.
2920 * cmpl_reg_vpi will set port_state to READY for SLI3. 2923 * cmpl_reg_vpi will set port_state to READY for SLI3.
2921 */ 2924 */
2922 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) 2925 if (phba->sli_rev < LPFC_SLI_REV4) {
2923 lpfc_issue_reg_vpi(phba, vport); 2926 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)
2924 else { /* NPIV Not enabled */ 2927 lpfc_issue_reg_vpi(phba, vport);
2925 lpfc_issue_clear_la(phba, vport); 2928 else { /* NPIV Not enabled */
2926 vport->port_state = LPFC_VPORT_READY; 2929 lpfc_issue_clear_la(phba, vport);
2930 vport->port_state = LPFC_VPORT_READY;
2931 }
2927 } 2932 }
2928 2933
2929 /* Setup and issue mailbox INITIALIZE LINK command */ 2934 /* Setup and issue mailbox INITIALIZE LINK command */
@@ -2959,11 +2964,13 @@ restart_disc:
2959 * set port_state to PORT_READY if SLI2. 2964 * set port_state to PORT_READY if SLI2.
2960 * cmpl_reg_vpi will set port_state to READY for SLI3. 2965 * cmpl_reg_vpi will set port_state to READY for SLI3.
2961 */ 2966 */
2962 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) 2967 if (phba->sli_rev < LPFC_SLI_REV4) {
2963 lpfc_issue_reg_vpi(phba, vport); 2968 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)
2964 else { /* NPIV Not enabled */ 2969 lpfc_issue_reg_vpi(phba, vport);
2965 lpfc_issue_clear_la(phba, vport); 2970 else { /* NPIV Not enabled */
2966 vport->port_state = LPFC_VPORT_READY; 2971 lpfc_issue_clear_la(phba, vport);
2972 vport->port_state = LPFC_VPORT_READY;
2973 }
2967 } 2974 }
2968 break; 2975 break;
2969 2976