aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.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_els.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_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c84
1 files changed, 27 insertions, 57 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index b8b34cf5c3d2..8c5c3aea4a19 100644
--- 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 *vport)
84 uint32_t ha_copy; 84 uint32_t ha_copy;
85 85
86 if (vport->port_state >= LPFC_VPORT_READY || 86 if (vport->port_state >= LPFC_VPORT_READY ||
87 phba->link_state == LPFC_LINK_DOWN) 87 phba->link_state == LPFC_LINK_DOWN ||
88 phba->sli_rev > LPFC_SLI_REV3)
88 return 0; 89 return 0;
89 90
90 /* Read the HBA Host Attention Register */ 91 /* Read the HBA Host Attention Register */
@@ -305,7 +306,7 @@ els_iocb_free_pcmb_exit:
305 * 0 - successfully issued fabric registration login for @vport 306 * 0 - successfully issued fabric registration login for @vport
306 * -ENXIO -- failed to issue fabric registration login for @vport 307 * -ENXIO -- failed to issue fabric registration login for @vport
307 **/ 308 **/
308static int 309int
309lpfc_issue_fabric_reglogin(struct lpfc_vport *vport) 310lpfc_issue_fabric_reglogin(struct lpfc_vport *vport)
310{ 311{
311 struct lpfc_hba *phba = vport->phba; 312 struct lpfc_hba *phba = vport->phba;
@@ -345,8 +346,7 @@ lpfc_issue_fabric_reglogin(struct lpfc_vport *vport)
345 err = 4; 346 err = 4;
346 goto fail; 347 goto fail;
347 } 348 }
348 rc = lpfc_reg_login(phba, vport->vpi, Fabric_DID, (uint8_t *)sp, mbox, 349 rc = lpfc_reg_rpi(phba, vport->vpi, Fabric_DID, (uint8_t *)sp, mbox, 0);
349 0);
350 if (rc) { 350 if (rc) {
351 err = 5; 351 err = 5;
352 goto fail_free_mbox; 352 goto fail_free_mbox;
@@ -1350,14 +1350,12 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry)
1350 IOCB_t *icmd; 1350 IOCB_t *icmd;
1351 struct lpfc_nodelist *ndlp; 1351 struct lpfc_nodelist *ndlp;
1352 struct lpfc_iocbq *elsiocb; 1352 struct lpfc_iocbq *elsiocb;
1353 struct lpfc_sli_ring *pring;
1354 struct lpfc_sli *psli; 1353 struct lpfc_sli *psli;
1355 uint8_t *pcmd; 1354 uint8_t *pcmd;
1356 uint16_t cmdsize; 1355 uint16_t cmdsize;
1357 int ret; 1356 int ret;
1358 1357
1359 psli = &phba->sli; 1358 psli = &phba->sli;
1360 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
1361 1359
1362 ndlp = lpfc_findnode_did(vport, did); 1360 ndlp = lpfc_findnode_did(vport, did);
1363 if (ndlp && !NLP_CHK_NODE_ACT(ndlp)) 1361 if (ndlp && !NLP_CHK_NODE_ACT(ndlp))
@@ -1391,7 +1389,7 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry)
1391 1389
1392 phba->fc_stat.elsXmitPLOGI++; 1390 phba->fc_stat.elsXmitPLOGI++;
1393 elsiocb->iocb_cmpl = lpfc_cmpl_els_plogi; 1391 elsiocb->iocb_cmpl = lpfc_cmpl_els_plogi;
1394 ret = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 1392 ret = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);
1395 1393
1396 if (ret == IOCB_ERROR) { 1394 if (ret == IOCB_ERROR) {
1397 lpfc_els_free_iocb(phba, elsiocb); 1395 lpfc_els_free_iocb(phba, elsiocb);
@@ -1501,14 +1499,9 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1501 PRLI *npr; 1499 PRLI *npr;
1502 IOCB_t *icmd; 1500 IOCB_t *icmd;
1503 struct lpfc_iocbq *elsiocb; 1501 struct lpfc_iocbq *elsiocb;
1504 struct lpfc_sli_ring *pring;
1505 struct lpfc_sli *psli;
1506 uint8_t *pcmd; 1502 uint8_t *pcmd;
1507 uint16_t cmdsize; 1503 uint16_t cmdsize;
1508 1504
1509 psli = &phba->sli;
1510 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
1511
1512 cmdsize = (sizeof(uint32_t) + sizeof(PRLI)); 1505 cmdsize = (sizeof(uint32_t) + sizeof(PRLI));
1513 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, 1506 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
1514 ndlp->nlp_DID, ELS_CMD_PRLI); 1507 ndlp->nlp_DID, ELS_CMD_PRLI);
@@ -1550,7 +1543,8 @@ lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1550 spin_lock_irq(shost->host_lock); 1543 spin_lock_irq(shost->host_lock);
1551 ndlp->nlp_flag |= NLP_PRLI_SND; 1544 ndlp->nlp_flag |= NLP_PRLI_SND;
1552 spin_unlock_irq(shost->host_lock); 1545 spin_unlock_irq(shost->host_lock);
1553 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { 1546 if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) ==
1547 IOCB_ERROR) {
1554 spin_lock_irq(shost->host_lock); 1548 spin_lock_irq(shost->host_lock);
1555 ndlp->nlp_flag &= ~NLP_PRLI_SND; 1549 ndlp->nlp_flag &= ~NLP_PRLI_SND;
1556 spin_unlock_irq(shost->host_lock); 1550 spin_unlock_irq(shost->host_lock);
@@ -1788,8 +1782,6 @@ lpfc_issue_els_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1788 ADISC *ap; 1782 ADISC *ap;
1789 IOCB_t *icmd; 1783 IOCB_t *icmd;
1790 struct lpfc_iocbq *elsiocb; 1784 struct lpfc_iocbq *elsiocb;
1791 struct lpfc_sli *psli = &phba->sli;
1792 struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING];
1793 uint8_t *pcmd; 1785 uint8_t *pcmd;
1794 uint16_t cmdsize; 1786 uint16_t cmdsize;
1795 1787
@@ -1822,7 +1814,8 @@ lpfc_issue_els_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1822 spin_lock_irq(shost->host_lock); 1814 spin_lock_irq(shost->host_lock);
1823 ndlp->nlp_flag |= NLP_ADISC_SND; 1815 ndlp->nlp_flag |= NLP_ADISC_SND;
1824 spin_unlock_irq(shost->host_lock); 1816 spin_unlock_irq(shost->host_lock);
1825 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { 1817 if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) ==
1818 IOCB_ERROR) {
1826 spin_lock_irq(shost->host_lock); 1819 spin_lock_irq(shost->host_lock);
1827 ndlp->nlp_flag &= ~NLP_ADISC_SND; 1820 ndlp->nlp_flag &= ~NLP_ADISC_SND;
1828 spin_unlock_irq(shost->host_lock); 1821 spin_unlock_irq(shost->host_lock);
@@ -1937,15 +1930,10 @@ lpfc_issue_els_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1937 struct lpfc_hba *phba = vport->phba; 1930 struct lpfc_hba *phba = vport->phba;
1938 IOCB_t *icmd; 1931 IOCB_t *icmd;
1939 struct lpfc_iocbq *elsiocb; 1932 struct lpfc_iocbq *elsiocb;
1940 struct lpfc_sli_ring *pring;
1941 struct lpfc_sli *psli;
1942 uint8_t *pcmd; 1933 uint8_t *pcmd;
1943 uint16_t cmdsize; 1934 uint16_t cmdsize;
1944 int rc; 1935 int rc;
1945 1936
1946 psli = &phba->sli;
1947 pring = &psli->ring[LPFC_ELS_RING];
1948
1949 spin_lock_irq(shost->host_lock); 1937 spin_lock_irq(shost->host_lock);
1950 if (ndlp->nlp_flag & NLP_LOGO_SND) { 1938 if (ndlp->nlp_flag & NLP_LOGO_SND) {
1951 spin_unlock_irq(shost->host_lock); 1939 spin_unlock_irq(shost->host_lock);
@@ -1978,7 +1966,7 @@ lpfc_issue_els_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1978 spin_lock_irq(shost->host_lock); 1966 spin_lock_irq(shost->host_lock);
1979 ndlp->nlp_flag |= NLP_LOGO_SND; 1967 ndlp->nlp_flag |= NLP_LOGO_SND;
1980 spin_unlock_irq(shost->host_lock); 1968 spin_unlock_irq(shost->host_lock);
1981 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 1969 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);
1982 1970
1983 if (rc == IOCB_ERROR) { 1971 if (rc == IOCB_ERROR) {
1984 spin_lock_irq(shost->host_lock); 1972 spin_lock_irq(shost->host_lock);
@@ -2058,14 +2046,12 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2058 struct lpfc_hba *phba = vport->phba; 2046 struct lpfc_hba *phba = vport->phba;
2059 IOCB_t *icmd; 2047 IOCB_t *icmd;
2060 struct lpfc_iocbq *elsiocb; 2048 struct lpfc_iocbq *elsiocb;
2061 struct lpfc_sli_ring *pring;
2062 struct lpfc_sli *psli; 2049 struct lpfc_sli *psli;
2063 uint8_t *pcmd; 2050 uint8_t *pcmd;
2064 uint16_t cmdsize; 2051 uint16_t cmdsize;
2065 struct lpfc_nodelist *ndlp; 2052 struct lpfc_nodelist *ndlp;
2066 2053
2067 psli = &phba->sli; 2054 psli = &phba->sli;
2068 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
2069 cmdsize = (sizeof(uint32_t) + sizeof(SCR)); 2055 cmdsize = (sizeof(uint32_t) + sizeof(SCR));
2070 2056
2071 ndlp = lpfc_findnode_did(vport, nportid); 2057 ndlp = lpfc_findnode_did(vport, nportid);
@@ -2108,7 +2094,8 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2108 2094
2109 phba->fc_stat.elsXmitSCR++; 2095 phba->fc_stat.elsXmitSCR++;
2110 elsiocb->iocb_cmpl = lpfc_cmpl_els_cmd; 2096 elsiocb->iocb_cmpl = lpfc_cmpl_els_cmd;
2111 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { 2097 if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) ==
2098 IOCB_ERROR) {
2112 /* The additional lpfc_nlp_put will cause the following 2099 /* The additional lpfc_nlp_put will cause the following
2113 * lpfc_els_free_iocb routine to trigger the rlease of 2100 * lpfc_els_free_iocb routine to trigger the rlease of
2114 * the node. 2101 * the node.
@@ -2152,7 +2139,6 @@ lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2152 struct lpfc_hba *phba = vport->phba; 2139 struct lpfc_hba *phba = vport->phba;
2153 IOCB_t *icmd; 2140 IOCB_t *icmd;
2154 struct lpfc_iocbq *elsiocb; 2141 struct lpfc_iocbq *elsiocb;
2155 struct lpfc_sli_ring *pring;
2156 struct lpfc_sli *psli; 2142 struct lpfc_sli *psli;
2157 FARP *fp; 2143 FARP *fp;
2158 uint8_t *pcmd; 2144 uint8_t *pcmd;
@@ -2162,7 +2148,6 @@ lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2162 struct lpfc_nodelist *ndlp; 2148 struct lpfc_nodelist *ndlp;
2163 2149
2164 psli = &phba->sli; 2150 psli = &phba->sli;
2165 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
2166 cmdsize = (sizeof(uint32_t) + sizeof(FARP)); 2151 cmdsize = (sizeof(uint32_t) + sizeof(FARP));
2167 2152
2168 ndlp = lpfc_findnode_did(vport, nportid); 2153 ndlp = lpfc_findnode_did(vport, nportid);
@@ -2219,7 +2204,8 @@ lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry)
2219 2204
2220 phba->fc_stat.elsXmitFARPR++; 2205 phba->fc_stat.elsXmitFARPR++;
2221 elsiocb->iocb_cmpl = lpfc_cmpl_els_cmd; 2206 elsiocb->iocb_cmpl = lpfc_cmpl_els_cmd;
2222 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { 2207 if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) ==
2208 IOCB_ERROR) {
2223 /* The additional lpfc_nlp_put will cause the following 2209 /* The additional lpfc_nlp_put will cause the following
2224 * lpfc_els_free_iocb routine to trigger the release of 2210 * lpfc_els_free_iocb routine to trigger the release of
2225 * the node. 2211 * the node.
@@ -2961,6 +2947,7 @@ lpfc_mbx_cmpl_dflt_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
2961 */ 2947 */
2962 lpfc_nlp_not_used(ndlp); 2948 lpfc_nlp_not_used(ndlp);
2963 } 2949 }
2950
2964 return; 2951 return;
2965} 2952}
2966 2953
@@ -3170,7 +3157,6 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
3170 IOCB_t *icmd; 3157 IOCB_t *icmd;
3171 IOCB_t *oldcmd; 3158 IOCB_t *oldcmd;
3172 struct lpfc_iocbq *elsiocb; 3159 struct lpfc_iocbq *elsiocb;
3173 struct lpfc_sli_ring *pring;
3174 struct lpfc_sli *psli; 3160 struct lpfc_sli *psli;
3175 uint8_t *pcmd; 3161 uint8_t *pcmd;
3176 uint16_t cmdsize; 3162 uint16_t cmdsize;
@@ -3178,7 +3164,6 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
3178 ELS_PKT *els_pkt_ptr; 3164 ELS_PKT *els_pkt_ptr;
3179 3165
3180 psli = &phba->sli; 3166 psli = &phba->sli;
3181 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
3182 oldcmd = &oldiocb->iocb; 3167 oldcmd = &oldiocb->iocb;
3183 3168
3184 switch (flag) { 3169 switch (flag) {
@@ -3266,7 +3251,7 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
3266 } 3251 }
3267 3252
3268 phba->fc_stat.elsXmitACC++; 3253 phba->fc_stat.elsXmitACC++;
3269 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 3254 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);
3270 if (rc == IOCB_ERROR) { 3255 if (rc == IOCB_ERROR) {
3271 lpfc_els_free_iocb(phba, elsiocb); 3256 lpfc_els_free_iocb(phba, elsiocb);
3272 return 1; 3257 return 1;
@@ -3305,15 +3290,12 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
3305 IOCB_t *icmd; 3290 IOCB_t *icmd;
3306 IOCB_t *oldcmd; 3291 IOCB_t *oldcmd;
3307 struct lpfc_iocbq *elsiocb; 3292 struct lpfc_iocbq *elsiocb;
3308 struct lpfc_sli_ring *pring;
3309 struct lpfc_sli *psli; 3293 struct lpfc_sli *psli;
3310 uint8_t *pcmd; 3294 uint8_t *pcmd;
3311 uint16_t cmdsize; 3295 uint16_t cmdsize;
3312 int rc; 3296 int rc;
3313 3297
3314 psli = &phba->sli; 3298 psli = &phba->sli;
3315 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
3316
3317 cmdsize = 2 * sizeof(uint32_t); 3299 cmdsize = 2 * sizeof(uint32_t);
3318 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, 3300 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
3319 ndlp->nlp_DID, ELS_CMD_LS_RJT); 3301 ndlp->nlp_DID, ELS_CMD_LS_RJT);
@@ -3346,7 +3328,7 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
3346 3328
3347 phba->fc_stat.elsXmitLSRJT++; 3329 phba->fc_stat.elsXmitLSRJT++;
3348 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 3330 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
3349 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 3331 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);
3350 3332
3351 if (rc == IOCB_ERROR) { 3333 if (rc == IOCB_ERROR) {
3352 lpfc_els_free_iocb(phba, elsiocb); 3334 lpfc_els_free_iocb(phba, elsiocb);
@@ -3379,8 +3361,6 @@ lpfc_els_rsp_adisc_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
3379 struct lpfc_nodelist *ndlp) 3361 struct lpfc_nodelist *ndlp)
3380{ 3362{
3381 struct lpfc_hba *phba = vport->phba; 3363 struct lpfc_hba *phba = vport->phba;
3382 struct lpfc_sli *psli = &phba->sli;
3383 struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING];
3384 ADISC *ap; 3364 ADISC *ap;
3385 IOCB_t *icmd, *oldcmd; 3365 IOCB_t *icmd, *oldcmd;
3386 struct lpfc_iocbq *elsiocb; 3366 struct lpfc_iocbq *elsiocb;
@@ -3422,7 +3402,7 @@ lpfc_els_rsp_adisc_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
3422 3402
3423 phba->fc_stat.elsXmitACC++; 3403 phba->fc_stat.elsXmitACC++;
3424 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 3404 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
3425 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 3405 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);
3426 if (rc == IOCB_ERROR) { 3406 if (rc == IOCB_ERROR) {
3427 lpfc_els_free_iocb(phba, elsiocb); 3407 lpfc_els_free_iocb(phba, elsiocb);
3428 return 1; 3408 return 1;
@@ -3459,14 +3439,12 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
3459 IOCB_t *icmd; 3439 IOCB_t *icmd;
3460 IOCB_t *oldcmd; 3440 IOCB_t *oldcmd;
3461 struct lpfc_iocbq *elsiocb; 3441 struct lpfc_iocbq *elsiocb;
3462 struct lpfc_sli_ring *pring;
3463 struct lpfc_sli *psli; 3442 struct lpfc_sli *psli;
3464 uint8_t *pcmd; 3443 uint8_t *pcmd;
3465 uint16_t cmdsize; 3444 uint16_t cmdsize;
3466 int rc; 3445 int rc;
3467 3446
3468 psli = &phba->sli; 3447 psli = &phba->sli;
3469 pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */
3470 3448
3471 cmdsize = sizeof(uint32_t) + sizeof(PRLI); 3449 cmdsize = sizeof(uint32_t) + sizeof(PRLI);
3472 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, 3450 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
@@ -3520,7 +3498,7 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
3520 phba->fc_stat.elsXmitACC++; 3498 phba->fc_stat.elsXmitACC++;
3521 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 3499 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
3522 3500
3523 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 3501 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);
3524 if (rc == IOCB_ERROR) { 3502 if (rc == IOCB_ERROR) {
3525 lpfc_els_free_iocb(phba, elsiocb); 3503 lpfc_els_free_iocb(phba, elsiocb);
3526 return 1; 3504 return 1;
@@ -3562,15 +3540,12 @@ lpfc_els_rsp_rnid_acc(struct lpfc_vport *vport, uint8_t format,
3562 RNID *rn; 3540 RNID *rn;
3563 IOCB_t *icmd, *oldcmd; 3541 IOCB_t *icmd, *oldcmd;
3564 struct lpfc_iocbq *elsiocb; 3542 struct lpfc_iocbq *elsiocb;
3565 struct lpfc_sli_ring *pring;
3566 struct lpfc_sli *psli; 3543 struct lpfc_sli *psli;
3567 uint8_t *pcmd; 3544 uint8_t *pcmd;
3568 uint16_t cmdsize; 3545 uint16_t cmdsize;
3569 int rc; 3546 int rc;
3570 3547
3571 psli = &phba->sli; 3548 psli = &phba->sli;
3572 pring = &psli->ring[LPFC_ELS_RING];
3573
3574 cmdsize = sizeof(uint32_t) + sizeof(uint32_t) 3549 cmdsize = sizeof(uint32_t) + sizeof(uint32_t)
3575 + (2 * sizeof(struct lpfc_name)); 3550 + (2 * sizeof(struct lpfc_name));
3576 if (format) 3551 if (format)
@@ -3626,7 +3601,7 @@ lpfc_els_rsp_rnid_acc(struct lpfc_vport *vport, uint8_t format,
3626 elsiocb->context1 = NULL; /* Don't need ndlp for cmpl, 3601 elsiocb->context1 = NULL; /* Don't need ndlp for cmpl,
3627 * it could be freed */ 3602 * it could be freed */
3628 3603
3629 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 3604 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0);
3630 if (rc == IOCB_ERROR) { 3605 if (rc == IOCB_ERROR) {
3631 lpfc_els_free_iocb(phba, elsiocb); 3606 lpfc_els_free_iocb(phba, elsiocb);
3632 return 1; 3607 return 1;
@@ -4440,8 +4415,6 @@ lpfc_els_rcv_lirr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
4440static void 4415static void
4441lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) 4416lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
4442{ 4417{
4443 struct lpfc_sli *psli = &phba->sli;
4444 struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING];
4445 MAILBOX_t *mb; 4418 MAILBOX_t *mb;
4446 IOCB_t *icmd; 4419 IOCB_t *icmd;
4447 RPS_RSP *rps_rsp; 4420 RPS_RSP *rps_rsp;
@@ -4507,7 +4480,7 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
4507 ndlp->nlp_rpi); 4480 ndlp->nlp_rpi);
4508 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 4481 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
4509 phba->fc_stat.elsXmitACC++; 4482 phba->fc_stat.elsXmitACC++;
4510 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) 4483 if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) == IOCB_ERROR)
4511 lpfc_els_free_iocb(phba, elsiocb); 4484 lpfc_els_free_iocb(phba, elsiocb);
4512 return; 4485 return;
4513} 4486}
@@ -4616,8 +4589,6 @@ lpfc_els_rsp_rpl_acc(struct lpfc_vport *vport, uint16_t cmdsize,
4616 IOCB_t *icmd, *oldcmd; 4589 IOCB_t *icmd, *oldcmd;
4617 RPL_RSP rpl_rsp; 4590 RPL_RSP rpl_rsp;
4618 struct lpfc_iocbq *elsiocb; 4591 struct lpfc_iocbq *elsiocb;
4619 struct lpfc_sli *psli = &phba->sli;
4620 struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING];
4621 uint8_t *pcmd; 4592 uint8_t *pcmd;
4622 4593
4623 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, 4594 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
@@ -4654,7 +4625,8 @@ lpfc_els_rsp_rpl_acc(struct lpfc_vport *vport, uint16_t cmdsize,
4654 ndlp->nlp_rpi); 4625 ndlp->nlp_rpi);
4655 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 4626 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
4656 phba->fc_stat.elsXmitACC++; 4627 phba->fc_stat.elsXmitACC++;
4657 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { 4628 if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) ==
4629 IOCB_ERROR) {
4658 lpfc_els_free_iocb(phba, elsiocb); 4630 lpfc_els_free_iocb(phba, elsiocb);
4659 return 1; 4631 return 1;
4660 } 4632 }
@@ -6139,7 +6111,6 @@ lpfc_issue_els_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
6139{ 6111{
6140 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 6112 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
6141 struct lpfc_hba *phba = vport->phba; 6113 struct lpfc_hba *phba = vport->phba;
6142 struct lpfc_sli_ring *pring = &phba->sli.ring[LPFC_ELS_RING];
6143 IOCB_t *icmd; 6114 IOCB_t *icmd;
6144 struct lpfc_iocbq *elsiocb; 6115 struct lpfc_iocbq *elsiocb;
6145 uint8_t *pcmd; 6116 uint8_t *pcmd;
@@ -6169,7 +6140,8 @@ lpfc_issue_els_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
6169 spin_lock_irq(shost->host_lock); 6140 spin_lock_irq(shost->host_lock);
6170 ndlp->nlp_flag |= NLP_LOGO_SND; 6141 ndlp->nlp_flag |= NLP_LOGO_SND;
6171 spin_unlock_irq(shost->host_lock); 6142 spin_unlock_irq(shost->host_lock);
6172 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { 6143 if (lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0) ==
6144 IOCB_ERROR) {
6173 spin_lock_irq(shost->host_lock); 6145 spin_lock_irq(shost->host_lock);
6174 ndlp->nlp_flag &= ~NLP_LOGO_SND; 6146 ndlp->nlp_flag &= ~NLP_LOGO_SND;
6175 spin_unlock_irq(shost->host_lock); 6147 spin_unlock_irq(shost->host_lock);
@@ -6224,7 +6196,6 @@ lpfc_resume_fabric_iocbs(struct lpfc_hba *phba)
6224 struct lpfc_iocbq *iocb; 6196 struct lpfc_iocbq *iocb;
6225 unsigned long iflags; 6197 unsigned long iflags;
6226 int ret; 6198 int ret;
6227 struct lpfc_sli_ring *pring = &phba->sli.ring[LPFC_ELS_RING];
6228 IOCB_t *cmd; 6199 IOCB_t *cmd;
6229 6200
6230repeat: 6201repeat:
@@ -6248,7 +6219,7 @@ repeat:
6248 "Fabric sched1: ste:x%x", 6219 "Fabric sched1: ste:x%x",
6249 iocb->vport->port_state, 0, 0); 6220 iocb->vport->port_state, 0, 0);
6250 6221
6251 ret = lpfc_sli_issue_iocb(phba, pring, iocb, 0); 6222 ret = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, iocb, 0);
6252 6223
6253 if (ret == IOCB_ERROR) { 6224 if (ret == IOCB_ERROR) {
6254 iocb->iocb_cmpl = iocb->fabric_iocb_cmpl; 6225 iocb->iocb_cmpl = iocb->fabric_iocb_cmpl;
@@ -6394,7 +6365,6 @@ static int
6394lpfc_issue_fabric_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *iocb) 6365lpfc_issue_fabric_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *iocb)
6395{ 6366{
6396 unsigned long iflags; 6367 unsigned long iflags;
6397 struct lpfc_sli_ring *pring = &phba->sli.ring[LPFC_ELS_RING];
6398 int ready; 6368 int ready;
6399 int ret; 6369 int ret;
6400 6370
@@ -6418,7 +6388,7 @@ lpfc_issue_fabric_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *iocb)
6418 "Fabric sched2: ste:x%x", 6388 "Fabric sched2: ste:x%x",
6419 iocb->vport->port_state, 0, 0); 6389 iocb->vport->port_state, 0, 0);
6420 6390
6421 ret = lpfc_sli_issue_iocb(phba, pring, iocb, 0); 6391 ret = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, iocb, 0);
6422 6392
6423 if (ret == IOCB_ERROR) { 6393 if (ret == IOCB_ERROR) {
6424 iocb->iocb_cmpl = iocb->fabric_iocb_cmpl; 6394 iocb->iocb_cmpl = iocb->fabric_iocb_cmpl;