userio.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * userio: virtual serio device support
  3. * Copyright (C) 2015 Red Hat
  4. * Copyright (C) 2015 Lyude (Stephen Chandler Paul) <cpaul@redhat.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU Lesser General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  14. * details.
  15. *
  16. * This is the public header used for user-space communication with the userio
  17. * driver. __attribute__((__packed__)) is used for all structs to keep ABI
  18. * compatibility between all architectures.
  19. */
  20. #ifndef _USERIO_H
  21. #define _USERIO_H
  22. #include <linux/types.h>
  23. enum userio_cmd_type {
  24. USERIO_CMD_REGISTER = 0,
  25. USERIO_CMD_SET_PORT_TYPE = 1,
  26. USERIO_CMD_SEND_INTERRUPT = 2
  27. };
  28. /*
  29. * userio Commands
  30. * All commands sent to /dev/userio are encoded using this structure. The type
  31. * field should contain a USERIO_CMD* value that indicates what kind of command
  32. * is being sent to userio. The data field should contain the accompanying
  33. * argument for the command, if there is one.
  34. */
  35. struct userio_cmd {
  36. __u8 type;
  37. __u8 data;
  38. } __attribute__((__packed__));
  39. #endif /* !_USERIO_H */