media: dvb: mpq: Secure demux support
This change adds support for demuxing of encrypted streams which current
software demux implementation does not support.
User-space API is extended to allow setting of key ladder information
needed in order to perform decryption.
If secure demux application is available, demuxing does not take place in
the dvb demux sw filter anymore but instead is performed in the new secure
demux, regardless of whether the stream is encrypted or not.
Otherwise, the dvb demux sw filter will be used as before and demuxing of
encrypted streams will not be available.
Change-Id: If75a7b03d1f13d3b012250b87c25eaf6d6cbc399
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
index 53bbd5e..2cea256 100644
--- a/include/linux/dvb/dmx.h
+++ b/include/linux/dvb/dmx.h
@@ -39,8 +39,7 @@
/* Min recording chunk upon which event is generated */
#define DMX_REC_BUFF_CHUNK_MIN_SIZE (100*188)
-/* Decoder buffers are usually large ~1MB, 10 should suffice */
-#define DMX_MAX_DECODER_BUFFER_NUM (10)
+#define DMX_MAX_DECODER_BUFFER_NUM (32)
typedef enum
{
@@ -574,6 +573,20 @@
int handles[DMX_MAX_DECODER_BUFFER_NUM];
};
+struct dmx_secure_mode {
+ /*
+ * Specifies whether secure mode should be set or not for the filter's
+ * pid. Note that DMX_OUT_TSDEMUX_TAP filters can have more than 1 pid
+ */
+ int is_secured;
+
+ /* PID to associate with key ladder id */
+ __u16 pid;
+
+ /* key ladder information to associate with the specified pid */
+ __u32 key_ladder_id;
+};
+
#define DMX_START _IO('o', 41)
#define DMX_STOP _IO('o', 42)
#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
@@ -597,5 +610,7 @@
#define DMX_SET_BUFFER _IOW('o', 62, struct dmx_buffer)
#define DMX_SET_DECODER_BUFFER _IOW('o', 63, struct dmx_decoder_buffers)
#define DMX_REUSE_DECODER_BUFFER _IO('o', 64)
+#define DMX_SET_SECURE_MODE _IOW('o', 65, struct dmx_secure_mode)
+
#endif /*_DVBDMX_H_*/