~xnox/debian/sid/dahdi-linux/nmu-659818

« back to all changes in this revision

Viewing changes to drivers/dahdi/wctdm24xxp/GpakApi.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell, Tzafrir Cohen, Victor Seva
  • Date: 2009-05-20 07:22:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090520072246-y1ba8ofc81ykgf8z
Tags: 1:2.2.0~dfsg~rc4-1
* New upstream release

[ Tzafrir Cohen ]
* NOT RELEASED YET
* Dropped qozap as wcb4xxp provides that functionality.
* New upstream RC.
* Actually build OpenVox drivers.
* opvxa1200.c: rev. 1.4.12.4 (battery fixes and such)
* Fix '${match}' in udev rules file (hardwire).
* no_firmware_download: Disable downloading a binary kernel module at 
  build time.

[ Victor Seva ]
* fix debian/watch. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2005 , Adaptive Digital Technologies, Inc.
3
 
 *
4
 
 * File Name: GpakApi.h
5
 
 *
6
 
 * Description:
7
 
 *   This file contains the function prototypes and data types for the user
8
 
 *   API functions that communicate with DSPs executing G.PAK software. The
9
 
 *   file is used by application software in the host processor connected to
10
 
 *   C55X G.PAK DSPs via a Host Port Interface.
11
 
 *
12
 
 * Version: 1.0
13
 
 *
14
 
 * Revision History:
15
 
 *   06/15/05 - Initial release.
16
 
 *   11/15/2006  - 24 TDM-TDM Channels EC release
17
 
 *
18
 
 * This program has been released under the terms of the GPL version 2 by
19
 
 * permission of Adaptive Digital Technologies, Inc.
20
 
 *
21
 
 */
22
 
 
23
 
/*
24
 
 * See http://www.asterisk.org for more information about
25
 
 * the Asterisk project. Please do not directly contact
26
 
 * any of the maintainers of this project for assistance;
27
 
 * the project provides a web site, mailing lists and IRC
28
 
 * channels for your use.
29
 
 *
30
 
 * This program is free software, distributed under the terms of
31
 
 * the GNU General Public License Version 2 as published by the
32
 
 * Free Software Foundation. See the LICENSE file included with
33
 
 * this program for more details.
34
 
 */
35
 
 
36
 
#ifndef _GPAKAPI_H  /* prevent multiple inclusion */
37
 
#define _GPAKAPI_H
38
 
#include "gpakErrs.h"
39
 
#include "gpakenum.h"
40
 
 
41
 
// Bit masks to select which algorithm's parameters to update: Or-together the
42
 
// desired masks into the UpdateBits function parameter.
43
 
#define DTMF_UPDATE_MASK        0x0010   // update DTMF params, MinLevel, SNRFlag and Freq
44
 
#define DTMF_TWIST_UPDATE_MASK  0x0020   // update DTMF TWIST system params
45
 
#define DTMF_VALID_MASK         0x0080   // update DTMF ValidMask params
46
 
 
47
 
#define DSP_DEBUG_BUFF_SIZE 42      // units of 16-bit words
48
 
 
49
 
/* Definition of an Asynchronous Event Data Structure */
50
 
typedef union
51
 
{
52
 
    struct
53
 
    {
54
 
        GpakToneCodes_t    ToneCode;       // detected tone code
55
 
        unsigned short int ToneDuration;   // tone duration
56
 
        GpakTdmDirection   Direction;      // detected on A r B side
57
 
        short int          DebugToneStatus;// reserved for debug info
58
 
    } toneEvent;
59
 
 
60
 
} GpakAsyncEventData_t;
61
 
 
62
 
/* Definition of an Echo Canceller Parameters information structure. */
63
 
typedef struct
64
 
