aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-10 12:38:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 06:49:32 -0400
commit9671045f4ce7a9e5eedc669a6921aeec26bd095e (patch)
tree6e338a7e682bb3d48ea17a69b18d1dcb85181953 /drivers/media/common
parentf5de95e2467b7b6b968e6c67489425265dd2a1c2 (diff)
[media] siano: fix PER/BER report on DVBv5
The check for lock logic is broken. Due to that, no PER/BER stats will ever be showed, and the DVBV3 events will be wrong. Also, the per-layer PER/BER stats for ISDB-T are filled with the wrong index. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/siano/smsdvb-main.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c
index 90f6e894e593..632a250a42cf 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -382,8 +382,12 @@ static void smsdvb_update_isdbt_stats(struct smsdvb_client_t *client,
382 /* Clears global counters, as the code below will sum it again */ 382 /* Clears global counters, as the code below will sum it again */
383 c->block_error.stat[0].uvalue = 0; 383 c->block_error.stat[0].uvalue = 0;
384 c->block_count.stat[0].uvalue = 0; 384 c->block_count.stat[0].uvalue = 0;
385 c->block_error.stat[0].scale = FE_SCALE_COUNTER;
386 c->block_count.stat[0].scale = FE_SCALE_COUNTER;
385 c->post_bit_error.stat[0].uvalue = 0; 387 c->post_bit_error.stat[0].uvalue = 0;
386 c->post_bit_count.stat[0].uvalue = 0; 388 c->post_bit_count.stat[0].uvalue = 0;
389 c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER;
390 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
387 391
388 for (i = 0; i < n_layers; i++) { 392 for (i = 0; i < n_layers; i++) {
389 lr = &p->LayerInfo[i]; 393 lr = &p->LayerInfo[i];
@@ -398,20 +402,20 @@ static void smsdvb_update_isdbt_stats(struct smsdvb_client_t *client,
398 c->layer[i].modulation = sms_to_modulation(lr->Constellation); 402 c->layer[i].modulation = sms_to_modulation(lr->Constellation);
399 403
400 /* TS PER */ 404 /* TS PER */
401 c->block_error.stat[i].scale = FE_SCALE_COUNTER; 405 c->block_error.stat[i + 1].scale = FE_SCALE_COUNTER;
402 c->block_count.stat[i].scale = FE_SCALE_COUNTER; 406 c->block_count.stat[i + 1].scale = FE_SCALE_COUNTER;
403 c->block_error.stat[i].uvalue += lr->ErrorTSPackets; 407 c->block_error.stat[i + 1].uvalue += lr->ErrorTSPackets;
404 c->block_count.stat[i].uvalue += lr->TotalTSPackets; 408 c->block_count.stat[i + 1].uvalue += lr->TotalTSPackets;
405 409
406 /* Update global PER counter */ 410 /* Update global PER counter */
407 c->block_error.stat[0].uvalue += lr->ErrorTSPackets; 411 c->block_error.stat[0].uvalue += lr->ErrorTSPackets;
408 c->block_count.stat[0].uvalue += lr->TotalTSPackets; 412 c->block_count.stat[0].uvalue += lr->TotalTSPackets;
409 413
410 /* BER */ 414 /* BER */
411 c->post_bit_error.stat[i].scale = FE_SCALE_COUNTER; 415 c->post_bit_error.stat[i + 1].scale = FE_SCALE_COUNTER;
412 c->post_bit_count.stat[i].scale = FE_SCALE_COUNTER; 416 c->post_bit_count.stat[i + 1].scale = FE_SCALE_COUNTER;
413 c->post_bit_error.stat[i].uvalue += lr->BERErrorCount; 417 c->post_bit_error.stat[i + 1].uvalue += lr->BERErrorCount;
414 c->post_bit_count.stat[i].uvalue += lr->BERBitCount; 418 c->post_bit_count.stat[i + 1].uvalue += lr->BERBitCount;
415 419
416 /* Update global BER counter */ 420 /* Update global BER counter */
417 c->post_bit_error.stat[0].uvalue += lr->BERErrorCount; 421 c->post_bit_error.stat[0].uvalue += lr->BERErrorCount;
@@ -462,9 +466,17 @@ static void smsdvb_update_isdbt_stats_ex(struct smsdvb_client_t *client,
462 /* Clears global counters, as the code below will sum it again */ 466 /* Clears global counters, as the code below will sum it again */
463 c->block_error.stat[0].uvalue = 0; 467 c->block_error.stat[0].uvalue = 0;
464 c->block_count.stat[0].uvalue = 0; 468 c->block_count.stat[0].uvalue = 0;
469 c->block_error.stat[0].scale = FE_SCALE_COUNTER;
470 c->block_count.stat[0].scale = FE_SCALE_COUNTER;
465 c->post_bit_error.stat[0].uvalue = 0; 471 c->post_bit_error.stat[0].uvalue = 0;
466 c->post_bit_count.stat[0].uvalue = 0; 472 c->post_bit_count.stat[0].uvalue = 0;
473 c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER;
474 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER;
467 475
476 c->post_bit_error.len = n_layers + 1;
477 c->post_bit_count.len = n_layers + 1;
478 c->block_error.len = n_layers + 1;
479 c->block_count.len = n_layers + 1;
468 for (i = 0; i < n_layers; i++) { 480 for (i = 0; i < n_layers; i++) {
469 lr = &p->LayerInfo[i]; 481 lr = &p->LayerInfo[i];
470 482
@@ -478,20 +490,20 @@ static void smsdvb_update_isdbt_stats_ex(struct smsdvb_client_t *client,
478 c->layer[i].modulation = sms_to_modulation(lr->Constellation); 490 c->layer[i].modulation = sms_to_modulation(lr->Constellation);
479 491
480 /* TS PER */ 492 /* TS PER */
481 c->block_error.stat[i].scale = FE_SCALE_COUNTER; 493 c->block_error.stat[i + 1].scale = FE_SCALE_COUNTER;
482 c->block_count.stat[i].scale = FE_SCALE_COUNTER; 494 c->block_count.stat[i + 1].scale = FE_SCALE_COUNTER;
483 c->block_error.stat[i].uvalue += lr->ErrorTSPackets; 495 c->block_error.stat[i + 1].uvalue += lr->ErrorTSPackets;
484 c->block_count.stat[i].uvalue += lr->TotalTSPackets; 496 c->block_count.stat[i + 1].uvalue += lr->TotalTSPackets;
485 497
486 /* Update global PER counter */ 498 /* Update global PER counter */
487 c->block_error.stat[0].uvalue += lr->ErrorTSPackets; 499 c->block_error.stat[0].uvalue += lr->ErrorTSPackets;
488 c->block_count.stat[0].uvalue += lr->TotalTSPackets; 500 c->block_count.stat[0].uvalue += lr->TotalTSPackets;
489 501
490 /* BER */ 502 /* BER */
491 c->post_bit_error.stat[i].scale = FE_SCALE_COUNTER; 503 c->post_bit_error.stat[i + 1].scale = FE_SCALE_COUNTER;
492 c->post_bit_count.stat[i].scale = FE_SCALE_COUNTER; 504 c->post_bit_count.stat[i + 1].scale = FE_SCALE_COUNTER;
493 c->post_bit_error.stat[i].uvalue += lr->BERErrorCount; 505 c->post_bit_error.stat[i + 1].uvalue += lr->BERErrorCount;
494 c->post_bit_count.stat[i].uvalue += lr->BERBitCount; 506 c->post_bit_count.stat[i + 1].uvalue += lr->BERBitCount;
495 507
496 /* Update global BER counter */ 508 /* Update global BER counter */
497 c->post_bit_error.stat[0].uvalue += lr->BERErrorCount; 509 c->post_bit_error.stat[0].uvalue += lr->BERErrorCount;
@@ -572,7 +584,7 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
572 smscore_putbuffer(client->coredev, cb); 584 smscore_putbuffer(client->coredev, cb);
573 585
574 if (is_status_update) { 586 if (is_status_update) {
575 if (client->fe_status == FE_HAS_LOCK) { 587 if (client->fe_status & FE_HAS_LOCK) {
576 sms_board_dvb3_event(client, DVB3_EVENT_FE_LOCK); 588 sms_board_dvb3_event(client, DVB3_EVENT_FE_LOCK);
577 if (client->last_per == c->block_error.stat[0].uvalue) 589 if (client->last_per == c->block_error.stat[0].uvalue)
578 sms_board_dvb3_event(client, DVB3_EVENT_UNC_OK); 590 sms_board_dvb3_event(client, DVB3_EVENT_UNC_OK);