Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/smartpqi/smartpqi_ioctl.c
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | default: | ||||
error = ENOTTY; | error = ENOTTY; | ||||
break; | break; | ||||
} | } | ||||
DBG_FUNC("OUT error = %d\n", error); | DBG_FUNC("OUT error = %d\n", error); | ||||
return error; | return error; | ||||
} | } | ||||
static d_open_t smartpqi_open; | |||||
static d_ioctl_t smartpqi_ioctl; | |||||
static d_close_t smartpqi_close; | |||||
static struct cdevsw smartpqi_cdevsw = | static struct cdevsw smartpqi_cdevsw = | ||||
{ | { | ||||
.d_version = D_VERSION, | .d_version = D_VERSION, | ||||
.d_open = smartpqi_open, | .d_open = smartpqi_open, | ||||
.d_close = smartpqi_close, | .d_close = smartpqi_close, | ||||
.d_ioctl = smartpqi_ioctl, | .d_ioctl = smartpqi_ioctl, | ||||
.d_name = "smartpqi", | .d_name = "smartpqi", | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | pqisrc_passthru_ioctl(struct pqisrc_softstate *softs, void *arg, int mode) | ||||
request.task_attribute = SOP_TASK_ATTRIBUTE_SIMPLE; | request.task_attribute = SOP_TASK_ATTRIBUTE_SIMPLE; | ||||
if (iocommand->buf_size > 0) { | if (iocommand->buf_size > 0) { | ||||
request.buffer_length = iocommand->buf_size; | request.buffer_length = iocommand->buf_size; | ||||
request.sg_descriptors[0].addr = ioctl_dma_buf.dma_addr; | request.sg_descriptors[0].addr = ioctl_dma_buf.dma_addr; | ||||
request.sg_descriptors[0].len = iocommand->buf_size; | request.sg_descriptors[0].len = iocommand->buf_size; | ||||
request.sg_descriptors[0].flags = SG_FLAG_LAST; | request.sg_descriptors[0].flags = SG_FLAG_LAST; | ||||
} | } | ||||
tag = pqisrc_get_tag(&softs->taglist); | tag = pqisrc_get_tag(&softs->taglist); | ||||
if (INVALID_ELEM == tag) { | |||||
DBG_ERR("Tag not available\n"); | |||||
ret = PQI_STATUS_FAILURE; | |||||
goto free_mem; | |||||
} | |||||
request.request_id = tag; | request.request_id = tag; | ||||
request.response_queue_id = ob_q->q_id; | request.response_queue_id = ob_q->q_id; | ||||
request.error_index = request.request_id; | request.error_index = request.request_id; | ||||
rcb = &softs->rcb[tag]; | rcb = &softs->rcb[tag]; | ||||
rcb->success_cmp_callback = pqisrc_process_internal_raid_response_success; | rcb->success_cmp_callback = pqisrc_process_internal_raid_response_success; | ||||
rcb->error_cmp_callback = pqisrc_process_internal_raid_response_error; | rcb->error_cmp_callback = pqisrc_process_internal_raid_response_error; | ||||
rcb->tag = tag; | rcb->tag = tag; | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |