Lines Matching refs:adapter
52 static void zfcp_fc_port_scan_time(struct zfcp_adapter *adapter) in zfcp_fc_port_scan_time() argument
57 adapter->next_port_scan = jiffies + interval + backoff; in zfcp_fc_port_scan_time()
60 static void zfcp_fc_port_scan(struct zfcp_adapter *adapter) in zfcp_fc_port_scan() argument
63 unsigned long next = adapter->next_port_scan; in zfcp_fc_port_scan()
74 queue_delayed_work(adapter->work_queue, &adapter->scan_work, delay); in zfcp_fc_port_scan()
77 void zfcp_fc_conditional_port_scan(struct zfcp_adapter *adapter) in zfcp_fc_conditional_port_scan() argument
82 zfcp_fc_port_scan(adapter); in zfcp_fc_conditional_port_scan()
85 void zfcp_fc_inverse_conditional_port_scan(struct zfcp_adapter *adapter) in zfcp_fc_inverse_conditional_port_scan() argument
90 zfcp_fc_port_scan(adapter); in zfcp_fc_inverse_conditional_port_scan()
103 struct zfcp_adapter *adapter = container_of(events, struct zfcp_adapter, in zfcp_fc_post_event() local
111 fc_host_post_event(adapter->scsi_host, fc_get_event_number(), in zfcp_fc_post_event()
126 void zfcp_fc_enqueue_event(struct zfcp_adapter *adapter, in zfcp_fc_enqueue_event() argument
138 spin_lock(&adapter->events.list_lock); in zfcp_fc_enqueue_event()
139 list_add_tail(&event->list, &adapter->events.list); in zfcp_fc_enqueue_event()
140 spin_unlock(&adapter->events.list_lock); in zfcp_fc_enqueue_event()
142 queue_work(adapter->work_queue, &adapter->events.work); in zfcp_fc_enqueue_event()
199 struct zfcp_adapter *adapter) in zfcp_fc_wka_port_init() argument
203 wka_port->adapter = adapter; in zfcp_fc_wka_port_init()
234 struct zfcp_adapter *adapter = fsf_req->adapter; in _zfcp_fc_incoming_rscn() local
237 read_lock_irqsave(&adapter->port_list_lock, flags); in _zfcp_fc_incoming_rscn()
238 list_for_each_entry(port, &adapter->port_list, list) { in _zfcp_fc_incoming_rscn()
246 read_unlock_irqrestore(&adapter->port_list_lock, flags); in _zfcp_fc_incoming_rscn()
270 zfcp_fc_enqueue_event(fsf_req->adapter, FCH_EVT_RSCN, in zfcp_fc_incoming_rscn()
273 zfcp_fc_conditional_port_scan(fsf_req->adapter); in zfcp_fc_incoming_rscn()
279 struct zfcp_adapter *adapter = req->adapter; in zfcp_fc_incoming_wwpn() local
282 read_lock_irqsave(&adapter->port_list_lock, flags); in zfcp_fc_incoming_wwpn()
283 list_for_each_entry(port, &adapter->port_list, list) in zfcp_fc_incoming_wwpn()
288 read_unlock_irqrestore(&adapter->port_list_lock, flags); in zfcp_fc_incoming_wwpn()
361 struct zfcp_adapter *adapter = port->adapter; in zfcp_fc_ns_gid_pn_request() local
380 ret = zfcp_fsf_send_ct(&adapter->gs->ds, &fc_req->ct_els, in zfcp_fc_ns_gid_pn_request()
381 adapter->pool.gid_pn_req, in zfcp_fc_ns_gid_pn_request()
399 struct zfcp_adapter *adapter = port->adapter; in zfcp_fc_ns_gid_pn() local
401 fc_req = mempool_alloc(adapter->pool.gid_pn, GFP_ATOMIC); in zfcp_fc_ns_gid_pn()
407 ret = zfcp_fc_wka_port_get(&adapter->gs->ds); in zfcp_fc_ns_gid_pn()
413 zfcp_fc_wka_port_put(&adapter->gs->ds); in zfcp_fc_ns_gid_pn()
415 mempool_free(fc_req, adapter->pool.gid_pn); in zfcp_fc_ns_gid_pn()
428 zfcp_erp_adapter_reopen(port->adapter, 0, "fcgpn_1"); in zfcp_fc_port_did_lookup()
449 if (!queue_work(port->adapter->work_queue, &port->gid_pn_work)) in zfcp_fc_trigger_did_lookup()
464 dev_warn(&port->adapter->ccw_device->dev, in zfcp_fc_plogi_evaluate()
519 struct zfcp_adapter *adapter = port->adapter; in zfcp_fc_adisc() local
520 struct Scsi_Host *shost = adapter->scsi_host; in zfcp_fc_adisc()
545 ret = zfcp_fsf_send_els(adapter, port->d_id, &fc_req->ct_els, in zfcp_fc_adisc()
592 if (!queue_work(port->adapter->work_queue, &port->test_link_work)) in zfcp_fc_test_link()
616 struct zfcp_adapter *adapter, int max_bytes) in zfcp_fc_send_gpn_ft() argument
631 ret = zfcp_fsf_send_ct(&adapter->gs->ds, ct_els, NULL, in zfcp_fc_send_gpn_ft()
653 struct zfcp_adapter *adapter, int max_entries) in zfcp_fc_eval_gpn_ft() argument
675 dev_warn(&adapter->ccw_device->dev, in zfcp_fc_eval_gpn_ft()
695 if (acc->fp_wwpn == fc_host_port_name(adapter->scsi_host)) in zfcp_fc_eval_gpn_ft()
698 port = zfcp_port_enqueue(adapter, acc->fp_wwpn, in zfcp_fc_eval_gpn_ft()
706 zfcp_erp_wait(adapter); in zfcp_fc_eval_gpn_ft()
707 write_lock_irqsave(&adapter->port_list_lock, flags); in zfcp_fc_eval_gpn_ft()
708 list_for_each_entry_safe(port, tmp, &adapter->port_list, list) in zfcp_fc_eval_gpn_ft()
710 write_unlock_irqrestore(&adapter->port_list_lock, flags); in zfcp_fc_eval_gpn_ft()
727 struct zfcp_adapter *adapter = container_of(dw, struct zfcp_adapter, in zfcp_fc_scan_ports() local
733 zfcp_fc_port_scan_time(adapter); in zfcp_fc_scan_ports()
735 chain = adapter->adapter_features & FSF_FEATURE_ELS_CT_CHAINED_SBALS; in zfcp_fc_scan_ports()
740 if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT && in zfcp_fc_scan_ports()
741 fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPIV) in zfcp_fc_scan_ports()
744 if (zfcp_fc_wka_port_get(&adapter->gs->ds)) in zfcp_fc_scan_ports()
752 ret = zfcp_fc_send_gpn_ft(fc_req, adapter, max_bytes); in zfcp_fc_scan_ports()
754 ret = zfcp_fc_eval_gpn_ft(fc_req, adapter, max_entries); in zfcp_fc_scan_ports()
764 zfcp_fc_wka_port_put(&adapter->gs->ds); in zfcp_fc_scan_ports()
767 static int zfcp_fc_gspn(struct zfcp_adapter *adapter, in zfcp_fc_gspn() argument
779 hton24(gspn_req->gspn.fp_fid, fc_host_port_id(adapter->scsi_host)); in zfcp_fc_gspn()
789 ret = zfcp_fsf_send_ct(&adapter->gs->ds, ct_els, NULL, in zfcp_fc_gspn()
798 if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_NPIV && in zfcp_fc_gspn()
800 snprintf(fc_host_symbolic_name(adapter->scsi_host), in zfcp_fc_gspn()
803 dev_name(&adapter->ccw_device->dev), in zfcp_fc_gspn()
806 strlcpy(fc_host_symbolic_name(adapter->scsi_host), in zfcp_fc_gspn()
812 static void zfcp_fc_rspn(struct zfcp_adapter *adapter, in zfcp_fc_rspn() argument
816 struct Scsi_Host *shost = adapter->scsi_host; in zfcp_fc_rspn()
837 ret = zfcp_fsf_send_ct(&adapter->gs->ds, ct_els, NULL, in zfcp_fc_rspn()
856 struct zfcp_adapter *adapter = container_of(work, struct zfcp_adapter, in zfcp_fc_sym_name_update() local
861 if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT && in zfcp_fc_sym_name_update()
862 fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPIV) in zfcp_fc_sym_name_update()
869 ret = zfcp_fc_wka_port_get(&adapter->gs->ds); in zfcp_fc_sym_name_update()
873 ret = zfcp_fc_gspn(adapter, fc_req); in zfcp_fc_sym_name_update()
874 if (ret || fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPIV) in zfcp_fc_sym_name_update()
878 zfcp_fc_rspn(adapter, fc_req); in zfcp_fc_sym_name_update()
881 zfcp_fc_wka_port_put(&adapter->gs->ds); in zfcp_fc_sym_name_update()
902 struct zfcp_adapter *adapter; in zfcp_fc_job_wka_port() local
907 adapter = (struct zfcp_adapter *) job->shost->hostdata[0]; in zfcp_fc_job_wka_port()
911 return &adapter->gs->as; in zfcp_fc_job_wka_port()
913 return &adapter->gs->ms; in zfcp_fc_job_wka_port()
915 return &adapter->gs->ts; in zfcp_fc_job_wka_port()
918 return &adapter->gs->ds; in zfcp_fc_job_wka_port()
937 struct zfcp_adapter *adapter) in zfcp_fc_exec_els_job() argument
945 port = zfcp_get_port_by_wwpn(adapter, rport->port_name); in zfcp_fc_exec_els_job()
955 return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ); in zfcp_fc_exec_els_job()
959 struct zfcp_adapter *adapter) in zfcp_fc_exec_ct_job() argument
984 struct zfcp_adapter *adapter; in zfcp_fc_exec_bsg_job() local
988 adapter = (struct zfcp_adapter *)shost->hostdata[0]; in zfcp_fc_exec_bsg_job()
990 if (!(atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_OPEN)) in zfcp_fc_exec_bsg_job()
1000 return zfcp_fc_exec_els_job(job, adapter); in zfcp_fc_exec_bsg_job()
1003 return zfcp_fc_exec_ct_job(job, adapter); in zfcp_fc_exec_bsg_job()
1015 int zfcp_fc_gs_setup(struct zfcp_adapter *adapter) in zfcp_fc_gs_setup() argument
1023 adapter->gs = wka_ports; in zfcp_fc_gs_setup()
1024 zfcp_fc_wka_port_init(&wka_ports->ms, FC_FID_MGMT_SERV, adapter); in zfcp_fc_gs_setup()
1025 zfcp_fc_wka_port_init(&wka_ports->ts, FC_FID_TIME_SERV, adapter); in zfcp_fc_gs_setup()
1026 zfcp_fc_wka_port_init(&wka_ports->ds, FC_FID_DIR_SERV, adapter); in zfcp_fc_gs_setup()
1027 zfcp_fc_wka_port_init(&wka_ports->as, FC_FID_ALIASES, adapter); in zfcp_fc_gs_setup()
1032 void zfcp_fc_gs_destroy(struct zfcp_adapter *adapter) in zfcp_fc_gs_destroy() argument
1034 kfree(adapter->gs); in zfcp_fc_gs_destroy()
1035 adapter->gs = NULL; in zfcp_fc_gs_destroy()