1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVIF_NOTIFY_H__
3 #define __NVIF_NOTIFY_H__
4 
5 struct nvif_notify {
6 	struct nvif_object *object;
7 	int index;
8 
9 #define NVIF_NOTIFY_USER 0
10 #define NVIF_NOTIFY_WORK 1
11 	unsigned long flags;
12 	atomic_t putcnt;
13 	void (*dtor)(struct nvif_notify *);
14 #define NVIF_NOTIFY_DROP 0
15 #define NVIF_NOTIFY_KEEP 1
16 	int  (*func)(struct nvif_notify *);
17 
18 	/* this is const for a *very* good reason - the data might be on the
19 	 * stack from an irq handler.  if you're not nvif/notify.c then you
20 	 * should probably think twice before casting it away...
21 	 */
22 	const void *data;
23 	u32 size;
24 	struct work_struct work;
25 };
26 
27 int  nvif_notify_init(struct nvif_object *, int (*func)(struct nvif_notify *),
28 		      bool work, u8 type, void *data, u32 size, u32 reply,
29 		      struct nvif_notify *);
30 int  nvif_notify_fini(struct nvif_notify *);
31 int  nvif_notify_get(struct nvif_notify *);
32 int  nvif_notify_put(struct nvif_notify *);
33 int  nvif_notify(const void *, u32, const void *, u32);
34 #endif
35