Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 272100 | Differences between
and this patch

Collapse All | Expand All

(-)hdjmod-1.28o/bulk.c (+19 lines)
Lines 34-39 Link Here
34
#include <linux/usb.h>
34
#include <linux/usb.h>
35
#include <linux/delay.h>
35
#include <linux/delay.h>
36
#include <linux/version.h>	/* For LINUX_VERSION_CODE */
36
#include <linux/version.h>	/* For LINUX_VERSION_CODE */
37
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
38
#include <linux/semaphore.h>
39
#endif
37
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
40
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
38
#include <sound/driver.h>
41
#include <sound/driver.h>
39
#endif
42
#endif
Lines 3062-3068 Link Here
3062
		goto hdj_create_bulk_interface_error;
3065
		goto hdj_create_bulk_interface_error;
3063
	}
3066
	}
3064
	/* allocate the buffer for bulk_out_urb */
3067
	/* allocate the buffer for bulk_out_urb */
3068
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
3069
	sema_init(&ubulk->bulk_out_buffer_mutex,1);
3070
#else
3065
	init_MUTEX(&ubulk->bulk_out_buffer_mutex);
3071
	init_MUTEX(&ubulk->bulk_out_buffer_mutex);
3072
#endif
3066
	
3073
	
3067
	ubulk->bulk_out_buffer =
3074
	ubulk->bulk_out_buffer =
3068
		usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size,
3075
		usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size,
Lines 3601-3607 Link Here
3601
		return -EINVAL;
3608
		return -EINVAL;
3602
	}
3609
	}
3603
3610
3611
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
3612
	sema_init(&ubulk->output_control_mutex,1);
3613
#else
3604
	init_MUTEX(&ubulk->output_control_mutex);
3614
	init_MUTEX(&ubulk->output_control_mutex);
3615
#endif
3605
	init_completion(&ubulk->output_control_completion);
3616
	init_completion(&ubulk->output_control_completion);
3606
3617
3607
	/* Every product here except the Steel targets HID.  Since the steel does not target HID, we don't
3618
	/* Every product here except the Steel targets HID.  Since the steel does not target HID, we don't
Lines 3855-3861 Link Here
3855
	u16 value = 0;
3866
	u16 value = 0;
3856
	struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context);
3867
	struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context);
3857
3868
3869
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
3870
	sema_init(&dc->device_config_mutex,1);
3871
#else
3858
	init_MUTEX(&dc->device_config_mutex);
3872
	init_MUTEX(&dc->device_config_mutex);
3873
#endif
3859
	
3874
	
3860
	ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common);
3875
	ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common);
3861
	if (ret!=0) {
3876
	if (ret!=0) {
Lines 4133-4139 Link Here
4133
4148
4134
	spin_lock_init(&dc->bulk_buffer_lock);
4149
	spin_lock_init(&dc->bulk_buffer_lock);
4135
	init_completion(&dc->bulk_request_completion);
4150
	init_completion(&dc->bulk_request_completion);
4151
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
4152
	sema_init(&dc->bulk_request_mutex,1);
4153
#else
4136
	init_MUTEX(&dc->bulk_request_mutex);
4154
	init_MUTEX(&dc->bulk_request_mutex);
4155
#endif
4137
4156
4138
	if ((ret = init_continuous_reader(ubulk))!=0) {
4157
	if ((ret = init_continuous_reader(ubulk))!=0) {
4139
		printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n",
4158
		printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n",
(-)hdjmod-1.28o/device.c (+15 lines)
Lines 36-41 Link Here
36
#include <linux/netlink.h>
36
#include <linux/netlink.h>
37
#include <net/sock.h>
37
#include <net/sock.h>
38
#include <linux/usb.h>
38
#include <linux/usb.h>
39
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
40
#include <linux/semaphore.h>
41
#endif
39
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
42
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
40
#include <sound/driver.h>
43
#include <sound/driver.h>
41
#endif
44
#endif
Lines 66-72 Link Here
66
module_param_array(id, charp, NULL, 0444);
69
module_param_array(id, charp, NULL, 0444);
67
MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter.");
70
MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter.");
68
71
72
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
73
static DEFINE_SEMAPHORE(register_mutex);
74
#else
69
static DECLARE_MUTEX(register_mutex);
75
static DECLARE_MUTEX(register_mutex);
76
#endif
70
static struct snd_hdj_chip *usb_chip[SNDRV_CARDS];
77
static struct snd_hdj_chip *usb_chip[SNDRV_CARDS];
71
78
72
/* reference count for the socket */
79
/* reference count for the socket */
Lines 1682-1688 Link Here
1682
	chip->card = card;
1689
	chip->card = card;
1683
	chip->product_code = product_code;
1690
	chip->product_code = product_code;
1684
1691
1692
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
1693
	sema_init(&chip->vendor_request_mutex,1);
1694
#else
1685
	init_MUTEX(&chip->vendor_request_mutex);
1695
	init_MUTEX(&chip->vendor_request_mutex);
1696
#endif
1686
1697
1687
	/* initialise the atomic variables */
1698
	/* initialise the atomic variables */
1688
	atomic_set(&chip->locked_io, 0);
1699
	atomic_set(&chip->locked_io, 0);
Lines 1697-1703 Link Here
1697
	INIT_LIST_HEAD(&chip->bulk_list);
1708
	INIT_LIST_HEAD(&chip->bulk_list);
1698
	chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
1709
	chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),
1699
			      le16_to_cpu(dev->descriptor.idProduct));
1710
			      le16_to_cpu(dev->descriptor.idProduct));
1711
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
1712
	sema_init(&chip->netlink_list_mutex,1);
1713
#else
1700
	init_MUTEX(&chip->netlink_list_mutex);
1714
	init_MUTEX(&chip->netlink_list_mutex);
1715
#endif
1701
	INIT_LIST_HEAD(&chip->netlink_registered_processes);
1716
	INIT_LIST_HEAD(&chip->netlink_registered_processes);
1702
	
1717
	
1703
	/* fill in DJ capabilities for this device */
1718
	/* fill in DJ capabilities for this device */
(-)hdjmod-1.28o/midi.c (+7 lines)
Lines 34-39 Link Here
34
#include <linux/module.h>
34
#include <linux/module.h>
35
#include <linux/usb.h>
35
#include <linux/usb.h>
36
#include <linux/kthread.h>
36
#include <linux/kthread.h>
37
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
38
#include <linux/semaphore.h>
39
#endif
37
#include <asm/byteorder.h>
40
#include <asm/byteorder.h>
38
#include <asm/atomic.h>
41
#include <asm/atomic.h>
39
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
42
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) )
Lines 677-683 Link Here
677
	
680
	
678
	/* this buffer and URB below are for general control requests, like changing the
681
	/* this buffer and URB below are for general control requests, like changing the
679
	 *  mouse setting or setting LEDs */
682
	 *  mouse setting or setting LEDs */
683
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )
684
	sema_init(&controller_state->output_control_ctl_mutex, 1);
685
#else
680
	init_MUTEX(&controller_state->output_control_ctl_mutex);
686
	init_MUTEX(&controller_state->output_control_ctl_mutex);
687
#endif
681
	init_completion(&controller_state->output_control_ctl_completion);
688
	init_completion(&controller_state->output_control_ctl_completion);
682
	controller_state->output_control_ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, 
689
	controller_state->output_control_ctl_req = usb_buffer_alloc(ep->umidi->chip->dev, 
683
							sizeof(*(controller_state->output_control_ctl_req)),
690
							sizeof(*(controller_state->output_control_ctl_req)),

Return to bug 272100