Lines Matching refs:ntfy

57 	struct usif_notify *ntfy;
58 list_for_each_entry(ntfy, &cli->notifys, head) {
59 if (ntfy->handle == handle)
60 return ntfy;
66 usif_notify_dtor(struct usif_notify *ntfy)
68 list_del(&ntfy->head);
69 kfree(ntfy);
75 struct usif_notify *ntfy = NULL;
84 if (WARN_ON(!(ntfy = (void *)(unsigned long)rep->v0.token)))
91 if (WARN_ON(!ntfy->p || ntfy->reply != (length + size)))
93 filp = ntfy->p->base.file_priv;
96 memcpy(&ntfy->p->e.data[0], header, length);
97 memcpy(&ntfy->p->e.data[length], data, size);
100 struct nvif_notify_rep_v0 *rep = (void *)ntfy->p->e.data;
101 rep->route = ntfy->route;
102 rep->token = ntfy->token;
111 if (!WARN_ON(filp->event_space < ntfy->p->e.base.length)) {
112 list_add_tail(&ntfy->p->base.link, &filp->event_list);
113 filp->event_space -= ntfy->p->e.base.length;
117 atomic_set(&ntfy->enabled, 0);
132 struct usif_notify *ntfy;
143 if (!(ntfy = kmalloc(sizeof(*ntfy), GFP_KERNEL)))
145 atomic_set(&ntfy->enabled, 0);
148 ntfy->reply = sizeof(struct nvif_notify_rep_v0) + req->v0.reply;
149 ntfy->route = req->v0.route;
150 ntfy->token = req->v0.token;
152 req->v0.token = (unsigned long)(void *)ntfy;
154 req->v0.token = ntfy->token;
155 req->v0.route = ntfy->route;
156 ntfy->handle = args->v0.index;
160 list_add(&ntfy->head, &cli->notifys);
162 kfree(ntfy);
174 struct usif_notify *ntfy;
178 if (!(ntfy = usif_notify_find(f, args->v0.index)))
185 usif_notify_dtor(ntfy);
197 struct usif_notify *ntfy;
201 if (!(ntfy = usif_notify_find(f, args->v0.index)))
206 if (atomic_xchg(&ntfy->enabled, 1))
209 ntfy->p = kmalloc(sizeof(*ntfy->p) + ntfy->reply, GFP_KERNEL);
210 if (ret = -ENOMEM, !ntfy->p)
212 ntfy->p->base.event = &ntfy->p->e.base;
213 ntfy->p->base.file_priv = f;
214 ntfy->p->e.base.type = DRM_NOUVEAU_EVENT_NVIF;
215 ntfy->p->e.base.length = sizeof(ntfy->p->e.base) + ntfy->reply;
220 atomic_set(&ntfy->enabled, 0);
221 kfree(ntfy->p);
234 struct usif_notify *ntfy;
238 if (!(ntfy = usif_notify_find(f, args->v0.index)))
244 if (ret == 0 && atomic_xchg(&ntfy->enabled, 0))
245 kfree(ntfy->p);
251 struct list_head ntfy;