blob: 7add46ecc6a24e7f6893da2345ced808cf4d40a1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* 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);
David Brownell979d5192005-09-22 22:32:24 -070022extern void usb_suspend_root_hub(struct usb_device *hdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070023extern void usb_resume_root_hub(struct usb_device *dev);
24
Greg KH6d5e8252005-04-18 17:39:24 -070025extern 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
David Brownelldb690872005-09-13 19:56:33 -070032/* Interfaces and their "power state" are owned by usbcore */
33
34static inline void mark_active(struct usb_interface *f)
35{
36 f->dev.power.power_state.event = PM_EVENT_ON;
37}
38
39static inline void mark_quiesced(struct usb_interface *f)
40{
41 f->dev.power.power_state.event = PM_EVENT_FREEZE;
42}
43
44static inline int is_active(struct usb_interface *f)
45{
46 return f->dev.power.power_state.event == PM_EVENT_ON;
47}
48
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050/* for labeling diagnostics */
51extern const char *usbcore_name;
52
53/* usbfs stuff */
54extern struct usb_driver usbfs_driver;
55extern struct file_operations usbfs_devices_fops;
56extern struct file_operations usbfs_device_file_operations;
57extern void usbfs_conn_disc_event(void);
58
Kay Sieversfbf82fd2005-07-31 01:05:53 +020059extern int usbdev_init(void);
60extern void usbdev_cleanup(void);
61extern void usbdev_add(struct usb_device *dev);
62extern void usbdev_remove(struct usb_device *dev);
63extern struct usb_device *usbdev_lookup_minor(int minor);
Greg KH6d5e8252005-04-18 17:39:24 -070064
Linus Torvalds1da177e2005-04-16 15:20:36 -070065struct dev_state {
66 struct list_head list; /* state list */
67 struct usb_device *dev;
68 struct file *file;
69 spinlock_t lock; /* protects the async urb lists */
70 struct list_head async_pending;
71 struct list_head async_completed;
72 wait_queue_head_t wait; /* wake up if a request completed */
73 unsigned int discsignr;
Linus Torvaldsd7dd8a72005-10-10 16:31:30 -070074 pid_t disc_pid;
75 uid_t disc_uid, disc_euid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 void __user *disccontext;
77 unsigned long ifclaimed;
78};
79