vhci_driver.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2005-2007 Takahiro Hirofuchi
  3. */
  4. #ifndef __VHCI_DRIVER_H
  5. #define __VHCI_DRIVER_H
  6. #include <libudev.h>
  7. #include <stdint.h>
  8. #include "usbip_common.h"
  9. #define USBIP_VHCI_BUS_TYPE "platform"
  10. #define MAXNPORT 128
  11. struct usbip_imported_device {
  12. uint8_t port;
  13. uint32_t status;
  14. uint32_t devid;
  15. uint8_t busnum;
  16. uint8_t devnum;
  17. /* usbip_class_device list */
  18. struct usbip_usb_device udev;
  19. };
  20. struct usbip_vhci_driver {
  21. /* /sys/devices/platform/vhci_hcd */
  22. struct udev_device *hc_device;
  23. int nports;
  24. struct usbip_imported_device idev[MAXNPORT];
  25. };
  26. extern struct usbip_vhci_driver *vhci_driver;
  27. int usbip_vhci_driver_open(void);
  28. void usbip_vhci_driver_close(void);
  29. int usbip_vhci_refresh_device_list(void);
  30. int usbip_vhci_get_free_port(void);
  31. int usbip_vhci_attach_device2(uint8_t port, int sockfd, uint32_t devid,
  32. uint32_t speed);
  33. /* will be removed */
  34. int usbip_vhci_attach_device(uint8_t port, int sockfd, uint8_t busnum,
  35. uint8_t devnum, uint32_t speed);
  36. int usbip_vhci_detach_device(uint8_t port);
  37. int usbip_vhci_imported_device_dump(struct usbip_imported_device *idev);
  38. #endif /* __VHCI_DRIVER_H */