Lines Matching refs:udev

24 	struct usb_device *udev;					\
28 udev = to_usb_device(dev); \
29 usb_lock_device(udev); \
30 actconfig = udev->actconfig; \
34 usb_unlock_device(udev); \
48 struct usb_device *udev; in bMaxPower_show() local
52 udev = to_usb_device(dev); in bMaxPower_show()
53 usb_lock_device(udev); in bMaxPower_show()
54 actconfig = udev->actconfig; in bMaxPower_show()
56 rc = sprintf(buf, "%dmA\n", usb_get_max_power(udev, actconfig)); in bMaxPower_show()
57 usb_unlock_device(udev); in bMaxPower_show()
65 struct usb_device *udev; in configuration_show() local
69 udev = to_usb_device(dev); in configuration_show()
70 usb_lock_device(udev); in configuration_show()
71 actconfig = udev->actconfig; in configuration_show()
74 usb_unlock_device(udev); in configuration_show()
86 struct usb_device *udev = to_usb_device(dev); in bConfigurationValue_store() local
91 usb_lock_device(udev); in bConfigurationValue_store()
92 value = usb_set_configuration(udev, config); in bConfigurationValue_store()
93 usb_unlock_device(udev); in bConfigurationValue_store()
104 struct usb_device *udev; \
107 udev = to_usb_device(dev); \
108 usb_lock_device(udev); \
109 retval = sprintf(buf, "%s\n", udev->name); \
110 usb_unlock_device(udev); \
122 struct usb_device *udev; in speed_show() local
125 udev = to_usb_device(dev); in speed_show()
127 switch (udev->speed) { in speed_show()
154 struct usb_device *udev; in busnum_show() local
156 udev = to_usb_device(dev); in busnum_show()
157 return sprintf(buf, "%d\n", udev->bus->busnum); in busnum_show()
164 struct usb_device *udev; in devnum_show() local
166 udev = to_usb_device(dev); in devnum_show()
167 return sprintf(buf, "%d\n", udev->devnum); in devnum_show()
174 struct usb_device *udev; in devpath_show() local
176 udev = to_usb_device(dev); in devpath_show()
177 return sprintf(buf, "%s\n", udev->devpath); in devpath_show()
184 struct usb_device *udev; in version_show() local
187 udev = to_usb_device(dev); in version_show()
188 bcdUSB = le16_to_cpu(udev->descriptor.bcdUSB); in version_show()
196 struct usb_device *udev; in maxchild_show() local
198 udev = to_usb_device(dev); in maxchild_show()
199 return sprintf(buf, "%d\n", udev->maxchild); in maxchild_show()
206 struct usb_device *udev; in quirks_show() local
208 udev = to_usb_device(dev); in quirks_show()
209 return sprintf(buf, "0x%x\n", udev->quirks); in quirks_show()
216 struct usb_device *udev; in avoid_reset_quirk_show() local
218 udev = to_usb_device(dev); in avoid_reset_quirk_show()
219 return sprintf(buf, "%d\n", !!(udev->quirks & USB_QUIRK_RESET)); in avoid_reset_quirk_show()
226 struct usb_device *udev = to_usb_device(dev); in avoid_reset_quirk_store() local
231 usb_lock_device(udev); in avoid_reset_quirk_store()
233 udev->quirks |= USB_QUIRK_RESET; in avoid_reset_quirk_store()
235 udev->quirks &= ~USB_QUIRK_RESET; in avoid_reset_quirk_store()
236 usb_unlock_device(udev); in avoid_reset_quirk_store()
244 struct usb_device *udev; in urbnum_show() local
246 udev = to_usb_device(dev); in urbnum_show()
247 return sprintf(buf, "%d\n", atomic_read(&udev->urbnum)); in urbnum_show()
254 struct usb_device *udev; in removable_show() local
257 udev = to_usb_device(dev); in removable_show()
259 switch (udev->removable) { in removable_show()
288 struct usb_device *udev = to_usb_device(dev); in persist_show() local
290 return sprintf(buf, "%d\n", udev->persist_enabled); in persist_show()
296 struct usb_device *udev = to_usb_device(dev); in persist_store() local
300 if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) in persist_store()
306 usb_lock_device(udev); in persist_store()
307 udev->persist_enabled = !!value; in persist_store()
308 usb_unlock_device(udev); in persist_store()
318 struct usb_device *udev = to_usb_device(dev); in add_persist_attributes() local
323 if (udev->descriptor.bDeviceClass != USB_CLASS_HUB) in add_persist_attributes()
341 struct usb_device *udev = to_usb_device(dev); in connected_duration_show() local
344 jiffies_to_msecs(jiffies - udev->connect_time)); in connected_duration_show()
358 struct usb_device *udev = to_usb_device(dev); in active_duration_show() local
361 if (udev->state != USB_STATE_SUSPENDED) in active_duration_show()
362 duration = jiffies_to_msecs(jiffies + udev->active_duration); in active_duration_show()
364 duration = jiffies_to_msecs(udev->active_duration); in active_duration_show()
407 struct usb_device *udev = to_usb_device(dev); in level_show() local
411 if (udev->state != USB_STATE_SUSPENDED && !udev->dev.power.runtime_auto) in level_show()
419 struct usb_device *udev = to_usb_device(dev); in level_store() local
429 usb_lock_device(udev); in level_store()
433 usb_disable_autosuspend(udev); in level_store()
437 usb_enable_autosuspend(udev); in level_store()
442 usb_unlock_device(udev); in level_store()
450 struct usb_device *udev = to_usb_device(dev); in usb2_hardware_lpm_show() local
453 if (udev->usb2_hw_lpm_allowed == 1) in usb2_hardware_lpm_show()
465 struct usb_device *udev = to_usb_device(dev); in usb2_hardware_lpm_store() local
469 usb_lock_device(udev); in usb2_hardware_lpm_store()
474 udev->usb2_hw_lpm_allowed = value; in usb2_hardware_lpm_store()
475 ret = usb_set_usb2_hardware_lpm(udev, value); in usb2_hardware_lpm_store()
478 usb_unlock_device(udev); in usb2_hardware_lpm_store()
491 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_l1_timeout_show() local
492 return sprintf(buf, "%d\n", udev->l1_params.timeout); in usb2_lpm_l1_timeout_show()
499 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_l1_timeout_store() local
505 udev->l1_params.timeout = timeout; in usb2_lpm_l1_timeout_store()
514 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_besl_show() local
515 return sprintf(buf, "%d\n", udev->l1_params.besl); in usb2_lpm_besl_show()
522 struct usb_device *udev = to_usb_device(dev); in usb2_lpm_besl_store() local
528 udev->l1_params.besl = besl; in usb2_lpm_besl_store()
537 struct usb_device *udev = to_usb_device(dev); in usb3_hardware_lpm_u1_show() local
540 usb_lock_device(udev); in usb3_hardware_lpm_u1_show()
542 if (udev->usb3_lpm_u1_enabled) in usb3_hardware_lpm_u1_show()
547 usb_unlock_device(udev); in usb3_hardware_lpm_u1_show()
556 struct usb_device *udev = to_usb_device(dev); in usb3_hardware_lpm_u2_show() local
559 usb_lock_device(udev); in usb3_hardware_lpm_u2_show()
561 if (udev->usb3_lpm_u2_enabled) in usb3_hardware_lpm_u2_show()
566 usb_unlock_device(udev); in usb3_hardware_lpm_u2_show()
610 struct usb_device *udev = to_usb_device(dev); in add_power_attributes() local
612 if (udev->usb2_hw_lpm_capable == 1) in add_power_attributes()
615 if (udev->speed == USB_SPEED_SUPER && in add_power_attributes()
616 udev->lpm_capable == 1) in add_power_attributes()
647 struct usb_device *udev; \
649 udev = to_usb_device(dev); \
651 le16_to_cpu(udev->descriptor.field)); \
664 struct usb_device *udev; \
666 udev = to_usb_device(dev); \
667 return sprintf(buf, format_string, udev->descriptor.field); \
714 struct usb_device *udev = to_usb_device(dev); in remove_store() local
717 usb_lock_device(udev); in remove_store()
718 if (udev->state != USB_STATE_NOTATTACHED) { in remove_store()
721 usb_set_configuration(udev, -1); in remove_store()
722 rc = usb_remove_device(udev); in remove_store()
726 usb_unlock_device(udev); in remove_store()
781 struct usb_device *udev = to_usb_device(dev); in dev_string_attrs_are_visible() local
784 if (udev->manufacturer == NULL) in dev_string_attrs_are_visible()
787 if (udev->product == NULL) in dev_string_attrs_are_visible()
790 if (udev->serial == NULL) in dev_string_attrs_are_visible()
815 struct usb_device *udev = to_usb_device(dev); in read_descriptors() local
825 usb_lock_device(udev); in read_descriptors()
826 for (cfgno = -1; cfgno < udev->descriptor.bNumConfigurations && in read_descriptors()
829 src = &udev->descriptor; in read_descriptors()
832 src = udev->rawdescriptors[cfgno]; in read_descriptors()
833 srclen = __le16_to_cpu(udev->config[cfgno].desc. in read_descriptors()
846 usb_unlock_device(udev); in read_descriptors()
856 int usb_create_sysfs_dev_files(struct usb_device *udev) in usb_create_sysfs_dev_files() argument
858 struct device *dev = &udev->dev; in usb_create_sysfs_dev_files()
874 usb_remove_sysfs_dev_files(udev); in usb_create_sysfs_dev_files()
878 void usb_remove_sysfs_dev_files(struct usb_device *udev) in usb_remove_sysfs_dev_files() argument
880 struct device *dev = &udev->dev; in usb_remove_sysfs_dev_files()
944 struct usb_device *udev; in modalias_show() local
948 udev = interface_to_usbdev(intf); in modalias_show()
953 le16_to_cpu(udev->descriptor.idVendor), in modalias_show()
954 le16_to_cpu(udev->descriptor.idProduct), in modalias_show()
955 le16_to_cpu(udev->descriptor.bcdDevice), in modalias_show()
956 udev->descriptor.bDeviceClass, in modalias_show()
957 udev->descriptor.bDeviceSubClass, in modalias_show()
958 udev->descriptor.bDeviceProtocol, in modalias_show()
1065 struct usb_device *udev = interface_to_usbdev(intf); in usb_create_sysfs_intf_files() local
1071 if (!alt->string && !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) in usb_create_sysfs_intf_files()
1072 alt->string = usb_cache_string(udev, alt->desc.iInterface); in usb_create_sysfs_intf_files()