* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / drivers / isdn / avmb1 / capilli.h
blobda64a183b6732c1775e19357974c41a4f304e491
1 /*
2 * $Id: capilli.h,v 1.4 1999/07/23 08:51:05 calle Exp $
3 *
4 * Kernel CAPI 2.0 Driver Interface for Linux
5 *
6 * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
7 *
8 */
9 #ifndef __CAPILLI_H__
10 #define __CAPILLI_H__
12 typedef struct capiloaddatapart {
13 int user; /* data in userspace ? */
14 int len;
15 unsigned char *data;
16 } capiloaddatapart;
18 typedef struct capiloaddata {
19 capiloaddatapart firmware;
20 capiloaddatapart configuration;
21 } capiloaddata;
23 typedef struct capicardparams {
24 unsigned int port;
25 unsigned irq;
26 int cardtype;
27 int cardnr;
28 unsigned int membase;
29 } capicardparams;
31 struct capi_driver;
33 struct capi_ctr {
34 struct capi_ctr *next; /* next ctr of same driver */
35 struct capi_driver *driver;
36 int cnr; /* controller number */
37 char name[32]; /* name of controller */
38 volatile unsigned short cardstate; /* controller state */
39 volatile int blocked; /* output blocked */
40 int traceflag; /* capi trace */
42 void *driverdata; /* driver specific */
44 /* filled before calling ready callback */
45 __u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
46 capi_version version; /* CAPI_GET_VERSION */
47 capi_profile profile; /* CAPI_GET_PROFILE */
48 __u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */
50 /* functions */
51 void (*ready)(struct capi_ctr * card);
52 void (*reseted)(struct capi_ctr * card);
53 void (*suspend_output)(struct capi_ctr * card);
54 void (*resume_output)(struct capi_ctr * card);
55 void (*handle_capimsg)(struct capi_ctr * card,
56 __u16 appl, struct sk_buff *skb);
57 void (*appl_registered)(struct capi_ctr * card, __u16 appl);
58 void (*appl_released)(struct capi_ctr * card, __u16 appl);
60 void (*new_ncci)(struct capi_ctr * card,
61 __u16 appl, __u32 ncci, __u32 winsize);
62 void (*free_ncci)(struct capi_ctr * card, __u16 appl, __u32 ncci);
64 /* management information for kcapi */
66 unsigned long nrecvctlpkt;
67 unsigned long nrecvdatapkt;
68 unsigned long nsentctlpkt;
69 unsigned long nsentdatapkt;
71 struct proc_dir_entry *procent;
72 char procfn[128];
75 struct capi_driver_interface {
76 struct capi_ctr *(*attach_ctr)(struct capi_driver *driver, char *name, void *data);
77 int (*detach_ctr)(struct capi_ctr *);
80 struct capi_driver {
81 char name[32]; /* driver name */
82 char revision[32];
83 int (*load_firmware)(struct capi_ctr *, capiloaddata *);
84 void (*reset_ctr)(struct capi_ctr *);
85 void (*remove_ctr)(struct capi_ctr *);
86 void (*register_appl)(struct capi_ctr *, __u16 appl,
87 capi_register_params *);
88 void (*release_appl)(struct capi_ctr *, __u16 appl);
89 void (*send_message)(struct capi_ctr *, struct sk_buff *skb);
91 char *(*procinfo)(struct capi_ctr *);
92 int (*ctr_read_proc)(char *page, char **start, off_t off,
93 int count, int *eof, struct capi_ctr *card);
94 int (*driver_read_proc)(char *page, char **start, off_t off,
95 int count, int *eof, struct capi_driver *driver);
97 int (*add_card)(struct capi_driver *driver, capicardparams *data);
99 /* intitialized by kcapi */
100 struct capi_ctr *controller; /* list of controllers */
101 struct capi_driver *next;
102 int ncontroller;
103 struct proc_dir_entry *procent;
104 char procfn[128];
107 struct capi_driver_interface *attach_capi_driver(struct capi_driver *driver);
108 void detach_capi_driver(struct capi_driver *driver);
110 #endif /* __CAPILLI_H__ */