{
65
 
    short int EcanTapLength;       // Echo Can Num Taps (tail length) 
66
 
    short int EcanNlpType;         // Echo Can NLP Type 
67
 
    short int EcanAdaptEnable;     // Echo Can Adapt Enable flag 
68
 
    short int EcanG165DetEnable;   // Echo Can G165 Detect Enable flag 
69
 
    short int EcanDblTalkThresh;   // Echo Can Double Talk threshold 
70
 
    short int EcanNlpThreshold;    // Echo Can NLP threshold 
71
 
    short int EcanNlpConv;  // Dynamic NLP control, NLP limit when EC about to converged
72
 
    short int EcanNlpUnConv;// Dynamic NLP control, NLP limit when EC not converged yet
73
 
    short int EcanNlpMaxSuppress; // suppression level for NLP_SUPP mode
74
 
    short int EcanCngThreshold;    // Echo Can CNG Noise threshold 
75
 
    short int EcanAdaptLimit;      // Echo Can Max Adapts per frame 
76
 
    short int EcanCrossCorrLimit;  // Echo Can Cross Correlation limit 
77
 
    short int EcanNumFirSegments;  // Echo Can Num FIR Segments 
78
 
    short int EcanFirSegmentLen;   // Echo Can FIR Segment Length 
79
 
} GpakEcanParms_t;
80
 
 
81
 
/* Definition of a Channel Configuration information structure. */
82
 
typedef struct
83
 
{
84
 
    GpakSerialPort_t    PcmInPortA;         // A side PCM Input Serial Port Id 
85
 
    unsigned short int  PcmInSlotA;         // A side PCM Input Time Slot 
86
 
    GpakSerialPort_t    PcmOutPortA;        // A side PCM Output Serial Port Id 
87
 
    unsigned short int  PcmOutSlotA;        // A side PCM Output Time Slot 
88
 
    GpakSerialPort_t    PcmInPortB;         // B side PCM Input Serial Port Id 
89
 
    unsigned short int  PcmInSlotB;         // B side PCM Input Time Slot 
90
 
    GpakSerialPort_t    PcmOutPortB;        // B side PCM Output Serial Port Id 
91
 
    unsigned short int  PcmOutSlotB;        // B side PCM Output Time Slot 
92
 
    GpakToneTypes       ToneTypesA;         // A side Tone Detect Types
93
 
    GpakToneTypes       ToneTypesB;         // B side Tone Detect Types
94
 
    GpakActivation      EcanEnableA;        // Echo Cancel A Enabled
95
 
    GpakActivation      EcanEnableB;        // Echo Cancel B Enabled
96
 
    GpakEcanParms_t     EcanParametersA;    // Echo Cancel parameters 
97
 
    GpakEcanParms_t     EcanParametersB;    // Echo Cancel parameters 
98
 
    GpakCompandModes    SoftwareCompand;    // software companding
99
 
    GpakRate_t          FrameRate;          // Gpak Frame Rate 
100
 
    GpakActivation      MuteToneA;          // A side mute DTMF Enabled
101
 
    GpakActivation      MuteToneB;          // B side mute DTMF Enabled
102
 
    GpakActivation      FaxCngDetA;         // A side FaxCng Tone Detector Enabled
103
 
    GpakActivation      FaxCngDetB;         // B side FaxCng Tone Detector Enabled
104
 
 
105
 
} GpakChannelConfig_t;
106
 
 
107
 
 
108
 
/* Definition of a Serial Port Configuration Structure */
109
 
typedef struct
110
 
