blob: 7098d6bd5ff20e34416394ec2d2020ee1cd80d8d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Joe Perches475be4d2012-02-19 19:52:38 -08002 * Interface between low level (hardware) drivers and
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * HiSax protocol stack
4 *
5 * Author Kai Germaschewski
6 * Copyright 2001 by Kai Germaschewski <kai.germaschewski@gmx.de>
Joe Perches475be4d2012-02-19 19:52:38 -08007 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12
13#ifndef __HISAX_IF_H__
14#define __HISAX_IF_H__
15
16#include <linux/skbuff.h>
17
18#define REQUEST 0
19#define CONFIRM 1
20#define INDICATION 2
21#define RESPONSE 3
22
23#define PH_ACTIVATE 0x0100
24#define PH_DEACTIVATE 0x0110
25#define PH_DATA 0x0120
26#define PH_PULL 0x0130
27#define PH_DATA_E 0x0140
28
29#define L1_MODE_NULL 0
30#define L1_MODE_TRANS 1
31#define L1_MODE_HDLC 2
32#define L1_MODE_EXTRN 3
33#define L1_MODE_HDLC_56K 4
34#define L1_MODE_MODEM 7
35#define L1_MODE_V32 8
36#define L1_MODE_FAX 9
37
38struct hisax_if {
39 void *priv; // private to driver
40 void (*l1l2)(struct hisax_if *, int pr, void *arg);
41 void (*l2l1)(struct hisax_if *, int pr, void *arg);
42};
43
44struct hisax_b_if {
45 struct hisax_if ifc;
46
47 // private to hisax
48 struct BCState *bcs;
49};
50
51struct hisax_d_if {
52 struct hisax_if ifc;
53
54 // private to hisax
55 struct module *owner;
56 struct IsdnCardState *cs;
57 struct hisax_b_if *b_if[2];
58 struct sk_buff_head erq;
Al Viro64b33612007-10-14 19:35:20 +010059 unsigned long ph_state;
Linus Torvalds1da177e2005-04-16 15:20:36 -070060};
61
62int hisax_register(struct hisax_d_if *hisax_if, struct hisax_b_if *b_if[],
63 char *name, int protocol);
64void hisax_unregister(struct hisax_d_if *hisax_if);
65
66#endif