int nvkm_ioctl(struct nouveau_client *client, bool supervisor, void *data, u32 size, void **hack) { union { struct nvif_ioctl_v0 v0; } *args = data; int ret; client->super = supervisor; nv_ioctl(client, "size %d\n", size); if (nvif_unpack(args->v0, 0, 0, true)) { nv_ioctl(client, "vers %d type %02x path %d owner %02x\n", args->v0.version, args->v0.type, args->v0.path_nr, args->v0.owner); ret = nvkm_ioctl_path(client->root, args->v0.type, args->v0.path_nr, args->v0.path, data, size, args->v0.owner, &args->v0.route, &args->v0.token); } nv_ioctl(client, "return %d\n", ret); if (hack) { *hack = client->data; client->data = NULL; } client->super = false; return ret; }
int nvkm_ioctl(struct nvkm_client *client, bool supervisor, void *data, u32 size, void **hack) { struct nvkm_object *object = &client->object; union { struct nvif_ioctl_v0 v0; } *args = data; int ret; client->super = supervisor; nvif_ioctl(object, "size %d\n", size); if (nvif_unpack(args->v0, 0, 0, true)) { nvif_ioctl(object, "vers %d type %02x object %016llx owner %02x\n", args->v0.version, args->v0.type, args->v0.object, args->v0.owner); ret = nvkm_ioctl_path(client, args->v0.object, args->v0.type, data, size, args->v0.owner, &args->v0.route, &args->v0.token); } nvif_ioctl(object, "return %d\n", ret); if (hack) { *hack = client->data; client->data = NULL; } client->super = false; return ret; }