Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* Functions local to drivers/usb/core/ */
2
3extern void usb_create_sysfs_dev_files (struct usb_device *dev);
4extern void usb_remove_sysfs_dev_files (struct usb_device *dev);
5extern void usb_create_sysfs_intf_files (struct usb_interface *intf);
6extern void usb_remove_sysfs_intf_files (struct usb_interface *intf);
7
8extern void usb_disable_endpoint (struct usb_device *dev, unsigned int epaddr);
9extern void usb_disable_interface (struct usb_device *dev,
10 struct usb_interface *intf);
11extern void usb_release_interface_cache(struct kref *ref);
12extern void usb_disable_device (struct usb_device *dev, int skip_ep0);
13
14extern int usb_get_device_descriptor(struct usb_device *dev,
15 unsigned int size);
16extern char *usb_cache_string(struct usb_device *udev, int index);
17extern int usb_set_configuration(struct usb_device *dev, int configuration);
18
19extern void usb_kick_khubd(struct usb_device *dev);
20extern void usb_suspend_root_hub(struct usb_device *hdev);
21extern void usb_resume_root_hub(struct usb_device *dev);
22
23extern int usb_hub_init(void);
24extern void usb_hub_cleanup(void);
25extern int usb_major_init(void);
26extern void usb_major_cleanup(void);
27extern int usb_host_init(void);
28extern void usb_host_cleanup(void);
29
30extern int usb_suspend_device(struct usb_device *dev);
31extern int usb_resume_device(struct usb_device *dev);
32
33extern struct device_driver usb_generic_driver;
34extern int usb_generic_driver_data;
35extern int usb_device_match(struct device *dev, struct device_driver *drv);
36
37/* Interfaces and their "power state" are owned by usbcore */
38
39static inline void mark_active(struct usb_interface *f)
40{
41 f->dev.power.power_state.event = PM_EVENT_ON;
42}
43
44static inline void mark_quiesced(struct usb_interface *f)
45{
46 f->dev.power.power_state.event = PM_EVENT_FREEZE;
47}
48
49static inline int is_active(struct usb_interface *f)
50{
51 return f->dev.power.power_state.event == PM_EVENT_ON;
52}
53
54
55/* for labeling diagnostics */
56extern const char *usbcore_name;
57
58/* usbfs stuff */
59extern struct usb_driver usbfs_driver;
60extern struct file_operations usbfs_devices_fops;
61extern struct file_operations usbfs_device_file_operations;
62extern void usbfs_conn_disc_event(void);
63
64extern int usbdev_init(void);
65extern void usbdev_cleanup(void);
66
67struct dev_state {
68 struct list_head list; /* state list */
69 struct usb_device *dev;
70 struct file *file;
71 spinlock_t lock; /* protects the async urb lists */
72 struct list_head async_pending;
73 struct list_head async_completed;
74 wait_queue_head_t wait; /* wake up if a request completed */
75 unsigned int discsignr;
76 pid_t disc_pid;
77 uid_t disc_uid, disc_euid;
78 void __user *disccontext;
79 unsigned long ifclaimed;
80};
81
82/* internal notify stuff */
83extern void usb_notify_add_device(struct usb_device *udev);
84extern void usb_notify_remove_device(struct usb_device *udev);
85extern void usb_notify_add_bus(struct usb_bus *ubus);
86extern void usb_notify_remove_bus(struct usb_bus *ubus);
87