Lines Matching refs:uevent
324 std::vector<std::string> DeviceHandler::GetBlockDeviceSymlinks(const Uevent& uevent) const { in GetBlockDeviceSymlinks()
330 if (FindPlatformDevice(uevent.path, &device)) { in GetBlockDeviceSymlinks()
342 } else if (FindPciDevicePrefix(uevent.path, &device)) { in GetBlockDeviceSymlinks()
344 } else if (FindVbdDevicePrefix(uevent.path, &device)) { in GetBlockDeviceSymlinks()
346 } else if (FindDmDevice(uevent.path, &partition, &uuid)) { in GetBlockDeviceSymlinks()
363 if (!uevent.partition_name.empty()) { in GetBlockDeviceSymlinks()
364 std::string partition_name_sanitized(uevent.partition_name); in GetBlockDeviceSymlinks()
366 if (partition_name_sanitized != uevent.partition_name) { in GetBlockDeviceSymlinks()
367 LOG(VERBOSE) << "Linking partition '" << uevent.partition_name << "' as '" in GetBlockDeviceSymlinks()
378 links.emplace_back("/dev/block/by-name/" + uevent.device_name); in GetBlockDeviceSymlinks()
381 auto last_slash = uevent.path.rfind('/'); in GetBlockDeviceSymlinks()
382 links.emplace_back(link_path + "/" + uevent.path.substr(last_slash + 1)); in GetBlockDeviceSymlinks()
453 void DeviceHandler::HandleAshmemUevent(const Uevent& uevent) { in HandleAshmemUevent() argument
454 if (uevent.device_name == "ashmem") { in HandleAshmemUevent()
463 Uevent dup_ashmem_uevent = uevent; in HandleAshmemUevent()
470 void DeviceHandler::HandleUevent(const Uevent& uevent) { in HandleUevent() argument
471 if (uevent.action == "add" || uevent.action == "change" || in HandleUevent()
472 uevent.action == "bind" || uevent.action == "online") { in HandleUevent()
473 FixupSysPermissions(uevent.path, uevent.subsystem); in HandleUevent()
477 if (uevent.major < 0 || uevent.minor < 0) return; in HandleUevent()
483 if (uevent.subsystem == "block") { in HandleUevent()
485 devpath = "/dev/block/" + Basename(uevent.path); in HandleUevent()
487 if (StartsWith(uevent.path, "/devices")) { in HandleUevent()
488 links = GetBlockDeviceSymlinks(uevent); in HandleUevent()
491 std::find(subsystems_.cbegin(), subsystems_.cend(), uevent.subsystem); in HandleUevent()
493 devpath = subsystem->ParseDevPath(uevent); in HandleUevent()
494 } else if (uevent.subsystem == "usb") { in HandleUevent()
495 if (!uevent.device_name.empty()) { in HandleUevent()
496 devpath = "/dev/" + uevent.device_name; in HandleUevent()
501 int bus_id = uevent.minor / 128 + 1; in HandleUevent()
502 int device_id = uevent.minor % 128 + 1; in HandleUevent()
505 } else if (StartsWith(uevent.subsystem, "usb")) { in HandleUevent()
508 } else if (uevent.subsystem == "misc" && StartsWith(uevent.device_name, "dm-user/")) { in HandleUevent()
509 devpath = "/dev/dm-user/" + uevent.device_name.substr(8); in HandleUevent()
511 devpath = "/dev/" + Basename(uevent.path); in HandleUevent()
516 HandleDevice(uevent.action, devpath, block, uevent.major, uevent.minor, links); in HandleUevent()
520 HandleAshmemUevent(uevent); in HandleUevent()