X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=namedev.h;h=e29279243bca829838408d00582984bf140c7123;hb=7d92b28f3971f1d80a85964c1bbde6146e411379;hp=3837e864a0049e4c70d2f60f0c3c9ecd8deebe64;hpb=6818c51d7abeab9914eb7193968b1efa9459a853;p=elogind.git diff --git a/namedev.h b/namedev.h index 3837e864a..e29279243 100644 --- a/namedev.h +++ b/namedev.h @@ -28,12 +28,13 @@ struct sysfs_class_device; -#define BUS_SIZE 30 -#define FILE_SIZE 50 -#define VALUE_SIZE 100 -#define ID_SIZE 50 -#define PLACE_SIZE 50 -#define PROGRAM_SIZE 100 +#define BUS_SIZE 32 +#define FILE_SIZE 64 +#define VALUE_SIZE 128 +#define ID_SIZE 64 +#define PLACE_SIZE 64 +#define DRIVER_SIZE 64 +#define PROGRAM_SIZE 128 #define FIELD_BUS "BUS" #define FIELD_SYSFS "SYSFS" @@ -43,6 +44,7 @@ struct sysfs_class_device; #define FIELD_RESULT "RESULT" #define FIELD_KERNEL "KERNEL" #define FIELD_SUBSYSTEM "SUBSYSTEM" +#define FIELD_DRIVER "DRIVER" #define FIELD_NAME "NAME" #define FIELD_SYMLINK "SYMLINK" #define FIELD_OWNER "OWNER" @@ -50,6 +52,7 @@ struct sysfs_class_device; #define FIELD_MODE "MODE" #define ATTR_PARTITIONS "all_partitions" +#define ATTR_IGNORE_REMOVE "ignore_remove" #define PARTITIONS_COUNT 15 #define MAX_SYSFS_PAIRS 5 @@ -57,14 +60,6 @@ struct sysfs_class_device; #define RULEFILE_SUFFIX ".rules" #define PERMFILE_SUFFIX ".permissions" -#define set_empty_perms(dev, m, o, g) \ - if (dev->mode == 0) \ - dev->mode = m; \ - if (dev->owner[0] == '\0') \ - strfieldcpy(dev->owner, o); \ - if (dev->group[0] == '\0') \ - strfieldcpy(dev->group, g); - struct sysfs_pair { char file[FILE_SIZE]; char value[VALUE_SIZE]; @@ -80,13 +75,15 @@ struct config_device { char program[PROGRAM_SIZE]; char result[PROGRAM_SIZE]; char subsystem[SUBSYSTEM_SIZE]; + char driver[DRIVER_SIZE]; char name[NAME_SIZE]; char symlink[NAME_SIZE]; struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS]; - char owner[OWNER_SIZE]; - char group[GROUP_SIZE]; - unsigned int mode; + char owner[USER_SIZE]; + char group[USER_SIZE]; + mode_t mode; int partitions; + int ignore_remove; char config_file[NAME_SIZE]; int config_line; }; @@ -95,8 +92,8 @@ struct perm_device { struct list_head node; char name[NAME_SIZE]; - char owner[OWNER_SIZE]; - char group[GROUP_SIZE]; + char owner[USER_SIZE]; + char group[USER_SIZE]; unsigned int mode; };