1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 13. DVB CA Device</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="dvbapi.html" title="Part II. LINUX DVB API"><link rel="prev" href="audio_function_calls.html" title="Audio Function Calls"><link rel="next" href="ca_function_calls.html" title="CA Function Calls"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13. DVB CA Device</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="audio_function_calls.html">Prev</a> </td><th width="60%" align="center">Part II. LINUX DVB API</th><td width="20%" align="right"> <a accesskey="n" href="ca_function_calls.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="dvb_ca"></a>Chapter 13. DVB CA Device</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="dvb_ca.html#ca_data_types">CA Data Types</a></span></dt><dd><dl><dt><span class="section"><a href="dvb_ca.html#ca-slot-info">ca_slot_info_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-descr-info">ca_descr_info_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-caps">ca_caps_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-msg">ca_msg_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-descr">ca_descr_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-pid">ca-pid</a></span></dt></dl></dd><dt><span class="section"><a href="ca_function_calls.html">CA Function Calls</a></span></dt><dd><dl><dt><span class="section"><a href="ca_function_calls.html#ca_fopen">open()</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#ca_fclose">close()</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_RESET">CA_RESET</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_CAP">CA_GET_CAP</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_SLOT_INFO">CA_GET_SLOT_INFO</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_DESCR_INFO">CA_GET_DESCR_INFO</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_GET_MSG">CA_GET_MSG</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_SEND_MSG">CA_SEND_MSG</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_SET_DESCR">CA_SET_DESCR</a></span></dt><dt><span class="section"><a href="ca_function_calls.html#CA_SET_PID">CA_SET_PID</a></span></dt></dl></dd></dl></div><p>The DVB CA device controls the conditional access hardware. It can be accessed through 2<span class="tt">/dev/dvb/adapter0/ca0</span>. Data types and and ioctl definitions can be accessed by 3including <span class="tt">linux/dvb/ca.h</span> in your application. 4</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ca_data_types"></a>CA Data Types</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="dvb_ca.html#ca-slot-info">ca_slot_info_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-descr-info">ca_descr_info_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-caps">ca_caps_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-msg">ca_msg_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-descr">ca_descr_t</a></span></dt><dt><span class="section"><a href="dvb_ca.html#ca-pid">ca-pid</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca-slot-info"></a>ca_slot_info_t</h3></div></div></div><pre class="programlisting"> 5typedef struct ca_slot_info { 6 int num; /⋆ slot number ⋆/ 7 8 int type; /⋆ CA interface this slot supports ⋆/ 9#define CA_CI 1 /⋆ CI high level interface ⋆/ 10#define CA_CI_LINK 2 /⋆ CI link layer level interface ⋆/ 11#define CA_CI_PHYS 4 /⋆ CI physical layer level interface ⋆/ 12#define CA_DESCR 8 /⋆ built-in descrambler ⋆/ 13#define CA_SC 128 /⋆ simple smart card interface ⋆/ 14 15 unsigned int flags; 16#define CA_CI_MODULE_PRESENT 1 /⋆ module (or card) inserted ⋆/ 17#define CA_CI_MODULE_READY 2 18} ca_slot_info_t; 19</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca-descr-info"></a>ca_descr_info_t</h3></div></div></div><pre class="programlisting"> 20typedef struct ca_descr_info { 21 unsigned int num; /⋆ number of available descramblers (keys) ⋆/ 22 unsigned int type; /⋆ type of supported scrambling system ⋆/ 23#define CA_ECD 1 24#define CA_NDS 2 25#define CA_DSS 4 26} ca_descr_info_t; 27</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca-caps"></a>ca_caps_t</h3></div></div></div><pre class="programlisting"> 28typedef struct ca_caps { 29 unsigned int slot_num; /⋆ total number of CA card and module slots ⋆/ 30 unsigned int slot_type; /⋆ OR of all supported types ⋆/ 31 unsigned int descr_num; /⋆ total number of descrambler slots (keys) ⋆/ 32 unsigned int descr_type;/⋆ OR of all supported types ⋆/ 33 } ca_cap_t; 34</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca-msg"></a>ca_msg_t</h3></div></div></div><pre class="programlisting"> 35/⋆ a message to/from a CI-CAM ⋆/ 36typedef struct ca_msg { 37 unsigned int index; 38 unsigned int type; 39 unsigned int length; 40 unsigned char msg[256]; 41} ca_msg_t; 42</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca-descr"></a>ca_descr_t</h3></div></div></div><pre class="programlisting"> 43typedef struct ca_descr { 44 unsigned int index; 45 unsigned int parity; 46 unsigned char cw[8]; 47} ca_descr_t; 48</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="ca-pid"></a>ca-pid</h3></div></div></div><pre class="programlisting"> 49typedef struct ca_pid { 50 unsigned int pid; 51 int index; /⋆ -1 == disable⋆/ 52} ca_pid_t; 53</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="audio_function_calls.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dvbapi.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ca_function_calls.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Audio Function Calls </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> CA Function Calls</td></tr></table></div></body></html> 54