1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26#ifndef __DIVA_XDI_COMMON_IO_H_INC__
27#define __DIVA_XDI_COMMON_IO_H_INC__
28
29
30
31#define DI_MAX_LINKS MAX_ADAPTER
32#define ISDN_MAX_NUM_LEN 60
33
34
35
36
37typedef struct {
38 dword Num ;
39 DEVICE_NAME DeviceName[4] ;
40 PISDN_ADAPTER QuadroAdapter[4] ;
41} ADAPTER_LIST_ENTRY, *PADAPTER_LIST_ENTRY ;
42
43
44
45#define MAX_MAPPED_ENTRIES 8
46typedef struct {
47 void * Address;
48 dword Length;
49} ADAPTER_MEMORY ;
50
51
52
53#define DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON 0x01
54#define DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON 0x02
55typedef struct _diva_xdi_capi_cfg {
56 byte cfg_1;
57} diva_xdi_capi_cfg_t;
58
59
60
61struct _ISDN_ADAPTER {
62 void (* DIRequest)(PISDN_ADAPTER, ENTITY *) ;
63 int State ;
64 int Initialized ;
65 int RegisteredWithDidd ;
66 int Unavailable ;
67 int ResourcesClaimed ;
68 int PnpBiosConfigUsed ;
69 dword Logging ;
70 dword features ;
71 char ProtocolIdString[80] ;
72
73
74
75 ADAPTER_MEMORY MappedMemory[MAX_MAPPED_ENTRIES] ;
76 CARD_PROPERTIES Properties ;
77 dword cardType ;
78 dword protocol_id ;
79 char protocol_name[8] ;
80 dword BusType ;
81 dword BusNumber ;
82 dword slotNumber ;
83 dword slotId ;
84 dword ControllerNumber ;
85 PISDN_ADAPTER MultiMaster ;
86 PADAPTER_LIST_ENTRY QuadroList ;
87 PDEVICE_OBJECT DeviceObject ;
88 dword DeviceId ;
89 diva_os_adapter_irq_info_t irq_info;
90 dword volatile IrqCount ;
91 int trapped ;
92 dword DspCodeBaseAddr ;
93 dword MaxDspCodeSize ;
94 dword downloadAddr ;
95 dword DspCodeBaseAddrTable[4] ;
96 dword MaxDspCodeSizeTable[4] ;
97 dword downloadAddrTable[4] ;
98 dword MemoryBase ;
99 dword MemorySize ;
100 byte __iomem *Address ;
101 byte __iomem *Config ;
102 byte __iomem *Control ;
103 byte __iomem *reset ;
104 byte __iomem *port ;
105 byte __iomem *ram ;
106 byte __iomem *cfg ;
107 byte __iomem *prom ;
108 byte __iomem *ctlReg ;
109 struct pc_maint *pcm ;
110 diva_os_dependent_devica_name_t os_name;
111 byte Name[32] ;
112 dword serialNo ;
113 dword ANum ;
114 dword ArchiveType ;
115 char *ProtocolSuffix ;
116 char Archive[32] ;
117 char Protocol[32] ;
118 char AddDownload[32] ;
119 char Oad1[ISDN_MAX_NUM_LEN] ;
120 char Osa1[ISDN_MAX_NUM_LEN] ;
121 char Oad2[ISDN_MAX_NUM_LEN] ;
122 char Osa2[ISDN_MAX_NUM_LEN] ;
123 char Spid1[ISDN_MAX_NUM_LEN] ;
124 char Spid2[ISDN_MAX_NUM_LEN] ;
125 byte nosig ;
126 byte BriLayer2LinkCount ;
127 dword Channels ;
128 dword tei ;
129 dword nt2 ;
130 dword TerminalCount ;
131 dword WatchDog ;
132 dword Permanent ;
133 dword BChMask ;
134 dword StableL2 ;
135 dword DidLen ;
136 dword NoOrderCheck ;
137 dword ForceLaw;
138 dword SigFlags ;
139 dword LowChannel ;
140 dword NoHscx30 ;
141 dword ProtVersion ;
142 dword crc4 ;
143 dword L1TristateOrQsig ;
144 dword InitialDspInfo ;
145 dword ModemGuardTone ;
146 dword ModemMinSpeed ;
147 dword ModemMaxSpeed ;
148 dword ModemOptions ;
149 dword ModemOptions2 ;
150 dword ModemNegotiationMode ;
151 dword ModemModulationsMask ;
152 dword ModemTransmitLevel ;
153 dword FaxOptions ;
154 dword FaxMaxSpeed ;
155 dword Part68LevelLimiter ;
156 dword UsEktsNumCallApp ;
157 byte UsEktsFeatAddConf ;
158 byte UsEktsFeatRemoveConf ;
159 byte UsEktsFeatCallTransfer ;
160 byte UsEktsFeatMsgWaiting ;
161 byte QsigDialect;
162 byte ForceVoiceMailAlert;
163 byte DisableAutoSpid;
164 byte ModemCarrierWaitTimeSec;
165 byte ModemCarrierLossWaitTimeTenthSec;
166 byte PiafsLinkTurnaroundInFrames;
167 byte DiscAfterProgress;
168 byte AniDniLimiter[3];
169 byte TxAttenuation;
170 word QsigFeatures;
171 dword GenerateRingtone ;
172 dword SupplementaryServicesFeatures;
173 dword R2Dialect;
174 dword R2CasOptions;
175 dword FaxV34Options;
176 dword DisabledDspMask;
177 dword AdapterTestMask;
178 dword DspImageLength;
179 word AlertToIn20mSecTicks;
180 word ModemEyeSetup;
181 byte R2CtryLength;
182 byte CCBSRelTimer;
183 byte *PcCfgBufferFile;
184 byte *PcCfgBuffer ;
185 diva_os_dump_file_t dump_file;
186 diva_os_board_trace_t board_trace ;
187 diva_os_spin_lock_t isr_spin_lock;
188 diva_os_spin_lock_t data_spin_lock;
189 diva_os_soft_isr_t req_soft_isr;
190 diva_os_soft_isr_t isr_soft_isr;
191 diva_os_atomic_t in_dpc;
192 PBUFFER RBuffer;
193 word e_max;
194 word e_count;
195 E_INFO *e_tbl;
196 word assign;
197 word head;
198 word tail;
199 ADAPTER a ;
200 void (* out)(ADAPTER * a) ;
201 byte (* dpc)(ADAPTER * a) ;
202 byte (* tst_irq)(ADAPTER * a) ;
203 void (* clr_irq)(ADAPTER * a) ;
204 int (* load)(PISDN_ADAPTER) ;
205 int (* mapmem)(PISDN_ADAPTER) ;
206 int (* chkIrq)(PISDN_ADAPTER) ;
207 void (* disIrq)(PISDN_ADAPTER) ;
208 void (* start)(PISDN_ADAPTER) ;
209 void (* stop)(PISDN_ADAPTER) ;
210 void (* rstFnc)(PISDN_ADAPTER) ;
211 void (* trapFnc)(PISDN_ADAPTER) ;
212 dword (* DetectDsps)(PISDN_ADAPTER) ;
213 void (* os_trap_nfy_Fnc)(PISDN_ADAPTER, dword) ;
214 diva_os_isr_callback_t diva_isr_handler;
215 dword sdram_bar;
216 dword fpga_features;
217 volatile int pcm_pending;
218 volatile void * pcm_data;
219 diva_xdi_capi_cfg_t capi_cfg;
220 dword tasks;
221 void *dma_map;
222 int (*DivaAdapterTestProc)(PISDN_ADAPTER);
223 void *AdapterTestMemoryStart;
224 dword AdapterTestMemoryLength;
225 const byte* cfg_lib_memory_init;
226 dword cfg_lib_memory_init_length;
227};
228
229
230
231struct e_info_s {
232 ENTITY * e;
233 byte next;
234 word assign_ref;
235};
236
237
238
239struct s_load {
240 byte ctrl;
241 byte card;
242 byte msize;
243 byte fill0;
244 word ebit;
245 word elocl;
246 word eloch;
247 byte reserved[20];
248 word signature;
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
256
257extern void * PTR_P(ADAPTER * a, ENTITY * e, void * P);
258extern void * PTR_X(ADAPTER * a, ENTITY * e);
259extern void * PTR_R(ADAPTER * a, ENTITY * e);
260extern void CALLBACK(ADAPTER * a, ENTITY * e);
261extern void set_ram(void * * adr_ptr);
262
263
264
265byte io_in(ADAPTER * a, void * adr);
266word io_inw(ADAPTER * a, void * adr);
267void io_in_buffer(ADAPTER * a, void * adr, void * P, word length);
268void io_look_ahead(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e);
269void io_out(ADAPTER * a, void * adr, byte data);
270void io_outw(ADAPTER * a, void * adr, word data);
271void io_out_buffer(ADAPTER * a, void * adr, void * P, word length);
272void io_inc(ADAPTER * a, void * adr);
273void bri_in_buffer (PISDN_ADAPTER IoAdapter, dword Pos,
274 void *Buf, dword Len);
275int bri_out_buffer (PISDN_ADAPTER IoAdapter, dword Pos,
276 void *Buf, dword Len, int Verify);
277
278
279
280byte mem_in(ADAPTER * a, void * adr);
281word mem_inw(ADAPTER * a, void * adr);
282void mem_in_buffer(ADAPTER * a, void * adr, void * P, word length);
283void mem_look_ahead(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e);
284void mem_out(ADAPTER * a, void * adr, byte data);
285void mem_outw(ADAPTER * a, void * adr, word data);
286void mem_out_buffer(ADAPTER * a, void * adr, void * P, word length);
287void mem_inc(ADAPTER * a, void * adr);
288void mem_in_dw (ADAPTER *a, void *addr, dword* data, int dwords);
289void mem_out_dw (ADAPTER *a, void *addr, const dword* data, int dwords);
290
291
292
293extern IDI_CALL Requests[MAX_ADAPTER] ;
294extern void DIDpcRoutine (struct _diva_os_soft_isr* psoft_isr,
295 void* context);
296extern void request (PISDN_ADAPTER, ENTITY *) ;
297
298
299
300typedef struct {
301 word *buf ;
302 word cnt ;
303 word out ;
304} Xdesc ;
305extern void dump_trap_frame (PISDN_ADAPTER IoAdapter, byte __iomem *exception) ;
306extern void dump_xlog_buffer (PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc) ;
307
308#endif
309