Lines Matching refs:udev
28 struct usb_device *udev; \
32 udev = to_usb_device(dev); \
33 rc = usb_lock_device_interruptible(udev); \
36 actconfig = udev->actconfig; \
40 usb_unlock_device(udev); \
54 struct usb_device *udev; in bMaxPower_show() local
58 udev = to_usb_device(dev); in bMaxPower_show()
59 rc = usb_lock_device_interruptible(udev); in bMaxPower_show()
62 actconfig = udev->actconfig; in bMaxPower_show()
64 rc = sprintf(buf, "%dmA\n", usb_get_max_power(udev, actconfig)); in bMaxPower_show()
65 usb_unlock_device(udev); in bMaxPower_show()
73 struct usb_device *udev; in configuration_show() local
77 udev = to_usb_device(dev); in configuration_show()
78 rc = usb_lock_device_interruptible(udev); in configuration_show()
81 actconfig = udev->actconfig; in configuration_show()
84 usb_unlock_device(udev); in configuration_show()
96 struct usb_device *udev = to_usb_device(dev); in bConfigurationValue_store() local
101 rc = usb_lock_device_interruptible(udev); in bConfigurationValue_store()
104 value = usb_set_configuration(udev, config); in bConfigurationValue_store()
105 usb_unlock_device(udev); in bConfigurationValue_store()
127 struct usb_device *udev; \
130 udev = to_usb_device(dev); \
131 retval = usb_lock_device_interruptible(udev); \
134 retval = sprintf(buf, "%s\n", udev->name); \
135 usb_unlock_device(udev); \
147 struct usb_device *udev; in speed_show() local
150 udev = to_usb_device(dev); in speed_show()
152 switch (udev->speed) { in speed_show()
182 struct usb_device *udev; in rx_lanes_show() local
184 udev = to_usb_device(dev); in rx_lanes_show()
185 return sprintf(buf, "%d\n", udev->rx_lanes); in rx_lanes_show()
192 struct usb_device *udev; in tx_lanes_show() local
194 udev = to_usb_device(dev); in tx_lanes_show()
195 return sprintf(buf, "%d\n", udev->tx_lanes); in tx_lanes_show()
202 struct usb_device *udev; in busnum_show() local
204 udev = to_usb_device(dev); in busnum_show()
205 return sprintf(buf, "%d\n", udev->bus->busnum); in busnum_show()
212 struct usb_device *udev; in devnum_show() local
214 udev = to_usb_device(dev); in devnum_show()
215 return sprintf(buf, "%d\n", udev->devnum); in devnum_show()
222 struct usb_device *udev; in devpath_show() local
224 udev = to_usb_device(dev); in devpath_show()
225 return sprintf(buf, "%s\n", udev->devpath); in devpath_show()
232 struct usb_device *udev; in version_show() local
235 udev = to_usb_device(dev); in version_show()
236 bcdUSB = le16_to_cpu(udev->descriptor.bcdUSB); in version_show()
244 struct usb_device *udev; in maxchild_show() local
246 udev = to_usb_device(dev); in maxchild_show()
247 return sprintf(buf, "%d\n", udev->maxchild); in maxchild_show()
254 struct usb_device *udev; in quirks_show() local
256 udev = to_usb_device(dev); in quirks_show()
257 return sprintf(buf, "0x%x\n", udev->quirks); in quirks_show()
264 struct usb_device *udev; in avoid_reset_quirk_show() local
266 udev = to_usb_device(dev); in avoid_reset_quirk_show()
267 return sprintf(buf, "%d\n", !!(udev->quirks & USB_QUIRK_RESET)); in avoid_reset_quirk_show()
274 struct usb_device *udev = to_usb_device(dev); in avoid_reset_quirk_store() local
279 rc = usb_lock_device_interruptible(udev); in avoid_reset_quirk_store()
283 udev->quirks |= USB_QUIRK_RESET; in avoid_reset_quirk_store()
285 udev->quirks &= ~USB_QUIRK_RESET; in avoid_reset_quirk_store()
286 usb_unlock_device(udev); in avoid_reset_quirk_store()
294 struct usb_device *udev; in urbnum_show() local
296 udev = to_usb_device(dev); in urbnum_show()
297 return sprintf(buf, "%d\n", atomic_read(&udev->urbnum)); in urbnum_show()
304 struct usb_device *udev; in removable_show() local
307 udev = to_usb_device(dev); in removable_show()
309 switch (udev->removable) { in removable_show()
338 struct usb_device *udev = to_usb_device(dev); in persist_show() local
340 return sprintf(buf, "%d\n", udev->persist_enabled); in persist_show()
346 struct usb_device *udev = to_usb_device(dev); in persist_store() local
350 if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) in persist_store()
356 rc = usb_lock_device_interruptible(udev); in persist_store()
359 udev->persist_enabled = !!value; in persist_store()
360 usb_unlock_device(udev); in persist_store()
370 struct usb_device *udev = to_usb_device(dev); in add_persist_attributes() local
375 if (udev->descriptor.bDeviceClass != USB_CLASS_HUB) in add_persist_attributes()
393 struct usb_device *udev = to_usb_device(dev); in connected_duration_show() local
396 jiffies_to_msecs(jiffies - udev->connect_time)); in connected_duration_show()
410 struct usb_device *udev = to_usb_device(dev); in active_duration_show() local
413 if (udev->state != USB_STATE_SUSPENDED) in active_duration_show()
414 duration = jiffies_to_msecs(jiffies + udev->active_duration); in active_duration_show()
416 duration = jiffies_to_msecs(udev->active_duration); in active_duration_show()
459 struct usb_device *udev = to_usb_device(dev); in level_show() local
463 if (udev->state != USB_STATE_SUSPENDED && !udev->dev.power.runtime_auto) in level_show()
471 struct usb_device *udev = to_usb_device(dev); in level_store() local
482 rv = usb_lock_device_interruptible(udev); in level_store()
488 usb_disable_autosuspend(udev); in level_store()
492 usb_enable_autosuspend(udev); in level_store()
497 usb_unlock_device(udev); in level_store()
505 struct usb_device *udev = to_usb_device(dev); in usb2_hardware_lpm_show() local
508 if (udev->usb2_hw_lpm_allowed == 1) in usb2_hardware_lpm_show()
520 struct usb_device *udev = to_usb_device(dev); in usb2_hardware_lpm_store() local
524 ret = usb_lock_device_interruptible(udev); in usb2_hardware_lpm_store()
531 udev->usb2_hw_lpm_allowed = value; in usb2_hardware_lpm_store()
533 ret = usb_enable_usb2_hardware_lpm(udev); in usb2_hardware_lpm_store()
535 ret = usb_disable_usb2_hardware_lpm(udev); in usb2_hardware_lpm_store()
538 usb_unlock_device(udev); in usb2_hardware_lpm_store()
551 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_l1_timeout_show() local
552 return sprintf(buf, "%d\n", udev->l1_params.timeout); in usb2_lpm_l1_timeout_show()
559 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_l1_timeout_store() local
565 udev->l1_params.timeout = timeout; in usb2_lpm_l1_timeout_store()
574 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_besl_show() local
575 return sprintf(buf, "%d\n", udev->l1_params.besl); in usb2_lpm_besl_show()
582 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_besl_store() local
588 udev->l1_params.besl = besl; in usb2_lpm_besl_store()
597 struct usb_device *udev = to_usb_device(dev); in usb3_hardware_lpm_u1_show() local
601 rc = usb_lock_device_interruptible(udev); in usb3_hardware_lpm_u1_show()
605 if (udev->usb3_lpm_u1_enabled) in usb3_hardware_lpm_u1_show()
610 usb_unlock_device(udev); in usb3_hardware_lpm_u1_show()
619 struct usb_device *udev = to_usb_device(dev); in usb3_hardware_lpm_u2_show() local
623 rc = usb_lock_device_interruptible(udev); in usb3_hardware_lpm_u2_show()
627 if (udev->usb3_lpm_u2_enabled) in usb3_hardware_lpm_u2_show()
632 usb_unlock_device(udev); in usb3_hardware_lpm_u2_show()
676 struct usb_device *udev = to_usb_device(dev); in add_power_attributes() local
678 if (udev->usb2_hw_lpm_capable == 1) in add_power_attributes()
681 if ((udev->speed == USB_SPEED_SUPER || in add_power_attributes()
682 udev->speed == USB_SPEED_SUPER_PLUS) && in add_power_attributes()
683 udev->lpm_capable == 1) in add_power_attributes()
714 struct usb_device *udev; \
716 udev = to_usb_device(dev); \
718 le16_to_cpu(udev->descriptor.field)); \
731 struct usb_device *udev; \
733 udev = to_usb_device(dev); \
734 return sprintf(buf, format_string, udev->descriptor.field); \
781 struct usb_device *udev = to_usb_device(dev); in remove_store() local
784 usb_lock_device(udev); in remove_store()
785 if (udev->state != USB_STATE_NOTATTACHED) { in remove_store()
788 usb_set_configuration(udev, -1); in remove_store()
789 rc = usb_remove_device(udev); in remove_store()
793 usb_unlock_device(udev); in remove_store()
853 struct usb_device *udev = to_usb_device(dev); in dev_string_attrs_are_visible() local
856 if (udev->manufacturer == NULL) in dev_string_attrs_are_visible()
859 if (udev->product == NULL) in dev_string_attrs_are_visible()
862 if (udev->serial == NULL) in dev_string_attrs_are_visible()
887 struct usb_device *udev = to_usb_device(dev); in read_descriptors() local
894 retval = usb_lock_device_interruptible(udev); in read_descriptors()
901 for (cfgno = -1; cfgno < udev->descriptor.bNumConfigurations && in read_descriptors()
904 src = &udev->descriptor; in read_descriptors()
907 src = udev->rawdescriptors[cfgno]; in read_descriptors()
908 srclen = __le16_to_cpu(udev->config[cfgno].desc. in read_descriptors()
921 usb_unlock_device(udev); in read_descriptors()
1041 int usb_create_sysfs_dev_files(struct usb_device *udev) in usb_create_sysfs_dev_files() argument
1043 struct device *dev = &udev->dev; in usb_create_sysfs_dev_files()
1058 if (is_root_hub(udev)) { in usb_create_sysfs_dev_files()
1066 usb_remove_sysfs_dev_files(udev); in usb_create_sysfs_dev_files()
1070 void usb_remove_sysfs_dev_files(struct usb_device *udev) in usb_remove_sysfs_dev_files() argument
1072 struct device *dev = &udev->dev; in usb_remove_sysfs_dev_files()
1074 if (is_root_hub(udev)) in usb_remove_sysfs_dev_files()
1139 struct usb_device *udev; in modalias_show() local
1143 udev = interface_to_usbdev(intf); in modalias_show()
1148 le16_to_cpu(udev->descriptor.idVendor), in modalias_show()
1149 le16_to_cpu(udev->descriptor.idProduct), in modalias_show()
1150 le16_to_cpu(udev->descriptor.bcdDevice), in modalias_show()
1151 udev->descriptor.bDeviceClass, in modalias_show()
1152 udev->descriptor.bDeviceSubClass, in modalias_show()
1153 udev->descriptor.bDeviceProtocol, in modalias_show()
1262 struct usb_device *udev = interface_to_usbdev(intf); in usb_create_sysfs_intf_files() local
1268 if (!alt->string && !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) in usb_create_sysfs_intf_files()
1269 alt->string = usb_cache_string(udev, alt->desc.iInterface); in usb_create_sysfs_intf_files()