1 /* $Id: diva_didd.c,v 1.13.6.4 2005/02/11 19:40:25 armin Exp $
3 * DIDD Interface module for Eicon active cards.
5 * Functions are in dadapter.c
7 * Copyright 2002-2003 by Armin Schindler (mac@melware.de)
8 * Copyright 2002-2003 Cytronics & Melware (info@melware.de)
10 * This software may be used and distributed according to the terms
11 * of the GNU General Public License, incorporated herein by reference.
14 #include <linux/config.h>
15 #include <linux/module.h>
16 #include <linux/init.h>
17 #include <linux/kernel.h>
18 #include <linux/proc_fs.h>
26 static char *main_revision
= "$Revision: 1.13.6.4 $";
28 static char *DRIVERNAME
=
29 "Eicon DIVA - DIDD table (http://www.melware.net)";
30 static char *DRIVERLNAME
= "divadidd";
31 char *DRIVERRELEASE_DIDD
= "2.0";
33 static char *main_proc_dir
= "eicon";
35 MODULE_DESCRIPTION("DIDD table driver for diva drivers");
36 MODULE_AUTHOR("Cytronics & Melware, Eicon Networks");
37 MODULE_SUPPORTED_DEVICE("Eicon diva drivers");
38 MODULE_LICENSE("GPL");
40 #define DBG_MINIMUM (DL_LOG + DL_FTL + DL_ERR)
41 #define DBG_DEFAULT (DBG_MINIMUM + DL_XLOG + DL_REG)
43 extern int diddfunc_init(void);
44 extern void diddfunc_finit(void);
46 extern void DIVA_DIDD_Read(void *, int);
48 static struct proc_dir_entry
*proc_didd
;
49 struct proc_dir_entry
*proc_net_eicon
= NULL
;
51 EXPORT_SYMBOL(DIVA_DIDD_Read
);
52 EXPORT_SYMBOL(proc_net_eicon
);
54 static char *getrev(const char *revision
)
58 if ((p
= strchr(revision
, ':'))) {
68 proc_read(char *page
, char **start
, off_t off
, int count
, int *eof
,
74 strcpy(tmprev
, main_revision
);
75 len
+= sprintf(page
+ len
, "%s\n", DRIVERNAME
);
76 len
+= sprintf(page
+ len
, "name : %s\n", DRIVERLNAME
);
77 len
+= sprintf(page
+ len
, "release : %s\n", DRIVERRELEASE_DIDD
);
78 len
+= sprintf(page
+ len
, "build : %s(%s)\n",
79 diva_didd_common_code_build
, DIVA_BUILD
);
80 len
+= sprintf(page
+ len
, "revision : %s\n", getrev(tmprev
));
82 if (off
+ count
>= len
)
87 return ((count
< len
- off
) ? count
: len
- off
);
90 static int DIVA_INIT_FUNCTION
create_proc(void)
92 proc_net_eicon
= create_proc_entry(main_proc_dir
, S_IFDIR
, proc_net
);
96 create_proc_entry(DRIVERLNAME
, S_IFREG
| S_IRUGO
,
98 proc_didd
->read_proc
= proc_read
;
105 static void DIVA_EXIT_FUNCTION
remove_proc(void)
107 remove_proc_entry(DRIVERLNAME
, proc_net_eicon
);
108 remove_proc_entry(main_proc_dir
, proc_net
);
111 static int DIVA_INIT_FUNCTION
divadidd_init(void)
116 printk(KERN_INFO
"%s\n", DRIVERNAME
);
117 printk(KERN_INFO
"%s: Rel:%s Rev:", DRIVERLNAME
, DRIVERRELEASE_DIDD
);
118 strcpy(tmprev
, main_revision
);
119 printk("%s Build:%s(%s)\n", getrev(tmprev
),
120 diva_didd_common_code_build
, DIVA_BUILD
);
122 if (!create_proc()) {
123 printk(KERN_ERR
"%s: could not create proc entry\n",
129 if (!diddfunc_init()) {
130 printk(KERN_ERR
"%s: failed to connect to DIDD.\n",
143 static void DIVA_EXIT_FUNCTION
divadidd_exit(void)
147 printk(KERN_INFO
"%s: module unloaded.\n", DRIVERLNAME
);
150 module_init(divadidd_init
);
151 module_exit(divadidd_exit
);