All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Scheller <d.scheller.oss@gmail.com>
To: mchehab@kernel.org, mchehab@s-opensource.com
Cc: linux-media@vger.kernel.org
Subject: [PATCH 12/19] [media] ddbridge/mci: extend mci_command and mci_result structs
Date: Sat, 23 Jun 2018 17:36:08 +0200	[thread overview]
Message-ID: <20180623153615.27630-13-d.scheller.oss@gmail.com> (raw)
In-Reply-To: <20180623153615.27630-1-d.scheller.oss@gmail.com>

From: Daniel Scheller <d.scheller@gmx.net>

Recent FPGA firmware reports more data and values in sent command
responses. Adjust the mci_command and mci_result structs including it's
unions to match these changes and add a few comments explaining things.

Picked up from the upstream dddvb GIT.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
---
 drivers/media/pci/ddbridge/ddbridge-mci.h | 74 +++++++++++++++++++++++++++----
 1 file changed, 66 insertions(+), 8 deletions(-)

diff --git a/drivers/media/pci/ddbridge/ddbridge-mci.h b/drivers/media/pci/ddbridge/ddbridge-mci.h
index 2e74f0544717..5e0c9e88b6fc 100644
--- a/drivers/media/pci/ddbridge/ddbridge-mci.h
+++ b/drivers/media/pci/ddbridge/ddbridge-mci.h
@@ -90,16 +90,30 @@ struct mci_command {
 	union {
 		u32 command_word;
 		struct {
-			u8 command;
-			u8 tuner;
-			u8 demod;
-			u8 output;
+			u8  command;
+			u8  tuner;
+			u8  demod;
+			u8  output;
 		};
 	};
 	union {
 		u32 params[31];
 		struct {
+			/*
+			 * Bit 0: DVB-S Enabled
+			 * Bit 1: DVB-S2 Enabled
+			 * Bit 7: InputStreamID
+			 */
 			u8  flags;
+			/*
+			 * Bit 0: QPSK,
+			 * Bit 1: 8PSK/8APSK
+			 * Bit 2: 16APSK
+			 * Bit 3: 32APSK
+			 * Bit 4: 64APSK
+			 * Bit 5: 128APSK
+			 * Bit 6: 256APSK
+			 */
 			u8  s2_modulation_mask;
 			u8  rsvd1;
 			u8  retry;
@@ -108,7 +122,36 @@ struct mci_command {
 			u8  input_stream_id;
 			u8  rsvd2[3];
 			u32 scrambling_sequence_index;
+			u32 frequency_range;
 		} dvbs2_search;
+
+		struct {
+			u8  tap;
+			u8  rsvd;
+			u16 point;
+		} get_iq_symbol;
+
+		struct {
+			/*
+			 * Bit 0: 0=VTM/1=SCAN
+			 * Bit 1: Set Gain
+			 */
+			u8  flags;
+			u8  roll_off;
+			u8  rsvd1;
+			u8  rsvd2;
+			u32 frequency;
+			u32 symbol_rate; /* Only in VTM mode */
+			u16 gain;
+		} sx8_start_iq;
+
+		struct {
+			/*
+			 * Bit 1:0 = STVVGLNA Gain.
+			 *   0 = AGC, 1 = 0dB, 2 = Minimum, 3 = Maximum
+			 */
+			u8  flags;
+		} sx8_input_enable;
 	};
 };
 
@@ -116,34 +159,49 @@ struct mci_result {
 	union {
 		u32 status_word;
 		struct {
-			u8 status;
-			u8 rsvd;
+			u8  status;
+			u8  mode;
 			u16 time;
 		};
 	};
 	union {
 		u32 result[27];
 		struct {
+			/* 1 = DVB-S, 2 = DVB-S2X */
 			u8  standard;
 			/* puncture rate for DVB-S */
 			u8  pls_code;
-			/* 7-6: rolloff, 5-2: rsrvd, 1:short, 0:pilots */
+			/* 2-0: rolloff */
 			u8  roll_off;
 			u8  rsvd;
+			/* actual frequency in Hz */
 			u32 frequency;
+			/* actual symbolrate in Hz */
 			u32 symbol_rate;
+			/* channel power in dBm x 100 */
 			s16 channel_power;
+			/* band power in dBm x 100 */
 			s16 band_power;
+			/*
+			 * SNR in dB x 100
+			 * Note: negative values are valid in DVB-S2
+			 */
 			s16 signal_to_noise;
 			s16 rsvd2;
+			/*
+			 * Counter for packet errors
+			 * (set to 0 on start command)
+			 */
 			u32 packet_errors;
+			/* Bit error rate: PreRS in DVB-S, PreBCH in DVB-S2X */
 			u32 ber_numerator;
 			u32 ber_denominator;
 		} dvbs2_signal_info;
+
 		struct {
 			s16 i;
 			s16 q;
-		} dvbs2_signal_iq;
+		} iq_symbol;
 	};
 	u32 version[4];
 };
