Lines Matching refs:efct

27 efct_xport_alloc(struct efct *efct)  in efct_xport_alloc()  argument
35 xport->efct = efct; in efct_xport_alloc()
40 efct_xport_init_debugfs(struct efct *efct) in efct_xport_init_debugfs() argument
49 if (!efct->sess_debugfs_dir) { in efct_xport_init_debugfs()
50 efct->sess_debugfs_dir = debugfs_create_dir("sessions", in efct_xport_init_debugfs()
52 if (IS_ERR(efct->sess_debugfs_dir)) { in efct_xport_init_debugfs()
53 efc_log_err(efct, in efct_xport_init_debugfs()
66 static void efct_xport_delete_debugfs(struct efct *efct) in efct_xport_delete_debugfs() argument
69 debugfs_remove(efct->sess_debugfs_dir); in efct_xport_delete_debugfs()
70 efct->sess_debugfs_dir = NULL; in efct_xport_delete_debugfs()
83 struct efct *efct = xport->efct; in efct_xport_attach() local
86 rc = efct_hw_setup(&efct->hw, efct, efct->pci); in efct_xport_attach()
88 efc_log_err(efct, "%s: Can't setup hardware\n", efct->desc); in efct_xport_attach()
92 efct_hw_parse_filter(&efct->hw, (void *)efct->filter_def); in efct_xport_attach()
94 xport->io_pool = efct_io_pool_create(efct, efct->hw.config.n_sgl); in efct_xport_attach()
96 efc_log_err(efct, "Can't allocate IO pool\n"); in efct_xport_attach()
178 efct_xport_config_stats_timer(struct efct *efct);
184 struct efct *efct = xport->efct; in efct_xport_stats_timer_cb() local
186 efct_xport_config_stats_timer(efct); in efct_xport_stats_timer_cb()
190 efct_xport_config_stats_timer(struct efct *efct) in efct_xport_config_stats_timer() argument
195 if (!efct) { in efct_xport_config_stats_timer()
200 xport = efct->xport; in efct_xport_config_stats_timer()
201 efct_hw_get_link_stats(&efct->hw, 0, 0, 0, in efct_xport_config_stats_timer()
204 efct_hw_get_host_stats(&efct->hw, 0, efct_xport_async_host_stats_cb, in efct_xport_config_stats_timer()
216 struct efct *efct = xport->efct; in efct_xport_initialize() local
229 rc = efct_hw_init(&efct->hw); in efct_xport_initialize()
231 efc_log_err(efct, "efct_hw_init failure\n"); in efct_xport_initialize()
235 rc = efct_scsi_tgt_new_device(efct); in efct_xport_initialize()
237 efc_log_err(efct, "failed to initialize target\n"); in efct_xport_initialize()
241 rc = efct_scsi_new_device(efct); in efct_xport_initialize()
243 efc_log_err(efct, "failed to initialize initiator\n"); in efct_xport_initialize()
248 efct_xport_config_stats_timer(efct); in efct_xport_initialize()
250 efct_xport_init_debugfs(efct); in efct_xport_initialize()
255 efct_scsi_tgt_del_device(efct); in efct_xport_initialize()
258 efct_hw_teardown(&efct->hw); in efct_xport_initialize()
268 struct efct *efct = NULL; in efct_xport_status() local
271 efct = xport->efct; in efct_xport_status()
287 value.value = efct_hw_get_link_speed(&efct->hw); in efct_xport_status()
295 result->value = efct_hw_get_link_speed(&efct->hw); in efct_xport_status()
299 memcpy((void *)result, &efct->xport->fc_xport_stats, in efct_xport_status()
307 rc = efct_hw_get_link_stats(&efct->hw, 0, 1, 1, in efct_xport_status()
315 efc_log_debug(efct, "sem wait failed\n"); in efct_xport_status()
321 rc = efct_hw_get_host_stats(&efct->hw, 1, in efct_xport_status()
330 efc_log_debug(efct, "sem wait failed\n"); in efct_xport_status()
345 efct_get_link_supported_speeds(struct efct *efct) in efct_get_link_supported_speeds() argument
363 link_module_type = sli_get_lmt(&efct->hw.sli); in efct_get_link_supported_speeds()
375 efct_scsi_new_device(struct efct *efct) in efct_scsi_new_device() argument
383 efc_log_err(efct, "failed to allocate Scsi_Host struct\n"); in efct_scsi_new_device()
388 efct->shost = shost; in efct_scsi_new_device()
392 vport->efct = efct; in efct_scsi_new_device()
399 shost->can_queue = efct->hw.config.n_io; in efct_scsi_new_device()
408 shost->sg_tablesize = sli_get_max_sgl(&efct->hw.sli); in efct_scsi_new_device()
412 efc_log_debug(efct, "transport template=%p\n", efct_xport_fc_tt); in efct_scsi_new_device()
415 error = scsi_add_host_with_dma(shost, &efct->pci->dev, in efct_scsi_new_device()
416 &efct->pci->dev); in efct_scsi_new_device()
418 efc_log_debug(efct, "failed scsi_add_host_with_dma\n"); in efct_scsi_new_device()
425 "Emulex %s FV%s DV%s", efct->model, in efct_scsi_new_device()
426 efct->hw.sli.fw_name[0], EFCT_DRIVER_VERSION); in efct_scsi_new_device()
431 fc_host_supported_speeds(shost) = efct_get_link_supported_speeds(efct); in efct_scsi_new_device()
433 fc_host_node_name(shost) = efct_get_wwnn(&efct->hw); in efct_scsi_new_device()
434 fc_host_port_name(shost) = efct_get_wwpn(&efct->hw); in efct_scsi_new_device()
502 struct efct *efct = xport->efct; in efct_xport_detach() local
505 efct_scsi_tgt_del_device(efct); in efct_xport_detach()
507 efct_scsi_del_device(efct); in efct_xport_detach()
513 efct_hw_teardown(&efct->hw); in efct_xport_detach()
515 efct_xport_delete_debugfs(efct); in efct_xport_detach()
530 struct efct *efct = NULL; in efct_xport_control() local
533 efct = xport->efct; in efct_xport_control()
538 rc = efct_hw_port_control(&efct->hw, EFCT_HW_PORT_INIT, 0, in efct_xport_control()
541 efc_log_err(efct, in efct_xport_control()
542 "%s: Can't init port\n", efct->desc); in efct_xport_control()
548 if (efct_hw_port_control(&efct->hw, EFCT_HW_PORT_SHUTDOWN, 0, in efct_xport_control()
550 efc_log_err(efct, "port shutdown failed\n"); in efct_xport_control()
564 if (sli_reset_required(&efct->hw.sli)) { in efct_xport_control()
565 struct efc_domain *domain = efct->efcport->domain; in efct_xport_control()
568 efc_domain_cb(efct->efcport, EFC_HW_DOMAIN_LOST, in efct_xport_control()
571 efct_hw_port_control(&efct->hw, EFCT_HW_PORT_SHUTDOWN, in efct_xport_control()
577 efc_register_domain_free_cb(efct->efcport, in efct_xport_control()
580 efc_log_debug(efct, "Waiting %d seconds for domain shutdown\n", in efct_xport_control()
585 efc_log_err(efct, "Domain shutdown timed out!!\n"); in efct_xport_control()
589 efc_register_domain_free_cb(efct->efcport, NULL, NULL); in efct_xport_control()
592 efc_vport_del_all(efct->efcport); in efct_xport_control()
608 efc_log_debug(efct, " WWNN %016llx\n", wwnn); in efct_xport_control()
625 efc_log_debug(efct, " WWPN %016llx\n", wwpn); in efct_xport_control()
664 efct_scsi_del_device(struct efct *efct) in efct_scsi_del_device() argument
666 if (!efct->shost) in efct_scsi_del_device()
669 efc_log_debug(efct, "Unregistering with Transport Layer\n"); in efct_scsi_del_device()
670 efct_xport_remove_host(efct->shost); in efct_scsi_del_device()
671 efc_log_debug(efct, "Unregistering with SCSI Midlayer\n"); in efct_scsi_del_device()
672 scsi_remove_host(efct->shost); in efct_scsi_del_device()
673 scsi_host_put(efct->shost); in efct_scsi_del_device()
674 efct->shost = NULL; in efct_scsi_del_device()
681 struct efct *efct = vport->efct; in efct_get_host_port_id() local
682 struct efc *efc = efct->efcport; in efct_get_host_port_id()
695 struct efct *efct = vport->efct; in efct_get_host_port_type() local
696 struct efc *efc = efct->efcport; in efct_get_host_port_type()
728 struct efct *efct = vport->efct; in efct_get_host_port_state() local
732 rc = efct_xport_status(efct->xport, EFCT_XPORT_PORT_STATUS, &status); in efct_get_host_port_state()
743 struct efct *efct = vport->efct; in efct_get_host_speed() local
744 struct efc *efc = efct->efcport; in efct_get_host_speed()
754 rc = efct_xport_status(efct->xport, EFCT_XPORT_LINK_SPEED, &speed); in efct_get_host_speed()
794 struct efct *efct = vport->efct; in efct_get_host_fabric_name() local
795 struct efc *efc = efct->efcport; in efct_get_host_fabric_name()
810 struct efct *efct = vport->efct; in efct_get_stats() local
812 struct efct_xport *xport = efct->xport; in efct_get_stats()
860 struct efct *efct = vport->efct; in efct_reset_stats() local
865 rc = efct_xport_status(efct->xport, EFCT_XPORT_LINK_STAT_RESET, &dummy); in efct_reset_stats()
875 struct efct *efct = vport ? vport->efct : NULL; in efct_issue_lip() local
877 if (!shost || !vport || !efct) { in efct_issue_lip()
879 shost, vport, efct); in efct_issue_lip()
889 if (efct_xport_control(efct->xport, EFCT_XPORT_PORT_OFFLINE)) in efct_issue_lip()
890 efc_log_debug(efct, "EFCT_XPORT_PORT_OFFLINE failed\n"); in efct_issue_lip()
892 if (efct_xport_control(efct->xport, EFCT_XPORT_PORT_ONLINE)) in efct_issue_lip()
893 efc_log_debug(efct, "EFCT_XPORT_PORT_ONLINE failed\n"); in efct_issue_lip()
899 efct_scsi_new_vport(struct efct *efct, struct device *dev) in efct_scsi_new_vport() argument
907 efc_log_err(efct, "failed to allocate Scsi_Host struct\n"); in efct_scsi_new_vport()
913 vport->efct = efct; in efct_scsi_new_vport()
916 shost->can_queue = efct->hw.config.n_io; in efct_scsi_new_vport()
922 shost->sg_tablesize = sli_get_max_sgl(&efct->hw.sli); in efct_scsi_new_vport()
926 efc_log_debug(efct, "vport transport template=%p\n", in efct_scsi_new_vport()
930 error = scsi_add_host_with_dma(shost, dev, &efct->pci->dev); in efct_scsi_new_vport()
932 efc_log_debug(efct, "failed scsi_add_host_with_dma\n"); in efct_scsi_new_vport()
939 "Emulex %s FV%s DV%s", efct->model, efct->hw.sli.fw_name[0], in efct_scsi_new_vport()
945 fc_host_supported_speeds(shost) = efct_get_link_supported_speeds(efct); in efct_scsi_new_vport()
951 int efct_scsi_del_vport(struct efct *efct, struct Scsi_Host *shost) in efct_scsi_del_vport() argument
954 efc_log_debug(efct, in efct_scsi_del_vport()
957 efc_log_debug(efct, "Unregistering vport with SCSI Midlayer\n"); in efct_scsi_del_vport()
972 struct efct *efct = pport ? pport->efct : NULL; in efct_vport_create() local
975 if (!fc_vport || !shost || !efct) in efct_vport_create()
978 vport = efct_scsi_new_vport(efct, &fc_vport->dev); in efct_vport_create()
980 efc_log_err(efct, "failed to create vport\n"); in efct_vport_create()
1002 struct efct *efct = vport ? vport->efct : NULL; in efct_vport_delete() local
1005 rc = efct_scsi_del_vport(efct, shost); in efct_vport_delete()