Skip to content
Permalink
Browse files

Add CA_SET_DESCR_MODE for setting hardware descrambler mode ( CSA / D…

…ES / AES ).
  • Loading branch information...
joeuser
joeuser committed Mar 9, 2017
1 parent 230dec7 commit 33018861e831cd97992c84e52d9ea5ccdd9eca81
Showing with 30 additions and 0 deletions.
  1. +30 −0 player2/linux/drivers/media/dvb/stm/dvb/dvb_ca.c
@@ -200,6 +200,36 @@ static int CaIoctl (struct inode* Inode,
return 0;
break;
}
case CA_SET_DESCR_MODE:
{
ca_descr_mode_t *descr_mode = (ca_descr_mode_t*) Parameter;

dprintk("CA_SET_DESCR_MODE\n");

if (descr_mode->index >= 16)
return -EINVAL;
if (descr_mode->algo > 3)
return -EINVAL;

dprintk("index = %d\n", descr_mode->index);
dprintk("algo = %d\n", descr_mode->algo);

if(descr_mode->index < 0 || descr_mode->index >= NUMBER_OF_DESCRAMBLERS){
printk("Error descrambler %d not supported! needs to be in range 0 - %d\n", descr_mode->index, NUMBER_OF_DESCRAMBLERS-1);
return -1;
}
if (&Context->DvbContext->Lock != NULL)
mutex_lock (&Context->DvbContext->Lock);

if (pti_hal_descrambler_set_mode(pSession->session, pSession->descramblers[descr_mode->index], descr_mode->algo) != 0)
printk("Error while setting descrambler mode\n");

if (&Context->DvbContext->Lock != NULL)
mutex_unlock (&Context->DvbContext->Lock);

return 0;
break;
}
case CA_SET_DESCR:
{
ca_descr_t *descr = (ca_descr_t*) Parameter;

0 comments on commit 3301886

Please sign in to comment.
You can’t perform that action at this time.