usbdef32_linux.go 618 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // +build 386 amd64p32 arm armbe mips mipsle mips64p32 mips64p32le ppc s390 sparc
  2. package hid
  3. import (
  4. "unsafe"
  5. )
  6. const (
  7. USBDEVFS_IOCTL = 0xc00c5512
  8. USBDEVFS_BULK = 0xc0105502
  9. USBDEVFS_CONTROL = 0xc0105500
  10. )
  11. type usbfsIoctl struct {
  12. Interface uint32
  13. IoctlCode uint32
  14. Data uint32
  15. }
  16. type usbfsCtrl struct {
  17. ReqType uint8
  18. Req uint8
  19. Value uint16
  20. Index uint16
  21. Len uint16
  22. Timeout uint32
  23. Data uint32
  24. }
  25. type usbfsBulk struct {
  26. Endpoint uint32
  27. Len uint32
  28. Timeout uint32
  29. Data uint32
  30. }
  31. func slicePtr(b []byte) uint32 {
  32. return uint32(uintptr(unsafe.Pointer(&b[0])))
  33. }