[PATCH] Kprobes: preempt_disable/enable() simplification
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / usb / core / usb.h
blob1c4a68499dce53cd060b27deb0d05c6658a01a04
1 /* Functions local to drivers/usb/core/ */
3 extern void usb_create_sysfs_dev_files (struct usb_device *dev);
4 extern void usb_remove_sysfs_dev_files (struct usb_device *dev);
5 extern void usb_create_sysfs_intf_files (struct usb_interface *intf);
6 extern void usb_remove_sysfs_intf_files (struct usb_interface *intf);
8 extern void usb_disable_endpoint (struct usb_device *dev, unsigned int epaddr);
9 extern void usb_disable_interface (struct usb_device *dev,
10 struct usb_interface *intf);
11 extern void usb_release_interface_cache(struct kref *ref);
12 extern void usb_disable_device (struct usb_device *dev, int skip_ep0);
14 extern int usb_get_device_descriptor(struct usb_device *dev,
15 unsigned int size);
16 extern char *usb_cache_string(struct usb_device *udev, int index);
17 extern int usb_set_configuration(struct usb_device *dev, int configuration);
19 extern void usb_lock_all_devices(void);
20 extern void usb_unlock_all_devices(void);
22 extern void usb_kick_khubd(struct usb_device *dev);
23 extern void usb_suspend_root_hub(struct usb_device *hdev);
24 extern void usb_resume_root_hub(struct usb_device *dev);
26 extern int usb_hub_init(void);
27 extern void usb_hub_cleanup(void);
28 extern int usb_major_init(void);
29 extern void usb_major_cleanup(void);
30 extern int usb_host_init(void);
31 extern void usb_host_cleanup(void);
33 extern int usb_suspend_device(struct usb_device *dev);
34 extern int usb_resume_device(struct usb_device *dev);
37 /* Interfaces and their "power state" are owned by usbcore */
39 static inline void mark_active(struct usb_interface *f)
41 f->dev.power.power_state.event = PM_EVENT_ON;
44 static inline void mark_quiesced(struct usb_interface *f)
46 f->dev.power.power_state.event = PM_EVENT_FREEZE;
49 static inline int is_active(struct usb_interface *f)
51 return f->dev.power.power_state.event == PM_EVENT_ON;
55 /* for labeling diagnostics */
56 extern const char *usbcore_name;
58 /* usbfs stuff */
59 extern struct usb_driver usbfs_driver;
60 extern struct file_operations usbfs_devices_fops;
61 extern struct file_operations usbfs_device_file_operations;
62 extern void usbfs_conn_disc_event(void);
64 extern int usbdev_init(void);
65 extern void usbdev_cleanup(void);
67 struct 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;
82 /* internal notify stuff */
83 extern void usb_notify_add_device(struct usb_device *udev);
84 extern void usb_notify_remove_device(struct usb_device *udev);
85 extern void usb_notify_add_bus(struct usb_bus *ubus);
86 extern void usb_notify_remove_bus(struct usb_bus *ubus);