vhci_driver.h 1.3 KB

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