Lines Matching full:fcp
95 ocs_fcp_change_role(struct ocs_softc *ocs, ocs_fcport *fcp, uint32_t new_role);
99 static void ocs_delete_target(ocs_t *ocs, ocs_fcport *fcp, int tgt);
100 uint32_t ocs_add_new_tgt(ocs_node_t *node, ocs_fcport *fcp);
101 uint32_t ocs_update_tgt(ocs_node_t *node, ocs_fcport *fcp, uint32_t tgt_id);
103 int32_t ocs_tgt_find(ocs_fcport *fcp, ocs_node_t *node);
128 ocs_fcport *fcp = FCPORT(ocs, chan); in ocs_attach_port() local
156 fcp->ocs = ocs; in ocs_attach_port()
157 fcp->sim = sim; in ocs_attach_port()
158 fcp->path = path; in ocs_attach_port()
160 callout_init_mtx(&fcp->ldt, &ocs->sim_lock, 0); in ocs_attach_port()
161 TASK_INIT(&fcp->ltask, 1, ocs_ldt_task, fcp); in ocs_attach_port()
169 ocs_fcport *fcp = NULL; in ocs_detach_port() local
172 fcp = FCPORT(ocs, chan); in ocs_detach_port()
174 sim = fcp->sim; in ocs_detach_port()
175 path = fcp->path; in ocs_detach_port()
177 callout_drain(&fcp->ldt); in ocs_detach_port()
178 ocs_ldt_task(fcp, 0); in ocs_detach_port()
180 if (fcp->sim) { in ocs_detach_port()
182 ocs_tgt_resource_abort(ocs, &fcp->targ_rsrc_wildcard); in ocs_detach_port()
186 fcp->path = NULL; in ocs_detach_port()
191 fcp->sim = NULL; in ocs_detach_port()
427 ocs_fcport *fcp = NULL; in ocs_scsi_new_initiator() local
429 fcp = node->sport->tgt_data; in ocs_scsi_new_initiator()
430 if (fcp == NULL) { in ocs_scsi_new_initiator()
431 ocs_log_err(ocs, "FCP is NULL \n"); in ocs_scsi_new_initiator()
447 xpt_async(AC_CONTRACT, fcp->path, &ac); in ocs_scsi_new_initiator()
499 ocs_fcport *fcp = NULL; in ocs_scsi_del_initiator() local
501 fcp = node->sport->tgt_data; in ocs_scsi_del_initiator()
502 if (fcp == NULL) { in ocs_scsi_del_initiator()
503 ocs_log_err(ocs, "FCP is NULL \n"); in ocs_scsi_del_initiator()
513 xpt_async(AC_CONTRACT, fcp->path, &ac); in ocs_scsi_del_initiator()
530 * @brief receive FCP SCSI Command
556 ocs_fcport *fcp = NULL; in ocs_scsi_recv_cmd() local
558 fcp = node->sport->tgt_data; in ocs_scsi_recv_cmd()
559 if (fcp == NULL) { in ocs_scsi_recv_cmd()
560 ocs_log_err(ocs, "FCP is NULL \n"); in ocs_scsi_recv_cmd()
576 if ((lun < OCS_MAX_LUN) && fcp->targ_rsrc[lun].enabled) { in ocs_scsi_recv_cmd()
577 trsrc = &fcp->targ_rsrc[lun]; in ocs_scsi_recv_cmd()
578 } else if (fcp->targ_rsrc_wildcard.enabled) { in ocs_scsi_recv_cmd()
579 trsrc = &fcp->targ_rsrc_wildcard; in ocs_scsi_recv_cmd()
636 * @brief receive FCP SCSI Command with first burst data.
638 * Receive a new FCP SCSI command from the base driver with first burst data.
689 ocs_fcport *fcp = NULL; in ocs_scsi_recv_tmf() local
691 fcp = node->sport->tgt_data; in ocs_scsi_recv_tmf()
692 if (fcp == NULL) { in ocs_scsi_recv_tmf()
693 ocs_log_err(ocs, "FCP is NULL \n"); in ocs_scsi_recv_tmf()
697 if ((lun < OCS_MAX_LUN) && fcp->targ_rsrc[lun].enabled) { in ocs_scsi_recv_tmf()
698 trsrc = &fcp->targ_rsrc[lun]; in ocs_scsi_recv_tmf()
699 } else if (fcp->targ_rsrc_wildcard.enabled) { in ocs_scsi_recv_tmf()
700 trsrc = &fcp->targ_rsrc_wildcard; in ocs_scsi_recv_tmf()
730 if ((lun < OCS_MAX_LUN) && fcp->targ_rsrc[lun].enabled) { in ocs_scsi_recv_tmf()
908 ocs_fcport *fcp = FCPORT(ocs, 0); in ocs_scsi_ini_new_sport() local
911 sport->tgt_data = fcp; in ocs_scsi_ini_new_sport()
912 fcp->fc_id = sport->fc_id; in ocs_scsi_ini_new_sport()
936 ocs_fcport *fcp = FCPORT(ocs, 0); in ocs_scsi_ini_del_sport() local
939 fcp->fc_id = 0; in ocs_scsi_ini_del_sport()
947 ocs_fcport *fcp = NULL; in ocs_scsi_sport_deleted() local
955 fcp = sport->tgt_data; in ocs_scsi_sport_deleted()
964 if ((fcp->role != KNOB_ROLE_NONE)) { in ocs_scsi_sport_deleted()
965 if(fcp->vport->sport != NULL) { in ocs_scsi_sport_deleted()
970 ocs_sport_vport_alloc(ocs->domain, fcp->vport); in ocs_scsi_sport_deleted()
977 ocs_tgt_find(ocs_fcport *fcp, ocs_node_t *node) in ocs_tgt_find() argument
983 tgt = &fcp->tgt[i]; in ocs_tgt_find()
1015 ocs_update_tgt(ocs_node_t *node, ocs_fcport *fcp, uint32_t tgt_id) in ocs_update_tgt() argument
1019 tgt = &fcp->tgt[tgt_id]; in ocs_update_tgt()
1031 ocs_add_new_tgt(ocs_node_t *node, ocs_fcport *fcp) in ocs_add_new_tgt() argument
1038 if (fcp->tgt[i].state == OCS_TGT_STATE_NONE) in ocs_add_new_tgt()
1048 cam_sim_path(fcp->sim), in ocs_add_new_tgt()
1056 ocs_update_tgt(node, fcp, i); in ocs_add_new_tgt()
1064 ocs_fcport *fcp = NULL; in ocs_scsi_new_target() local
1067 fcp = node->sport->tgt_data; in ocs_scsi_new_target()
1068 if (fcp == NULL) { in ocs_scsi_new_target()
1069 printf("%s:FCP is NULL \n", __func__); in ocs_scsi_new_target()
1073 i = ocs_tgt_find(fcp, node); in ocs_scsi_new_target()
1076 ocs_add_new_tgt(node, fcp); in ocs_scsi_new_target()
1080 ocs_update_tgt(node, fcp, i); in ocs_scsi_new_target()
1085 ocs_delete_target(ocs_t *ocs, ocs_fcport *fcp, int tgt) in ocs_delete_target() argument
1089 if (!fcp->sim) { in ocs_delete_target()
1094 if (CAM_REQ_CMP == xpt_create_path(&cpath, NULL, cam_sim_path(fcp->sim), in ocs_delete_target()
1116 ocs_fcport *fcp = arg; in ocs_ldt() local
1117 taskqueue_enqueue(taskqueue_thread, &fcp->ltask); in ocs_ldt()
1123 ocs_fcport *fcp = arg; in ocs_ldt_task() local
1124 ocs_t *ocs = fcp->ocs; in ocs_ldt_task()
1129 tgt = &fcp->tgt[i]; in ocs_ldt_task()
1141 ocs_delete_target(ocs, fcp, i); in ocs_ldt_task()
1147 callout_reset(&fcp->ldt, hz, ocs_ldt, fcp); in ocs_ldt_task()
1149 callout_deactivate(&fcp->ldt); in ocs_ldt_task()
1181 ocs_fcport *fcp = NULL; in ocs_scsi_del_target() local
1190 fcp = node->sport->tgt_data; in ocs_scsi_del_target()
1191 if (fcp == NULL) { in ocs_scsi_del_target()
1192 ocs_log_err(ocs,"FCP is NULL \n"); in ocs_scsi_del_target()
1196 tgt_id = ocs_tgt_find(fcp, node); in ocs_scsi_del_target()
1202 tgt = &fcp->tgt[tgt_id]; in ocs_scsi_del_target()
1206 ocs_delete_target(ocs, fcp, tgt_id); in ocs_scsi_del_target()
1210 if (!callout_active(&fcp->ldt)) { in ocs_scsi_del_target()
1211 callout_reset(&fcp->ldt, hz, ocs_ldt, fcp); in ocs_scsi_del_target()
1865 ocs_fcport *fcp; in ocs_initiator_io() local
1867 fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); in ocs_initiator_io()
1869 if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { in ocs_initiator_io()
1875 if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_NONE) { in ocs_initiator_io()
1881 node = ocs_node_get_instance(ocs, fcp->tgt[ccb_h->target_id].node_id); in ocs_initiator_io()
1982 ocs_fcp_change_role(struct ocs_softc *ocs, ocs_fcport *fcp, uint32_t new_role) in ocs_fcp_change_role() argument
1986 ocs_vport_spec_t *vport = fcp->vport; in ocs_fcp_change_role()
1995 fcp->role = new_role; in ocs_fcp_change_role()
2017 if ((fcp->role != KNOB_ROLE_NONE)){ in ocs_fcp_change_role()
2018 fcp->role = new_role; in ocs_fcp_change_role()
2025 fcp->role = new_role; in ocs_fcp_change_role()
2030 if (fcp->role != KNOB_ROLE_NONE) { in ocs_fcp_change_role()
2096 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2124 fc->port = fcp->fc_id; in ocs_action()
2170 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2185 tgt = &fcp->tgt[cts->ccb_h.target_id]; in ocs_action()
2233 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2250 knob->xport_specific.fc.wwnn = fcp->vport->wwnn; in ocs_action()
2251 knob->xport_specific.fc.wwpn = fcp->vport->wwpn; in ocs_action()
2254 knob->xport_specific.fc.role = fcp->role; in ocs_action()
2266 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2285 if (fcp->role != KNOB_ROLE_NONE) { in ocs_action()
2290 if (fcp->role != KNOB_ROLE_TARGET) { in ocs_action()
2295 if (fcp->role != KNOB_ROLE_INITIATOR) { in ocs_action()
2300 if (fcp->role != KNOB_ROLE_BOTH) { in ocs_action()
2313 bus, fcp->role, knob->xport_specific.fc.role); in ocs_action()
2315 ocs_fcp_change_role(ocs, fcp, knob->xport_specific.fc.role); in ocs_action()
2371 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2373 node = ocs_node_get_instance(ocs, fcp->tgt[ccb_h->target_id].node_id); in ocs_action()
2413 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2420 trsrc = ocs_tgt_resource_get(fcp, &ccb->ccb_h, &status); in ocs_action()
2458 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_action() local
2462 trsrc = ocs_tgt_resource_get(fcp, &ccb->ccb_h, &status); in ocs_action()
2606 static ocs_tgt_resource_t *ocs_tgt_resource_get(ocs_fcport *fcp, in ocs_tgt_resource_get() argument
2617 return &fcp->targ_rsrc_wildcard; in ocs_tgt_resource_get()
2620 return &fcp->targ_rsrc[lun]; in ocs_tgt_resource_get()
2666 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_abort_atio() local
2668 trsrc = ocs_tgt_resource_get(fcp, &accb->ccb_h, &status); in ocs_abort_atio()
2725 ocs_fcport *fcp = FCPORT(ocs, bus); in ocs_abort_inot() local
2727 trsrc = ocs_tgt_resource_get(fcp, &accb->ccb_h, &status); in ocs_abort_inot()
2755 ocs_fcport *fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((accb)->ccb_h.path))); in ocs_abort_initiator_io() local
2756 node = ocs_node_get_instance(ocs, fcp->tgt[accb->ccb_h.target_id].node_id); in ocs_abort_initiator_io()