Subject: include semaphore.h explicitly for newer kernels
Origin: http://svn.asterisk.org/svn/dahdi/linux/trunk@8758 
Bug: https://issues.asterisk.org/view.php?id=17382

With kernel version >= 2.6.35-rc1, building failed with:

  drivers/dahdi/voicebus/GpakCust.h:114: error: field ‘sem’ has incomplete type

Reported by: Chainsaw
Patches:
      07-semaphore-include-not-optional.diff uploaded by Chainsaw (license 723)

---
 drivers/dahdi/voicebus/GpakCust.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/dahdi/voicebus/GpakCust.h b/drivers/dahdi/voicebus/GpakCust.h
index 2b28480..64ef44a 100644
--- a/drivers/dahdi/voicebus/GpakCust.h
+++ b/drivers/dahdi/voicebus/GpakCust.h
@@ -40,6 +40,11 @@
 #include <linux/completion.h>
 #include <linux/workqueue.h>
 #include <linux/delay.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
+#include <linux/semaphore.h>
+#endif
 
 #include "gpakenum.h"
 #include "adt_lec.h"
-- 
1.7.1

