11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
4475be4d85a274d0961593db41cf85689db1d583cJoe Perches Copyright (c) Eicon Networks, 2002.
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
6475be4d85a274d0961593db41cf85689db1d583cJoe Perches This source file is supplied for the use with
7475be4d85a274d0961593db41cf85689db1d583cJoe Perches Eicon Networks range of DIVA Server Adapters.
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
9475be4d85a274d0961593db41cf85689db1d583cJoe Perches Eicon File Revision :    2.1
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
11475be4d85a274d0961593db41cf85689db1d583cJoe Perches This program is free software; you can redistribute it and/or modify
12475be4d85a274d0961593db41cf85689db1d583cJoe Perches it under the terms of the GNU General Public License as published by
13475be4d85a274d0961593db41cf85689db1d583cJoe Perches the Free Software Foundation; either version 2, or (at your option)
14475be4d85a274d0961593db41cf85689db1d583cJoe Perches any later version.
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
16475be4d85a274d0961593db41cf85689db1d583cJoe Perches This program is distributed in the hope that it will be useful,
17475be4d85a274d0961593db41cf85689db1d583cJoe Perches but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
18475be4d85a274d0961593db41cf85689db1d583cJoe Perches implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19475be4d85a274d0961593db41cf85689db1d583cJoe Perches See the GNU General Public License for more details.
201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
21475be4d85a274d0961593db41cf85689db1d583cJoe Perches You should have received a copy of the GNU General Public License
22475be4d85a274d0961593db41cf85689db1d583cJoe Perches along with this program; if not, write to the Free Software
23475be4d85a274d0961593db41cf85689db1d583cJoe Perches Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef __DIVA_XDI_COMMON_IO_H_INC__ /* { */
271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define __DIVA_XDI_COMMON_IO_H_INC__
281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
29475be4d85a274d0961593db41cf85689db1d583cJoe Perches  maximum = 16 adapters
30475be4d85a274d0961593db41cf85689db1d583cJoe Perches*/
311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define DI_MAX_LINKS    MAX_ADAPTER
321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define ISDN_MAX_NUM_LEN 60
331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --------------------------------------------------------------------------
34475be4d85a274d0961593db41cf85689db1d583cJoe Perches   structure for quadro card management (obsolete for
35475be4d85a274d0961593db41cf85689db1d583cJoe Perches   systems that do provide per card load event)
36475be4d85a274d0961593db41cf85689db1d583cJoe Perches   -------------------------------------------------------------------------- */
371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef struct {
38475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword         Num;
39475be4d85a274d0961593db41cf85689db1d583cJoe Perches	DEVICE_NAME   DeviceName[4];
40475be4d85a274d0961593db41cf85689db1d583cJoe Perches	PISDN_ADAPTER QuadroAdapter[4];
41475be4d85a274d0961593db41cf85689db1d583cJoe Perches} ADAPTER_LIST_ENTRY, *PADAPTER_LIST_ENTRY;
421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --------------------------------------------------------------------------
43475be4d85a274d0961593db41cf85689db1d583cJoe Perches   Special OS memory support structures
44475be4d85a274d0961593db41cf85689db1d583cJoe Perches   -------------------------------------------------------------------------- */
451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define MAX_MAPPED_ENTRIES 8
461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef struct {
47475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void *Address;
48475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword    Length;
49475be4d85a274d0961593db41cf85689db1d583cJoe Perches} ADAPTER_MEMORY;
501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --------------------------------------------------------------------------
51475be4d85a274d0961593db41cf85689db1d583cJoe Perches   Configuration of XDI clients carried by XDI
52475be4d85a274d0961593db41cf85689db1d583cJoe Perches   -------------------------------------------------------------------------- */
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON      0x01
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON 0x02
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef struct _diva_xdi_capi_cfg {
56475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte cfg_1;
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} diva_xdi_capi_cfg_t;
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --------------------------------------------------------------------------
59475be4d85a274d0961593db41cf85689db1d583cJoe Perches   Main data structure kept per adapter
60475be4d85a274d0961593db41cf85689db1d583cJoe Perches   -------------------------------------------------------------------------- */
611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct _ISDN_ADAPTER {
62475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*DIRequest)(PISDN_ADAPTER, ENTITY *);
63475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int State; /* from NT4 1.srv, a good idea, but  a poor achievement */
64475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int Initialized;
65475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int RegisteredWithDidd;
66475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int Unavailable;  /* callback function possible? */
67475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int ResourcesClaimed;
68475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int PnpBiosConfigUsed;
69475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword Logging;
70475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword features;
71475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char ProtocolIdString[80];
72475be4d85a274d0961593db41cf85689db1d583cJoe Perches	/*
73475be4d85a274d0961593db41cf85689db1d583cJoe Perches	  remember mapped memory areas
74475be4d85a274d0961593db41cf85689db1d583cJoe Perches	*/
75475be4d85a274d0961593db41cf85689db1d583cJoe Perches	ADAPTER_MEMORY MappedMemory[MAX_MAPPED_ENTRIES];
76475be4d85a274d0961593db41cf85689db1d583cJoe Perches	CARD_PROPERTIES Properties;
77475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword cardType;
78475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword protocol_id;       /* configured protocol identifier */
79475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char protocol_name[8];  /* readable name of protocol */
80475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword BusType;
81475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword BusNumber;
82475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword slotNumber;
83475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword slotId;
84475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ControllerNumber;  /* for QUADRO cards only */
85475be4d85a274d0961593db41cf85689db1d583cJoe Perches	PISDN_ADAPTER MultiMaster;       /* for 4-BRI card only - use MultiMaster or QuadroList */
86475be4d85a274d0961593db41cf85689db1d583cJoe Perches	PADAPTER_LIST_ENTRY QuadroList;        /* for QUADRO card  only */
87475be4d85a274d0961593db41cf85689db1d583cJoe Perches	PDEVICE_OBJECT DeviceObject;
88475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword DeviceId;
89475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_adapter_irq_info_t irq_info;
90475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword volatile IrqCount;
91475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int trapped;
92475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword DspCodeBaseAddr;
93475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword MaxDspCodeSize;
94475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword downloadAddr;
95475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword DspCodeBaseAddrTable[4]; /* add. for MultiMaster */
96475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword MaxDspCodeSizeTable[4]; /* add. for MultiMaster */
97475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword downloadAddrTable[4]; /* add. for MultiMaster */
98475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword MemoryBase;
99475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword MemorySize;
100475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *Address;
101475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *Config;
102475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *Control;
103475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *reset;
104475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *port;
105475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *ram;
106475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *cfg;
107475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *prom;
108475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte __iomem *ctlReg;
109475be4d85a274d0961593db41cf85689db1d583cJoe Perches	struct pc_maint  *pcm;
110475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_dependent_devica_name_t os_name;
111475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte Name[32];
112475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword serialNo;
113475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ANum;
114475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ArchiveType; /* ARCHIVE_TYPE_NONE ..._SINGLE ..._USGEN ..._MULTI */
115475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char *ProtocolSuffix; /* internal protocolfile table */
116475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Archive[32];
117475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Protocol[32];
118475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char AddDownload[32]; /* Dsp- or other additional download files */
119475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Oad1[ISDN_MAX_NUM_LEN];
120475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Osa1[ISDN_MAX_NUM_LEN];
121475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Oad2[ISDN_MAX_NUM_LEN];
122475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Osa2[ISDN_MAX_NUM_LEN];
123475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Spid1[ISDN_MAX_NUM_LEN];
124475be4d85a274d0961593db41cf85689db1d583cJoe Perches	char Spid2[ISDN_MAX_NUM_LEN];
125475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte nosig;
126475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte BriLayer2LinkCount; /* amount of TEI's that adapter will support in P2MP mode */
127475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword Channels;
128475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword tei;
129475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword nt2;
130475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword TerminalCount;
131475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword WatchDog;
132475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword Permanent;
133475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword BChMask; /* B channel mask for unchannelized modes */
134475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword StableL2;
135475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword DidLen;
136475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword NoOrderCheck;
137475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ForceLaw; /* VoiceCoding - default:0, a-law: 1, my-law: 2 */
138475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword SigFlags;
139475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword LowChannel;
140475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword NoHscx30;
141475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ProtVersion;
142475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword crc4;
143475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword L1TristateOrQsig; /* enable Layer 1 Tristate (bit 2)Or Qsig params (bit 0,1)*/
144475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword InitialDspInfo;
145475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemGuardTone;
146475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemMinSpeed;
147475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemMaxSpeed;
148475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemOptions;
149475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemOptions2;
150475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemNegotiationMode;
151475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemModulationsMask;
152475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword ModemTransmitLevel;
153475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword FaxOptions;
154475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword FaxMaxSpeed;
155475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword Part68LevelLimiter;
156475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword UsEktsNumCallApp;
157475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte UsEktsFeatAddConf;
158475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte UsEktsFeatRemoveConf;
159475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte UsEktsFeatCallTransfer;
160475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte UsEktsFeatMsgWaiting;
161475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte QsigDialect;
162475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte ForceVoiceMailAlert;
163475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte DisableAutoSpid;
164475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte ModemCarrierWaitTimeSec;
165475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte ModemCarrierLossWaitTimeTenthSec;
166475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte PiafsLinkTurnaroundInFrames;
167475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte DiscAfterProgress;
168475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte AniDniLimiter[3];
169475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte TxAttenuation;  /* PRI/E1 only: attenuate TX signal */
170475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word QsigFeatures;
171475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword GenerateRingtone;
172475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword SupplementaryServicesFeatures;
173475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword R2Dialect;
174475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword R2CasOptions;
175475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword FaxV34Options;
176475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword DisabledDspMask;
177475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword AdapterTestMask;
178475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword DspImageLength;
179475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word AlertToIn20mSecTicks;
180475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word ModemEyeSetup;
181475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte R2CtryLength;
182475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte CCBSRelTimer;
183475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte *PcCfgBufferFile;/* flexible parameter via file */
184475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte *PcCfgBuffer; /* flexible parameter via multistring */
185475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_dump_file_t dump_file; /* dump memory to file at lowest irq level */
186475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_board_trace_t board_trace; /* traces from the board */
187475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_spin_lock_t isr_spin_lock;
188475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_spin_lock_t data_spin_lock;
189475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_soft_isr_t req_soft_isr;
190475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_soft_isr_t isr_soft_isr;
191475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_atomic_t  in_dpc;
192475be4d85a274d0961593db41cf85689db1d583cJoe Perches	PBUFFER RBuffer;        /* Copy of receive lookahead buffer */
193475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word e_max;
194475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word e_count;
195475be4d85a274d0961593db41cf85689db1d583cJoe Perches	E_INFO *e_tbl;
196475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word assign;         /* list of pending ASSIGNs  */
197475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word head;           /* head of request queue    */
198475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word tail;           /* tail of request queue    */
199475be4d85a274d0961593db41cf85689db1d583cJoe Perches	ADAPTER a;             /* not a separate structure */
200475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*out)(ADAPTER *a);
201475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte (*dpc)(ADAPTER *a);
202475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte (*tst_irq)(ADAPTER *a);
203475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*clr_irq)(ADAPTER *a);
204475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int (*load)(PISDN_ADAPTER);
205475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int (*mapmem)(PISDN_ADAPTER);
206475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int (*chkIrq)(PISDN_ADAPTER);
207475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*disIrq)(PISDN_ADAPTER);
208475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*start)(PISDN_ADAPTER);
209475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*stop)(PISDN_ADAPTER);
210475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*rstFnc)(PISDN_ADAPTER);
211475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*trapFnc)(PISDN_ADAPTER);
212475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword (*DetectDsps)(PISDN_ADAPTER);
213475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void (*os_trap_nfy_Fnc)(PISDN_ADAPTER, dword);
214475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_os_isr_callback_t diva_isr_handler;
215475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword sdram_bar;  /* must be 32 bit */
216475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword fpga_features;
217475be4d85a274d0961593db41cf85689db1d583cJoe Perches	volatile int pcm_pending;
218475be4d85a274d0961593db41cf85689db1d583cJoe Perches	volatile void *pcm_data;
219475be4d85a274d0961593db41cf85689db1d583cJoe Perches	diva_xdi_capi_cfg_t capi_cfg;
220475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword tasks;
221475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void *dma_map;
222475be4d85a274d0961593db41cf85689db1d583cJoe Perches	int (*DivaAdapterTestProc)(PISDN_ADAPTER);
223475be4d85a274d0961593db41cf85689db1d583cJoe Perches	void *AdapterTestMemoryStart;
224475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword AdapterTestMemoryLength;
225475be4d85a274d0961593db41cf85689db1d583cJoe Perches	const byte *cfg_lib_memory_init;
226475be4d85a274d0961593db41cf85689db1d583cJoe Perches	dword cfg_lib_memory_init_length;
2271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ---------------------------------------------------------------------
229475be4d85a274d0961593db41cf85689db1d583cJoe Perches   Entity table
2301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   --------------------------------------------------------------------- */
2311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct e_info_s {
232475be4d85a274d0961593db41cf85689db1d583cJoe Perches	ENTITY *e;
233475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte          next;                   /* chaining index           */
234475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word          assign_ref;             /* assign reference         */
2351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ---------------------------------------------------------------------
237475be4d85a274d0961593db41cf85689db1d583cJoe Perches   S-cards shared ram structure for loading
2381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   --------------------------------------------------------------------- */
2391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct s_load {
240475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte ctrl;
241475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte card;
242475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte msize;
243475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte fill0;
244475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word ebit;
245475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word elocl;
246475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word eloch;
247475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte reserved[20];
248475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word signature;
249475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte fill[224];
250475be4d85a274d0961593db41cf85689db1d583cJoe Perches	byte b[256];
2511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
2521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define PR_RAM  ((struct pr_ram *)0)
2531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define RAM ((struct dual *)0)
2541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ---------------------------------------------------------------------
255475be4d85a274d0961593db41cf85689db1d583cJoe Perches   platform specific conversions
2561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   --------------------------------------------------------------------- */
257475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void *PTR_P(ADAPTER *a, ENTITY *e, void *P);
258475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void *PTR_X(ADAPTER *a, ENTITY *e);
259475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void *PTR_R(ADAPTER *a, ENTITY *e);
260475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void CALLBACK(ADAPTER *a, ENTITY *e);
261475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void set_ram(void **adr_ptr);
2621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ---------------------------------------------------------------------
263475be4d85a274d0961593db41cf85689db1d583cJoe Perches   ram access functions for io mapped cards
2641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   --------------------------------------------------------------------- */
265475be4d85a274d0961593db41cf85689db1d583cJoe Perchesbyte io_in(ADAPTER *a, void *adr);
266475be4d85a274d0961593db41cf85689db1d583cJoe Perchesword io_inw(ADAPTER *a, void *adr);
267475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid io_in_buffer(ADAPTER *a, void *adr, void *P, word length);
268475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid io_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
269475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid io_out(ADAPTER *a, void *adr, byte data);
270475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid io_outw(ADAPTER *a, void *adr, word data);
271475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid io_out_buffer(ADAPTER *a, void *adr, void *P, word length);
272475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid io_inc(ADAPTER *a, void *adr);
273475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid bri_in_buffer(PISDN_ADAPTER IoAdapter, dword Pos,
274475be4d85a274d0961593db41cf85689db1d583cJoe Perches		   void *Buf, dword Len);
275475be4d85a274d0961593db41cf85689db1d583cJoe Perchesint bri_out_buffer(PISDN_ADAPTER IoAdapter, dword Pos,
276475be4d85a274d0961593db41cf85689db1d583cJoe Perches		   void *Buf, dword Len, int Verify);
2771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ---------------------------------------------------------------------
278475be4d85a274d0961593db41cf85689db1d583cJoe Perches   ram access functions for memory mapped cards
2791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   --------------------------------------------------------------------- */
280475be4d85a274d0961593db41cf85689db1d583cJoe Perchesbyte mem_in(ADAPTER *a, void *adr);
281475be4d85a274d0961593db41cf85689db1d583cJoe Perchesword mem_inw(ADAPTER *a, void *adr);
282475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_in_buffer(ADAPTER *a, void *adr, void *P, word length);
283475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_look_ahead(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
284475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_out(ADAPTER *a, void *adr, byte data);
285475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_outw(ADAPTER *a, void *adr, word data);
286475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_out_buffer(ADAPTER *a, void *adr, void *P, word length);
287475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_inc(ADAPTER *a, void *adr);
288475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_in_dw(ADAPTER *a, void *addr, dword *data, int dwords);
289475be4d85a274d0961593db41cf85689db1d583cJoe Perchesvoid mem_out_dw(ADAPTER *a, void *addr, const dword *data, int dwords);
2901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ---------------------------------------------------------------------
291475be4d85a274d0961593db41cf85689db1d583cJoe Perches   functions exported by io.c
2921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   --------------------------------------------------------------------- */
293475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern IDI_CALL Requests[MAX_ADAPTER];
294475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void     DIDpcRoutine(struct _diva_os_soft_isr *psoft_isr,
295475be4d85a274d0961593db41cf85689db1d583cJoe Perches			     void *context);
296475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void     request(PISDN_ADAPTER, ENTITY *);
2971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* ---------------------------------------------------------------------
298475be4d85a274d0961593db41cf85689db1d583cJoe Perches   trapFn helpers, used to recover debug trace from dead card
2991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds   --------------------------------------------------------------------- */
3001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef struct {
301475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word *buf;
302475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word  cnt;
303475be4d85a274d0961593db41cf85689db1d583cJoe Perches	word  out;
304475be4d85a274d0961593db41cf85689db1d583cJoe Perches} Xdesc;
305475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void dump_trap_frame(PISDN_ADAPTER IoAdapter, byte __iomem *exception);
306475be4d85a274d0961593db41cf85689db1d583cJoe Perchesextern void dump_xlog_buffer(PISDN_ADAPTER IoAdapter, Xdesc *xlogDesc);
3071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* --------------------------------------------------------------------- */
3081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif  /* } __DIVA_XDI_COMMON_IO_H_INC__ */
309