summaryrefslogtreecommitdiff
path: root/zaptel.h
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-31 19:01:33 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-01-31 19:01:33 +0000
commit96f60efee8c9f08e30dece68a4671d065889ee22 (patch)
tree98d049ee6851fcdc71a547768dc820857bb689c5 /zaptel.h
parent92e6d005b1107055cdd62f41fc06bda8e98b14b3 (diff)
make it simpler for existing userspace apps to use the new zaptel.h that requires linux/types.h
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2059 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.h')
-rw-r--r--zaptel.h57
1 files changed, 30 insertions, 27 deletions
diff --git a/zaptel.h b/zaptel.h
index fefad1f..327cc28 100644
--- a/zaptel.h
+++ b/zaptel.h
@@ -30,20 +30,26 @@
#ifndef _LINUX_ZAPTEL_H
#define _LINUX_ZAPTEL_H
+#include <linux/types.h>
+
#ifdef __KERNEL__
#include "zconfig.h"
#include <linux/version.h>
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/config.h>
#endif
+
#ifdef CONFIG_ZAPATA_NET
#include <linux/hdlc.h>
#endif
+
#ifdef CONFIG_ZAPATA_PPP
#include <linux/ppp_channel.h>
#include <linux/skbuff.h>
#include <linux/interrupt.h>
#endif
+
#include <linux/fs.h>
#include <linux/list.h>
@@ -69,7 +75,8 @@
#include "ecdis.h"
#include "fasthdlc.h"
-#endif
+#endif /* __KERNEL__ */
+
#ifdef CONFIG_DEVFS_FS
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#include <linux/devfs_fs_kernel.h>
@@ -789,9 +796,6 @@ struct zt_tone_def { /* Structure for zone programming */
};
-#ifdef __KERNEL__
-#endif /* KERNEL */
-
/* Define the maximum block size */
#define ZT_MAX_BLOCKSIZE 8192
@@ -991,8 +995,6 @@ struct zt_tone_def { /* Structure for zone programming */
#endif
#ifdef __KERNEL__
-
-#include <linux/types.h>
#include <linux/poll.h>
#define ZT_MAX_EVENTSIZE 64 /* 64 events max in buffer */
@@ -1019,7 +1021,8 @@ struct zt_hdlc {
#endif
struct zt_chan *chan;
};
-#endif
+
+#endif /* CONFIG_ZAPATA_NET */
/* Conference queue stucture */
struct confq {
@@ -1451,24 +1454,24 @@ struct zt_dynamic_driver {
};
/* Receive a dynamic span message */
-extern void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen);
+void zt_dynamic_receive(struct zt_span *span, unsigned char *msg, int msglen);
/* Register a dynamic driver */
-extern int zt_dynamic_register(struct zt_dynamic_driver *driver);
+int zt_dynamic_register(struct zt_dynamic_driver *driver);
/* Unregister a dynamic driver */
-extern void zt_dynamic_unregister(struct zt_dynamic_driver *driver);
+void zt_dynamic_unregister(struct zt_dynamic_driver *driver);
/* Receive on a span. The zaptel interface will handle all the calculations for
all member channels of the span, pulling the data from the readchunk buffer */
-extern int zt_receive(struct zt_span *span);
+int zt_receive(struct zt_span *span);
/* Prepare writechunk buffers on all channels for this span */
-extern int zt_transmit(struct zt_span *span);
+int zt_transmit(struct zt_span *span);
/* Register a span. Returns 0 on success, -1 on failure. Pref-master is non-zero if
we should have preference in being the master device */
-extern int zt_register(struct zt_span *span, int prefmaster);
+int zt_register(struct zt_span *span, int prefmaster);
/* Allocate / free memory for a transcoder */
struct zt_transcoder *zt_transcoder_alloc(int numchans);
@@ -1485,32 +1488,32 @@ int zt_transcoder_alert(struct zt_transcoder_channel *ztc);
/* Unregister a span */
-extern int zt_unregister(struct zt_span *span);
+int zt_unregister(struct zt_span *span);
/* Gives a name to an LBO */
-extern char *zt_lboname(int lbo);
+char *zt_lboname(int lbo);
/* Tell Zaptel about changes in received rbs bits */
-extern void zt_rbsbits(struct zt_chan *chan, int bits);
+void zt_rbsbits(struct zt_chan *chan, int bits);
/* Tell Zaptel abou changes in received signalling */
-extern void zt_hooksig(struct zt_chan *chan, zt_rxsig_t rxsig);
+void zt_hooksig(struct zt_chan *chan, zt_rxsig_t rxsig);
/* Queue an event on a channel */
-extern void zt_qevent_nolock(struct zt_chan *chan, int event);
+void zt_qevent_nolock(struct zt_chan *chan, int event);
/* Queue an event on a channel, locking it first */
-extern void zt_qevent_lock(struct zt_chan *chan, int event);
+void zt_qevent_lock(struct zt_chan *chan, int event);
/* Notify a change possible change in alarm status */
-extern void zt_alarm_notify(struct zt_span *span);
+void zt_alarm_notify(struct zt_span *span);
/* Initialize a tone state */
-extern void zt_init_tone_state(struct zt_tone_state *ts, struct zt_tone *zt);
+void zt_init_tone_state(struct zt_tone_state *ts, struct zt_tone *zt);
/* Get a given DTMF or MF tone struct, suitable for zt_tone_nextsample.
Set 'mf' to 0 for DTMF or 1 for MFv1 */
-extern struct zt_tone *zt_dtmf_tone(char digit, int mf);
+struct zt_tone *zt_dtmf_tone(char digit, int mf);
/* Echo cancel a receive and transmit chunk for a given channel. This
should be called by the low-level driver as close to the interface
@@ -1518,8 +1521,8 @@ extern struct zt_tone *zt_dtmf_tone(char digit, int mf);
AT THE ZAPTEL LEVEL. zt_ec_chunk will not echo cancel if it should
not be doing so. rxchunk is modified in-place */
-extern void zt_ec_chunk(struct zt_chan *chan, unsigned char *rxchunk, const unsigned char *txchunk);
-extern void zt_ec_span(struct zt_span *span);
+void zt_ec_chunk(struct zt_chan *chan, unsigned char *rxchunk, const unsigned char *txchunk);
+void zt_ec_span(struct zt_span *span);
extern struct file_operations *zt_transcode_fops;
@@ -1528,15 +1531,15 @@ extern struct file_operations *zt_transcode_fops;
extern short __zt_mulaw[256];
extern short __zt_alaw[256];
#ifdef CONFIG_CALC_XLAW
-extern u_char __zt_lineartoulaw(short a);
-extern u_char __zt_lineartoalaw(short a);
+u_char __zt_lineartoulaw(short a);
+u_char __zt_lineartoalaw(short a);
#else
extern u_char __zt_lin2mu[16384];
extern u_char __zt_lin2a[16384];
#endif
/* Used by dynamic zaptel -- don't use directly */
-extern void zt_set_dynamic_ioctl(int (*func)(unsigned int cmd, unsigned long data));
+void zt_set_dynamic_ioctl(int (*func)(unsigned int cmd, unsigned long data));
/* Used privately by zaptel. Avoid touching directly */
struct zt_tone {