From 6e4f531815188a666ff636e5ab7cd5a893e246c3 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Fri, 7 Apr 2006 22:41:34 +0000 Subject: 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. --- sys/dev/usb/umidivar.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'sys/dev/usb/umidivar.h') 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 */ -- cgit v1.2.3