Lines Matching +full:x +full:- +full:rc

6  * Copyright (c) 2008-2013 Broadcom Corporation
7 * Copyright (c) 2014-2016 QLogic Corporation
8 * Copyright (c) 2016-2017 Cavium Inc.
32 int rc = 0; in bnx2fc_rrq_compl() local
35 rrq_req = cb_arg->io_req; in bnx2fc_rrq_compl()
36 orig_io_req = cb_arg->aborted_io_req; in bnx2fc_rrq_compl()
38 BNX2FC_ELS_DBG("rrq_compl: orig xid = 0x%x, rrq_xid = 0x%x\n", in bnx2fc_rrq_compl()
39 orig_io_req->xid, rrq_req->xid); in bnx2fc_rrq_compl()
41 kref_put(&orig_io_req->refcount, bnx2fc_cmd_release); in bnx2fc_rrq_compl()
43 if (test_and_clear_bit(BNX2FC_FLAG_ELS_TIMEOUT, &rrq_req->req_flags)) { in bnx2fc_rrq_compl()
48 BNX2FC_ELS_DBG("rrq xid - 0x%x timed out, clean it up\n", in bnx2fc_rrq_compl()
49 rrq_req->xid); in bnx2fc_rrq_compl()
51 if (rrq_req->on_active_queue) { in bnx2fc_rrq_compl()
52 list_del_init(&rrq_req->link); in bnx2fc_rrq_compl()
53 rrq_req->on_active_queue = 0; in bnx2fc_rrq_compl()
54 rc = bnx2fc_initiate_cleanup(rrq_req); in bnx2fc_rrq_compl()
55 BUG_ON(rc); in bnx2fc_rrq_compl()
64 struct bnx2fc_rport *tgt = aborted_io_req->tgt; in bnx2fc_send_rrq()
70 int rc; in bnx2fc_send_rrq() local
72 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) in bnx2fc_send_rrq()
73 return -EINVAL; in bnx2fc_send_rrq()
75 lport = tgt->rdata->local_port; in bnx2fc_send_rrq()
76 sid = tgt->sid; in bnx2fc_send_rrq()
77 r_a_tov = lport->r_a_tov; in bnx2fc_send_rrq()
79 BNX2FC_ELS_DBG("Sending RRQ orig_xid = 0x%x\n", in bnx2fc_send_rrq()
80 aborted_io_req->xid); in bnx2fc_send_rrq()
86 rc = -ENOMEM; in bnx2fc_send_rrq()
90 cb_arg->aborted_io_req = aborted_io_req; in bnx2fc_send_rrq()
94 rrq.rrq_ox_id = htons(aborted_io_req->xid); in bnx2fc_send_rrq()
95 rrq.rrq_rx_id = htons(aborted_io_req->task->rxwr_txrd.var_ctx.rx_id); in bnx2fc_send_rrq()
98 rc = bnx2fc_initiate_els(tgt, ELS_RRQ, &rrq, sizeof(rrq), in bnx2fc_send_rrq()
101 if (rc == -ENOMEM) { in bnx2fc_send_rrq()
104 rc = FAILED; in bnx2fc_send_rrq()
111 if (rc) { in bnx2fc_send_rrq()
112 BNX2FC_ELS_DBG("RRQ failed - release orig io req 0x%x\n", in bnx2fc_send_rrq()
113 aborted_io_req->xid); in bnx2fc_send_rrq()
115 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_send_rrq()
116 kref_put(&aborted_io_req->refcount, bnx2fc_cmd_release); in bnx2fc_send_rrq()
117 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_send_rrq()
119 return rc; in bnx2fc_send_rrq()
133 int rc = 0; in bnx2fc_l2_els_compl() local
135 l2_oxid = cb_arg->l2_oxid; in bnx2fc_l2_els_compl()
136 BNX2FC_ELS_DBG("ELS COMPL - l2_oxid = 0x%x\n", l2_oxid); in bnx2fc_l2_els_compl()
138 els_req = cb_arg->io_req; in bnx2fc_l2_els_compl()
139 if (test_and_clear_bit(BNX2FC_FLAG_ELS_TIMEOUT, &els_req->req_flags)) { in bnx2fc_l2_els_compl()
144 if (els_req->on_active_queue) { in bnx2fc_l2_els_compl()
145 list_del_init(&els_req->link); in bnx2fc_l2_els_compl()
146 els_req->on_active_queue = 0; in bnx2fc_l2_els_compl()
147 rc = bnx2fc_initiate_cleanup(els_req); in bnx2fc_l2_els_compl()
148 BUG_ON(rc); in bnx2fc_l2_els_compl()
153 tgt = els_req->tgt; in bnx2fc_l2_els_compl()
154 mp_req = &(els_req->mp_req); in bnx2fc_l2_els_compl()
155 fc_hdr = &(mp_req->resp_fc_hdr); in bnx2fc_l2_els_compl()
156 resp_len = mp_req->resp_len; in bnx2fc_l2_els_compl()
157 resp_buf = mp_req->resp_buf; in bnx2fc_l2_els_compl()
187 struct fc_lport *lport = tgt->rdata->local_port; in bnx2fc_send_adisc()
188 u32 r_a_tov = lport->r_a_tov; in bnx2fc_send_adisc()
189 int rc; in bnx2fc_send_adisc() local
195 return -ENOMEM; in bnx2fc_send_adisc()
198 cb_arg->l2_oxid = ntohs(fh->fh_ox_id); in bnx2fc_send_adisc()
200 BNX2FC_ELS_DBG("send ADISC: l2_oxid = 0x%x\n", cb_arg->l2_oxid); in bnx2fc_send_adisc()
203 rc = bnx2fc_initiate_els(tgt, ELS_ADISC, adisc, sizeof(*adisc), in bnx2fc_send_adisc()
205 if (rc) in bnx2fc_send_adisc()
207 return rc; in bnx2fc_send_adisc()
215 struct fc_lport *lport = tgt->rdata->local_port; in bnx2fc_send_logo()
216 u32 r_a_tov = lport->r_a_tov; in bnx2fc_send_logo()
217 int rc; in bnx2fc_send_logo() local
223 return -ENOMEM; in bnx2fc_send_logo()
226 cb_arg->l2_oxid = ntohs(fh->fh_ox_id); in bnx2fc_send_logo()
228 BNX2FC_ELS_DBG("Send LOGO: l2_oxid = 0x%x\n", cb_arg->l2_oxid); in bnx2fc_send_logo()
231 rc = bnx2fc_initiate_els(tgt, ELS_LOGO, logo, sizeof(*logo), in bnx2fc_send_logo()
233 if (rc) in bnx2fc_send_logo()
235 return rc; in bnx2fc_send_logo()
243 struct fc_lport *lport = tgt->rdata->local_port; in bnx2fc_send_rls()
244 u32 r_a_tov = lport->r_a_tov; in bnx2fc_send_rls()
245 int rc; in bnx2fc_send_rls() local
251 return -ENOMEM; in bnx2fc_send_rls()
254 cb_arg->l2_oxid = ntohs(fh->fh_ox_id); in bnx2fc_send_rls()
258 rc = bnx2fc_initiate_els(tgt, ELS_RLS, rls, sizeof(*rls), in bnx2fc_send_rls()
260 if (rc) in bnx2fc_send_rls()
262 return rc; in bnx2fc_send_rls()
276 int rc = 0; in bnx2fc_srr_compl() local
278 orig_io_req = cb_arg->aborted_io_req; in bnx2fc_srr_compl()
279 srr_req = cb_arg->io_req; in bnx2fc_srr_compl()
280 if (test_and_clear_bit(BNX2FC_FLAG_ELS_TIMEOUT, &srr_req->req_flags)) { in bnx2fc_srr_compl()
283 "orig_io - 0x%x\n", in bnx2fc_srr_compl()
284 orig_io_req->xid); in bnx2fc_srr_compl()
285 rc = bnx2fc_initiate_abts(srr_req); in bnx2fc_srr_compl()
286 if (rc != SUCCESS) { in bnx2fc_srr_compl()
291 if (test_bit(BNX2FC_FLAG_IO_COMPL, &orig_io_req->req_flags) || in bnx2fc_srr_compl()
292 test_bit(BNX2FC_FLAG_ISSUE_ABTS, &orig_io_req->req_flags)) { in bnx2fc_srr_compl()
293 BNX2FC_IO_DBG(srr_req, "srr_compl:xid 0x%x flags = %lx", in bnx2fc_srr_compl()
294 orig_io_req->xid, orig_io_req->req_flags); in bnx2fc_srr_compl()
297 orig_io_req->srr_retry++; in bnx2fc_srr_compl()
298 if (orig_io_req->srr_retry <= SRR_RETRY_COUNT) { in bnx2fc_srr_compl()
299 struct bnx2fc_rport *tgt = orig_io_req->tgt; in bnx2fc_srr_compl()
300 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_srr_compl()
301 rc = bnx2fc_send_srr(orig_io_req, in bnx2fc_srr_compl()
302 orig_io_req->srr_offset, in bnx2fc_srr_compl()
303 orig_io_req->srr_rctl); in bnx2fc_srr_compl()
304 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_srr_compl()
305 if (!rc) in bnx2fc_srr_compl()
309 rc = bnx2fc_initiate_abts(orig_io_req); in bnx2fc_srr_compl()
310 if (rc != SUCCESS) { in bnx2fc_srr_compl()
312 "failed xid = 0x%x. issue cleanup\n", in bnx2fc_srr_compl()
313 orig_io_req->xid); in bnx2fc_srr_compl()
318 if (test_bit(BNX2FC_FLAG_IO_COMPL, &orig_io_req->req_flags) || in bnx2fc_srr_compl()
319 test_bit(BNX2FC_FLAG_ISSUE_ABTS, &orig_io_req->req_flags)) { in bnx2fc_srr_compl()
320 BNX2FC_IO_DBG(srr_req, "srr_compl:xid - 0x%x flags = %lx", in bnx2fc_srr_compl()
321 orig_io_req->xid, orig_io_req->req_flags); in bnx2fc_srr_compl()
324 mp_req = &(srr_req->mp_req); in bnx2fc_srr_compl()
325 fc_hdr = &(mp_req->resp_fc_hdr); in bnx2fc_srr_compl()
326 resp_len = mp_req->resp_len; in bnx2fc_srr_compl()
327 resp_buf = mp_req->resp_buf; in bnx2fc_srr_compl()
355 rc = bnx2fc_initiate_abts(orig_io_req); in bnx2fc_srr_compl()
356 if (rc != SUCCESS) { in bnx2fc_srr_compl()
358 "failed xid = 0x%x. issue cleanup\n", in bnx2fc_srr_compl()
359 orig_io_req->xid); in bnx2fc_srr_compl()
364 BNX2FC_IO_DBG(srr_req, "srr compl - invalid opcode = %d\n", in bnx2fc_srr_compl()
372 kref_put(&orig_io_req->refcount, bnx2fc_cmd_release); in bnx2fc_srr_compl()
394 int rc = 0; in bnx2fc_rec_compl() local
399 rec_req = cb_arg->io_req; in bnx2fc_rec_compl()
400 orig_io_req = cb_arg->aborted_io_req; in bnx2fc_rec_compl()
401 BNX2FC_IO_DBG(rec_req, "rec_compl: orig xid = 0x%x", orig_io_req->xid); in bnx2fc_rec_compl()
402 tgt = orig_io_req->tgt; in bnx2fc_rec_compl()
405 if (test_and_clear_bit(BNX2FC_FLAG_ELS_TIMEOUT, &rec_req->req_flags)) { in bnx2fc_rec_compl()
407 "orig_io - 0x%x\n", in bnx2fc_rec_compl()
408 orig_io_req->xid); in bnx2fc_rec_compl()
410 rc = bnx2fc_initiate_abts(rec_req); in bnx2fc_rec_compl()
411 if (rc != SUCCESS) { in bnx2fc_rec_compl()
416 orig_io_req->rec_retry++; in bnx2fc_rec_compl()
418 if (orig_io_req->rec_retry <= REC_RETRY_COUNT) { in bnx2fc_rec_compl()
419 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_rec_compl()
420 rc = bnx2fc_send_rec(orig_io_req); in bnx2fc_rec_compl()
421 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_rec_compl()
422 if (!rc) in bnx2fc_rec_compl()
425 rc = bnx2fc_initiate_abts(orig_io_req); in bnx2fc_rec_compl()
426 if (rc != SUCCESS) { in bnx2fc_rec_compl()
428 "failed xid = 0x%x. issue cleanup\n", in bnx2fc_rec_compl()
429 orig_io_req->xid); in bnx2fc_rec_compl()
435 if (test_bit(BNX2FC_FLAG_IO_COMPL, &orig_io_req->req_flags)) { in bnx2fc_rec_compl()
437 "orig_io - 0x%x\n", in bnx2fc_rec_compl()
438 orig_io_req->xid); in bnx2fc_rec_compl()
441 if (test_bit(BNX2FC_FLAG_ISSUE_ABTS, &orig_io_req->req_flags)) { in bnx2fc_rec_compl()
443 "orig_io - 0x%x\n", in bnx2fc_rec_compl()
444 orig_io_req->xid); in bnx2fc_rec_compl()
448 mp_req = &(rec_req->mp_req); in bnx2fc_rec_compl()
449 fc_hdr = &(mp_req->resp_fc_hdr); in bnx2fc_rec_compl()
450 resp_len = mp_req->resp_len; in bnx2fc_rec_compl()
451 acc = resp_buf = mp_req->resp_buf; in bnx2fc_rec_compl()
477 if ((rjt->er_reason == ELS_RJT_LOGIC || in bnx2fc_rec_compl()
478 rjt->er_reason == ELS_RJT_UNAB) && in bnx2fc_rec_compl()
479 rjt->er_explan == ELS_EXPL_OXID_RXID) { in bnx2fc_rec_compl()
484 new_io_req->sc_cmd = orig_io_req->sc_cmd; in bnx2fc_rec_compl()
487 &orig_io_req->req_flags); in bnx2fc_rec_compl()
491 rc = bnx2fc_post_io_req(tgt, new_io_req); in bnx2fc_rec_compl()
492 if (!rc) in bnx2fc_rec_compl()
497 rc = bnx2fc_initiate_abts(orig_io_req); in bnx2fc_rec_compl()
498 if (rc != SUCCESS) { in bnx2fc_rec_compl()
505 offset = ntohl(acc->reca_fc4value); in bnx2fc_rec_compl()
506 e_stat = ntohl(acc->reca_e_stat); in bnx2fc_rec_compl()
511 BNX2FC_IO_DBG(rec_req, "e_stat = 0x%x, offset = 0x%x\n", in bnx2fc_rec_compl()
515 &orig_io_req->err_entry; in bnx2fc_rec_compl()
516 sc_cmd = orig_io_req->sc_cmd; in bnx2fc_rec_compl()
517 if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) { in bnx2fc_rec_compl()
519 if (offset == orig_io_req->data_xfer_len) { in bnx2fc_rec_compl()
520 BNX2FC_IO_DBG(rec_req, "WRITE - resp lost\n"); in bnx2fc_rec_compl()
536 if (err_entry->data.rx_buf_off == in bnx2fc_rec_compl()
537 orig_io_req->data_xfer_len) { in bnx2fc_rec_compl()
539 BNX2FC_IO_DBG(rec_req, "READ - resp lost\n"); in bnx2fc_rec_compl()
545 offset = err_entry->data.rx_buf_off; in bnx2fc_rec_compl()
555 rc = bnx2fc_initiate_abts(orig_io_req); in bnx2fc_rec_compl()
556 if (rc != SUCCESS) { in bnx2fc_rec_compl()
562 BNX2FC_IO_DBG(rec_req, "Send SRR - FCP_RSP\n"); in bnx2fc_rec_compl()
563 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_rec_compl()
564 rc = bnx2fc_send_srr(orig_io_req, offset, r_ctl); in bnx2fc_rec_compl()
565 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_rec_compl()
567 if (rc) { in bnx2fc_rec_compl()
578 kref_put(&orig_io_req->refcount, bnx2fc_cmd_release); in bnx2fc_rec_compl()
585 struct bnx2fc_rport *tgt = orig_io_req->tgt; in bnx2fc_send_rec()
586 struct fc_lport *lport = tgt->rdata->local_port; in bnx2fc_send_rec()
588 u32 sid = tgt->sid; in bnx2fc_send_rec()
589 u32 r_a_tov = lport->r_a_tov; in bnx2fc_send_rec()
590 int rc; in bnx2fc_send_rec() local
598 rc = -ENOMEM; in bnx2fc_send_rec()
601 kref_get(&orig_io_req->refcount); in bnx2fc_send_rec()
603 cb_arg->aborted_io_req = orig_io_req; in bnx2fc_send_rec()
607 rec.rec_ox_id = htons(orig_io_req->xid); in bnx2fc_send_rec()
608 rec.rec_rx_id = htons(orig_io_req->task->rxwr_txrd.var_ctx.rx_id); in bnx2fc_send_rec()
610 rc = bnx2fc_initiate_els(tgt, ELS_REC, &rec, sizeof(rec), in bnx2fc_send_rec()
613 if (rc) { in bnx2fc_send_rec()
614 BNX2FC_IO_DBG(orig_io_req, "REC failed - release\n"); in bnx2fc_send_rec()
615 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_send_rec()
616 kref_put(&orig_io_req->refcount, bnx2fc_cmd_release); in bnx2fc_send_rec()
617 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_send_rec()
621 return rc; in bnx2fc_send_rec()
627 struct bnx2fc_rport *tgt = orig_io_req->tgt; in bnx2fc_send_srr()
628 struct fc_lport *lport = tgt->rdata->local_port; in bnx2fc_send_srr()
630 u32 r_a_tov = lport->r_a_tov; in bnx2fc_send_srr()
631 int rc; in bnx2fc_send_srr() local
639 rc = -ENOMEM; in bnx2fc_send_srr()
642 kref_get(&orig_io_req->refcount); in bnx2fc_send_srr()
644 cb_arg->aborted_io_req = orig_io_req; in bnx2fc_send_srr()
647 srr.srr_ox_id = htons(orig_io_req->xid); in bnx2fc_send_srr()
648 srr.srr_rx_id = htons(orig_io_req->task->rxwr_txrd.var_ctx.rx_id); in bnx2fc_send_srr()
651 orig_io_req->srr_offset = offset; in bnx2fc_send_srr()
652 orig_io_req->srr_rctl = r_ctl; in bnx2fc_send_srr()
654 rc = bnx2fc_initiate_els(tgt, ELS_SRR, &srr, sizeof(srr), in bnx2fc_send_srr()
657 if (rc) { in bnx2fc_send_srr()
658 BNX2FC_IO_DBG(orig_io_req, "SRR failed - release\n"); in bnx2fc_send_srr()
659 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_send_srr()
660 kref_put(&orig_io_req->refcount, bnx2fc_cmd_release); in bnx2fc_send_srr()
661 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_send_srr()
664 set_bit(BNX2FC_FLAG_SRR_SENT, &orig_io_req->req_flags); in bnx2fc_send_srr()
667 return rc; in bnx2fc_send_srr()
675 struct fcoe_port *port = tgt->port; in bnx2fc_initiate_els()
676 struct bnx2fc_interface *interface = port->priv; in bnx2fc_initiate_els()
677 struct fc_rport *rport = tgt->rport; in bnx2fc_initiate_els()
678 struct fc_lport *lport = port->lport; in bnx2fc_initiate_els()
684 int rc = 0; in bnx2fc_initiate_els() local
689 rc = fc_remote_port_chkready(rport); in bnx2fc_initiate_els()
690 if (rc) { in bnx2fc_initiate_els()
691 printk(KERN_ERR PFX "els 0x%x: rport not ready\n", op); in bnx2fc_initiate_els()
692 rc = -EINVAL; in bnx2fc_initiate_els()
695 if (lport->state != LPORT_ST_READY || !(lport->link_up)) { in bnx2fc_initiate_els()
696 printk(KERN_ERR PFX "els 0x%x: link is not ready\n", op); in bnx2fc_initiate_els()
697 rc = -EINVAL; in bnx2fc_initiate_els()
700 if (!(test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags))) { in bnx2fc_initiate_els()
701 printk(KERN_ERR PFX "els 0x%x: tgt not ready\n", op); in bnx2fc_initiate_els()
702 rc = -EINVAL; in bnx2fc_initiate_els()
707 rc = -ENOMEM; in bnx2fc_initiate_els()
711 els_req->sc_cmd = NULL; in bnx2fc_initiate_els()
712 els_req->port = port; in bnx2fc_initiate_els()
713 els_req->tgt = tgt; in bnx2fc_initiate_els()
714 els_req->cb_func = cb_func; in bnx2fc_initiate_els()
715 cb_arg->io_req = els_req; in bnx2fc_initiate_els()
716 els_req->cb_arg = cb_arg; in bnx2fc_initiate_els()
717 els_req->data_xfer_len = data_len; in bnx2fc_initiate_els()
719 mp_req = (struct bnx2fc_mp_req *)&(els_req->mp_req); in bnx2fc_initiate_els()
720 rc = bnx2fc_init_mp_req(els_req); in bnx2fc_initiate_els()
721 if (rc == FAILED) { in bnx2fc_initiate_els()
723 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_initiate_els()
724 kref_put(&els_req->refcount, bnx2fc_cmd_release); in bnx2fc_initiate_els()
725 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_els()
726 rc = -ENOMEM; in bnx2fc_initiate_els()
729 /* rc SUCCESS */ in bnx2fc_initiate_els()
730 rc = 0; in bnx2fc_initiate_els()
734 mp_req->req_len = data_len; in bnx2fc_initiate_els()
735 els_req->data_xfer_len = mp_req->req_len; in bnx2fc_initiate_els()
739 memcpy(mp_req->req_buf, data, data_len); in bnx2fc_initiate_els()
741 printk(KERN_ERR PFX "Invalid ELS op 0x%x\n", op); in bnx2fc_initiate_els()
742 els_req->cb_func = NULL; in bnx2fc_initiate_els()
743 els_req->cb_arg = NULL; in bnx2fc_initiate_els()
744 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_initiate_els()
745 kref_put(&els_req->refcount, bnx2fc_cmd_release); in bnx2fc_initiate_els()
746 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_els()
747 rc = -EINVAL; in bnx2fc_initiate_els()
750 if (rc) in bnx2fc_initiate_els()
754 fc_hdr = &(mp_req->req_fc_hdr); in bnx2fc_initiate_els()
756 did = tgt->rport->port_id; in bnx2fc_initiate_els()
757 sid = tgt->sid; in bnx2fc_initiate_els()
769 xid = els_req->xid; in bnx2fc_initiate_els()
775 interface->hba->task_ctx[task_idx]; in bnx2fc_initiate_els()
779 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_initiate_els()
781 if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) { in bnx2fc_initiate_els()
783 els_req->cb_func = NULL; in bnx2fc_initiate_els()
784 els_req->cb_arg = NULL; in bnx2fc_initiate_els()
785 kref_put(&els_req->refcount, bnx2fc_cmd_release); in bnx2fc_initiate_els()
786 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_els()
787 return -EINVAL; in bnx2fc_initiate_els()
794 els_req->on_active_queue = 1; in bnx2fc_initiate_els()
795 list_add_tail(&els_req->link, &tgt->els_queue); in bnx2fc_initiate_els()
799 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_initiate_els()
802 return rc; in bnx2fc_initiate_els()
813 BNX2FC_ELS_DBG("Entered process_els_compl xid = 0x%x" in bnx2fc_process_els_compl()
814 "cmd_type = %d\n", els_req->xid, els_req->cmd_type); in bnx2fc_process_els_compl()
817 &els_req->req_flags)) { in bnx2fc_process_els_compl()
819 "els - 0x%x\n", els_req->xid); in bnx2fc_process_els_compl()
821 kref_put(&els_req->refcount, bnx2fc_cmd_release); in bnx2fc_process_els_compl()
826 if (cancel_delayed_work(&els_req->timeout_work)) in bnx2fc_process_els_compl()
827 kref_put(&els_req->refcount, in bnx2fc_process_els_compl()
830 if (els_req->on_active_queue) { in bnx2fc_process_els_compl()
831 list_del_init(&els_req->link); in bnx2fc_process_els_compl()
832 els_req->on_active_queue = 0; in bnx2fc_process_els_compl()
835 mp_req = &(els_req->mp_req); in bnx2fc_process_els_compl()
836 fc_hdr = &(mp_req->resp_fc_hdr); in bnx2fc_process_els_compl()
840 &task->rxwr_only.union_ctx.comp_info.mp_rsp.fc_hdr; in bnx2fc_process_els_compl()
845 mp_req->resp_len = in bnx2fc_process_els_compl()
846 task->rxwr_only.union_ctx.comp_info.mp_rsp.mp_payload_len; in bnx2fc_process_els_compl()
849 if ((els_req->cb_func) && (els_req->cb_arg)) { in bnx2fc_process_els_compl()
850 els_req->cb_func(els_req->cb_arg); in bnx2fc_process_els_compl()
851 els_req->cb_arg = NULL; in bnx2fc_process_els_compl()
854 kref_put(&els_req->refcount, bnx2fc_cmd_release); in bnx2fc_process_els_compl()
865 struct fc_lport *lport = exch->lp; in bnx2fc_flogi_resp()
877 granted_mac = fr_cb(fp)->granted_mac; in bnx2fc_flogi_resp()
883 * If granted_mac is non-zero, we use that. in bnx2fc_flogi_resp()
885 * the sel_fcf->fc_map and the d_id fo the FLOGI frame. in bnx2fc_flogi_resp()
886 * If sel_fcf->fc_map is 0, then we use the default FCF-MAC plus the in bnx2fc_flogi_resp()
892 } else if (fip->sel_fcf && fip->sel_fcf->fc_map != 0) { in bnx2fc_flogi_resp()
893 hton24(fc_map, fip->sel_fcf->fc_map); in bnx2fc_flogi_resp()
897 fcoe_mac[3] = fh->fh_d_id[0]; in bnx2fc_flogi_resp()
898 fcoe_mac[4] = fh->fh_d_id[1]; in bnx2fc_flogi_resp()
899 fcoe_mac[5] = fh->fh_d_id[2]; in bnx2fc_flogi_resp()
902 fc_fcoe_set_mac(fcoe_mac, fh->fh_d_id); in bnx2fc_flogi_resp()
907 fip->update_mac(lport, fcoe_mac); in bnx2fc_flogi_resp()
917 struct fc_lport *lport = exch->lp; in bnx2fc_logo_resp()
921 fip->update_mac(lport, zero_mac); in bnx2fc_logo_resp()
933 struct bnx2fc_interface *interface = port->priv; in bnx2fc_elsct_send()
944 if (ntoh24(fh->fh_d_id) != FC_FID_FLOGI) in bnx2fc_elsct_send()