Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] [linux_dvb] Some questions about API for ECD module of AV7110 ?



Hello,

I've analysed Linux DVB API 1.0.1 (that is a
wonderfull job), but I've not exactly found the way to
use it for descrambling (ECD). References of my
analysis are :
- "AV711x_3_1.pdf" from URL
http://www.linuxdvb.tv/documentation/index.html
- "ca.h" from linux-dvb-api 1.0.1
- "av7110.c" from linux-dvb-api 1.0.1

Questions are at the end of this message.

*** ANALYSIS OF "AV711x_3_1.pdf" ***
************************************
- in chapter 6.1.1
Maximum number of PIDs that can be descrambled is 32.
Maximum number of pairs of keys for the descrambler is
16.
- in chapter 6.1.3
The AV7110 contains a full implementation of the
European Common Descrambler (ECD) hardware. The
descrambling of the incoming data is performed
automatically with minimum intervention by the CPU.
The TPP module detects which transport packets are
scrambled, at either the program elementary stream
(PES) or the transport stream level, and routes the
data through the ECD as necessary. The ECD stores the
descrambler keys locally and automatically selects the
correct key of a specific PID. Up to 16 sets of keys
are stored in the key table for use by the ECD. It is
possible for more than one PID to use the same key.
The descrambler keys are derived by the conditional
access software using the command packet from the
bit-stream.


*** ANALYSIS OF "CA.H" ***
**************************
- line 36 (not documented in Linux API PDF file):
define CA_DESCR         8     /* built-in descrambler
*/
- line 70:
typedef struct ca_descr {
        unsigned int index;
        unsigned int parity;    /* 0 == even, 1 == odd
*/
        unsigned char cw[8];
} ca_descr_t;
- line 76 (not documented in Linux API PDF file):
typedef struct ca_pid {
        unsigned int pid;
        int index;              /* -1 == disable*/
} ca_pid_t;


*** ANALYSIS OF "AV7110.C" ***
******************************
In dvb_ca_ioctl methods :
- line 4004 => ECD descrambler maximum capacity is 16
(from AV711x_3_1.pdf)
cap.descr_num=16;
cap.descr_type=CA_ECD;
- line 4072 => ca_descr_t.index (0..15) is the index
of keys array
if (descr->index>=16)
  return -EINVAL;
- no line => case CA_SET_PID is missing, calling to
CA_SET_PID command would return -EINVAL.


*** IMPLEMENTATION AFTER MY ANALYSIS ***
****************************************
/* The 'index' parameter used by addPid and writeCW
implementation are linked.
   In fact, 'pid' parameter used by addPid will be
descrambled with 'cw' parameter used by writeCW.
 */

/* Add a PID to descrambler */
int addPid(int index, int pid) {
  ca_pid_t ca_pid;
  ca_pid.index = index;
  ca_pid.pid = pid;
  return ioctl(fd_ca, CA_SET_PID, &ca_pid);
}

/* Remove a PID from descrambler */
int removePid(int pid) {
  ca_pid_t ca_pid;
  ca_pid.index = -1;
  ca_pid.pid = pid;
  return ioctl(fd_ca, CA_SET_PID, &ca_pid);
}

/* Write Control Word to descrambler */
int writeCW(int index, unsigned int parity, unsigned
char *cw) {
  ca_descr_t ca_descr;
  ca_desc.index = index;
  ca_desc.parity = parity;
  ca_desc.cw = cw;
  return ioctl(fd_ca, CA_SET_DESCR, &ca_descr);
}


*** Questions ***
*****************
- Could you confirm my analysis ?
- Which firmware I have to install for using this
implementation ?
(Root or Root-icam, and what does it mean "icam" ?)
- Case CA_SET_PID is missing in dvc_ca_ioctl method in
'av7110.c', calling to CA_SET_PID command would return
-EINVAL. Could I patch 'av7110.c' in order to
implement CA_SET_PID ? Firmware is it compatible with
this implementation ?

Thank you, for helping me.

Best regards

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index