Lines Matching full:ocs
41 #include "ocs.h"
46 #define frame_printf(ocs, hdr, fmt, ...) \ argument
50 ocs_log_debug(ocs, "[%06x.%s] %02x/%04x/%04x: " fmt, fc_be24toh((hdr)->d_id), s_id_text, \
54 static int32_t ocs_unsol_process(ocs_t *ocs, ocs_hw_sequence_t *seq);
64 static int32_t ocs_purge_pending(ocs_t *ocs, ocs_list_t *pend_list, ocs_lock_t *list_lock);
80 ocs_t *ocs = thread_data->ocs; in ocs_unsol_rq_thread() local
84 ocs_log_debug(ocs, "%s running\n", mythread->name); in ocs_unsol_rq_thread()
102 ocs_log_debug(ocs, "%s exiting\n", mythread->name); in ocs_unsol_rq_thread()
117 ocs_t *ocs = arg; in ocs_unsol_abort_cb() local
120 ocs_log_debug(ocs, "xri=0x%x tag=0x%x\n", hio->indicator, hio->reqtag); in ocs_unsol_abort_cb()
121 ocs_hw_io_free(&ocs->hw, hio); in ocs_unsol_abort_cb()
131 ocs_port_owned_abort(ocs_t *ocs, ocs_hw_io_t *hio) in ocs_port_owned_abort() argument
134 hw_rc = ocs_hw_io_abort(&ocs->hw, hio, FALSE, in ocs_port_owned_abort()
135 ocs_unsol_abort_cb, ocs); in ocs_port_owned_abort()
138 ocs_log_debug(ocs, "already aborted XRI 0x%x\n", hio->indicator); in ocs_port_owned_abort()
140 ocs_log_debug(ocs, "Error aborting XRI 0x%x status %d\n", in ocs_port_owned_abort()
161 ocs_t *ocs = arg; in ocs_unsolicited_cb() local
162 ocs_xport_t *xport = ocs->xport; in ocs_unsolicited_cb()
167 if (ocs->rq_threads == 0) { in ocs_unsolicited_cb()
168 rc = ocs_unsol_process(ocs, seq); in ocs_unsolicited_cb()
173 uint32_t thr_index = ox_id % ocs->rq_threads; in ocs_unsolicited_cb()
179 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_unsolicited_cb()
192 * @param ocs Pointer to the ocs structure.
198 ocs_unsol_process(ocs_t *ocs, ocs_hw_sequence_t *seq) in ocs_unsol_process() argument
205 if (ocs->hw.workaround.override_fcfi) { in ocs_unsol_process()
206 if (ocs->hw.first_domain_idx > -1) { in ocs_unsol_process()
207 seq_fcfi = ocs->hw.first_domain_idx; in ocs_unsol_process()
212 if (seq_fcfi < ARRAY_SIZE(ocs->xport->fcfi)) { in ocs_unsol_process()
213 xport_fcfi = &ocs->xport->fcfi[seq_fcfi]; in ocs_unsol_process()
218 ocs_log_test(ocs, "FCFI %d is not valid, dropping frame\n", seq->fcfi); in ocs_unsol_process()
220 ocs_port_owned_abort(ocs, seq->hio); in ocs_unsol_process()
223 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_unsol_process()
226 domain = ocs_hw_domain_get(&ocs->hw, seq_fcfi); in ocs_unsol_process()
251 ocs_port_owned_abort(ocs, seq->hio); in ocs_unsol_process()
253 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_unsol_process()
275 ocs_t *ocs = node->ocs; in ocs_process_node_pending() local
303 ocs_port_owned_abort(ocs, seq->hio); in ocs_process_node_pending()
305 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_process_node_pending()
310 ocs_log_debug(ocs, "%u node frames held and processed\n", pend_frames_processed); in ocs_process_node_pending()
333 ocs_t *ocs = domain->ocs; in ocs_domain_process_pending() local
339 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator]; in ocs_domain_process_pending()
365 ocs_port_owned_abort(ocs, seq->hio); in ocs_domain_process_pending()
367 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_domain_process_pending()
371 ocs_log_debug(ocs, "%u domain frames held and processed\n", pend_frames_processed); in ocs_domain_process_pending()
384 * @param ocs Pointer to ocs object.
392 ocs_purge_pending(ocs_t *ocs, ocs_list_t *pend_list, ocs_lock_t *list_lock) in ocs_purge_pending() argument
402 frame_printf(ocs, (fc_header_t*) frame->header->dma.virt, "Discarding held frame\n"); in ocs_purge_pending()
404 ocs_port_owned_abort(ocs, frame->hio); in ocs_purge_pending()
406 ocs_hw_sequence_free(&ocs->hw, frame); in ocs_purge_pending()
428 return ocs_purge_pending(node->ocs, &node->pend_frames, &node->pend_frames_lock); in ocs_node_purge_pending()
447 ocs_t *ocs = domain->ocs; in ocs_domain_purge_pending() local
451 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator]; in ocs_domain_purge_pending()
452 return ocs_purge_pending(domain->ocs, in ocs_domain_purge_pending()
490 ocs_t *ocs = domain->ocs; in ocs_domain_frames_held() local
495 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator]; in ocs_domain_frames_held()
515 ocs_t *ocs = domain->ocs; in ocs_domain_hold_frames() local
519 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator]; in ocs_domain_hold_frames()
521 ocs_log_debug(domain->ocs, "hold frames set for FCFI %d\n", in ocs_domain_hold_frames()
543 ocs_t *ocs = domain->ocs; in ocs_domain_accept_frames() local
547 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator]; in ocs_domain_accept_frames()
549 ocs_log_debug(domain->ocs, "hold frames cleared for FCFI %d\n", in ocs_domain_accept_frames()
564 * @param arg Pointer to ocs object.
575 ocs_t *ocs = domain->ocs; in ocs_domain_dispatch_frame() local
594 frame_printf(ocs, hdr, "phy sport for FC ID 0x%06x is NULL, dropping frame\n", d_id); in ocs_domain_dispatch_frame()
604 ocs_log_warn(ocs, "unsolicited FCP frame with invalid d_id x%x, dropping\n", in ocs_domain_dispatch_frame()
624 ocs_log_debug(ocs, "solicited data/ctrl frame without node, dropping\n"); in ocs_domain_dispatch_frame()
629 ocs_log_err(ocs, "ocs_node_alloc() failed\n"); in ocs_domain_dispatch_frame()
638 frame_printf(ocs, hdr, "Holding frame\n"); in ocs_domain_dispatch_frame()
788 ocs_validate_fcp_cmd(ocs_t *ocs, ocs_hw_sequence_t *seq) in ocs_validate_fcp_cmd() argument
801 ocs_log_debug(ocs, "dropping ox_id %04x with payload length (%zd) less than expected (%zd)\n", in ocs_validate_fcp_cmd()
882 ocs_t *ocs = node->ocs; in ocs_dispatch_fcp_cmd() local
895 if (ocs_validate_fcp_cmd(ocs, seq)) { in ocs_dispatch_fcp_cmd()
909 rc = ocs_hw_get(&ocs->hw, OCS_HW_SEND_FRAME_CAPABLE, &send_frame_capable); in ocs_dispatch_fcp_cmd()
913 ocs_log_test(ocs, "ocs_sframe_send_task_set_full_or_busy failed: %d\n", rc); in ocs_dispatch_fcp_cmd()
918 ocs_log_err(ocs, "IO allocation failed ox_id %04x\n", ocs_be16toh(fchdr->ox_id)); in ocs_dispatch_fcp_cmd()
931 ocs_log_err(ocs, "ESP Header present. Fix ESP Size.\n"); in ocs_dispatch_fcp_cmd()
959 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_dispatch_fcp_cmd()
980 ocs_t *ocs = node->ocs; in ocs_dispatch_fcp_cmd_auto_xfer_rdy() local
991 if (ocs_validate_fcp_cmd(ocs, seq)) { in ocs_dispatch_fcp_cmd_auto_xfer_rdy()
1010 rc = ocs_hw_get(&ocs->hw, OCS_HW_SEND_FRAME_CAPABLE, &send_frame_capable); in ocs_dispatch_fcp_cmd_auto_xfer_rdy()
1014 ocs_log_test(ocs, "ocs_sframe_send_task_set_full_or_busy failed: %d\n", rc); in ocs_dispatch_fcp_cmd_auto_xfer_rdy()
1019 ocs_log_err(ocs, "IO allocation failed ox_id %04x\n", ocs_be16toh(fchdr->ox_id)); in ocs_dispatch_fcp_cmd_auto_xfer_rdy()
1029 ocs_log_err(ocs, "TMF flags set 0x%x\n", cmnd->task_management_flags); in ocs_dispatch_fcp_cmd_auto_xfer_rdy()
1036 ocs_hw_io_activate_port_owned(&ocs->hw, seq->hio); in ocs_dispatch_fcp_cmd_auto_xfer_rdy()
1049 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_dispatch_fcp_cmd_auto_xfer_rdy()
1071 ocs_t *ocs = node->ocs; in ocs_dispatch_fcp_data() local
1072 ocs_hw_t *hw = &ocs->hw; in ocs_dispatch_fcp_data()
1082 ocs_log_err(ocs, "data received for NULL io, xri=0x%x\n", in ocs_dispatch_fcp_data()
1092 ocs_log_err(ocs, "data received for host owned XRI, xri=0x%x\n", in ocs_dispatch_fcp_data()
1099 ocs_log_err(ocs, "data with status 0x%x received, xri=0x%x\n", in ocs_dispatch_fcp_data()
1107 ocs_port_owned_abort(ocs, seq->hio); in ocs_dispatch_fcp_data()
1128 ocs_log_err(ocs, "error passing first burst, xri=0x%x, oxid=0x%x\n", in ocs_dispatch_fcp_data()
1133 ocs_hw_sequence_free(&ocs->hw, seq); in ocs_dispatch_fcp_data()
1230 ocs_t *ocs = node->ocs; in ocs_sframe_common_send() local
1231 ocs_hw_t *hw = &ocs->hw; in ocs_sframe_common_send()
1289 rc = ocs_hw_send_frame(&ocs->hw, (void*)&hdr, FC_SOFI3, FC_EOFT, &ctx->payload, ctx, in ocs_sframe_common_send()
1292 ocs_log_test(ocs, "ocs_hw_send_frame failed: %d\n", rc); in ocs_sframe_common_send()
1358 ocs_log_test(node->ocs, "ocs_sframe_send_fcp_rsp failed: %d\n", rc); in ocs_sframe_send_task_set_full_or_busy()