From 96f60efee8c9f08e30dece68a4671d065889ee22 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Wed, 31 Jan 2007 19:01:33 +0000 Subject: 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 --- fxotune.c | 1 - fxstest.c | 1 - hdlcstress.c | 2 -- hdlctest.c | 2 -- patgen.c | 2 -- patlooptest.c | 2 -- pattest.c | 2 -- timertest.c | 1 - tonezone.c | 1 - torisatool.c | 1 - usbfxstest.c | 1 - wctc4xxp/codec_test.c | 1 - zaptel.c | 1 - zaptel.h | 57 +++++++++++++++++++++++++++------------------------ zonedata.c | 1 - ztcfg.c | 1 - ztd-eth.c | 1 - ztd-loc.c | 1 - ztdiag.c | 1 - ztdummy.c | 1 - ztdynamic.c | 1 - ztmonitor.c | 1 - zttool.c | 1 - zttranscode.c | 1 - 24 files changed, 30 insertions(+), 55 deletions(-) diff --git a/fxotune.c b/fxotune.c index 94d0912..c5db4d1 100644 --- a/fxotune.c +++ b/fxotune.c @@ -22,7 +22,6 @@ #include #include -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/fxstest.c b/fxstest.c index 820ae3f..922a1a9 100644 --- a/fxstest.c +++ b/fxstest.c @@ -5,7 +5,6 @@ #include #include #include -#include #include "zaptel.h" #include "tonezone.h" #include "wctdm.h" diff --git a/hdlcstress.c b/hdlcstress.c index 3d3d942..70505a2 100644 --- a/hdlcstress.c +++ b/hdlcstress.c @@ -2,10 +2,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/hdlctest.c b/hdlctest.c index fd74bbb..d67a552 100644 --- a/hdlctest.c +++ b/hdlctest.c @@ -2,10 +2,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/patgen.c b/patgen.c index 38d199c..e72b0ed 100644 --- a/patgen.c +++ b/patgen.c @@ -3,14 +3,12 @@ #include #include #include -#include #include #include #include #include #include "bittest.h" -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/patlooptest.c b/patlooptest.c index 51bec00..709c1a2 100644 --- a/patlooptest.c +++ b/patlooptest.c @@ -3,14 +3,12 @@ #include #include #include -#include #include #include #include #include #include -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/pattest.c b/pattest.c index a25d265..8bc64aa 100644 --- a/pattest.c +++ b/pattest.c @@ -3,14 +3,12 @@ #include #include #include -#include #include #include #include #include #include "bittest.h" -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/timertest.c b/timertest.c index fd213e5..df224b2 100644 --- a/timertest.c +++ b/timertest.c @@ -8,7 +8,6 @@ #include #include -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/tonezone.c b/tonezone.c index cb8754a..deb1ac1 100644 --- a/tonezone.c +++ b/tonezone.c @@ -29,7 +29,6 @@ #include #include #include -#include #include "tonezone.h" #define DEFAULT_ZT_DEV "/dev/zap/ctl" diff --git a/torisatool.c b/torisatool.c index 75d54c7..43dc7a9 100644 --- a/torisatool.c +++ b/torisatool.c @@ -28,7 +28,6 @@ #include #include #include -#include #include "zaptel.h" #include "torisa.h" diff --git a/usbfxstest.c b/usbfxstest.c index 45c9b93..23cd680 100644 --- a/usbfxstest.c +++ b/usbfxstest.c @@ -6,7 +6,6 @@ #include #include #include "zap.h" -#include #include int main(int argc, char *argv[]) diff --git a/wctc4xxp/codec_test.c b/wctc4xxp/codec_test.c index 5cef93e..4117007 100644 --- a/wctc4xxp/codec_test.c +++ b/wctc4xxp/codec_test.c @@ -35,7 +35,6 @@ #include #include #include -#include #ifdef STANDALONE_ZAPATA #include "../zaptel.h" #else diff --git a/zaptel.c b/zaptel.c index 0625e2e..fc1bd35 100644 --- a/zaptel.c +++ b/zaptel.c @@ -79,7 +79,6 @@ #define FAST_HDLC_NEED_TABLES #include "fasthdlc.h" -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else 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 + #ifdef __KERNEL__ #include "zconfig.h" #include + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) #include #endif + #ifdef CONFIG_ZAPATA_NET #include #endif + #ifdef CONFIG_ZAPATA_PPP #include #include #include #endif + #include #include @@ -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 @@ -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 #include #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 { diff --git a/zonedata.c b/zonedata.c index 0d57f87..dbfef0d 100644 --- a/zonedata.c +++ b/zonedata.c @@ -23,7 +23,6 @@ * UK information from BT SIN 350 Issue 1.1 * Helpful reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ -#include #include "tonezone.h" struct tone_zone builtin_zones[] = diff --git a/ztcfg.c b/ztcfg.c index ec1fdf6..ae03547 100644 --- a/ztcfg.c +++ b/ztcfg.c @@ -38,7 +38,6 @@ #include #include #include "ztcfg.h" -#include #include "tonezone.h" #include "zaptel.h" diff --git a/ztd-eth.c b/ztd-eth.c index 8dec7a2..26737b9 100644 --- a/ztd-eth.c +++ b/ztd-eth.c @@ -36,7 +36,6 @@ #ifdef CONFIG_DEVFS_FS #include #endif -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/ztd-loc.c b/ztd-loc.c index ff9ba73..100bd9f 100644 --- a/ztd-loc.c +++ b/ztd-loc.c @@ -60,7 +60,6 @@ #ifdef CONFIG_DEVFS_FS #include #endif -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/ztdiag.c b/ztdiag.c index 864f19a..e2be5f3 100644 --- a/ztdiag.c +++ b/ztdiag.c @@ -4,7 +4,6 @@ #include #include -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/ztdummy.c b/ztdummy.c index 0b2c111..df2f19b 100644 --- a/ztdummy.c +++ b/ztdummy.c @@ -59,7 +59,6 @@ #include #include #include -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/ztdynamic.c b/ztdynamic.c index df68b5a..825f6ee 100644 --- a/ztdynamic.c +++ b/ztdynamic.c @@ -36,7 +36,6 @@ #ifdef CONFIG_DEVFS_FS #include #endif -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #else diff --git a/ztmonitor.c b/ztmonitor.c index be307d7..6098b66 100644 --- a/ztmonitor.c +++ b/ztmonitor.c @@ -38,7 +38,6 @@ #include #include #include -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #include "tonezone.h" diff --git a/zttool.c b/zttool.c index 34b8f79..2a3cb34 100644 --- a/zttool.c +++ b/zttool.c @@ -38,7 +38,6 @@ #include #include #include -#include #ifdef STANDALONE_ZAPATA #include "zaptel.h" #include "tonezone.h" diff --git a/zttranscode.c b/zttranscode.c index 60ff0ca..aad71cc 100644 --- a/zttranscode.c +++ b/zttranscode.c @@ -34,7 +34,6 @@ #include #include #include -#include #ifdef CONFIG_DEVFS_FS #include #endif -- cgit v1.2.3