diff options
author | Antti Palosaari <crope@iki.fi> | 2014-09-02 07:29:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-21 18:46:22 -0400 |
commit | 6bb096c92671cad4a8cfcb8bf2a5309a9033faee (patch) | |
tree | 8a84aba0c81dd0894ddaf683a4b1dfe3a96834f8 | |
parent | 204f4319289fcd45ae2d059a4cfc200c7754b050 (diff) |
[media] af9033: implement DVBv5 post-Viterbi BER
Implement following DTV API commands:
DTV_STAT_POST_ERROR_BIT_COUNT
DTV_STAT_POST_TOTAL_BIT_COUNT
These will provide post-Viterbi bit error rate reporting.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/dvb-frontends/af9033.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/af9033.c b/drivers/media/dvb-frontends/af9033.c index 7b853469bb3b..b6b90e61ed83 100644 --- a/drivers/media/dvb-frontends/af9033.c +++ b/drivers/media/dvb-frontends/af9033.c | |||
@@ -38,6 +38,8 @@ struct af9033_dev { | |||
38 | fe_status_t fe_status; | 38 | fe_status_t fe_status; |
39 | u32 ber; | 39 | u32 ber; |
40 | u32 ucb; | 40 | u32 ucb; |
41 | u64 post_bit_error; | ||
42 | u64 post_bit_count; | ||
41 | u64 error_block_count; | 43 | u64 error_block_count; |
42 | u64 total_block_count; | 44 | u64 total_block_count; |
43 | struct delayed_work stat_work; | 45 | struct delayed_work stat_work; |
@@ -1093,6 +1095,8 @@ static void af9033_stat_work(struct work_struct *work) | |||
1093 | if (dev->fe_status & FE_HAS_LOCK) { | 1095 | if (dev->fe_status & FE_HAS_LOCK) { |
1094 | /* outer FEC, 204 byte packets */ | 1096 | /* outer FEC, 204 byte packets */ |
1095 | u16 abort_packet_count, rsd_packet_count; | 1097 | u16 abort_packet_count, rsd_packet_count; |
1098 | /* inner FEC, bits */ | ||
1099 | u32 rsd_bit_err_count; | ||
1096 | 1100 | ||
1097 | /* | 1101 | /* |
1098 | * Packet count used for measurement is 10000 | 1102 | * Packet count used for measurement is 10000 |
@@ -1104,10 +1108,13 @@ static void af9033_stat_work(struct work_struct *work) | |||
1104 | goto err; | 1108 | goto err; |
1105 | 1109 | ||
1106 | abort_packet_count = (buf[1] << 8) | (buf[0] << 0); | 1110 | abort_packet_count = (buf[1] << 8) | (buf[0] << 0); |
1111 | rsd_bit_err_count = (buf[4] << 16) | (buf[3] << 8) | buf[2]; | ||
1107 | rsd_packet_count = (buf[6] << 8) | (buf[5] << 0); | 1112 | rsd_packet_count = (buf[6] << 8) | (buf[5] << 0); |
1108 | 1113 | ||
1109 | dev->error_block_count += abort_packet_count; | 1114 | dev->error_block_count += abort_packet_count; |
1110 | dev->total_block_count += rsd_packet_count; | 1115 | dev->total_block_count += rsd_packet_count; |
1116 | dev->post_bit_error += rsd_bit_err_count; | ||
1117 | dev->post_bit_count += rsd_packet_count * 204 * 8; | ||
1111 | 1118 | ||
1112 | c->block_count.len = 1; | 1119 | c->block_count.len = 1; |
1113 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; | 1120 | c->block_count.stat[0].scale = FE_SCALE_COUNTER; |
@@ -1116,6 +1123,14 @@ static void af9033_stat_work(struct work_struct *work) | |||
1116 | c->block_error.len = 1; | 1123 | c->block_error.len = 1; |
1117 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; | 1124 | c->block_error.stat[0].scale = FE_SCALE_COUNTER; |
1118 | c->block_error.stat[0].uvalue = dev->error_block_count; | 1125 | c->block_error.stat[0].uvalue = dev->error_block_count; |
1126 | |||
1127 | c->post_bit_count.len = 1; | ||
1128 | c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; | ||
1129 | c->post_bit_count.stat[0].uvalue = dev->post_bit_count; | ||
1130 | |||
1131 | c->post_bit_error.len = 1; | ||
1132 | c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; | ||
1133 | c->post_bit_error.stat[0].uvalue = dev->post_bit_error; | ||
1119 | } | 1134 | } |
1120 | 1135 | ||
1121 | err_schedule_delayed_work: | 1136 | err_schedule_delayed_work: |