On Tue, Nov 29, 2011 at 8:01 PM, Mariusz Bialonczyk <manio@xxxxxxxxxx> wrote: > This patch add support for reading UNC blocks for stv090x frontend. > Partially based on stv0900 code by Abylay Ospan <aospan@xxxxxxxx> > > Signed-off-by: Mariusz Bialonczyk <manio@xxxxxxxxxx> > --- > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html