Lines Matching refs:fcport

12 static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op,  in qedf_initiate_els()  argument
32 if (!fcport) { in qedf_initiate_els()
38 qedf = fcport->qedf; in qedf_initiate_els()
43 rc = fc_remote_port_chkready(fcport->rport); in qedf_initiate_els()
56 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_initiate_els()
63 els_req = qedf_alloc_cmd(fcport, QEDF_ELS); in qedf_initiate_els()
81 els_req->fcport = fcport; in qedf_initiate_els()
118 did = fcport->rdata->ids.port_id; in qedf_initiate_els()
119 sid = fcport->sid; in qedf_initiate_els()
128 spin_lock_irqsave(&fcport->rport_lock, flags); in qedf_initiate_els()
130 sqe_idx = qedf_get_sqe_idx(fcport); in qedf_initiate_els()
131 sqe = &fcport->sq[sqe_idx]; in qedf_initiate_els()
145 qedf_ring_doorbell(fcport); in qedf_initiate_els()
146 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_initiate_els()
190 qedf = rrq_req->fcport->qedf; in qedf_rrq_compl()
229 struct qedf_rport *fcport; in qedf_send_rrq() local
242 fcport = aborted_io_req->fcport; in qedf_send_rrq()
245 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_send_rrq()
250 if (!fcport->qedf) { in qedf_send_rrq()
255 qedf = fcport->qedf; in qedf_send_rrq()
257 sid = fcport->sid; in qedf_send_rrq()
281 rc = qedf_initiate_els(fcport, ELS_RRQ, &rrq, sizeof(rrq), in qedf_send_rrq()
294 static void qedf_process_l2_frame_compl(struct qedf_rport *fcport, in qedf_process_l2_frame_compl() argument
298 struct fc_lport *lport = fcport->qedf->lport; in qedf_process_l2_frame_compl()
314 hton24(fh->fh_s_id, fcport->rdata->ids.port_id); in qedf_process_l2_frame_compl()
333 void qedf_restart_rport(struct qedf_rport *fcport) in qedf_restart_rport() argument
339 if (!fcport) in qedf_restart_rport()
342 if (test_bit(QEDF_RPORT_IN_RESET, &fcport->flags) || in qedf_restart_rport()
343 !test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags) || in qedf_restart_rport()
344 test_bit(QEDF_RPORT_UPLOADING_CONNECTION, &fcport->flags)) { in qedf_restart_rport()
345 QEDF_ERR(&(fcport->qedf->dbg_ctx), "fcport %p already in reset or not offloaded.\n", in qedf_restart_rport()
346 fcport); in qedf_restart_rport()
351 set_bit(QEDF_RPORT_IN_RESET, &fcport->flags); in qedf_restart_rport()
353 rdata = fcport->rdata; in qedf_restart_rport()
355 lport = fcport->qedf->lport; in qedf_restart_rport()
357 QEDF_ERR(&(fcport->qedf->dbg_ctx), in qedf_restart_rport()
365 clear_bit(QEDF_RPORT_IN_RESET, &fcport->flags); in qedf_restart_rport()
371 struct qedf_rport *fcport; in qedf_l2_els_compl() local
394 fcport = els_req->fcport; in qedf_l2_els_compl()
414 qedf_restart_rport(fcport); in qedf_l2_els_compl()
419 QEDF_ERR(&(fcport->qedf->dbg_ctx), "resp_len is " in qedf_l2_els_compl()
424 fp = fc_frame_alloc(fcport->qedf->lport, resp_len); in qedf_l2_els_compl()
426 QEDF_ERR(&(fcport->qedf->dbg_ctx), in qedf_l2_els_compl()
439 QEDF_INFO(&(fcport->qedf->dbg_ctx), QEDF_LOG_ELS, in qedf_l2_els_compl()
441 qedf_process_l2_frame_compl(fcport, fp, l2_oxid); in qedf_l2_els_compl()
447 int qedf_send_adisc(struct qedf_rport *fcport, struct fc_frame *fp) in qedf_send_adisc() argument
451 struct fc_lport *lport = fcport->qedf->lport; in qedf_send_adisc()
457 qedf = fcport->qedf; in qedf_send_adisc()
474 rc = qedf_initiate_els(fcport, ELS_ADISC, adisc, sizeof(*adisc), in qedf_send_adisc()
500 qedf = srr_req->fcport->qedf; in qedf_srr_compl()
569 struct qedf_rport *fcport; in qedf_send_srr() local
580 fcport = orig_io_req->fcport; in qedf_send_srr()
583 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_send_srr()
588 if (!fcport->qedf) { in qedf_send_srr()
596 qedf = fcport->qedf; in qedf_send_srr()
598 sid = fcport->sid; in qedf_send_srr()
621 rc = qedf_initiate_els(fcport, ELS_SRR, &srr, sizeof(srr), in qedf_send_srr()
642 struct qedf_rport *fcport; in qedf_initiate_seq_cleanup() local
648 fcport = orig_io_req->fcport; in qedf_initiate_seq_cleanup()
650 QEDF_INFO(&(fcport->qedf->dbg_ctx), QEDF_LOG_ELS, in qedf_initiate_seq_cleanup()
656 QEDF_ERR(&(fcport->qedf->dbg_ctx), "Unable to allocate cb_arg " in qedf_initiate_seq_cleanup()
669 qedf_cmd_timer_set(fcport->qedf, orig_io_req, in qedf_initiate_seq_cleanup()
672 spin_lock_irqsave(&fcport->rport_lock, flags); in qedf_initiate_seq_cleanup()
674 sqe_idx = qedf_get_sqe_idx(fcport); in qedf_initiate_seq_cleanup()
675 sqe = &fcport->sq[sqe_idx]; in qedf_initiate_seq_cleanup()
681 qedf_ring_doorbell(fcport); in qedf_initiate_seq_cleanup()
683 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_initiate_seq_cleanup()
712 struct qedf_rport *fcport; in qedf_requeue_io_req() local
717 fcport = orig_io_req->fcport; in qedf_requeue_io_req()
718 if (!fcport) { in qedf_requeue_io_req()
724 QEDF_ERR(&(fcport->qedf->dbg_ctx), "sc_cmd is NULL for " in qedf_requeue_io_req()
729 new_io_req = qedf_alloc_cmd(fcport, QEDF_SCSI_CMD); in qedf_requeue_io_req()
731 QEDF_ERR(&(fcport->qedf->dbg_ctx), "Could not allocate new " in qedf_requeue_io_req()
747 spin_lock_irqsave(&fcport->rport_lock, flags); in qedf_requeue_io_req()
750 if (qedf_post_io_req(fcport, new_io_req)) { in qedf_requeue_io_req()
751 QEDF_ERR(&(fcport->qedf->dbg_ctx), "Unable to post io_req\n"); in qedf_requeue_io_req()
753 atomic_inc(&fcport->free_sqes); in qedf_requeue_io_req()
755 QEDF_INFO(&(fcport->qedf->dbg_ctx), QEDF_LOG_ELS, in qedf_requeue_io_req()
762 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_requeue_io_req()
767 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_requeue_io_req()
794 qedf = rec_req->fcport->qedf; in qedf_rec_compl()
929 struct qedf_rport *fcport; in qedf_send_rec() local
942 fcport = orig_io_req->fcport; in qedf_send_rec()
945 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_send_rec()
950 if (!fcport->qedf) { in qedf_send_rec()
958 qedf = fcport->qedf; in qedf_send_rec()
960 sid = fcport->sid; in qedf_send_rec()
984 rc = qedf_initiate_els(fcport, ELS_REC, &rec, sizeof(rec), in qedf_send_rec()