| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * Released under the GPLv2 only. |
|---|
| 4 | 4 | */ |
|---|
| .. | .. |
|---|
| 37 | 37 | extern void usb_detect_quirks(struct usb_device *udev); |
|---|
| 38 | 38 | extern void usb_detect_interface_quirks(struct usb_device *udev); |
|---|
| 39 | 39 | extern void usb_release_quirk_list(void); |
|---|
| 40 | | -extern bool usb_endpoint_is_blacklisted(struct usb_device *udev, |
|---|
| 40 | +extern bool usb_endpoint_is_ignored(struct usb_device *udev, |
|---|
| 41 | 41 | struct usb_host_interface *intf, |
|---|
| 42 | 42 | struct usb_endpoint_descriptor *epd); |
|---|
| 43 | 43 | extern int usb_remove_device(struct usb_device *udev); |
|---|
| 44 | 44 | |
|---|
| 45 | | -extern int usb_get_device_descriptor(struct usb_device *dev, |
|---|
| 46 | | - unsigned int size); |
|---|
| 45 | +extern struct usb_device_descriptor *usb_get_device_descriptor( |
|---|
| 46 | + struct usb_device *udev); |
|---|
| 47 | 47 | extern int usb_set_isoch_delay(struct usb_device *dev); |
|---|
| 48 | 48 | extern int usb_get_bos_descriptor(struct usb_device *dev); |
|---|
| 49 | 49 | extern void usb_release_bos_descriptor(struct usb_device *dev); |
|---|
| 50 | 50 | extern char *usb_cache_string(struct usb_device *udev, int index); |
|---|
| 51 | 51 | extern int usb_set_configuration(struct usb_device *dev, int configuration); |
|---|
| 52 | 52 | extern int usb_choose_configuration(struct usb_device *udev); |
|---|
| 53 | +extern int usb_generic_driver_probe(struct usb_device *udev); |
|---|
| 54 | +extern void usb_generic_driver_disconnect(struct usb_device *udev); |
|---|
| 55 | +extern int usb_generic_driver_suspend(struct usb_device *udev, |
|---|
| 56 | + pm_message_t msg); |
|---|
| 57 | +extern int usb_generic_driver_resume(struct usb_device *udev, |
|---|
| 58 | + pm_message_t msg); |
|---|
| 53 | 59 | |
|---|
| 54 | 60 | static inline unsigned usb_get_max_power(struct usb_device *udev, |
|---|
| 55 | 61 | struct usb_host_config *c) |
|---|
| .. | .. |
|---|
| 66 | 72 | const struct usb_device_id *id); |
|---|
| 67 | 73 | extern int usb_match_device(struct usb_device *dev, |
|---|
| 68 | 74 | const struct usb_device_id *id); |
|---|
| 75 | +extern const struct usb_device_id *usb_device_match_id(struct usb_device *udev, |
|---|
| 76 | + const struct usb_device_id *id); |
|---|
| 77 | +extern bool usb_driver_applicable(struct usb_device *udev, |
|---|
| 78 | + struct usb_device_driver *udrv); |
|---|
| 69 | 79 | extern void usb_forced_unbind_intf(struct usb_interface *intf); |
|---|
| 70 | 80 | extern void usb_unbind_and_rebind_marked_interfaces(struct usb_device *udev); |
|---|
| 71 | 81 | |
|---|
| .. | .. |
|---|
| 97 | 107 | extern int usb_runtime_idle(struct device *dev); |
|---|
| 98 | 108 | extern int usb_enable_usb2_hardware_lpm(struct usb_device *udev); |
|---|
| 99 | 109 | extern int usb_disable_usb2_hardware_lpm(struct usb_device *udev); |
|---|
| 110 | + |
|---|
| 111 | +extern void usbfs_notify_suspend(struct usb_device *udev); |
|---|
| 112 | +extern void usbfs_notify_resume(struct usb_device *udev); |
|---|
| 100 | 113 | |
|---|
| 101 | 114 | #else |
|---|
| 102 | 115 | |
|---|
| .. | .. |
|---|
| 156 | 169 | return dev->type == &usb_port_device_type; |
|---|
| 157 | 170 | } |
|---|
| 158 | 171 | |
|---|
| 172 | +static inline int is_root_hub(struct usb_device *udev) |
|---|
| 173 | +{ |
|---|
| 174 | + return (udev->parent == NULL); |
|---|
| 175 | +} |
|---|
| 176 | + |
|---|
| 159 | 177 | /* Do the same for device drivers and interface drivers. */ |
|---|
| 160 | 178 | |
|---|
| 161 | 179 | static inline int is_usb_device_driver(struct device_driver *drv) |
|---|
| .. | .. |
|---|
| 172 | 190 | extern const struct attribute_group *usb_interface_groups[]; |
|---|
| 173 | 191 | |
|---|
| 174 | 192 | /* usbfs stuff */ |
|---|
| 175 | | -extern struct mutex usbfs_mutex; |
|---|
| 176 | 193 | extern struct usb_driver usbfs_driver; |
|---|
| 177 | 194 | extern const struct file_operations usbfs_devices_fops; |
|---|
| 178 | 195 | extern const struct file_operations usbdev_file_operations; |
|---|
| 179 | | -extern void usbfs_conn_disc_event(void); |
|---|
| 180 | 196 | |
|---|
| 181 | 197 | extern int usb_devio_init(void); |
|---|
| 182 | 198 | extern void usb_devio_cleanup(void); |
|---|
| .. | .. |
|---|
| 192 | 208 | extern void usb_notify_remove_device(struct usb_device *udev); |
|---|
| 193 | 209 | extern void usb_notify_add_bus(struct usb_bus *ubus); |
|---|
| 194 | 210 | extern void usb_notify_remove_bus(struct usb_bus *ubus); |
|---|
| 195 | | -extern void usb_atomic_notify_dead_bus(struct usb_bus *ubus); |
|---|
| 196 | 211 | extern void usb_hub_adjust_deviceremovable(struct usb_device *hdev, |
|---|
| 197 | 212 | struct usb_hub_descriptor *desc); |
|---|
| 198 | 213 | |
|---|