[svn-commits] sruffell: linux/trunk r8140 - in /linux/trunk: drivers/dahdi/ include/dahdi/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 26 12:51:59 CST 2010


Author: sruffell
Date: Fri Feb 26 12:51:49 2010
New Revision: 8140

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8140
Log:
dahdi_dynamic: Changes to allow to compile against vanilla 2.6.9 kernel.

Modified:
    linux/trunk/drivers/dahdi/dahdi_dynamic.c
    linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
    linux/trunk/include/dahdi/kernel.h

Modified: linux/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=8140&r1=8139&r2=8140
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic.c Fri Feb 26 12:51:49 2010
@@ -113,10 +113,15 @@
 	struct list_head list;
 };
 
+#ifdef DEFINE_SPINLOCK
 static DEFINE_SPINLOCK(dspan_lock);
+static DEFINE_SPINLOCK(driver_lock);
+#else
+static spinlock_t dspan_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
+#endif
+
 static LIST_HEAD(dspan_list);
-
-static DEFINE_SPINLOCK(driver_lock);
 static LIST_HEAD(driver_list);
 
 static int debug = 0;

Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c?view=diff&rev=8140&r1=8139&r2=8140
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_ethmf.c Fri Feb 26 12:51:49 2010
@@ -129,7 +129,11 @@
 /**
  * Lock for adding and removing items in ethmf_list
  */
+#ifdef DEFINE_SPINLOCK
 static DEFINE_SPINLOCK(ethmf_lock);
+#else
+static spinlock_t ethmf_lock = SPIN_LOCK_UNLOCKED;
+#endif
 
 /**
  * The active list of all running spans
@@ -396,6 +400,10 @@
 	struct net_device *dev;
 	unsigned char addr[ETH_ALEN];
 	int spans_ready = 0, index = 0;
+#if LINUX_VERSION < KERNEL_VERSION(2, 6, 18)
+	static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+	unsigned long flags;
+#endif
 
 	if (atomic_read(&shutdown))
 		return 0;
@@ -407,12 +415,24 @@
 		return 0;
 	}
 
+#if LINUX_VERSION < KERNEL_VERSION(2, 6, 18)
+	if (!atomic_read(&z->ready)) {
+		spin_lock_irqsave(&lock, flags);
+		atomic_inc(&z->ready);
+		if (1 == atomic_read(&z->ready)) {
+			memcpy(z->msgbuf, msg, msglen);
+			z->msgbuf_len = msglen;
+		}
+		spin_unlock_irqrestore(&lock, flags);
+	}
+#else
 	if (!atomic_read(&z->ready)) {
 		if (atomic_inc_return(&z->ready) == 1) {
 			memcpy(z->msgbuf, msg, msglen);
 			z->msgbuf_len = msglen;
 		}
 	}
+#endif
 
 	spans_ready = ethmf_trx_spans_ready(z->addr_hash, &ready_spans);
 	if (spans_ready) {

Modified: linux/trunk/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/kernel.h?view=diff&rev=8140&r1=8139&r2=8140
==============================================================================
--- linux/trunk/include/dahdi/kernel.h (original)
+++ linux/trunk/include/dahdi/kernel.h Fri Feb 26 12:51:49 2010
@@ -1181,6 +1181,7 @@
 	(signal_pending((p)) && sigismember(&(p)->pending.signal, SIGKILL))
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
+#define synchronize_rcu() synchronize_kernel()
 static inline void list_replace(struct list_head *old, struct list_head *new)
 {
         new->next = old->next;




More information about the svn-commits mailing list