History log of /haiku/src/add-ons/kernel/drivers/midi/usb_midi/usb_midi.h
Revision Date Author Comments
# 7345ce9a 24-Jun-2023 Niels Sascha Reedijk <niels.reedijk@gmail.com>

usb_midi: use the private kernel headers when building the module

Change-Id: I40c1c38cdcc3b7930b8dba1cacbb43d97714cfb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6646
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 3df82f28 30-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

usb_midi: fix crash when unplugging devices

* When a midi device is unplugged, the driver deletes all the MIDI
channels, and unblocks all pending accesses on those. The port
structureis freed but the device kept a pointer to it.
* When a transfer is cancelled, the driver would try to notify all
callers waiting on the ports that the device is gone. But it's too late
to access the port as it was already deleted (and the callers already
unlocked).

Reset the port pointer to NULL when deleting a port, so no further
access to it is possible.

Fixes #11533.

Also remove an unused field in the usb midi device structure.


# ca4f3ba3 02-May-2013 Philippe Houdoin <philippe.houdoin@gmail.com>

Patch by Pete Goodeve fixing #9311. Thanks.

* Respect device's declared max packet size.
This improve support of USB midi controlers which don't support
arbitrary bulk read size, like iCON ones.
* Fix an logic inversion regarding O_RDONLY/O_WRONLY
and output or input ports only devices.


# dae8628f 06-Jun-2011 Jérôme Duval <korli@users.berlios.de>

.c => .cpp, build fix


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41982 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ae67ffbd 06-Jun-2011 Jérôme Duval <korli@users.berlios.de>

* style cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41981 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1291377a 03-Jun-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Applied patch by Pete Goodeve, which adds multi-ports support to usb_midi driver.
Fixed some coding style and a few sanity checks where it make sense.

This driver code is not in a good shape and needs a wide cleanup.
unfortunatly, I still don't have any device to test with, so I can't do that anytime soon.
Intead of letting his patch collecting dust since 3 months (my bad),
I think it's better the multi-port support gets at least more exposure than
just Pete's hardware.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41874 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c091ffe 26-Oct-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Apply patch (with changes) by Pete Goodeve: fix #4053.
Closing usb_midi now wake up midi_server port reader, as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33782 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c7f3645 14-Sep-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed typo, spotted by korli.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33137 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfa9be00 13-Sep-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Apply Pete Goodeve patch, provided in #4463:
* add output support
* fix variable lenght input: all usb_midi_event_packet bytes were
always returned before.
Missing features are:
* multiport support (input from any ports are read and merged currently,
so beware to connect only one port!)
* non-standard USB midi adapters, like my Roland UM-2 which don't advertize
themselves as Audio / Midi stream class/subclass.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33126 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 58da9ac9 22-Aug-2006 Jérôme Duval <korli@users.berlios.de>

moved from cbuf to ring_buffer, untested


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18563 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec53687c 15-Feb-2006 Jérôme Duval <korli@users.berlios.de>

added a MIDI USB driver (IN only)
tested with a Evolution MK-425C


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16415 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3df82f281333e7a24c739adc5f1dc4cc7eb32ab6 30-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

usb_midi: fix crash when unplugging devices

* When a midi device is unplugged, the driver deletes all the MIDI
channels, and unblocks all pending accesses on those. The port
structureis freed but the device kept a pointer to it.
* When a transfer is cancelled, the driver would try to notify all
callers waiting on the ports that the device is gone. But it's too late
to access the port as it was already deleted (and the callers already
unlocked).

Reset the port pointer to NULL when deleting a port, so no further
access to it is possible.

Fixes #11533.

Also remove an unused field in the usb midi device structure.


# ca4f3ba33cb33a12a9292717626ea455ed3d43fb 02-May-2013 Philippe Houdoin <philippe.houdoin@gmail.com>

Patch by Pete Goodeve fixing #9311. Thanks.

* Respect device's declared max packet size.
This improve support of USB midi controlers which don't support
arbitrary bulk read size, like iCON ones.
* Fix an logic inversion regarding O_RDONLY/O_WRONLY
and output or input ports only devices.


# dae8628f1b51acbe4b2fc0c5dc0e0ea62588c0d4 06-Jun-2011 Jérôme Duval <korli@users.berlios.de>

.c => .cpp, build fix


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41982 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ae67ffbd06ef33f13fffa075662891c69fc059f4 06-Jun-2011 Jérôme Duval <korli@users.berlios.de>

* style cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41981 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1291377a6e506cedcad9738248724fbe3837f13f 03-Jun-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Applied patch by Pete Goodeve, which adds multi-ports support to usb_midi driver.
Fixed some coding style and a few sanity checks where it make sense.

This driver code is not in a good shape and needs a wide cleanup.
unfortunatly, I still don't have any device to test with, so I can't do that anytime soon.
Intead of letting his patch collecting dust since 3 months (my bad),
I think it's better the multi-port support gets at least more exposure than
just Pete's hardware.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41874 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c091ffef46bf6e7fad1c619de2b6c30a1fe0746 26-Oct-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Apply patch (with changes) by Pete Goodeve: fix #4053.
Closing usb_midi now wake up midi_server port reader, as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33782 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c7f3645ac66f7d24d833bbd82364b2eb970cf22 14-Sep-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed typo, spotted by korli.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33137 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfa9be00c4f35f3677a34d72cb138844e7547629 13-Sep-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Apply Pete Goodeve patch, provided in #4463:
* add output support
* fix variable lenght input: all usb_midi_event_packet bytes were
always returned before.
Missing features are:
* multiport support (input from any ports are read and merged currently,
so beware to connect only one port!)
* non-standard USB midi adapters, like my Roland UM-2 which don't advertize
themselves as Audio / Midi stream class/subclass.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33126 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 58da9ac9e56cf6c1ecf4f5af8601d40e64b0cf19 22-Aug-2006 Jérôme Duval <korli@users.berlios.de>

moved from cbuf to ring_buffer, untested


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18563 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec53687c76cbd8443e3ee48ce28d065d6e03c586 15-Feb-2006 Jérôme Duval <korli@users.berlios.de>

added a MIDI USB driver (IN only)
tested with a Evolution MK-425C


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16415 a95241bf-73f2-0310-859d-f6bbb57e9c96