From 37eb46be881dde4b405d3d8b48e76b4a8d62ae2c Mon Sep 17 00:00:00 2001 From: Christopher Kenna Date: Fri, 7 Jan 2011 20:46:25 -0500 Subject: Feather-Trace: register devices with sysfs This patch implements support for Feather-Trace devices to use the sysfs file system and, consequently, udev support. This allows us to allocate major/minor numbers for Feather-Trace devices dynamically, which is desirable because our old static allocations tend to create conflicts on modern distributions and/or when there are many cores. --- include/litmus/ftdev.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/litmus/ftdev.h') diff --git a/include/litmus/ftdev.h b/include/litmus/ftdev.h index 7697b4616699..efb2a5c9a9b0 100644 --- a/include/litmus/ftdev.h +++ b/include/litmus/ftdev.h @@ -28,10 +28,13 @@ struct ftdev_minor { struct mutex lock; /* FIXME: filter for authorized events */ struct ftdev_event* events; + struct device* device; }; struct ftdev { struct cdev cdev; + struct class* class; + const char* name; /* FIXME: don't waste memory, allocate dynamically */ struct ftdev_minor minor[MAX_FTDEV_MINORS]; unsigned int minor_cnt; @@ -43,7 +46,7 @@ struct ftdev { struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size); void free_ft_buffer(struct ft_buffer* buf); -void ftdev_init(struct ftdev* ftdev, struct module* owner); -int register_ftdev(struct ftdev* ftdev, const char* name, int major); +void ftdev_init(struct ftdev* ftdev, struct module* owner, const char* name); +int register_ftdev(struct ftdev* ftdev); #endif -- cgit v1.2.2