Lines Matching refs:vport

53 inline void lpfc_vport_set_state(struct lpfc_vport *vport,  in lpfc_vport_set_state()  argument
56 struct fc_vport *fc_vport = vport->fc_vport; in lpfc_vport_set_state()
76 vport->port_state = LPFC_VPORT_FAILED; in lpfc_vport_set_state()
79 vport->port_state = LPFC_VPORT_UNKNOWN; in lpfc_vport_set_state()
118 lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_vport_sparm() argument
131 rc = lpfc_read_sparam(phba, pmb, vport->vpi); in lpfc_vport_sparm()
146 pmb->vport = vport; in lpfc_vport_sparm()
150 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_sparm()
158 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_sparm()
170 memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm)); in lpfc_vport_sparm()
171 memcpy(&vport->fc_nodename, &vport->fc_sparam.nodeName, in lpfc_vport_sparm()
173 memcpy(&vport->fc_portname, &vport->fc_sparam.portName, in lpfc_vport_sparm()
204 struct lpfc_vport *vport; in lpfc_unique_wwpn() local
208 list_for_each_entry(vport, &phba->port_list, listentry) { in lpfc_unique_wwpn()
209 if (vport == new_vport) in lpfc_unique_wwpn()
212 if (memcmp(&vport->fc_sparam.portName, in lpfc_unique_wwpn()
238 static void lpfc_discovery_wait(struct lpfc_vport *vport) in lpfc_discovery_wait() argument
240 struct lpfc_hba *phba = vport->phba; in lpfc_discovery_wait()
253 if ((vport->num_disc_nodes > 0) || in lpfc_discovery_wait()
254 test_bit(FC_RSCN_MODE, &vport->fc_flag) || in lpfc_discovery_wait()
255 test_bit(FC_RSCN_DISCOVERY, &vport->fc_flag) || in lpfc_discovery_wait()
256 test_bit(FC_NLP_MORE, &vport->fc_flag) || in lpfc_discovery_wait()
257 test_bit(FC_RSCN_DEFERRED, &vport->fc_flag) || in lpfc_discovery_wait()
258 test_bit(FC_NDISC_ACTIVE, &vport->fc_flag) || in lpfc_discovery_wait()
259 test_bit(FC_DISC_TMO, &vport->fc_flag) || in lpfc_discovery_wait()
260 ((vport->port_state > LPFC_VPORT_FAILED) && in lpfc_discovery_wait()
261 (vport->port_state < LPFC_VPORT_READY))) { in lpfc_discovery_wait()
262 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT, in lpfc_discovery_wait()
267 vport->port_state, vport->fc_flag, in lpfc_discovery_wait()
268 vport->num_disc_nodes, in lpfc_discovery_wait()
273 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT, in lpfc_discovery_wait()
277 vport->port_state, vport->fc_flag, in lpfc_discovery_wait()
285 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_discovery_wait()
288 vport->port_state, vport->fc_flag, in lpfc_discovery_wait()
299 struct lpfc_vport *vport = NULL; in lpfc_vport_create() local
343 vport = lpfc_create_port(phba, instance, &fc_vport->dev); in lpfc_vport_create()
344 if (!vport) { in lpfc_vport_create()
352 vport->vpi = vpi; in lpfc_vport_create()
353 lpfc_debugfs_initialize(vport); in lpfc_vport_create()
355 if ((status = lpfc_vport_sparm(phba, vport))) { in lpfc_vport_create()
357 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
361 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
367 destroy_port(vport); in lpfc_vport_create()
371 u64_to_wwn(fc_vport->node_name, vport->fc_nodename.u.wwn); in lpfc_vport_create()
372 u64_to_wwn(fc_vport->port_name, vport->fc_portname.u.wwn); in lpfc_vport_create()
374 memcpy(&vport->fc_sparam.portName, vport->fc_portname.u.wwn, 8); in lpfc_vport_create()
375 memcpy(&vport->fc_sparam.nodeName, vport->fc_nodename.u.wwn, 8); in lpfc_vport_create()
377 if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") || in lpfc_vport_create()
378 !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) { in lpfc_vport_create()
379 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
383 destroy_port(vport); in lpfc_vport_create()
388 if (!lpfc_unique_wwpn(phba, vport)) { in lpfc_vport_create()
389 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
393 destroy_port(vport); in lpfc_vport_create()
399 lpfc_alloc_sysfs_attr(vport); in lpfc_vport_create()
402 vport->cfg_lun_queue_depth = phba->pport->cfg_lun_queue_depth; in lpfc_vport_create()
405 vport->cfg_enable_fc4_type = LPFC_ENABLE_FCP; in lpfc_vport_create()
407 *(struct lpfc_vport **)fc_vport->dd_data = vport; in lpfc_vport_create()
408 vport->fc_vport = fc_vport; in lpfc_vport_create()
411 set_bit(FC_ALLOW_FDMI, &vport->load_flag); in lpfc_vport_create()
415 vport->fdmi_hba_mask = phba->pport->fdmi_hba_mask; in lpfc_vport_create()
416 vport->fdmi_port_mask = phba->pport->fdmi_port_mask; in lpfc_vport_create()
425 rc = lpfc_sli4_init_vpi(vport); in lpfc_vport_create()
439 set_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in lpfc_vport_create()
440 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_vport_create()
448 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_vport_create()
454 lpfc_vport_set_state(vport, FC_VPORT_DISABLED); in lpfc_vport_create()
466 lpfc_set_disctmo(vport); in lpfc_vport_create()
467 lpfc_initial_fdisc(vport); in lpfc_vport_create()
469 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in lpfc_vport_create()
470 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_create()
474 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_vport_create()
479 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, in lpfc_vport_create()
481 lpfc_host_attrib_init(lpfc_shost_from_vport(vport)); in lpfc_vport_create()
487 lpfc_send_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_send_npiv_logo() argument
490 struct lpfc_hba *phba = vport->phba; in lpfc_send_npiv_logo()
503 rc = lpfc_issue_els_npiv_logo(vport, ndlp); in lpfc_send_npiv_logo()
524 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT, in lpfc_send_npiv_logo()
536 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in disable_vport() local
537 struct lpfc_hba *phba = vport->phba; in disable_vport()
541 if (test_bit(FC_UNLOADING, &vport->load_flag)) in disable_vport()
544 ndlp = lpfc_findnode_did(vport, Fabric_DID); in disable_vport()
546 (void)lpfc_send_npiv_logo(vport, ndlp); in disable_vport()
548 lpfc_sli_host_down(vport); in disable_vport()
549 lpfc_cleanup_rpis(vport, 0); in disable_vport()
551 lpfc_stop_vport_timers(vport); in disable_vport()
552 lpfc_unreg_all_rpis(vport); in disable_vport()
553 lpfc_unreg_default_rpis(vport); in disable_vport()
558 lpfc_mbx_unreg_vpi(vport); in disable_vport()
560 set_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in disable_vport()
562 lpfc_vport_set_state(vport, FC_VPORT_DISABLED); in disable_vport()
563 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, in disable_vport()
571 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in enable_vport() local
572 struct lpfc_hba *phba = vport->phba; in enable_vport()
577 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in enable_vport()
581 set_bit(FC_LOADING, &vport->load_flag); in enable_vport()
582 if (test_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag)) { in enable_vport()
583 lpfc_issue_init_vpi(vport); in enable_vport()
587 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in enable_vport()
595 lpfc_set_disctmo(vport); in enable_vport()
596 lpfc_initial_fdisc(vport); in enable_vport()
598 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in enable_vport()
599 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in enable_vport()
603 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in enable_vport()
607 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, in enable_vport()
625 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in lpfc_vport_delete() local
626 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_vport_delete()
627 struct lpfc_hba *phba = vport->phba; in lpfc_vport_delete()
631 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_vport_delete()
632 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_delete()
639 if ((vport->vport_flag & STATIC_VPORT) && in lpfc_vport_delete()
641 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_vport_delete()
647 set_bit(FC_UNLOADING, &vport->load_flag); in lpfc_vport_delete()
656 vport->port_state > LPFC_VPORT_FAILED && in lpfc_vport_delete()
657 vport->port_state < LPFC_VPORT_READY) { in lpfc_vport_delete()
661 if (vport->port_state > LPFC_VPORT_FAILED && in lpfc_vport_delete()
662 vport->port_state < LPFC_VPORT_READY) in lpfc_vport_delete()
675 lpfc_free_sysfs_attr(vport); in lpfc_vport_delete()
676 lpfc_debugfs_terminate(vport); in lpfc_vport_delete()
679 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_vport_delete()
687 if (vport->cfg_enable_da_id) { in lpfc_vport_delete()
693 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_vport_delete()
702 rc = lpfc_ns_cmd(vport, SLI_CTNS_DA_ID, 0, 0); in lpfc_vport_delete()
709 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT | LOG_ELS, in lpfc_vport_delete()
731 if (!(vport->vpi_state & LPFC_VPI_REGISTERED)) in lpfc_vport_delete()
735 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_vport_delete()
739 rc = lpfc_send_npiv_logo(vport, ndlp); in lpfc_vport_delete()
745 lpfc_discovery_wait(vport); in lpfc_vport_delete()
753 lpfc_cleanup(vport); in lpfc_vport_delete()
756 lpfc_sli_host_down(vport); in lpfc_vport_delete()
757 lpfc_stop_vport_timers(vport); in lpfc_vport_delete()
760 lpfc_unreg_all_rpis(vport); in lpfc_vport_delete()
761 lpfc_unreg_default_rpis(vport); in lpfc_vport_delete()
766 if (!(vport->vpi_state & LPFC_VPI_REGISTERED) || in lpfc_vport_delete()
767 lpfc_mbx_unreg_vpi(vport)) in lpfc_vport_delete()
773 lpfc_free_vpi(phba, vport->vpi); in lpfc_vport_delete()
774 vport->work_port_events = 0; in lpfc_vport_delete()
776 list_del_init(&vport->listentry); in lpfc_vport_delete()
778 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, in lpfc_vport_delete()