All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] DVB: dvb_frontend: remove static assignments from dtv_property_cache_sync()
@ 2011-08-16 14:04 Andreas Oberritter
  2011-08-16 14:04 ` [PATCH] DVB: increment minor version after addition of SYS_TURBO Andreas Oberritter
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Oberritter @ 2011-08-16 14:04 UTC (permalink / raw)
  To: linux-media

- Move all static assignments to a new function
  dtv_property_cache_init().
- Call dtv_property_cache_init() from FE_SET_FRONTEND, but not from
  dtv_property_process_get().
- This fixes a problem where 2G delivery system parameters would get
  overwritten with invalid values, leading to partially incorrect
  results when calling FE_GET_PROPERTY.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index d218fe2..a716627 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1019,6 +1019,29 @@ static int is_legacy_delivery_system(fe_delivery_system_t s)
 	return 0;
 }
 
+/* Initialize the cache with some default values derived from the
+ * legacy frontend_info structure.
+ */
+static void dtv_property_cache_init(struct dvb_frontend *fe,
+				    struct dtv_frontend_properties *c)
+{
+	switch (fe->ops.info.type) {
+	case FE_QPSK:
+		c->modulation = QPSK;   /* implied for DVB-S in legacy API */
+		c->rolloff = ROLLOFF_35;/* implied for DVB-S */
+		c->delivery_system = SYS_DVBS;
+		break;
+	case FE_QAM:
+		c->delivery_system = SYS_DVBC_ANNEX_AC;
+		break;
+	case FE_OFDM:
+		c->delivery_system = SYS_DVBT;
+		break;
+	case FE_ATSC:
+		break;
+	}
+}
+
 /* Synchronise the legacy tuning parameters into the cache, so that demodulator
  * drivers can use a single set_frontend tuning function, regardless of whether
  * it's being used for the legacy or new API, reducing code and complexity.
@@ -1032,17 +1055,13 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 
 	switch (fe->ops.info.type) {
 	case FE_QPSK:
-		c->modulation = QPSK;   /* implied for DVB-S in legacy API */
-		c->rolloff = ROLLOFF_35;/* implied for DVB-S */
 		c->symbol_rate = p->u.qpsk.symbol_rate;
 		c->fec_inner = p->u.qpsk.fec_inner;
-		c->delivery_system = SYS_DVBS;
 		break;
 	case FE_QAM:
 		c->symbol_rate = p->u.qam.symbol_rate;
 		c->fec_inner = p->u.qam.fec_inner;
 		c->modulation = p->u.qam.modulation;
-		c->delivery_system = SYS_DVBC_ANNEX_AC;
 		break;
 	case FE_OFDM:
 		if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
@@ -1060,7 +1079,6 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe,
 		c->transmission_mode = p->u.ofdm.transmission_mode;
 		c->guard_interval = p->u.ofdm.guard_interval;
 		c->hierarchy = p->u.ofdm.hierarchy_information;
-		c->delivery_system = SYS_DVBT;
 		break;
 	case FE_ATSC:
 		c->modulation = p->u.vsb.modulation;
@@ -1821,6 +1839,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
 
 			memcpy (&fepriv->parameters_in, parg,
 				sizeof (struct dvb_frontend_parameters));
+			dtv_property_cache_init(fe, c);
 			dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
 		}
 
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] DVB: increment minor version after addition of SYS_TURBO
  2011-08-16 14:04 [PATCH] DVB: dvb_frontend: remove static assignments from dtv_property_cache_sync() Andreas Oberritter
@ 2011-08-16 14:04 ` Andreas Oberritter
  2011-09-03 16:19   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Oberritter @ 2011-08-16 14:04 UTC (permalink / raw)
  To: linux-media

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
---
Depends on https://patchwork.kernel.org/patch/1045472/

 include/linux/dvb/version.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
index 1421cc8..66594b1 100644
--- a/include/linux/dvb/version.h
+++ b/include/linux/dvb/version.h
@@ -24,6 +24,6 @@
 #define _DVBVERSION_H_
 
 #define DVB_API_VERSION 5
-#define DVB_API_VERSION_MINOR 3
+#define DVB_API_VERSION_MINOR 4
 
 #endif /*_DVBVERSION_H_*/
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] DVB: increment minor version after addition of SYS_TURBO
  2011-08-16 14:04 ` [PATCH] DVB: increment minor version after addition of SYS_TURBO Andreas Oberritter
@ 2011-09-03 16:19   ` Mauro Carvalho Chehab
  2011-09-03 17:26     ` [PATCH 1/2] DVB: improve documentation for satellite delivery systems Andreas Oberritter
  2011-09-03 17:26     ` [PATCH 2/2] DVB: Change API version in documentation: 3 -> 5.4 Andreas Oberritter
  0 siblings, 2 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2011-09-03 16:19 UTC (permalink / raw)
  To: Andreas Oberritter; +Cc: linux-media

Hi Andreas,

