Lines Matching refs:fcport

9 static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op,  in qedf_initiate_els()  argument
27 if (!fcport) { in qedf_initiate_els()
33 qedf = fcport->qedf; in qedf_initiate_els()
38 rc = fc_remote_port_chkready(fcport->rport); in qedf_initiate_els()
51 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_initiate_els()
57 els_req = qedf_alloc_cmd(fcport, QEDF_ELS); in qedf_initiate_els()
70 els_req->fcport = fcport; in qedf_initiate_els()
107 did = fcport->rdata->ids.port_id; in qedf_initiate_els()
108 sid = fcport->sid; in qedf_initiate_els()
117 spin_lock_irqsave(&fcport->rport_lock, flags); in qedf_initiate_els()
119 sqe_idx = qedf_get_sqe_idx(fcport); in qedf_initiate_els()
120 sqe = &fcport->sq[sqe_idx]; in qedf_initiate_els()
134 qedf_ring_doorbell(fcport); in qedf_initiate_els()
137 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_initiate_els()
146 struct qedf_rport *fcport; in qedf_process_els_compl() local
160 fcport = els_req->fcport; in qedf_process_els_compl()
165 if (test_bit(QEDF_RPORT_IN_TARGET_RESET, &fcport->flags) || in qedf_process_els_compl()
166 test_bit(QEDF_RPORT_IN_LUN_RESET, &fcport->flags)) { in qedf_process_els_compl()
199 qedf = rrq_req->fcport->qedf; in qedf_rrq_compl()
241 struct qedf_rport *fcport; in qedf_send_rrq() local
255 fcport = aborted_io_req->fcport; in qedf_send_rrq()
257 if (!fcport) { in qedf_send_rrq()
267 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_send_rrq()
272 if (!fcport->qedf) { in qedf_send_rrq()
277 qedf = fcport->qedf; in qedf_send_rrq()
292 sid = fcport->sid; in qedf_send_rrq()
316 rc = qedf_initiate_els(fcport, ELS_RRQ, &rrq, sizeof(rrq), in qedf_send_rrq()
329 static void qedf_process_l2_frame_compl(struct qedf_rport *fcport, in qedf_process_l2_frame_compl() argument
333 struct fc_lport *lport = fcport->qedf->lport; in qedf_process_l2_frame_compl()
349 hton24(fh->fh_s_id, fcport->rdata->ids.port_id); in qedf_process_l2_frame_compl()
368 void qedf_restart_rport(struct qedf_rport *fcport) in qedf_restart_rport() argument
375 if (!fcport) { in qedf_restart_rport()
380 spin_lock_irqsave(&fcport->rport_lock, flags); in qedf_restart_rport()
381 if (test_bit(QEDF_RPORT_IN_RESET, &fcport->flags) || in qedf_restart_rport()
382 !test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags) || in qedf_restart_rport()
383 test_bit(QEDF_RPORT_UPLOADING_CONNECTION, &fcport->flags)) { in qedf_restart_rport()
384 QEDF_ERR(&(fcport->qedf->dbg_ctx), "fcport %p already in reset or not offloaded.\n", in qedf_restart_rport()
385 fcport); in qedf_restart_rport()
386 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_restart_rport()
391 set_bit(QEDF_RPORT_IN_RESET, &fcport->flags); in qedf_restart_rport()
392 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_restart_rport()
394 rdata = fcport->rdata; in qedf_restart_rport()
396 fcport->rdata = NULL; in qedf_restart_rport()
401 lport = fcport->qedf->lport; in qedf_restart_rport()
403 QEDF_ERR(&(fcport->qedf->dbg_ctx), in qedf_restart_rport()
413 fcport->rdata = rdata; in qedf_restart_rport()
415 clear_bit(QEDF_RPORT_IN_RESET, &fcport->flags); in qedf_restart_rport()
421 struct qedf_rport *fcport; in qedf_l2_els_compl() local
447 fcport = els_req->fcport; in qedf_l2_els_compl()
467 qedf_restart_rport(fcport); in qedf_l2_els_compl()
472 QEDF_ERR(&(fcport->qedf->dbg_ctx), "resp_len is " in qedf_l2_els_compl()
477 fp = fc_frame_alloc(fcport->qedf->lport, resp_len); in qedf_l2_els_compl()
479 QEDF_ERR(&(fcport->qedf->dbg_ctx), in qedf_l2_els_compl()
492 QEDF_INFO(&(fcport->qedf->dbg_ctx), QEDF_LOG_ELS, in qedf_l2_els_compl()
494 qedf_process_l2_frame_compl(fcport, fp, l2_oxid); in qedf_l2_els_compl()
500 int qedf_send_adisc(struct qedf_rport *fcport, struct fc_frame *fp) in qedf_send_adisc() argument
504 struct fc_lport *lport = fcport->qedf->lport; in qedf_send_adisc()
510 qedf = fcport->qedf; in qedf_send_adisc()
527 rc = qedf_initiate_els(fcport, ELS_ADISC, adisc, sizeof(*adisc), in qedf_send_adisc()
553 qedf = srr_req->fcport->qedf; in qedf_srr_compl()
627 struct qedf_rport *fcport; in qedf_send_srr() local
638 fcport = orig_io_req->fcport; in qedf_send_srr()
641 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_send_srr()
646 if (!fcport->qedf) { in qedf_send_srr()
654 qedf = fcport->qedf; in qedf_send_srr()
678 rc = qedf_initiate_els(fcport, ELS_SRR, &srr, sizeof(srr), in qedf_send_srr()
699 struct qedf_rport *fcport; in qedf_initiate_seq_cleanup() local
705 fcport = orig_io_req->fcport; in qedf_initiate_seq_cleanup()
707 QEDF_INFO(&(fcport->qedf->dbg_ctx), QEDF_LOG_ELS, in qedf_initiate_seq_cleanup()
713 QEDF_ERR(&(fcport->qedf->dbg_ctx), "Unable to allocate cb_arg " in qedf_initiate_seq_cleanup()
726 qedf_cmd_timer_set(fcport->qedf, orig_io_req, in qedf_initiate_seq_cleanup()
729 spin_lock_irqsave(&fcport->rport_lock, flags); in qedf_initiate_seq_cleanup()
731 sqe_idx = qedf_get_sqe_idx(fcport); in qedf_initiate_seq_cleanup()
732 sqe = &fcport->sq[sqe_idx]; in qedf_initiate_seq_cleanup()
738 qedf_ring_doorbell(fcport); in qedf_initiate_seq_cleanup()
740 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_initiate_seq_cleanup()
772 struct qedf_rport *fcport; in qedf_requeue_io_req() local
777 fcport = orig_io_req->fcport; in qedf_requeue_io_req()
778 if (!fcport) { in qedf_requeue_io_req()
784 QEDF_ERR(&(fcport->qedf->dbg_ctx), "sc_cmd is NULL for " in qedf_requeue_io_req()
789 new_io_req = qedf_alloc_cmd(fcport, QEDF_SCSI_CMD); in qedf_requeue_io_req()
791 QEDF_ERR(&(fcport->qedf->dbg_ctx), "Could not allocate new " in qedf_requeue_io_req()
807 spin_lock_irqsave(&fcport->rport_lock, flags); in qedf_requeue_io_req()
810 if (qedf_post_io_req(fcport, new_io_req)) { in qedf_requeue_io_req()
811 QEDF_ERR(&(fcport->qedf->dbg_ctx), "Unable to post io_req\n"); in qedf_requeue_io_req()
813 atomic_inc(&fcport->free_sqes); in qedf_requeue_io_req()
815 QEDF_INFO(&(fcport->qedf->dbg_ctx), QEDF_LOG_ELS, in qedf_requeue_io_req()
822 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_requeue_io_req()
827 spin_unlock_irqrestore(&fcport->rport_lock, flags); in qedf_requeue_io_req()
854 qedf = rec_req->fcport->qedf; in qedf_rec_compl()
1000 struct qedf_rport *fcport; in qedf_send_rec() local
1013 fcport = orig_io_req->fcport; in qedf_send_rec()
1016 if (!test_bit(QEDF_RPORT_SESSION_READY, &fcport->flags)) { in qedf_send_rec()
1021 if (!fcport->qedf) { in qedf_send_rec()
1029 qedf = fcport->qedf; in qedf_send_rec()
1031 sid = fcport->sid; in qedf_send_rec()
1055 rc = qedf_initiate_els(fcport, ELS_REC, &rec, sizeof(rec), in qedf_send_rec()