Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
io.h
Go to the documentation of this file.
1 
2 /*
3  *
4  Copyright (c) Eicon Networks, 2002.
5  *
6  This source file is supplied for the use with
7  Eicon Networks range of DIVA Server Adapters.
8  *
9  Eicon File Revision : 2.1
10  *
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2, or (at your option)
14  any later version.
15  *
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
18  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  See the GNU General Public License for more details.
20  *
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  *
25  */
26 #ifndef __DIVA_XDI_COMMON_IO_H_INC__ /* { */
27 #define __DIVA_XDI_COMMON_IO_H_INC__
28 /*
29  maximum = 16 adapters
30 */
31 #define DI_MAX_LINKS MAX_ADAPTER
32 #define ISDN_MAX_NUM_LEN 60
33 /* --------------------------------------------------------------------------
34  structure for quadro card management (obsolete for
35  systems that do provide per card load event)
36  -------------------------------------------------------------------------- */
37 typedef struct {
39  DEVICE_NAME DeviceName[4];
40  PISDN_ADAPTER QuadroAdapter[4];
42 /* --------------------------------------------------------------------------
43  Special OS memory support structures
44  -------------------------------------------------------------------------- */
45 #define MAX_MAPPED_ENTRIES 8
46 typedef struct {
47  void *Address;
50 /* --------------------------------------------------------------------------
51  Configuration of XDI clients carried by XDI
52  -------------------------------------------------------------------------- */
53 #define DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON 0x01
54 #define DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON 0x02
55 typedef struct _diva_xdi_capi_cfg {
58 /* --------------------------------------------------------------------------
59  Main data structure kept per adapter
60  -------------------------------------------------------------------------- */
61 struct _ISDN_ADAPTER {
63  int State; /* from NT4 1.srv, a good idea, but a poor achievement */
66  int Unavailable; /* callback function possible? */
71  char ProtocolIdString[80];
72  /*
73  remember mapped memory areas
74  */
78  dword protocol_id; /* configured protocol identifier */
79  char protocol_name[8]; /* readable name of protocol */
84  dword ControllerNumber; /* for QUADRO cards only */
85  PISDN_ADAPTER MultiMaster; /* for 4-BRI card only - use MultiMaster or QuadroList */
86  PADAPTER_LIST_ENTRY QuadroList; /* for QUADRO card only */
90  dword volatile IrqCount;
91  int trapped;
95  dword DspCodeBaseAddrTable[4]; /* add. for MultiMaster */
96  dword MaxDspCodeSizeTable[4]; /* add. for MultiMaster */
97  dword downloadAddrTable[4]; /* add. for MultiMaster */
109  struct pc_maint *pcm;
111  byte Name[32];
114  dword ArchiveType; /* ARCHIVE_TYPE_NONE ..._SINGLE ..._USGEN ..._MULTI */
115  char *ProtocolSuffix; /* internal protocolfile table */
116  char Archive[32];
117  char Protocol[32];
118  char AddDownload[32]; /* Dsp- or other additional download files */
126  byte BriLayer2LinkCount; /* amount of TEI's that adapter will support in P2MP mode */
133  dword BChMask; /* B channel mask for unchannelized modes */
137  dword ForceLaw; /* VoiceCoding - default:0, a-law: 1, my-law: 2 */
143  dword L1TristateOrQsig; /* enable Layer 1 Tristate (bit 2)Or Qsig params (bit 0,1)*/
169  byte TxAttenuation; /* PRI/E1 only: attenuate TX signal */
183  byte *PcCfgBufferFile;/* flexible parameter via file */
184  byte *PcCfgBuffer; /* flexible parameter via multistring */
185  diva_os_dump_file_t dump_file; /* dump memory to file at lowest irq level */
186  diva_os_board_trace_t board_trace; /* traces from the board */
192  PBUFFER RBuffer; /* Copy of receive lookahead buffer */
196  word assign; /* list of pending ASSIGNs */
197  word head; /* head of request queue */
198  word tail; /* tail of request queue */
199  ADAPTER a; /* not a separate structure */
215  dword sdram_bar; /* must be 32 bit */
217  volatile int pcm_pending;
218  volatile void *pcm_data;
221  void *dma_map;
227 };
228 /* ---------------------------------------------------------------------
229  Entity table
230  --------------------------------------------------------------------- */
231 struct e_info_s {
233  byte next; /* chaining index */
234  word assign_ref; /* assign reference */
235 };
236 /* ---------------------------------------------------------------------
237  S-cards shared ram structure for loading
238  --------------------------------------------------------------------- */
239 struct s_load {
249  byte fill[224];
250  byte b[256];
251 };
252 #define PR_RAM ((struct pr_ram *)0)
253 #define RAM ((struct dual *)0)
254 /* ---------------------------------------------------------------------
255  platform specific conversions
256  --------------------------------------------------------------------- */
257 extern void *PTR_P(ADAPTER *a, ENTITY *e, void *P);
258 extern void *PTR_X(ADAPTER *a, ENTITY *e);
259 extern void *PTR_R(ADAPTER *a, ENTITY *e);
260 extern void CALLBACK(ADAPTER *a, ENTITY *e);
261 extern void set_ram(void **adr_ptr);
262 /* ---------------------------------------------------------------------
263  ram access functions for io mapped cards
264  --------------------------------------------------------------------- */
265 byte io_in(ADAPTER *a, void *adr);
266 word io_inw(ADAPTER *a, void *adr);
267 void io_in_buffer(ADAPTER *a, void *adr, void *P, word length);
268 void io_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
269 void io_out(ADAPTER *a, void *adr, byte data);
270 void io_outw(ADAPTER *a, void *adr, word data);
271 void io_out_buffer(ADAPTER *a, void *adr, void *P, word length);
272 void io_inc(ADAPTER *a, void *adr);
273 void bri_in_buffer(PISDN_ADAPTER IoAdapter, dword Pos,
274  void *Buf, dword Len);
275 int bri_out_buffer(PISDN_ADAPTER IoAdapter, dword Pos,
276  void *Buf, dword Len, int Verify);
277 /* ---------------------------------------------------------------------
278  ram access functions for memory mapped cards
279  --------------------------------------------------------------------- */
280 byte mem_in(ADAPTER *a, void *adr);
281 word mem_inw(ADAPTER *a, void *adr);
282 void mem_in_buffer(ADAPTER *a, void *adr, void *P, word length);
283 void mem_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
284 void mem_out(ADAPTER *a, void *adr, byte data);
285 void mem_outw(ADAPTER *a, void *adr, word data);
286 void mem_out_buffer(ADAPTER *a, void *adr, void *P, word length);
287 void mem_inc(ADAPTER *a, void *adr);
288 void mem_in_dw(ADAPTER *a, void *addr, dword *data, int dwords);
289 void mem_out_dw(ADAPTER *a, void *addr, const dword *data, int dwords);
290 /* ---------------------------------------------------------------------
291  functions exported by io.c
292  --------------------------------------------------------------------- */
294 extern void DIDpcRoutine(struct _diva_os_soft_isr *psoft_isr,
295  void *context);
296 extern void request(PISDN_ADAPTER, ENTITY *);
297 /* ---------------------------------------------------------------------
298  trapFn helpers, used to recover debug trace from dead card
299  --------------------------------------------------------------------- */
300 typedef struct {
304 } Xdesc;
305 extern void dump_trap_frame(PISDN_ADAPTER IoAdapter, byte __iomem *exception);
306 extern void dump_xlog_buffer(PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc);
307 /* --------------------------------------------------------------------- */
308 #endif /* } __DIVA_XDI_COMMON_IO_H_INC__ */