[svn-commits] tzafrir: linux/trunk r10010 - in /linux/trunk/drivers/dahdi/oct612x: include/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 30 15:09:44 CDT 2011


Author: tzafrir
Date: Thu Jun 30 15:09:39 2011
New Revision: 10010

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10010
Log:
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 at xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Acked-by: Doug Bailey <dbailey at digium.com>
Acked-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
    linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h
    linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
    linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c

Modified: linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h?view=diff&rev=10010&r1=10009&r2=10010
==============================================================================
--- linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h (original)
+++ linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_channel_inst.h Thu Jun 30 15:09:39 2011
@@ -39,6 +39,14 @@
 /*****************************  DEFINES  *************************************/
 
 /*****************************  TYPES  ***************************************/
+
+#ifndef	__KERNEL__
+#include	<stdint.h>
+#endif
+
+#ifndef	PTR_TYPE
+#define	PTR_TYPE	UINT16
+#endif
 
 typedef struct _OCT6100_API_CHANNEL_TDM_
 {
@@ -293,10 +301,10 @@
 	/*=======================================================================*/
 	/* 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 @@
 	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;
-
-
-	UINT16	ulRinUserBufPlayoutEventId;
-	UINT16	ulSoutUserBufPlayoutEventId;
+	PTR_TYPE	ulLastSSToneDetected;
+	PTR_TYPE	ulLastSSToneTimestamp;
+
+
+	PTR_TYPE	ulRinUserBufPlayoutEventId;
+	PTR_TYPE	ulSoutUserBufPlayoutEventId;
 
 	UINT32	aulToneConf[2];
 	UINT32	ulUserChanId;

Modified: linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h?view=diff&rev=10010&r1=10009&r2=10010
==============================================================================
--- linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h (original)
+++ linux/trunk/drivers/dahdi/oct612x/include/oct6100api/oct6100_defines.h Thu Jun 30 15:09:39 2011
@@ -56,7 +56,7 @@
 #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 @@
 
 /* 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 @@
 #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 @@
 /* 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 @@
 #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
 

Modified: linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c?view=diff&rev=10010&r1=10009&r2=10010
==============================================================================
--- linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c (original)
+++ linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c Thu Jun 30 15:09:39 2011
@@ -36,7 +36,17 @@
 #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"

Modified: linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c?view=diff&rev=10010&r1=10009&r2=10010
==============================================================================
--- linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c (original)
+++ linux/trunk/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.c Thu Jun 30 15:09:39 2011
@@ -37,7 +37,15 @@
 #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"




More information about the svn-commits mailing list