include upstream ip1000a driver version 2.09f
[linux-2.4.git] / drivers / isdn / eicon / eicon_idi.h
1 /* $Id: eicon_idi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
2  *
3  * ISDN lowlevel-module for the Eicon active cards.
4  * IDI-Interface
5  *
6  * Copyright 1998-2000  by Armin Schindler (mac@melware.de)
7  * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
8  *
9  * This software may be used and distributed according to the terms
10  * of the GNU General Public License, incorporated herein by reference.
11  *
12  */
13
14 #ifndef E_IDI_H
15 #define E_IDI_H
16
17 #include <linux/config.h>
18
19 #undef N_DATA
20 #undef ID_MASK
21
22 #include "pc.h"
23
24 #define AOC_IND  26             /* Advice of Charge                         */
25 #define PI  0x1e                /* Progress Indicator               */
26 #define NI  0x27                /* Notification Indicator           */
27
28 #define CALL_HOLD       0x22
29 #define CALL_HOLD_ACK   0x24
30
31 /* defines for statectrl */
32 #define WAITING_FOR_HANGUP      0x01
33 #define HAVE_CONN_REQ           0x02
34 #define IN_HOLD                 0x04
35
36 typedef struct {
37         char cpn[32];
38         char oad[32];
39         char dsa[32];
40         char osa[32];
41         __u8 plan;
42         __u8 screen;
43         __u8 sin[4];
44         __u8 chi[4];
45         __u8 e_chi[4];
46         __u8 bc[12];
47         __u8 e_bc[12];
48         __u8 llc[18];
49         __u8 hlc[5];
50         __u8 cau[4];
51         __u8 e_cau[2];
52         __u8 e_mt;
53         __u8 dt[6];
54         char display[83];
55         char keypad[35];
56         char rdn[32];
57 } idi_ind_message;
58
59 typedef struct { 
60   __u16 next            __attribute__ ((packed));
61   __u8  Req;
62   __u8  ReqId;
63   __u8  ReqCh;
64   __u8  Reserved1;
65   __u16 Reference       __attribute__ ((packed));
66   __u8  Reserved[8];
67   eicon_PBUFFER XBuffer; 
68 } eicon_REQ;
69
70 typedef struct {
71   __u16 next            __attribute__ ((packed));
72   __u8  Rc;
73   __u8  RcId;
74   __u8  RcCh;
75   __u8  Reserved1;
76   __u16 Reference       __attribute__ ((packed));
77   __u8  Reserved2[8];
78 } eicon_RC;
79
80 typedef struct {
81   __u16 next            __attribute__ ((packed));
82   __u8  Ind;
83   __u8  IndId;
84   __u8  IndCh;
85   __u8  MInd;
86   __u16 MLength         __attribute__ ((packed));
87   __u16 Reference       __attribute__ ((packed));
88   __u8  RNR;
89   __u8  Reserved;
90   __u32 Ack             __attribute__ ((packed));
91   eicon_PBUFFER RBuffer;
92 } eicon_IND;
93
94 typedef struct {
95         __u8            *Data;
96         unsigned int    Size;
97         unsigned int    Len;
98         __u8            *Next;
99 } eicon_OBJBUFFER;
100
101 extern int idi_do_req(eicon_card *card, eicon_chan *chan, int cmd, int layer);
102 extern int idi_hangup(eicon_card *card, eicon_chan *chan);
103 extern int idi_connect_res(eicon_card *card, eicon_chan *chan);
104 extern int eicon_idi_listen_req(eicon_card *card, eicon_chan *chan);
105 extern int idi_connect_req(eicon_card *card, eicon_chan *chan, char *phone,
106                             char *eazmsn, int si1, int si2);
107
108 extern void idi_handle_ack(eicon_card *card, struct sk_buff *skb);
109 extern void idi_handle_ind(eicon_card *card, struct sk_buff *skb);
110 extern int eicon_idi_manage(eicon_card *card, eicon_manifbuf *mb);
111 extern int idi_send_data(eicon_card *card, eicon_chan *chan, int ack, struct sk_buff *skb, int que, int chk);
112 extern void idi_audio_cmd(eicon_card *ccard, eicon_chan *chan, int cmd, u_char *value);
113 extern int capipmsg(eicon_card *card, eicon_chan *chan, capi_msg *cm);
114 #ifdef CONFIG_ISDN_TTY_FAX
115 extern void idi_fax_cmd(eicon_card *card, eicon_chan *chan);
116 extern int idi_faxdata_send(eicon_card *ccard, eicon_chan *chan, struct sk_buff *skb);
117 #endif
118
119 #endif