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,35) ) |
40 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
38 |
#include <linux/slab.h> |
41 |
#include <linux/slab.h> |
39 |
#endif |
42 |
#endif |
Lines 3086-3092
Link Here
|
3086 |
goto hdj_create_bulk_interface_error; |
3089 |
goto hdj_create_bulk_interface_error; |
3087 |
} |
3090 |
} |
3088 |
/* allocate the buffer for bulk_out_urb */ |
3091 |
/* allocate the buffer for bulk_out_urb */ |
|
|
3092 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) ) |
3093 |
sema_init(&ubulk->bulk_out_buffer_mutex,1); |
3094 |
#else |
3089 |
init_MUTEX(&ubulk->bulk_out_buffer_mutex); |
3095 |
init_MUTEX(&ubulk->bulk_out_buffer_mutex); |
|
|
3096 |
#endif |
3090 |
|
3097 |
|
3091 |
ubulk->bulk_out_buffer = |
3098 |
ubulk->bulk_out_buffer = |
3092 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
3099 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) ) |
Lines 3633-3639
Link Here
|
3633 |
return -EINVAL; |
3640 |
return -EINVAL; |
3634 |
} |
3641 |
} |
3635 |
|
3642 |
|
|
|
3643 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) ) |
3644 |
sema_init(&ubulk->output_control_mutex,1); |
3645 |
#else |
3636 |
init_MUTEX(&ubulk->output_control_mutex); |
3646 |
init_MUTEX(&ubulk->output_control_mutex); |
|
|
3647 |
#endif |
3637 |
init_completion(&ubulk->output_control_completion); |
3648 |
init_completion(&ubulk->output_control_completion); |
3638 |
|
3649 |
|
3639 |
/* Every product here except the Steel targets HID. Since the steel does not target HID, we don't |
3650 |
/* Every product here except the Steel targets HID. Since the steel does not target HID, we don't |
Lines 3907-3913
Link Here
|
3907 |
u16 value = 0; |
3918 |
u16 value = 0; |
3908 |
struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context); |
3919 |
struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context); |
3909 |
|
3920 |
|
|
|
3921 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) ) |
3922 |
sema_init(&dc->device_config_mutex,1); |
3923 |
#else |
3910 |
init_MUTEX(&dc->device_config_mutex); |
3924 |
init_MUTEX(&dc->device_config_mutex); |
|
|
3925 |
#endif |
3911 |
|
3926 |
|
3912 |
ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common); |
3927 |
ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common); |
3913 |
if (ret!=0) { |
3928 |
if (ret!=0) { |
Lines 4185-4191
Link Here
|
4185 |
|
4200 |
|
4186 |
spin_lock_init(&dc->bulk_buffer_lock); |
4201 |
spin_lock_init(&dc->bulk_buffer_lock); |
4187 |
init_completion(&dc->bulk_request_completion); |
4202 |
init_completion(&dc->bulk_request_completion); |
|
|
4203 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,37) ) |
4204 |
sema_init(&dc->bulk_request_mutex,1); |
4205 |
#else |
4188 |
init_MUTEX(&dc->bulk_request_mutex); |
4206 |
init_MUTEX(&dc->bulk_request_mutex); |
|
|
4207 |
#endif |
4189 |
|
4208 |
|
4190 |
if ((ret = init_continuous_reader(ubulk))!=0) { |
4209 |
if ((ret = init_continuous_reader(ubulk))!=0) { |
4191 |
printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n", |
4210 |
printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n", |