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