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"
30 #define KEY_SYSFS_PAIRS_MAX 5
31 #define KEY_ENV_PAIRS_MAX 5
33 #define RULEFILE_SUFFIX ".rules"
46 char value[VALUE_SIZE];
47 enum key_operation operation;
51 struct list_head node;
53 char kernel_name[NAME_SIZE];
54 enum key_operation kernel_operation;
55 char subsystem[NAME_SIZE];
56 enum key_operation subsystem_operation;
57 char action[NAME_SIZE];
58 enum key_operation action_operation;
59 char devpath[PATH_SIZE];
60 enum key_operation devpath_operation;
62 enum key_operation bus_operation;
64 enum key_operation id_operation;
65 char driver[NAME_SIZE];
66 enum key_operation driver_operation;
67 char program[PATH_SIZE];
68 enum key_operation program_operation;
69 char result[PATH_SIZE];
70 enum key_operation result_operation;
71 struct key_pair sysfs_pair[KEY_SYSFS_PAIRS_MAX];
73 struct key_pair env_pair[KEY_ENV_PAIRS_MAX];
75 char modalias[NAME_SIZE];
76 enum key_operation modalias_operation;
77 char import[PATH_SIZE];
78 enum key_operation import_operation;
82 enum key_operation name_operation;
83 char symlink[PATH_SIZE];
84 enum key_operation symlink_operation;
85 char owner[USER_SIZE];
86 enum key_operation owner_operation;
87 char group[USER_SIZE];
88 enum key_operation group_operation;
90 enum key_operation mode_operation;
92 enum key_operation run_operation;
99 char config_file[PATH_SIZE];
103 extern int udev_rules_init(void);
104 extern void udev_rules_close(void);
106 extern int udev_rules_iter_init(void);
107 extern struct udev_rule *udev_rules_iter_next(void);
109 extern int udev_rules_get_name(struct udevice *udev, struct sysfs_class_device *class_dev);
110 extern int udev_rules_get_run(struct udevice *udev, struct sysfs_device *sysfs_device);