]> git.pld-linux.org Git - packages/dahdi-linux.git/commitdiff
- fix building with kernel 3.15 auto/th/dahdi-linux-2.9.1.1-1
authorJan Rękorajski <baggins@pld-linux.org>
Fri, 11 Jul 2014 21:16:11 +0000 (23:16 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Fri, 11 Jul 2014 21:16:11 +0000 (23:16 +0200)
dahdi-linux.spec
linux-3.15.patch [new file with mode: 0644]

index bcbea09cac2f9c175c0d9304e24a855e4dd1da81..7ae7e37a53746a05109e2176d0bb10aeb5c444b3 100644 (file)
@@ -77,6 +77,7 @@ Source6:      %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
 # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
 Source7:       %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
 # Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
+Patch0:                linux-3.15.patch
 URL:           http://www.asterisk.org/
 BuildRequires: rpmbuild(macros) >= 1.678
 %{?with_dist_kernel:%{expand:%kbrs}}
@@ -179,6 +180,7 @@ cd ../..\
 
 %prep
 %setup -q -n %{pname}-%{version}
+%patch0 -p1
 
 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
        ln -s $a drivers/dahdi/firmware
diff --git a/linux-3.15.patch b/linux-3.15.patch
new file mode 100644 (file)
index 0000000..4caf8cb
--- /dev/null
@@ -0,0 +1,141 @@
+From c9481d30bbc84905f449b8c1bfc2c8f3eaefd9c3 Mon Sep 17 00:00:00 2001
+From: Shaun Ruffell <sruffell@digium.com>
+Date: Sun, 18 May 2014 02:49:30 -0500
+Subject: [PATCH] pciradio: interruptible_sleep_on_timeout() ->
+ msleep_interruptible()
+
+interruptible_sleep_on_timeout() has been deprecated for awhile and was finally
+removed in Linux 3.15. Since interruptible_sleep_on_timeout() uses jiffies for
+the delay, I assumed that each jiffy equated to 10ms given the age of the
+driver.
+
+Signed-off-by: Shaun Ruffell <sruffell@digium.com>
+Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
+Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
+---
+ drivers/dahdi/pciradio.c | 27 +++++++++++++--------------
+ 1 file changed, 13 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/dahdi/pciradio.c b/drivers/dahdi/pciradio.c
+index 9231593..07b85b3 100644
+--- a/drivers/dahdi/pciradio.c
++++ b/drivers/dahdi/pciradio.c
+@@ -52,6 +52,7 @@ With driver: 303826  (1.5 %)
+ #include <linux/interrupt.h>
+ #include <linux/moduleparam.h>
+ #include <linux/sched.h>
++#include <linux/delay.h>
+ #include <asm/io.h>
+ #include <asm/delay.h> 
+@@ -481,8 +482,6 @@ static void rbi_out(struct pciradio *rad, int n, unsigned char *rbicmd)
+ {
+ unsigned long flags;
+ int   x;
+-DECLARE_WAIT_QUEUE_HEAD(mywait);
+-
+       for(;;)
+       {
+@@ -490,7 +489,8 @@ DECLARE_WAIT_QUEUE_HEAD(mywait);
+               x = rad->remote_locked || (__pciradio_getcreg(rad,0xc) & 2);
+               if (!x) rad->remote_locked = 1;
+               spin_unlock_irqrestore(&rad->lock,flags);
+-              if (x) interruptible_sleep_on_timeout(&mywait,2);
++              if (x)
++                      msleep_interruptible(20);
+               else break;
+       }       
+       spin_lock_irqsave(&rad->lock,flags);
+@@ -527,7 +527,6 @@ static void mx828_command(struct pciradio *rad,int channel, unsigned char comman
+ static void mx828_command_wait(struct pciradio *rad,int channel, unsigned char command, unsigned char *byte1, unsigned char *byte2)
+ {
+-DECLARE_WAIT_QUEUE_HEAD(mywait);
+ unsigned long flags;
+@@ -535,7 +534,7 @@ unsigned long flags;
+       while(rad->encdec.state)
+       {
+               spin_unlock_irqrestore(&rad->lock,flags);  
+-              interruptible_sleep_on_timeout(&mywait,2);   
++              msleep_interruptible(20);
+               spin_lock_irqsave(&rad->lock,flags);  
+       }
+       rad->encdec.lastcmd = jiffies + 1000;
+@@ -967,7 +966,6 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
+       } stack;
+       struct pciradio *rad = chan->pvt;
+-      DECLARE_WAIT_QUEUE_HEAD(mywait);
+       switch (cmd) {
+       case DAHDI_RADIO_GETPARAM:
+@@ -1255,7 +1253,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
+                               __pciradio_setcreg(rad,8,byte2);
+                               spin_unlock_irqrestore(&rad->lock,flags);
+                               if (i || (jiffies < rad->lastremcmd + 10))
+-                                      interruptible_sleep_on_timeout(&mywait,10);
++                                      msleep_interruptible(100);
+                               rad->lastremcmd = jiffies;
+                               rbi_out(rad,chan->chanpos - 1,(unsigned char *)&stack.p.data);
+                               spin_lock_irqsave(&rad->lock,flags);
+@@ -1270,7 +1268,8 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
+                               x = rad->remote_locked || (__pciradio_getcreg(rad,0xc) & 2);
+                               if (!x) rad->remote_locked = 1;
+                               spin_unlock_irqrestore(&rad->lock,flags);
+-                              if (x) interruptible_sleep_on_timeout(&mywait,2);
++                              if (x)
++                                      msleep_interruptible(20);
+                               else break;
+                       }       
+                       spin_lock_irqsave(&rad->lock,flags);
+@@ -1287,14 +1286,14 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
+                       __pciradio_setcreg(rad,8,byte2);
+                       spin_unlock_irqrestore(&rad->lock,flags);
+                       if (byte1 != byte2) 
+-                              interruptible_sleep_on_timeout(&mywait,3);
++                              msleep_interruptible(30);
+                       while (jiffies < rad->lastremcmd + 10)
+-                              interruptible_sleep_on_timeout(&mywait,10);
++                              msleep_interruptible(100);
+                       rad->lastremcmd = jiffies;
+                       for(;;)
+                       {
+                               if (!(__pciradio_getcreg(rad,0xc) & 2)) break;
+-                              interruptible_sleep_on_timeout(&mywait,2);
++                              msleep_interruptible(20);
+                       }
+                       spin_lock_irqsave(&rad->lock,flags);
+                       /* enable and address async serializer */
+@@ -1316,7 +1315,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
+                                       (!strchr((char *)rad->rxbuf,'\r'))))
+                               {
+                                       spin_unlock_irqrestore(&rad->lock,flags);
+-                                      interruptible_sleep_on_timeout(&mywait,2);
++                                      msleep_interruptible(20);
+                                       spin_lock_irqsave(&rad->lock,flags);
+                                       continue;
+                               }
+@@ -1336,7 +1335,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
+                               while(rad->txlen && (rad->txindex < rad->txlen))
+                               {
+                                       spin_unlock_irqrestore(&rad->lock,flags);
+-                                      interruptible_sleep_on_timeout(&mywait,2);
++                                      msleep_interruptible(20);
+                                       spin_lock_irqsave(&rad->lock,flags);
+                               }
+                               /* disable and un-address async serializer */
+@@ -1345,7 +1344,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
+                       rad->remote_locked = 0;
+                       spin_unlock_irqrestore(&rad->lock,flags);
+                       if (rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_SERIAL_ASCII)
+-                              interruptible_sleep_on_timeout(&mywait,100);
++                              msleep_interruptible(1000);
+                       if (copy_to_user((__user void *) data, &stack.p, sizeof(stack.p))) return -EFAULT;
+                       return 0;
+               default:
+-- 
+1.9.3
+
This page took 0.211604 seconds and 4 git commands to generate.