Lines Matching refs:port
40 "upper limit of port scan random backoff in msecs (default 500)");
45 "minimum interval between port scans in msecs (default 60000)");
247 struct zfcp_port *port;
250 list_for_each_entry(port, &adapter->port_list, list) {
251 if ((port->d_id & range) == (ntoh24(page->rscn_fid) & range))
252 zfcp_fc_test_link(port);
277 struct zfcp_port *port;
280 list_for_each_entry(port, &adapter->port_list, list) {
281 if (port->d_id)
283 zfcp_erp_port_reopen(port,
306 struct zfcp_port *port;
309 list_for_each_entry(port, &adapter->port_list, list)
310 if (port->wwpn == wwpn) {
311 zfcp_erp_port_forced_reopen(port, 0, "fciwwp1");
367 ct_els->port->d_id = ntoh24(gid_pn_rsp->gid_pn.fp_fid);
384 static int zfcp_fc_ns_gid_pn_request(struct zfcp_port *port,
387 struct zfcp_adapter *adapter = port->adapter;
394 fc_req->ct_els.port = port;
404 gid_pn_req->gid_pn.fn_wwpn = cpu_to_be64(port->wwpn);
418 * @port: port where GID_PN request is needed
421 static int zfcp_fc_ns_gid_pn(struct zfcp_port *port)
425 struct zfcp_adapter *adapter = port->adapter;
437 ret = zfcp_fc_ns_gid_pn_request(port, fc_req);
448 struct zfcp_port *port = container_of(work, struct zfcp_port,
451 set_worker_desc("zgidpn%16llx", port->wwpn); /* < WORKER_DESC_LEN=24 */
452 ret = zfcp_fc_ns_gid_pn(port);
455 zfcp_erp_adapter_reopen(port->adapter, 0, "fcgpn_1");
459 if (!port->d_id) {
460 zfcp_erp_set_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED);
464 zfcp_erp_port_reopen(port, 0, "fcgpn_3");
466 put_device(&port->dev);
471 * @port: The zfcp_port to lookup the d_id for.
473 void zfcp_fc_trigger_did_lookup(struct zfcp_port *port)
475 get_device(&port->dev);
476 if (!queue_work(port->adapter->work_queue, &port->gid_pn_work))
477 put_device(&port->dev);
482 * @port: zfcp_port structure
487 void zfcp_fc_plogi_evaluate(struct zfcp_port *port, struct fc_els_flogi *plogi)
489 if (be64_to_cpu(plogi->fl_wwpn) != port->wwpn) {
490 port->d_id = 0;
491 dev_warn(&port->adapter->ccw_device->dev,
492 "A port opened with WWPN 0x%016Lx returned data that "
494 (unsigned long long) port->wwpn,
499 port->wwnn = be64_to_cpu(plogi->fl_wwnn);
500 port->maxframe_size = be16_to_cpu(plogi->fl_csp.sp_bb_data);
503 port->supported_classes |= FC_COS_CLASS1;
505 port->supported_classes |= FC_COS_CLASS2;
507 port->supported_classes |= FC_COS_CLASS3;
509 port->supported_classes |= FC_COS_CLASS4;
515 struct zfcp_port *port = fc_req->ct_els.port;
520 zfcp_erp_port_forced_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED,
525 if (!port->wwnn)
526 port->wwnn = be64_to_cpu(adisc_resp->adisc_wwnn);
528 if ((port->wwpn != be64_to_cpu(adisc_resp->adisc_wwpn)) ||
529 !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_OPEN)) {
530 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED,
536 port->d_id = ntoh24(adisc_resp->adisc_port_id);
537 /* port is still good, nothing to do */
539 atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
540 put_device(&port->dev);
544 static int zfcp_fc_adisc(struct zfcp_port *port)
547 struct zfcp_adapter *adapter = port->adapter;
556 fc_req->ct_els.port = port;
574 d_id = port->d_id; /* remember as destination for send els below */
576 * Force fresh GID_PN lookup on next port recovery.
578 * to prevent race with port->d_id re-init in zfcp_fc_adisc_handler().
580 port->d_id = 0;
592 struct zfcp_port *port =
596 set_worker_desc("zadisc%16llx", port->wwpn); /* < WORKER_DESC_LEN=24 */
598 /* only issue one test command at one time per port */
599 if (atomic_read(&port->status) & ZFCP_STATUS_PORT_LINK_TEST)
602 atomic_or(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
604 retval = zfcp_fc_adisc(port);
609 atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
610 zfcp_erp_port_forced_reopen(port, 0, "fcltwk1");
613 put_device(&port->dev);
618 * @port: port to be tested
620 * Test status of a link to a remote port using the ELS command ADISC.
621 * If there is a problem with the remote port, error recovery steps
624 void zfcp_fc_test_link(struct zfcp_port *port)
626 get_device(&port->dev);
627 if (!queue_work(port->adapter->work_queue, &port->test_link_work))
628 put_device(&port->dev);
715 static void zfcp_fc_validate_port(struct zfcp_port *port, struct list_head *lh)
717 if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_NOESC))
720 atomic_andnot(ZFCP_STATUS_COMMON_NOESC, &port->status);
722 if ((port->supported_classes != 0) ||
723 !list_empty(&port->unit_list))
726 list_move_tail(&port->list, lh);
736 struct zfcp_port *port, *tmp;
771 /* skip the adapter's port and known remote ports */
776 port = zfcp_port_enqueue(adapter, be64_to_cpu(acc->fp_wwpn),
778 if (!IS_ERR(port))
779 zfcp_erp_port_reopen(port, 0, "fcegpf1");
780 else if (PTR_ERR(port) != -EEXIST)
781 ret = PTR_ERR(port);
786 list_for_each_entry_safe(port, tmp, &adapter->port_list, list)
787 zfcp_fc_validate_port(port, &remove_lh);
790 list_for_each_entry_safe(port, tmp, &remove_lh, list) {
791 zfcp_erp_port_shutdown(port, 0, "fcegpf2");
792 device_unregister(&port->dev);
922 * zfcp_fc_sym_name_update - Retrieve and update the symbolic port name
923 * @work: ns_up_work of the adapter where to update the symbolic port name
925 * Retrieve the current symbolic port name that may have been set by
928 * the port name is unique for this system), update the symbolic port
1024 struct zfcp_port *port;
1028 port = zfcp_get_port_by_wwpn(adapter, rport->port_name);
1029 if (!port)
1032 d_id = port->d_id;
1033 put_device(&port->dev);