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 67 68 69 70 71 72 73 74 75 76 77
|
--- ../alsa-kernel/usb/quirks.c 2010-03-10 09:22:24.488022926 +0100
+++ quirks.c 2010-03-10 09:59:44.787522189 +0100
@@ -1,3 +1,5 @@
+#define __NO_VERSION__
+#include "usbaudio.inc"
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -157,7 +159,11 @@
}
alts = &iface->altsetting[fp->altset_idx];
fp->datainterval = snd_usb_parse_datainterval(chip, alts);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
+#else
+ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
+#endif
usb_set_interface(chip->dev, fp->iface, 0);
snd_usb_init_pitch(chip, fp->iface, alts, fp);
snd_usb_init_sample_rate(chip, fp->iface, alts, fp, fp->rate_max);
@@ -228,7 +234,11 @@
fp->endpoint = get_endpoint(alts, 0)->bEndpointAddress;
fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
fp->datainterval = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
+#else
+ fp->maxpacksize = get_endpoint(alts, 0)->wMaxPacketSize;
+#endif
switch (fp->maxpacksize) {
case 0x120:
@@ -313,8 +323,13 @@
struct usb_host_config *config = dev->actconfig;
int err;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
if (le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_OLD ||
le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_NEW) {
+#else
+ if (get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_OLD ||
+ get_cfg_desc(config)->wTotalLength == EXTIGY_FIRMWARE_SIZE_NEW) {
+#endif
snd_printdd("sending Extigy boot sequence...\n");
/* Send message to force it to reconnect with full interface. */
err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev,0),
@@ -326,8 +341,13 @@
if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err);
err = usb_reset_configuration(dev);
if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
snd_printdd("extigy_boot: new boot length = %d\n",
le16_to_cpu(get_cfg_desc(config)->wTotalLength));
+#else
+ snd_printdd("extigy_boot: new boot length = %d\n",
+ get_cfg_desc(config)->wTotalLength);
+#endif
return -ENODEV; /* quit this anyway */
}
return 0;
@@ -335,6 +355,8 @@
static int snd_usb_audigy2nx_boot_quirk(struct usb_device *dev)
{
+/* The pre-2.6.13 EHCI driver blows up when doing high speed iso transfers */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
u8 buf = 1;
snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 0x2a,
@@ -346,6 +368,7 @@
1, 2000, NULL, 0, 1000);
return -ENODEV;
}
+#endif
return 0;
}
|