Em 16-08-2011 11:04, Andreas Oberritter escreveu:
> Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
> ---
> Depends on https://patchwork.kernel.org/patch/1045472/
> 
>  include/linux/dvb/version.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
> index 1421cc8..66594b1 100644
> --- a/include/linux/dvb/version.h
> +++ b/include/linux/dvb/version.h
> @@ -24,6 +24,6 @@
>  #define _DVBVERSION_H_
>  
>  #define DVB_API_VERSION 5
> -#define DVB_API_VERSION_MINOR 3
> +#define DVB_API_VERSION_MINOR 4

Could you also please update the DocBooks for it?

Let's avoid increasing the gap between the specs and the
API.

Thank you!
Mauro

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] DVB: improve documentation for satellite delivery systems
  2011-09-03 16:19   ` Mauro Carvalho Chehab
@ 2011-09-03 17:26     ` Andreas Oberritter
  2011-09-03 17:26     ` [PATCH 2/2] DVB: Change API version in documentation: 3 -> 5.4 Andreas Oberritter
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Oberritter @ 2011-09-03 17:26 UTC (permalink / raw)
  To: linux-media

- Move voltage and tone to DVB-S.
- Add turbo code.
- In DVB-S2 and turbo code sections, refer to DVB-S, as both
  are extensions to DVB-S.
- Add modulation to DVB-S2.

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
---
 Documentation/DocBook/media/dvb/dvbproperty.xml |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml b/Documentation/DocBook/media/dvb/dvbproperty.xml
index 75bea04..3bc8a61 100644
--- a/Documentation/DocBook/media/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -810,6 +810,8 @@ typedef enum fe_hierarchy {
 			<listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
 			<listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
 			<listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
+			<listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem>
+			<listitem><para><link linkend="DTV-TONE"><constant>DTV_TONE</constant></link></para></listitem>
 		</itemizedlist>
 		<para>Future implementations might add those two missing parameters:</para>
 		<itemizedlist mark='opencircle'>
@@ -819,25 +821,18 @@ typedef enum fe_hierarchy {
 	</section>
 	<section id="dvbs2-params">
 		<title>DVB-S2 delivery system</title>
-		<para>The following parameters are valid for DVB-S2:</para>
+		<para>In addition to all parameters valid for DVB-S, DVB-S2 supports the following parameters:</para>
 		<itemizedlist mark='opencircle'>
-			<listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-TONE"><constant>DTV_TONE</constant></link></para></listitem>
+			<listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
 			<listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem>
 			<listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem>
 		</itemizedlist>
-		<para>Future implementations might add those two missing parameters:</para>
+	</section>
+	<section id="turbo-params">
+		<title>Turbo code delivery system</title>
+		<para>In addition to all parameters valid for DVB-S, turbo code supports the following parameters:</para>
 		<itemizedlist mark='opencircle'>
-			<listitem><para><link linkend="DTV-DISEQC-MASTER"><constant>DTV_DISEQC_MASTER</constant></link></para></listitem>
-			<listitem><para><link linkend="DTV-DISEQC-SLAVE-REPLY"><constant>DTV_DISEQC_SLAVE_REPLY</constant></link></para></listitem>
+			<listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
 		</itemizedlist>
 	</section>
 	<section id="isdbs-params">
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] DVB: Change API version in documentation: 3 -> 5.4
  2011-09-03 16:19   ` Mauro Carvalho Chehab
  2011-09-03 17:26     ` [PATCH 1/2] DVB: improve documentation for satellite delivery systems Andreas Oberritter
@ 2011-09-03 17:26     ` Andreas Oberritter
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Oberritter @ 2011-09-03 17:26 UTC (permalink / raw)
  To: linux-media

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
---
 Documentation/DocBook/media/dvb/intro.xml |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/DocBook/media/dvb/intro.xml b/Documentation/DocBook/media/dvb/intro.xml
index c75dc7c..170064a 100644
--- a/Documentation/DocBook/media/dvb/intro.xml
+++ b/Documentation/DocBook/media/dvb/intro.xml
@@ -205,7 +205,7 @@ a partial path like:</para>
 additional include file <emphasis
 role="tt">linux/dvb/version.h</emphasis> exists, which defines the
 constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document
-describes <emphasis role="tt">DVB_API_VERSION&#x00A0;3</emphasis>.
+describes <emphasis role="tt">DVB_API_VERSION 5.4</emphasis>.
 </para>
 
 </section>
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-03 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-16 14:04 [PATCH] DVB: dvb_frontend: remove static assignments from dtv_property_cache_sync() Andreas Oberritter
2011-08-16 14:04 ` [PATCH] DVB: increment minor version after addition of SYS_TURBO Andreas Oberritter
2011-09-03 16:19   ` Mauro Carvalho Chehab
2011-09-03 17:26     ` [PATCH 1/2] DVB: improve documentation for satellite delivery systems Andreas Oberritter
2011-09-03 17:26     ` [PATCH 2/2] DVB: Change API version in documentation: 3 -> 5.4 Andreas Oberritter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.