summaryrefslogtreecommitdiff
path: root/sys/dev/usb/umidivar.h
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2006-04-07 22:41:34 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2006-04-07 22:41:34 +0000
commit6e4f531815188a666ff636e5ab7cd5a893e246c3 (patch)
tree9a010f147be7c73ff596bb2b1444fad0512c6d9f /sys/dev/usb/umidivar.h
parentac027bced9dbecb8b0b9df43116b66cb9d857f51 (diff)
Add optional flush method to MIDI hardware interface.
Allow umidi(4) to send multiple events in a single USB transfer. This greatly improves the number of interrupts umidi is able to generate. From Alexandre Ratchov.
Diffstat (limited to 'sys/dev/usb/umidivar.h')
-rw-r--r--sys/dev/usb/umidivar.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/usb/umidivar.h b/sys/dev/usb/umidivar.h
index 77889e386fe..3cfec867fa5 100644
--- a/sys/dev/usb/umidivar.h
+++ b/sys/dev/usb/umidivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: umidivar.h,v 1.9 2005/09/07 06:57:09 jsg Exp $ */
+/* $OpenBSD: umidivar.h,v 1.10 2006/04/07 22:41:33 jsg Exp $ */
/* $NetBSD: umidivar.h,v 1.5 2002/09/12 21:00:42 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -40,9 +40,7 @@
struct umidi_packet {
unsigned status;
unsigned index;
- unsigned char buffer_rt[UMIDI_PACKET_SIZE]; /* real time packet */
- unsigned char buffer_com[UMIDI_PACKET_SIZE]; /* common/voice packet */
- unsigned char *buffer;
+ unsigned char buf[UMIDI_PACKET_SIZE]; /* common/voice packet */
};
/*
@@ -76,13 +74,16 @@ struct umidi_jack {
void *arg;
int binded;
int opened;
+ SIMPLEQ_ENTRY(umidi_jack) intrq_entry;
+#ifdef DIAGNOSTIC
+ unsigned wait;
+#endif
union {
struct {
- void (*intr)(void *);
- TAILQ_ENTRY(umidi_jack) queue_entry;
+ void (*intr)(void *);
} out;
struct {
- void (*intr)(void *, int);
+ void (*intr)(void *, int);
} in;
} u;
};
@@ -100,7 +101,10 @@ struct umidi_endpoint {
int num_open;
int num_jacks;
struct umidi_jack *jacks[UMIDI_MAX_EPJACKS];
- TAILQ_HEAD(, umidi_jack) queue_head;
+ unsigned used;
+ unsigned busy;
+ unsigned pending;
+ SIMPLEQ_HEAD(, umidi_jack) intrq;
};
/* software context */