From patchwork Thu Dec 29 10:20:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mariusz Bialonczyk X-Patchwork-Id: 9141 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RgD6V-0000IU-4k; Thu, 29 Dec 2011 11:20:56 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1RgD6S-0007QG-Gq; Thu, 29 Dec 2011 11:20:53 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752294Ab1L2KUu (ORCPT + 4 others); Thu, 29 Dec 2011 05:20:50 -0500 Received: from skyboo.net ([82.160.187.4]:47898 "EHLO skyboo.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752112Ab1L2KUt (ORCPT ); Thu, 29 Dec 2011 05:20:49 -0500 Received: from [2001:470:1f0b:1af:f000::2] by skyboo.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.77) (envelope-from ) id 1RgD6J-0006TF-Sm; Thu, 29 Dec 2011 11:20:45 +0100 Message-ID: <4EFC3EF6.4000307@skyboo.net> Date: Thu, 29 Dec 2011 11:20:38 +0100 From: Mariusz Bialonczyk User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20111010 Icedove/3.1.15 MIME-Version: 1.0 To: linux-media@vger.kernel.org CC: Manu Abraham , Oliver Endriss , Andreas Regel References: <1322577083-24728-1-git-send-email-manio@skyboo.net> In-Reply-To: X-SA-Exim-Connect-IP: 2001:470:1f0b:1af:f000::2 X-SA-Exim-Mail-From: manio@skyboo.net X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on draco.skyboo.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_40 autolearn=ham version=3.3.2 Subject: Re: [PATCH] stv090x: implement function for reading uncorrected blocks count X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:26:47 +0000) X-SA-Exim-Scanned: Yes (on skyboo.net) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.29.100619 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, MSGID_ADDED_BY_MTA 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __HIGHBITS 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' X-LSpam-Score: -1.9 (-) X-LSpam-Report: No, score=-1.9 required=5.0 tests=BAYES_00=-1.9 autolearn=ham On 12/06/2011 07:48 PM, Manu Abraham wrote: >> With UCB, what we imply is the uncorrectable blocks in the Outer >> coding. The CRC encoder/decoder is at the Physical layer, much prior >> and is completely different from what is expected of UCB. >> >> With the stv0900/3, you don't really have a Uncorrectable 's register >> field, one would need to really calculate that out, rather than >> reading out CRC errors. > > Maybe you can try something like this: > setup ERRCTRL1 to > > Bit7-4:1100 (TS error count, packet error final) > Bit3:reserved:0 > Bit2-0:000 (reset counter on read) 001 (without reset of counter on read) > > and the resultant values can be read from > ERRCNT10 > > Note that, you get the resultant values as Packet Errors, rather than > bit errors, so you might need to multiply that by 8. > > I have not tried this out. but you can possibly try it. Thank you for your tips I try it using the following code: static int stv090x_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) { struct stv090x_state *state = fe->demodulator_priv; u32 reg, v; u32 val_header_err, val_packet_err; switch (state->delsys) { case STV090x_DVBS2: /* Reset the packet Error counter1 */ if (STV090x_WRITE_DEMOD(state, ERRCTRL1, 0xc1) < 0) goto err; /* Obtain value */ reg = STV090x_READ_DEMOD(state, ERRCNT10); v = STV090x_GETFIELD_Px(reg, ERR_CNT10_FIELD); *ucblocks = (v << 3);<->// value * 2^3 break; default: return -EINVAL; } return 0; err: dprintk(FE_ERROR, 1, "I/O error"); return -1; } Unfortunately I always obtain value 0. I was also trying with DVB-S2 channel tunned for the whole night - and morning I still see 0 value. Is it possible that it is normal when satellite installation is correctly set? Maybe i need to wait for some difficulties - like snow on dish? I think we may leave it as it is now if there's no UCB register... Another thing related with this frontend: I am not sure but I think that btw I found some c-p mistake. Please correct if I am wrong. Here's the diff: regards, diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index e448851..dd02f9a 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c @@ -3531,7 +3531,7 @@ static int stv090x_read_per(struct dvb_frontend *fe, u32 *per) } else { /* Counter 2 */ reg = STV090x_READ_DEMOD(state, ERRCNT22); - h = STV090x_GETFIELD_Px(reg, ERR_CNT2_FIELD); + h = STV090x_GETFIELD_Px(reg, ERR_CNT22_FIELD); reg = STV090x_READ_DEMOD(state, ERRCNT21); m = STV090x_GETFIELD_Px(reg, ERR_CNT21_FIELD);