{
111
 
    GpakSlotCfg_t SlotsSelect1;         // port 1 Slot selection
112
 
    unsigned short int FirstBlockNum1;  // port 1 first group Block Number
113
 
    unsigned short int FirstSlotMask1;  // port 1 first group Slot Mask
114
 
    unsigned short int SecBlockNum1;    // port 1 second group Block Number
115
 
    unsigned short int SecSlotMask1;    // port 1 second group Slot Mask
116
 
 
117
 
    GpakSerWordSize_t  SerialWordSize1; // port 1 serial word size 
118
 
    GpakCompandModes   CompandingMode1; // port 1 companding mode
119
 
    GpakSerFrameSyncPol_t TxFrameSyncPolarity1; // port 1 Tx Frame Sync Polarity
120
 
    GpakSerFrameSyncPol_t RxFrameSyncPolarity1; // port 1 Rx Frame Sync Polarity
121
 
    GpakSerClockPol_t  TxClockPolarity1;        // port 1 Tx Clock Polarity
122
 
    GpakSerClockPol_t  RxClockPolarity1;        // port 1 Rx Clock Polarity
123
 
    GpakSerDataDelay_t TxDataDelay1;            // port 1 Tx data delay
124
 
    GpakSerDataDelay_t RxDataDelay1;            // port 1 Rx data delay
125
 
    GpakActivation     DxDelay1;                // port 1 DX Delay
126
 
 
127
 
    unsigned short int ThirdSlotMask1;  // port 1 3rd group Slot Mask
128
 
    unsigned short int FouthSlotMask1;  // port 1 4th group Slot Mask
129
 
    unsigned short int FifthSlotMask1;  // port 1 5th group Slot Mask
130
 
    unsigned short int SixthSlotMask1;  // port 1 6th group Slot Mask
131
 
    unsigned short int SevenSlotMask1;  // port 1 7th group Slot Mask
132
 
    unsigned short int EightSlotMask1;  // port 1 8th group Slot Mask
133
 
 
134
 
 
135
 
    GpakSlotCfg_t SlotsSelect2;         // port 2 Slot selection
136
 
    unsigned short int FirstBlockNum2;  // port 2 first group Block Number
137
 
    unsigned short int FirstSlotMask2;  // port 2 first group Slot Mask
138
 
    unsigned short int SecBlockNum2;    // port 2 second group Block Number
139
 
    unsigned short int SecSlotMask2;    // port 2 second group Slot Mask
140
 
    GpakSerWordSize_t  SerialWordSize2; // port 2 serial word size 
141
 
    GpakCompandModes   CompandingMode2; // port 2 companding mode
142
 
    GpakSerFrameSyncPol_t TxFrameSyncPolarity2; // port 2 Tx Frame Sync Polarity
143
 
    GpakSerFrameSyncPol_t RxFrameSyncPolarity2; // port 2 Rx Frame Sync Polarity
144
 
    GpakSerClockPol_t  TxClockPolarity2;        // port 2 Tx Clock Polarity
145
 
    GpakSerClockPol_t  RxClockPolarity2;        // port 2 Rx Clock Polarity
146
 
    GpakSerDataDelay_t TxDataDelay2;            // port 2 Tx data delay
147
 
    GpakSerDataDelay_t RxDataDelay2;            // port 2 Rx data delay
148
 
    GpakActivation     DxDelay2;                // port 2 DX Delay
149
 
    
150
 
    unsigned short int ThirdSlotMask2;  // port 2 3rd group Slot Mask
151
 
    unsigned short int FouthSlotMask2;  // port 2 4th group Slot Mask
152
 
    unsigned short int FifthSlotMask2;  // port 2 5th group Slot Mask
153
 
    unsigned short int SixthSlotMask2;  // port 2 6th group Slot Mask
154
 
    unsigned short int SevenSlotMask2;  // port 2 7th group Slot Mask
155
 
    unsigned short int EightSlotMask2;  // port 2 8th group Slot Mask
156
 
 
157
 
    GpakSlotCfg_t SlotsSelect3;         // port 3 Slot selection
158
 
    unsigned short int FirstBlockNum3;  // port 3 first group Block Number
159
 
    unsigned short int FirstSlotMask3;  // port 3 first group Slot Mask
160
 
    unsigned short int SecBlockNum3;    // port 3 second group Block Number
161
 
    unsigned short int SecSlotMask3;    // port 3 second group Slot Mask
162
 
    GpakSerWordSize_t  SerialWordSize3; // port 3 serial word size 
163
 
    GpakCompandModes   CompandingMode3; // port 3 companding mode
164
 
    GpakSerFrameSyncPol_t TxFrameSyncPolarity3; // port 3 Tx Frame Sync Polarity
165
 
    GpakSerFrameSyncPol_t RxFrameSyncPolarity3; // port 3 Rx Frame Sync Polarity
166
 
    GpakSerClockPol_t  TxClockPolarity3;        // port 3 Tx Clock Polarity
167
 
    GpakSerClockPol_t  RxClockPolarity3;        // port 3 Rx Clock Polarity
168
 
    GpakSerDataDelay_t TxDataDelay3;            // port 3 Tx data delay
169
 
    GpakSerDataDelay_t RxDataDelay3;            // port 3 Rx data delay
170
 
    GpakActivation     DxDelay3;                // port 3 DX Delay
171
 
 
172
 
    unsigned short int ThirdSlotMask3;  // port 3 3rd group Slot Mask
173
 
    unsigned short int FouthSlotMask3;  // port 3 4th group Slot Mask
174
 
    unsigned short int FifthSlotMask3;  // port 3 5th group Slot Mask
175
 
    unsigned short int SixthSlotMask3;  // port 3 6th group Slot Mask
176
 
    unsigned short int SevenSlotMask3;  // port 3 7th group Slot Mask
177
 
    unsigned short int EightSlotMask3;  // port 3 8th group Slot Mask
178
 
 
179
 
} GpakPortConfig_t;
180
 
 
181
 
