2 * $Id: capilli.h,v 1.4 1999/07/23 08:51:05 calle Exp $
4 * Kernel CAPI 2.0 Driver Interface for Linux
6 * (c) Copyright 1999 by Carsten Paeth (calle@calle.in-berlin.de)
12 typedef struct capiloaddatapart
{
13 int user
; /* data in userspace ? */
18 typedef struct capiloaddata
{
19 capiloaddatapart firmware
;
20 capiloaddatapart configuration
;
23 typedef struct capicardparams
{
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 */
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
;
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
*);
81 char name
[32]; /* driver name */
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
;
103 struct proc_dir_entry
*procent
;
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__ */