Lines Matching refs:uevent

316 std::vector<std::string> DeviceHandler::GetBlockDeviceSymlinks(const Uevent& uevent) const {  in GetBlockDeviceSymlinks()
322 if (FindPlatformDevice(uevent.path, &device)) { in GetBlockDeviceSymlinks()
334 } else if (FindPciDevicePrefix(uevent.path, &device)) { in GetBlockDeviceSymlinks()
336 } else if (FindVbdDevicePrefix(uevent.path, &device)) { in GetBlockDeviceSymlinks()
338 } else if (FindDmDevice(uevent.path, &partition, &uuid)) { in GetBlockDeviceSymlinks()
355 if (!uevent.partition_name.empty()) { in GetBlockDeviceSymlinks()
356 std::string partition_name_sanitized(uevent.partition_name); in GetBlockDeviceSymlinks()
358 if (partition_name_sanitized != uevent.partition_name) { in GetBlockDeviceSymlinks()
359 LOG(VERBOSE) << "Linking partition '" << uevent.partition_name << "' as '" in GetBlockDeviceSymlinks()
370 links.emplace_back("/dev/block/by-name/" + uevent.device_name); in GetBlockDeviceSymlinks()
373 auto last_slash = uevent.path.rfind('/'); in GetBlockDeviceSymlinks()
374 links.emplace_back(link_path + "/" + uevent.path.substr(last_slash + 1)); in GetBlockDeviceSymlinks()
445 void DeviceHandler::HandleAshmemUevent(const Uevent& uevent) { in HandleAshmemUevent() argument
446 if (uevent.device_name == "ashmem") { in HandleAshmemUevent()
455 Uevent dup_ashmem_uevent = uevent; in HandleAshmemUevent()
462 void DeviceHandler::HandleUevent(const Uevent& uevent) { in HandleUevent() argument
463 if (uevent.action == "add" || uevent.action == "change" || uevent.action == "online") { in HandleUevent()
464 FixupSysPermissions(uevent.path, uevent.subsystem); in HandleUevent()
468 if (uevent.major < 0 || uevent.minor < 0) return; in HandleUevent()
474 if (uevent.subsystem == "block") { in HandleUevent()
476 devpath = "/dev/block/" + Basename(uevent.path); in HandleUevent()
478 if (StartsWith(uevent.path, "/devices")) { in HandleUevent()
479 links = GetBlockDeviceSymlinks(uevent); in HandleUevent()
482 std::find(subsystems_.cbegin(), subsystems_.cend(), uevent.subsystem); in HandleUevent()
484 devpath = subsystem->ParseDevPath(uevent); in HandleUevent()
485 } else if (uevent.subsystem == "usb") { in HandleUevent()
486 if (!uevent.device_name.empty()) { in HandleUevent()
487 devpath = "/dev/" + uevent.device_name; in HandleUevent()
492 int bus_id = uevent.minor / 128 + 1; in HandleUevent()
493 int device_id = uevent.minor % 128 + 1; in HandleUevent()
496 } else if (StartsWith(uevent.subsystem, "usb")) { in HandleUevent()
500 devpath = "/dev/" + Basename(uevent.path); in HandleUevent()
505 HandleDevice(uevent.action, devpath, block, uevent.major, uevent.minor, links); in HandleUevent()
509 HandleAshmemUevent(uevent); in HandleUevent()