[Bluetooth] Add support for newer ANYCOM USB dongles
[pandora-kernel.git] / sound / usb / usbaudio.c
index 664dd4c..c82b01c 100644 (file)
@@ -68,7 +68,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;     /* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;     /* Enable this card */
 static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Vendor ID for this card */
 static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; /* Product ID for this card */
-static int nrpacks = 4;                /* max. number of packets per urb */
+static int nrpacks = 8;                /* max. number of packets per urb */
 static int async_unlink = 1;
 static int device_setup[SNDRV_CARDS]; /* device parameter for this card*/
 
@@ -100,7 +100,7 @@ MODULE_PARM_DESC(device_setup, "Specific device setup (if needed).");
  *
  */
 
-#define MAX_PACKS      10
+#define MAX_PACKS      20
 #define MAX_PACKS_HS   (MAX_PACKS * 8) /* in high speed mode */
 #define MAX_URBS       8
 #define SYNC_URBS      4       /* always four urbs for sync */
@@ -653,7 +653,7 @@ static struct snd_urb_ops audio_urb_ops_high_speed[2] = {
 /*
  * complete callback from data urb
  */
-static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
+static void snd_complete_urb(struct urb *urb)
 {
        struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context;
        struct snd_usb_substream *subs = ctx->subs;
@@ -676,7 +676,7 @@ static void snd_complete_urb(struct urb *urb, struct pt_regs *regs)
 /*
  * complete callback from sync urb
  */
-static void snd_complete_sync_urb(struct urb *urb, struct pt_regs *regs)
+static void snd_complete_sync_urb(struct urb *urb)
 {
        struct snd_urb_ctx *ctx = (struct snd_urb_ctx *)urb->context;
        struct snd_usb_substream *subs = ctx->subs;
@@ -2046,10 +2046,9 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
        void *buf = NULL;
 
        if (size > 0) {
-               buf = kmalloc(size, GFP_KERNEL);
+               buf = kmemdup(data, size, GFP_KERNEL);
                if (!buf)
                        return -ENOMEM;
-               memcpy(buf, data, size);
        }
        err = usb_control_msg(dev, pipe, request, requesttype,
                              value, index, buf, size, timeout);
@@ -2846,12 +2845,11 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
        int stream, err;
        int *rate_table = NULL;
 
-       fp = kmalloc(sizeof(*fp), GFP_KERNEL);
+       fp = kmemdup(quirk->data, sizeof(*fp), GFP_KERNEL);
        if (! fp) {
-               snd_printk(KERN_ERR "cannot malloc\n");
+               snd_printk(KERN_ERR "cannot memdup\n");
                return -ENOMEM;
        }
-       memcpy(fp, quirk->data, sizeof(*fp));
        if (fp->nr_rates > 0) {
                rate_table = kmalloc(sizeof(int) * fp->nr_rates, GFP_KERNEL);
                if (!rate_table) {
@@ -3029,10 +3027,9 @@ static int create_ua1000_quirk(struct snd_usb_audio *chip,
            altsd->bNumEndpoints != 1)
                return -ENXIO;
 
-       fp = kmalloc(sizeof(*fp), GFP_KERNEL);
+       fp = kmemdup(&ua1000_format, sizeof(*fp), GFP_KERNEL);
        if (!fp)
                return -ENOMEM;
-       memcpy(fp, &ua1000_format, sizeof(*fp));
 
        fp->channels = alts->extra[4];
        fp->iface = altsd->bInterfaceNumber;