/* Definition of a Tone Generation Parameter Structure */
182
 
/*
183
 
typedef struct
184
 
{
185
 
    GpakToneGenType_t ToneType;         // Tone Type
186
 
    unsigned short int Frequency[4];    // Frequency (Hz)
187
 
    short int Level[4];                 // Frequency's Level (1 dBm)
188
 
    unsigned short int OnTime[4];       // On Times (msecs)
189
 
    unsigned short int OffTime[4];      // Off Times (msecs)
190
 
} GpakToneGenParms_t;
191
 
*/
192
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
193
 
 
194
 
/* gpakConfigureChannel return status. */
195
 
typedef enum
196
 
{
197
 
    CcsSuccess = 0,           /* Channel Configured successfully */
198
 
    CcsParmError = 1,         /* Channel Config Parameter error */
199
 
    CcsInvalidChannel = 2,    /* invalid channel */
200
 
    CcsInvalidDsp = 3,        /* invalid DSP */
201
 
    CcsDspCommFailure = 4     /* failed to communicate with DSP */
202
 
} gpakConfigChanStatus_t;
203
 
 
204
 
/*
205
 
 * gpakConfigureChannel - Configure a DSP's Channel.
206
 
 *
207
 
 * FUNCTION
208
 
 *  This function configures a DSP's Channel.
209
 
 *
210
 
 * RETURNS
211
 
 *  Status code indicating success or a specific error.
212
 
 *
213
 
 */
214
 
extern gpakConfigChanStatus_t gpakConfigureChannel(
215
 
    unsigned short int      DspId,       // DSP identifier
216
 
    unsigned short int      ChannelId,   // channel identifier
217
 
    GpakChanType            ChannelType, // channel type
218
 
    GpakChannelConfig_t     *pChanConfig, // pointer to channel config info 
219
 
    GPAK_ChannelConfigStat_t *pStatus    // pointer to Channel Config Status
220
 
    );
221
 
 
222
 
 
223
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
224
 
 
225
 
/* gpakTearDownChannel return status. */
226
 
typedef enum
227
 
{
228
 
    TdsSuccess = 0,         /* Channel Tear Down successful */
229
 
    TdsError = 1,           /* Channel Tear Down error */
230
 
    TdsInvalidChannel = 2,  /* invalid channel */
231
 
    TdsInvalidDsp = 3,      /* invalid DSP */
232
 
    TdsDspCommFailure = 4   /* failed to communicate with DSP */
233
 
} gpakTearDownStatus_t;
234
 
 
235
 
/*
236
 
 * gpakTearDownChannel - Tear Down a DSP's Channel.
237
 
 *
238
 
 * FUNCTION
239
 
 *  This function tears down a DSP's Channel.
240
 
 *
241
 
 * RETURNS
242
 
 *  Status code indicating success or a specific error.
243
 
 *
244
 
 */
245
 
 
246
 
extern gpakTearDownStatus_t gpakTearDownChannel(
247
 
    unsigned short int      DspId,      // DSP identifier
248
 
    unsigned short int      ChannelId,  // channel identifier
249
 
    GPAK_TearDownChanStat_t *pStatus    // pointer to Tear Down Status
250
 
    );
251
 
 
252
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
253
 
 
254
 
/* gpakAlgControl return status. */
255
 
typedef enum
256
 
{
257
 
    AcSuccess = 0,         /* control successful */
258
 
    AcInvalidChannel = 1,  /* invalid channel identifier */
259
 
    AcInvalidDsp = 2,      /* invalid DSP */
260
 
    AcParmError = 3,       /* invalid control parameter */
261
 
    AcDspCommFailure = 4   /* failed to communicate with DSP */
262
 
} gpakAlgControlStat_t;
263
 
 
264
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
265
 
 * gpakAlgControl - Control an Algorithm.
