• Home
  • Raw
  • Download

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()
170 if (udev->ssp_rate == USB_SSP_GEN_2x2) in speed_show()
185 struct usb_device *udev; in rx_lanes_show() local
187 udev = to_usb_device(dev); in rx_lanes_show()
188 return sprintf(buf, "%d\n", udev->rx_lanes); in rx_lanes_show()
195 struct usb_device *udev; in tx_lanes_show() local
197 udev = to_usb_device(dev); in tx_lanes_show()
198 return sprintf(buf, "%d\n", udev->tx_lanes); in tx_lanes_show()
205 struct usb_device *udev; in busnum_show() local
207 udev = to_usb_device(dev); in busnum_show()
208 return sprintf(buf, "%d\n", udev->bus->busnum); in busnum_show()
215 struct usb_device *udev; in devnum_show() local
217 udev = to_usb_device(dev); in devnum_show()
218 return sprintf(buf, "%d\n", udev->devnum); in devnum_show()
225 struct usb_device *udev; in devpath_show() local
227 udev = to_usb_device(dev); in devpath_show()
228 return sprintf(buf, "%s\n", udev->devpath); in devpath_show()
235 struct usb_device *udev; in version_show() local
238 udev = to_usb_device(dev); in version_show()
239 bcdUSB = le16_to_cpu(udev->descriptor.bcdUSB); in version_show()
247 struct usb_device *udev; in maxchild_show() local
249 udev = to_usb_device(dev); in maxchild_show()
250 return sprintf(buf, "%d\n", udev->maxchild); in maxchild_show()
257 struct usb_device *udev; in quirks_show() local
259 udev = to_usb_device(dev); in quirks_show()
260 return sprintf(buf, "0x%x\n", udev->quirks); in quirks_show()
267 struct usb_device *udev; in avoid_reset_quirk_show() local
269 udev = to_usb_device(dev); in avoid_reset_quirk_show()
270 return sprintf(buf, "%d\n", !!(udev->quirks & USB_QUIRK_RESET)); in avoid_reset_quirk_show()
277 struct usb_device *udev = to_usb_device(dev); in avoid_reset_quirk_store() local
282 rc = usb_lock_device_interruptible(udev); in avoid_reset_quirk_store()
286 udev->quirks |= USB_QUIRK_RESET; in avoid_reset_quirk_store()
288 udev->quirks &= ~USB_QUIRK_RESET; in avoid_reset_quirk_store()
289 usb_unlock_device(udev); in avoid_reset_quirk_store()
297 struct usb_device *udev; in urbnum_show() local
299 udev = to_usb_device(dev); in urbnum_show()
300 return sprintf(buf, "%d\n", atomic_read(&udev->urbnum)); in urbnum_show()
318 struct usb_device *udev = to_usb_device(dev); in persist_show() local
320 return sprintf(buf, "%d\n", udev->persist_enabled); in persist_show()
326 struct usb_device *udev = to_usb_device(dev); in persist_store() local
330 if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) in persist_store()
336 rc = usb_lock_device_interruptible(udev); in persist_store()
339 udev->persist_enabled = !!value; in persist_store()
340 usb_unlock_device(udev); in persist_store()
350 struct usb_device *udev = to_usb_device(dev); in add_persist_attributes() local
355 if (udev->descriptor.bDeviceClass != USB_CLASS_HUB) in add_persist_attributes()
373 struct usb_device *udev = to_usb_device(dev); in connected_duration_show() local
376 jiffies_to_msecs(jiffies - udev->connect_time)); in connected_duration_show()
390 struct usb_device *udev = to_usb_device(dev); in active_duration_show() local
393 if (udev->state != USB_STATE_SUSPENDED) in active_duration_show()
394 duration = jiffies_to_msecs(jiffies + udev->active_duration); in active_duration_show()
396 duration = jiffies_to_msecs(udev->active_duration); in active_duration_show()
439 struct usb_device *udev = to_usb_device(dev); in level_show() local
443 if (udev->state != USB_STATE_SUSPENDED && !udev->dev.power.runtime_auto) in level_show()
451 struct usb_device *udev = to_usb_device(dev); in level_store() local
462 rv = usb_lock_device_interruptible(udev); in level_store()
468 usb_disable_autosuspend(udev); in level_store()
472 usb_enable_autosuspend(udev); in level_store()
477 usb_unlock_device(udev); in level_store()
485 struct usb_device *udev = to_usb_device(dev); in usb2_hardware_lpm_show() local
488 if (udev->usb2_hw_lpm_allowed == 1) in usb2_hardware_lpm_show()
500 struct usb_device *udev = to_usb_device(dev); in usb2_hardware_lpm_store() local
504 ret = usb_lock_device_interruptible(udev); in usb2_hardware_lpm_store()
511 udev->usb2_hw_lpm_allowed = value; in usb2_hardware_lpm_store()
513 ret = usb_enable_usb2_hardware_lpm(udev); in usb2_hardware_lpm_store()
515 ret = usb_disable_usb2_hardware_lpm(udev); in usb2_hardware_lpm_store()
518 usb_unlock_device(udev); in usb2_hardware_lpm_store()
531 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_l1_timeout_show() local
532 return sprintf(buf, "%d\n", udev->l1_params.timeout); in usb2_lpm_l1_timeout_show()
539 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_l1_timeout_store() local
545 udev->l1_params.timeout = timeout; in usb2_lpm_l1_timeout_store()
554 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_besl_show() local
555 return sprintf(buf, "%d\n", udev->l1_params.besl); in usb2_lpm_besl_show()
562 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_besl_store() local
568 udev->l1_params.besl = besl; in usb2_lpm_besl_store()
577 struct usb_device *udev = to_usb_device(dev); in usb3_hardware_lpm_u1_show() local
581 rc = usb_lock_device_interruptible(udev); in usb3_hardware_lpm_u1_show()
585 if (udev->usb3_lpm_u1_enabled) in usb3_hardware_lpm_u1_show()
590 usb_unlock_device(udev); in usb3_hardware_lpm_u1_show()
599 struct usb_device *udev = to_usb_device(dev); in usb3_hardware_lpm_u2_show() local
603 rc = usb_lock_device_interruptible(udev); in usb3_hardware_lpm_u2_show()
607 if (udev->usb3_lpm_u2_enabled) in usb3_hardware_lpm_u2_show()
612 usb_unlock_device(udev); in usb3_hardware_lpm_u2_show()
656 struct usb_device *udev = to_usb_device(dev); in add_power_attributes() local
658 if (udev->usb2_hw_lpm_capable == 1) in add_power_attributes()
661 if ((udev->speed == USB_SPEED_SUPER || in add_power_attributes()
662 udev->speed == USB_SPEED_SUPER_PLUS) && in add_power_attributes()
663 udev->lpm_capable == 1) in add_power_attributes()
694 struct usb_device *udev; \
696 udev = to_usb_device(dev); \
698 le16_to_cpu(udev->descriptor.field)); \
711 struct usb_device *udev; \
713 udev = to_usb_device(dev); \
714 return sprintf(buf, format_string, udev->descriptor.field); \
761 struct usb_device *udev = to_usb_device(dev); in remove_store() local
764 usb_lock_device(udev); in remove_store()
765 if (udev->state != USB_STATE_NOTATTACHED) { in remove_store()
768 usb_set_configuration(udev, -1); in remove_store()
769 rc = usb_remove_device(udev); in remove_store()
773 usb_unlock_device(udev); in remove_store()
832 struct usb_device *udev = to_usb_device(dev); in dev_string_attrs_are_visible() local
835 if (udev->manufacturer == NULL) in dev_string_attrs_are_visible()
838 if (udev->product == NULL) in dev_string_attrs_are_visible()
841 if (udev->serial == NULL) in dev_string_attrs_are_visible()
866 struct usb_device *udev = to_usb_device(dev); in read_descriptors() local
876 for (cfgno = -1; cfgno < udev->descriptor.bNumConfigurations && in read_descriptors()
879 src = &udev->descriptor; in read_descriptors()
882 src = udev->rawdescriptors[cfgno]; in read_descriptors()
883 srclen = __le16_to_cpu(udev->config[cfgno].desc. in read_descriptors()
1015 int usb_create_sysfs_dev_files(struct usb_device *udev) in usb_create_sysfs_dev_files() argument
1017 struct device *dev = &udev->dev; in usb_create_sysfs_dev_files()
1032 if (is_root_hub(udev)) { in usb_create_sysfs_dev_files()
1040 usb_remove_sysfs_dev_files(udev); in usb_create_sysfs_dev_files()
1044 void usb_remove_sysfs_dev_files(struct usb_device *udev) in usb_remove_sysfs_dev_files() argument
1046 struct device *dev = &udev->dev; in usb_remove_sysfs_dev_files()
1048 if (is_root_hub(udev)) in usb_remove_sysfs_dev_files()
1113 struct usb_device *udev; in modalias_show() local
1117 udev = interface_to_usbdev(intf); in modalias_show()
1122 le16_to_cpu(udev->descriptor.idVendor), in modalias_show()
1123 le16_to_cpu(udev->descriptor.idProduct), in modalias_show()
1124 le16_to_cpu(udev->descriptor.bcdDevice), in modalias_show()
1125 udev->descriptor.bDeviceClass, in modalias_show()
1126 udev->descriptor.bDeviceSubClass, in modalias_show()
1127 udev->descriptor.bDeviceProtocol, in modalias_show()
1236 struct usb_device *udev = interface_to_usbdev(intf); in usb_create_sysfs_intf_files() local
1242 if (!alt->string && !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) in usb_create_sysfs_intf_files()
1243 alt->string = usb_cache_string(udev, alt->desc.iInterface); in usb_create_sysfs_intf_files()