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

Lines Matching refs:ocs

43 #include "ocs.h"
53 #define SCSI_ITT_SIZE(ocs) ((ocs->ocs_xport == OCS_XPORT_FC) ? 4 : 8)
55 #define SCSI_IOFMT_ARGS(io) io->instance_index, SCSI_ITT_SIZE(io->ocs), io->init_task_tag, SCSI_ITT_SIZE(io->ocs), io->tgt_task_tag, io->hw_tag
57 #define enable_tsend_auto_resp(ocs) ((ocs->ctrlmask & OCS_CTRLMASK_XPORT_DISABLE_AUTORSP_TSEND) == 0)
58 #define enable_treceive_auto_resp(ocs) ((ocs->ctrlmask & OCS_CTRLMASK_XPORT_DISABLE_AUTORSP_TRECEIVE) == 0)
60 #define scsi_io_printf(io, fmt, ...) ocs_log_info(io->ocs, "[%s]" SCSI_IOFMT fmt, \
65 if (OCS_LOG_ENABLE_SCSI_TRACE(io->ocs)) \
69 #define scsi_log(ocs, fmt, ...) \
71 if (OCS_LOG_ENABLE_SCSI_TRACE(ocs)) \
72 ocs_log_info(ocs, fmt, ##__VA_ARGS__); \
85 static uint32_t ocs_scsi_dif_check_app_tag(ocs_t *ocs, ocs_hw_dif_info_t *dif_info, uint16_t exp_app_tag, ocs_dif_t *dif);
86 static uint32_t ocs_scsi_dif_check_ref_tag(ocs_t *ocs, ocs_hw_dif_info_t *dif_info, uint32_t exp_ref_tag, ocs_dif_t *dif);
87 static int32_t ocs_scsi_convert_dif_info(ocs_t *ocs, ocs_scsi_dif_info_t *scsi_dif_info,
174 ocs_t *ocs;
179 ocs_assert(node->ocs, NULL);
181 ocs = node->ocs;
182 ocs_assert(ocs->xport, NULL);
183 xport = ocs->xport;
192 io = ocs_io_alloc(ocs);
203 ocs_log_err(node->ocs, "assertion failed: io->hio is not NULL\n");
209 io->ocs = ocs;
252 ocs_t *ocs = io->ocs;
272 ocs_io_free(ocs, io);
323 ocs_t *ocs;
335 ocs = io->ocs;
336 ocs_assert(ocs);
436 ocs_scsi_check_pending(ocs);
506 ocs_t *ocs = io->ocs;
523 ocs_log_debug(ocs, "blocksize %d first check_block %" PRId64 " last_check_block %" PRId64 " check_count %d\n",
529 ocs_log_test(ocs, "ocs_scsi_get_block_vaddr() failed: %d\n", addrlen_count);
535 ocs_log_debug(ocs, "block guard check error, lba %" PRId64 "\n", scsi_dif_info.lba + i);
539 if (! ocs_scsi_dif_check_app_tag(ocs, dif_info, scsi_dif_info.app_tag, dif)) {
540 ocs_log_debug(ocs, "app tag check error, lba %" PRId64 "\n", scsi_dif_info.lba + i);
544 if (! ocs_scsi_dif_check_ref_tag(ocs, dif_info, (scsi_dif_info.ref_tag + i), dif)) {
545 ocs_log_debug(ocs, "ref tag check error, lba %" PRId64 "\n", scsi_dif_info.lba + i);
597 * @param ocs Pointer to the ocs structure for logging.
605 ocs_scsi_dif_check_app_tag(ocs_t *ocs, ocs_hw_dif_info_t *dif_info, uint16_t exp_app_tag, ocs_dif_t *dif)
611 ocs_log_debug(ocs, "expected app tag 0x%x, actual 0x%x\n",
623 * @param ocs Pointer to the ocs structure for logging.
631 ocs_scsi_dif_check_ref_tag(ocs_t *ocs, ocs_hw_dif_info_t *dif_info, uint32_t exp_ref_tag, ocs_dif_t *dif)
638 ocs_log_debug(ocs, "expected ref tag 0x%x, actual 0x%x\n",
690 ocs_t *ocs = hw->os;
699 ocs_log_err(ocs, "ocs_hw_io_init_sges failed: %d\n", rc);
764 ocs_log_err(ocs, "ocs_hw_io_add_sge failed: count=%d rc=%d\n",
777 ocs_log_err(ocs, "ocs_hw_io_add_sge failed: count=%d rc=%d\n",
790 * @param ocs Pointer to the ocs structure for logging.
798 ocs_scsi_convert_dif_info(ocs_t *ocs, ocs_scsi_dif_info_t *scsi_dif_info, ocs_hw_dif_info_t *hw_dif_info)
848 ocs_log_test(ocs, "unhandled SCSI DIF operation %d\n",
873 ocs_log_test(ocs, "unhandled SCSI DIF block size %d\n",
896 ocs_hw_get(&ocs->hw, OCS_HW_DIF_SEED, &dif_seed);
986 * @param ocs Pointer to the OCS structure.
992 ocs_scsi_check_pending(ocs_t *ocs)
994 ocs_xport_t *xport = ocs->xport;
1017 hio = ocs_hw_io_alloc(&ocs->hw);
1052 if (ocs_hw_async_call(&ocs->hw, ocs_scsi_check_pending_async_cb, io)) {
1053 ocs_log_test(ocs, "call to ocs_hw_async_call() failed\n");
1090 if (ocs_hw_async_call(&ocs->hw, ocs_scsi_check_pending_async_cb, io)) {
1091 ocs_log_test(ocs, "call to ocs_hw_async_call() failed\n");
1124 ocs_t *ocs = io->ocs;
1125 ocs_xport_t *xport = ocs->xport;
1160 ocs_scsi_check_pending(ocs);
1169 hio = ocs_hw_io_alloc(&io->ocs->hw);
1203 ocs_t *ocs = io->ocs;
1204 ocs_xport_t *xport = ocs->xport;
1222 ocs_scsi_check_pending(ocs);
1249 ocs_t *ocs = io->ocs;
1281 ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &max_sgl);
1282 ocs_hw_get(&ocs->hw, OCS_HW_SGL_CHAINING_HOST_ALLOCATED, &host_allocated);
1297 rc = ocs_dma_alloc(ocs, &io->ovfl_sgl, count*sizeof(sli4_sge_t), 64);
1299 ocs_log_err(ocs, "ocs_dma_alloc overflow sgl failed\n");
1302 rc = ocs_hw_io_register_sgl(&ocs->hw, io->hio, &io->ovfl_sgl, count);
1305 ocs_log_err(ocs, "ocs_hw_io_register_sgl() failed\n");
1312 rc = ocs_scsi_build_sgls(&ocs->hw, io->hio, &io->hw_dif, io->sgl, io->sgl_count, io->hio_type);
1318 if (OCS_LOG_ENABLE_SCSI_TRACE(ocs)) {
1326 rc = ocs_hw_io_send(&io->ocs->hw, io->hio_type, io->hio, io->wire_len, &io->iparam, &io->node->rnode,
1332 rc = ocs_hw_srrs_send(&ocs->hw, io->hio_type, io->hio,
1339 rc = ocs_hw_srrs_send(&ocs->hw, io->hio_type, io->hio,
1348 rc = ocs_hw_srrs_send(&ocs->hw, io->hio_type, io->hio,
1400 rc = ocs_hw_io_abort(&io->ocs->hw, hio_to_abort, io->send_abts,
1465 ocs_t *ocs;
1476 ocs_hw_get(&io->ocs->hw, OCS_HW_DISABLE_AR_TGT_DIF, &disable_ar_tgt_dif);
1490 ocs = io->ocs;
1491 ocs_assert(ocs, -1);
1505 rc = ocs_scsi_convert_dif_info(ocs, dif_info, &io->hw_dif);
1579 enable_tsend_auto_resp(io->ocs), cb, arg);
1589 enable_treceive_auto_resp(io->ocs), cb, arg);
1606 ocs_dma_free(io->ocs, &io->ovfl_sgl);
1634 ocs_t *ocs;
1644 ocs = io->ocs;
1645 ocs_assert(ocs, -1);
1649 ocs_scsi_convert_dif_info(ocs, NULL, &io->hw_dif);
1682 ocs_log_err(ocs, "NULL response buffer\n");
1754 ocs_t *ocs = NULL;
1760 ocs_assert(io->ocs, -1);
1763 ocs = io->ocs;
1766 ocs_scsi_convert_dif_info(ocs, NULL, &io->hw_dif);
1852 ocs_t *ocs;
1856 ocs_assert(io->ocs, -1);
1858 ocs = io->ocs;
1901 ocs_io_free(ocs, io);
1903 ocs_scsi_check_pending(ocs);
1924 ocs_t *ocs;
1931 ocs_assert(io->ocs, -1);
1933 ocs = io->ocs;
1934 xport = ocs->xport;
1948 abort_io = ocs_io_alloc(ocs);
1998 ocs_t *ocs;
2002 ocs_assert(io->ocs, -1);
2004 ocs = io->ocs;
2025 ocs_scsi_check_pending(ocs);
2096 ocs_log_test(io->ocs, "Got completion for non-busy io with tag 0x%x\n", io->tag);
2126 ocs_t *ocs;
2134 ocs = io->ocs;
2135 ocs_assert(ocs);
2202 ocs_log_test(io->ocs, "[%s]" SCSI_IOFMT "local reject=0x%02x\n",
2233 ocs_scsi_check_pending(ocs);
2487 ocs_t *ocs;
2496 ocs = io->ocs;
2513 if (OCS_LOG_ENABLE_SCSI_TRACE(ocs)) {
2518 ocs_textbuf_init(ocs, &txtbuf, buf, sizeof(buf));
2621 ocs_log_test(ocs, "bad IO type %d\n", io->hio_type);
2625 rc = ocs_scsi_convert_dif_info(ocs, dif_info, &io->hw_dif);
2668 ocs_t *ocs;
2673 ocs_assert(io->ocs, -1);
2675 ocs = io->ocs;
2677 ocs_log_debug(ocs, "status %d ext %d\n", status, ext_status);
2696 ocs_log_test(ocs, "Unhandled local reject 0x%x/0x%x\n", status, ext_status);
2711 ocs_scsi_check_pending(ocs);
2723 * @param ocs Pointer to the ocs.
2729 ocs_scsi_get_property(ocs_t *ocs, ocs_scsi_property_e prop)
2731 ocs_xport_t *xport = ocs->xport;
2736 if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &val)) {
2741 if (ocs->ctrlmask & OCS_CTRLMASK_TEST_CHAINED_SGLS) {
2748 if (0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &val)) {
2755 if (0 == ocs_hw_get(&ocs->hw, OCS_HW_DIF_CAPABLE, &val)) {
2762 if (ocs_hw_get(&ocs->hw, OCS_HW_DIF_MULTI_SEPARATE, &val) == 0) {
2768 if (ocs_hw_get(&ocs->hw, OCS_HW_SEND_FRAME_CAPABLE, &val) == 0) {
2776 ocs_log_debug(ocs, "invalid property request %d\n", prop);
2788 * @param ocs Pointer to the ocs.
2793 void *ocs_scsi_get_property_ptr(ocs_t *ocs, ocs_scsi_property_e prop)
2799 rc = ocs_hw_get_ptr(&ocs->hw, OCS_HW_WWN_NODE);
2802 rc = ocs_hw_get_ptr(&ocs->hw, OCS_HW_WWN_PORT);
2805 rc = ocs_hw_get_ptr(&ocs->hw, OCS_HW_PORTNUM);
2808 rc = ocs_hw_get_ptr(&ocs->hw, OCS_HW_BIOS_VERSION_STRING);
2816 if (ocs_hw_get(&ocs->hw, OCS_HW_VPD_LEN, &vpd_len)) {
2817 ocs_log_test(ocs, "Can't get VPD length\n");
2822 pvpd = ocs_hw_get_ptr(&ocs->hw, OCS_HW_VPD);
2830 scsi_log(ocs, "Note: VPD is missing, using wwnn for serial number\n");
2832 if ((ocs == NULL) || (ocs->domain == NULL) || (ocs->domain->sport == NULL)) {
2835 rc = &ocs->domain->sport->wwnn_str[8];
2845 if (ocs_hw_get(&ocs->hw, OCS_HW_VPD_LEN, &vpd_len)) {
2846 ocs_log_test(ocs, "Can't get VPD length\n");
2850 pvpd = ocs_hw_get_ptr(&ocs->hw, OCS_HW_VPD);
2867 ocs_log_debug(ocs, "invalid property request %d\n", prop);
2937 * @param ocs Pointer to device object.
2943 ocs_scsi_register_bounce(ocs_t *ocs, void(*fctn)(void(*fctn)(void *arg), void *arg, uint32_t s_id, uint32_t d_id,
2948 rc = ocs_hw_callback(&ocs->hw, OCS_HW_CB_BOUNCE, fctn, NULL);
2950 ocs_log_test(ocs, "ocs_hw_callback(OCS_HW_CB_BOUNCE) failed: %d\n", rc);