usb.h revision a7b986b3e107727dd1c1af0ead0b5e52d7726db3
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 int usb_set_configuration(struct usb_device *dev, int configuration);
17
18extern void usb_lock_all_devices(void);
19extern void usb_unlock_all_devices(void);
20
21extern void usb_kick_khubd(struct usb_device *dev);
22extern void usb_suspend_root_hub(struct usb_device *hdev);
23extern void usb_resume_root_hub(struct usb_device *dev);
24
25extern int  usb_hub_init(void);
26extern void usb_hub_cleanup(void);
27extern int usb_major_init(void);
28extern void usb_major_cleanup(void);
29extern int usb_host_init(void);
30extern void usb_host_cleanup(void);
31
32extern int usb_suspend_device(struct usb_device *dev);
33extern int usb_resume_device(struct usb_device *dev);
34
35
36/* Interfaces and their "power state" are owned by usbcore */
37
38static inline void mark_active(struct usb_interface *f)
39{
40	f->dev.power.power_state.event = PM_EVENT_ON;
41}
42
43static inline void mark_quiesced(struct usb_interface *f)
44{
45	f->dev.power.power_state.event = PM_EVENT_FREEZE;
46}
47
48static inline int is_active(struct usb_interface *f)
49{
50	return f->dev.power.power_state.event == PM_EVENT_ON;
51}
52
53
54/* for labeling diagnostics */
55extern const char *usbcore_name;
56
57/* usbfs stuff */
58extern struct usb_driver usbfs_driver;
59extern struct file_operations usbfs_devices_fops;
60extern struct file_operations usbfs_device_file_operations;
61extern void usbfs_conn_disc_event(void);
62
63extern int usbdev_init(void);
64extern void usbdev_cleanup(void);
65
66struct dev_state {
67	struct list_head list;      /* state list */
68	struct usb_device *dev;
69	struct file *file;
70	spinlock_t lock;            /* protects the async urb lists */
71	struct list_head async_pending;
72	struct list_head async_completed;
73	wait_queue_head_t wait;     /* wake up if a request completed */
74	unsigned int discsignr;
75	pid_t disc_pid;
76	uid_t disc_uid, disc_euid;
77	void __user *disccontext;
78	unsigned long ifclaimed;
79};
80
81/* internal notify stuff */
82extern void usb_notify_add_device(struct usb_device *udev);
83extern void usb_notify_remove_device(struct usb_device *udev);
84extern void usb_notify_add_bus(struct usb_bus *ubus);
85extern void usb_notify_remove_bus(struct usb_bus *ubus);
86
87