Kennung für das Versionskontroll-System:
char *rcs = ''$Id: pendulum.c,v 1.141 1996/04/23 16:34:01 heuler$'';
Globale Variablen:
char kernel_version[] = UTS_RELEASE; /* kernel version */ int major = PENDEL_MAJOR; /* major device id */ int irq = PENDEL_IRQ; /* pendulum card irq */ int base = PENDEL_BASE; /* pendulum card base */ int freq = PENDEL_FREQ; /* frequency of update */ volatile int force; /* force for pendulum in next IRQ */ volatile int force_flag; /* force controlling */ volatile int old_irqcounter; /* old counter of irq */ volatile int skipped; /* number of irqs skipped */ volatile int max_skipped; /* max number of irqs skipped */ struct task_struct *process; /* controlling process */ int process_pid; /* controlling process pid */
Lokale Variablen:
static int lock_ctrl; /* this flag is set when the
ctrl device is openend */
static io_outstruct outdata; /* struct for output of iodata */
static struct file_operations pendel_fops = {
NULL, /* lseek */
pendel_read, /* read */
pendel_write, /* write */
NULL, /* readdir */
NULL, /* select */
pendel_ioctl, /* ioctl */
NULL, /* mmap */
pendel_open, /* open */
pendel_close, /* close */
NULL, /* fsync */
NULL, /* fasync */
NULL, /* check media_change */
NULL /* revalidate */
};
Callback - Wird aufgerufen, wenn das Modul entfernt wird:
void cleanup_module();
Callback - Wird bei Lesezugriffen auf das Device aufgerufen:
int pendel_read(struct inode *ip, struct file *fp, char* to, int len);
Callback - Wird bei Schreibzugriffen auf das Device aufgerufen:
int pendel_write(struct inode *ip, struct file *fp, const char*
from, int len);
Callback - Wird bei Kontrollzugriffen auf das Device aufgerufen:
int pendel_ioctl(struct inode *ip, struct file *fp, uint cmd,
ulong arg);
Callback - Wird beim Öffnen des Device aufgerufen:
int pendel_open(struct inode *ip, struct file *fp);
Callback - Wird beim Schließen des Device aufgerufen:
void pendel_close(struct inode *ip, struct file *fp);
Bearbeitet ASCII-Befehle mit Argumenten:
void command_sarg(char *str, int cmd, int fl);
Bearbeitet ASCII-Befehle ohne Argumente:
int parse_command(char *str);