ca.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <title>DVB CA Device</title>
  2. <para>The DVB CA device controls the conditional access hardware. It can be accessed through
  3. <emphasis role="tt">/dev/dvb/adapter0/ca0</emphasis>. Data types and and ioctl definitions can be accessed by
  4. including <emphasis role="tt">linux/dvb/ca.h</emphasis> in your application.
  5. </para>
  6. <section id="ca_data_types">
  7. <title>CA Data Types</title>
  8. <section id="ca-slot-info">
  9. <title>ca_slot_info_t</title>
  10. <programlisting>
  11. typedef struct ca_slot_info {
  12. int num; /&#x22C6; slot number &#x22C6;/
  13. int type; /&#x22C6; CA interface this slot supports &#x22C6;/
  14. #define CA_CI 1 /&#x22C6; CI high level interface &#x22C6;/
  15. #define CA_CI_LINK 2 /&#x22C6; CI link layer level interface &#x22C6;/
  16. #define CA_CI_PHYS 4 /&#x22C6; CI physical layer level interface &#x22C6;/
  17. #define CA_DESCR 8 /&#x22C6; built-in descrambler &#x22C6;/
  18. #define CA_SC 128 /&#x22C6; simple smart card interface &#x22C6;/
  19. unsigned int flags;
  20. #define CA_CI_MODULE_PRESENT 1 /&#x22C6; module (or card) inserted &#x22C6;/
  21. #define CA_CI_MODULE_READY 2
  22. } ca_slot_info_t;
  23. </programlisting>
  24. </section>
  25. <section id="ca-descr-info">
  26. <title>ca_descr_info_t</title>
  27. <programlisting>
  28. typedef struct ca_descr_info {
  29. unsigned int num; /&#x22C6; number of available descramblers (keys) &#x22C6;/
  30. unsigned int type; /&#x22C6; type of supported scrambling system &#x22C6;/
  31. #define CA_ECD 1
  32. #define CA_NDS 2
  33. #define CA_DSS 4
  34. } ca_descr_info_t;
  35. </programlisting>
  36. </section>
  37. <section id="ca-caps">
  38. <title>ca_caps_t</title>
  39. <programlisting>
  40. typedef struct ca_caps {
  41. unsigned int slot_num; /&#x22C6; total number of CA card and module slots &#x22C6;/
  42. unsigned int slot_type; /&#x22C6; OR of all supported types &#x22C6;/
  43. unsigned int descr_num; /&#x22C6; total number of descrambler slots (keys) &#x22C6;/
  44. unsigned int descr_type;/&#x22C6; OR of all supported types &#x22C6;/
  45. } ca_cap_t;
  46. </programlisting>
  47. </section>
  48. <section id="ca-msg">
  49. <title>ca_msg_t</title>
  50. <programlisting>
  51. /&#x22C6; a message to/from a CI-CAM &#x22C6;/
  52. typedef struct ca_msg {
  53. unsigned int index;
  54. unsigned int type;
  55. unsigned int length;
  56. unsigned char msg[256];
  57. } ca_msg_t;
  58. </programlisting>
  59. </section>
  60. <section id="ca-descr">
  61. <title>ca_descr_t</title>
  62. <programlisting>
  63. typedef struct ca_descr {
  64. unsigned int index;
  65. unsigned int parity;
  66. unsigned char cw[8];
  67. } ca_descr_t;
  68. </programlisting>
  69. </section>
  70. <section id="ca-pid">
  71. <title>ca-pid</title>
  72. <programlisting>
  73. typedef struct ca_pid {
  74. unsigned int pid;
  75. int index; /&#x22C6; -1 == disable&#x22C6;/
  76. } ca_pid_t;
  77. </programlisting>
  78. </section></section>
  79. <section id="ca_function_calls">
  80. <title>CA Function Calls</title>
  81. <section id="ca_fopen">
  82. <title>open()</title>
  83. <para>DESCRIPTION
  84. </para>
  85. <informaltable><tgroup cols="1"><tbody><row><entry
  86. align="char">
  87. <para>This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use.</para>
  88. <para>When an open() call has succeeded, the device will be ready for use.
  89. The significance of blocking or non-blocking mode is described in the
  90. documentation for functions where there is a difference. It does not affect the
  91. semantics of the open() call itself. A device opened in blocking mode can later
  92. be put into non-blocking mode (and vice versa) using the F_SETFL command
  93. of the fcntl system call. This is a standard system call, documented in the Linux
  94. manual page for fcntl. Only one user can open the CA Device in O_RDWR
  95. mode. All other attempts to open the device in this mode will fail, and an error
  96. code will be returned.</para>
  97. </entry>
  98. </row></tbody></tgroup></informaltable>
  99. <para>SYNOPSIS
  100. </para>
  101. <informaltable><tgroup cols="1"><tbody><row><entry
  102. align="char">
  103. <para>int open(const char &#x22C6;deviceName, int flags);</para>
  104. </entry>
  105. </row></tbody></tgroup></informaltable>
  106. <para>PARAMETERS
  107. </para>
  108. <informaltable><tgroup cols="2"><tbody><row><entry
  109. align="char">
  110. <para>const char
  111. *deviceName</para>
  112. </entry><entry
  113. align="char">
  114. <para>Name of specific video device.</para>
  115. </entry>
  116. </row><row><entry
  117. align="char">
  118. <para>int flags</para>
  119. </entry><entry
  120. align="char">
  121. <para>A bit-wise OR of the following flags:</para>
  122. </entry>
  123. </row><row><entry
  124. align="char">
  125. </entry><entry
  126. align="char">
  127. <para>O_RDONLY read-only access</para>
  128. </entry>
  129. </row><row><entry
  130. align="char">
  131. </entry><entry
  132. align="char">
  133. <para>O_RDWR read/write access</para>
  134. </entry>
  135. </row><row><entry
  136. align="char">
  137. </entry><entry
  138. align="char">
  139. <para>O_NONBLOCK open in non-blocking mode</para>
  140. </entry>
  141. </row><row><entry
  142. align="char">
  143. </entry><entry
  144. align="char">
  145. <para>(blocking mode is the default)</para>
  146. </entry>
  147. </row></tbody></tgroup></informaltable>
  148. <para>ERRORS
  149. </para>
  150. <informaltable><tgroup cols="2"><tbody><row><entry
  151. align="char">
  152. <para>ENODEV</para>
  153. </entry><entry
  154. align="char">
  155. <para>Device driver not loaded/available.</para>
  156. </entry>
  157. </row><row><entry
  158. align="char">
  159. <para>EINTERNAL</para>
  160. </entry><entry
  161. align="char">
  162. <para>Internal error.</para>
  163. </entry>
  164. </row><row><entry
  165. align="char">
  166. <para>EBUSY</para>
  167. </entry><entry
  168. align="char">
  169. <para>Device or resource busy.</para>
  170. </entry>
  171. </row><row><entry
  172. align="char">
  173. <para>EINVAL</para>
  174. </entry><entry
  175. align="char">
  176. <para>Invalid argument.</para>
  177. </entry>
  178. </row></tbody></tgroup></informaltable>
  179. </section>
  180. <section id="ca_fclose">
  181. <title>close()</title>
  182. <para>DESCRIPTION
  183. </para>
  184. <informaltable><tgroup cols="1"><tbody><row><entry
  185. align="char">
  186. <para>This system call closes a previously opened audio device.</para>
  187. </entry>
  188. </row></tbody></tgroup></informaltable>
  189. <para>SYNOPSIS
  190. </para>
  191. <informaltable><tgroup cols="1"><tbody><row><entry
  192. align="char">
  193. <para>int close(int fd);</para>
  194. </entry>
  195. </row></tbody></tgroup></informaltable>
  196. <para>PARAMETERS
  197. </para>
  198. <informaltable><tgroup cols="2"><tbody><row><entry
  199. align="char">
  200. <para>int fd</para>
  201. </entry><entry
  202. align="char">
  203. <para>File descriptor returned by a previous call to open().</para>
  204. </entry>
  205. </row></tbody></tgroup></informaltable>
  206. <para>ERRORS
  207. </para>
  208. <informaltable><tgroup cols="2"><tbody><row><entry
  209. align="char">
  210. <para>EBADF</para>
  211. </entry><entry
  212. align="char">
  213. <para>fd is not a valid open file descriptor.</para>
  214. </entry>
  215. </row></tbody></tgroup></informaltable>
  216. </section>
  217. </section>