266
 
 *
267
 
 * FUNCTION
268
 
 *  This function controls an Algorithm
269
 
 *
270
 
 * RETURNS
271
 
 *  Status code indicating success or a specific error.
272
 
 *
273
 
 */
274
 
extern gpakAlgControlStat_t gpakAlgControl(
275
 
    unsigned short int  DspId,          // DSP identifier
276
 
    unsigned short int  ChannelId,              // channel identifier
277
 
    GpakAlgCtrl_t       ControlCode,    // algorithm control code
278
 
    GPAK_AlgControlStat_t *pStatus      // pointer to return status
279
 
    );
280
 
 
281
 
 
282
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
283
 
 
284
 
/* gpakConfigurePorts return status. */
285
 
typedef enum
286
 
{
287
 
    CpsSuccess = 0,         /* Serial Ports configured successfully */
288
 
    CpsParmError = 1,       /* Configure Ports Parameter error */
289
 
    CpsInvalidDsp = 2,      /* invalid DSP */
290
 
    CpsDspCommFailure = 3   /* failed to communicate with DSP */
291
 
} gpakConfigPortStatus_t;
292
 
 
293
 
/*
294
 
 * gpakConfigurePorts - Configure a DSP's serial ports.
295
 
 *
296
 
 * FUNCTION
297
 
 *  This function configures a DSP's serial ports.
298
 
 *
299
 
 * RETURNS
300
 
 *  Status code indicating success or a specific error.
301
 
 *
302
 
 */
303
 
extern gpakConfigPortStatus_t gpakConfigurePorts(
304
 
    unsigned short int DspId,           // DSP identifier
305
 
    GpakPortConfig_t   *pPortConfig,     // pointer to Port Config info
306
 
    GPAK_PortConfigStat_t *pStatus      // pointer to Port Config Status
307
 
    );
308
 
 
309
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
310
 
 
311
 
/* gpakDownloadDsp return status. */
312
 
typedef enum
313
 
{
314
 
    GdlSuccess = 0,         /* DSP download successful */
315
 
    GdlFileReadError = 1,   /* error reading Download file */
316
 
    GdlInvalidFile = 2,     /* invalid Download file content */
317
 
    GdlInvalidDsp = 3       /* invalid DSP */
318
 
} gpakDownloadStatus_t;
319
 
 
320
 
/*
321
 
 * gpakDownloadDsp - Download a DSP's Program and initialized Data memory.
322
 
 *
323
 
 * FUNCTION
324
 
 *  This function reads a DSP's Program and Data memory image from the
325
 
 *  specified file and writes the image to the DSP's memory.
326
 
 *
327
 
 * RETURNS
328
 
 *  Status code indicating success or a specific error.
329
 
 *
330
 
 */
331
 
extern gpakDownloadStatus_t gpakDownloadDsp(
332
 
    unsigned short int  DspId,  // DSP identifier
333
 
    GPAK_FILE_ID        FileId  // G.PAK download file identifier
334
 
    );
335
 
 
336
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
337
 
 
338
 
/* gpakReadEventFIFOMessage return status */
339
 
typedef enum
340
 
{
341
 
    RefEventAvail = 0,       /* an event was successfully read from the fifo */
342
 
    RefNoEventAvail = 1,     /* no event was in the fifo */
343
 
    RefInvalidDsp = 2,       /* invalid DSP identifier */
344
 
    RefInvalidEvent = 3,     /* invalid event */
345
 
    RefDspCommFailure = 4    /* error communicating with DSP */
346
 
} gpakReadEventFIFOMessageStat_t;
347
 
 
348
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
349
 
 * gpakReadEventFIFOMessage - read from the event fifo
350
 
 * 
351
 
 * FUNCTION
352
 
 *  This function reads a single event from the event fifo if one is available
353
 
 * 
354
 
 * RETURNS
355
 
 *  Status  code indicating success or a specific error.
356
 
 *
357
 
 * Note: This function should be called in a loop until the return status 
358
 
 *       indicates that the fifo is empty.
359
 
 */
360
 
