logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

ca.h (3510B)


  1. /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */
  2. /*
  3. * ca.h
  4. *
  5. * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
  6. * & Marcus Metzler <marcus@convergence.de>
  7. * for convergence integrated media GmbH
  8. */
  9. #ifndef _DVBCA_H_
  10. #define _DVBCA_H_
  11. /**
  12. * struct ca_slot_info - CA slot interface types and info.
  13. *
  14. * @num: slot number.
  15. * @type: slot type.
  16. * @flags: flags applicable to the slot.
  17. *
  18. * This struct stores the CA slot information.
  19. *
  20. * @type can be:
  21. *
  22. * - %CA_CI - CI high level interface;
  23. * - %CA_CI_LINK - CI link layer level interface;
  24. * - %CA_CI_PHYS - CI physical layer level interface;
  25. * - %CA_DESCR - built-in descrambler;
  26. * - %CA_SC -simple smart card interface.
  27. *
  28. * @flags can be:
  29. *
  30. * - %CA_CI_MODULE_PRESENT - module (or card) inserted;
  31. * - %CA_CI_MODULE_READY - module is ready for usage.
  32. */
  33. struct ca_slot_info {
  34. int num;
  35. int type;
  36. #define CA_CI 1
  37. #define CA_CI_LINK 2
  38. #define CA_CI_PHYS 4
  39. #define CA_DESCR 8
  40. #define CA_SC 128
  41. unsigned int flags;
  42. #define CA_CI_MODULE_PRESENT 1
  43. #define CA_CI_MODULE_READY 2
  44. };
  45. /**
  46. * struct ca_descr_info - descrambler types and info.
  47. *
  48. * @num: number of available descramblers (keys).
  49. * @type: type of supported scrambling system.
  50. *
  51. * Identifies the number of descramblers and their type.
  52. *
  53. * @type can be:
  54. *
  55. * - %CA_ECD - European Common Descrambler (ECD) hardware;
  56. * - %CA_NDS - Videoguard (NDS) hardware;
  57. * - %CA_DSS - Distributed Sample Scrambling (DSS) hardware.
  58. */
  59. struct ca_descr_info {
  60. unsigned int num;
  61. unsigned int type;
  62. #define CA_ECD 1
  63. #define CA_NDS 2
  64. #define CA_DSS 4
  65. };
  66. /**
  67. * struct ca_caps - CA slot interface capabilities.
  68. *
  69. * @slot_num: total number of CA card and module slots.
  70. * @slot_type: bitmap with all supported types as defined at
  71. * &struct ca_slot_info (e. g. %CA_CI, %CA_CI_LINK, etc).
  72. * @descr_num: total number of descrambler slots (keys)
  73. * @descr_type: bitmap with all supported types as defined at
  74. * &struct ca_descr_info (e. g. %CA_ECD, %CA_NDS, etc).
  75. */
  76. struct ca_caps {
  77. unsigned int slot_num;
  78. unsigned int slot_type;
  79. unsigned int descr_num;
  80. unsigned int descr_type;
  81. };
  82. /**
  83. * struct ca_msg - a message to/from a CI-CAM
  84. *
  85. * @index: unused
  86. * @type: unused
  87. * @length: length of the message
  88. * @msg: message
  89. *
  90. * This struct carries a message to be send/received from a CI CA module.
  91. */
  92. struct ca_msg {
  93. unsigned int index;
  94. unsigned int type;
  95. unsigned int length;
  96. unsigned char msg[256];
  97. };
  98. /**
  99. * struct ca_descr - CA descrambler control words info
  100. *
  101. * @index: CA Descrambler slot
  102. * @parity: control words parity, where 0 means even and 1 means odd
  103. * @cw: CA Descrambler control words
  104. */
  105. struct ca_descr {
  106. unsigned int index;
  107. unsigned int parity;
  108. unsigned char cw[8];
  109. };
  110. #define CA_RESET _IO('o', 128)
  111. #define CA_GET_CAP _IOR('o', 129, struct ca_caps)
  112. #define CA_GET_SLOT_INFO _IOR('o', 130, struct ca_slot_info)
  113. #define CA_GET_DESCR_INFO _IOR('o', 131, struct ca_descr_info)
  114. #define CA_GET_MSG _IOR('o', 132, struct ca_msg)
  115. #define CA_SEND_MSG _IOW('o', 133, struct ca_msg)
  116. #define CA_SET_DESCR _IOW('o', 134, struct ca_descr)
  117. /* This is needed for legacy userspace support */
  118. typedef struct ca_slot_info ca_slot_info_t;
  119. typedef struct ca_descr_info ca_descr_info_t;
  120. typedef struct ca_caps ca_caps_t;
  121. typedef struct ca_msg ca_msg_t;
  122. typedef struct ca_descr ca_descr_t;
  123. #endif