aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/ftdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/litmus/ftdev.h')
-rw-r--r--include/litmus/ftdev.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/litmus/ftdev.h b/include/litmus/ftdev.h
index 7697b4616699..348387e9adf9 100644
--- a/include/litmus/ftdev.h
+++ b/include/litmus/ftdev.h
@@ -6,8 +6,6 @@
6#include <linux/mutex.h> 6#include <linux/mutex.h>
7#include <linux/cdev.h> 7#include <linux/cdev.h>
8 8
9#define MAX_FTDEV_MINORS NR_CPUS
10
11#define FTDEV_ENABLE_CMD 0 9#define FTDEV_ENABLE_CMD 0
12#define FTDEV_DISABLE_CMD 1 10#define FTDEV_DISABLE_CMD 1
13 11
@@ -28,12 +26,15 @@ struct ftdev_minor {
28 struct mutex lock; 26 struct mutex lock;
29 /* FIXME: filter for authorized events */ 27 /* FIXME: filter for authorized events */
30 struct ftdev_event* events; 28 struct ftdev_event* events;
29 struct device* device;
31}; 30};
32 31
33struct ftdev { 32struct ftdev {
33 dev_t major;
34 struct cdev cdev; 34 struct cdev cdev;
35 /* FIXME: don't waste memory, allocate dynamically */ 35 struct class* class;
36 struct ftdev_minor minor[MAX_FTDEV_MINORS]; 36 const char* name;
37 struct ftdev_minor* minor;
37 unsigned int minor_cnt; 38 unsigned int minor_cnt;
38 ftdev_alloc_t alloc; 39 ftdev_alloc_t alloc;
39 ftdev_free_t free; 40 ftdev_free_t free;
@@ -43,7 +44,9 @@ struct ftdev {
43struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size); 44struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size);
44void free_ft_buffer(struct ft_buffer* buf); 45void free_ft_buffer(struct ft_buffer* buf);
45 46
46void ftdev_init(struct ftdev* ftdev, struct module* owner); 47int ftdev_init( struct ftdev* ftdev, struct module* owner,
47int register_ftdev(struct ftdev* ftdev, const char* name, int major); 48 const int minor_cnt, const char* name);
49void ftdev_exit(struct ftdev* ftdev);
50int register_ftdev(struct ftdev* ftdev);
48 51
49#endif 52#endif