-- 
2.16.4

  parent reply	other threads:[~2018-06-23 15:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-23 15:35 [PATCH 00/19] dddvb/ddbridge updates as of 2018-06-23 Daniel Scheller
2018-06-23 15:35 ` [PATCH 01/19] [media] dvb-frontends/mxl5xx: add break to case DVBS2 in get_frontend() Daniel Scheller
2018-07-30 15:05   ` Mauro Carvalho Chehab
2018-06-23 15:35 ` [PATCH 02/19] [media] dvb-frontends/stv0910: cast the BER denominator shift exp to ULL Daniel Scheller
2018-06-23 15:35 ` [PATCH 03/19] [media] ddbridge: probe for LNBH25 chips before attaching Daniel Scheller
2018-06-23 15:36 ` [PATCH 04/19] [media] ddbridge: evaluate the actual link when setting up the dummy tuner Daniel Scheller
2018-06-23 15:36 ` [PATCH 05/19] [media] ddbridge: report I2C bus errors Daniel Scheller
2018-06-23 15:36 ` [PATCH 06/19] [media] ddbridge: remove unused MDIO defines and hwinfo member Daniel Scheller
2018-06-23 15:36 ` [PATCH 07/19] [media] ddbridge: link structure access cosmetics in ddb_port_probe() Daniel Scheller
2018-06-23 15:36 ` [PATCH 08/19] [media] ddbridge: change MCI base ID and define a SX8 ID Daniel Scheller
2018-06-23 15:36 ` [PATCH 09/19] [media] ddbridge/mci: update copyright year in headers Daniel Scheller
2018-06-23 15:36 ` [PATCH 10/19] [media] ddbridge/mci: read and report signal strength and SNR Daniel Scheller
2018-06-23 15:36 ` [PATCH 11/19] [media] ddbridge/mci: rename defines and fix i/q var types Daniel Scheller
2018-06-23 15:36 ` Daniel Scheller [this message]
2018-06-23 15:36 ` [PATCH 13/19] [media] ddbridge/mci: store mci type and number of ports in the hwinfo Daniel Scheller
2018-06-23 15:36 ` [PATCH 14/19] [media] ddbridge/mci: make ddb_mci_cmd() and ddb_mci_config() public Daniel Scheller
2018-06-23 15:36 ` [PATCH 15/19] [media] ddbridge/mci: split MaxSX8 specific code off to ddbridge-sx8.c Daniel Scheller
2018-06-23 15:36 ` [PATCH 16/19] [media] ddbridge/mci: add more MCI status codes, improve MCI_SUCCESS macro Daniel Scheller
2018-06-23 15:36 ` [PATCH 17/19] [media] ddbridge/sx8: disable automatic PLS code search Daniel Scheller
2018-06-23 15:36 ` [PATCH 18/19] [media] ddbridge/sx8: enable modulation selection in set_parameters() Daniel Scheller
2018-06-23 15:36 ` [PATCH 19/19] [media] ddbridge/mci: add SX8 I/Q mode remark and remove DIAG CMD defines Daniel Scheller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180623153615.27630-13-d.scheller.oss@gmail.com \
    --to=d.scheller.oss@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@s-opensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.