summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGimmeapill2015-06-24 22:19:14 +0200
committerGimmeapill2015-06-24 22:19:14 +0200
commit6c2baf26186091f384d37864d53e11620558a8f7 (patch)
tree2f1a5bca1c3daa67f43ac9b1a158fbfbae942c73
downloadaur-6c2baf26186091f384d37864d53e11620558a8f7.tar.gz
Initial import
-rw-r--r--.SRCINFO36
-rw-r--r--PKGBUILD97
-rw-r--r--dj_console_mp3_e2.patch29
-rw-r--r--hdjmod.diff13
-rw-r--r--hdjmod.install20
-rw-r--r--kernel_2.6.31_fix.patch20
-rw-r--r--kernel_2.6.35_fix.diff420
-rw-r--r--kernel_2.6.37_fix.patch96
-rw-r--r--kernel_2.6.39_fix.patch11
-rw-r--r--kernel_3.16_fix.patch11
-rw-r--r--kernel_3.6_fix.patch53
-rw-r--r--kernel_3.7_fix.patch12
12 files changed, 818 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..de57a053106c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,36 @@
+pkgbase = hdjmod
+ pkgdesc = Hercules DJ kernel module
+ pkgver = 1.28
+ pkgrel = 12
+ url = http://ts.hercules.com/eng/
+ install = hdjmod.install
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = rpmextract
+ makedepends = linux-headers
+ depends = linux>=3.16
+ optdepends = hdjcpl: Control Panel for the Hercules DJ series hardware settings
+ source = ftp://ftp.hercules.com/pub/webupdate/DJCSeries/Hercules_DJSeries_Linux.tgz
+ source = hdjmod.diff
+ source = kernel_2.6.31_fix.patch
+ source = kernel_2.6.35_fix.diff
+ source = dj_console_mp3_e2.patch
+ source = kernel_2.6.37_fix.patch
+ source = kernel_2.6.39_fix.patch
+ source = kernel_3.6_fix.patch
+ source = kernel_3.7_fix.patch
+ source = kernel_3.16_fix.patch
+ md5sums = 498cf0ff144f20106718932ab22571ce
+ md5sums = 464f8a8eda9d4c2ec83cf1c43e5dbee3
+ md5sums = 405a57365935fa003514ac2370325de1
+ md5sums = 359c33f8e21a7ce5425d5409919f8252
+ md5sums = f9e6f12c5f59c7bdb44d813cd42c9b27
+ md5sums = 132528f078a26775ca8c7c4c3ebfe748
+ md5sums = 9cc3e1cb4c7877ebf09e389e67b19182
+ md5sums = 8bf580fcfe06f48ce8247272b55633ce
+ md5sums = f40801f32abc47088a54c8893aa27e75
+ md5sums = 03b1ec1382d9d79a78cc79525cae06e4
+
+pkgname = hdjmod
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9db16019133a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,97 @@
+# Contributor: Ali H. Caliskan <ali.h.caliskan AT gmail DOT com>
+# Contributor: sergeantspoon <sergeantspoon@archlinux.us>
+# Contributor: Speedboy <theknight696.linux AT gmail DOT com>
+# Contributor: Fabian Zimmermann / fabian-zimmermann.net
+# Maintainer: Gimmeapill <gimmeapill at gmail DOT com>
+
+pkgname=hdjmod
+pkgver=1.28
+pkgrel=12
+pkgdesc="Hercules DJ kernel module"
+arch=('i686' 'x86_64')
+url="http://ts.hercules.com/eng/"
+license=('GPL2')
+depends=('linux>=3.16')
+makedepends=('rpmextract' 'linux-headers')
+optdepends=('hdjcpl: Control Panel for the Hercules DJ series hardware settings')
+install=hdjmod.install
+
+source=('ftp://ftp.hercules.com/pub/webupdate/DJCSeries/Hercules_DJSeries_Linux.tgz'
+ 'hdjmod.diff'
+ 'kernel_2.6.31_fix.patch'
+ 'kernel_2.6.35_fix.diff'
+ 'dj_console_mp3_e2.patch'
+ 'kernel_2.6.37_fix.patch'
+ 'kernel_2.6.39_fix.patch'
+ 'kernel_3.6_fix.patch'
+ 'kernel_3.7_fix.patch'
+ 'kernel_3.16_fix.patch')
+
+md5sums=('498cf0ff144f20106718932ab22571ce'
+ '464f8a8eda9d4c2ec83cf1c43e5dbee3'
+ '405a57365935fa003514ac2370325de1'
+ '359c33f8e21a7ce5425d5409919f8252'
+ 'f9e6f12c5f59c7bdb44d813cd42c9b27'
+ '132528f078a26775ca8c7c4c3ebfe748'
+ '9cc3e1cb4c7877ebf09e389e67b19182'
+ '8bf580fcfe06f48ce8247272b55633ce'
+ 'f40801f32abc47088a54c8893aa27e75'
+ '03b1ec1382d9d79a78cc79525cae06e4')
+
+build() {
+ # Obtain source files
+ cd $srcdir/kernel\ module
+ /usr/bin/rpmextract.sh hdjmod-dkms-$pkgver-1.noarch.rpm
+
+ # Delete the old source folder
+ rm -rf $srcdir/$pkgname-$pkgver
+
+ # Move the source
+ mv usr/src/$pkgname-$pkgver $srcdir
+ cd $srcdir/$pkgname-$pkgver
+
+ # First patch makes installing easier
+ patch -p0 < $srcdir/hdjmod.diff
+
+ # Second patch fixes APIs that were changed in kernel >= 2.6.31
+ patch -p0 < $srcdir/kernel_2.6.31_fix.patch
+
+ # Third patch fixes Build errors with a kernel >= 2.6.35
+ patch -p0 < $srcdir/kernel_2.6.35_fix.diff
+
+ # Fix the path to the linux headers in bulk.h (this was hardcoded by kernel_2.6.35_fix.diff)
+ sed -i s/2.6.35-ARCH/$(uname -r)/ bulk.h
+
+ # Fourth patch adds supports for the DJ Console MP3 e2
+ patch -p0 < $srcdir/dj_console_mp3_e2.patch
+
+ # Fifth patch fixes build errors with kernel 2.6.37
+ patch -p0 < $srcdir/kernel_2.6.37_fix.patch
+
+ # Sixth patch fixes build errors with kernel 2.6.39 (from OpenSUSE Factory)
+ patch -p0 < $srcdir/kernel_2.6.39_fix.patch
+
+ # Seventh patch fixes build errors with kernel 3.6.x (from OpenSUSE Factory)
+ patch -p0 < $srcdir/kernel_3.6_fix.patch
+
+ # Eighth patch fixes build errors with kernel 3.7.x (from OpenSUSE Factory)
+ patch -p0 < $srcdir/kernel_3.7_fix.patch
+
+ # Ninth patch fixes build errors with kernel 3.16.x (by Fabian Zimmermann / fabian-zimmermann.net)
+ patch -p0 < $srcdir/kernel_3.16_fix.patch
+
+ # Fix again the path to slab.h in bulk.h
+ sed -i s@/usr/src/linux-$(uname -r)/include/linux/slab.h@/usr/lib/modules/$(uname -r)/build/include/linux/slab.h@ bulk.h
+
+ # Patches 5->8 by Matthias Bach <marix@marix.org>
+ # http://download.opensuse.org/repositories/hardware/openSUSE_Factory/src/
+
+ # Compile...
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+# make DESTDIR="$pkgdir/" install
+ make DESTDIR="$pkgdir/usr/" install
+}
diff --git a/dj_console_mp3_e2.patch b/dj_console_mp3_e2.patch
new file mode 100644
index 000000000000..dde59e13fa5a
--- /dev/null
+++ b/dj_console_mp3_e2.patch
@@ -0,0 +1,29 @@
+--- device.c.orig 2010-12-12 16:34:17.866666668 +0100
++++ device.c 2011-01-09 12:17:06.000000000 +0100
+@@ -1828,6 +1828,8 @@ static int usbid_to_product_code(u32 usb
+ return DJCONTROLLER_PRODUCT_CODE;
+ } else if (usbid == USB_ID(USB_HDJ_VENDOR_ID, DJ_CONTROL_MP3W_PID)) {
+ return DJCONTROLLER_PRODUCT_CODE;
++ } else if (usbid == USB_ID(USB_HDJ_VENDOR_ID, DJ_CONTROL_MP3E2_PID)) {
++ return DJCONTROLSTEEL_PRODUCT_CODE;
+ } else {
+ return DJCONSOLE_PRODUCT_UNKNOWN;
+ }
+@@ -1860,6 +1862,7 @@ static int hdj_probe(struct usb_interfac
+ (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONSOLE_RMX_PID)&&
+ (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONTROL_MP3_PID)&&
+ (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONTROL_MP3W_PID)&&
++ (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONTROL_MP3E2_PID)&&
+ (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONSOLE_STEEL_PID))
+ {
+ printk(KERN_INFO"hdj_probe() unsupported device, idVendor%lx, idProduct:%lx\n",
+--- device.h.orig 2009-01-27 15:25:50.000000000 +0100
++++ device.h 2011-01-09 12:19:22.000000000 +0100
+@@ -38,6 +38,7 @@ extern int netlink_unit;
+ #define DJ_CONSOLE_RMX_PID 0xb101
+ #define DJ_CONTROL_MP3_PID 0xd000
+ #define DJ_CONTROL_MP3W_PID 0xd001
++#define DJ_CONTROL_MP3E2_PID 0xb105
+ #define DJ_CONSOLE_STEEL_PID 0xb102
+
+ #define DJ_BULK_IFNUM 0
diff --git a/hdjmod.diff b/hdjmod.diff
new file mode 100644
index 000000000000..44d5d32767ab
--- /dev/null
+++ b/hdjmod.diff
@@ -0,0 +1,13 @@
+--- src/hdjmod-1.28/Makefile 2009-01-27 15:25:50.000000000 +0100
++++ Makefile 2009-04-03 18:21:39.000000000 +0200
+@@ -54,8 +54,8 @@
+ endif
+
+ install:
+- install -d $(INSTALLDIR)
+- install -c $(TARGET).ko $(INSTALLDIR)
++ install -d $(DESTDIR)$(INSTALLDIR)
++ install -c $(TARGET).ko $(DESTDIR)$(INSTALLDIR)
+
+ uninstall:
+ rm -f $(INSTALLDIR)/$(TARGET).ko
diff --git a/hdjmod.install b/hdjmod.install
new file mode 100644
index 000000000000..a361be186cdb
--- /dev/null
+++ b/hdjmod.install
@@ -0,0 +1,20 @@
+post_install () {
+ depmod -a
+ echo "==> Use 'modprobe hdj_mod' to load the Hercules DJ linux kernel module."
+
+}
+
+post_upgrade() {
+ post_install $1
+
+}
+
+post_remove() {
+ depmod -a
+
+}
+
+op=$1
+shift
+
+$op $*
diff --git a/kernel_2.6.31_fix.patch b/kernel_2.6.31_fix.patch
new file mode 100644
index 000000000000..7050969f71f6
--- /dev/null
+++ b/kernel_2.6.31_fix.patch
@@ -0,0 +1,20 @@
+--- device.c.orig 2009-10-27 19:52:01.000000000 -0400
++++ device.c 2009-10-27 19:53:32.000000000 -0400
+@@ -1660,12 +1660,11 @@
+ /* let the kernel option override custom id */
+ strncpy(card_id,id[idx],sizeof(card_id)-1);
+ }
+- card = snd_card_new(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0);
+- if (card == NULL) {
+- snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx);
+- return -ENOMEM;
+- }
+-
++ err = snd_card_create(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card);
++ if (err < 0) {
++ snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx);
++ return err;
++ }
+ /* save the index, so people who have the card can reference the chip */
+ card->private_data = (void*)(unsigned long)idx;
+
diff --git a/kernel_2.6.35_fix.diff b/kernel_2.6.35_fix.diff
new file mode 100644
index 000000000000..5796b4b81bed
--- /dev/null
+++ b/kernel_2.6.35_fix.diff
@@ -0,0 +1,420 @@
+--- bulk.c 2009-01-27 15:25:50.000000000 +0100
++++ bulkpatched.c 2010-08-19 00:11:40.802050414 +0200
+@@ -312,7 +312,7 @@ int firmware_send_bulk(struct usb_hdjbul
+ /*indicate that a bulk output request is in progress.*/
+ atomic_inc(&ubulk->bulk_out_command_in_progress);
+
+- /* Since we allocated our buffer with usb_buffer_alloc, do a copy- surely less of a penalty than using
++ /* Since we allocated our buffer with usb_alloc_coherent, do a copy- surely less of a penalty than using
+ * a kmalloc buffer which DMA setup for it, especially with our small buffer sizes */
+ memcpy(ubulk->bulk_out_buffer,buffer,buffer_size);
+
+@@ -461,8 +461,8 @@ int send_vendor_request(int chip_index,
+ (void *)chip);
+
+ chip->ctrl_urb->setup_dma = chip->ctl_req_dma;
+- /* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */
+- chip->ctrl_urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
++ /* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */
++ chip->ctrl_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+
+ ret = hdjbulk_submit_urb(chip, chip->ctrl_urb, GFP_KERNEL);
+ if (ret!=0) {
+@@ -553,7 +553,7 @@ int usb_set_report(struct usb_hdjbulk *u
+ output_control_callback,
+ &ubulk->output_control_completion);
+ ubulk->output_control_urb->setup_dma = ubulk->output_control_dma;
+- ubulk->output_control_urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
++ ubulk->output_control_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+ if ((rc = hdjbulk_submit_urb(ubulk->chip,ubulk->output_control_urb, GFP_KERNEL))!=0) {
+ printk(KERN_WARNING"%s hdjbulk_submit_urb() failed, rc:%d\n",__FUNCTION__,rc);
+ } else {
+@@ -2675,7 +2675,7 @@ static void uninit_output_control_state(
+ {
+ if (ubulk->chip->product_code!=DJCONTROLSTEEL_PRODUCT_CODE) {
+ if (ubulk->output_control_ctl_req!=NULL && ubulk->control_interface!=NULL) {
+- usb_buffer_free(interface_to_usbdev(ubulk->control_interface),
++ usb_free_coherent(interface_to_usbdev(ubulk->control_interface),
+ sizeof(*(ubulk->output_control_ctl_req)),
+ ubulk->output_control_ctl_req,
+ ubulk->output_control_dma);
+@@ -2684,7 +2684,7 @@ static void uninit_output_control_state(
+
+ if (ubulk->output_control_buffer!=NULL && ubulk->control_interface!=NULL &&
+ ubulk->output_control_urb!=NULL) {
+- usb_buffer_free(interface_to_usbdev(ubulk->control_interface),
++ usb_free_coherent(interface_to_usbdev(ubulk->control_interface),
+ ubulk->output_control_urb->transfer_buffer_length,
+ ubulk->output_control_buffer,
+ ubulk->output_control_urb->transfer_dma);
+@@ -2712,7 +2712,7 @@ void kill_bulk_urbs(struct usb_hdjbulk *
+ usb_kill_urb(ubulk->bulk_out_urb);
+ if (free_urbs!=0) {
+ if (ubulk->bulk_out_buffer!=NULL) {
+- usb_buffer_free(ubulk->chip->dev, ubulk->bulk_out_size,
++ usb_free_coherent(ubulk->chip->dev, ubulk->bulk_out_size,
+ ubulk->bulk_out_urb->transfer_buffer,
+ ubulk->bulk_out_urb->transfer_dma);
+ ubulk->bulk_out_buffer = NULL;
+@@ -3065,11 +3065,11 @@ int hdj_create_bulk_interface(struct snd
+ init_MUTEX(&ubulk->bulk_out_buffer_mutex);
+
+ ubulk->bulk_out_buffer =
+- usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size,
++ usb_alloc_coherent(ubulk->chip->dev, ubulk->bulk_out_size,
+ GFP_KERNEL, &ubulk->bulk_out_urb->transfer_dma);
+
+ if (ubulk->bulk_out_buffer==NULL) {
+- printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__);
++ printk(KERN_WARNING"%s() usb_alloc_coherent() failed\n",__FUNCTION__);
+
+ retval = -ENOMEM;
+ goto hdj_create_bulk_interface_error;
+@@ -3609,12 +3609,12 @@ static int init_output_control_state(str
+ * control state */
+ if (ubulk->chip->product_code != DJCONTROLSTEEL_PRODUCT_CODE) {
+ /* allocate memory for setup packet for our control requests */
+- ubulk->output_control_ctl_req = usb_buffer_alloc(interface_to_usbdev(ubulk->control_interface),
++ ubulk->output_control_ctl_req = usb_alloc_coherent(interface_to_usbdev(ubulk->control_interface),
+ sizeof(*(ubulk->output_control_ctl_req)),
+ GFP_KERNEL,
+ &ubulk->output_control_dma);
+ if (ubulk->output_control_ctl_req==NULL) {
+- printk(KERN_WARNING"%s() usb_buffer_alloc failed (ctl req)\n",__FUNCTION__);
++ printk(KERN_WARNING"%s() usb_alloc_coherent failed (ctl req)\n",__FUNCTION__);
+ ret = -ENOMEM;
+ goto hdjbulk_init_output_control_state_error;
+ } else {
+@@ -3628,7 +3628,7 @@ static int init_output_control_state(str
+ goto hdjbulk_init_output_control_state_error;
+ }
+
+- ubulk->output_control_buffer = usb_buffer_alloc(interface_to_usbdev(ubulk->control_interface),
++ ubulk->output_control_buffer = usb_alloc_coherent(interface_to_usbdev(ubulk->control_interface),
+ ubulk->output_control_buffer_size,
+ GFP_KERNEL,
+ &ubulk->output_control_urb->transfer_dma);
+@@ -3773,10 +3773,10 @@ static int init_continuous_reader(struct
+ }
+
+ ep[i]->max_transfer = ubulk->continuous_reader_packet_size;
+- buffer = usb_buffer_alloc(ubulk->chip->dev, ep[i]->max_transfer,
++ buffer = usb_alloc_coherent(ubulk->chip->dev, ep[i]->max_transfer,
+ GFP_KERNEL, &ep[i]->urb->transfer_dma);
+ if (!buffer) {
+- printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__);
++ printk(KERN_WARNING"%s() usb_alloc_coherent() failed\n",__FUNCTION__);
+
+ ret = -ENOMEM;
+ goto init_continuous_reader_error;
+@@ -4250,7 +4250,7 @@ void hdjbulk_in_endpoint_delete(struct h
+ {
+ if (ep->urb) {
+ if (ep->urb->transfer_buffer) {
+- usb_buffer_free(ep->ubulk->chip->dev, ep->max_transfer,
++ usb_free_coherent(ep->ubulk->chip->dev, ep->max_transfer,
+ ep->urb->transfer_buffer,
+ ep->urb->transfer_dma);
+ }
+--- bulk.h 2009-01-27 15:25:50.000000000 +0100
++++ bulkpatched.h 2010-08-19 00:12:41.552050469 +0200
+@@ -21,6 +21,8 @@
+ *
+ */
+
++#include "/usr/src/linux-2.6.35-ARCH/include/linux/slab.h"
++
+ #if !defined(_BULK_H_)
+ #define _BULK_H_
+
+--- device.c 2010-08-19 00:05:54.875385619 +0200
++++ devicepatched.c 2010-08-19 00:11:57.452050579 +0200
+@@ -1559,7 +1559,7 @@ static int snd_hdj_chip_free(struct snd_
+
+ if(chip->ctrl_req_buffer != NULL)
+ {
+- usb_buffer_free(chip->dev,
++ usb_free_coherent(chip->dev,
+ chip->ctrl_urb->transfer_buffer_length,
+ chip->ctrl_req_buffer,
+ chip->ctrl_urb->transfer_dma);
+@@ -1575,7 +1575,7 @@ static int snd_hdj_chip_free(struct snd_
+
+ if(chip->ctl_req != NULL)
+ {
+- usb_buffer_free(chip->dev,
++ usb_free_coherent(chip->dev,
+ sizeof(*(chip->ctl_req)),
+ chip->ctl_req,
+ chip->ctl_req_dma);
+@@ -1727,12 +1727,12 @@ static int snd_hdj_chip_create(struct us
+ }
+
+ /* allocate memory for setup packet for our control requests */
+- chip->ctl_req = usb_buffer_alloc(chip->dev,
++ chip->ctl_req = usb_alloc_coherent(chip->dev,
+ sizeof(*(chip->ctl_req)),
+ GFP_KERNEL,
+ &chip->ctl_req_dma);
+ if(chip->ctl_req == NULL) {
+- printk(KERN_WARNING"snd_hdj_chip_create(): usb_buffer_alloc() failed for setup DMA\n");
++ printk(KERN_WARNING"snd_hdj_chip_create(): usb_alloc_coherent() failed for setup DMA\n");
+ return err;
+ }
+
+@@ -1742,12 +1742,12 @@ static int snd_hdj_chip_create(struct us
+
+ chip->ctrl_req_buffer_len = sizeof(u16);
+ chip->ctrl_urb->transfer_buffer_length = chip->ctrl_req_buffer_len;
+- chip->ctrl_req_buffer = usb_buffer_alloc(chip->dev,
++ chip->ctrl_req_buffer = usb_alloc_coherent(chip->dev,
+ chip->ctrl_urb->transfer_buffer_length,
+ GFP_KERNEL,
+ &chip->ctrl_urb->transfer_dma);
+ if (chip->ctrl_req_buffer == NULL) {
+- printk(KERN_WARNING"snd_hdj_chip_create(): usb_buffer_alloc() failed\n");
++ printk(KERN_WARNING"snd_hdj_chip_create(): usb_alloc_coherent() failed\n");
+ return err;
+ }
+
+--- midi.c 2009-01-27 15:25:50.000000000 +0100
++++ midipatched.c 2010-08-19 00:12:10.072050470 +0200
+@@ -367,7 +367,7 @@ static void snd_hdjmidi_in_endpoint_dele
+ {
+ if (ep->urb) {
+ if (ep->urb->transfer_buffer) {
+- usb_buffer_free(ep->umidi->chip->dev,
++ usb_free_coherent(ep->umidi->chip->dev,
+ ep->urb->transfer_buffer_length,
+ ep->urb->transfer_buffer,
+ ep->urb->transfer_dma);
+@@ -503,10 +503,10 @@ static int snd_hdjmidi_in_endpoint_creat
+ pipe = usb_rcvbulkpipe(umidi->chip->dev, ep_info->in_ep);
+ }
+ length = usb_maxpacket(umidi->chip->dev, pipe, 0);
+- buffer = usb_buffer_alloc(umidi->chip->dev, length, GFP_KERNEL,
++ buffer = usb_alloc_coherent(umidi->chip->dev, length, GFP_KERNEL,
+ &ep->urb->transfer_dma);
+ if (!buffer) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed\n",__FUNCTION__);
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent failed\n",__FUNCTION__);
+ snd_hdjmidi_in_endpoint_delete(ep);
+ return -ENOMEM;
+ }
+@@ -536,7 +536,7 @@ static void snd_hdjmidi_out_endpoint_del
+ #endif
+ if (ep->urb) {
+ if (ep->urb->transfer_buffer) {
+- usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer,
++ usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer,
+ ep->urb->transfer_buffer,
+ ep->urb->transfer_dma);
+ }
+@@ -544,27 +544,27 @@ static void snd_hdjmidi_out_endpoint_del
+ }
+ if (ep->urb_led) {
+ if (ep->urb_led->transfer_buffer) {
+- usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer,
++ usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer,
+ ep->urb_led->transfer_buffer,
+ ep->urb_led->transfer_dma);
+ }
+ usb_free_urb(ep->urb_led);
+ }
+ if (ep->ctrl_req_led) {
+- usb_buffer_free(ep->umidi->chip->dev, sizeof(*(ep->ctrl_req_led)),
++ usb_free_coherent(ep->umidi->chip->dev, sizeof(*(ep->ctrl_req_led)),
+ ep->ctrl_req_led, ep->ctrl_req_led_dma);
+ }
+ if (ep->controller_state) {
+ if (ep->controller_state->output_control_ctl_urb &&
+ ep->controller_state->output_control_ctl_urb->transfer_buffer &&
+ ep->controller_state->output_control_ctl_urb->transfer_dma) {
+- usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer,
++ usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer,
+ ep->controller_state->output_control_ctl_urb->transfer_buffer,
+ ep->controller_state->output_control_ctl_urb->transfer_dma);
+ }
+ if (ep->controller_state->output_control_ctl_req &&
+ ep->controller_state->output_control_ctl_dma) {
+- usb_buffer_free(ep->umidi->chip->dev,
++ usb_free_coherent(ep->umidi->chip->dev,
+ sizeof(*(ep->controller_state->output_control_ctl_req)),
+ ep->controller_state->output_control_ctl_req,
+ ep->controller_state->output_control_ctl_dma);
+@@ -573,7 +573,7 @@ static void snd_hdjmidi_out_endpoint_del
+ usb_free_urb(ep->controller_state->output_control_ctl_urb);
+ }
+ if (ep->controller_state->ctl_req) {
+- usb_buffer_free(ep->umidi->chip->dev,
++ usb_free_coherent(ep->umidi->chip->dev,
+ sizeof(*(ep->controller_state->ctl_req)),
+ ep->controller_state->ctl_req,
+ ep->controller_state->ctl_req_dma);
+@@ -584,14 +584,14 @@ static void snd_hdjmidi_out_endpoint_del
+ }
+ if (ep->controller_state->urb_kt) {
+ if (ep->controller_state->urb_kt->transfer_buffer) {
+- usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer,
++ usb_free_coherent(ep->umidi->chip->dev, ep->max_transfer,
+ ep->controller_state->urb_kt->transfer_buffer,
+ ep->controller_state->urb_kt->transfer_dma);
+ }
+ usb_free_urb(ep->controller_state->urb_kt);
+ }
+ if (ep->controller_state->ctl_req_kt) {
+- usb_buffer_free(ep->umidi->chip->dev,
++ usb_free_coherent(ep->umidi->chip->dev,
+ sizeof(*(ep->controller_state->ctl_req_kt)),
+ ep->controller_state->ctl_req_kt,
+ ep->controller_state->ctl_req_dma_kt);
+@@ -666,12 +666,12 @@ static int controller_output_init(struct
+ controller_state->is_weltrend = is_mp3_weltrend(ep->umidi->chip->usb_id);
+ }
+
+- controller_state->ctl_req = usb_buffer_alloc(ep->umidi->chip->dev,
++ controller_state->ctl_req = usb_alloc_coherent(ep->umidi->chip->dev,
+ sizeof(*(controller_state->ctl_req)),
+ GFP_KERNEL,
+ &controller_state->ctl_req_dma);
+ if (controller_state->ctl_req==NULL) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA\n",__FUNCTION__);
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for setup DMA\n",__FUNCTION__);
+ return -ENOMEM;
+ }
+
+@@ -679,12 +679,12 @@ static int controller_output_init(struct
+ * mouse setting or setting LEDs */
+ init_MUTEX(&controller_state->output_control_ctl_mutex);
+ init_completion(&controller_state->output_control_ctl_completion);
+- controller_state->output_control_ctl_req = usb_buffer_alloc(ep->umidi->chip->dev,
++ controller_state->output_control_ctl_req = usb_alloc_coherent(ep->umidi->chip->dev,
+ sizeof(*(controller_state->output_control_ctl_req)),
+ GFP_KERNEL,
+ &controller_state->output_control_ctl_dma);
+ if (controller_state->output_control_ctl_req==NULL) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for general setup DMA\n",
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for general setup DMA\n",
+ __FUNCTION__);
+ return -ENOMEM;
+ }
+@@ -700,10 +700,10 @@ static int controller_output_init(struct
+ max_transfer = usb_maxpacket(ep->umidi->chip->dev,
+ controller_state->output_control_ctl_pipe, 1);
+
+- buffer = usb_buffer_alloc(ep->umidi->chip->dev, max_transfer,
++ buffer = usb_alloc_coherent(ep->umidi->chip->dev, max_transfer,
+ GFP_KERNEL, &controller_state->output_control_ctl_urb->transfer_dma);
+ if (buffer==NULL) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed (general URB buffer)\n",
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent failed (general URB buffer)\n",
+ __FUNCTION__);
+ return -ENOMEM;
+ }
+@@ -726,8 +726,8 @@ static int controller_output_init(struct
+ controller_state->output_control_ctl_req->wIndex = cpu_to_le16(ep->umidi->iface->cur_altsetting->desc.bInterfaceNumber);
+ controller_state->output_control_ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN);
+ controller_state->output_control_ctl_urb->setup_dma = controller_state->output_control_ctl_dma;
+- /* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */
+- controller_state->output_control_ctl_urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
++ /* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */
++ controller_state->output_control_ctl_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+
+ return 0;
+ }
+@@ -772,12 +772,12 @@ static int snd_hdjmidi_out_endpoint_crea
+ }
+
+ if (ep->umidi->chip->caps.leds_hid_controlled) {
+- ep->ctrl_req_led = usb_buffer_alloc(ep->umidi->chip->dev,
++ ep->ctrl_req_led = usb_alloc_coherent(ep->umidi->chip->dev,
+ sizeof(*(ep->ctrl_req_led)),
+ GFP_KERNEL,
+ &ep->ctrl_req_led_dma);
+ if (ep->ctrl_req_led==NULL) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA\n",__FUNCTION__);
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for setup DMA\n",__FUNCTION__);
+ return -ENOMEM;
+ }
+ }
+@@ -806,18 +806,18 @@ static int snd_hdjmidi_out_endpoint_crea
+ pipe = usb_sndctrlpipe(umidi->chip->dev, 0);
+ }
+ ep->max_transfer = usb_maxpacket(umidi->chip->dev, pipe, 1);
+- buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer,
++ buffer = usb_alloc_coherent(umidi->chip->dev, ep->max_transfer,
+ GFP_KERNEL, &ep->urb->transfer_dma);
+ if (!buffer) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed\n",__FUNCTION__);
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed\n",__FUNCTION__);
+ snd_hdjmidi_out_endpoint_delete(ep);
+ return -ENOMEM;
+ }
+
+- buffer_led = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer,
++ buffer_led = usb_alloc_coherent(umidi->chip->dev, ep->max_transfer,
+ GFP_KERNEL, &ep->urb_led->transfer_dma);
+ if (!buffer_led) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for LED buffer\n",
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for LED buffer\n",
+ __FUNCTION__);
+ snd_hdjmidi_out_endpoint_delete(ep);
+ return -ENOMEM;
+@@ -853,8 +853,8 @@ static int snd_hdjmidi_out_endpoint_crea
+ ep->controller_state->ctl_req->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber);
+ ep->controller_state->ctl_req->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN);
+ ep->urb->setup_dma = ep->controller_state->ctl_req_dma;
+- /* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */
+- ep->urb->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
++ /* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */
++ ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+ }
+
+ if (ep->umidi->chip->caps.leds_hid_controlled) {
+@@ -874,8 +874,8 @@ static int snd_hdjmidi_out_endpoint_crea
+ ep->ctrl_req_led->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber);
+ ep->ctrl_req_led->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN);
+ ep->urb_led->setup_dma = ep->ctrl_req_led_dma;
+- /* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */
+- ep->urb_led->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
++ /* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */
++ ep->urb_led->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+ }
+
+ if (ep->umidi->chip->caps.leds_bulk_controlled) {
+@@ -913,20 +913,20 @@ static int snd_hdjmidi_out_endpoint_crea
+ return -ENOMEM;
+ }
+
+- buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer,
++ buffer = usb_alloc_coherent(umidi->chip->dev, ep->max_transfer,
+ GFP_KERNEL, &ep->controller_state->urb_kt->transfer_dma);
+ if (!buffer) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc() for wq failed\n",__FUNCTION__);
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent() for wq failed\n",__FUNCTION__);
+ snd_hdjmidi_out_endpoint_delete(ep);
+ return -ENOMEM;
+ }
+
+- ep->controller_state->ctl_req_kt = usb_buffer_alloc(umidi->chip->dev,
++ ep->controller_state->ctl_req_kt = usb_alloc_coherent(umidi->chip->dev,
+ sizeof(*(ep->controller_state->ctl_req_kt)),
+ GFP_KERNEL,
+ &ep->controller_state->ctl_req_dma_kt);
+ if (!ep->controller_state->ctl_req_kt) {
+- snd_printk(KERN_WARNING"%s() usb_buffer_alloc() failed for setup DMA for wq\n",__FUNCTION__);
++ snd_printk(KERN_WARNING"%s() usb_alloc_coherent() failed for setup DMA for wq\n",__FUNCTION__);
+ snd_hdjmidi_out_endpoint_delete(ep);
+ return -ENOMEM;
+ }
+@@ -946,8 +946,8 @@ static int snd_hdjmidi_out_endpoint_crea
+ ep->controller_state->ctl_req_kt->wIndex = cpu_to_le16(umidi->iface->cur_altsetting->desc.bInterfaceNumber);
+ ep->controller_state->ctl_req_kt->wLength = cpu_to_le16(DJ_MP3_HID_OUTPUT_REPORT_LEN);
+ ep->controller_state->urb_kt->setup_dma = ep->controller_state->ctl_req_dma_kt;
+- /* NOTE: transfer_dma setup above in call to usb_buffer_alloc() */
+- ep->controller_state->urb_kt->transfer_flags = URB_NO_SETUP_DMA_MAP | URB_NO_TRANSFER_DMA_MAP;
++ /* NOTE: transfer_dma setup above in call to usb_alloc_coherent() */
++ ep->controller_state->urb_kt->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
+
+ init_completion(&ep->controller_state->ctl_req_completion_kt);
+ init_completion(&ep->controller_state->mp3w_kthread_started);
diff --git a/kernel_2.6.37_fix.patch b/kernel_2.6.37_fix.patch
new file mode 100644
index 000000000000..e17363d978cf
--- /dev/null
+++ b/kernel_2.6.37_fix.patch
@@ -0,0 +1,96 @@
+--- bulk.c.orig 2011-01-31 20:42:56.463333356 +0100
++++ bulk.c 2011-02-02 18:35:12.453333307 +0100
+@@ -34,6 +34,7 @@
+ #include <linux/usb.h>
+ #include <linux/delay.h>
+ #include <linux/version.h> /* For LINUX_VERSION_CODE */
++#include <linux/semaphore.h>
+ #if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
+ #include <sound/driver.h>
+ #endif
+@@ -3062,7 +3063,7 @@ int hdj_create_bulk_interface(struct snd
+ goto hdj_create_bulk_interface_error;
+ }
+ /* allocate the buffer for bulk_out_urb */
+- init_MUTEX(&ubulk->bulk_out_buffer_mutex);
++ sema_init(&ubulk->bulk_out_buffer_mutex,1);
+
+ ubulk->bulk_out_buffer =
+ usb_alloc_coherent(ubulk->chip->dev, ubulk->bulk_out_size,
+@@ -3601,7 +3602,7 @@ static int init_output_control_state(str
+ return -EINVAL;
+ }
+
+- init_MUTEX(&ubulk->output_control_mutex);
++ sema_init(&ubulk->output_control_mutex,1);
+ init_completion(&ubulk->output_control_completion);
+
+ /* Every product here except the Steel targets HID. Since the steel does not target HID, we don't
+@@ -3855,7 +3856,7 @@ int hdjbulk_init_dj_console(struct usb_h
+ u16 value = 0;
+ struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context);
+
+- init_MUTEX(&dc->device_config_mutex);
++ sema_init(&dc->device_config_mutex,1);
+
+ ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common);
+ if (ret!=0) {
+@@ -4133,7 +4134,7 @@ int hdjbulk_init_dj_steel(struct usb_hdj
+
+ spin_lock_init(&dc->bulk_buffer_lock);
+ init_completion(&dc->bulk_request_completion);
+- init_MUTEX(&dc->bulk_request_mutex);
++ sema_init(&dc->bulk_request_mutex,1);
+
+ if ((ret = init_continuous_reader(ubulk))!=0) {
+ printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n",
+
+--- device.c.orig 2011-01-31 20:42:56.470000023 +0100
++++ device.c 2011-02-02 18:37:06.129999924 +0100
+@@ -66,7 +66,7 @@ MODULE_PARM_DESC(index, "Index value for
+ module_param_array(id, charp, NULL, 0444);
+ MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter.");
+
+-static DECLARE_MUTEX(register_mutex);
++static DEFINE_SEMAPHORE(register_mutex);
+ static struct snd_hdj_chip *usb_chip[SNDRV_CARDS];
+
+ /* reference count for the socket */
+@@ -1681,7 +1681,7 @@ static int snd_hdj_chip_create(struct us
+ chip->card = card;
+ chip->product_code = product_code;
+
+- init_MUTEX(&chip->vendor_request_mutex);
++ sema_init(&chip->vendor_request_mutex,1);
+
+ /* initialise the atomic variables */
+ atomic_set(&chip->locked_io, 0);
+@@ -1696,7 +1696,7 @@ static int snd_hdj_chip_create(struct us
+ INIT_LIST_HEAD(&chip->bulk_list);
+ chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
+ le16_to_cpu(dev->descriptor.idProduct));
+- init_MUTEX(&chip->netlink_list_mutex);
++ sema_init(&chip->netlink_list_mutex,1);
+ INIT_LIST_HEAD(&chip->netlink_registered_processes);
+
+ /* fill in DJ capabilities for this device */
+
+--- midi.c.orig 2011-01-31 20:42:56.470000023 +0100
++++ midi.c 2011-02-02 18:38:31.653333225 +0100
+@@ -34,6 +34,7 @@
+ #include <linux/module.h>
+ #include <linux/usb.h>
+ #include <linux/kthread.h>
++#include <linux/semaphore.h>
+ #include <asm/byteorder.h>
+ #include <asm/atomic.h>
+ #if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
+@@ -677,7 +678,7 @@ static int controller_output_init(struct
+
+ /* this buffer and URB below are for general control requests, like changing the
+ * mouse setting or setting LEDs */
+- init_MUTEX(&controller_state->output_control_ctl_mutex);
++ sema_init(&controller_state->output_control_ctl_mutex, 1);
+ init_completion(&controller_state->output_control_ctl_completion);
+ controller_state->output_control_ctl_req = usb_alloc_coherent(ep->umidi->chip->dev,
+ sizeof(*(controller_state->output_control_ctl_req)),
diff --git a/kernel_2.6.39_fix.patch b/kernel_2.6.39_fix.patch
new file mode 100644
index 000000000000..147b315b8a35
--- /dev/null
+++ b/kernel_2.6.39_fix.patch
@@ -0,0 +1,11 @@
+--- midi.c.orig 2009-01-27 15:25:50.000000000 +0100
++++ midi.c 2011-05-30 21:47:18.000000000 +0200
+@@ -60,7 +60,7 @@
+
+ unsigned long channel_list_initialized = 0;
+ struct midi_channel_elem channel_list[NUM_MIDI_CHANNELS];
+-spinlock_t channel_list_lock = SPIN_LOCK_UNLOCKED;
++DEFINE_SPINLOCK(channel_list_lock);
+
+ static struct usb_protocol_ops snd_hdjmidi_standard_ops = {
+ .input = snd_hdjmidi_standard_input,
diff --git a/kernel_3.16_fix.patch b/kernel_3.16_fix.patch
new file mode 100644
index 000000000000..f7770605ff4f
--- /dev/null
+++ b/kernel_3.16_fix.patch
@@ -0,0 +1,11 @@
+--- device.c.orig 2014-08-31 22:26:13.471173295 +0200
++++ device.c 2014-08-31 22:25:50.821534001 +0200
+@@ -1660,7 +1660,7 @@
+ /* let the kernel option override custom id */
+ strncpy(card_id,id[idx],sizeof(card_id)-1);
+ }
+- err = snd_card_create(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card);
++ err = snd_card_new(NULL, index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card);
+ if (err < 0) {
+ snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx);
+ return err;
diff --git a/kernel_3.6_fix.patch b/kernel_3.6_fix.patch
new file mode 100644
index 000000000000..bd9b641ff29e
--- /dev/null
+++ b/kernel_3.6_fix.patch
@@ -0,0 +1,53 @@
+--- device.c.orig 2009-01-27 15:25:50.000000000 +0100
++++ device.c 2012-10-16 21:52:40.000000000 +0100
+@@ -2393,6 +2393,13 @@
+ /* Try to allocate a netlink socket minimizing the risk of collision,
+ * by starting at the max unit number and counting down */
+ for (unit=MAX_LINKS-1;unit>MIN_NETLINK_UNIT;unit--) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
++ nl_sk = netlink_kernel_create(
++ &init_net,
++ unit,
++ THIS_MODULE,
++ NULL);
++#else
+ nl_sk = netlink_kernel_create(
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+ &init_net,
+@@ -2404,6 +2411,7 @@
+ NULL,
+ #endif
+ THIS_MODULE);
++#endif
+ if (nl_sk!=NULL) {
+ netlink_unit = unit;
+ return 0;
+@@ -2469,6 +2477,20 @@
+ return NULL;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
++ nlh = nlmsg_put(skb, target_pid, seq, t, size, flags);
++ if(!nlh) {
++ if (skb) {
++ kfree_skb(skb);
++ }
++ return NULL;
++ }
++ data = nlmsg_data(nlh);
++ if (size > 0) {
++ memcpy(data, payload, size);
++ }
++ return skb;
++#else
+ nlh = NLMSG_PUT(skb, target_pid, seq, t, size);
+ nlh->nlmsg_flags = flags;
+ data = NLMSG_DATA(nlh);
+@@ -2482,6 +2504,7 @@
+ kfree_skb(skb);
+ }
+ return NULL;
++#endif
+ }
+
+ int register_for_netlink(struct snd_hdj_chip* chip,
diff --git a/kernel_3.7_fix.patch b/kernel_3.7_fix.patch
new file mode 100644
index 000000000000..3db3b600b78a
--- /dev/null
+++ b/kernel_3.7_fix.patch
@@ -0,0 +1,12 @@
+--- device.c.orig 2013-02-03 12:07:06.165824608 +0100
++++ device.c 2013-02-03 12:07:45.498944856 +0100
+@@ -2399,7 +2399,9 @@
+ nl_sk = netlink_kernel_create(
+ &init_net,
+ unit,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
+ THIS_MODULE,
++#endif
+ NULL);
+ #else
+ nl_sk = netlink_kernel_create(