Lines Matching refs:ucmd
33 static int ucmd_respond(struct fwctl_ucmd *ucmd, size_t cmd_len) in ucmd_respond() argument
35 if (copy_to_user(ucmd->ubuffer, ucmd->cmd, in ucmd_respond()
36 min_t(size_t, ucmd->user_size, cmd_len))) in ucmd_respond()
56 static int fwctl_cmd_info(struct fwctl_ucmd *ucmd) in fwctl_cmd_info() argument
58 struct fwctl_device *fwctl = ucmd->uctx->fwctl; in fwctl_cmd_info()
59 struct fwctl_info *cmd = ucmd->cmd; in fwctl_cmd_info()
71 fwctl->ops->info(ucmd->uctx, &driver_info_len); in fwctl_cmd_info()
83 return ucmd_respond(ucmd, sizeof(*cmd)); in fwctl_cmd_info()
86 static int fwctl_cmd_rpc(struct fwctl_ucmd *ucmd) in fwctl_cmd_rpc() argument
88 struct fwctl_device *fwctl = ucmd->uctx->fwctl; in fwctl_cmd_rpc()
89 struct fwctl_rpc *cmd = ucmd->cmd; in fwctl_cmd_rpc()
125 ucmd->uctx, cmd->scope, inbuf, cmd->in_len, &out_len); in fwctl_cmd_rpc()
138 return ucmd_respond(ucmd, sizeof(*cmd)); in fwctl_cmd_rpc()
151 int (*execute)(struct fwctl_ucmd *ucmd);
173 struct fwctl_ucmd ucmd = {}; in fwctl_fops_ioctl() local
186 ucmd.uctx = uctx; in fwctl_fops_ioctl()
187 ucmd.cmd = &buf; in fwctl_fops_ioctl()
188 ucmd.ubuffer = (void __user *)arg; in fwctl_fops_ioctl()
189 ret = get_user(ucmd.user_size, (u32 __user *)ucmd.ubuffer); in fwctl_fops_ioctl()
193 if (ucmd.user_size < op->min_size) in fwctl_fops_ioctl()
196 ret = copy_struct_from_user(ucmd.cmd, op->size, ucmd.ubuffer, in fwctl_fops_ioctl()
197 ucmd.user_size); in fwctl_fops_ioctl()
204 return op->execute(&ucmd); in fwctl_fops_ioctl()