]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: dvb_frontend: add physical layer scrambling support
authorAthanasios Oikonomou <athoik@gmail.com>
Sat, 16 Dec 2017 12:23:38 +0000 (07:23 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 19 Dec 2017 12:08:12 +0000 (07:08 -0500)
This commit adds a new property DTV_SCRAMBLING_SEQUENCE_INDEX.

This 18 bit field, when present, carries the index of the DVB-S2 physical
layer scrambling sequence as defined in clause 5.5.4 of EN 302 307.
There is no explicit signalling method to convey scrambling sequence index
to the receiver. If S2 satellite delivery system descriptor is available
it can be used to read the scrambling sequence index (EN 300 468 table 41).

By default, gold scrambling sequence index 0 is used. The valid scrambling
sequence index range is from 0 to 262142.

Increase the DVB API version in order userspace to be aware of the changes.

Signed-off-by: Athanasios Oikonomou <athoik@gmail.com>
Acked-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Documentation/media/uapi/dvb/fe_property_parameters.rst
Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst
drivers/media/dvb-core/dvb_frontend.c
drivers/media/dvb-core/dvb_frontend.h
include/uapi/linux/dvb/frontend.h
include/uapi/linux/dvb/version.h

index 6eef507fea5063d81eca50d737d8dbb3bd0ee632..3524dcae4604997a2550672fa9e94a1e890ffa90 100644 (file)
@@ -987,3 +987,21 @@ Possible values: 0, 1, LNA_AUTO
 1, LNA on
 
 use the special macro LNA_AUTO to set LNA auto
+
+
+.. _DTV-SCRAMBLING-SEQUENCE-INDEX:
+
+DTV_SCRAMBLING_SEQUENCE_INDEX
+=============================
+
+Used on DVB-S2.
+
+This 18 bit field, when present, carries the index of the DVB-S2 physical
+layer scrambling sequence as defined in clause 5.5.4 of EN 302 307.
+There is no explicit signalling method to convey scrambling sequence index
+to the receiver. If S2 satellite delivery system descriptor is available
+it can be used to read the scrambling sequence index (EN 300 468 table 41).
+
+By default, gold scrambling sequence index 0 is used.
+
+The valid scrambling sequence index range is from 0 to 262142.
index 1f40399c68fffe1a911301b5c1639e5ce0bd8569..2929e6999a7ab0c72c33b98db6b5a7ac73d252dc 100644 (file)
@@ -60,6 +60,8 @@ following parameters:
 
 -  :ref:`DTV_STREAM_ID <DTV-STREAM-ID>`
 
+-  :ref:`DTV_SCRAMBLING_SEQUENCE_INDEX <DTV-SCRAMBLING-SEQUENCE-INDEX>`
+
 In addition, the :ref:`DTV QoS statistics <frontend-stat-properties>`
 are also valid.
 
index ee3ea4dcd9c144dc3b84329557c1b06a0cebda6d..5547b9830bbc0118fb0691d53d43a0e74cd6052d 100644 (file)
@@ -982,6 +982,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
        }
 
        c->stream_id = NO_STREAM_ID_FILTER;
+       c->scrambling_sequence_index = 0;/* default sequence */
 
        switch (c->delivery_system) {
        case SYS_DVBS:
@@ -1072,6 +1073,7 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
 
        _DTV_CMD(DTV_STREAM_ID, 1, 0),
        _DTV_CMD(DTV_DVBT2_PLP_ID_LEGACY, 1, 0),
+       _DTV_CMD(DTV_SCRAMBLING_SEQUENCE_INDEX, 1, 0),
        _DTV_CMD(DTV_LNA, 1, 0),
 
        /* Get */
@@ -1417,6 +1419,11 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
                tvp->u.data = c->stream_id;
                break;
 
+       /* Physical layer scrambling support */
+       case DTV_SCRAMBLING_SEQUENCE_INDEX:
+               tvp->u.data = c->scrambling_sequence_index;
+               break;
+
        /* ATSC-MH */
        case DTV_ATSCMH_FIC_VER:
                tvp->u.data = fe->dtv_property_cache.atscmh_fic_ver;
@@ -1900,6 +1907,11 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
                c->stream_id = data;
                break;
 
+       /* Physical layer scrambling support */
+       case DTV_SCRAMBLING_SEQUENCE_INDEX:
+               c->scrambling_sequence_index = data;
+               break;
+
        /* ATSC-MH */
        case DTV_ATSCMH_PARADE_ID:
                fe->dtv_property_cache.atscmh_parade_id = data;
index ace0c2fb26c292b4ca5441947d44516e7e2c1b1b..2bc25f1e425b0e16bf1f3f5e6df15b378bdc8010 100644 (file)
@@ -513,6 +513,8 @@ struct dvb_fe_events {
  * @layer.interleaving:         per layer interleaving.
  * @stream_id:         If different than zero, enable substream filtering, if
  *                     hardware supports (DVB-S2 and DVB-T2).
+ * @scrambling_sequence_index: Carries the index of the DVB-S2 physical layer
+ *                             scrambling sequence.
  * @atscmh_fic_ver:    Version number of the FIC (Fast Information Channel)
  *                     signaling data (only ATSC-M/H)
  * @atscmh_parade_id:  Parade identification number (only ATSC-M/H)
@@ -591,6 +593,9 @@ struct dtv_frontend_properties {
        /* Multistream specifics */
        u32                     stream_id;
 
+       /* Physical Layer Scrambling specifics */
+       u32                     scrambling_sequence_index;
+
        /* ATSC-MH specifics */
        u8                      atscmh_fic_ver;
        u8                      atscmh_parade_id;
index 9dad6c66cc34fc35716fa42d59ae278a7f5de032..4f9b4551c534894e7e16e3c7bd0e4f66916e0cde 100644 (file)
@@ -547,7 +547,10 @@ enum fe_interleaving {
 #define DTV_STAT_ERROR_BLOCK_COUNT     68
 #define DTV_STAT_TOTAL_BLOCK_COUNT     69
 
-#define DTV_MAX_COMMAND                DTV_STAT_TOTAL_BLOCK_COUNT
+/* Physical layer scrambling */
+#define DTV_SCRAMBLING_SEQUENCE_INDEX  70
+
+#define DTV_MAX_COMMAND                DTV_SCRAMBLING_SEQUENCE_INDEX
 
 /**
  * enum fe_pilot - Type of pilot tone
index 02e32ea8398475cdc7cc6c35105340ad2ae52fbe..2c5cffe6d2a0a32f90f7963f31f94ee20263d64d 100644 (file)
@@ -25,6 +25,6 @@
 #define _DVBVERSION_H_
 
 #define DVB_API_VERSION 5
-#define DVB_API_VERSION_MINOR 10
+#define DVB_API_VERSION_MINOR 11
 
 #endif /*_DVBVERSION_H_*/