Lines Matching refs:dev

136 static int dev_if_packed_info(sd_device *dev, char *ifs_str, size_t len) {  in dev_if_packed_info()  argument
156 r = sd_device_get_syspath(dev, &syspath); in dev_if_packed_info()
163 return log_device_debug_errno(dev, errno, "Failed to open \"%s\": %m", filename); in dev_if_packed_info()
167 return log_device_warning_errno(dev, SYNTHETIC_ERRNO(EIO), in dev_if_packed_info()
182 return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EIO), in dev_if_packed_info()
227 static int builtin_usb_id(sd_device *dev, sd_netlink **rtnl, int argc, char *argv[], bool test) { in builtin_usb_id() argument
253 assert(dev); in builtin_usb_id()
255 r = sd_device_get_syspath(dev, &syspath); in builtin_usb_id()
259 r = sd_device_get_sysname(dev, &sysname); in builtin_usb_id()
264 if (sd_device_get_devtype(dev, &devtype) >= 0 && streq(devtype, "usb_device")) { in builtin_usb_id()
265 dev_if_packed_info(dev, packed_if_str, sizeof(packed_if_str)); in builtin_usb_id()
266 dev_usb = dev; in builtin_usb_id()
271 … r = sd_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_interface", &dev_interface); in builtin_usb_id()
273 return log_device_debug_errno(dev, r, "Failed to access usb_interface: %m"); in builtin_usb_id()
312 … r = sd_device_get_parent_with_subsystem_devtype(dev, "scsi", "scsi_device", &dev_scsi); in builtin_usb_id()
314 log_device_debug_errno(dev, r, "Unable to find parent SCSI device"); in builtin_usb_id()
430 udev_builtin_add_property(dev, test, "ID_VENDOR", vendor_str); in builtin_usb_id()
431 udev_builtin_add_property(dev, test, "ID_VENDOR_ENC", vendor_str_enc); in builtin_usb_id()
432 udev_builtin_add_property(dev, test, "ID_VENDOR_ID", vendor_id); in builtin_usb_id()
433 udev_builtin_add_property(dev, test, "ID_MODEL", model_str); in builtin_usb_id()
434 udev_builtin_add_property(dev, test, "ID_MODEL_ENC", model_str_enc); in builtin_usb_id()
435 udev_builtin_add_property(dev, test, "ID_MODEL_ID", product_id); in builtin_usb_id()
436 udev_builtin_add_property(dev, test, "ID_REVISION", revision_str); in builtin_usb_id()
437 udev_builtin_add_property(dev, test, "ID_SERIAL", serial); in builtin_usb_id()
439 udev_builtin_add_property(dev, test, "ID_SERIAL_SHORT", serial_str); in builtin_usb_id()
441 udev_builtin_add_property(dev, test, "ID_TYPE", type_str); in builtin_usb_id()
443 udev_builtin_add_property(dev, test, "ID_INSTANCE", instance_str); in builtin_usb_id()
444 udev_builtin_add_property(dev, test, "ID_BUS", "usb"); in builtin_usb_id()
446 udev_builtin_add_property(dev, test, "ID_USB_INTERFACES", packed_if_str); in builtin_usb_id()
448 udev_builtin_add_property(dev, test, "ID_USB_INTERFACE_NUM", ifnum); in builtin_usb_id()
450 udev_builtin_add_property(dev, test, "ID_USB_DRIVER", driver); in builtin_usb_id()