Lines Matching refs:ctx

145 	pvscsi_cmd_ctx_t *ctx, *end;
148 for (ctx = pvs->cmd_ctx; ctx < end; ctx++) {
149 if (ctx->cmd == cmd)
150 return (ctx);
157 pvscsi_resolve_ctx(pvscsi_softc_t *pvs, uint64_t ctx)
159 if (ctx > 0 && ctx <= pvs->req_depth)
160 return (&pvs->cmd_ctx[ctx - 1]);
168 pvscsi_cmd_ctx_t *ctx;
173 ctx = (pvscsi_cmd_ctx_t *)list_remove_head(&pvs->cmd_ctx_pool);
174 ASSERT(ctx != NULL);
176 ctx->cmd = cmd;
177 cmd->ctx = ctx;
189 cmd->ctx->cmd = NULL;
190 list_insert_tail(&pvs->cmd_ctx_pool, cmd->ctx);
191 cmd->ctx = NULL;
471 pvscsi_cmd_ctx_t *ctx;
477 ctx = pvscsi_resolve_ctx(pvs, cdesc->context);
478 ASSERT(ctx != NULL);
480 if ((cmd = ctx->cmd) != NULL) {
594 acmd.context = pvscsi_map_ctx(pvs, cmd->ctx);
607 /* Release I/O ctx */
609 if (cmd->ctx != NULL)
629 ASSERT(cmd->ctx);
640 struct PVSCSISGElement *sgl = CMD_CTX_SGLIST_VA(cmd->ctx);
648 rdesc->dataAddr = (uint64_t)CMD_CTX_SGLIST_PA(cmd->ctx);
808 /* Release I/O ctx */
809 if (cmd->ctx != NULL)
1026 dev_err(pvs->dip, CE_WARN, "!no free ctx available");
1078 rdesc->context = pvscsi_map_ctx(pvs, cmd->ctx);
1251 pvscsi_cmd_ctx_t *ctx;
1254 ctx = pvs->cmd_ctx = kmem_zalloc(size, KM_SLEEP);
1256 for (i = 0; i < pvs->req_depth; ++i, ++ctx) {
1257 list_insert_tail(&pvs->cmd_ctx_pool, ctx);
1259 &ctx->dma_buf) != DDI_SUCCESS)
1266 for (; i >= 0; --i, --ctx) {
1267 list_remove(&pvs->cmd_ctx_pool, ctx);
1268 pvscsi_free_dma_buffer(&ctx->dma_buf);
1279 pvscsi_cmd_ctx_t *ctx = pvs->cmd_ctx;
1281 for (i = 0; i < pvs->req_depth; ++i, ++ctx) {
1282 list_remove(&pvs->cmd_ctx_pool, ctx);
1283 pvscsi_free_dma_buffer(&ctx->dma_buf);
1995 if (cmd->ctx != NULL) {
2057 cmd->ctx = NULL;