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

« back to all changes in this revision

Viewing changes to kernel/wctdm24xxp/GpakCust.h

  • Committer: Bazaar Package Importer
  • Author(s): Tzafrir Cohen
  • Date: 2008-08-28 22:58:23 UTC
  • mfrom: (11.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080828225823-r8bdunirm8hmc76m
Tags: 1:1.4.11~dfsg-2
* Patch xpp_fxs_power: Fixed an issue with hook detection of the Astribank
  FXS module.
* Don't fail init.d script if fxotune fails. This may happen if running it
  when Asterisk is already running.
* Bump standards version to 3.8.0.0 .
* Ignore false lintian warning ("m-a a-i" has "a a").
* Patch xpp_fxo_cid_always: do always pass PCM if that's what the user
  asked.
* Patch vzaphfc_proc_root_dir: fix vzaphfc on 2.6.26.
* Patch wcte12xp_flags: Proper time for irq save flags.
* Patch headers_2627: Fix location of semaphore.h for 2.6.27 .
* Patch xpp_fxs_dtmf_leak: Don't play DTMFs to the wrong channel.
* Patch wctdm_fix_alarm: Fix sending channel alarms.
* Patch device_class_2626: Fix building 2.6.26 (Closes: #493397).
* Using dh_lintian for lintian overrides, hence requiring debhelper 6.0.7.
* Lintian: we know we have direct changes. Too bad we're half-upstream :-(
* Fix doc-base section names. 

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: GpakCust.h
 
5
 *
 
6
 * Description:
 
7
 *   This file contains host system dependent definitions and prototypes of
 
8
 *   functions to support generic G.PAK API functions. The file is used when
 
9
 *   integrating G.PAK API functions in a specific host processor environment.
 
10
 *
 
11
 *   Note: This file may need to be modified by the G.PAK system integrator.
 
12
 *
 
13
 * Version: 1.0
 
14
 *
 
15
 * Revision History:
 
16
 *   06/15/05 - Initial release.
 
17
 *
 
18
 * This program has been released under the terms of the GPL version 2 by
 
19
 * permission of Adaptive Digital Technologies, Inc.  The standard
 
20
 * GPL disclaimer is given inline below for your convenience.
 
21
 *
 
22
 * This program is free software; you can redistribute it and/or modify
 
23
 * it under the terms of the GNU General Public License as published by
 
24
 * the Free Software Foundation; either version 2 of the License, or
 
25
 * (at your option) any later version.
 
26
 * 
 
27
 * This program is distributed in the hope that it will be useful,
 
28
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
30
 * GNU General Public License for more details.
 
31
 * 
 
32
 * You should have received a copy of the GNU General Public License
 
33
 * along with this program; if not, write to the Free Software
 
34
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
 
35
 */
 
36
 
 
37
#ifndef _GPAKCUST_H  /* prevent multiple inclusion */
 
38
#define _GPAKCUST_H
 
39
 
 
40
#include "wctdm24xxp.h"
 
41
#ifdef VPM150M_SUPPORT
 
42
#include <linux/device.h>
 
43
#include <linux/firmware.h>
 
44
#endif
 
45
#include "gpakenum.h"
 
46
 
 
47
 
 
48
struct wctdm_firmware {
 
49
        const struct firmware *fw;
 
50
        unsigned int offset;
 
51
};
 
52
 
 
53
/* Host and DSP system dependent related definitions. */
 
54
#define MAX_DSP_CORES 128                 /* maximum number of DSP cores */
 
55
//#define MAX_CONFS 1                     /* maximum number of conferences */
 
56
//#define MAX_PKT_CHANNELS 8              /* maximum number of packet channels */
 
57
#define MAX_CHANNELS 32                  /* maximum number of channels */
 
58
#define MAX_WAIT_LOOPS 50               /* max number of wait delay loops */
 
59
#define DSP_IFBLK_ADDRESS 0x0100        /* DSP address of I/F block pointer */
 
60
#define DOWNLOAD_BLOCK_SIZE 512         /* download block size (DSP words) */
 
61
//#define MAX_CIDPAYLOAD_BYTES 512        /* max size of a CID payload (octets) */
 
62
typedef unsigned short DSP_WORD;    /* 16 bit DSP word */
 
63
typedef unsigned int DSP_ADDRESS;  /* 32 bit DSP address */
 
64
typedef struct wctdm_firmware* GPAK_FILE_ID; /* G.PAK Download file identifier */
 
65
 
 
66
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
67
 * gpakReadDspMemory - Read DSP memory.
 
68
 *
 
69
 * FUNCTION
 
70
 *  This function reads a contiguous block of words from DSP memory starting at
 
71
 *  the specified address.
 
72
 *
 
73
 * RETURNS
 
74
 *  nothing
 
75
 *
 
76
 */
 
77
extern void gpakReadDspMemory(
 
78
    unsigned short int DspId,   /* DSP Identifier (0 to MAX_DSP_CORES-1) */
 
79
    DSP_ADDRESS DspAddress,     /* DSP's memory address of first word */
 
80
    unsigned int NumWords,      /* number of contiguous words to read */
 
81
    DSP_WORD *pWordValues       /* pointer to array of word values variable */
 
82
    );
 
83
 
 
84
 
 
85
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
86
 * gpakWriteDspMemory - Write DSP memory.
 
87
 *
 
88
 * FUNCTION
 
89
 *  This function writes a contiguous block of words to DSP memory starting at
 
90
 *  the specified address.
 
91
 *
 
92
 * RETURNS
 
93
 *  nothing
 
94
 *
 
95
 */
 
96
extern void gpakWriteDspMemory(
 
97
    unsigned short int DspId,   /* DSP Identifier (0 to MAX_DSP_CORES-1) */
 
98
    DSP_ADDRESS DspAddress,     /* DSP's memory address of first word */
 
99
    unsigned int NumWords,      /* number of contiguous words to write */
 
100
    DSP_WORD *pWordValues       /* pointer to array of word values to write */
 
101
    );
 
102
 
 
103
 
 
104
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
105
 * gpakHostDelay - Delay for a fixed time interval.
 
106
 *
 
107
 * FUNCTION
 
108
 *  This function delays for a fixed time interval before returning. The time
 
109
 *  interval is the Host Port Interface sampling period when polling a DSP for
 
110
 *  replies to command messages.
 
111
 *
 
112
 * RETURNS
 
113
 *  nothing
 
114
 *
 
115
 */
 
116
extern void gpakHostDelay(void);
 
117
 
 
118
 
 
119
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
120
 * gpakLockAccess - Lock access to the specified DSP.
 
121
 *
 
122
 * FUNCTION
 
123
 *  This function aquires exclusive access to the specified DSP.
 
124
 *
 
125
 * RETURNS
 
126
 *  nothing
 
127
 *
 
128
 */
 
129
extern void gpakLockAccess(
 
130
    unsigned short int DspId      /* DSP Identifier (0 to MAX_DSP_CORES-1) */
 
131
    );
 
132
 
 
133
 
 
134
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
135
 * gpakUnlockAccess - Unlock access to the specified DSP.
 
136
 *
 
137
 * FUNCTION
 
138
 *  This function releases exclusive access to the specified DSP.
 
139
 *
 
140
 * RETURNS
 
141
 *  nothing
 
142
 *
 
143
 */
 
144
extern void gpakUnlockAccess(
 
145
    unsigned short int DspId       /* DSP Identifier (0 to MAX_DSP_CORES-1) */
 
146
    );
 
147
 
 
148
 
 
149
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
150
 * gpakReadFile - Read a block of bytes from a G.PAK Download file.
 
151
 *
 
152
 * FUNCTION
 
153
 *  This function reads a contiguous block of bytes from a G.PAK Download file
 
154
 *  starting at the current file position.
 
155
 *
 
156
 * RETURNS
 
157
 *  The number of bytes read from the file.
 
158
 *   -1 indicates an error occurred.
 
159
 *    0 indicates all bytes have been read (end of file)
 
160
 *
 
161
 */
 
162
extern int gpakReadFile(
 
163
    GPAK_FILE_ID FileId,        /* G.PAK Download File Identifier */
 
164
    unsigned char *pBuffer,         /* pointer to buffer for storing bytes */
 
165
    unsigned int NumBytes       /* number of bytes to read */
 
166
    );
 
167
 
 
168
 
 
169
unsigned char wctdm_vpm150m_getpage(struct wctdm *wc);
 
170
 
 
171
int wctdm_vpm150m_setpage(struct wctdm *wc, unsigned short addr);
 
172
 
 
173
int wctdm_vpm150m_setreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data);
 
174
 
 
175
unsigned short wctdm_vpm150m_getreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data);
 
176
 
 
177
char vpm150mtone_to_zaptone(GpakToneCodes_t tone);
 
178
 
 
179
#endif  /* prevent multiple inclusion */
 
180
 
 
181