hx170dec.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Decoder device driver (kernel module headers)
  3. *
  4. * Copyright (C) 2009 Hantro Products Oy.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef _HX170DEC_H_
  20. #define _HX170DEC_H_
  21. #include <linux/ioctl.h>
  22. #include <linux/types.h>
  23. struct core_desc
  24. {
  25. __u32 id; /* id of the core */
  26. __u32 *regs; /* pointer to user registers */
  27. __u32 size; /* size of register space */
  28. };
  29. /* Use 'k' as magic number */
  30. #define HX170DEC_IOC_MAGIC 'k'
  31. /*
  32. * S means "Set" through a ptr,
  33. * T means "Tell" directly with the argument value
  34. * G means "Get": reply by setting through a pointer
  35. * Q means "Query": response is on the return value
  36. * X means "eXchange": G and S atomically
  37. * H means "sHift": T and Q atomically
  38. */
  39. #define HX170DEC_IOCGHWOFFSET _IOR(HX170DEC_IOC_MAGIC, 3, unsigned long *)
  40. #define HX170DEC_IOCGHWIOSIZE _IOR(HX170DEC_IOC_MAGIC, 4, unsigned int *)
  41. #define HX170DEC_IOC_MC_OFFSETS _IOR(HX170DEC_IOC_MAGIC, 7, unsigned long *)
  42. #define HX170DEC_IOC_MC_CORES _IOR(HX170DEC_IOC_MAGIC, 8, unsigned int *)
  43. #define HX170DEC_IOCS_DEC_PUSH_REG _IOW(HX170DEC_IOC_MAGIC, 9, struct core_desc *)
  44. #define HX170DEC_IOCS_PP_PUSH_REG _IOW(HX170DEC_IOC_MAGIC, 10, struct core_desc *)
  45. #define HX170DEC_IOCH_DEC_RESERVE _IO(HX170DEC_IOC_MAGIC, 11)
  46. #define HX170DEC_IOCT_DEC_RELEASE _IO(HX170DEC_IOC_MAGIC, 12)
  47. #define HX170DEC_IOCQ_PP_RESERVE _IO(HX170DEC_IOC_MAGIC, 13)
  48. #define HX170DEC_IOCT_PP_RELEASE _IO(HX170DEC_IOC_MAGIC, 14)
  49. #define HX170DEC_IOCX_DEC_WAIT _IOWR(HX170DEC_IOC_MAGIC, 15, struct core_desc *)
  50. #define HX170DEC_IOCX_PP_WAIT _IOWR(HX170DEC_IOC_MAGIC, 16, struct core_desc *)
  51. #define HX170DEC_IOCS_DEC_PULL_REG _IOWR(HX170DEC_IOC_MAGIC, 17, struct core_desc *)
  52. #define HX170DEC_IOCS_PP_PULL_REG _IOWR(HX170DEC_IOC_MAGIC, 18, struct core_desc *)
  53. #define HX170DEC_IOX_ASIC_ID _IOWR(HX170DEC_IOC_MAGIC, 20, __u32 *)
  54. /*
  55. * Following are not used yet:
  56. *
  57. * #define HX170DEC_PP_INSTANCE _IO(HX170DEC_IOC_MAGIC, 1)
  58. * #define HX170DEC_HW_PERFORMANCE _IO(HX170DEC_IOC_MAGIC, 2)
  59. * #define HX170DEC_IOC_CLI _IO(HX170DEC_IOC_MAGIC, 5)
  60. * #define HX170DEC_IOC_STI _IO(HX170DEC_IOC_MAGIC, 6)
  61. * #define HX170DEC_IOCG_CORE_WAIT _IOR(HX170DEC_IOC_MAGIC, 19, int *)
  62. * #define HX170DEC_DEBUG_STATUS _IO(HX170DEC_IOC_MAGIC, 29)
  63. */
  64. #define HX170DEC_IOC_MAXNR 29
  65. #endif /* !_HX170DEC_H_ */