extern gpakReadEventFIFOMessageStat_t gpakReadEventFIFOMessage(
361
 
    unsigned short int      DspId,          // DSP identifier
362
 
    unsigned short int      *pChannelId,    // pointer to channel identifier
363
 
    GpakAsyncEventCode_t    *pEventCode,    // pointer to Event Code
364
 
    GpakAsyncEventData_t    *pEventData     // pointer to Event Data Struct
365
 
    );
366
 
 
367
 
 
368
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
369
 
 
370
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
371
 
 
372
 
/* gpakPingDsp return status values */
373
 
typedef enum
374
 
{
375
 
    PngSuccess = 0,          /* DSP responded successfully */
376
 
    PngInvalidDsp = 1,       /* invalid DSP identifier */
377
 
    PngDspCommFailure = 2       /* error communicating with DSP */
378
 
} gpakPingDspStat_t;
379
 
 
380
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
381
 
 * gpakPingDsp - ping the DSP to see if it's alive
382
 
 * 
383
 
 * FUNCTION
384
 
 *  This function checks if the DSP is still communicating with the host
385
 
 * 
386
 
 * RETURNS
387
 
 *  Status  code indicating success or a specific error.
388
 
 */
389
 
extern gpakPingDspStat_t gpakPingDsp(
390
 
    unsigned short int      DspId,          // DSP identifier
391
 
    unsigned short int      *pDspSwVersion  // DSP software version
392
 
    );
393
 
 
394
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
395
 
 
396
 
/* gpakSerialTxFixedValue return status values */
397
 
typedef enum
398
 
{
399
 
    TfvSuccess = 0,         /* operation successful */
400
 
    TfvInvalidChannel = 1,  /* invalid channel identifier */
401
 
    TfvInvalidDsp = 2,      /* invalid DSP identifier */
402
 
    TfvDspCommFailure = 3   /* failed to communicate with DSP */
403
 
} gpakSerialTxFixedValueStat_t;
404
 
 
405
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
406
 
 * gpakSerialTxFixedValue - transmit a fixed value on a timeslot
407
 
 * 
408
 
 * FUNCTION
409
 
 *  This function controls transmission of a fixed value out onto a serial 
410
 
 *  port's timeslot.
411
 
 * 
412
 
 * RETURNS
413
 
 *  Status  code indicating success or a specific error.
414
 
 */
415
 
extern gpakSerialTxFixedValueStat_t gpakSerialTxFixedValue(
416
 
    unsigned short int      DspId,          // DSP identifier
417
 
    unsigned short int      ChannelId,      // channel identifier
418
 
    GpakSerialPort_t        PcmOutPort,     // PCM Output Serial Port Id
419
 
    unsigned short int      PcmOutSlot,     // PCM Output Time Slot
420
 
    unsigned short int      Value,          // 16-bit value 
421
 
    GpakActivation          State                   // activation state
422
 
    );
423
 
 
424
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
425
 
 
426
 
/* gpakControlTdmLoopBack return status values */
427
 
typedef enum
428
 
{
429
 
    ClbSuccess = 0,         /* operation successful */
430
 
    ClbSerPortInactive = 1, /* serial port is inactive */
431
 
    ClbInvalidDsp = 2,      /* invalid DSP identifier */
432
 
    ClbDspCommFailure = 3   /* failed to communicate with DSP */
433
 
} gpakControlTdmLoopBackStat_t;
434
 
 
435
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
436
 
 * gpakControlTdmLoopBack - control a serial port's loopback state
437
 
 * 
438
 
 * FUNCTION
439
 
 *  This function enables/disables the tdm input to output looback mode on a
440
 
 *  serial port
441
 
 * 
442
 
 * RETURNS
443
 
 *  Status  code indicating success or a specific error.
444
 
 */
445
 
 
446
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
447
 
gpakControlTdmLoopBackStat_t gpakControlTdmLoopBack(
448
 
    unsigned short int      DspId,          // DSP identifier
449
 
    GpakSerialPort_t        SerialPort,     // Serial Port Id
450
 
    GpakActivation          LoopBackState   // Loopback State
451
 
    );
452
 
 
453
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
454
 
 
455
 
/* gpakReadCpuUsage return status values */
456
 
typedef enum
457
 
