extern char sysfs_path[PATH_SIZE];
extern int sysfs_init(void);
extern void sysfs_cleanup(void);
-extern void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath, const char *subsystem);
+extern void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath,
+ const char *subsystem, const char *driver);
extern struct sysfs_device *sysfs_device_get(const char *devpath);
extern struct sysfs_device *sysfs_device_get_parent(struct sysfs_device *dev);
extern struct sysfs_device *sysfs_device_get_parent_with_subsystem(struct sysfs_device *dev, const char *subsystem);
}
}
-void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath, const char *subsystem)
+void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath,
+ const char *subsystem, const char *driver)
{
char *pos;
strlcpy(dev->devpath, devpath, sizeof(dev->devpath));
if (subsystem != NULL)
strlcpy(dev->subsystem, subsystem, sizeof(dev->subsystem));
+ if (driver != NULL)
+ strlcpy(dev->driver, driver, sizeof(dev->driver));
/* set kernel name */
pos = strrchr(dev->devpath, '/');
return NULL;
memset(dev, 0x00, sizeof(struct sysfs_device));
- sysfs_device_set_values(dev, devpath_real, NULL);
+ sysfs_device_set_values(dev, devpath_real, NULL, NULL);
/* get subsystem */
if (strncmp(dev->devpath, "/class/", 7) == 0) {
if (udev == NULL)
return -1;
strlcpy(udev->action, msg->action, sizeof(udev->action));
- sysfs_device_set_values(udev->dev, msg->devpath, msg->subsystem);
+ sysfs_device_set_values(udev->dev, msg->devpath, msg->subsystem, msg->driver);
udev->devt = msg->devt;
retval = udev_device_event(&rules, udev);
msg->devpath = &key[8];
else if (strncmp(key, "SUBSYSTEM=", 10) == 0)
msg->subsystem = &key[10];
+ else if (strncmp(key, "DRIVER=", 7) == 0)
+ msg->driver = &key[7];
else if (strncmp(key, "SEQNUM=", 7) == 0)
msg->seqnum = strtoull(&key[7], NULL, 10);
else if (strncmp(key, "PHYSDEVPATH=", 12) == 0)
char *action;
char *devpath;
char *subsystem;
+ char *driver;
dev_t devt;
unsigned long long seqnum;
char *physdevpath;