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