Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* Functions local to drivers/usb/core/ */ |
| 2 | |
| 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); |
| 7 | |
| 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); |
| 13 | |
| 14 | extern int usb_get_device_descriptor(struct usb_device *dev, |
| 15 | unsigned int size); |
| 16 | extern int usb_set_configuration(struct usb_device *dev, int configuration); |
| 17 | |
| 18 | extern void usb_lock_all_devices(void); |
| 19 | extern void usb_unlock_all_devices(void); |
| 20 | |
| 21 | extern void usb_kick_khubd(struct usb_device *dev); |
David Brownell | 979d519 | 2005-09-22 22:32:24 -0700 | [diff] [blame] | 22 | extern void usb_suspend_root_hub(struct usb_device *hdev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | extern void usb_resume_root_hub(struct usb_device *dev); |
| 24 | |
Greg KH | 6d5e825 | 2005-04-18 17:39:24 -0700 | [diff] [blame] | 25 | extern int usb_hub_init(void); |
| 26 | extern void usb_hub_cleanup(void); |
| 27 | extern int usb_major_init(void); |
| 28 | extern void usb_major_cleanup(void); |
| 29 | extern int usb_host_init(void); |
| 30 | extern void usb_host_cleanup(void); |
| 31 | |
David Brownell | 5edbfb7 | 2005-09-22 22:45:26 -0700 | [diff] [blame] | 32 | extern int usb_suspend_device(struct usb_device *dev); |
| 33 | extern int usb_resume_device(struct usb_device *dev); |
| 34 | |
| 35 | |
David Brownell | db69087 | 2005-09-13 19:56:33 -0700 | [diff] [blame] | 36 | /* Interfaces and their "power state" are owned by usbcore */ |
| 37 | |
| 38 | static inline void mark_active(struct usb_interface *f) |
| 39 | { |
| 40 | f->dev.power.power_state.event = PM_EVENT_ON; |
| 41 | } |
| 42 | |
| 43 | static inline void mark_quiesced(struct usb_interface *f) |
| 44 | { |
| 45 | f->dev.power.power_state.event = PM_EVENT_FREEZE; |
| 46 | } |
| 47 | |
| 48 | static inline int is_active(struct usb_interface *f) |
| 49 | { |
| 50 | return f->dev.power.power_state.event == PM_EVENT_ON; |
| 51 | } |
| 52 | |
| 53 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | /* for labeling diagnostics */ |
| 55 | extern const char *usbcore_name; |
| 56 | |
| 57 | /* usbfs stuff */ |
| 58 | extern struct usb_driver usbfs_driver; |
| 59 | extern struct file_operations usbfs_devices_fops; |
| 60 | extern struct file_operations usbfs_device_file_operations; |
| 61 | extern void usbfs_conn_disc_event(void); |
| 62 | |
Kay Sievers | fbf82fd | 2005-07-31 01:05:53 +0200 | [diff] [blame] | 63 | extern int usbdev_init(void); |
| 64 | extern void usbdev_cleanup(void); |
| 65 | extern void usbdev_add(struct usb_device *dev); |
| 66 | extern void usbdev_remove(struct usb_device *dev); |
Greg KH | 6d5e825 | 2005-04-18 17:39:24 -0700 | [diff] [blame] | 67 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | struct dev_state { |
| 69 | struct list_head list; /* state list */ |
| 70 | struct usb_device *dev; |
| 71 | struct file *file; |
| 72 | spinlock_t lock; /* protects the async urb lists */ |
| 73 | struct list_head async_pending; |
| 74 | struct list_head async_completed; |
| 75 | wait_queue_head_t wait; /* wake up if a request completed */ |
| 76 | unsigned int discsignr; |
Linus Torvalds | d7dd8a7 | 2005-10-10 16:31:30 -0700 | [diff] [blame] | 77 | pid_t disc_pid; |
| 78 | uid_t disc_uid, disc_euid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | void __user *disccontext; |
| 80 | unsigned long ifclaimed; |
| 81 | }; |
| 82 | |
Greg Kroah-Hartman | 3099e75 | 2005-06-20 21:15:16 -0700 | [diff] [blame^] | 83 | /* internal notify stuff */ |
| 84 | extern void usb_notify_add_device(struct usb_device *udev); |
| 85 | extern void usb_notify_remove_device(struct usb_device *udev); |
| 86 | extern void usb_notify_add_bus(struct usb_bus *ubus); |
| 87 | extern void usb_notify_remove_bus(struct usb_bus *ubus); |
| 88 | |