Back to home page

OSCL-LXR

 
 

    


0001 /* $Id: capilli.h,v 1.1.2.2 2004/01/16 21:09:27 keil Exp $
0002  * 
0003  * Kernel CAPI 2.0 Driver Interface for Linux
0004  * 
0005  * Copyright 1999 by Carsten Paeth <calle@calle.de>
0006  * 
0007  * This software may be used and distributed according to the terms
0008  * of the GNU General Public License, incorporated herein by reference.
0009  *
0010  */
0011 
0012 #ifndef __CAPILLI_H__
0013 #define __CAPILLI_H__
0014 
0015 #include <linux/kernel.h>
0016 #include <linux/list.h>
0017 #include <linux/capi.h>
0018 #include <linux/kernelcapi.h>
0019 
0020 typedef struct capiloaddatapart {
0021     int user;       /* data in userspace ? */
0022     int len;
0023     unsigned char *data;
0024 } capiloaddatapart;
0025 
0026 typedef struct capiloaddata {
0027     capiloaddatapart firmware;
0028     capiloaddatapart configuration;
0029 } capiloaddata;
0030 
0031 typedef struct capicardparams {
0032     unsigned int port;
0033     unsigned irq;
0034     int cardtype;
0035     int cardnr;
0036     unsigned int membase;
0037 } capicardparams;
0038 
0039 struct capi_ctr {
0040     /* filled in before calling attach_capi_ctr */
0041     struct module *owner;
0042     void *driverdata;           /* driver specific */
0043     char name[32];              /* name of controller */
0044     char *driver_name;          /* name of driver */
0045     int (*load_firmware)(struct capi_ctr *, capiloaddata *);
0046     void (*reset_ctr)(struct capi_ctr *);
0047     void (*register_appl)(struct capi_ctr *, u16 appl,
0048                   capi_register_params *);
0049     void (*release_appl)(struct capi_ctr *, u16 appl);
0050     u16  (*send_message)(struct capi_ctr *, struct sk_buff *skb);
0051     
0052     char *(*procinfo)(struct capi_ctr *);
0053     int (*proc_show)(struct seq_file *, void *);
0054 
0055     /* filled in before calling ready callback */
0056     u8 manu[CAPI_MANUFACTURER_LEN];     /* CAPI_GET_MANUFACTURER */
0057     capi_version version;           /* CAPI_GET_VERSION */
0058     capi_profile profile;           /* CAPI_GET_PROFILE */
0059     u8 serial[CAPI_SERIAL_LEN];     /* CAPI_GET_SERIAL */
0060 
0061     /* management information for kcapi */
0062 
0063     unsigned long nrecvctlpkt;
0064     unsigned long nrecvdatapkt;
0065     unsigned long nsentctlpkt;
0066     unsigned long nsentdatapkt;
0067 
0068     int cnr;                /* controller number */
0069     unsigned short state;           /* controller state */
0070     int blocked;                /* output blocked */
0071     int traceflag;              /* capi trace */
0072 
0073     struct proc_dir_entry *procent;
0074         char procfn[128];
0075 };
0076 
0077 int attach_capi_ctr(struct capi_ctr *);
0078 int detach_capi_ctr(struct capi_ctr *);
0079 
0080 void capi_ctr_ready(struct capi_ctr * card);
0081 void capi_ctr_down(struct capi_ctr * card);
0082 void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb);
0083 
0084 // ---------------------------------------------------------------------------
0085 // needed for AVM capi drivers
0086 
0087 struct capi_driver {
0088     char name[32];              /* driver name */
0089     char revision[32];
0090 
0091     /* management information for kcapi */
0092     struct list_head list; 
0093 };
0094 
0095 #endif              /* __CAPILLI_H__ */