Skip to contentSkip to conversation

lpfc 8.3.2 : Reorganization for SLI4 - Part 1 of 3

PATCH New James Smart 1 participant 1 message May 22, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/17 lpfc 8.3.2 : Reorganization for SLI4 - Part 1 of 3

Reorganization for SLI4 - Part 1 of 3

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.

---

 lpfc.h         |   72 +-
 lpfc_debugfs.c |   17 
 lpfc_els.c     |    8 
 lpfc_hbadisc.c |   69 +
 lpfc_init.c    | 1981 ++++++++++++++++++++++++++++++++++++++++++---------------
 5 files changed, 1595 insertions(+), 552 deletions(-)
drivers/scsi/lpfc/lpfc_debugfs.c +11 -6
diff -upNr a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -280,6 +280,8 @@ lpfc_debugfs_hbqinfo_data(struct lpfc_hb
 	struct lpfc_dmabuf *d_buf;
 	struct hbq_dmabuf *hbq_buf;
 
+	if (phba->sli_rev != 3)
+		return 0;
 	cnt = LPFC_HBQINFO_SIZE;
 	spin_lock_irq(&phba->hbalock);
 
@@ -489,12 +491,15 @@ lpfc_debugfs_dumpHostSlim_data(struct lp
 				 pring->next_cmdidx, pring->local_getidx,
 				 pring->flag, pgpp->rspPutInx, pring->numRiocb);
 	}
-	word0 = readl(phba->HAregaddr);
-	word1 = readl(phba->CAregaddr);
-	word2 = readl(phba->HSregaddr);
-	word3 = readl(phba->HCregaddr);
-	len +=  snprintf(buf+len, size-len, "HA:%08x CA:%08x HS:%08x HC:%08x\n",
-	word0, word1, word2, word3);
+
+	if (phba->sli_rev <= LPFC_SLI_REV3) {
+		word0 = readl(phba->HAregaddr);
+		word1 = readl(phba->CAregaddr);
+		word2 = readl(phba->HSregaddr);
+		word3 = readl(phba->HCregaddr);
+		len +=  snprintf(buf+len, size-len, "HA:%08x CA:%08x HS:%08x "
+				 "HC:%08x\n", word0, word1, word2, word3);
+	}
 	spin_unlock_irq(&phba->hbalock);
 	return len;
 }
drivers/scsi/lpfc/lpfc_els.c +4 -4
diff -upNr a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
@@ -84,7 +84,8 @@ lpfc_els_chk_latt(struct lpfc_vport *vpo
 	uint32_t ha_copy;
 
 	if (vport->port_state >= LPFC_VPORT_READY ||
-	    phba->link_state == LPFC_LINK_DOWN)
+	    phba->link_state == LPFC_LINK_DOWN ||
+	    phba->sli_rev > LPFC_SLI_REV3)
 		return 0;
 
 	/* Read the HBA Host Attention Register */
@@ -305,7 +306,7 @@ els_iocb_free_pcmb_exit:
  *   0 - successfully issued fabric registration login for @vport
  *   -ENXIO -- failed to issue fabric registration login for @vport
  **/
-static int
+int
 lpfc_issue_fabric_reglogin(struct lpfc_vport *vport)
 {
 	struct lpfc_hba  *phba = vport->phba;
@@ -345,8 +346,7 @@ lpfc_issue_fabric_reglogin(struct lpfc_v
 		err = 4;
 		goto fail;
 	}
-	rc = lpfc_reg_login(phba, vport->vpi, Fabric_DID, (uint8_t *)sp, mbox,
-			    0);
+	rc = lpfc_reg_rpi(phba, vport->vpi, Fabric_DID, (uint8_t *)sp, mbox, 0);
 	if (rc) {
 		err = 5;
 		goto fail_free_mbox;
drivers/scsi/lpfc/lpfc.h +69 -3

102 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_hbadisc.c +38 -31

100 lines not on this page · raw message

drivers/scsi/lpfc/lpfc_init.c +1473 -508

2,358 lines not on this page · raw message