1 /* $Id: capilli.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
3 * Kernel CAPI 2.0 Driver Interface for Linux
5 * Copyright 1999 by Carsten Paeth <calle@calle.de>
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
15 typedef struct capiloaddatapart {
16 int user; /* data in userspace ? */
21 typedef struct capiloaddata {
22 capiloaddatapart firmware;
23 capiloaddatapart configuration;
26 typedef struct capicardparams {
37 struct capi_ctr *next; /* next ctr of same driver */
38 struct capi_driver *driver;
39 int cnr; /* controller number */
40 char name[32]; /* name of controller */
41 volatile unsigned short cardstate; /* controller state */
42 volatile int blocked; /* output blocked */
43 int traceflag; /* capi trace */
45 void *driverdata; /* driver specific */
47 /* filled before calling ready callback */
48 __u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
49 capi_version version; /* CAPI_GET_VERSION */
50 capi_profile profile; /* CAPI_GET_PROFILE */
51 __u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */
54 void (*ready)(struct capi_ctr * card);
55 void (*reseted)(struct capi_ctr * card);
56 void (*suspend_output)(struct capi_ctr * card);
57 void (*resume_output)(struct capi_ctr * card);
58 void (*handle_capimsg)(struct capi_ctr * card,
59 __u16 appl, struct sk_buff *skb);
60 void (*appl_registered)(struct capi_ctr * card, __u16 appl);
61 void (*appl_released)(struct capi_ctr * card, __u16 appl);
63 void (*new_ncci)(struct capi_ctr * card,
64 __u16 appl, __u32 ncci, __u32 winsize);
65 void (*free_ncci)(struct capi_ctr * card, __u16 appl, __u32 ncci);
67 /* management information for kcapi */
69 unsigned long nrecvctlpkt;
70 unsigned long nrecvdatapkt;
71 unsigned long nsentctlpkt;
72 unsigned long nsentdatapkt;
74 struct proc_dir_entry *procent;
78 struct capi_driver_interface {
79 struct capi_ctr *(*attach_ctr)(struct capi_driver *driver, char *name, void *data);
80 int (*detach_ctr)(struct capi_ctr *);
84 char name[32]; /* driver name */
86 int (*load_firmware)(struct capi_ctr *, capiloaddata *);
87 void (*reset_ctr)(struct capi_ctr *);
88 void (*remove_ctr)(struct capi_ctr *);
89 void (*register_appl)(struct capi_ctr *, __u16 appl,
90 capi_register_params *);
91 void (*release_appl)(struct capi_ctr *, __u16 appl);
92 void (*send_message)(struct capi_ctr *, struct sk_buff *skb);
94 char *(*procinfo)(struct capi_ctr *);
95 int (*ctr_read_proc)(char *page, char **start, off_t off,
96 int count, int *eof, struct capi_ctr *card);
97 int (*driver_read_proc)(char *page, char **start, off_t off,
98 int count, int *eof, struct capi_driver *driver);
100 int (*add_card)(struct capi_driver *driver, capicardparams *data);
102 /* intitialized by kcapi */
103 struct capi_ctr *controller; /* list of controllers */
104 struct capi_driver *next;
106 struct proc_dir_entry *procent;
110 struct capi_driver_interface *attach_capi_driver(struct capi_driver *driver);
111 void detach_capi_driver(struct capi_driver *driver);
113 #endif /* __CAPILLI_H__ */