}
}
- /* check for matching kernel name*/
+ /* check for matching kernel name */
if (dev->kernel[0] != '\0') {
dbg("check for " FIELD_KERNEL " dev->kernel='%s' class_dev->name='%s'", dev->kernel, class_dev->name);
if (strcmp_pattern(dev->kernel, class_dev->name) != 0) {
}
}
+ /* check for matching subsystem */
+ if (dev->subsystem[0] != '\0') {
+ dbg("check for " FIELD_SUBSYSTEM " dev->subsystem='%s' class_dev->name='%s'", dev->subsystem, class_dev->name);
+ if (strcmp_pattern(dev->subsystem, udev->subsystem) != 0) {
+ dbg(FIELD_SUBSYSTEM " is not matching");
+ goto try_parent;
+ } else {
+ dbg(FIELD_SUBSYSTEM " matches");
+ }
+ }
+
/* check for matching bus id */
if (dev->id[0] != '\0') {
dbg("check " FIELD_ID);
#define FIELD_PROGRAM "PROGRAM"
#define FIELD_RESULT "RESULT"
#define FIELD_KERNEL "KERNEL"
+#define FIELD_SUBSYSTEM "SUBSYSTEM"
#define FIELD_NAME "NAME"
#define FIELD_SYMLINK "SYMLINK"
#define FIELD_OWNER "OWNER"
char kernel[NAME_SIZE];
char program[PROGRAM_SIZE];
char result[PROGRAM_SIZE];
+ char subsystem[SUBSYSTEM_SIZE];
char name[NAME_SIZE];
char symlink[NAME_SIZE];
struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
continue;
}
+ if (strcasecmp(temp2, FIELD_SUBSYSTEM) == 0) {
+ strfieldcpy(dev.subsystem, temp3);
+ valid = 1;
+ continue;
+ }
+
if (strcasecmp(temp2, FIELD_PROGRAM) == 0) {
program_given = 1;
strfieldcpy(dev.program, temp3);
exp_name => "cdrom",
conf => <<EOF
KERNEL="sda", NAME="cdrom%e"
+EOF
+ },
+ {
+ desc => "SUBSYSTEM test",
+ subsys => "block",
+ devpath => "/block/sda",
+ exp_name => "node",
+ conf => <<EOF
+BUS="scsi", KERNEL="sda", NAME="should_not_match", SUBSYSTEM="vc"
+BUS="scsi", KERNEL="sda", NAME="node", SUBSYSTEM="block"
+BUS="scsi", KERNEL="sda", NAME="should_not_match2", SUBSYSTEM="vc"
EOF
},
);
.B KERNEL
Match the kernel device name.
.TP
+.B SUBSYSTEM
+Match the kernel's subsystem name.
+.TP
+.TP
.B ID
Match the device number on the bus, like PCI bus id.
.TP