mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
test c**
This commit is contained in:
@@ -31,8 +31,6 @@
|
|||||||
#define x_debug 1
|
#define x_debug 1
|
||||||
#define y_debug 0
|
#define y_debug 0
|
||||||
|
|
||||||
#define tricky 0
|
|
||||||
|
|
||||||
#define TAG_MENU_ANSWER 0x9f880b
|
#define TAG_MENU_ANSWER 0x9f880b
|
||||||
#define TAG_ENTER_MENU 0x9f8022
|
#define TAG_ENTER_MENU 0x9f8022
|
||||||
|
|
||||||
@@ -996,13 +994,6 @@ void cCA::slot_pollthread(void *c)
|
|||||||
printf("r = %d, %m\n", res);
|
printf("r = %d, %m\n", res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* no comment :) */
|
|
||||||
#if tricky
|
|
||||||
if ((!checkQueueSize(slot) && !slot->hasCAManager && !slot->ccmgr_ready) || slot->counter < 3)
|
|
||||||
slot->pollConnection = true;
|
|
||||||
if (slot->hasCAManager && slot->ccmgr_ready)
|
|
||||||
slot->counter++;
|
|
||||||
#else
|
|
||||||
/* check for activate the pollConnection */
|
/* check for activate the pollConnection */
|
||||||
if (!checkQueueSize(slot) && (slot->DataRCV || slot->mmiOpened || slot->counter > 5))
|
if (!checkQueueSize(slot) && (slot->DataRCV || slot->mmiOpened || slot->counter > 5))
|
||||||
{
|
{
|
||||||
@@ -1012,7 +1003,6 @@ void cCA::slot_pollthread(void *c)
|
|||||||
slot->counter++;
|
slot->counter++;
|
||||||
else
|
else
|
||||||
slot->counter = 0;
|
slot->counter = 0;
|
||||||
#endif
|
|
||||||
/* if Flag: send a DataLast */
|
/* if Flag: send a DataLast */
|
||||||
if (!checkQueueSize(slot) && slot->pollConnection && slot->DataLast)
|
if (!checkQueueSize(slot) && slot->pollConnection && slot->DataLast)
|
||||||
{
|
{
|
||||||
@@ -1147,11 +1137,7 @@ void cCA::slot_pollthread(void *c)
|
|||||||
/* not necessary: the arrived capmt will be automaticly send */
|
/* not necessary: the arrived capmt will be automaticly send */
|
||||||
//SendCaPMT(slot);
|
//SendCaPMT(slot);
|
||||||
}
|
}
|
||||||
if (slot->hasCAManager && slot->hasAppManager && slot->newCapmt
|
if (slot->hasCAManager && slot->hasAppManager && slot->newCapmt)
|
||||||
#if tricky
|
|
||||||
&& slot->ccmgr_ready
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
SendCaPMT(slot);
|
SendCaPMT(slot);
|
||||||
slot->newCapmt = false;
|
slot->newCapmt = false;
|
||||||
|
@@ -11,60 +11,30 @@
|
|||||||
|
|
||||||
static const char * FILENAME = "[descrambler]";
|
static const char * FILENAME = "[descrambler]";
|
||||||
|
|
||||||
/* alles im Kernel Header ca.h definiert da es der player2 auch braucht
|
|
||||||
|
|
||||||
enum ca_descr_data_type {
|
|
||||||
CA_DATA_IV,
|
|
||||||
CA_DATA_KEY,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ca_descr_parity {
|
|
||||||
CA_PARITY_EVEN,
|
|
||||||
CA_PARITY_ODD,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ca_descr_data {
|
|
||||||
unsigned int index;
|
|
||||||
enum ca_descr_parity parity;
|
|
||||||
enum ca_descr_data_type data_type;
|
|
||||||
unsigned int length;
|
|
||||||
unsigned char *data;
|
|
||||||
};
|
|
||||||
#define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data)
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int desc_fd;
|
static int desc_fd;
|
||||||
|
|
||||||
|
/* Byte 0 to 15 are AES Key, Byte 16 to 31 are IV */
|
||||||
|
|
||||||
int descrambler_set_key(int index, int parity, unsigned char *data)
|
int descrambler_set_key(int index, int parity, unsigned char *data)
|
||||||
{
|
{
|
||||||
struct ca_descr_data d;
|
struct ca_descr_data d;
|
||||||
|
|
||||||
printf("%s -> %s\n", FILENAME, __FUNCTION__);
|
printf("%s -> %s\n", FILENAME, __FUNCTION__);
|
||||||
|
|
||||||
|
|
||||||
d.index = index;
|
d.index = index;
|
||||||
d.parity = (ca_descr_parity)parity;
|
d.parity = (ca_descr_parity)parity;
|
||||||
d.data_type = CA_DATA_KEY;
|
d.data_type = CA_DATA_KEY;
|
||||||
d.length = 16;
|
d.length = 32;
|
||||||
d.data = data;
|
d.data = data;
|
||||||
|
|
||||||
printf("Index: %d Parity: %d Type CA_DATA_KEY= %d\n", d.index, d.parity, d.data_type);
|
printf("Index: %d Parity: (%d) -> ", d.index, d.parity);
|
||||||
hexdump(d.data, 16);
|
hexdump(d.data, 32);
|
||||||
|
|
||||||
if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d))
|
if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d))
|
||||||
printf("CA_SET_DESCR_DATA\n");
|
{
|
||||||
|
//printf("CA_SET_DESCR_DATA\n");
|
||||||
d.index = index;
|
}
|
||||||
d.parity = (ca_descr_parity)parity;
|
|
||||||
d.data_type = CA_DATA_IV;
|
|
||||||
d.length = 16;
|
|
||||||
d.data = data + 16;
|
|
||||||
|
|
||||||
printf("Index: %d Parity: %d Type CA_DATA_IV= %d\n", d.index, d.parity, d.data_type);
|
|
||||||
hexdump(d.data, 16);
|
|
||||||
|
|
||||||
if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d))
|
|
||||||
printf("CA_SET_DESCR_DATA\n");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user