{
458
 
    RcuSuccess = 0,         /* operation successful */
459
 
    RcuInvalidDsp = 1,      /* invalid DSP identifier */
460
 
    RcuDspCommFailure = 2   /* communication failure */
461
 
} gpakReadCpuUsageStat_t;
462
 
 
463
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
464
 
 * gpakReadCpuUsage - read the cpu usage statistics
465
 
 * 
466
 
 * FUNCTION
467
 
 *  This function reads cpu utilization from the DSP.
468
 
 * 
469
 
 * RETURNS
470
 
 *  Status  code indicating success or a specific error.
471
 
 */
472
 
extern gpakReadCpuUsageStat_t gpakReadCpuUsage(
473
 
    unsigned short int  DspId,              // DSP identifier
474
 
    unsigned short int  *pPeakUsage,        // pointer to peak usage variable
475
 
    unsigned short int  *pPrev1SecPeakUsage // peak usage over previous 1 second
476
 
    );
477
 
 
478
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
479
 
 
480
 
/* gpakResetCpuUsageStats return status values */
481
 
typedef enum
482
 
{
483
 
    RstcSuccess = 0,         /* operation successful */
484
 
    RstcInvalidDsp = 1,      /* invalid DSP identifier */
485
 
    RstcDspCommFailure = 2   /* communication failure */
486
 
} gpakResetCpuUsageStat_t;
487
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
488
 
 * gpakResetCpuUsageStats - reset the cpu usage statistics
489
 
 * 
490
 
 * FUNCTION
491
 
 *  This function resets the cpu utilization statistics
492
 
 * 
493
 
 * RETURNS
494
 
 *  Status  code indicating success or a specific error.
495
 
 */
496
 
extern gpakResetCpuUsageStat_t gpakResetCpuUsageStats(
497
 
    unsigned short int  DspId              // DSP identifier
498
 
    );
499
 
 
500
 
 
501
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
502
 
 
503
 
/* gpakReadFramingStats return status values */
504
 
typedef enum
505
 
{
506
 
    RfsSuccess = 0,         /* operation successful */
507
 
    RfsInvalidDsp = 1,      /* invalid DSP identifier */
508
 
    RfsDspCommFailure = 2   /* communication failure */
509
 
} gpakReadFramingStatsStatus_t;
510
 
 
511
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
512
 
 * gpakReadFramingStats
513
 
 * 
514
 
 * FUNCTION
515
 
 *  This function reads a DSP's framing interrupt statistics
516
 
 * 
517
 
 * RETURNS
518
 
 *  Status  code indicating success or a specific error.
519
 
 */
520
 
extern gpakReadFramingStatsStatus_t gpakReadFramingStats(
521
 
    unsigned short int  DspId,                // DSP identifier
522
 
    unsigned short int  *pFramingError1Count, // port 1 Framing error count
523
 
    unsigned short int  *pFramingError2Count, // port 2 Framing error count
524
 
    unsigned short int  *pFramingError3Count, // port 3 Framing error count
525
 
    unsigned short int  *pDmaStopErrorCount,   // DMA-stoppage error count
526
 
    unsigned short int  *pDmaSlipStatsBuffer   // DMA slips count
527
 
    );
528
 
 
529
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
530
 
 
531
 
/* gpakResetFramingStats return values */
532
 
typedef enum
533
 
{
534
 
    RstfSuccess = 0,         /* operation successful */
535
 
    RstfInvalidDsp = 1,      /* invalid DSP identifier */
536
 
    RstfDspCommFailure = 2   /* communication failure */
537
 
} gpakResetFramingStatsStatus_t;
538
 
 
539
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
540
 
 * gpakResetFramingStats - reset a DSP's framing interrupt statistics
541
 
 * 
542
 
 * FUNCTION
543
 
 *  This function resets a DSP's framing interrupt statistics
544
 
 * 
545
 
 * RETURNS
546
 
 *  Status  code indicating success or a specific error.
547
 
 */
548
 
extern gpakResetFramingStatsStatus_t gpakResetFramingStats(
549
 
    unsigned short int      DspId          // DSP identifier
550
 
    );
551
 
 
552
 
 
553
 
typedef enum
554
 
