Lines Matching defs:ioctl

121 #define	VD_EFI_DEV_SET(dev, vdsk, ioctl)	\
122 VDSK_EFI_DEV_SET(dev, vdsk, ioctl, \
540 int cmd; /* corresponding ioctl cmd */
541 const char *cmd_name; /* ioctl cmd name */
542 void *arg; /* ioctl cmd argument */
1394 * Build and execute the uscsi ioctl. We build a group0, group1
3039 * ENOTSUP - Unknown disk label type or unsupported DKIO ioctl
3407 * Call the appropriate function to execute the ioctl depending
3458 PR0("ioctl %x set rval = %d, which is not being returned"
3468 * This is the function that processes the ioctl requests (farming it
3472 * 0 - ioctl operation completed successfully
3477 * sets request->status to the return value of the ioctl function.
3480 vd_do_ioctl(vd_t *vd, vd_dring_payload_t *request, void* buf, vd_ioctl_t *ioctl)
3487 PR0("Performing %s", ioctl->operation_name);
3490 if (ioctl->copyin != NULL) {
3502 if (ioctl->copyin == VD_IDENTITY_IN) {
3504 ioctl->arg = buf;
3506 /* convert client vdisk operation data to ioctl data */
3507 status = (ioctl->copyin)(buf, nbytes,
3508 (void *)ioctl->arg);
3516 if (ioctl->operation == VD_OP_SCSICMD) {
3517 struct uscsi_cmd *uscsi = (struct uscsi_cmd *)ioctl->arg;
3529 * Send the ioctl to the disk backend.
3531 request->status = vd_backend_ioctl(vd, ioctl->cmd, ioctl->arg);
3534 PR0("ioctl(%s) = errno %d", ioctl->cmd_name, request->status);
3535 if (ioctl->operation == VD_OP_SCSICMD &&
3536 ((struct uscsi_cmd *)ioctl->arg)->uscsi_status != 0)
3551 if (ioctl->copyout != NULL) {
3555 /* Convert ioctl data to vdisk operation data, if necessary */
3556 if (ioctl->copyout != VD_IDENTITY_OUT)
3557 (ioctl->copyout)((void *)ioctl->arg, buf);
3613 vd_ioctl_t ioctl[] = {
3653 size_t nioctls = (sizeof (ioctl))/(sizeof (ioctl[0]));
3661 * Determine ioctl corresponding to caller's "operation" and
3665 if (request->operation == ioctl[i].operation) {
3667 ASSERT(ioctl[i].nbytes % sizeof (uint64_t) == 0);
3672 if (request->nbytes >= ioctl[i].nbytes)
3675 "got %lu", ioctl[i].operation_name,
3676 ioctl[i].nbytes, request->nbytes);
3680 if (request->nbytes != ioctl[i].nbytes) {
3682 ioctl[i].operation_name, ioctl[i].nbytes,
3692 if (!(vd->open_flags & FWRITE) && ioctl[i].write) {
3694 ioctl[i].operation_name);
3701 status = vd_do_ioctl(vd, request, buf, &ioctl[i]);
3960 * can use preemption. So we can use the MHIOCTKNOWN ioctl.
3971 * host. So we need to use the MHIOCTKOWN ioctl to enable the
3974 * MHIOCQRESERVE ioctl to ensure we can get exclusive rights
4193 * Any request errors (e.g. ENOTTY from an ioctl) are saved in
6275 /* try with the non-extended vtoc ioctl */
6327 * ioctl). This block size is expected to be a power of 2 and a multiple of