~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to debian/patches/zaptelh_14.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell, Tzafrir Cohen, Kilian Krause, Mark Purcell
  • Date: 2006-12-02 14:33:30 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20061202143330-ezh6vrvpmab44gw8
Tags: 1:1.2.11.dfsg-1
[ Tzafrir Cohen ]
* Reverting my changes from 1:1.2.9.1.dfsg-2. Moved to the experimental
  branch.

[ Kilian Krause ]
* Remove bogus zaptel-modules from being Recommends (Closes: #387961)
* Update vzaphfc as proposed by Jens Wilke

[ Mark Purcell ]
* New Upstream Release
  - Fixes: Fails to build with pristine upstream kernel, very recent version
  (Closes: #400705)
  - Fixes: Please package version 1.2.11 (Closes: #399634)
  - Fixes: vzaphfc: error: 'CHECKSUM_HW' undeclared (Closes: #386498)
* Cleanup debian/patches/wct4xxp-dfsg.dpatch
* debian/rules call dh_installmodules from binary_modules:
  - Fixes:  I had to do depmod -a manually after doing m-a a-i zaptel (Closes:
  #332787)
* Update debian/patches/Makefile_uname.dpatch to force -O2
  - Fixes:  Cannot initiate a call to BRI (Closes: #386052)
* Remove Depends: zaptel from debian/control.modules.in
  - please don't depend on zaptel (Closes: #391826)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## zaptelh_14.dpatch by Tzafrir Cohen <tzafrir.cohen@xorcom.com>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: New interfaces of zaptel 1.4. This allows building asterisk 1.4
6
 
 
7
 
@DPATCH@
8
 
diff -urNad zaptel-1.2.9.1.dfsg~/zaptel.h zaptel-1.2.9.1.dfsg/zaptel.h
9
 
--- zaptel-1.2.9.1.dfsg~/zaptel.h       2006-10-08 00:15:11.000000000 +0200
10
 
+++ zaptel-1.2.9.1.dfsg/zaptel.h        2006-10-08 00:16:47.000000000 +0200
11
 
@@ -115,6 +115,7 @@
12
 
 #define ZT_SIG_DACS    (__ZT_SIG_DACS | ZT_SIG_CLEAR)  /* Cross connect */
13
 
 #define ZT_SIG_EM_E1    (1 << 17)                      /* E1 E&M Variation */
14
 
 #define ZT_SIG_DACS_RBS         ((1 << 18) | __ZT_SIG_DACS)    /* Cross connect w/ RBS */
15
 
+#define ZT_SIG_HARDHDLC        ((1 << 19) | ZT_SIG_CLEAR)
16
 
 
17
 
 /* tone flag values */
18
 
 #define        ZT_REVERSE_RXTONE 1  /* reverse polarity rx tone logic */
19
 
@@ -666,6 +667,11 @@
20
 
  */
21
 
 #define        ZT_SETPOLARITY          _IOW (ZT_CODE, 92, int)
22
 
 
23
 
+/*
24
 
+ * Transcoder operations
25
 
+ */
26
 
+#define ZT_TRANSCODE_OP                _IOWR(ZT_CODE, 93, int)
27
 
+
28
 
 /* 
29
 
  * Startup or Shutdown a span
30
 
  */
31
 
@@ -690,11 +696,88 @@
32
 
 #define ZT_TONE_STUTTER                10
33
 
 #define ZT_TONE_MAX            16
34
 
 
35
 
+#define ZT_TONE_DTMF_BASE      64
36
 
+
37
 
+/*
38
 
+ * These must be in the same order as the dtmf_tones array in tones.h 
39
 
+ */
40
 
+enum {
41
 
+       ZT_TONE_DTMF_0 = ZT_TONE_DTMF_BASE,
42
 
+       ZT_TONE_DTMF_1,
43
 
+       ZT_TONE_DTMF_2,
44
 
+       ZT_TONE_DTMF_3,
45
 
+       ZT_TONE_DTMF_4,
46
 
+       ZT_TONE_DTMF_5,
47
 
+       ZT_TONE_DTMF_6,
48
 
+       ZT_TONE_DTMF_7,
49
 
+       ZT_TONE_DTMF_8,
50
 
+       ZT_TONE_DTMF_9,
51
 
+       ZT_TONE_DTMF_s,
52
 
+       ZT_TONE_DTMF_p,
53
 
+       ZT_TONE_DTMF_A,
54
 
+       ZT_TONE_DTMF_B,
55
 
+       ZT_TONE_DTMF_C,
56
 
+       ZT_TONE_DTMF_D
57
 
+};
58
 
+
59
 
+#define ZT_TONE_DTMF_MAX ZT_TONE_DTMF_D
60
 
+
61
 
 #define ZT_MAX_CADENCE         16
62
 
 
63
 
 #define ZT_TONEDETECT_ON       (1 << 0)                /* Detect tones */
64
 
 #define ZT_TONEDETECT_MUTE     (1 << 1)                /* Mute audio in received channel */
65
 
 
66
 
+#define ZT_TRANSCODE_MAGIC 0x74a9c0de
67
 
+
68
 
+/* Operations */
69
 
+#define ZT_TCOP_RESET          1                       /* Reset the channel state / codec selection */
70
 
+#define ZT_TCOP_TRANSCODE      2                       /* Begin transcoding a block */
71
 
+#define ZT_TCOP_GETINFO                3                       /* Get information (use zt_transcode_info) */
72
 
+
73
 
+typedef struct zt_transcode_info {
74
 
+       unsigned int op;
75
 
+       unsigned int tcnum;
76
 
+       char name[80];
77
 
+       unsigned int srcfmts;
78
 
+       unsigned int dstfmts;
79
 
+} ZT_TRANSCODE_INFO;
80
 
+
81
 
+#define ZT_TCCONF_USETS        (1 << 0)        /* Use/update timestamp field */
82
 
+#define ZT_TCCONF_USESEQ       (1 << 1)        /* Use/update seqno field */
83
 
+
84
 
+#define ZT_TCSTAT_DSTRDY       (1 << 0)        /* Destination data is ready */
85
 
+#define ZT_TCSTAT_DSTBUSY      (1 << 1)        /* Destination data is outstanding */
86
 
+
87
 
+#define __ZT_TRANSCODE_BUFSIZ          16384
88
 
+#define ZT_TRANSCODE_HDRLEN            256
89
 
+#define ZT_TRANSCODE_BUFSIZ            ((__ZT_TRANSCODE_BUFSIZ) - (ZT_TRANSCODE_HDRLEN))
90
 
+#define ZT_TRANSCODE_DSTOFFSET         (((ZT_TRANSCODE_BUFSIZ) / 2) + ZT_TRANSCODE_HDRLEN)
91
 
+#define ZT_TRANSCODE_SRCOFFSET         (((ZT_TRANSCODE_BUFSIZ) / 2) + ZT_TRANSCODE_HDRLEN)
92
 
+
93
 
+typedef struct zt_transcode_header {
94
 
+       unsigned int srcfmt;            /* See formats.h -- use TCOP_RESET when you change */
95
 
+       unsigned int srcoffset;         /* In bytes -- written by user */
96
 
+       unsigned int srclen;            /* In bytes -- written by user */
97
 
+       unsigned int srctimestamp;      /* In samples -- written by user (only used if ZT_TCCONF_USETS is set) */
98
 
+       unsigned int srcseqno;          /* In units -- written by user (only used if ZT_TCCONF_USESEQ is set) */
99
 
+
100
 
+       unsigned int dstfmt;            /* See formats.h -- use TCOP_RESET when you change */
101
 
+       unsigned int dstoffset;         /* In bytes -- written by user */
102
 
+       unsigned int dsttimestamp;      /* In samples -- read by user */
103
 
+       unsigned int dstseqno;          /* In units -- read by user (only used if ZT_TCCONF_USESEQ is set) */
104
 
+       unsigned int dstlen;            /* In bytes -- read by user */
105
 
+       unsigned int dstsamples;        /* In timestamp units -- read by user */
106
 
+
107
 
+       unsigned int magic;             /* Magic value -- ZT_TRANSCODE_MAGIC, read by user */
108
 
+       unsigned int config;            /* Read/write by user */
109
 
+       unsigned int status;            /* Read/write by user */
110
 
+
111
 
+       /* XXX: fix this to automatically calculate somehow */
112
 
+       unsigned char userhdr[ZT_TRANSCODE_HDRLEN - (sizeof(unsigned int) * 14)];       /* Storage for user parameters */
113
 
+       unsigned char srcdata[ZT_TRANSCODE_BUFSIZ / 2]; /* Storage of source data */
114
 
+       unsigned char dstdata[ZT_TRANSCODE_BUFSIZ / 2]; /* Storage of destination data */
115
 
+} ZT_TRANSCODE_HEADER;
116
 
+
117
 
 struct zt_ring_cadence {
118
 
        int ringcadence [ZT_MAX_CADENCE];
119
 
 };
120
 
@@ -1360,6 +1443,33 @@
121
 
 #endif 
122
 
 };
123
 
 
124
 
+struct zt_transcoder_channel {
125
 
+       void *pvt;
126
 
+       struct zt_transcoder *parent;
127
 
+       wait_queue_head_t ready;
128
 
+       int errorstatus;
129
 
+       int offset;
130
 
+       unsigned int flags;
131
 
+       unsigned int srcfmt;
132
 
+       unsigned int dstfmt;
133
 
+       struct zt_transcode_header *tch;
134
 
+};
135
 
+
136
 
+#define ZT_TC_FLAG_BUSY       (1 << 0)
137
 
+#define ZT_TC_FLAG_TRANSIENT  (1 << 1)
138
 
+
139
 
+
140
 
+struct zt_transcoder {
141
 
+       struct zt_transcoder *next;
142
 
+       char name[80];
143
 
+       int numchannels;
144
 
+       unsigned int srcfmts;
145
 
+       unsigned int dstfmts;
146
 
+       int (*operation)(struct zt_transcoder_channel *channel, int op);
147
 
+       /* Transcoder channels */
148
 
+       struct zt_transcoder_channel channels[0];
149
 
+};
150
 
+
151
 
 #define ZT_WATCHDOG_NOINTS             (1 << 0)
152
 
 
153
 
 #define ZT_WATCHDOG_INIT                       1000