summaryrefslogtreecommitdiff
path: root/udev.h
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-10-18 19:11:51 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 22:02:46 -0700
commit7a947ce51586fd4212447643df90580542777ab9 (patch)
treed9d30236cf65e489b9bc2c5003ef9e1fa838f53e /udev.h
parent8e0871196c916be60a9d0327ce8483c4f9763c17 (diff)
[PATCH] big cleanup of internal udev api
Here is the first patch to cleanup the internal processing of the various stages of an udev event. It should not change any behavior, but if your system depends on udev, please always test it before reboot :) We pass only one generic structure around between add, remove, namedev, db and dev_d handling and make all relevant data available to all internal stages. All udev structures are renamed to "udev". We replace the fake parameter by a flag in the udev structure. We open the class device in the main binaries and not in udev_add, to make it possible to use libsysfs for udevstart directory crawling. The last sleep parameters are removed.
Diffstat (limited to 'udev.h')
-rw-r--r--udev.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/udev.h b/udev.h
index 642b30b517..70de729f30 100644
--- a/udev.h
+++ b/udev.h
@@ -41,11 +41,8 @@
#define LINE_SIZE 256
-#define FAKE 1
-#define NOFAKE 0
-
/* length of public data to store in udevdb */
-#define UDEVICE_LEN (offsetof(struct udevice, bus_id))
+#define UDEVICE_DB_LEN (offsetof(struct udevice, devpath))
struct udevice {
char name[NAME_SIZE];
@@ -61,20 +58,23 @@ struct udevice {
char config_file[NAME_SIZE];
long config_uptime;
- /* private data that help us in building strings */
+ /* private data, not stored in udevdb */
+ char devpath[DEVPATH_SIZE];
+ char subsystem[SUBSYSTEM_SIZE];
char bus_id[SYSFS_NAME_LEN];
+ char bus[SYSFS_NAME_LEN];
char program_result[NAME_SIZE];
char kernel_number[NAME_SIZE];
char kernel_name[NAME_SIZE];
+ int test_run;
};
-extern int udev_add_device(const char *path, const char *subsystem, int fake);
-extern int udev_remove_device(const char *path, const char *subsystem);
+extern int udev_add_device(struct udevice *udev, struct sysfs_class_device *class_dev);
+extern int udev_remove_device(struct udevice *udev);
extern void udev_init_config(void);
extern int udev_start(void);
extern int parse_get_pair(char **orig_string, char **left, char **right);
-extern void dev_d_send(struct udevice *dev, const char *subsystem,
- const char *devpath);
+extern void dev_d_send(struct udevice *udev);
extern char **main_argv;
extern char **main_envp;