blob: a5094d221086dffaf61d21bbe76e9980e0c8116b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2/*
3 *
Joe Perches475be4d2012-02-19 19:52:38 -08004 Copyright (c) Eicon Networks, 2002.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
Joe Perches475be4d2012-02-19 19:52:38 -08006 This source file is supplied for the use with
7 Eicon Networks range of DIVA Server Adapters.
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 *
Joe Perches475be4d2012-02-19 19:52:38 -08009 Eicon File Revision : 2.1
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 *
Joe Perches475be4d2012-02-19 19:52:38 -080011 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 *
Joe Perches475be4d2012-02-19 19:52:38 -080016 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 *
Joe Perches475be4d2012-02-19 19:52:38 -080021 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 *
25 */
Joe Perches475be4d2012-02-19 19:52:38 -080026#ifndef _DI_DEFS_
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#define _DI_DEFS_
Joe Perches475be4d2012-02-19 19:52:38 -080028/* typedefs for our data structures */
Linus Torvalds1da177e2005-04-16 15:20:36 -070029typedef struct get_name_s GET_NAME;
30/* The entity_s structure is used to pass all
31 parameters between application and IDI */
32typedef struct entity_s ENTITY;
33typedef struct buffers_s BUFFERS;
34typedef struct postcall_s POSTCALL;
35typedef struct get_para_s GET_PARA;
36#define BOARD_NAME_LENGTH 9
37#define IDI_CALL_LINK_T
38#define IDI_CALL_ENTITY_T
39/* typedef void ( * IDI_CALL)(ENTITY *); */
40/* --------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -080041 IDI_CALL
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 -------------------------------------------------------- */
Joe Perches475be4d2012-02-19 19:52:38 -080043typedef void (IDI_CALL_LINK_T *IDI_CALL)(ENTITY IDI_CALL_ENTITY_T *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070044typedef struct {
Joe Perches475be4d2012-02-19 19:52:38 -080045 word length; /* length of data/parameter field */
46 byte P[270]; /* data/parameter field */
Linus Torvalds1da177e2005-04-16 15:20:36 -070047} DBUFFER;
48struct get_name_s {
Joe Perches475be4d2012-02-19 19:52:38 -080049 word command; /* command = 0x0100 */
50 byte name[BOARD_NAME_LENGTH];
Linus Torvalds1da177e2005-04-16 15:20:36 -070051};
52struct postcall_s {
Joe Perches475be4d2012-02-19 19:52:38 -080053 word command; /* command = 0x0300 */
54 word dummy; /* not used */
55 void (*callback)(void *); /* call back */
56 void *context; /* context pointer */
Linus Torvalds1da177e2005-04-16 15:20:36 -070057};
58#define REQ_PARA 0x0600 /* request command line parameters */
59#define REQ_PARA_LEN 1 /* number of data bytes */
60#define L1_STARTUP_DOWN_POS 0 /* '-y' command line parameter in......*/
61#define L1_STARTUP_DOWN_MSK 0x01 /* first byte position (index 0) with value 0x01 */
62struct get_para_s {
Joe Perches475be4d2012-02-19 19:52:38 -080063 word command; /* command = 0x0600 */
64 byte len; /* max length of para field in bytes */
65 byte para[REQ_PARA_LEN]; /* parameter field */
Linus Torvalds1da177e2005-04-16 15:20:36 -070066};
67struct buffers_s {
Joe Perches475be4d2012-02-19 19:52:38 -080068 word PLength;
69 byte *P;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070};
71struct entity_s {
Joe Perches475be4d2012-02-19 19:52:38 -080072 byte Req; /* pending request */
73 byte Rc; /* return code received */
74 byte Ind; /* indication received */
75 byte ReqCh; /* channel of current Req */
76 byte RcCh; /* channel of current Rc */
77 byte IndCh; /* channel of current Ind */
78 byte Id; /* ID used by this entity */
79 byte GlobalId; /* reserved field */
80 byte XNum; /* number of X-buffers */
81 byte RNum; /* number of R-buffers */
82 BUFFERS *X; /* pointer to X-buffer list */
83 BUFFERS *R; /* pointer to R-buffer list */
84 word RLength; /* length of current R-data */
85 DBUFFER *RBuffer; /* buffer of current R-data */
86 byte RNR; /* receive not ready flag */
87 byte complete; /* receive complete status */
88 IDI_CALL callback;
89 word user[2];
90 /* fields used by the driver internally */
91 byte No; /* entity number */
92 byte reserved2; /* reserved field */
93 byte More; /* R/X More flags */
94 byte MInd; /* MDATA coding for this ID */
95 byte XCurrent; /* current transmit buffer */
96 byte RCurrent; /* current receive buffer */
97 word XOffset; /* offset in x-buffer */
98 word ROffset; /* offset in r-buffer */
Linus Torvalds1da177e2005-04-16 15:20:36 -070099};
100typedef struct {
Joe Perches475be4d2012-02-19 19:52:38 -0800101 byte type;
102 byte channels;
103 word features;
104 IDI_CALL request;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105} DESCRIPTOR;
Joe Perches475be4d2012-02-19 19:52:38 -0800106/* descriptor type field coding */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107#define IDI_ADAPTER_S 1
108#define IDI_ADAPTER_PR 2
109#define IDI_ADAPTER_DIVA 3
110#define IDI_ADAPTER_MAESTRA 4
111#define IDI_VADAPTER 0x40
112#define IDI_DRIVER 0x80
113#define IDI_DADAPTER 0xfd
114#define IDI_DIDDPNP 0xfe
115#define IDI_DIMAINT 0xff
Joe Perches475be4d2012-02-19 19:52:38 -0800116/* Hardware IDs ISA PNP */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117#define HW_ID_DIVA_PRO 3 /* same as IDI_ADAPTER_DIVA */
118#define HW_ID_MAESTRA 4 /* same as IDI_ADAPTER_MAESTRA */
119#define HW_ID_PICCOLA 5
120#define HW_ID_DIVA_PRO20 6
121#define HW_ID_DIVA20 7
122#define HW_ID_DIVA_PRO20_U 8
123#define HW_ID_DIVA20_U 9
124#define HW_ID_DIVA30 10
125#define HW_ID_DIVA30_U 11
Joe Perches475be4d2012-02-19 19:52:38 -0800126/* Hardware IDs PCI */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127#define HW_ID_EICON_PCI 0x1133
128#define HW_ID_SIEMENS_PCI 0x8001 /* unused SubVendor ID for Siemens Cornet-N cards */
129#define HW_ID_PROTTYPE_CORNETN 0x0014 /* SubDevice ID for Siemens Cornet-N cards */
130#define HW_ID_FUJITSU_SIEMENS_PCI 0x110A /* SubVendor ID for Fujitsu Siemens */
131#define HW_ID_GS03_PCI 0x0021 /* SubDevice ID for Fujitsu Siemens ISDN S0 card */
132#define HW_ID_DIVA_PRO20_PCI 0xe001
133#define HW_ID_DIVA20_PCI 0xe002
134#define HW_ID_DIVA_PRO20_PCI_U 0xe003
135#define HW_ID_DIVA20_PCI_U 0xe004
136#define HW_ID_DIVA201_PCI 0xe005
137#define HW_ID_DIVA_CT_ST 0xe006
138#define HW_ID_DIVA_CT_U 0xe007
139#define HW_ID_DIVA_CTL_ST 0xe008
140#define HW_ID_DIVA_CTL_U 0xe009
141#define HW_ID_DIVA_ISDN_V90_PCI 0xe00a
142#define HW_ID_DIVA202_PCI_ST 0xe00b
143#define HW_ID_DIVA202_PCI_U 0xe00c
144#define HW_ID_DIVA_PRO30_PCI 0xe00d
145#define HW_ID_MAESTRA_PCI 0xe010
146#define HW_ID_MAESTRAQ_PCI 0xe012
147#define HW_ID_DSRV_Q8M_V2_PCI 0xe013
148#define HW_ID_MAESTRAP_PCI 0xe014
149#define HW_ID_DSRV_P30M_V2_PCI 0xe015
150#define HW_ID_DSRV_VOICE_Q8M_PCI 0xe016
151#define HW_ID_DSRV_VOICE_Q8M_V2_PCI 0xe017
152#define HW_ID_DSRV_B2M_V2_PCI 0xe018
153#define HW_ID_DSRV_VOICE_P30M_V2_PCI 0xe019
154#define HW_ID_DSRV_B2F_PCI 0xe01a
155#define HW_ID_DSRV_VOICE_B2M_V2_PCI 0xe01b
Joe Perches475be4d2012-02-19 19:52:38 -0800156/* Hardware IDs USB */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157#define EICON_USB_VENDOR_ID 0x071D
158#define HW_ID_DIVA_USB_REV1 0x1000
159#define HW_ID_DIVA_USB_REV2 0x1003
160#define HW_ID_TELEDAT_SURF_USB_REV2 0x1004
161#define HW_ID_TELEDAT_SURF_USB_REV1 0x2000
162/* --------------------------------------------------------------------------
Joe Perches475be4d2012-02-19 19:52:38 -0800163 Adapter array change notification framework
164 -------------------------------------------------------------------------- */
165typedef void (IDI_CALL_LINK_T *didd_adapter_change_callback_t)(void IDI_CALL_ENTITY_T *context, DESCRIPTOR *adapter, int removal);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166/* -------------------------------------------------------------------------- */
167#define DI_VOICE 0x0 /* obsolete define */
168#define DI_FAX3 0x1
169#define DI_MODEM 0x2
170#define DI_POST 0x4
171#define DI_V110 0x8
172#define DI_V120 0x10
173#define DI_POTS 0x20
174#define DI_CODEC 0x40
175#define DI_MANAGE 0x80
176#define DI_V_42 0x0100
177#define DI_EXTD_FAX 0x0200 /* Extended FAX (ECM, 2D, T.6, Polling) */
178#define DI_AT_PARSER 0x0400 /* Build-in AT Parser in the L2 */
179#define DI_VOICE_OVER_IP 0x0800 /* Voice over IP support */
Joe Perches475be4d2012-02-19 19:52:38 -0800180typedef void (IDI_CALL_LINK_T *_IDI_CALL)(void *, ENTITY *);
181#endif