File: usbmixer.patch

package info (click to toggle)
alsa-driver 1.0.13-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 20,108 kB
  • ctags: 50,477
  • sloc: ansic: 319,881; sh: 32,930; makefile: 2,015; python: 1,527; perl: 1,316; xml: 896; awk: 66
file content (66 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- ../alsa-kernel/usb/usbmixer.c	2006-05-12 15:08:40.000000000 +0200
+++ usbmixer.c	2006-06-19 17:19:16.000000000 +0200
@@ -1,3 +1,11 @@
+#include <linux/config.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#define SND_NEED_USB_WRAPPER
+#define __NO_VERSION__
+#endif
+
 /*
  *   (Tentative) USB Audio Driver for ALSA
  *
@@ -40,6 +48,14 @@
 
 #include "usbaudio.h"
 
+#ifndef USB_DT_CS_DEVICE
+#define USB_DT_CS_DEVICE		0x21
+#define USB_DT_CS_CONFIG		0x22
+#define USB_DT_CS_STRING		0x23
+#define USB_DT_CS_INTERFACE		0x24
+#define USB_DT_CS_ENDPOINT		0x25
+#endif
+
 /*
  */
 
@@ -1683,7 +1699,11 @@
 	}
 }
 
+#ifndef OLD_USB
 static void snd_usb_mixer_status_complete(struct urb *urb, struct pt_regs *regs)
+#else
+static void snd_usb_mixer_status_complete(struct urb *urb)
+#endif
 {
 	struct usb_mixer_interface *mixer = urb->context;
 
@@ -1728,7 +1748,11 @@
 		return 0;
 
 	epnum = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
 	buffer_length = le16_to_cpu(ep->wMaxPacketSize);
+#else
+	buffer_length = ep->wMaxPacketSize;
+#endif
 	transfer_buffer = kmalloc(buffer_length, GFP_KERNEL);
 	if (!transfer_buffer)
 		return -ENOMEM;
@@ -1745,8 +1769,12 @@
 	return 0;
 }
 
+#ifndef OLD_USB
 static void snd_usb_soundblaster_remote_complete(struct urb *urb,
 						 struct pt_regs *regs)
+#else
+static void snd_usb_soundblaster_remote_complete(struct urb *urb)
+#endif
 {
 	struct usb_mixer_interface *mixer = urb->context;
 	const struct rc_config *rc = mixer->rc_cfg;