{
555
 
        RmmSuccess =0,
556
 
        RmmInvalidDsp = 1,
557
 
        RmmSizeTooBig = 2,
558
 
        RmmFailure = 3,
559
 
        RmmInvalidAddress = 4
560
 
        
561
 
} gpakReadDSPMemoryStat_t;
562
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
563
 
 * gpakResetFramingStats - read a section of DSP memory
564
 
 *                         to get access DSP registers, since 0x00--0x60 not HPI-accessable
565
 
 * 
566
 
 * FUNCTION
567
 
 *  This function resets a DSP's framing interrupt statistics
568
 
 * 
569
 
 * RETURNS
570
 
 *  Status  code indicating success or a specific error.
571
 
 */
572
 
 
573
 
extern gpakReadDSPMemoryStat_t gpakReadDSPMemoryMap(
574
 
    unsigned short int  DspId,         // Dsp Identifier
575
 
    unsigned short int  *pDest,        // Buffer on host to hold DSP memory map
576
 
        DSP_ADDRESS BufrBaseAddress,       // DSP memory users want to read out
577
 
    unsigned short int   MemoryLength_Word16 // Length of memory section read out, unit is 16-bit word
578
 
    );
579
 
 
580
 
typedef enum
581
 
{
582
 
        GPIOSuccess =0,
583
 
        GPIOInvalidDsp = 1,
584
 
        GPIODspCommFailure = 2
585
 
}gpakAccessGPIOStat_t;
586
 
 
587
 
extern gpakAccessGPIOStat_t gpakAccessGPIO(
588
 
    unsigned short int      DspId,          // DSP identifier
589
 
        GpakGPIOCotrol_t        gpakControlGPIO,// select oeration, changeDIR/write/read
590
 
    unsigned short int      *pGPIOValue  // pointer for the read/write value or DIR mask
591
 
    );
592
 
 
593
 
/* gpakWriteSystemParms return status. */
594
 
typedef enum
595
 
{
596
 
    WspSuccess = 0,         /* System Parameters written successfully */
597
 
    WspParmError = 1,       /* Write System Parms's Parameter error */
598
 
    WspInvalidDsp = 2,      /* invalid DSP */
599
 
    WspDspCommFailure = 3   /* failed to communicate with DSP */
600
 
} gpakWriteSysParmsStatus_t;
601
 
 
602
 
/* Definition of a System Parameters information structure. */
603
 
typedef struct
604
 
{
605
 
    /* DTMF Parameters */
606
 
    short int MinSigLevel;      /* 0 = Disabled, Min Sig Power Level for detection */
607
 
    short int SNRFlag;          /* 0 = Disabled, relax SNR tolerances */
608
 
    short int FreqDeviation;    /* 0 = Disabled, X Percent Deviation times 10 (e.g. 1.7% is entered as 17) */
609
 
    short int DtmfFwdTwist;     /* 0 to 8 db */
610
 
    short int DtmfRevTwist;     /* 0 to 8 db */
611
 
 
612
 
        short int DtmfValidityMask; /* This flag allows users to relax the trailing conditions of the tone */
613
 
 
614
 
} GpakSystemParms_t;
615
 
/* gpakReadSystemParms return status. */
616
 
typedef enum
617
 
{
618
 
    RspSuccess = 0,         /* System Parameters read successfully */
619
 
    RspInvalidDsp = 1,      /* invalid DSP */
620
 
    RspDspCommFailure = 2   /* failed to communicate with DSP */
621
 
} gpakReadSysParmsStatus_t;
622
 
 
623
 
extern gpakReadSysParmsStatus_t gpakReadSystemParms(
624
 
    unsigned short int      DspId,  // DSP identifier
625
 
    GpakSystemParms_t *pSysParms    /* pointer to System Parms info var */
626
 
    );
627
 
 
628
 
extern gpakWriteSysParmsStatus_t gpakWriteSystemParms(
629
 
    unsigned short int      DspId,  // DSP identifier
630
 
    GpakSystemParms_t *pSysParms,   /* pointer to System Parms info var */
631
 
    unsigned short int UpdateBits, /* input: flags indicating which parms to update */
632
 
    GPAK_SysParmsStat_t *pStatus    /* pointer to Write System Parms Status */
633
 
    );
634
 
 
635
 
#endif // end multiple inclusion
636