From 1d9cc0062caf7f89847b70a54aec4abf1a9acb18 Mon Sep 17 00:00:00 2001 From: David Guglielmi Date: Sat, 2 Aug 2014 20:51:47 +0200 Subject: [PATCH] - Import ebuild media-sound/hdjmod --- media-sound/hdjmod/Manifest | 13 + .../hdjmod/files/dj_console_mp3_e2.patch | 29 ++ .../hdjmod/files/hdjmod_fix_hotplug.patch | 17 + .../hdjmod/files/hdjmod_kernel_2.6.30.patch | 23 + .../hdjmod/files/hdjmod_kernel_2.6.36.patch | 492 ++++++++++++++++++ .../hdjmod/files/hdjmod_kernel_2.6.37.patch | 135 +++++ .../hdjmod/files/hdjmod_kernel_2.6.39.patch | 12 + .../hdjmod/files/hdjmod_kernel_3.16.patch | 25 + .../hdjmod/files/hdjmod_kernel_3.6.patch | 54 ++ .../hdjmod/files/hdjmod_kernel_3.7.patch | 14 + media-sound/hdjmod/files/hdjmod_kfree.patch | 22 + media-sound/hdjmod/hdjmod-1.28.ebuild | 53 ++ media-sound/hdjmod/metadata.xml | 9 + 13 files changed, 898 insertions(+) create mode 100644 media-sound/hdjmod/Manifest create mode 100644 media-sound/hdjmod/files/dj_console_mp3_e2.patch create mode 100644 media-sound/hdjmod/files/hdjmod_fix_hotplug.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kernel_2.6.30.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kernel_2.6.36.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kernel_2.6.37.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kernel_2.6.39.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kernel_3.16.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kernel_3.6.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kernel_3.7.patch create mode 100644 media-sound/hdjmod/files/hdjmod_kfree.patch create mode 100644 media-sound/hdjmod/hdjmod-1.28.ebuild create mode 100644 media-sound/hdjmod/metadata.xml diff --git a/media-sound/hdjmod/Manifest b/media-sound/hdjmod/Manifest new file mode 100644 index 0000000..a7b0367 --- /dev/null +++ b/media-sound/hdjmod/Manifest @@ -0,0 +1,13 @@ +AUX dj_console_mp3_e2.patch 1368 SHA256 104d04b930d5072eac3c05771a1eb7599b3b58447259be3402c85a3e98b6e028 SHA512 10f0afec327aec004668af091c8311361124513d7484e1278dc5bd432eede62f2d01ab203ea3d47c010f4e1c3fea4bd47c44a1c2bb4062261856cb94dda63a43 WHIRLPOOL dc9c72c8f315394bd8f524807348d08be64d07baf211789d0ef16a6bdbce3764a71b3249fad458f78059b7b02e1a7efd846ddbdc0cc056b2439a63c6f0f57b59 +AUX hdjmod_fix_hotplug.patch 785 SHA256 160dee0bc3bb2b213be55bb3fe7212efd3520d741d19d69541e1e0c67501c184 SHA512 1010e357f838f5f4b36139dc6ea2c3d1039042953baa61b6b742a49589a71105e4d870bfe63496fad230f02e161ac0cc4e78c7e99bac46775922b2f57d6ceade WHIRLPOOL 2f364c78037101b4b2ddf12199bc65d33d1b79fe3abcada155487da072258bd9bc6b898770f463f050c0decc6eb38bed20049dd4db5cff9d7d8585c047ce6ec0 +AUX hdjmod_kernel_2.6.30.patch 931 SHA256 c15793ffd31f43f6042564fcf5cd9740c3ac7a42aec2f52a40306b8dd4d23f7b SHA512 a8e2c500c85369610d53a967044d64211a97cd072e13824c628986d6d41e97920b183f44c9027fc67afb5294cbaa0436cd7598193b7e11e1ae5a23d44a230859 WHIRLPOOL 15593c115f1cd4dc55da594f1830bd342855aeb789672bb6b632f09bdf725e74208c19ef9017b82a5591684941a869756ceb89f451bcc90421bcb02a9408f32d +AUX hdjmod_kernel_2.6.36.patch 17168 SHA256 65a20d275ea3d3e0dcd00edc3750b461d1f998b74c2ec41ff28a37a333161229 SHA512 a680ca2982bfef114df04d9483e2e4b45ff22d299a834427236f13ddb4cbcb08729254beff5c1376a5adaaa5c0b33d8c863054c5baae5957b81ce09ffaf53a4b WHIRLPOOL b5a373937055d004efef93d43a8f82c0be568199cc284dedec584bf9d9338ee9001962c2aca46ce1fdd8a8e5b88c5098cbd6f008b088f9f0aef13d295f8300cf +AUX hdjmod_kernel_2.6.37.patch 4658 SHA256 65156c36c3d8ec74cfcd9f56fd88f2828ce7cc782318a761202a72f03e425d57 SHA512 f7fb3f38295b6102d9625447e3f05b228502b879660549eabe09db754d9c7e36c5a1cc46c93800dc81bb6b744f44f2a8025c42edae24772592a1c49322690f0c WHIRLPOOL f40ecd2db1736d7589a0462a6b7f537424607870bdae02b8ee01430f405e0169ae3f6277a248413fa6fd3a91095a0d6793e42d6ccb14fed30590efa88427e0e9 +AUX hdjmod_kernel_2.6.39.patch 492 SHA256 8baac382e065a8ed536ffdd560956fd2d07d431fa2322dd46fd26b96b5828086 SHA512 9696c469a34a044ac656e0f8b5b0230544985d5ed7857e96984950774033395669f6eb0acea0168d61ac18da73d0b90ee472ee30d8c02024ce91ffb753a82189 WHIRLPOOL c3a2521623beb6545242a8088e6abd44b7e24da67fcf259ec7c4f62f91dfaaaffe5977bd861d60128b93ddb0a578207ed2d6b1800feb93b4cfc4198679e108e0 +AUX hdjmod_kernel_3.16.patch 1073 SHA256 02edc97a5f4926a1e1821335b66f2447c5ffc6465efa6f58d79043b566ee7cea SHA512 42f0ae68afb90c56315fe06f46a4d056d3b93fbf1b152241567415afaf7084eb27c2a30ed79f9473014aaea67ad25eb610bafd4563f29b83ee4fc472586f13d3 WHIRLPOOL c84ce9631dc8c8acdab1fac2bd51000dbb9a396fb593ffe7f3b25a9d2294e01499b7d491dab0d33deab3357914a32212f890a886933523d19761e12505acbed3 +AUX hdjmod_kernel_3.6.patch 1441 SHA256 ba2e19c2973cfb01977a0b542b0b952e2b37df7a80dd519edad2dfeb5780f903 SHA512 efc45711249fc615e092969c26551d8705ec9fa95751f7a2f561625c7b101bb0db96c6ea5c5c6de55286a049a2bf71e16e3c9585b94ac143905828bfe97e4e4e WHIRLPOOL d56556678d2861f9e9a182ae74419b2b807b2ebb7d69836355b6c7ff19f2ac0a88394b20b8840cbcb1d806d748513fce910b59fdebaf2851bd26807965afb083 +AUX hdjmod_kernel_3.7.patch 450 SHA256 2283f7382e567b6e0d7e34c5847ce3d4f56b1f9df3e5bb7a1cd9d3e59d5a98dd SHA512 042b0c37301a1dcdacbae27d2035c68ea134d87ca581d2e5ab754da73242bd868d8bcb59537037d70eb710b1b1474df7f9f9e2c17b55f637359f698f1789186e WHIRLPOOL c0fbc3a436f20e8150bea7089c35278092ad91fde64eff82c6184c36c33304d37f437e208736b16465d721bed29fa78f24c0ce2859fe5e09f64569fe2a706cbe +AUX hdjmod_kfree.patch 864 SHA256 d8980de10f5eeb2c6939ba11b78215fe9bdb5b75e4893ea4d449a6cae2818124 SHA512 20601818bcd81c6c21ea47f22de25cebcaadecc7a4ad2eeda2d78aee07b3991448356b242493c074bf8129f6c1e14221686d82d98929826e1193717c337c1d5d WHIRLPOOL 847c4011ab59a3645d0e9f0983ef28febd796bd3562d5b10b4c005033443a88f3e550e581e757c2e9be4bb661433b08c098bf24b926aa84e160851e8ee7836e6 +DIST Hercules_DJSeries_Linux.tgz 10060469 SHA256 c3957491c367f642484e7a7f5a15acb8cb50f7c407cb225eabc7fb5d6a07ed28 SHA512 b63dd2a4abefc6d75fb1383c001191b0acd2473bd256c6f099ab079d22bdd1c1e3c8ddddca724601caea90133ccc5c264cf285d1dad339507a0a702f37e42b30 WHIRLPOOL 11ee0998cabaecf6e18b3c0b413f43af13918d1d9c673f0ab62a3d7abb5cb35b70b6808edf84886d91e1e557b60dc382f19b862668fd6f90cd4f37cdd6f07906 +EBUILD hdjmod-1.28.ebuild 1327 SHA256 68a96df11c93511cb5db33b5da34df7232b45baa7b3e76eea6949c1319fec7b1 SHA512 2fbac54e140dcd6ae096f28d57e6153aed9fb91ce97c3d083aede49b67b38802ce4965c1abe9d2457405e789522700ed4eb1da720b7aa7338fa86a4ff7435e6b WHIRLPOOL b4c282b88f120fd28343531ee9003568de219de5baa3173090bc88311d1221a991ceb32b875155741151b247272d72b47e5d0acd6d0772e0e10c6553604b6b5e +MISC metadata.xml 279 SHA256 57b46f588d3f016ff88ab3a11ea193bbc3d875621bb03961f52d15f95898a0a7 SHA512 e83c1bfc480012d014868027a92d99b55da96dad7960814eb4ba7ec738a8770aec6d84db792a2dabca65568d39f55c890f348177118ddd8cc49aefa6c7e90ef0 WHIRLPOOL 084174ee31ca47d9c908b6800cfdb7361f6e20bb6161996c9f69a2c3e266e47784dda18e9fbfb06a3d8f1eec8265c12bfc6bf36a1d9f0f0ac0c5e655e5b1270c diff --git a/media-sound/hdjmod/files/dj_console_mp3_e2.patch b/media-sound/hdjmod/files/dj_console_mp3_e2.patch new file mode 100644 index 0000000..dde59e1 --- /dev/null +++ b/media-sound/hdjmod/files/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/media-sound/hdjmod/files/hdjmod_fix_hotplug.patch b/media-sound/hdjmod/files/hdjmod_fix_hotplug.patch new file mode 100644 index 0000000..8e96b5d --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_fix_hotplug.patch @@ -0,0 +1,17 @@ +diff -Naru hdjmod-1.28o/device.c hdjmod-1.28/device.c +--- hdjmod-1.28o/device.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/device.c 2012-03-13 22:21:56.000000000 +0100 +@@ -79,10 +79,9 @@ + /* table of devices that work with this driver- look for vendor specific interfaces with + * our VID */ + static struct usb_device_id hdj_table [] = { +- { .match_flags = (USB_DEVICE_ID_MATCH_DEVICE), +- .idVendor = (USB_HDJ_VENDOR_ID) }, +- { .match_flags = (USB_DEVICE_ID_MATCH_INT_CLASS), +- .bInterfaceClass = USB_CLASS_VENDOR_SPEC}, ++ { .match_flags = (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_CLASS), ++ .idVendor = (USB_HDJ_VENDOR_ID), ++ .bInterfaceClass = USB_CLASS_VENDOR_SPEC }, + { } /* Terminating entry */ + }; + MODULE_DEVICE_TABLE(usb, hdj_table); diff --git a/media-sound/hdjmod/files/hdjmod_kernel_2.6.30.patch b/media-sound/hdjmod/files/hdjmod_kernel_2.6.30.patch new file mode 100644 index 0000000..545bc4c --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kernel_2.6.30.patch @@ -0,0 +1,23 @@ +diff -Naru hdjmod-1.28o/device.c hdjmod-1.28/device.c +--- hdjmod-1.28o/device.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/device.c 2010-02-06 16:20:36.901740173 +0100 +@@ -1660,11 +1660,19 @@ + /* let the kernel option override custom id */ + strncpy(card_id,id[idx],sizeof(card_id)-1); + } ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ) ++ err = snd_card_create(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card ); ++ if (err) { ++ snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx); ++ return err; ++ } ++#else + 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; + } ++#endif + + /* save the index, so people who have the card can reference the chip */ + card->private_data = (void*)(unsigned long)idx; diff --git a/media-sound/hdjmod/files/hdjmod_kernel_2.6.36.patch b/media-sound/hdjmod/files/hdjmod_kernel_2.6.36.patch new file mode 100644 index 0000000..d762d4b --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kernel_2.6.36.patch @@ -0,0 +1,492 @@ +diff -Naru hdjmod-1.28.old/bulk.c hdjmod-1.28/bulk.c +--- hdjmod-1.28.old/bulk.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/bulk.c 2010-09-26 19:27:53.000000000 +0200 +@@ -462,7 +462,7 @@ + + 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; ++ 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 @@ + 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,12 @@ + { + 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), ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ interface_to_usbdev(ubulk->control_interface), + sizeof(*(ubulk->output_control_ctl_req)), + ubulk->output_control_ctl_req, + ubulk->output_control_dma); +@@ -2684,7 +2689,12 @@ + + if (ubulk->output_control_buffer!=NULL && ubulk->control_interface!=NULL && + ubulk->output_control_urb!=NULL) { +- usb_buffer_free(interface_to_usbdev(ubulk->control_interface), ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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 +2722,12 @@ + 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, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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,7 +3080,12 @@ + init_MUTEX(&ubulk->bulk_out_buffer_mutex); + + ubulk->bulk_out_buffer = +- usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ ubulk->chip->dev, ubulk->bulk_out_size, + GFP_KERNEL, &ubulk->bulk_out_urb->transfer_dma); + + if (ubulk->bulk_out_buffer==NULL) { +@@ -3609,7 +3629,13 @@ + * 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 = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ interface_to_usbdev(ubulk->control_interface), + sizeof(*(ubulk->output_control_ctl_req)), + GFP_KERNEL, + &ubulk->output_control_dma); +@@ -3628,7 +3654,13 @@ + goto hdjbulk_init_output_control_state_error; + } + +- ubulk->output_control_buffer = usb_buffer_alloc(interface_to_usbdev(ubulk->control_interface), ++ ubulk->output_control_buffer = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ interface_to_usbdev(ubulk->control_interface), + ubulk->output_control_buffer_size, + GFP_KERNEL, + &ubulk->output_control_urb->transfer_dma); +@@ -3773,7 +3805,13 @@ + } + + ep[i]->max_transfer = ubulk->continuous_reader_packet_size; +- buffer = usb_buffer_alloc(ubulk->chip->dev, ep[i]->max_transfer, ++ buffer = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ 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__); +@@ -4250,7 +4288,12 @@ + { + if (ep->urb) { + if (ep->urb->transfer_buffer) { +- usb_buffer_free(ep->ubulk->chip->dev, ep->max_transfer, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ ep->ubulk->chip->dev, ep->max_transfer, + ep->urb->transfer_buffer, + ep->urb->transfer_dma); + } +diff -Naru hdjmod-1.28.old/device.c hdjmod-1.28/device.c +--- hdjmod-1.28.old/device.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/device.c 2010-09-26 19:14:55.000000000 +0200 +@@ -1559,7 +1559,12 @@ + + if(chip->ctrl_req_buffer != NULL) + { +- usb_buffer_free(chip->dev, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ chip->dev, + chip->ctrl_urb->transfer_buffer_length, + chip->ctrl_req_buffer, + chip->ctrl_urb->transfer_dma); +@@ -1575,7 +1580,12 @@ + + if(chip->ctl_req != NULL) + { +- usb_buffer_free(chip->dev, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ chip->dev, + sizeof(*(chip->ctl_req)), + chip->ctl_req, + chip->ctl_req_dma); +@@ -1728,7 +1738,13 @@ + } + + /* allocate memory for setup packet for our control requests */ +- chip->ctl_req = usb_buffer_alloc(chip->dev, ++ chip->ctl_req = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ chip->dev, + sizeof(*(chip->ctl_req)), + GFP_KERNEL, + &chip->ctl_req_dma); +@@ -1743,7 +1759,13 @@ + + 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 = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ chip->dev, + chip->ctrl_urb->transfer_buffer_length, + GFP_KERNEL, + &chip->ctrl_urb->transfer_dma); +diff -Naru hdjmod-1.28.old/midi.c hdjmod-1.28/midi.c +--- hdjmod-1.28.old/midi.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/midi.c 2010-09-26 19:38:35.000000000 +0200 +@@ -367,7 +367,12 @@ + { + if (ep->urb) { + if (ep->urb->transfer_buffer) { +- usb_buffer_free(ep->umidi->chip->dev, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ ep->umidi->chip->dev, + ep->urb->transfer_buffer_length, + ep->urb->transfer_buffer, + ep->urb->transfer_dma); +@@ -503,7 +508,13 @@ + 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 = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ umidi->chip->dev, length, GFP_KERNEL, + &ep->urb->transfer_dma); + if (!buffer) { + snd_printk(KERN_WARNING"%s() usb_buffer_alloc failed\n",__FUNCTION__); +@@ -536,7 +547,12 @@ + #endif + if (ep->urb) { + if (ep->urb->transfer_buffer) { +- usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ ep->umidi->chip->dev, ep->max_transfer, + ep->urb->transfer_buffer, + ep->urb->transfer_dma); + } +@@ -544,27 +560,47 @@ + } + if (ep->urb_led) { + if (ep->urb_led->transfer_buffer) { +- usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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)), ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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 +609,12 @@ + usb_free_urb(ep->controller_state->output_control_ctl_urb); + } + if (ep->controller_state->ctl_req) { +- usb_buffer_free(ep->umidi->chip->dev, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ ep->umidi->chip->dev, + sizeof(*(ep->controller_state->ctl_req)), + ep->controller_state->ctl_req, + ep->controller_state->ctl_req_dma); +@@ -584,14 +625,24 @@ + } + if (ep->controller_state->urb_kt) { + if (ep->controller_state->urb_kt->transfer_buffer) { +- usb_buffer_free(ep->umidi->chip->dev, ep->max_transfer, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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, ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_free_coherent( ++#else ++ usb_buffer_free( ++#endif ++ 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,7 +717,13 @@ + 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 = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ ep->umidi->chip->dev, + sizeof(*(controller_state->ctl_req)), + GFP_KERNEL, + &controller_state->ctl_req_dma); +@@ -679,7 +736,13 @@ + * 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 = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ ep->umidi->chip->dev, + sizeof(*(controller_state->output_control_ctl_req)), + GFP_KERNEL, + &controller_state->output_control_ctl_dma); +@@ -700,7 +763,13 @@ + 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 = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ 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", +@@ -727,7 +796,7 @@ + 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; ++ controller_state->output_control_ctl_urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; + + return 0; + } +@@ -772,7 +841,13 @@ + } + + if (ep->umidi->chip->caps.leds_hid_controlled) { +- ep->ctrl_req_led = usb_buffer_alloc(ep->umidi->chip->dev, ++ ep->ctrl_req_led = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ ep->umidi->chip->dev, + sizeof(*(ep->ctrl_req_led)), + GFP_KERNEL, + &ep->ctrl_req_led_dma); +@@ -806,7 +881,13 @@ + 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 = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ 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__); +@@ -814,7 +895,13 @@ + return -ENOMEM; + } + +- buffer_led = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, ++ buffer_led = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ 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", +@@ -854,7 +941,7 @@ + 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; ++ ep->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; + } + + if (ep->umidi->chip->caps.leds_hid_controlled) { +@@ -875,7 +962,7 @@ + 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; ++ ep->urb_led->transfer_flags = URB_NO_TRANSFER_DMA_MAP; + } + + if (ep->umidi->chip->caps.leds_bulk_controlled) { +@@ -913,7 +1000,13 @@ + return -ENOMEM; + } + +- buffer = usb_buffer_alloc(umidi->chip->dev, ep->max_transfer, ++ buffer = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ 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__); +@@ -921,7 +1014,13 @@ + return -ENOMEM; + } + +- ep->controller_state->ctl_req_kt = usb_buffer_alloc(umidi->chip->dev, ++ ep->controller_state->ctl_req_kt = ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) ) ++ usb_alloc_coherent( ++#else ++ usb_buffer_alloc( ++#endif ++ umidi->chip->dev, + sizeof(*(ep->controller_state->ctl_req_kt)), + GFP_KERNEL, + &ep->controller_state->ctl_req_dma_kt); +@@ -947,7 +1046,7 @@ + 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; ++ 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/media-sound/hdjmod/files/hdjmod_kernel_2.6.37.patch b/media-sound/hdjmod/files/hdjmod_kernel_2.6.37.patch new file mode 100644 index 0000000..9cd3a88 --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kernel_2.6.37.patch @@ -0,0 +1,135 @@ +diff -Naru hdjmod-1.28o/bulk.c hdjmod-1.28/bulk.c +--- hdjmod-1.28o/bulk.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/bulk.c 2012-04-06 22:53:14.000000000 +0200 +@@ -34,6 +34,9 @@ + #include + #include + #include /* For LINUX_VERSION_CODE */ ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++#include ++#endif + #if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) ) + #include + #endif +@@ -3062,7 +3065,11 @@ + goto hdj_create_bulk_interface_error; + } + /* allocate the buffer for bulk_out_urb */ ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++ sema_init(&ubulk->bulk_out_buffer_mutex,1); ++#else + init_MUTEX(&ubulk->bulk_out_buffer_mutex); ++#endif + + ubulk->bulk_out_buffer = + usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size, +@@ -3601,7 +3608,11 @@ + return -EINVAL; + } + ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++ sema_init(&ubulk->output_control_mutex,1); ++#else + init_MUTEX(&ubulk->output_control_mutex); ++#endif + 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 +3866,11 @@ + u16 value = 0; + struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context); + ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++ sema_init(&dc->device_config_mutex,1); ++#else + init_MUTEX(&dc->device_config_mutex); ++#endif + + ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common); + if (ret!=0) { +@@ -4133,7 +4148,11 @@ + + spin_lock_init(&dc->bulk_buffer_lock); + init_completion(&dc->bulk_request_completion); ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++ sema_init(&dc->bulk_request_mutex,1); ++#else + init_MUTEX(&dc->bulk_request_mutex); ++#endif + + if ((ret = init_continuous_reader(ubulk))!=0) { + printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n", +diff -Naru hdjmod-1.28o/device.c hdjmod-1.28/device.c +--- hdjmod-1.28o/device.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/device.c 2012-04-06 22:54:53.000000000 +0200 +@@ -36,6 +36,9 @@ + #include + #include + #include ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++#include ++#endif + #if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) ) + #include + #endif +@@ -66,7 +69,11 @@ + module_param_array(id, charp, NULL, 0444); + MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter."); + ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++static DEFINE_SEMAPHORE(register_mutex); ++#else + static DECLARE_MUTEX(register_mutex); ++#endif + static struct snd_hdj_chip *usb_chip[SNDRV_CARDS]; + + /* reference count for the socket */ +@@ -1682,7 +1689,11 @@ + chip->card = card; + chip->product_code = product_code; + ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++ sema_init(&chip->vendor_request_mutex,1); ++#else + init_MUTEX(&chip->vendor_request_mutex); ++#endif + + /* initialise the atomic variables */ + atomic_set(&chip->locked_io, 0); +@@ -1697,7 +1708,11 @@ + INIT_LIST_HEAD(&chip->bulk_list); + chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor), + le16_to_cpu(dev->descriptor.idProduct)); ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++ sema_init(&chip->netlink_list_mutex,1); ++#else + init_MUTEX(&chip->netlink_list_mutex); ++#endif + INIT_LIST_HEAD(&chip->netlink_registered_processes); + + /* fill in DJ capabilities for this device */ +diff -Naru hdjmod-1.28o/midi.c hdjmod-1.28/midi.c +--- hdjmod-1.28o/midi.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/midi.c 2012-04-06 22:55:48.000000000 +0200 +@@ -34,6 +34,9 @@ + #include + #include + #include ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++#include ++#endif + #include + #include + #if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) ) +@@ -677,7 +680,11 @@ + + /* this buffer and URB below are for general control requests, like changing the + * mouse setting or setting LEDs */ ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) ++ sema_init(&controller_state->output_control_ctl_mutex, 1); ++#else + init_MUTEX(&controller_state->output_control_ctl_mutex); ++#endif + init_completion(&controller_state->output_control_ctl_completion); + controller_state->output_control_ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, + sizeof(*(controller_state->output_control_ctl_req)), diff --git a/media-sound/hdjmod/files/hdjmod_kernel_2.6.39.patch b/media-sound/hdjmod/files/hdjmod_kernel_2.6.39.patch new file mode 100644 index 0000000..87dab82 --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kernel_2.6.39.patch @@ -0,0 +1,12 @@ +diff -Naru hdjmod-1.28o/midi.c hdjmod-1.28/midi.c +--- hdjmod-1.28o/midi.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/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/media-sound/hdjmod/files/hdjmod_kernel_3.16.patch b/media-sound/hdjmod/files/hdjmod_kernel_3.16.patch new file mode 100644 index 0000000..e6c4109 --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kernel_3.16.patch @@ -0,0 +1,25 @@ +From: Matthias Bach +Date: 2014-07-26 23:30:00 +0200 +Subject: Fix compile on kernel 3.16 +Upstream: to be done + +The module no longer compiled on 3.16 due to API changes in ALSA. + +diff -Naru hdjmod-1.28o/device.c hdjmod-1.28/device.c +--- hdjmod-1.28o/device.c 2014-07-25 22:38:52.985186212 +0200 ++++ hdjmod-1.28/device.c 2014-07-25 22:44:05.297761993 +0200 +@@ -1660,7 +1660,13 @@ + /* let the kernel option override custom id */ + strncpy(card_id,id[idx],sizeof(card_id)-1); + } +-#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ) ++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) ) ++ err = snd_card_new(&dev->dev, index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card ); ++ if (err) { ++ snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx); ++ return err; ++ } ++#elif ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ) + err = snd_card_create(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card ); + if (err) { + snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx); diff --git a/media-sound/hdjmod/files/hdjmod_kernel_3.6.patch b/media-sound/hdjmod/files/hdjmod_kernel_3.6.patch new file mode 100644 index 0000000..69ccecc --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kernel_3.6.patch @@ -0,0 +1,54 @@ +diff -Naru hdjmod-1.28o/device.c hdjmod-1.28/device.c +--- hdjmod-1.28o/device.c 2009-01-27 15:25:50.000000000 +0100 ++++ hdjmod-1.28/device.c 2012-10-16 21:52:40.000000000 +0200 +@@ -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/media-sound/hdjmod/files/hdjmod_kernel_3.7.patch b/media-sound/hdjmod/files/hdjmod_kernel_3.7.patch new file mode 100644 index 0000000..44f11ef --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kernel_3.7.patch @@ -0,0 +1,14 @@ +diff -aru hdjmod-1.28o/device.c hdjmod-1.28/device.c +--- hdjmod-1.28o/device.c 2012-12-23 17:41:13.111607777 +0100 ++++ hdjmod-1.28/device.c 2012-12-23 17:42:33.115898437 +0100 +@@ -2397,7 +2397,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( +Nur in hdjmod-1.28: .device.c.swp. diff --git a/media-sound/hdjmod/files/hdjmod_kfree.patch b/media-sound/hdjmod/files/hdjmod_kfree.patch new file mode 100644 index 0000000..8515666 --- /dev/null +++ b/media-sound/hdjmod/files/hdjmod_kfree.patch @@ -0,0 +1,22 @@ +diff -Naru hdjmod-1.28o//configuration_manager.c hdjmod-1.28/configuration_manager.c +--- hdjmod-1.28o//configuration_manager.c 2010-07-25 18:57:11.000000000 +0200 ++++ hdjmod-1.28/configuration_manager.c 2010-07-25 19:00:15.000000000 +0200 +@@ -23,6 +23,7 @@ + + #include + #include ++#include + #include + #include /* For LINUX_VERSION_CODE */ + #include +diff -Naru hdjmod-1.28o//midi.c hdjmod-1.28/midi.c +--- hdjmod-1.28o//midi.c 2010-07-25 18:57:11.000000000 +0200 ++++ hdjmod-1.28/midi.c 2010-07-25 19:02:13.000000000 +0200 +@@ -25,6 +25,7 @@ + #include + #include /* For LINUX_VERSION_CODE */ + #include ++#include + #include + #include + #include diff --git a/media-sound/hdjmod/hdjmod-1.28.ebuild b/media-sound/hdjmod/hdjmod-1.28.ebuild new file mode 100644 index 0000000..8c6ee93 --- /dev/null +++ b/media-sound/hdjmod/hdjmod-1.28.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit eutils linux-mod rpm + +DESCRIPTION="Hercules DJ devices kernel module driver" +HOMEPAGE="ftp://ftp.hercules.com/pub/webupdate/DJCSeries" +SRC_URI="ftp://ftp.hercules.com/pub/webupdate/DJCSeries/Hercules_DJSeries_Linux.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="sys-kernel/linux-headers" +RDEPEND="${DEPEND}" + +pkg_setup() { + linux-mod_pkg_setup + CONFIG_CHECK=" + SND_RAWMIDI + SND_VIRMIDI + USB + " + check_extra_config + BUILD_TARGETS="clean modules" + BUILD_PARAMS="KERNELDIR=${KV_DIR}" + MODULE_NAMES="hdj_mod()" +} + +src_unpack() { + unpack ${A} + rpm_unpack "./kernel module/${PN}-dkms-${PV}-1.noarch.rpm" + + einfo "Move ${WORKDIR}/usr/src/${P} to ${S}" + mv "${WORKDIR}/usr/src/${P}" "${S}" +} + +src_prepare() { + epatch "${FILESDIR}/dj_console_mp3_e2.patch" + epatch "${FILESDIR}/${PN}_fix_hotplug.patch" + epatch "${FILESDIR}/${PN}_kfree.patch" + epatch "${FILESDIR}/${PN}_kernel_2.6.30.patch" + epatch "${FILESDIR}/${PN}_kernel_2.6.36.patch" + epatch "${FILESDIR}/${PN}_kernel_2.6.37.patch" + epatch "${FILESDIR}/${PN}_kernel_2.6.39.patch" + epatch "${FILESDIR}/${PN}_kernel_3.6.patch" + epatch "${FILESDIR}/${PN}_kernel_3.7.patch" + epatch "${FILESDIR}/${PN}_kernel_3.16.patch" +} diff --git a/media-sound/hdjmod/metadata.xml b/media-sound/hdjmod/metadata.xml new file mode 100644 index 0000000..47b715a --- /dev/null +++ b/media-sound/hdjmod/metadata.xml @@ -0,0 +1,9 @@ + + + + media-sound + + dg@accelance.fr + David Guglielmi + +