4 Copyright (c) Eicon Networks, 2002.
6 This source file is supplied for the use with
7 Eicon Networks range of DIVA Server Adapters.
9 Eicon File Revision : 2.1
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)
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.
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.
26 #ifndef __DIVA_XDI_COMMON_IO_H_INC__ /* { */
27 #define __DIVA_XDI_COMMON_IO_H_INC__
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 -------------------------------------------------------------------------- */
39 DEVICE_NAME DeviceName[4] ;
40 PISDN_ADAPTER QuadroAdapter[4] ;
41 } ADAPTER_LIST_ENTRY, *PADAPTER_LIST_ENTRY ;
42 /* --------------------------------------------------------------------------
43 Configuration of XDI clients carried by XDI
44 -------------------------------------------------------------------------- */
45 #define DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON 0x01
46 #define DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON 0x02
47 typedef struct _diva_xdi_capi_cfg {
49 } diva_xdi_capi_cfg_t;
50 /* --------------------------------------------------------------------------
51 Main data structure kept per adapter
52 -------------------------------------------------------------------------- */
53 struct _ISDN_ADAPTER {
54 void (* DIRequest)(PISDN_ADAPTER, ENTITY *) ;
56 int RegisteredWithDidd ;
57 int Unavailable ; /* callback function possible? */
58 int ResourcesClaimed ;
59 int PnpBiosConfigUsed ;
62 char ProtocolIdString[80] ;
64 remember mapped memory areas
66 CARD_PROPERTIES Properties ;
68 dword protocol_id ; /* configured protocol identifier */
69 char protocol_name[8] ; /* readable name of protocol */
74 dword ControllerNumber ; /* for QUADRO cards only */
75 PISDN_ADAPTER MultiMaster ; /* for 4-BRI card only - use MultiMaster or QuadroList */
76 PADAPTER_LIST_ENTRY QuadroList ; /* for QUADRO card only */
77 PDEVICE_OBJECT DeviceObject ;
79 diva_os_adapter_irq_info_t irq_info;
80 dword volatile IrqCount ;
82 dword DspCodeBaseAddr ;
83 dword MaxDspCodeSize ;
85 dword DspCodeBaseAddrTable[4] ; /* add. for MultiMaster */
86 dword MaxDspCodeSizeTable[4] ; /* add. for MultiMaster */
87 dword downloadAddrTable[4] ; /* add. for MultiMaster */
99 struct pc_maint *pcm ;
100 diva_os_dependent_devica_name_t os_name;
104 dword ArchiveType ; /* ARCHIVE_TYPE_NONE ..._SINGLE ..._USGEN ..._MULTI */
105 char *ProtocolSuffix ; /* internal protocolfile table */
108 char Oad1[ISDN_MAX_NUM_LEN] ;
109 char Osa1[ISDN_MAX_NUM_LEN] ;
110 char Oad2[ISDN_MAX_NUM_LEN] ;
111 char Osa2[ISDN_MAX_NUM_LEN] ;
112 char Spid1[ISDN_MAX_NUM_LEN] ;
113 char Spid2[ISDN_MAX_NUM_LEN] ;
115 byte BriLayer2LinkCount ; /* amount of TEI's that adapter will support in P2MP mode */
119 dword TerminalCount ;
122 dword BChMask ; /* B channel mask for unchannelized modes */
126 dword ForceLaw; /* VoiceCoding - default:0, a-law: 1, my-law: 2 */
132 dword L1TristateOrQsig ; /* enable Layer 1 Tristate (bit 2)Or Qsig params (bit 0,1)*/
133 dword InitialDspInfo ;
134 dword ModemGuardTone ;
135 dword ModemMinSpeed ;
136 dword ModemMaxSpeed ;
138 dword ModemOptions2 ;
139 dword ModemNegotiationMode ;
140 dword ModemModulationsMask ;
141 dword ModemTransmitLevel ;
144 dword Part68LevelLimiter ;
145 dword UsEktsNumCallApp ;
146 byte UsEktsFeatAddConf ;
147 byte UsEktsFeatRemoveConf ;
148 byte UsEktsFeatCallTransfer ;
149 byte UsEktsFeatMsgWaiting ;
151 byte ForceVoiceMailAlert;
152 byte DisableAutoSpid;
153 byte ModemCarrierWaitTimeSec;
154 byte ModemCarrierLossWaitTimeTenthSec;
155 byte PiafsLinkTurnaroundInFrames;
157 dword GenerateRingtone ;
158 diva_os_spin_lock_t isr_spin_lock;
159 diva_os_spin_lock_t data_spin_lock;
160 diva_os_soft_isr_t req_soft_isr;
161 diva_os_soft_isr_t isr_soft_isr;
162 diva_os_atomic_t in_dpc;
163 PBUFFER RBuffer; /* Copy of receive lookahead buffer */
167 word assign; /* list of pending ASSIGNs */
168 word head; /* head of request queue */
169 word tail; /* tail of request queue */
170 ADAPTER a ; /* not a separate structure */
171 void (* out)(ADAPTER * a) ;
172 byte (* dpc)(ADAPTER * a) ;
173 byte (* tst_irq)(ADAPTER * a) ;
174 void (* clr_irq)(ADAPTER * a) ;
175 int (* load)(PISDN_ADAPTER) ;
176 int (* mapmem)(PISDN_ADAPTER) ;
177 int (* chkIrq)(PISDN_ADAPTER) ;
178 void (* disIrq)(PISDN_ADAPTER) ;
179 void (* start)(PISDN_ADAPTER) ;
180 void (* stop)(PISDN_ADAPTER) ;
181 void (* rstFnc)(PISDN_ADAPTER) ;
182 void (* trapFnc)(PISDN_ADAPTER) ;
183 void (* os_trap_nfy_Fnc)(PISDN_ADAPTER, dword) ;
184 diva_os_isr_callback_t diva_isr_handler;
187 volatile int pcm_pending;
188 volatile unsigned long pcm_data;
189 diva_xdi_capi_cfg_t capi_cfg;
193 /* ---------------------------------------------------------------------
195 --------------------------------------------------------------------- */
198 byte next; /* chaining index */
199 word assign_ref; /* assign reference */
201 /* ---------------------------------------------------------------------
202 S-cards shared ram structure for loading
203 --------------------------------------------------------------------- */
217 #define PR_RAM ((struct pr_ram *)0)
218 #define RAM ((struct dual *)0)
219 /* ---------------------------------------------------------------------
220 Functions for port io
221 --------------------------------------------------------------------- */
222 void outp_words_from_buffer (word* adr, byte* P, word len);
223 void inp_words_to_buffer (word* adr, byte* P, word len);
224 /* ---------------------------------------------------------------------
225 platform specific conversions
226 --------------------------------------------------------------------- */
227 extern void * PTR_P(ADAPTER * a, ENTITY * e, void * P);
228 extern void * PTR_X(ADAPTER * a, ENTITY * e);
229 extern void * PTR_R(ADAPTER * a, ENTITY * e);
230 extern void CALLBACK(ADAPTER * a, ENTITY * e);
231 extern void set_ram(void * * adr_ptr);
232 /* ---------------------------------------------------------------------
233 ram access functions for io mapped cards
234 --------------------------------------------------------------------- */
235 byte io_in(ADAPTER * a, void * adr);
236 word io_inw(ADAPTER * a, void * adr);
237 void io_in_buffer(ADAPTER * a, void * adr, void * P, word length);
238 void io_look_ahead(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e);
239 void io_out(ADAPTER * a, void * adr, byte data);
240 void io_outw(ADAPTER * a, void * adr, word data);
241 void io_out_buffer(ADAPTER * a, void * adr, void * P, word length);
242 void io_inc(ADAPTER * a, void * adr);
243 /* ---------------------------------------------------------------------
244 ram access functions for memory mapped cards
245 --------------------------------------------------------------------- */
246 byte mem_in(ADAPTER * a, void * adr);
247 word mem_inw(ADAPTER * a, void * adr);
248 void mem_in_buffer(ADAPTER * a, void * adr, void * P, word length);
249 void mem_look_ahead(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e);
250 void mem_out(ADAPTER * a, void * adr, byte data);
251 void mem_outw(ADAPTER * a, void * adr, word data);
252 void mem_out_buffer(ADAPTER * a, void * adr, void * P, word length);
253 void mem_inc(ADAPTER * a, void * adr);
254 void mem_in_dw (ADAPTER *a, void *addr, dword* data, int dwords);
255 void mem_out_dw (ADAPTER *a, void *addr, const dword* data, int dwords);
256 /* ---------------------------------------------------------------------
257 functions exported by io.c
258 --------------------------------------------------------------------- */
259 extern IDI_CALL Requests[MAX_ADAPTER] ;
260 extern void DIDpcRoutine (struct _diva_os_soft_isr* psoft_isr,
262 extern void request (PISDN_ADAPTER, ENTITY *) ;
263 /* ---------------------------------------------------------------------
264 trapFn helpers, used to recover debug trace from dead card
265 --------------------------------------------------------------------- */
271 extern void dump_trap_frame (PISDN_ADAPTER IoAdapter, byte *exception) ;
272 extern void dump_xlog_buffer (PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc) ;
273 /* --------------------------------------------------------------------- */
274 #endif /* } __DIVA_XDI_COMMON_IO_H_INC__ */