Lines Matching refs:fcp
75 ocs_fcp_change_role(struct ocs_softc *ocs, ocs_fcport *fcp, uint32_t new_role);
79 static void ocs_delete_target(ocs_t *ocs, ocs_fcport *fcp, int tgt);
80 uint32_t ocs_add_new_tgt(ocs_node_t *node, ocs_fcport *fcp);
81 uint32_t ocs_update_tgt(ocs_node_t *node, ocs_fcport *fcp, uint32_t tgt_id);
83 int32_t ocs_tgt_find(ocs_fcport *fcp, ocs_node_t *node);
108 ocs_fcport *fcp = FCPORT(ocs, chan); in ocs_attach_port() local
136 fcp->ocs = ocs; in ocs_attach_port()
137 fcp->sim = sim; in ocs_attach_port()
138 fcp->path = path; in ocs_attach_port()
140 callout_init_mtx(&fcp->ldt, &ocs->sim_lock, 0); in ocs_attach_port()
141 TASK_INIT(&fcp->ltask, 1, ocs_ldt_task, fcp); in ocs_attach_port()
149 ocs_fcport *fcp = NULL; in ocs_detach_port() local
152 fcp = FCPORT(ocs, chan); in ocs_detach_port()
154 sim = fcp->sim; in ocs_detach_port()
155 path = fcp->path; in ocs_detach_port()
157 callout_drain(&fcp->ldt); in ocs_detach_port()
158 ocs_ldt_task(fcp, 0); in ocs_detach_port()
160 if (fcp->sim) { in ocs_detach_port()
162 ocs_tgt_resource_abort(ocs, &fcp->targ_rsrc_wildcard); in ocs_detach_port()
166 fcp->path = NULL; in ocs_detach_port()
171 fcp->sim = NULL; in ocs_detach_port()
408 ocs_fcport *fcp = NULL; in ocs_scsi_new_initiator() local
410 fcp = node->sport->tgt_data; in ocs_scsi_new_initiator()
411 if (fcp == NULL) { in ocs_scsi_new_initiator()
428 xpt_async(AC_CONTRACT, fcp->path, &ac); in ocs_scsi_new_initiator()
480 ocs_fcport *fcp = NULL; in ocs_scsi_del_initiator() local
482 fcp = node->sport->tgt_data; in ocs_scsi_del_initiator()
483 if (fcp == NULL) { in ocs_scsi_del_initiator()
494 xpt_async(AC_CONTRACT, fcp->path, &ac); in ocs_scsi_del_initiator()
538 ocs_fcport *fcp = NULL; in ocs_scsi_recv_cmd() local
540 fcp = node->sport->tgt_data; in ocs_scsi_recv_cmd()
541 if (fcp == NULL) { in ocs_scsi_recv_cmd()
558 if ((lun < OCS_MAX_LUN) && fcp->targ_rsrc[lun].enabled) { in ocs_scsi_recv_cmd()
559 trsrc = &fcp->targ_rsrc[lun]; in ocs_scsi_recv_cmd()
560 } else if (fcp->targ_rsrc_wildcard.enabled) { in ocs_scsi_recv_cmd()
561 trsrc = &fcp->targ_rsrc_wildcard; in ocs_scsi_recv_cmd()
668 ocs_fcport *fcp = NULL; in ocs_scsi_recv_tmf() local
670 fcp = node->sport->tgt_data; in ocs_scsi_recv_tmf()
671 if (fcp == NULL) { in ocs_scsi_recv_tmf()
676 if ((lun < OCS_MAX_LUN) && fcp->targ_rsrc[lun].enabled) { in ocs_scsi_recv_tmf()
677 trsrc = &fcp->targ_rsrc[lun]; in ocs_scsi_recv_tmf()
678 } else if (fcp->targ_rsrc_wildcard.enabled) { in ocs_scsi_recv_tmf()
679 trsrc = &fcp->targ_rsrc_wildcard; in ocs_scsi_recv_tmf()
710 if ((lun < OCS_MAX_LUN) && fcp->targ_rsrc[lun].enabled) { in ocs_scsi_recv_tmf()
889 ocs_fcport *fcp = FCPORT(ocs, 0); in ocs_scsi_ini_new_sport() local
892 sport->tgt_data = fcp; in ocs_scsi_ini_new_sport()
893 fcp->fc_id = sport->fc_id; in ocs_scsi_ini_new_sport()
917 ocs_fcport *fcp = FCPORT(ocs, 0); in ocs_scsi_ini_del_sport() local
920 fcp->fc_id = 0; in ocs_scsi_ini_del_sport()
928 ocs_fcport *fcp = NULL; in ocs_scsi_sport_deleted() local
936 fcp = sport->tgt_data; in ocs_scsi_sport_deleted()
945 if ((fcp->role != KNOB_ROLE_NONE)) { in ocs_scsi_sport_deleted()
946 if(fcp->vport->sport != NULL) { in ocs_scsi_sport_deleted()
951 ocs_sport_vport_alloc(ocs->domain, fcp->vport); in ocs_scsi_sport_deleted()
958 ocs_tgt_find(ocs_fcport *fcp, ocs_node_t *node) in ocs_tgt_find() argument
964 tgt = &fcp->tgt[i]; in ocs_tgt_find()
996 ocs_update_tgt(ocs_node_t *node, ocs_fcport *fcp, uint32_t tgt_id) in ocs_update_tgt() argument
1000 tgt = &fcp->tgt[tgt_id]; in ocs_update_tgt()
1012 ocs_add_new_tgt(ocs_node_t *node, ocs_fcport *fcp) in ocs_add_new_tgt() argument
1019 if (fcp->tgt[i].state == OCS_TGT_STATE_NONE) in ocs_add_new_tgt()
1029 cam_sim_path(fcp->sim), in ocs_add_new_tgt()
1037 ocs_update_tgt(node, fcp, i); in ocs_add_new_tgt()
1045 ocs_fcport *fcp = NULL; in ocs_scsi_new_target() local
1048 fcp = node->sport->tgt_data; in ocs_scsi_new_target()
1049 if (fcp == NULL) { in ocs_scsi_new_target()
1054 i = ocs_tgt_find(fcp, node); in ocs_scsi_new_target()
1057 ocs_add_new_tgt(node, fcp); in ocs_scsi_new_target()
1061 ocs_update_tgt(node, fcp, i); in ocs_scsi_new_target()
1066 ocs_delete_target(ocs_t *ocs, ocs_fcport *fcp, int tgt) in ocs_delete_target() argument
1070 if (!fcp->sim) { in ocs_delete_target()
1075 if (CAM_REQ_CMP == xpt_create_path(&cpath, NULL, cam_sim_path(fcp->sim), in ocs_delete_target()
1097 ocs_fcport *fcp = arg; in ocs_ldt() local
1098 taskqueue_enqueue(taskqueue_thread, &fcp->ltask); in ocs_ldt()
1104 ocs_fcport *fcp = arg; in ocs_ldt_task() local
1105 ocs_t *ocs = fcp->ocs; in ocs_ldt_task()
1110 tgt = &fcp->tgt[i]; in ocs_ldt_task()
1124 ocs_delete_target(ocs, fcp, i); in ocs_ldt_task()
1131 callout_reset(&fcp->ldt, hz, ocs_ldt, fcp); in ocs_ldt_task()
1133 callout_deactivate(&fcp->ldt); in ocs_ldt_task()
1165 ocs_fcport *fcp = NULL; in ocs_scsi_del_target() local
1169 fcp = node->sport->tgt_data; in ocs_scsi_del_target()
1170 if (fcp == NULL) { in ocs_scsi_del_target()
1175 tgt_id = ocs_tgt_find(fcp, node); in ocs_scsi_del_target()
1177 tgt = &fcp->tgt[tgt_id]; in ocs_scsi_del_target()
1181 ocs_delete_target(ocs, fcp, tgt_id); in ocs_scsi_del_target()
1186 if (!callout_active(&fcp->ldt)) { in ocs_scsi_del_target()
1187 callout_reset(&fcp->ldt, hz, ocs_ldt, fcp); in ocs_scsi_del_target()
1785 ocs_fcport *fcp = NULL; in ocs_initiator_io() local
1786 fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); in ocs_initiator_io()
1787 if (fcp == NULL) { in ocs_initiator_io()
1792 if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { in ocs_initiator_io()
1798 if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_NONE) { in ocs_initiator_io()
1804 node = ocs_node_get_instance(ocs, fcp->tgt[ccb_h->target_id].node_id); in ocs_initiator_io()
1881 ocs_fcp_change_role(struct ocs_softc *ocs, ocs_fcport *fcp, uint32_t new_role) in ocs_fcp_change_role() argument
1885 ocs_vport_spec_t *vport = fcp->vport; in ocs_fcp_change_role()
1894 fcp->role = new_role; in ocs_fcp_change_role()
1916 if ((fcp->role != KNOB_ROLE_NONE)){ in ocs_fcp_change_role()
1917 fcp->role = new_role; in ocs_fcp_change_role()
1924 fcp->role = new_role; in ocs_fcp_change_role()
1929 if (fcp->role != KNOB_ROLE_NONE) { in ocs_fcp_change_role()
1995 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2023 fc->port = fcp->fc_id; in ocs_action()
2068 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2083 tgt = &fcp->tgt[cts->ccb_h.target_id]; in ocs_action()
2131 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2148 knob->xport_specific.fc.wwnn = fcp->vport->wwnn; in ocs_action()
2149 knob->xport_specific.fc.wwpn = fcp->vport->wwpn; in ocs_action()
2152 knob->xport_specific.fc.role = fcp->role; in ocs_action()
2164 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2183 if (fcp->role != KNOB_ROLE_NONE) { in ocs_action()
2188 if (fcp->role != KNOB_ROLE_TARGET) { in ocs_action()
2193 if (fcp->role != KNOB_ROLE_INITIATOR) { in ocs_action()
2198 if (fcp->role != KNOB_ROLE_BOTH) { in ocs_action()
2211 bus, fcp->role, knob->xport_specific.fc.role); in ocs_action()
2213 ocs_fcp_change_role(ocs, fcp, knob->xport_specific.fc.role); in ocs_action()
2266 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2268 node = ocs_node_get_instance(ocs, fcp->tgt[ccb_h->target_id].node_id); in ocs_action()
2308 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2315 trsrc = ocs_tgt_resource_get(fcp, &ccb->ccb_h, &status); in ocs_action()
2353 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2357 trsrc = ocs_tgt_resource_get(fcp, &ccb->ccb_h, &status); in ocs_action()
2501 static ocs_tgt_resource_t *ocs_tgt_resource_get(ocs_fcport *fcp, in ocs_tgt_resource_get() argument
2512 return &fcp->targ_rsrc_wildcard; in ocs_tgt_resource_get()
2515 return &fcp->targ_rsrc[lun]; in ocs_tgt_resource_get()
2566 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_abort_atio() local
2568 trsrc = ocs_tgt_resource_get(fcp, &accb->ccb_h, &status); in ocs_abort_atio()
2625 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_abort_inot() local
2627 trsrc = ocs_tgt_resource_get(fcp, &accb->ccb_h, &status); in ocs_abort_inot()
2655 ocs_fcport *fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((accb)->ccb_h.path))); in ocs_abort_initiator_io() local
2656 node = ocs_node_get_instance(ocs, fcp->tgt[accb->ccb_h.target_id].node_id); in ocs_abort_initiator_io()