On Wed, Dec 7, 2011 at 12:04 AM, Manu Abraham <abraham.m...@gmail.com> wrote:
> On Tue, Nov 29, 2011 at 8:01 PM, Mariusz Bialonczyk <ma...@skyboo.net> wrote:
>> This patch add support for reading UNC blocks for stv090x frontend.
>> Partially based on stv0900 code by Abylay Ospan <aos...@netup.ru>
>>
>> Signed-off-by: Mariusz Bialonczyk <ma...@skyboo.net>
>> ---
>>  drivers/media/dvb/frontends/stv090x.c |   32 
>> +++++++++++++++++++++++++++++++-
>>  1 files changed, 31 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/media/dvb/frontends/stv090x.c 
>> b/drivers/media/dvb/frontends/stv090x.c
>> index 52d8712..ad6141f 100644
>> --- a/drivers/media/dvb/frontends/stv090x.c
>> +++ b/drivers/media/dvb/frontends/stv090x.c
>> @@ -3687,6 +3687,35 @@ static int stv090x_read_cnr(struct dvb_frontend *fe, 
>> u16 *cnr)
>>        return 0;
>>  }
>>
>> +static int stv090x_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
>> +{
>> +       struct stv090x_state *state = fe->demodulator_priv;
>> +       u32 reg_0, reg_1;
>> +       u32 val_header_err, val_packet_err;
>> +
>> +       switch (state->delsys) {
>> +       case STV090x_DVBS2:
>> +               /* DVB-S2 delineator error count */
>> +
>> +               /* retrieving number for erronous headers */
>> +               reg_1 = stv090x_read_reg(state, STV090x_P1_BBFCRCKO1);
>> +               reg_0 = stv090x_read_reg(state, STV090x_P1_BBFCRCKO0);
>> +               val_header_err = MAKEWORD16(reg_1, reg_0);
>> +
>> +               /* retrieving number for erronous packets */
>> +               reg_1 = stv090x_read_reg(state, STV090x_P1_UPCRCKO1);
>> +               reg_0 = stv090x_read_reg(state, STV090x_P1_UPCRCKO0);
>> +               val_packet_err = MAKEWORD16(reg_1, reg_0);
>> +
>> +               *ucblocks = val_packet_err + val_header_err;
>
>
> 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.

Regards,
Manu
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to