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

Lines Matching refs:ocs

43 #include "ocs.h"
66 ocs_t *ocs; /* Pointer to device object */
94 * @param ocs Driver instance's software context.
103 ocs_io_pool_create(ocs_t *ocs, uint32_t num_io, uint32_t num_sgl)
110 io_pool = ocs_malloc(ocs, sizeof(*io_pool), OCS_M_ZERO | OCS_M_NOWAIT);
112 ocs_log_err(ocs, "allocate of IO pool failed\n");
116 io_pool->ocs = ocs;
120 ocs_lock_init(ocs, &io_pool->lock, "io_pool lock[%d]", ocs->instance_index);
122 io_pool->pool = ocs_pool_alloc(ocs, sizeof(ocs_io_t), io_pool->io_num_ios, FALSE);
129 io->ocs = ocs;
132 if (ocs->enable_ini) {
133 rc = ocs_dma_alloc(ocs, &io->cmdbuf, SCSI_CMD_BUF_LENGTH, OCS_MIN_DMA_ALIGNMENT);
135 ocs_log_err(ocs, "ocs_dma_alloc cmdbuf failed\n");
142 rc = ocs_dma_alloc(ocs, &io->rspbuf, SCSI_RSP_BUF_LENGTH, OCS_MIN_DMA_ALIGNMENT);
144 ocs_log_err(ocs, "ocs_dma_alloc cmdbuf failed\n");
150 io->sgl = ocs_malloc(ocs, sizeof(*io->sgl) * num_sgl, OCS_M_NOWAIT | OCS_M_ZERO);
152 ocs_log_err(ocs, "malloc sgl's failed\n");
163 rc = ocs_dma_alloc(ocs, &io->els_req, OCS_ELS_REQ_LEN, OCS_MIN_DMA_ALIGNMENT);
165 ocs_log_err(ocs, "ocs_dma_alloc els_req failed\n");
170 rc = ocs_dma_alloc(ocs, &io->els_rsp, OCS_ELS_GID_PT_RSP_LEN, OCS_MIN_DMA_ALIGNMENT);
172 ocs_log_err(ocs, "ocs_dma_alloc els_rsp failed\n");
194 ocs_t *ocs;
199 ocs = io_pool->ocs;
207 ocs_free(ocs, io->sgl, sizeof(*io->sgl) * io->sgl_allocated);
209 ocs_dma_free(ocs, &io->cmdbuf);
210 ocs_dma_free(ocs, &io->rspbuf);
211 ocs_dma_free(ocs, &io->els_req);
212 ocs_dma_free(ocs, &io->els_rsp);
219 ocs_free(ocs, io_pool, sizeof(*io_pool));
220 ocs->xport->io_pool = NULL;
243 ocs_t *ocs;
247 ocs = io_pool->ocs;
257 io->ocs = ocs;
268 ocs_atomic_add_return(&ocs->xport->io_active_count, 1);
269 ocs_atomic_add_return(&ocs->xport->io_total_alloc, 1);
286 ocs_t *ocs;
291 ocs = io_pool->ocs;
300 ocs_hw_io_free(&ocs->hw, hio);
303 ocs_atomic_sub_return(&ocs->xport->io_active_count, 1);
304 ocs_atomic_add_return(&ocs->xport->io_total_free, 1);
311 * @param ocs Driver instance's software context.
317 ocs_io_find_tgt_io(ocs_t *ocs, ocs_node_t *node, uint16_t ox_id, uint16_t rx_id)
338 * @param ocs Pointer to driver structure.
344 ocs_io_get_instance(ocs_t *ocs, uint32_t index)
346 ocs_xport_t *xport = ocs->xport;