~vibhavp/ubuntu/raring/dahdi-tools/merge-from-debian

« back to all changes in this revision

Viewing changes to xpp/oct612x/include/octrpc/oct6100_rpc_protocol.h

  • Committer: Vibhav Pant
  • Date: 2012-12-26 17:23:16 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: vibhavp@gmail.com-20121226172316-o2jojsfcnr0aqrme
* Merge from Debian unstable. Remaining changes:
  - Bug Fix: If linux-headers are not installed, don't block, and print
    information for the user.
  - added debian/dahdi.postinst
  - added --error-handler=init_failed to debian/rules
  - debian/control: Added gawk as dependency for dkms build (LP: #493304)
  - Changes from Debian:
    - debian/control: Change Maintainer
    - debian/control: Removed Uploaders field.
    - debian/control: Removed Debian Vcs-Svn entry and replaced with
      ubuntu-voip Vcs-Bzr, to reflect divergence in packages.
    - debian/control: Package dahdi Depends on dahdi-dkms | dahdi-source 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
2
 
 
3
File:  oct6100_rpc_protocol.h
 
4
 
 
5
    Copyright (c) 2001-2007 Octasic Inc.
 
6
    
 
7
Description: 
 
8
 
 
9
        File containing all defines and prototypes related to the OCT6100 RPC 
 
10
        protocol for exchanging debug commands.
 
11
 
 
12
This file is part of the Octasic OCT6100 GPL API . The OCT6100 GPL API  is 
 
13
free software; you can redistribute it and/or modify it under the terms of 
 
14
the GNU General Public License as published by the Free Software Foundation; 
 
15
either version 2 of the License, or (at your option) any later version.
 
16
 
 
17
The OCT6100 GPL API is distributed in the hope that it will be useful, but 
 
18
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 
19
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 
20
for more details. 
 
21
 
 
22
You should have received a copy of the GNU General Public License 
 
23
along with the OCT6100 GPL API; if not, write to the Free Software 
 
24
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
25
 
 
26
$Octasic_Release: OCT612xAPI-01.00-PR49 $
 
27
 
 
28
$Octasic_Revision: 6 $
 
29
 
 
30
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
31
 
 
32
#ifndef __OCT6100_RPC_PROTOCOL_H__
 
33
#define __OCT6100_RPC_PROTOCOL_H__
 
34
 
 
35
/*****************************  DEFINES  *************************************/
 
36
 
 
37
#define cOCTRPC_INTERFACE_VERSION                               0x00010002
 
38
 
 
39
/* Octasic commands. */
 
40
#define cOCT6100_RPC_CHIP_LIST                                  0xFF000000
 
41
#define cOCT6100_RPC_CHIP_CHOICE                                0xFF000001
 
42
#define cOCT6100_RPC_ENV_DISCONNECT                             0xFF000002
 
43
 
 
44
/* Commands */
 
45
/* Read commands */
 
46
#define cOCT6100_RPC_READ_WORD                                  0x00000000
 
47
#define cOCT6100_RPC_READ_BURST                                 0x00000001
 
48
#define cOCT6100_RPC_READ_DEBUG                                 0x00000002
 
49
#define cOCT6100_RPC_READ_ARRAY                                 0x00000003
 
50
#define cOCT6100_RPC_API_DISCONNECT                             0x00000004
 
51
 
 
52
/* Write commands */
 
53
#define cOCT6100_RPC_WRITE_WORD                                 0x00000010
 
54
#define cOCT6100_RPC_WRITE_BURST                                0x00000011
 
55
#define cOCT6100_RPC_WRITE_SMEAR                                0x00000012
 
56
#define cOCT6100_RPC_WRITE_INC                                  0x00000013
 
57
 
 
58
/* Debug commands.*/
 
59
#define cOCT6100_RPC_SET_HOT_CHANNEL                    0x00000014
 
60
#define cOCT6100_RPC_GET_DEBUG_CHAN_INDEX               0x00000015
 
61
 
 
62
#define cOCTRPC_UNKNOWN_COMMAND_NUM                             0xFFFFFFFF
 
63
 
 
64
/* Errors */
 
65
#define cOCT6100_RPCERR_OK                                              0x00000000
 
66
#define cOCT6100_RPCERR_INVALID_COMMAND_NUMBER  0x00000001
 
67
#define cOCT6100_RPCERR_INVALID_COMMAND_PAYLOAD 0x00000002
 
68
#define cOCT6100_RPCERR_INVALID_COMMAND_LENGTH  0x00000003
 
69
 
 
70
 
 
71
/*****************************  TYPES  ***************************************/
 
72
 
 
73
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
74
 
 
75
Structure:              OCT6100_RPC_READ_WORD
 
76
 
 
77
Description:    Command structure for the read of one word.
 
78
 
 
79
-------------------------------------------------------------------------------
 
80
|       Member                  |       Description
 
81
-------------------------------------------------------------------------------
 
82
IN      ulAddress                       Address at which to read.
 
83
OUT     ulReadData                      The word read, returned.
 
84
 
 
85
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
86
typedef struct _OCT6100_RPC_READ_WORD_
 
87
{
 
88
        UINT32  IN      ulAddress;
 
89
        UINT32  OUT     ulReadData;
 
90
 
 
91
} tOCT6100_RPC_READ_WORD, *tPOCT6100_RPC_READ_WORD;
 
92
 
 
93
 
 
94
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
95
 
 
96
Structure:              OCT6100_RPC_READ_BURST
 
97
 
 
98
Description:    Command structure for a read burst.  The burst starts at the
 
99
                                given address and reads the specified number of consecutive
 
100
                                words.
 
101
 
 
102
                                Whereas every command structure uses a complete dword for every
 
103
                                member, irrespective of the size of data unit needed, this
 
104
                                structure does not do so for the read data.  To save bandwidth
 
105
                                the read data words are returned two per dword.
 
106
 
 
107
Example packet: 31                 16 15                  0
 
108
                                -------------------------------------------
 
109
                                |             ulAddress = 0x100           |
 
110
                                -------------------------------------------
 
111
                                |            ulBurstLength = 0x3          |
 
112
                                -------------------------------------------
 
113
 aulReadData -> |         D0         |         D1         |
 
114
                                -------------------------------------------
 
115
                                |         D2         |         xx         |
 
116
                                -------------------------------------------
 
117
 
 
118
                                Dy is the read data at ulAddress + 2 * y.
 
119
 
 
120
-------------------------------------------------------------------------------
 
121
|       Member                  |       Description
 
122
-------------------------------------------------------------------------------
 
123
IN      ulAddress                       Address at which to read.
 
124
IN      ulBurstLength           The number of consecutive words to be read.
 
125
OUT     aulReadData                     The read data returned.  The dwords of the structure
 
126
                                                starting at this address are arranged as indicated in
 
127
                                                the example packet above.
 
128
 
 
129
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
130
typedef struct _OCT6100_RPC_READ_BURST_
 
131
{
 
132
        UINT32  IN      ulAddress;
 
133
        UINT32  IN      ulBurstLength;
 
134
        UINT32  OUT     aulReadData[ 1 ];
 
135
 
 
136
} tOCT6100_RPC_READ_BURST, *tPOCT6100_RPC_READ_BURST;
 
137
 
 
138
 
 
139
 
 
140
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
141
 
 
142
Structure:              OCT6100_RPC_READ_ARRAY
 
143
 
 
144
Description:    Command structure for a variable number of reads.  The reads do
 
145
                                not have to be at contiguous addresses.
 
146
 
 
147
                                Whereas every command structure uses a complete dword for every
 
148
                                member, irrespective of the size of data unit needed, this
 
149
                                structure does not do so for the read data. To save bandwidth
 
150
                                the read data words are returned two per dword, and the
 
151
                                parity bits are returned 16 per dword (two parity bits per read
 
152
                                access).
 
153
 
 
154
Example packet: 31                 16 15                  0
 
155
                                -------------------------------------------
 
156
                                |            ulArrayLength = 0x3          |
 
157
                                -------------------------------------------
 
158
 aulArrayData ->|                   A0                    |
 
159
                                -------------------------------------------
 
160
                                |                   A1                    |
 
161
                                -------------------------------------------
 
162
                                |                   A2                    |
 
163
                                -------------------------------------------
 
164
                                |         D0         |         D1         |
 
165
                                -------------------------------------------
 
166
                                |         D2         |         xx         |
 
167
                                -------------------------------------------
 
168
 
 
169
                                Ay is the address for access y.
 
170
                                Dy is the read data at Ay.
 
171
 
 
172
-------------------------------------------------------------------------------
 
173
|       Member                  |       Description
 
174
-------------------------------------------------------------------------------
 
175
IN              ulArrayLength   Number of reads to do.
 
176
IN OUT  aulArrayData    The addresses at which to read (IN) and the read data
 
177
                                                returned (OUT).  The dwords of the command structure
 
178
                                                starting at this address are arranged as indicated in
 
179
                                                the example packet above.
 
180
 
 
181
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
182
typedef struct _OCT6100_RPC_READ_ARRAY
 
183
{
 
184
        UINT32  IN              ulArrayLength;
 
185
        UINT32  IN OUT  aulArrayData[ 1 ];
 
186
        
 
187
} tOCT6100_RPC_READ_ARRAY, *tPOCT6100_RPC_READ_ARRAY;
 
188
 
 
189
 
 
190
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
191
 
 
192
Structure:              OCT6100_RPC_WRITE_WORD
 
193
 
 
194
Description:    Command structure for the write of one word.
 
195
 
 
196
-------------------------------------------------------------------------------
 
197
|       Member                  |       Description
 
198
-------------------------------------------------------------------------------
 
199
IN      ulAddress                       Address at which to write.
 
200
IN      ulWriteData                     The word to write.
 
201
 
 
202
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
203
typedef struct _OCT6100_RPC_WRITE_WORD_
 
204
{
 
205
        UINT32  IN      ulAddress;
 
206
        UINT32  IN      ulParity;
 
207
        UINT32  IN      ulWriteData;
 
208
 
 
209
} tOCT6100_RPC_WRITE_WORD, *tPOCT6100_RPC_WRITE_WORD;
 
210
 
 
211
 
 
212
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
213
 
 
214
Structure:              OCT6100_RPC_WRITE_SMEAR
 
215
 
 
216
Description:    Command structure for the write of one word at one or many
 
217
                                consecutive addresses.
 
218
 
 
219
-------------------------------------------------------------------------------
 
220
|       Member                  |       Description
 
221
-------------------------------------------------------------------------------
 
222
IN      ulAddress                       Address of first write.
 
223
IN      ulSmearLength           Number of consecutive addresses to write.
 
224
IN      ulWriteData                     The word to write at each address.
 
225
 
 
226
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
227
typedef struct _OCT6100_RPC_WRITE_SMEAR_
 
228
{
 
229
        UINT32  IN      ulAddress;
 
230
        UINT32  IN      ulSmearLength;
 
231
        UINT32  IN      ulParity;
 
232
        UINT32  IN      ulWriteData;
 
233
 
 
234
} tOCT6100_RPC_WRITE_SMEAR, *tPOCT6100_RPC_WRITE_SMEAR;
 
235
 
 
236
 
 
237
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
238
 
 
239
Structure:              OCT6100_RPC_WRITE_INC
 
240
 
 
241
Description:    Command structure for the write of an incremental pattern at
 
242
                                one or many consecutive addresses.
 
243
 
 
244
-------------------------------------------------------------------------------
 
245
|       Member                  |       Description
 
246
-------------------------------------------------------------------------------
 
247
IN      ulAddress                       Address of first write.
 
248
IN      ulIncLength                     Number of consecutive addresses to write.
 
249
IN      ulWriteData                     The first word of the incremental pattern.  For each
 
250
                                                consecutive write the word will be incremented by 1.
 
251
 
 
252
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
253
typedef struct _OCT6100_RPC_WRITE_INC_
 
254
{
 
255
        UINT32  IN      ulAddress;
 
256
        UINT32  IN      ulIncLength;
 
257
        UINT32  IN      ulParity;
 
258
        UINT32  IN      ulWriteData;
 
259
 
 
260
} tOCT6100_RPC_WRITE_INC, *tPOCT6100_RPC_WRITE_INC;
 
261
 
 
262
 
 
263
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
264
 
 
265
Structure:              OCT6100_RPC_WRITE_BURST
 
266
 
 
267
Description:    Command structure for a write burst.  The burst starts at the
 
268
                                given address and writes a given word for each address.
 
269
 
 
270
                                Whereas every command structure uses a complete dword for every
 
271
                                member, irrespective of the size of data unit needed, this
 
272
                                structure does not do so for the write data.  To save bandwidth
 
273
                                the write data words are sent two per dword.
 
274
 
 
275
Example packet: 31                 16 15                  0
 
276
                                -------------------------------------------
 
277
                                |             ulAddress = 0x100           |
 
278
                                -------------------------------------------
 
279
                                |            ulBurstLength = 0x3          |
 
280
                                -------------------------------------------
 
281
 aulWriteData ->|         D0         |         D1         |
 
282
                                -------------------------------------------
 
283
                                |         D2         |         xx         |
 
284
                                -------------------------------------------
 
285
 
 
286
                                Dy is the write data for ulAddress + 2 * y.
 
287
 
 
288
-------------------------------------------------------------------------------
 
289
|       Member                  |       Description
 
290
-------------------------------------------------------------------------------
 
291
IN      ulAddress                       First address at which to write.
 
292
IN      ulBurstLength           The number of consecutive addresses to be write.
 
293
IN      aulWriteData            The write data words.  The dwords of the structure
 
294
                                                starting at this address are arranged as indicated in
 
295
                                                the example packet above.
 
296
 
 
297
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
298
typedef struct _OCT6100_RPC_WRITE_BURST_
 
299
{
 
300
        UINT32  IN      ulAddress;
 
301
        UINT32  IN      ulBurstLength;
 
302
        UINT32  IN      ulParity;
 
303
        UINT32  IN      aulWriteData[ 1 ];
 
304
 
 
305
} tOCT6100_RPC_WRITE_BURST, *tPOCT6100_RPC_WRITE_BURST;
 
306
 
 
307
 
 
308
 
 
309
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
310
 
 
311
Structure:              OCT6100_RPC_SET_HOT_CHANNEL
 
312
 
 
313
Description:    Command structure to set the hot channel.
 
314
 
 
315
-------------------------------------------------------------------------------
 
316
|       Member                  |       Description
 
317
-------------------------------------------------------------------------------
 
318
IN      ulDebugChannel                  Index of the channel to debug.
 
319
 
 
320
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
321
typedef struct _OCT6100_RPC_SET_HOT_CHANNEL_
 
322
{
 
323
        UINT32  IN      ulHotChannel;
 
324
        UINT32  IN      ulPcmLaw;
 
325
 
 
326
} tOCT6100_RPC_SET_HOT_CHANNEL, *tPOCT6100_RPC_SET_HOT_CHANNEL;
 
327
 
 
328
 
 
329
 
 
330
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\
 
331
 
 
332
Structure:              OCT6100_RPC_GET_DEBUG_CHAN_INDEX
 
333
 
 
334
Description:    Command structure to get the debug channel index used by the API.
 
335
 
 
336
-------------------------------------------------------------------------------
 
337
|       Member                  |       Description
 
338
-------------------------------------------------------------------------------
 
339
IN      ulDebugChannel                  Index of the channel to debug.
 
340
 
 
341
\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
342
typedef struct _OCT6100_RPC_GET_DEBUG_CHAN_INDEX_
 
343
{
 
344
        UINT32  OUT     ulDebugChanIndex;
 
345
 
 
346
} tOCT6100_RPC_GET_DEBUG_CHAN_INDEX, *tPOCT6100_RPC_GET_DEBUG_CHAN_INDEX;
 
347
 
 
348
#endif /* __OCT6100_RPC_PROTOCOL_H__ */