ca.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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_t">
  9. <title>ca_slot_info_t</title>
  10. <programlisting>
  11. /&#x22C6; slot interface types and info &#x22C6;/
  12. typedef struct ca_slot_info_s {
  13. int num; /&#x22C6; slot number &#x22C6;/
  14. int type; /&#x22C6; CA interface this slot supports &#x22C6;/
  15. #define CA_CI 1 /&#x22C6; CI high level interface &#x22C6;/
  16. #define CA_CI_LINK 2 /&#x22C6; CI link layer level interface &#x22C6;/
  17. #define CA_CI_PHYS 4 /&#x22C6; CI physical layer level interface &#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_t">
  26. <title>ca_descr_info_t</title>
  27. <programlisting>
  28. typedef struct ca_descr_info_s {
  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_cap_t">
  38. <title>ca_cap_t</title>
  39. <programlisting>
  40. typedef struct ca_cap_s {
  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_t">
  49. <title>ca_msg_t</title>
  50. <programlisting>
  51. /&#x22C6; a message to/from a CI-CAM &#x22C6;/
  52. typedef struct ca_msg_s {
  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_t">
  61. <title>ca_descr_t</title>
  62. <programlisting>
  63. typedef struct ca_descr_s {
  64. unsigned int index;
  65. unsigned int parity;
  66. unsigned char cw[8];
  67. } ca_descr_t;
  68. </programlisting>
  69. </section></section>
  70. <section id="ca_function_calls">
  71. <title>CA Function Calls</title>
  72. <section id="ca_fopen">
  73. <title>open()</title>
  74. <para>DESCRIPTION
  75. </para>
  76. <informaltable><tgroup cols="1"><tbody><row><entry
  77. align="char">
  78. <para>This system call opens a named ca device (e.g. /dev/ost/ca) for subsequent use.</para>
  79. <para>When an open() call has succeeded, the device will be ready for use.
  80. The significance of blocking or non-blocking mode is described in the
  81. documentation for functions where there is a difference. It does not affect the
  82. semantics of the open() call itself. A device opened in blocking mode can later
  83. be put into non-blocking mode (and vice versa) using the F_SETFL command
  84. of the fcntl system call. This is a standard system call, documented in the Linux
  85. manual page for fcntl. Only one user can open the CA Device in O_RDWR
  86. mode. All other attempts to open the device in this mode will fail, and an error
  87. code will be returned.</para>
  88. </entry>
  89. </row></tbody></tgroup></informaltable>
  90. <para>SYNOPSIS
  91. </para>
  92. <informaltable><tgroup cols="1"><tbody><row><entry
  93. align="char">
  94. <para>int open(const char &#x22C6;deviceName, int flags);</para>
  95. </entry>
  96. </row></tbody></tgroup></informaltable>
  97. <para>PARAMETERS
  98. </para>
  99. <informaltable><tgroup cols="2"><tbody><row><entry
  100. align="char">
  101. <para>const char
  102. *deviceName</para>
  103. </entry><entry
  104. align="char">
  105. <para>Name of specific video device.</para>
  106. </entry>
  107. </row><row><entry
  108. align="char">
  109. <para>int flags</para>
  110. </entry><entry
  111. align="char">
  112. <para>A bit-wise OR of the following flags:</para>
  113. </entry>
  114. </row><row><entry
  115. align="char">
  116. </entry><entry
  117. align="char">
  118. <para>O_RDONLY read-only access</para>
  119. </entry>
  120. </row><row><entry
  121. align="char">
  122. </entry><entry
  123. align="char">
  124. <para>O_RDWR read/write access</para>
  125. </entry>
  126. </row><row><entry
  127. align="char">
  128. </entry><entry
  129. align="char">
  130. <para>O_NONBLOCK open in non-blocking mode</para>
  131. </entry>
  132. </row><row><entry
  133. align="char">
  134. </entry><entry
  135. align="char">
  136. <para>(blocking mode is the default)</para>
  137. </entry>
  138. </row></tbody></tgroup></informaltable>
  139. <para>ERRORS
  140. </para>
  141. <informaltable><tgroup cols="2"><tbody><row><entry
  142. align="char">
  143. <para>ENODEV</para>
  144. </entry><entry
  145. align="char">
  146. <para>Device driver not loaded/available.</para>
  147. </entry>
  148. </row><row><entry
  149. align="char">
  150. <para>EINTERNAL</para>
  151. </entry><entry
  152. align="char">
  153. <para>Internal error.</para>
  154. </entry>
  155. </row><row><entry
  156. align="char">
  157. <para>EBUSY</para>
  158. </entry><entry
  159. align="char">
  160. <para>Device or resource busy.</para>
  161. </entry>
  162. </row><row><entry
  163. align="char">
  164. <para>EINVAL</para>
  165. </entry><entry
  166. align="char">
  167. <para>Invalid argument.</para>
  168. </entry>
  169. </row></tbody></tgroup></informaltable>
  170. </section>
  171. <section id="ca_fclose">
  172. <title>close()</title>
  173. <para>DESCRIPTION
  174. </para>
  175. <informaltable><tgroup cols="1"><tbody><row><entry
  176. align="char">
  177. <para>This system call closes a previously opened audio device.</para>
  178. </entry>
  179. </row></tbody></tgroup></informaltable>
  180. <para>SYNOPSIS
  181. </para>
  182. <informaltable><tgroup cols="1"><tbody><row><entry
  183. align="char">
  184. <para>int close(int fd);</para>
  185. </entry>
  186. </row></tbody></tgroup></informaltable>
  187. <para>PARAMETERS
  188. </para>
  189. <informaltable><tgroup cols="2"><tbody><row><entry
  190. align="char">
  191. <para>int fd</para>
  192. </entry><entry
  193. align="char">
  194. <para>File descriptor returned by a previous call to open().</para>
  195. </entry>
  196. </row></tbody></tgroup></informaltable>
  197. <para>ERRORS
  198. </para>
  199. <informaltable><tgroup cols="2"><tbody><row><entry
  200. align="char">
  201. <para>EBADF</para>
  202. </entry><entry
  203. align="char">
  204. <para>fd is not a valid open file descriptor.</para>
  205. </entry>
  206. </row></tbody></tgroup></informaltable>
  207. </section>
  208. </section>