13 #include <linux/module.h>
15 #include <linux/kernel.h>
16 #include <linux/poll.h>
18 #include <asm/uaccess.h>
26 static char *main_revision =
"$Revision: 1.32.6.10 $";
37 static unsigned long diva_dbg_mem = 0;
41 "Eicon DIVA - MAINT module (http://www.melware.net)";
42 static char *DRIVERLNAME =
"diva_mnt";
43 static char *
DEVNAME =
"DivasMAINT";
47 static unsigned long opened;
57 static char *getrev(
const char *
revision)
62 if ((p =
strchr(revision,
':'))) {
120 unsigned int mask = 0;
122 poll_wait(file, &msgwaitq, wait);
130 static int maint_open(
struct inode *
ino,
struct file *filep)
147 static int maint_close(
struct inode *ino,
struct file *filep)
160 static ssize_t divas_maint_write(
struct file *file,
const char __user *
buf,
161 size_t count, loff_t *ppos)
166 static ssize_t divas_maint_read(
struct file *file,
char __user *buf,
167 size_t count, loff_t *ppos)
175 .read = divas_maint_read,
176 .write = divas_maint_write,
179 .release = maint_close
182 static void divas_maint_unregister_chrdev(
void)
184 unregister_chrdev(major,
DEVNAME);
187 static int __init divas_maint_register_chrdev(
void)
189 if ((major = register_chrdev(0,
DEVNAME, &divas_maint_fops)) < 0)
210 static int __init maint_init(
void)
221 strcpy(tmprev, main_revision);
224 if (!divas_maint_register_chrdev()) {
232 divas_maint_unregister_chrdev();
237 printk(
KERN_INFO "%s: trace buffer = %p - %d kBytes, %s (Major: %d)\n",
239 (diva_dbg_mem == 0) ?
"internal" :
"external", major);
248 static void __exit maint_exit(
void)
250 divas_maint_unregister_chrdev();