summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/umidi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Nuke all occurrences of usbd_abort_pipe() if it gets called rightmglocker2020-07-311-2/+1
| | | | | | | | | | before usbd_close_pipe(), since usbd_close_pipe() already takes care about aborting non-empty pipes. As investigated by gerhard@ usbdi.c rev. 1.57 did add usbd_abort_pipe() to usbd_close_pipe(), but the drivers didn't get cleaned up afterwards. ok gerhard@
* Prevent a NULL derefence in alloc_all_endpoints_fixed_ep()jasper2020-03-161-1/+8
| | | | | | | | | | when no IO endpoints were found. Coverity CID 1453263, 1453156 Check return value of usbd_interface2endpoint_descriptor() in alloc_all_endpoints_yamaha() as it may return NULL which ends up being dereferenced by the UE_GET_XFERTYPE() macro. Coverity CID 271356 ok ratchov@
* Remove uneeded header.mpi2019-01-231-2/+1
|
* free(9) sizes for array of endpoints.mpi2018-11-161-6/+9
| | | | ok ratchov@
* zap return keyword to clarify umidi_flush() returns no value; ok ratchov@miko2018-10-311-2/+2
|
* clarify that goto error in alloc_all_endpoints_fixed_ep() always returnsmiko2018-09-071-7/+2
| | | | | | USBD_INVAL. ok mpi@
* move initial jack count to alloc_all_endpoints(), and reset count to zeromiko2018-09-071-5/+4
| | | | | | in free_all_jacks(). ok stsp@ ratchov@
* execute the same code for failure of assign_all_jacks_automatically()miko2018-09-061-1/+3
| | | | | | | and attach_all_mididevs(). this ensures unbind_all_jacks() and usbd_deactivate() happen for both cases. ok ratchov@
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-301-2/+2
| | | | ok deraadt@ krw@
* A pile of sizes to free(9). In test for a few days in snapshots.deraadt2017-04-081-5/+7
| | | | | Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
* Use __func__ for DPRINTF's as we do in other parts of theratchov2017-02-101-13/+13
| | | | code. From Michael W. Bombardieri" <mb at ii.net>. Thanks.
* Remove unused MIX_CN_CIN macro, make umidi_evlen[] static, style(9).ratchov2017-01-071-35/+19
| | | | From Michael W. Bombardieri. Thanks.
* Group identical close_in_jack() and close_out_jack() into a singleratchov2016-12-201-17/+7
| | | | routine. From Michael W. Bombardieri <mb at ii.net>. Thanks!
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* More malloc() -> mallocarray() in the kernel.doug2014-12-091-17/+13
| | | | ok deraadt@ tedu@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-6/+6
| | | | after discussions with beck deraadt kettenis.
* Replace sc_dying in favour of usbd_is_dying() and usbd_deactivate().pirofti2013-11-101-8/+8
| | | | Okay mpi@
* Introduce a global interrupt-aware mutex protecting dataratchov2013-05-151-2/+7
| | | | | | | | | | | | | structures (including sound-card registers) from concurent access by syscall and interrupt code-paths. Since critical sections remain the same, calls to splraise/spllower can be safely replaced by calls to mtx_enter/mtx_leave with two exceptions: (1) mutexes are not reentrant (the inner splraise is thus removed), and (2) we're not allowed to sleep with a mutex (either msleep is used or the mutex is released before sleeping). ok and help from kettenis, a lot of work from armani
* Get rid of various 'typedef struct' definitions and use plain structuremglocker2013-04-151-7/+7
| | | | | | | | | definitions instead. We don't change usb.h for now to stay compatible with userland. Tested by mpi@ on macppc and myself on i386. ok mpi@
* proc.h is way too much header for usb to handle.tedu2013-03-281-2/+1
|
* you probably don't need to include vnode.h or reboot.h. you most definitelytedu2013-03-281-2/+1
| | | | | absolutely do not need to include vnode.h because it includes uvm_extern.h and you want the idiotic TRUE FALSE defines from uvm.
* If the MIDI UART is not ready for output, don't spin at IPL_CLOCK;ratchov2012-03-301-51/+17
| | | | | | | just return and make the midi(4) driver retry later. UART buffers are large enough for this, except eap(4) which uses interrupts for output. help from and ok jsg@
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-4/+1
| | | | | | | | that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
* Back out inadvertently commited change.oga2011-06-231-20/+24
| | | | This one wanted some more comments before commit.
* Don't leak the ctrl_data in uvideo_queryctrl, uvideo_s_ctrl and uvideo_g_ctrl.oga2011-06-231-24/+20
| | | | | | | If one of the usb calls we did here failed we'd return immediately and not free our buffer. ok miod@
* M_WAITOK cleanup of two cases:mk2011-06-171-6/+6
| | | | | | | | | | | | | | | | 1) Allocating with M_WAITOK, checking for NULL, and calling panic() is pointless (malloc() will panic if it can't allocate) so remove the check and the call. 2) Allocating with M_WAITOK, checking for NULL, and then gracefully handling failure to allocate is pointless. Instead also pass M_CANFAIL so malloc() doesn't panic so we can actually handle it gracefully. 1) was done using Coccinelle. Input from oga. ok miod.
* garbage collect "usb events". without /dev/usb there is no way to accessjakemsr2011-01-251-7/+1
| | | | | | them from userland, and nothing in the kernel uses them. ok krw@, miod@
* remove dying flag in detach() function.yuo2010-09-241-2/+1
| | | | | | The dying flag will be set in activate()/DEACTIVATE. ok deraadt@
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-3/+3
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* treat usb vendor/product names as a locator, and have usbd_print handle it,deraadt2007-10-111-6/+1
| | | | | | so that it shows up before the :. as a result, all the usb devices do not need to have name printing code anymore. all this now works and prints nicely because usbd_probe_and_attach() is serialized. ok kettenis
* Simpliest memset(,0,) -> M_ZERO changes. One (caddr *) cast removal,krw2007-10-061-4/+3
| | | | | otherwise just adding M_ZERO to malloc() and removing the immediately adjacent memset(,0,).
* Remove the definition and usage of the USB_DECLARE_DRIVER_CLASS andmbalmer2007-06-141-2/+17
| | | | | | | | USB_DECLARE_DRIVER macros. No binary change. ok dlg.
* Remove the definition and use of the device_ptr_t which was a struct device *.mbalmer2007-06-121-2/+2
| | | | | | No binary change. ok mk.
* Remove the definition and use of the USBDEVNAME macro.mbalmer2007-06-101-15/+15
| | | | | | | (This might look easy, but it was a big diff. Thanks to dlg and especially jsg for looking over it; we found at least four mistakes in the initial diff.) ok jsg.
* Remove the definition and use of the USBDEV macro. It only created confusionmbalmer2007-06-101-3/+3
| | | | | | | | and the address of it's argument: USBDEV(sc->sc_dev) yields &sc->sc_dev. No binary changes. ok jsg.
* Farewell USB_{ATTACH,MATCH,DETACH}* you will not be missed.jsg2007-05-271-9/+12
| | | | ok deraadt@ krw@ mbalmer@
* #include <sys/lock.h> not needed. i.e. these compile fine without it.krw2007-05-051-2/+1
|
* In a drivers activate() entry point, if on DVACT_DEACTIVATE it doesmiod2006-06-231-3/+1
| | | | | | something, then it MUST return zero on DVACT_ACTIVATE, not EOPNOTSUPP; this very popular bug has been cut and pasted a lot of times... ok deraadt@ mickey@
* Add optional flush method to MIDI hardware interface.jsg2006-04-071-83/+140
| | | | | | | 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.
* Move contents of sys/select.h to sys/selinfo.h in preparation for amillert2005-11-211-2/+2
| | | | | userland-visible sys/select.h. Consistent with what Net and Free do. OK deraadt@, tested with full ports build by naddy@.
* Fix bug that caused multi byte MIDI messages to get corruptedjsg2005-09-071-22/+24
| | | | | | | | | | when a single real time byte is inserted. From Alexandre Ratchov. While I don't have a umidi device to test here it looks correct to me and alex has a history of sending good MIDI diffs. ok deraadt@
* Don't keep the devinfo string on the stack, instead use malloc/free.brad2005-08-011-4/+5
| | | | | | | | This should cure some rare stack overflows. From augustss NetBSD ok dlg@ pascoe@
* When processing sysex stop bytes ensure the packet is not corruptedjsg2004-11-201-1/+3
| | | | | if we are building a new packet, from Alexandre Ratchov. ok deraadt@
* better midi stuff from alex@caoua.orgderaadt2004-06-271-256/+233
|
* check for null before memsetnate2003-05-191-2/+2
|
* string cleanup; nate okderaadt2003-05-071-2/+2
|
* sync with NetBSDnate2002-11-111-2/+2
|
* update $NetBSD$ tagsnate2002-07-251-3/+2
|
* get rid of trailing whitespacenate2002-07-251-4/+4
|