• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/ocs_fc/

Lines Matching refs:ocs

43 #include "ocs.h"
48 #define frame_printf(ocs, hdr, fmt, ...) \
52 ocs_log_debug(ocs, "[%06x.%s] %02x/%04x/%04x: " fmt, fc_be24toh((hdr)->d_id), s_id_text, \
56 static int32_t ocs_unsol_process(ocs_t *ocs, ocs_hw_sequence_t *seq);
66 static int32_t ocs_purge_pending(ocs_t *ocs, ocs_list_t *pend_list, ocs_lock_t *list_lock);
82 ocs_t *ocs = thread_data->ocs;
86 ocs_log_debug(ocs, "%s running\n", mythread->name);
104 ocs_log_debug(ocs, "%s exiting\n", mythread->name);
119 ocs_t *ocs = arg;
122 ocs_log_debug(ocs, "xri=0x%x tag=0x%x\n", hio->indicator, hio->reqtag);
123 ocs_hw_io_free(&ocs->hw, hio);
133 ocs_port_owned_abort(ocs_t *ocs, ocs_hw_io_t *hio)
136 hw_rc = ocs_hw_io_abort(&ocs->hw, hio, FALSE,
137 ocs_unsol_abort_cb, ocs);
140 ocs_log_debug(ocs, "already aborted XRI 0x%x\n", hio->indicator);
142 ocs_log_debug(ocs, "Error aborting XRI 0x%x status %d\n",
163 ocs_t *ocs = arg;
164 ocs_xport_t *xport = ocs->xport;
169 if (ocs->rq_threads == 0) {
170 rc = ocs_unsol_process(ocs, seq);
175 uint32_t thr_index = ox_id % ocs->rq_threads;
181 ocs_hw_sequence_free(&ocs->hw, seq);
194 * @param ocs Pointer to the ocs structure.
200 ocs_unsol_process(ocs_t *ocs, ocs_hw_sequence_t *seq)
207 if (ocs->hw.workaround.override_fcfi) {
208 if (ocs->hw.first_domain_idx > -1) {
209 seq_fcfi = ocs->hw.first_domain_idx;
214 if (seq_fcfi < ARRAY_SIZE(ocs->xport->fcfi)) {
215 xport_fcfi = &ocs->xport->fcfi[seq_fcfi];
220 ocs_log_test(ocs, "FCFI %d is not valid, dropping frame\n", seq->fcfi);
222 ocs_port_owned_abort(ocs, seq->hio);
225 ocs_hw_sequence_free(&ocs->hw, seq);
228 domain = ocs_hw_domain_get(&ocs->hw, seq_fcfi);
253 ocs_port_owned_abort(ocs, seq->hio);
255 ocs_hw_sequence_free(&ocs->hw, seq);
277 ocs_t *ocs = node->ocs;
305 ocs_port_owned_abort(ocs, seq->hio);
307 ocs_hw_sequence_free(&ocs->hw, seq);
312 ocs_log_debug(ocs, "%u node frames held and processed\n", pend_frames_processed);
335 ocs_t *ocs = domain->ocs;
341 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator];
367 ocs_port_owned_abort(ocs, seq->hio);
369 ocs_hw_sequence_free(&ocs->hw, seq);
373 ocs_log_debug(ocs, "%u domain frames held and processed\n", pend_frames_processed);
386 * @param ocs Pointer to ocs object.
394 ocs_purge_pending(ocs_t *ocs, ocs_list_t *pend_list, ocs_lock_t *list_lock)
404 frame_printf(ocs, (fc_header_t*) frame->header->dma.virt, "Discarding held frame\n");
406 ocs_port_owned_abort(ocs, frame->hio);
408 ocs_hw_sequence_free(&ocs->hw, frame);
430 return ocs_purge_pending(node->ocs, &node->pend_frames, &node->pend_frames_lock);
449 ocs_t *ocs = domain->ocs;
453 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator];
454 return ocs_purge_pending(domain->ocs,
492 ocs_t *ocs = domain->ocs;
497 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator];
517 ocs_t *ocs = domain->ocs;
521 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator];
523 ocs_log_debug(domain->ocs, "hold frames set for FCFI %d\n",
545 ocs_t *ocs = domain->ocs;
549 xport_fcfi = &ocs->xport->fcfi[domain->fcf_indicator];
551 ocs_log_debug(domain->ocs, "hold frames cleared for FCFI %d\n",
566 * @param arg Pointer to ocs object.
577 ocs_t *ocs = domain->ocs;
596 frame_printf(ocs, hdr, "phy sport for FC ID 0x%06x is NULL, dropping frame\n", d_id);
606 ocs_log_warn(ocs, "unsolicited FCP frame with invalid d_id x%x, dropping\n",
626 ocs_log_debug(ocs, "solicited data/ctrl frame without node, dropping\n");
631 ocs_log_err(ocs, "ocs_node_alloc() failed\n");
640 frame_printf(ocs, hdr, "Holding frame\n");
790 ocs_validate_fcp_cmd(ocs_t *ocs, ocs_hw_sequence_t *seq)
803 ocs_log_debug(ocs, "dropping ox_id %04x with payload length (%zd) less than expected (%zd)\n",
884 ocs_t *ocs = node->ocs;
897 if (ocs_validate_fcp_cmd(ocs, seq)) {
911 rc = ocs_hw_get(&ocs->hw, OCS_HW_SEND_FRAME_CAPABLE, &send_frame_capable);
915 ocs_log_test(ocs, "ocs_sframe_send_task_set_full_or_busy failed: %d\n", rc);
920 ocs_log_err(ocs, "IO allocation failed ox_id %04x\n", ocs_be16toh(fchdr->ox_id));
933 ocs_log_err(ocs, "ESP Header present. Fix ESP Size.\n");
961 ocs_hw_sequence_free(&ocs->hw, seq);
982 ocs_t *ocs = node->ocs;
993 if (ocs_validate_fcp_cmd(ocs, seq)) {
1012 rc = ocs_hw_get(&ocs->hw, OCS_HW_SEND_FRAME_CAPABLE, &send_frame_capable);
1016 ocs_log_test(ocs, "ocs_sframe_send_task_set_full_or_busy failed: %d\n", rc);
1021 ocs_log_err(ocs, "IO allocation failed ox_id %04x\n", ocs_be16toh(fchdr->ox_id));
1031 ocs_log_err(ocs, "TMF flags set 0x%x\n", cmnd->task_management_flags);
1038 ocs_hw_io_activate_port_owned(&ocs->hw, seq->hio);
1051 ocs_hw_sequence_free(&ocs->hw, seq);
1073 ocs_t *ocs = node->ocs;
1074 ocs_hw_t *hw = &ocs->hw;
1084 ocs_log_err(ocs, "data received for NULL io, xri=0x%x\n",
1094 ocs_log_err(ocs, "data received for host owned XRI, xri=0x%x\n",
1101 ocs_log_err(ocs, "data with status 0x%x received, xri=0x%x\n",
1109 ocs_port_owned_abort(ocs, seq->hio);
1130 ocs_log_err(ocs, "error passing first burst, xri=0x%x, oxid=0x%x\n",
1135 ocs_hw_sequence_free(&ocs->hw, seq);
1232 ocs_t *ocs = node->ocs;
1233 ocs_hw_t *hw = &ocs->hw;
1291 rc = ocs_hw_send_frame(&ocs->hw, (void*)&hdr, FC_SOFI3, FC_EOFT, &ctx->payload, ctx,
1294 ocs_log_test(ocs, "ocs_hw_send_frame failed: %d\n", rc);
1360 ocs_log_test(node->ocs, "ocs_sframe_send_fcp_rsp failed: %d\n", rc);