diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-02-26 19:16:37 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-02-26 19:16:37 +0000 |
commit | dc2167891fb61686a58580fb480b63129cbe7e84 (patch) | |
tree | 865c6f22c0ddfae0b80be555f8bededbe7e0f955 | |
parent | 503ee29737f324adef9cfbdc9efd611184357a22 (diff) |
dahdi_dynamic: Use kernel versions where interface changed for workarounds.
atomic_inc_return was added in 2.6.10, and synchronize_rcu() was added in
2.6.12.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8142 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/dahdi_dynamic_ethmf.c | 4 | ||||
-rw-r--r-- | include/dahdi/kernel.h | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/dahdi/dahdi_dynamic_ethmf.c b/drivers/dahdi/dahdi_dynamic_ethmf.c index a88fc37..f8670c8 100644 --- a/drivers/dahdi/dahdi_dynamic_ethmf.c +++ b/drivers/dahdi/dahdi_dynamic_ethmf.c @@ -400,7 +400,7 @@ static int ztdethmf_transmit(void *pvt, unsigned char *msg, int msglen) struct net_device *dev; unsigned char addr[ETH_ALEN]; int spans_ready = 0, index = 0; -#if LINUX_VERSION < KERNEL_VERSION(2, 6, 18) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10) static spinlock_t lock = SPIN_LOCK_UNLOCKED; unsigned long flags; #endif @@ -415,7 +415,7 @@ static int ztdethmf_transmit(void *pvt, unsigned char *msg, int msglen) return 0; } -#if LINUX_VERSION < KERNEL_VERSION(2, 6, 18) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10) if (!atomic_read(&z->ready)) { spin_lock_irqsave(&lock, flags); atomic_inc(&z->ready); diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index 7d56b42..8ce81b0 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -1181,7 +1181,6 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss) (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; @@ -1191,6 +1190,8 @@ static inline void list_replace(struct list_head *old, struct list_head *new) } #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) #define kzalloc(a, b) kcalloc(1, a, b) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) +#define synchronize_rcu() synchronize_kernel() #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) static inline unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout) @@ -1205,6 +1206,7 @@ wait_for_completion_timeout(struct completion *x, unsigned long timeout) return timeout; } #endif /* 2.6.11 */ +#endif /* 2.6.12 */ #endif /* 2.6.14 */ #endif /* 2.6.18 */ #endif /* 2.6.25 */ |