igorzwx wrote:So that, a new "magic patch" might be needed to compile OSS4 for Linux kernel 4.15. Right?
I'm no magician but, for what it's worth, I have wrote the following patch:
Code: Select all
--- oss-v4.2-build2017-src-gpl-orig/setup/Linux/oss/build/osscore.c 2018-02-01 21:02:56.396940512 +0000
+++ oss-v4.2-build2017-src-gpl/setup/Linux/oss/build/osscore.c 2018-02-01 21:42:35.156620086 +0000
@@ -495,6 +495,9 @@
int timestamp;
void (*func) (void *);
void *arg;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ int data;
+#endif
struct timer_list timer;
} tmout_desc_t;
@@ -507,8 +510,16 @@
int timeout_random = 0x12123400;
void
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+oss_timer_callback (struct timer_list *t)
+#else
oss_timer_callback (unsigned long id)
+#endif
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ tmout_desc_t *priv = container_of(t, typeof(*priv), timer);
+ int id = priv->data;
+#endif
tmout_desc_t *tmout;
int ix;
void *arg;
@@ -567,10 +578,17 @@
tmout->arg = arg;
tmout->timestamp = id | (timeout_random & ~0xff);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
+ tmout->data = id | (timeout_random & ~0xff);
+ timer_setup (&tmout->timer, oss_timer_callback, 0);
+#else
init_timer (&tmout->timer);
+#endif
tmout->timer.expires = jiffies + ticks;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
tmout->timer.data = id | (timeout_random & ~0xff);
tmout->timer.function = oss_timer_callback;
+#endif
add_timer (&tmout->timer);
return id | (timeout_random & ~0xff);
I've compiled and installed it on Ubuntu with kernel v4.14.13 and kernel v4.15 and checked sound output using ossplay.
All appears well though further testing maybe advisable.