From patchwork Sat Dec 16 12:23:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Athanasios Oikonomou X-Patchwork-Id: 10116939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 846A36019C for ; Sat, 16 Dec 2017 12:25:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 761FA296AC for ; Sat, 16 Dec 2017 12:25:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6874B29E1D; Sat, 16 Dec 2017 12:25:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D39FD296AC for ; Sat, 16 Dec 2017 12:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756742AbdLPMY6 (ORCPT ); Sat, 16 Dec 2017 07:24:58 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:46472 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756729AbdLPMYz (ORCPT ); Sat, 16 Dec 2017 07:24:55 -0500 Received: by mail-wr0-f193.google.com with SMTP id g17so999246wrd.13 for ; Sat, 16 Dec 2017 04:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=x7XFO8rHrQg1zw3cSNdR1hZqxq6lu9pcSBhn4Cmvjbo=; b=J7elxMbVHzJMdCkm+bzXwVluYOv2M457uv9mBfgC7f0Ptqo4t5y+yXitNUDnLn7uIB snRP7W6s3+4gazLeWacTD36Y+b50BzdoSHGV+12Db5JwA8BgqzKOSRmpW40gYYxMpOKn ORiJzxoyNNLQ+XwToiMjYyfGG/jeq0ATCSy5Tu5F3Z1muJ1HL6v2J8h7zuzei9tTCdot Ko0ws27iKV0ls6D38l7O17LqdydUyf14Wp/HecCaCe8m8xzornti2SaF+wIWqZuJD+eM lJT1V5Y7hK89XO8JnRqXG10u9/H7ECsax4rgSiqNLT1nyNnjAHnvEne4w+DsXeftqjxT eopg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=x7XFO8rHrQg1zw3cSNdR1hZqxq6lu9pcSBhn4Cmvjbo=; b=IgXySDtPUGC4cQsvn84hNj6gcjVjPjiwhiOgy2zQHr7TFsBwGCnXtvL6fRSwIE3vDI 5ToCDg2x7xvw4QVhnulCBot4u8wWr3ZESgCBtr3Z5exggZKtaNNX/sWHj4/XT0RfJB1V 1s7+F+jWwLrf3GOOJxNj4FEmFQiJvrCQ1X076eFo4JOQO3SibojI3gRrrw+4tZuLHZM3 Yk4PEWwDp0f5T+1D2QFECen2xVIBWm9IgiqzWeJTiVfDqPqcNnEXmGUHSh8V1e6wDBgd BHWD9amQk5lErctAE8n/LcFkrCAM50AvAo7/HCZ8XEfYZilod3vjUEZbQT6eI+AMharR NGqQ== X-Gm-Message-State: AKGB3mLdnGR1cvnsk1h+ZJX56PwlQhdrLUPNRs5XBZ9/xtf8ZvHzeqA7 Z9RO2BIOi7sM8OPCa8ba6j9j54U= X-Google-Smtp-Source: ACJfBouIxkDtUYSlAx6Y+ZgeZhMABWpZrO7SLnGK0kIVnyAs8j22O+cKDeyEonZyyosrrHJiATocIg== X-Received: by 10.223.139.3 with SMTP id n3mr11999260wra.166.1513427094210; Sat, 16 Dec 2017 04:24:54 -0800 (PST) Received: from images.net (ns380618.ip-188-165-252.eu. [188.165.252.42]) by smtp.gmail.com with ESMTPSA id 38sm9538678wry.34.2017.12.16.04.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Dec 2017 04:24:53 -0800 (PST) From: Athanasios Oikonomou To: linux-media@vger.kernel.org Cc: Athanasios Oikonomou , Mauro Carvalho Chehab , Ralph Metzler , Manu Abraham Subject: [PATCH 1/2] media: dvb_frontend: add physical layer scrambling support Date: Sat, 16 Dec 2017 14:23:38 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- .../media/uapi/dvb/fe_property_parameters.rst | 18 ++++++++++++++++++ .../uapi/dvb/frontend-property-satellite-systems.rst | 2 ++ drivers/media/dvb-core/dvb_frontend.c | 12 ++++++++++++ drivers/media/dvb-core/dvb_frontend.h | 5 +++++ include/uapi/linux/dvb/frontend.h | 5 ++++- include/uapi/linux/dvb/version.h | 2 +- 6 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Documentation/media/uapi/dvb/fe_property_parameters.rst b/Documentation/media/uapi/dvb/fe_property_parameters.rst index 6eef507..3524dca 100644 --- a/Documentation/media/uapi/dvb/fe_property_parameters.rst +++ b/Documentation/media/uapi/dvb/fe_property_parameters.rst @@ -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. diff --git a/Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst b/Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst index 1f40399..2929e69 100644 --- a/Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst +++ b/Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst @@ -60,6 +60,8 @@ following parameters: - :ref:`DTV_STREAM_ID ` +- :ref:`DTV_SCRAMBLING_SEQUENCE_INDEX ` + In addition, the :ref:`DTV QoS statistics ` are also valid. diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 2afaa82..e192876 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -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; diff --git a/drivers/media/dvb-core/dvb_frontend.h b/drivers/media/dvb-core/dvb_frontend.h index ace0c2f..2bc25f1 100644 --- a/drivers/media/dvb-core/dvb_frontend.h +++ b/drivers/media/dvb-core/dvb_frontend.h @@ -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; diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index b297b65..9218cd6 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -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 diff --git a/include/uapi/linux/dvb/version.h b/include/uapi/linux/dvb/version.h index 02e32ea..2c5cffe 100644 --- a/include/uapi/linux/dvb/version.h +++ b/include/uapi/linux/dvb/version.h @@ -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_*/