aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-12-06 10:01:18 -0500
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-12-06 10:01:18 -0500
commit4796b71fbb907ce6b8a9acf1852d3646a80b4576 (patch)
tree6263f165446c581efdbb760205c1f85378fe6259 /drivers/scsi/lpfc/lpfc_els.c
parent6d5aefb8eaa38e44b5b8cf60c812aceafc02d924 (diff)
parentec0bf39a471bf6fcd01def2bd677128cea940b73 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/pcmcia/ds.c Fix up merge failures with Linus's head and fix new compile failures. Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 71864cdc6c71..a5f33a0dd4e7 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -243,6 +243,7 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp,
243 struct serv_parm *sp, IOCB_t *irsp) 243 struct serv_parm *sp, IOCB_t *irsp)
244{ 244{
245 LPFC_MBOXQ_t *mbox; 245 LPFC_MBOXQ_t *mbox;
246 struct lpfc_dmabuf *mp;
246 int rc; 247 int rc;
247 248
248 spin_lock_irq(phba->host->host_lock); 249 spin_lock_irq(phba->host->host_lock);
@@ -307,10 +308,14 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp,
307 308
308 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT | MBX_STOP_IOCB); 309 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT | MBX_STOP_IOCB);
309 if (rc == MBX_NOT_FINISHED) 310 if (rc == MBX_NOT_FINISHED)
310 goto fail_free_mbox; 311 goto fail_issue_reg_login;
311 312
312 return 0; 313 return 0;
313 314
315 fail_issue_reg_login:
316 mp = (struct lpfc_dmabuf *) mbox->context1;
317 lpfc_mbuf_free(phba, mp->virt, mp->phys);
318 kfree(mp);
314 fail_free_mbox: 319 fail_free_mbox:
315 mempool_free(mbox, phba->mbox_mem_pool); 320 mempool_free(mbox, phba->mbox_mem_pool);
316 fail: 321 fail:
@@ -657,6 +662,12 @@ lpfc_plogi_confirm_nport(struct lpfc_hba * phba, struct lpfc_dmabuf *prsp,
657 uint8_t name[sizeof (struct lpfc_name)]; 662 uint8_t name[sizeof (struct lpfc_name)];
658 uint32_t rc; 663 uint32_t rc;
659 664
665 /* Fabric nodes can have the same WWPN so we don't bother searching
666 * by WWPN. Just return the ndlp that was given to us.
667 */
668 if (ndlp->nlp_type & NLP_FABRIC)
669 return ndlp;
670
660 lp = (uint32_t *) prsp->virt; 671 lp = (uint32_t *) prsp->virt;
661 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); 672 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t));
662 memset(name, 0, sizeof (struct lpfc_name)); 673 memset(name, 0, sizeof (struct lpfc_name));
@@ -1122,7 +1133,7 @@ lpfc_cmpl_els_adisc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
1122 mempool_free(mbox, 1133 mempool_free(mbox,
1123 phba->mbox_mem_pool); 1134 phba->mbox_mem_pool);
1124 lpfc_disc_flush_list(phba); 1135 lpfc_disc_flush_list(phba);
1125 psli->ring[(psli->ip_ring)]. 1136 psli->ring[(psli->extra_ring)].
1126 flag &= 1137 flag &=
1127 ~LPFC_STOP_IOCB_EVENT; 1138 ~LPFC_STOP_IOCB_EVENT;
1128 psli->ring[(psli->fcp_ring)]. 1139 psli->ring[(psli->fcp_ring)].
@@ -1851,6 +1862,7 @@ lpfc_cmpl_els_acc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
1851 IOCB_t *irsp; 1862 IOCB_t *irsp;
1852 struct lpfc_nodelist *ndlp; 1863 struct lpfc_nodelist *ndlp;
1853 LPFC_MBOXQ_t *mbox = NULL; 1864 LPFC_MBOXQ_t *mbox = NULL;
1865 struct lpfc_dmabuf *mp;
1854 1866
1855 irsp = &rspiocb->iocb; 1867 irsp = &rspiocb->iocb;
1856 1868
@@ -1862,6 +1874,11 @@ lpfc_cmpl_els_acc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
1862 /* Check to see if link went down during discovery */ 1874 /* Check to see if link went down during discovery */
1863 if ((lpfc_els_chk_latt(phba)) || !ndlp) { 1875 if ((lpfc_els_chk_latt(phba)) || !ndlp) {
1864 if (mbox) { 1876 if (mbox) {
1877 mp = (struct lpfc_dmabuf *) mbox->context1;
1878 if (mp) {
1879 lpfc_mbuf_free(phba, mp->virt, mp->phys);
1880 kfree(mp);
1881 }
1865 mempool_free( mbox, phba->mbox_mem_pool); 1882 mempool_free( mbox, phba->mbox_mem_pool);
1866 } 1883 }
1867 goto out; 1884 goto out;
@@ -1893,9 +1910,7 @@ lpfc_cmpl_els_acc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
1893 } 1910 }
1894 /* NOTE: we should have messages for unsuccessful 1911 /* NOTE: we should have messages for unsuccessful
1895 reglogin */ 1912 reglogin */
1896 mempool_free( mbox, phba->mbox_mem_pool);
1897 } else { 1913 } else {
1898 mempool_free( mbox, phba->mbox_mem_pool);
1899 /* Do not call NO_LIST for lpfc_els_abort'ed ELS cmds */ 1914 /* Do not call NO_LIST for lpfc_els_abort'ed ELS cmds */
1900 if (!((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && 1915 if (!((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) &&
1901 ((irsp->un.ulpWord[4] == IOERR_SLI_ABORTED) || 1916 ((irsp->un.ulpWord[4] == IOERR_SLI_ABORTED) ||
@@ -1907,6 +1922,12 @@ lpfc_cmpl_els_acc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb,
1907 } 1922 }
1908 } 1923 }
1909 } 1924 }
1925 mp = (struct lpfc_dmabuf *) mbox->context1;
1926 if (mp) {
1927 lpfc_mbuf_free(phba, mp->virt, mp->phys);
1928 kfree(mp);
1929 }
1930 mempool_free(mbox, phba->mbox_mem_pool);
1910 } 1931 }
1911out: 1932out:
1912 if (ndlp) { 1933 if (ndlp) {
@@ -2644,6 +2665,7 @@ lpfc_els_handle_rscn(struct lpfc_hba * phba)
2644 ndlp->nlp_type |= NLP_FABRIC; 2665 ndlp->nlp_type |= NLP_FABRIC;
2645 ndlp->nlp_prev_state = ndlp->nlp_state; 2666 ndlp->nlp_prev_state = ndlp->nlp_state;
2646 ndlp->nlp_state = NLP_STE_PLOGI_ISSUE; 2667 ndlp->nlp_state = NLP_STE_PLOGI_ISSUE;
2668 lpfc_nlp_list(phba, ndlp, NLP_PLOGI_LIST);
2647 lpfc_issue_els_plogi(phba, NameServer_DID, 0); 2669 lpfc_issue_els_plogi(phba, NameServer_DID, 0);
2648 /* Wait for NameServer login cmpl before we can 2670 /* Wait for NameServer login cmpl before we can
2649 continue */ 2671 continue */
@@ -3039,7 +3061,7 @@ lpfc_els_rcv_farp(struct lpfc_hba * phba,
3039 /* FARP-REQ received from DID <did> */ 3061 /* FARP-REQ received from DID <did> */
3040 lpfc_printf_log(phba, 3062 lpfc_printf_log(phba,
3041 KERN_INFO, 3063 KERN_INFO,
3042 LOG_IP, 3064 LOG_ELS,
3043 "%d:0601 FARP-REQ received from DID x%x\n", 3065 "%d:0601 FARP-REQ received from DID x%x\n",
3044 phba->brd_no, did); 3066 phba->brd_no, did);
3045 3067
@@ -3101,7 +3123,7 @@ lpfc_els_rcv_farpr(struct lpfc_hba * phba,
3101 /* FARP-RSP received from DID <did> */ 3123 /* FARP-RSP received from DID <did> */
3102 lpfc_printf_log(phba, 3124 lpfc_printf_log(phba,
3103 KERN_INFO, 3125 KERN_INFO,
3104 LOG_IP, 3126 LOG_ELS,
3105 "%d:0600 FARP-RSP received from DID x%x\n", 3127 "%d:0600 FARP-RSP received from DID x%x\n",
3106 phba->brd_no, did); 3128 phba->brd_no, did);
3107 3129