V4L/DVB (9738): sms1xxx: fix invalid unc readings
authorMichael Krufky <mkrufky@linuxtv.org>
Sat, 22 Nov 2008 17:56:37 +0000 (14:56 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:41 +0000 (17:53 -0200)
Add function smsdvb_read_ucblocks to report uncorrectable error counts.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/siano/smscoreapi.h
drivers/media/dvb/siano/smsdvb.c

index 27b0c4139dc0908a978169da4753d4f18b0d9682..6b3fb86c814bd27b8288ce6384e2accf60248b3b 100644 (file)
@@ -381,7 +381,7 @@ struct smsdvb_client_t {
        struct dvb_frontend     frontend;
 
        fe_status_t             fe_status;
-       int                     fe_ber, fe_snr, fe_signal_strength;
+       int                     fe_ber, fe_snr, fe_unc, fe_signal_strength;
 
        struct completion       tune_done, stat_done;
 
index 54144a3749468ac47c782fc0f6c98492d29b76fc..adf00b989c124770471e12bcd8a4060d69853495 100644 (file)
@@ -60,6 +60,7 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
 
                        client->fe_snr = p->Stat.SNR;
                        client->fe_ber = p->Stat.BER;
+                       client->fe_unc = p->Stat.BERErrorCount;
 
                        if (p->Stat.InBandPwr < -95)
                                client->fe_signal_strength = 0;
@@ -72,6 +73,7 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
                        client->fe_status = 0;
                        client->fe_snr =
                        client->fe_ber =
+                       client->fe_unc =
                        client->fe_signal_strength = 0;
                }
 
@@ -217,6 +219,18 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)
        return rc;
 }
 
+static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
+{
+       struct smsdvb_client_t *client =
+               container_of(fe, struct smsdvb_client_t, frontend);
+       int rc = smsdvb_send_statistics_request(client);
+
+       if (!rc)
+               *ucblocks = client->fe_unc;
+
+       return rc;
+}
+
 static int smsdvb_get_tune_settings(struct dvb_frontend *fe,
                                    struct dvb_frontend_tune_settings *tune)
 {
@@ -329,6 +343,7 @@ static struct dvb_frontend_ops smsdvb_fe_ops = {
        .read_ber = smsdvb_read_ber,
        .read_signal_strength = smsdvb_read_signal_strength,
        .read_snr = smsdvb_read_snr,
+       .read_ucblocks = smsdvb_read_ucblocks,
 
        .init = smsdvb_init,
        .sleep = smsdvb_sleep,