6 * Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation version 2 of the License.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include "libsysfs/sysfs/libsysfs.h"
31 #define KEY_KERNEL "KERNEL"
32 #define KEY_SUBSYSTEM "SUBSYSTEM"
33 #define KEY_ACTION "ACTION"
36 #define KEY_PROGRAM "PROGRAM"
37 #define KEY_RESULT "RESULT"
38 #define KEY_DRIVER "DRIVER"
39 #define KEY_SYSFS "SYSFS"
41 #define KEY_NAME "NAME"
42 #define KEY_SYMLINK "SYMLINK"
43 #define KEY_OWNER "OWNER"
44 #define KEY_GROUP "GROUP"
45 #define KEY_MODE "MODE"
47 #define KEY_OPTIONS "OPTIONS"
49 #define OPTION_LAST_RULE "last_rule"
50 #define OPTION_IGNORE_DEVICE "ignore_device"
51 #define OPTION_IGNORE_REMOVE "ignore_remove"
52 #define OPTION_PARTITIONS "all_partitions"
54 #define KEY_SYSFS_PAIRS_MAX 5
55 #define KEY_ENV_PAIRS_MAX 5
57 #define RULEFILE_SUFFIX ".rules"
70 char value[VALUE_SIZE];
71 enum key_operation operation;
75 struct list_head node;
77 char kernel[NAME_SIZE];
78 enum key_operation kernel_operation;
79 char subsystem[NAME_SIZE];
80 enum key_operation subsystem_operation;
81 char action[NAME_SIZE];
82 enum key_operation action_operation;
84 enum key_operation bus_operation;
86 enum key_operation id_operation;
87 char driver[NAME_SIZE];
88 enum key_operation driver_operation;
89 char program[PATH_SIZE];
90 enum key_operation program_operation;
91 char result[PATH_SIZE];
92 enum key_operation result_operation;
93 struct key_pair sysfs_pair[KEY_SYSFS_PAIRS_MAX];
95 struct key_pair env_pair[KEY_ENV_PAIRS_MAX];
99 enum key_operation name_operation;
100 char symlink[PATH_SIZE];
101 enum key_operation symlink_operation;
102 char owner[USER_SIZE];
103 enum key_operation owner_operation;
104 char group[USER_SIZE];
105 enum key_operation group_operation;
107 enum key_operation mode_operation;
109 enum key_operation run_operation;
116 char config_file[PATH_SIZE];
120 extern struct list_head udev_rule_list;
122 extern int udev_rules_init(void);
123 extern int udev_rules_get_name(struct udevice *udev, struct sysfs_class_device *class_dev);
124 extern int udev_rules_get_run(struct udevice *udev, struct sysfs_device *sysfs_device);
125 extern void udev_rules_close(void);