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

« back to all changes in this revision

Viewing changes to drivers/dahdi/wctdm24xxp/GpakCust.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: 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. 
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 _GPAKCUST_H  /* prevent multiple inclusion */
37
 
#define _GPAKCUST_H
38
 
 
39
 
#include "wctdm24xxp.h"
40
 
#ifdef VPM150M_SUPPORT
41
 
#include <linux/device.h>
42
 
#include <linux/firmware.h>
43
 
#endif
44
 
#include "gpakenum.h"
45
 
 
46
 
 
47
 
struct wctdm_firmware {
48
 
        const struct firmware *fw;
49
 
        unsigned int offset;
50
 
};
51
 
 
52
 
/* Host and DSP system dependent related definitions. */
53
 
#define MAX_DSP_CORES 128                 /* maximum number of DSP cores */
54
 
//#define MAX_CONFS 1                     /* maximum number of conferences */
55
 
//#define MAX_PKT_CHANNELS 8              /* maximum number of packet channels */
56
 
#define MAX_CHANNELS 32                  /* maximum number of channels */
57
 
#define MAX_WAIT_LOOPS 50               /* max number of wait delay loops */
58
 
#define DSP_IFBLK_ADDRESS 0x0100        /* DSP address of I/F block pointer */
59
 
#define DOWNLOAD_BLOCK_SIZE 512         /* download block size (DSP words) */
60
 
//#define MAX_CIDPAYLOAD_BYTES 512        /* max size of a CID payload (octets) */
61
 
typedef unsigned short DSP_WORD;    /* 16 bit DSP word */
62
 
typedef unsigned int DSP_ADDRESS;  /* 32 bit DSP address */
63
 
typedef struct wctdm_firmware* GPAK_FILE_ID; /* G.PAK Download file identifier */
64
 
 
65
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
66
 
 * gpakReadDspMemory - Read DSP memory.
67
 
 *
68
 
 * FUNCTION
69
 
 *  This function reads a contiguous block of words from DSP memory starting at
70
 
 *  the specified address.
71
 
 *
72
 
 * RETURNS
73
 
 *  nothing
74
 
 *
75
 
 */
76
 
extern void gpakReadDspMemory(
77
 
    unsigned short int DspId,   /* DSP Identifier (0 to MAX_DSP_CORES-1) */
78
 
    DSP_ADDRESS DspAddress,     /* DSP's memory address of first word */
79
 
    unsigned int NumWords,      /* number of contiguous words to read */
80
 
    DSP_WORD *pWordValues       /* pointer to array of word values variable */
81
 
    );
82
 
 
83
 
 
84
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
85
 
 * gpakWriteDspMemory - Write DSP memory.
86
 
 *
87
 
 * FUNCTION
88
 
 *  This function writes a contiguous block of words to DSP memory starting at
89
 
 *  the specified address.
90
 
 *
91
 
 * RETURNS
92
 
 *  nothing
93
 
 *
94
 
 */
95
 
extern void gpakWriteDspMemory(
96
 
    unsigned short int DspId,   /* DSP Identifier (0 to MAX_DSP_CORES-1) */
97
 
    DSP_ADDRESS DspAddress,     /* DSP's memory address of first word */
98
 
    unsigned int NumWords,      /* number of contiguous words to write */
99
 
    DSP_WORD *pWordValues       /* pointer to array of word values to write */
100
 
    );
101
 
 
102
 
 
103
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
104
 
 * gpakHostDelay - Delay for a fixed time interval.
105
 
 *
106
 
 * FUNCTION
107
 
 *  This function delays for a fixed time interval before returning. The time
108
 
 *  interval is the Host Port Interface sampling period when polling a DSP for
109
 
 *  replies to command messages.
110
 
 *
111
 
 * RETURNS
112
 
 *  nothing
113
 
 *
114
 
 */
115
 
extern void gpakHostDelay(void);
116
 
 
117
 
 
118
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
119
 
 * gpakLockAccess - Lock access to the specified DSP.
120
 
 *
121
 
 * FUNCTION
122
 
 *  This function aquires exclusive access to the specified DSP.
123
 
 *
124
 
 * RETURNS
125
 
 *  nothing
126
 
 *
127
 
 */
128
 
extern void gpakLockAccess(
129
 
    unsigned short int DspId      /* DSP Identifier (0 to MAX_DSP_CORES-1) */
130
 
    );
131
 
 
132
 
 
133
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
134
 
 * gpakUnlockAccess - Unlock access to the specified DSP.
135
 
 *
136
 
 * FUNCTION
137
 
 *  This function releases exclusive access to the specified DSP.
138
 
 *
139
 
 * RETURNS
140
 
 *  nothing
141
 
 *
142
 
 */
143
 
extern void gpakUnlockAccess(
144
 
    unsigned short int DspId       /* DSP Identifier (0 to MAX_DSP_CORES-1) */
145
 
    );
146
 
 
147
 
 
148
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
149
 
 * gpakReadFile - Read a block of bytes from a G.PAK Download file.
150
 
 *
151
 
 * FUNCTION
152
 
 *  This function reads a contiguous block of bytes from a G.PAK Download file
153
 
 *  starting at the current file position.
154
 
 *
155
 
 * RETURNS
156
 
 *  The number of bytes read from the file.
157
 
 *   -1 indicates an error occurred.
158
 
 *    0 indicates all bytes have been read (end of file)
159
 
 *
160
 
 */
161
 
extern int gpakReadFile(
162
 
    GPAK_FILE_ID FileId,        /* G.PAK Download File Identifier */
163
 
    unsigned char *pBuffer,         /* pointer to buffer for storing bytes */
164
 
    unsigned int NumBytes       /* number of bytes to read */
165
 
    );
166
 
 
167
 
 
168
 
unsigned char wctdm_vpm150m_getpage(struct wctdm *wc);
169
 
 
170
 
int wctdm_vpm150m_setpage(struct wctdm *wc, unsigned short addr);
171
 
 
172
 
int wctdm_vpm150m_setreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data);
173
 
 
174
 
unsigned short wctdm_vpm150m_getreg(struct wctdm *wc, unsigned int len, unsigned int addr, unsigned short *data);
175
 
 
176
 
char vpm150mtone_to_zaptone(GpakToneCodes_t tone);
177
 
 
178
 
#endif  /* prevent multiple inclusion */
179
 
 
180