ca.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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>RETURN VALUE</para>
  149. <informaltable><tgroup cols="2"><tbody><row><entry
  150. align="char">
  151. <para>ENODEV</para>
  152. </entry><entry
  153. align="char">
  154. <para>Device driver not loaded/available.</para>
  155. </entry>
  156. </row><row><entry
  157. align="char">
  158. <para>EINTERNAL</para>
  159. </entry><entry
  160. align="char">
  161. <para>Internal error.</para>
  162. </entry>
  163. </row><row><entry
  164. align="char">
  165. <para>EBUSY</para>
  166. </entry><entry
  167. align="char">
  168. <para>Device or resource busy.</para>
  169. </entry>
  170. </row><row><entry
  171. align="char">
  172. <para>EINVAL</para>
  173. </entry><entry
  174. align="char">
  175. <para>Invalid argument.</para>
  176. </entry>
  177. </row></tbody></tgroup></informaltable>
  178. </section>
  179. <section id="ca_fclose">
  180. <title>close()</title>
  181. <para>DESCRIPTION
  182. </para>
  183. <informaltable><tgroup cols="1"><tbody><row><entry
  184. align="char">
  185. <para>This system call closes a previously opened audio device.</para>
  186. </entry>
  187. </row></tbody></tgroup></informaltable>
  188. <para>SYNOPSIS
  189. </para>
  190. <informaltable><tgroup cols="1"><tbody><row><entry
  191. align="char">
  192. <para>int close(int fd);</para>
  193. </entry>
  194. </row></tbody></tgroup></informaltable>
  195. <para>PARAMETERS
  196. </para>
  197. <informaltable><tgroup cols="2"><tbody><row><entry
  198. align="char">
  199. <para>int fd</para>
  200. </entry><entry
  201. align="char">
  202. <para>File descriptor returned by a previous call to open().</para>
  203. </entry>
  204. </row></tbody></tgroup></informaltable>
  205. <para>RETURN VALUE</para>
  206. <informaltable><tgroup cols="2"><tbody><row><entry
  207. align="char">
  208. <para>EBADF</para>
  209. </entry><entry
  210. align="char">
  211. <para>fd is not a valid open file descriptor.</para>
  212. </entry>
  213. </row></tbody></tgroup></informaltable>
  214. </section>
  215. </section>