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