]> err.no Git - linux-2.6/blobdiff - sound/pci/intel8x0.c
[LLC]: Fix double receive of SKB.
[linux-2.6] / sound / pci / intel8x0.c
index da024ffe96c25200640b2c13be33660b128ba254..0df7602568e2a8cb73054c1bb7730f0425300d34 100644 (file)
@@ -413,7 +413,7 @@ struct intel8x0 {
        u32 int_sta_mask;               /* interrupt status mask */
 };
 
-static struct pci_device_id snd_intel8x0_ids[] = {
+static struct pci_device_id snd_intel8x0_ids[] __devinitdata = {
        { 0x8086, 0x2415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801AA */
        { 0x8086, 0x2425, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82901AB */
        { 0x8086, 0x2445, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_INTEL }, /* 82801BA */
@@ -1293,6 +1293,7 @@ static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substre
        return 0;
 }
 
+#if 0 // NYI
 static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream)
 {
        struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1308,7 +1309,6 @@ static int snd_intel8x0_ali_spdifin_close(struct snd_pcm_substream *substream)
        return 0;
 }
 
-#if 0 // NYI
 static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream)
 {
        struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1435,6 +1435,7 @@ static struct snd_pcm_ops snd_intel8x0_ali_ac97spdifout_ops = {
        .pointer =      snd_intel8x0_pcm_pointer,
 };
 
+#if 0 // NYI
 static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
        .open =         snd_intel8x0_ali_spdifin_open,
        .close =        snd_intel8x0_ali_spdifin_close,
@@ -1446,7 +1447,6 @@ static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
        .pointer =      snd_intel8x0_pcm_pointer,
 };
 
-#if 0 // NYI
 static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = {
        .open =         snd_intel8x0_ali_spdifout_open,
        .close =        snd_intel8x0_ali_spdifout_close,
@@ -1582,7 +1582,7 @@ static struct ich_pcm_table ali_pcms[] __devinitdata = {
        {
                .suffix = "IEC958",
                .playback_ops = &snd_intel8x0_ali_ac97spdifout_ops,
-               .capture_ops = &snd_intel8x0_ali_spdifin_ops,
+               /* .capture_ops = &snd_intel8x0_ali_spdifin_ops, */
                .prealloc_size = 64 * 1024,
                .prealloc_max_size = 128 * 1024,
                .ac97_idx = ALID_AC97SPDIFOUT,
@@ -2351,7 +2351,7 @@ static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing)
 
 static int snd_intel8x0_chip_init(struct intel8x0 *chip, int probing)
 {
-       unsigned int i;
+       unsigned int i, timeout;
        int err;
        
        if (chip->device_type != DEVICE_ALI) {
@@ -2369,6 +2369,15 @@ static int snd_intel8x0_chip_init(struct intel8x0 *chip, int probing)
        /* reset channels */
        for (i = 0; i < chip->bdbars_count; i++)
                iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, ICH_RESETREGS);
+       for (i = 0; i < chip->bdbars_count; i++) {
+               timeout = 100000;
+               while (--timeout != 0) {
+                       if ((igetbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset) & ICH_RESETREGS) == 0)
+                               break;
+                }
+                if (timeout == 0)
+                        printk(KERN_ERR "intel8x0: reset of registers failed?\n");
+        }
        /* initialize Buffer Descriptor Lists */
        for (i = 0; i < chip->bdbars_count; i++)
                iputdword(chip, ICH_REG_OFF_BDBAR + chip->ichd[i].reg_offset,