usb.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* Functions local to drivers/usb/core/ */
  2. extern void usb_create_sysfs_dev_files (struct usb_device *dev);
  3. extern void usb_remove_sysfs_dev_files (struct usb_device *dev);
  4. extern void usb_create_sysfs_intf_files (struct usb_interface *intf);
  5. extern void usb_remove_sysfs_intf_files (struct usb_interface *intf);
  6. extern void usb_disable_endpoint (struct usb_device *dev, unsigned int epaddr);
  7. extern void usb_disable_interface (struct usb_device *dev,
  8. struct usb_interface *intf);
  9. extern void usb_release_interface_cache(struct kref *ref);
  10. extern void usb_disable_device (struct usb_device *dev, int skip_ep0);
  11. extern int usb_get_device_descriptor(struct usb_device *dev,
  12. unsigned int size);
  13. extern int usb_set_configuration(struct usb_device *dev, int configuration);
  14. extern void usb_lock_all_devices(void);
  15. extern void usb_unlock_all_devices(void);
  16. extern void usb_kick_khubd(struct usb_device *dev);
  17. extern void usb_suspend_root_hub(struct usb_device *hdev);
  18. extern void usb_resume_root_hub(struct usb_device *dev);
  19. extern int usb_hub_init(void);
  20. extern void usb_hub_cleanup(void);
  21. extern int usb_major_init(void);
  22. extern void usb_major_cleanup(void);
  23. extern int usb_host_init(void);
  24. extern void usb_host_cleanup(void);
  25. extern int usb_suspend_device(struct usb_device *dev);
  26. extern int usb_resume_device(struct usb_device *dev);
  27. /* Interfaces and their "power state" are owned by usbcore */
  28. static inline void mark_active(struct usb_interface *f)
  29. {
  30. f->dev.power.power_state.event = PM_EVENT_ON;
  31. }
  32. static inline void mark_quiesced(struct usb_interface *f)
  33. {
  34. f->dev.power.power_state.event = PM_EVENT_FREEZE;
  35. }
  36. static inline int is_active(struct usb_interface *f)
  37. {
  38. return f->dev.power.power_state.event == PM_EVENT_ON;
  39. }
  40. /* for labeling diagnostics */
  41. extern const char *usbcore_name;
  42. /* usbfs stuff */
  43. extern struct usb_driver usbfs_driver;
  44. extern struct file_operations usbfs_devices_fops;
  45. extern struct file_operations usbfs_device_file_operations;
  46. extern void usbfs_conn_disc_event(void);
  47. extern int usbdev_init(void);
  48. extern void usbdev_cleanup(void);
  49. extern void usbdev_add(struct usb_device *dev);
  50. extern void usbdev_remove(struct usb_device *dev);
  51. extern struct usb_device *usbdev_lookup_minor(int minor);
  52. struct dev_state {
  53. struct list_head list; /* state list */
  54. struct usb_device *dev;
  55. struct file *file;
  56. spinlock_t lock; /* protects the async urb lists */
  57. struct list_head async_pending;
  58. struct list_head async_completed;
  59. wait_queue_head_t wait; /* wake up if a request completed */
  60. unsigned int discsignr;
  61. pid_t disc_pid;
  62. uid_t disc_uid, disc_euid;
  63. void __user *disccontext;
  64. unsigned long ifclaimed;
  65. };