summaryrefslogtreecommitdiff
path: root/drivers/dahdi/oct612x
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
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')
-rw-r--r--drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h26
-rw-r--r--drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h10
-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
4 files changed, 44 insertions, 10 deletions
diff --git a/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h b/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
index 4472b9c..5b71bb0 100644
--- a/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
+++ b/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
@@ -40,6 +40,14 @@ $Octasic_Revision: 90 $
/***************************** TYPES ***************************************/
+#ifndef __KERNEL__
+#include <stdint.h>
+#endif
+
+#ifndef PTR_TYPE
+#define PTR_TYPE UINT16
+#endif
+
typedef struct _OCT6100_API_CHANNEL_TDM_
{
/* Laws. */
@@ -293,10 +301,10 @@ typedef struct _OCT6100_API_CHANNEL_
/*=======================================================================*/
/* Buffer playout information. */
- UINT16 ulRinBufWritePtr;
- UINT16 ulRinBufSkipPtr;
- UINT16 ulSoutBufWritePtr;
- UINT16 ulSoutBufSkipPtr;
+ PTR_TYPE ulRinBufWritePtr;
+ PTR_TYPE ulRinBufSkipPtr;
+ PTR_TYPE ulSoutBufWritePtr;
+ PTR_TYPE ulSoutBufSkipPtr;
/* User channel ID, transparently passed to the user. */
@@ -324,19 +332,19 @@ typedef struct _OCT6100_API_CHANNEL_
UINT16 usPhasingTsstIndex;
/* Mode of operation of the channel based on the extended tone detection configuration. */
- UINT16 ulExtToneChanMode;
+ PTR_TYPE ulExtToneChanMode;
/*=======================================================================*/
/* Tone detection state. */
/* This array is configured as follow. */
/* Index 0 contain event 0 to 31 and Index 1 contains event 32 - 55 */
- UINT16 ulLastSSToneDetected;
- UINT16 ulLastSSToneTimestamp;
+ PTR_TYPE ulLastSSToneDetected;
+ PTR_TYPE ulLastSSToneTimestamp;
- UINT16 ulRinUserBufPlayoutEventId;
- UINT16 ulSoutUserBufPlayoutEventId;
+ PTR_TYPE ulRinUserBufPlayoutEventId;
+ PTR_TYPE ulSoutUserBufPlayoutEventId;
UINT32 aulToneConf[2];
UINT32 ulUserChanId;
diff --git a/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h b/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h
index b1f1622..ef12119 100644
--- a/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h
+++ b/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h
@@ -56,7 +56,7 @@ $Octasic_Revision: 171 $
#define cOCT6100_INVALID_HANDLE cOCT6100_FFFFFFFF
#define cOCT6100_INVALID_TIMESLOT cOCT6100_FFFFFFFF
#define cOCT6100_INVALID_STREAM cOCT6100_FFFFFFFF
-#define cOCT6100_INVALID_VALUE -1
+#define cOCT6100_INVALID_VALUE cOCT6100_FFFFFFFF
#define cOCT6100_INVALID_STAT cOCT6100_FFFFFFFF
#define cOCT6100_INVALID_STAT_W cOCT6100_FFFF
#define cOCT6100_INVALID_PCM_LAW cOCT6100_FF
@@ -249,7 +249,9 @@ $Octasic_Revision: 171 $
/* Chip open defines.*/
#define cOCT6100_INTERNAL_TONE_ARRAY_SIZE 256 /* in words.*/
+#ifndef cOCT6100_INTERNAL_SUPER_ARRAY_SIZE
#define cOCT6100_INTERNAL_SUPER_ARRAY_SIZE 128 /* in words.*/
+#endif
/* Internal memory mapping.*/
@@ -394,7 +396,9 @@ $Octasic_Revision: 171 $
#define cOCT6100_IMAGE_AF_CST_OFFSET 0x1000;
/* Max defines.*/
+#ifndef cOCT6100_MAX_ECHO_CHANNELS
#define cOCT6100_MAX_ECHO_CHANNELS 128
+#endif
#define cOCT6100_MAX_TSI_CNCTS 1530
#define cOCT6100_MAX_CALLER_ID_PLAYOUT_BUFFERS ( 3328 + 6 )
#define cOCT6100_MAX_PLAYOUT_BUFFERS ( 1344 + cOCT6100_MAX_CALLER_ID_PLAYOUT_BUFFERS )
@@ -484,7 +488,9 @@ $Octasic_Revision: 171 $
/* CPTAG: No application needs for mixer events. */
/* 2 needed for head and tail nodes. 2 more needed to get through channel modify function. */
/* Careful. This value cannot be zero. */
+#ifndef cOCT6100_MAX_MIXER_EVENTS
#define cOCT6100_MAX_MIXER_EVENTS 4
+#endif
#define cOCT6100_MAX_FLEX_CONF_PARTICIPANTS_PER_BRIDGE 32
#define cOCT6100_CONF_DOMINANT_SPEAKER_UNASSIGNED 672
#define cOCT6100_CONF_NO_DOMINANT_SPEAKER_HNDL cOCT6100_FFFFFFFE
@@ -589,6 +595,8 @@ $Octasic_Revision: 171 $
#define cOCT6100_TONE_INFO_STOP_STRING "[~ToneDetectorInfo]"
#define cOCT6100_TONE_INFO_EVENT_STRING "TONEEVENT=0x"
+#define cOCT6100_MAX_NLP_CONF_DWORD 20
+
/* Tail displacement info.*/
#define cOCT6100_MAX_TAIL_DISPLACEMENT 896
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"