summaryrefslogtreecommitdiff
path: root/drivers/dahdi/oct612x/octdeviceapi/oct6100api
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-06-30 20:09:39 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-06-30 20:09:39 +0000
commit60778f85e85ec4052bb063f00ea6247fda892fe2 (patch)
treef7e925ab4e4dd4d471e6a5dcab6c1e4eea324b63 /drivers/dahdi/oct612x/octdeviceapi/oct6100api
parent5b4cbef06565812c3ebed4f65eb50daa670f8254 (diff)
oct612x: Fixes for Octasic user space compilation:
* Don't assume a pointer diff is 16 bits only. * cOCT6100_INVALID_VALUE should be used against 32 unsigned values * Make 3 constants adjustable via '-Dmacro=value': - cOCT6100_INTERNAL_SUPER_ARRAY_SIZE - cOCT6100_MAX_ECHO_CHANNELS - cOCT6100_MAX_MIXER_EVENTS Signed-off-by: Oron Peled <oron.peled@xorcom.com> Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Doug Bailey <dbailey@digium.com> Acked-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10010 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/oct612x/octdeviceapi/oct6100api')
-rw-r--r--drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c10
-rw-r--r--drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c8
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
index ff1770a..26eaa1b 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
@@ -36,7 +36,17 @@ $Octasic_Revision: 492 $
#include <sys/types.h>
#include <dahdi/compat/bsd.h>
#else
+#ifndef __KERNEL__
+#include <stdlib.h>
+#include <stdio.h>
+#define kmalloc(size, type) malloc(size)
+#define kfree(ptr) free(ptr)
+#define GFP_ATOMIC 0 /* Dummy */
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#else
#include <linux/slab.h>
+#include <linux/kernel.h>
+#endif
#endif
#include "octdef.h"
diff --git a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c
index 14f13e0..819ac84 100644
--- a/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c
+++ b/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c
@@ -37,7 +37,15 @@ $Octasic_Revision: 347 $
#include <sys/types.h>
#include <dahdi/compat/bsd.h>
#else
+#ifndef __KERNEL__
+#include <stdlib.h>
+#define kmalloc(size, type) malloc(size)
+#define kfree(ptr) free(ptr)
+#define GFP_ATOMIC 0 /*Dummy */
+#else
#include <linux/slab.h>
+#include <linux/kernel.h>
+#endif
#endif
#include "octdef.h"