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
This commit is contained in:
committed by
Tzafrir Cohen
parent
d7fdb06033
commit
304e481d47
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user