summaryrefslogtreecommitdiffstats
path: root/main.h
blob: db38aa8d46bd10c86b5ea197e5e1dcbf616d09c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _HELLOMAIN_H_
#define _HELLOMAIN_H_

#include <linux/cdev.h>

#ifndef HELLO_MAJOR
#define HELLO_MAJOR 0 /* let kernel choose, unless user really defined it */
#endif

#define HELLO_KERNEL_BUFF_LEN 1024

extern int hello_major;
extern int hello_minor;

extern char *magicstr;

struct hello_dev {
    dev_t devnum;
    struct semaphore sem;
    struct cdev cdev; /* char device */

    /* for r/w operations */
    char hello_buffer[HELLO_KERNEL_BUFF_LEN];
    size_t buff_index;
};

/* function prototypes */
int hello_debugfs(void);

#endif