Lines Matching defs:ntfy
62 struct usif_notify *ntfy;
63 list_for_each_entry(ntfy, &cli->notifys, head) {
64 if (ntfy->handle == handle)
65 return ntfy;
71 usif_notify_dtor(struct usif_notify *ntfy)
73 list_del(&ntfy->head);
74 kfree(ntfy);
80 struct usif_notify *ntfy = NULL;
89 if (WARN_ON(!(ntfy = (void *)(unsigned long)rep->v0.token)))
96 if (WARN_ON(!ntfy->p || ntfy->reply != (length + size)))
98 filp = ntfy->p->base.file_priv;
101 memcpy(&ntfy->p->e.data[0], header, length);
102 memcpy(&ntfy->p->e.data[length], data, size);
105 struct nvif_notify_rep_v0 *rep = (void *)ntfy->p->e.data;
106 rep->route = ntfy->route;
107 rep->token = ntfy->token;
116 if (!WARN_ON(filp->event_space < ntfy->p->e.base.length)) {
117 list_add_tail(&ntfy->p->base.link, &filp->event_list);
118 filp->event_space -= ntfy->p->e.base.length;
126 atomic_set(&ntfy->enabled, 0);
141 struct usif_notify *ntfy;
152 if (!(ntfy = kmalloc(sizeof(*ntfy), GFP_KERNEL)))
154 atomic_set(&ntfy->enabled, 0);
157 ntfy->reply = sizeof(struct nvif_notify_rep_v0) + req->v0.reply;
158 ntfy->route = req->v0.route;
159 ntfy->token = req->v0.token;
161 req->v0.token = (unsigned long)(void *)ntfy;
163 req->v0.token = ntfy->token;
164 req->v0.route = ntfy->route;
165 ntfy->handle = args->v0.index;
169 list_add(&ntfy->head, &cli->notifys);
171 kfree(ntfy);
183 struct usif_notify *ntfy;
187 if (!(ntfy = usif_notify_find(f, args->v0.index)))
194 usif_notify_dtor(ntfy);
206 struct usif_notify *ntfy;
210 if (!(ntfy = usif_notify_find(f, args->v0.index)))
215 if (atomic_xchg(&ntfy->enabled, 1))
218 ntfy->p = kmalloc(sizeof(*ntfy->p) + ntfy->reply, GFP_KERNEL);
219 if (ret = -ENOMEM, !ntfy->p)
221 ntfy->p->base.event = &ntfy->p->e.base;
222 ntfy->p->base.file_priv = f;
223 ntfy->p->e.base.type = DRM_NOUVEAU_EVENT_NVIF;
224 ntfy->p->e.base.length = sizeof(ntfy->p->e.base) + ntfy->reply;
229 atomic_set(&ntfy->enabled, 0);
230 kfree(ntfy->p);
243 struct usif_notify *ntfy;
247 if (!(ntfy = usif_notify_find(f, args->v0.index)))
253 if (ret == 0 && atomic_xchg(&ntfy->enabled, 0))
254 kfree(ntfy->p);
260 struct list_head ntfy;