usbdef64_linux.go 594 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // +build amd64
  2. package hid
  3. import (
  4. "unsafe"
  5. )
  6. const (
  7. USBDEVFS_IOCTL = 0xc0105512
  8. USBDEVFS_BULK = 0xc0185502
  9. USBDEVFS_CONTROL = 0xc0185500
  10. )
  11. type usbfsIoctl struct {
  12. Interface uint32
  13. IoctlCode uint32
  14. Data uint64
  15. }
  16. type usbfsCtrl struct {
  17. ReqType uint8
  18. Req uint8
  19. Value uint16
  20. Index uint16
  21. Len uint16
  22. Timeout uint32
  23. _ uint32
  24. Data uint64 // FIXME
  25. }
  26. type usbfsBulk struct {
  27. Endpoint uint32
  28. Len uint32
  29. Timeout uint32
  30. _ uint32
  31. Data uint64
  32. }
  33. func slicePtr(b []byte) uint64 {
  34. return uint64(uintptr(unsafe.Pointer(&b[0])))
  35. }