Update of /cvsroot/alsa/alsa-driver/acore
In directory sc8-pr-cvs1:/tmp/cvs-serv18847

Modified Files:
        info.inc info.patch pci_compat_22.c 
Log Message:
Fixed compilation for 2.2 kernels.
Added a workaround for PCI flags for 2.2 kernels (bad MMIO detection)
Fixed bad kfree call..


Index: info.inc
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/acore/info.inc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- info.inc    30 May 2003 12:53:12 -0000      1.1
+++ info.inc    11 Aug 2003 12:51:27 -0000      1.2
@@ -81,17 +81,12 @@
                           struct proc_dir_entry *de)
 {
        if (parent && de) {
-               if (S_ISDIR(de->mode) && de->data) {
+               if (S_ISLNK(de->mode) && de->data) {
                        kfree(de->data);
                        de->data = 0;
                }
                proc_unregister(parent, de->low_ino);
        }
 }
-
-static struct inode_operations snd_info_entry_inode_operations =
-{
-               &snd_info_entry_operations,     /* default sound info directory 
file-ops */
-};
 
 #endif /* LINUX_VERSION_CODE < 2.4.0 */

Index: info.patch
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/acore/info.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- info.patch  30 May 2003 12:53:12 -0000      1.1
+++ info.patch  11 Aug 2003 12:51:27 -0000      1.2
@@ -1,5 +1,5 @@
---- info.c     2003-05-30 14:29:41.000000000 +0200
-+++ info.c     2003-05-30 14:28:42.000000000 +0200
+--- ../../alsa-kernel/core/info.c      Fri Jul 18 18:07:35 2003
++++ info.c     Mon Aug 11 11:16:29 2003
 @@ -1,3 +1,4 @@
 +#include "info.inc"
  /*
@@ -41,7 +41,7 @@
        return ret;
  }
  
-@@ -489,7 +496,9 @@
+@@ -487,7 +494,9 @@
  
  static struct file_operations snd_info_entry_operations =
  {
@@ -51,7 +51,21 @@
        .llseek =       snd_info_entry_llseek,
        .read =         snd_info_entry_read,
        .write =        snd_info_entry_write,
-@@ -908,9 +917,16 @@
+@@ -498,6 +507,13 @@
+       .release =      snd_info_entry_release,
+ };
+ 
++#ifdef LINUX_2_2
++static struct inode_operations snd_info_entry_inode_operations =
++{
++      &snd_info_entry_operations,     /* default sound info directory file-ops */
++};
++#endif
++
+ /**
+  * snd_create_proc_entry - create a procfs entry
+  * @name: the name of the proc file
+@@ -906,9 +922,16 @@
                up(&info_mutex);
                return -ENOMEM;
        }

Index: pci_compat_22.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/acore/pci_compat_22.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pci_compat_22.c     5 Mar 2003 11:36:39 -0000       1.3
+++ pci_compat_22.c     11 Aug 2003 12:51:27 -0000      1.4
@@ -175,16 +175,35 @@
        return sz;
 }
 
+/* hack, hack, hack - why 2.2 kernels are so broken? */
+static struct broken_addr {
+       u16 vendor;
+       u16 device;
+       u32 flags;
+} broken_addr[] = {
+       { 0x8086, 0x2415, IORESOURCE_IO },              /* 82801AA */
+       { 0x8086, 0x2425, IORESOURCE_IO },              /* 82901AB */
+       { 0x8086, 0x2445, IORESOURCE_IO },              /* 82801BA */
+       { 0x8086, 0x2485, IORESOURCE_IO },              /* ICH3 */
+       { 0x8086, 0x7195, IORESOURCE_IO },              /* 440MX */
+       { 0, 0, 0 }
+};
+
 int snd_pci_compat_get_flags (struct pci_dev *dev, int n_base)
 {
-       unsigned long foo = dev->base_address[n_base] & PCI_BASE_ADDRESS_SPACE;
+       unsigned long foo;
        int flags = 0;
+
+       for (foo = 0; broken_addr[foo].vendor; foo++)
+               if (dev->vendor == broken_addr[foo].vendor &&
+                   dev->device == broken_addr[foo].device)
+                       return broken_addr[foo].flags;
        
        if (foo == 0)
                flags |= IORESOURCE_MEM;
        if (foo == 1)
                flags |= IORESOURCE_IO;
-       
+
        return flags;
 }
 



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to