ReaperX7 |
08-23-2013 07:33 PM |
Patches for OSSv4 and Slackware kernels 3.8 or later
Source: http://www.opensound.com/forum/viewf...e6da274046e470
Kernels after 3.8.x changed something in how OSSv4 works with newer kernels:
The following patches were collected from 4Front's Linux forums for your usage in Slackware if needed and for fixing the SlackBuilds post-installation of the OSS 4.2.2008 package.
(Should also work for 4.2.2007 also)
Code:
--- setup/Linux/oss/build/pci_wrapper.inc 2009-08-27 05:19:07.000000000 +0300
+++ setup/Linux/oss/build/pci_wrapper.inc 2013-02-08 13:56:10.519794975 +0200
@@ -17,7 +17,11 @@
static dev_map_t dev_map[MAX_INSTANCE];
static int n_devmap = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
static int __devinit
+#else
+static int
+#endif
osspci_probe (struct pci_dev *pcidev, const struct pci_device_id *pciid)
{
oss_device_t *osdev;
@@ -65,7 +69,11 @@
return 0;
}
-static void __devexit
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
+static int __devexit
+#else
+static int
+#endif
osspci_remove (struct pci_dev *pcidev)
{
int i;
@@ -80,10 +88,11 @@
pci_disable_device (dev_map[i].pcidev);
osdev_delete (osdev);
- return;
+ return 0;
}
printk (KERN_ALERT DRIVER_NICK ": Can't find the PCI device to detach\n");
+ return -EIO;
}
void
Code:
--- setup/Linux/oss/build/osscore.c 2012-05-22 00:23:41.000000000 +0200
+++ newCore.c 2013-06-02 01:00:16.187019464 +0200
@@ -276,28 +276,59 @@
return strlen (tmp);
}
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
static struct file_operations oss_proc_operations = {
.read = oss_read_devfiles,
};
+#else
+static struct file_operations fops = {
+ .owner = THIS_MODULE,
+ .read = oss_read_devfiles,
+};
+#endif
+
static void
init_proc_fs (void)
{
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+
if ((oss_proc_root =
- create_proc_entry ("opensound", 0700 | S_IFDIR, NULL)) == NULL)
+ create_proc_entry ("opensound", 0700 | S_IFDIR, NULL)) == NULL)
+ {
+ oss_cmn_err (CE_CONT, "Cannot create /proc/opensound\n");
+ return;
+ }
+
+ if ((oss_proc_devfiles =
+ create_proc_entry ("devfiles", 0600, oss_proc_root)) == NULL)
+ {
+ oss_cmn_err (CE_CONT, "Cannot create /proc/opensound/devfiles\n");
+ return;
+ }
+
+ oss_proc_devfiles->proc_fops = &oss_proc_operations;
+
+#else
+
+ if ((oss_proc_root =
+ proc_mkdir ("opensound", NULL)) == NULL )
{
- oss_cmn_err (CE_CONT, "Cannot create /proc/opensound\n");
- return;
+ oss_cmn_err (CE_CONT, "Cannot create /proc/opensound\n");
+ return;
}
if ((oss_proc_devfiles =
- create_proc_entry ("devfiles", 0600, oss_proc_root)) == NULL)
+ proc_create ("devfiles", 0600, oss_proc_root, &fops)) == NULL)
{
- oss_cmn_err (CE_CONT, "Cannot create /proc/opensound/devfiles\n");
- return;
+ oss_cmn_err (CE_CONT, "Cannot create /proc/opensound/devfiles\n");
+ return;
}
- oss_proc_devfiles->proc_fops = &oss_proc_operations;
+#endif
+
}
static void
Code:
--- setup/Linux/oss/build/osscore.c 2012-05-22 00:23:41.000000000 +0200
+++ setup/Linux/oss/build/osscore.c 2013-07-20 21:47:18.294007175 +0200
@@ -953,7 +984,9 @@
fop->llseek = oss_no_llseek;
fop->read = tmp_read;
fop->write = tmp_write;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
fop->readdir = NULL; /* tmp_readdir; */
+#endif
fop->poll = tmp_poll;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)
fop->ioctl = tmp_ioctl;
Once you've installed the SlackBuild and followed the other instructions to disable ALSA and blacklist the ALSA modules, you'll need to navigate to the directory:
/usr/lib64/oss/build
...and apply said patches to allow the "soundon" script to properly work.
The patches were taken from various sources including ArchLinux's repository so you may need to rework the patches to work with the SlackBuilds or apply them by hand.
|