aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-09 13:54:46 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 06:47:18 -0400
commitff702eb8d9c8ca293e7f0343dd38b718d58815b0 (patch)
treed6b5b1ac7e62b1758c1063dd3a32ecc584c01502 /drivers/media/common
parenteab0fa0f04317c7bb50f87d6b410d8ad6e2c2888 (diff)
[media] siano: split debug logic from the status update routine
It is confusing to merge both status updates with debug stuff. Also, it is a better idea to move those status updates to debugfs, instead of doing a large amount of printk's like that. So, break them into a separate block of routines. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/siano/smsdvb.c250
1 files changed, 135 insertions, 115 deletions
diff --git a/drivers/media/common/siano/smsdvb.c b/drivers/media/common/siano/smsdvb.c
index 1d6b8dfa0808..04544f591df5 100644
--- a/drivers/media/common/siano/smsdvb.c
+++ b/drivers/media/common/siano/smsdvb.c
@@ -61,6 +61,136 @@ static int sms_dbg;
61module_param_named(debug, sms_dbg, int, 0644); 61module_param_named(debug, sms_dbg, int, 0644);
62MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); 62MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))");
63 63
64static void smsdvb_print_dvb_stats(struct SMSHOSTLIB_STATISTICS_ST *p)
65{
66 if (!(sms_dbg & 2))
67 return;
68
69 printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked);
70 printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked);
71 printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn);
72 printk(KERN_DEBUG "SNR = %d", p->SNR);
73 printk(KERN_DEBUG "BER = %d", p->BER);
74 printk(KERN_DEBUG "FIB_CRC = %d", p->FIB_CRC);
75 printk(KERN_DEBUG "TS_PER = %d", p->TS_PER);
76 printk(KERN_DEBUG "MFER = %d", p->MFER);
77 printk(KERN_DEBUG "RSSI = %d", p->RSSI);
78 printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr);
79 printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset);
80 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
81 printk(KERN_DEBUG "Frequency = %d", p->Frequency);
82 printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth);
83 printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode);
84 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
85 printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval);
86 printk(KERN_DEBUG "CodeRate = %d", p->CodeRate);
87 printk(KERN_DEBUG "LPCodeRate = %d", p->LPCodeRate);
88 printk(KERN_DEBUG "Hierarchy = %d", p->Hierarchy);
89 printk(KERN_DEBUG "Constellation = %d", p->Constellation);
90 printk(KERN_DEBUG "BurstSize = %d", p->BurstSize);
91 printk(KERN_DEBUG "BurstDuration = %d", p->BurstDuration);
92 printk(KERN_DEBUG "BurstCycleTime = %d", p->BurstCycleTime);
93 printk(KERN_DEBUG "CalculatedBurstCycleTime = %d", p->CalculatedBurstCycleTime);
94 printk(KERN_DEBUG "NumOfRows = %d", p->NumOfRows);
95 printk(KERN_DEBUG "NumOfPaddCols = %d", p->NumOfPaddCols);
96 printk(KERN_DEBUG "NumOfPunctCols = %d", p->NumOfPunctCols);
97 printk(KERN_DEBUG "ErrorTSPackets = %d", p->ErrorTSPackets);
98 printk(KERN_DEBUG "TotalTSPackets = %d", p->TotalTSPackets);
99 printk(KERN_DEBUG "NumOfValidMpeTlbs = %d", p->NumOfValidMpeTlbs);
100 printk(KERN_DEBUG "NumOfInvalidMpeTlbs = %d", p->NumOfInvalidMpeTlbs);
101 printk(KERN_DEBUG "NumOfCorrectedMpeTlbs = %d", p->NumOfCorrectedMpeTlbs);
102 printk(KERN_DEBUG "BERErrorCount = %d", p->BERErrorCount);
103 printk(KERN_DEBUG "BERBitCount = %d", p->BERBitCount);
104 printk(KERN_DEBUG "SmsToHostTxErrors = %d", p->SmsToHostTxErrors);
105 printk(KERN_DEBUG "PreBER = %d", p->PreBER);
106 printk(KERN_DEBUG "CellId = %d", p->CellId);
107 printk(KERN_DEBUG "DvbhSrvIndHP = %d", p->DvbhSrvIndHP);
108 printk(KERN_DEBUG "DvbhSrvIndLP = %d", p->DvbhSrvIndLP);
109 printk(KERN_DEBUG "NumMPEReceived = %d", p->NumMPEReceived);
110}
111
112static void smsdvb_print_isdb_stats(struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p)
113{
114 int i;
115
116 if (!(sms_dbg & 2))
117 return;
118
119 printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked);
120 printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked);
121 printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn);
122 printk(KERN_DEBUG "SNR = %d", p->SNR);
123 printk(KERN_DEBUG "RSSI = %d", p->RSSI);
124 printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr);
125 printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset);
126 printk(KERN_DEBUG "Frequency = %d", p->Frequency);
127 printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth);
128 printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode);
129 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
130 printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval);
131 printk(KERN_DEBUG "SystemType = %d", p->SystemType);
132 printk(KERN_DEBUG "PartialReception = %d", p->PartialReception);
133 printk(KERN_DEBUG "NumOfLayers = %d", p->NumOfLayers);
134 printk(KERN_DEBUG "SmsToHostTxErrors = %d", p->SmsToHostTxErrors);
135
136 for (i = 0; i < 3; i++) {
137 printk(KERN_DEBUG "%d: CodeRate = %d", i, p->LayerInfo[i].CodeRate);
138 printk(KERN_DEBUG "%d: Constellation = %d", i, p->LayerInfo[i].Constellation);
139 printk(KERN_DEBUG "%d: BER = %d", i, p->LayerInfo[i].BER);
140 printk(KERN_DEBUG "%d: BERErrorCount = %d", i, p->LayerInfo[i].BERErrorCount);
141 printk(KERN_DEBUG "%d: BERBitCount = %d", i, p->LayerInfo[i].BERBitCount);
142 printk(KERN_DEBUG "%d: PreBER = %d", i, p->LayerInfo[i].PreBER);
143 printk(KERN_DEBUG "%d: TS_PER = %d", i, p->LayerInfo[i].TS_PER);
144 printk(KERN_DEBUG "%d: ErrorTSPackets = %d", i, p->LayerInfo[i].ErrorTSPackets);
145 printk(KERN_DEBUG "%d: TotalTSPackets = %d", i, p->LayerInfo[i].TotalTSPackets);
146 printk(KERN_DEBUG "%d: TILdepthI = %d", i, p->LayerInfo[i].TILdepthI);
147 printk(KERN_DEBUG "%d: NumberOfSegments = %d", i, p->LayerInfo[i].NumberOfSegments);
148 printk(KERN_DEBUG "%d: TMCCErrors = %d", i, p->LayerInfo[i].TMCCErrors);
149 }
150}
151
152static void
153smsdvb_print_isdb_stats_ex(struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *p)
154{
155 int i;
156
157 if (!(sms_dbg & 2))
158 return;
159
160 printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked);
161 printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked);
162 printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn);
163 printk(KERN_DEBUG "SNR = %d", p->SNR);
164 printk(KERN_DEBUG "RSSI = %d", p->RSSI);
165 printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr);
166 printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset);
167 printk(KERN_DEBUG "Frequency = %d", p->Frequency);
168 printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth);
169 printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode);
170 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
171 printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval);
172 printk(KERN_DEBUG "SystemType = %d", p->SystemType);
173 printk(KERN_DEBUG "PartialReception = %d", p->PartialReception);
174 printk(KERN_DEBUG "NumOfLayers = %d", p->NumOfLayers);
175 printk(KERN_DEBUG "SegmentNumber = %d", p->SegmentNumber);
176 printk(KERN_DEBUG "TuneBW = %d", p->TuneBW);
177
178 for (i = 0; i < 3; i++) {
179 printk(KERN_DEBUG "%d: CodeRate = %d", i, p->LayerInfo[i].CodeRate);
180 printk(KERN_DEBUG "%d: Constellation = %d", i, p->LayerInfo[i].Constellation);
181 printk(KERN_DEBUG "%d: BER = %d", i, p->LayerInfo[i].BER);
182 printk(KERN_DEBUG "%d: BERErrorCount = %d", i, p->LayerInfo[i].BERErrorCount);
183 printk(KERN_DEBUG "%d: BERBitCount = %d", i, p->LayerInfo[i].BERBitCount);
184 printk(KERN_DEBUG "%d: PreBER = %d", i, p->LayerInfo[i].PreBER);
185 printk(KERN_DEBUG "%d: TS_PER = %d", i, p->LayerInfo[i].TS_PER);
186 printk(KERN_DEBUG "%d: ErrorTSPackets = %d", i, p->LayerInfo[i].ErrorTSPackets);
187 printk(KERN_DEBUG "%d: TotalTSPackets = %d", i, p->LayerInfo[i].TotalTSPackets);
188 printk(KERN_DEBUG "%d: TILdepthI = %d", i, p->LayerInfo[i].TILdepthI);
189 printk(KERN_DEBUG "%d: NumberOfSegments = %d", i, p->LayerInfo[i].NumberOfSegments);
190 printk(KERN_DEBUG "%d: TMCCErrors = %d", i, p->LayerInfo[i].TMCCErrors);
191 }
192}
193
64/* Events that may come from DVB v3 adapter */ 194/* Events that may come from DVB v3 adapter */
65static void sms_board_dvb3_event(struct smsdvb_client_t *client, 195static void sms_board_dvb3_event(struct smsdvb_client_t *client,
66 enum SMS_DVB3_EVENTS event) { 196 enum SMS_DVB3_EVENTS event) {
@@ -115,51 +245,9 @@ static void sms_board_dvb3_event(struct smsdvb_client_t *client,
115} 245}
116 246
117static void smsdvb_update_dvb_stats(struct RECEPTION_STATISTICS_EX_S *pReceptionData, 247static void smsdvb_update_dvb_stats(struct RECEPTION_STATISTICS_EX_S *pReceptionData,
118 struct SMSHOSTLIB_STATISTICS_ST *p) 248 struct SMSHOSTLIB_STATISTICS_ST *p)
119{ 249{
120 if (sms_dbg & 2) { 250 smsdvb_print_dvb_stats(p);
121 printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked);
122 printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked);
123 printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn);
124 printk(KERN_DEBUG "SNR = %d", p->SNR);
125 printk(KERN_DEBUG "BER = %d", p->BER);
126 printk(KERN_DEBUG "FIB_CRC = %d", p->FIB_CRC);
127 printk(KERN_DEBUG "TS_PER = %d", p->TS_PER);
128 printk(KERN_DEBUG "MFER = %d", p->MFER);
129 printk(KERN_DEBUG "RSSI = %d", p->RSSI);
130 printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr);
131 printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset);
132 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
133 printk(KERN_DEBUG "Frequency = %d", p->Frequency);
134 printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth);
135 printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode);
136 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
137 printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval);
138 printk(KERN_DEBUG "CodeRate = %d", p->CodeRate);
139 printk(KERN_DEBUG "LPCodeRate = %d", p->LPCodeRate);
140 printk(KERN_DEBUG "Hierarchy = %d", p->Hierarchy);
141 printk(KERN_DEBUG "Constellation = %d", p->Constellation);
142 printk(KERN_DEBUG "BurstSize = %d", p->BurstSize);
143 printk(KERN_DEBUG "BurstDuration = %d", p->BurstDuration);
144 printk(KERN_DEBUG "BurstCycleTime = %d", p->BurstCycleTime);
145 printk(KERN_DEBUG "CalculatedBurstCycleTime = %d", p->CalculatedBurstCycleTime);
146 printk(KERN_DEBUG "NumOfRows = %d", p->NumOfRows);
147 printk(KERN_DEBUG "NumOfPaddCols = %d", p->NumOfPaddCols);
148 printk(KERN_DEBUG "NumOfPunctCols = %d", p->NumOfPunctCols);
149 printk(KERN_DEBUG "ErrorTSPackets = %d", p->ErrorTSPackets);
150 printk(KERN_DEBUG "TotalTSPackets = %d", p->TotalTSPackets);
151 printk(KERN_DEBUG "NumOfValidMpeTlbs = %d", p->NumOfValidMpeTlbs);
152 printk(KERN_DEBUG "NumOfInvalidMpeTlbs = %d", p->NumOfInvalidMpeTlbs);
153 printk(KERN_DEBUG "NumOfCorrectedMpeTlbs = %d", p->NumOfCorrectedMpeTlbs);
154 printk(KERN_DEBUG "BERErrorCount = %d", p->BERErrorCount);
155 printk(KERN_DEBUG "BERBitCount = %d", p->BERBitCount);
156 printk(KERN_DEBUG "SmsToHostTxErrors = %d", p->SmsToHostTxErrors);
157 printk(KERN_DEBUG "PreBER = %d", p->PreBER);
158 printk(KERN_DEBUG "CellId = %d", p->CellId);
159 printk(KERN_DEBUG "DvbhSrvIndHP = %d", p->DvbhSrvIndHP);
160 printk(KERN_DEBUG "DvbhSrvIndLP = %d", p->DvbhSrvIndLP);
161 printk(KERN_DEBUG "NumMPEReceived = %d", p->NumMPEReceived);
162 }
163 251
164 /* update reception data */ 252 /* update reception data */
165 pReceptionData->IsRfLocked = p->IsRfLocked; 253 pReceptionData->IsRfLocked = p->IsRfLocked;
@@ -179,43 +267,9 @@ static void smsdvb_update_dvb_stats(struct RECEPTION_STATISTICS_EX_S *pReception
179}; 267};
180 268
181static void smsdvb_update_isdbt_stats(struct RECEPTION_STATISTICS_EX_S *pReceptionData, 269static void smsdvb_update_isdbt_stats(struct RECEPTION_STATISTICS_EX_S *pReceptionData,
182 struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p) 270 struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p)
183{ 271{
184 int i; 272 smsdvb_print_isdb_stats(p);
185
186 if (sms_dbg & 2) {
187 printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked);
188 printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked);
189 printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn);
190 printk(KERN_DEBUG "SNR = %d", p->SNR);
191 printk(KERN_DEBUG "RSSI = %d", p->RSSI);
192 printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr);
193 printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset);
194 printk(KERN_DEBUG "Frequency = %d", p->Frequency);
195 printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth);
196 printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode);
197 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
198 printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval);
199 printk(KERN_DEBUG "SystemType = %d", p->SystemType);
200 printk(KERN_DEBUG "PartialReception = %d", p->PartialReception);
201 printk(KERN_DEBUG "NumOfLayers = %d", p->NumOfLayers);
202 printk(KERN_DEBUG "SmsToHostTxErrors = %d", p->SmsToHostTxErrors);
203
204 for (i = 0; i < 3; i++) {
205 printk(KERN_DEBUG "%d: CodeRate = %d", i, p->LayerInfo[i].CodeRate);
206 printk(KERN_DEBUG "%d: Constellation = %d", i, p->LayerInfo[i].Constellation);
207 printk(KERN_DEBUG "%d: BER = %d", i, p->LayerInfo[i].BER);
208 printk(KERN_DEBUG "%d: BERErrorCount = %d", i, p->LayerInfo[i].BERErrorCount);
209 printk(KERN_DEBUG "%d: BERBitCount = %d", i, p->LayerInfo[i].BERBitCount);
210 printk(KERN_DEBUG "%d: PreBER = %d", i, p->LayerInfo[i].PreBER);
211 printk(KERN_DEBUG "%d: TS_PER = %d", i, p->LayerInfo[i].TS_PER);
212 printk(KERN_DEBUG "%d: ErrorTSPackets = %d", i, p->LayerInfo[i].ErrorTSPackets);
213 printk(KERN_DEBUG "%d: TotalTSPackets = %d", i, p->LayerInfo[i].TotalTSPackets);
214 printk(KERN_DEBUG "%d: TILdepthI = %d", i, p->LayerInfo[i].TILdepthI);
215 printk(KERN_DEBUG "%d: NumberOfSegments = %d", i, p->LayerInfo[i].NumberOfSegments);
216 printk(KERN_DEBUG "%d: TMCCErrors = %d", i, p->LayerInfo[i].TMCCErrors);
217 }
218 }
219 273
220 /* update reception data */ 274 /* update reception data */
221 pReceptionData->IsRfLocked = p->IsRfLocked; 275 pReceptionData->IsRfLocked = p->IsRfLocked;
@@ -249,41 +303,7 @@ static void smsdvb_update_isdbt_stats(struct RECEPTION_STATISTICS_EX_S *pRecepti
249static void smsdvb_update_isdbt_stats_ex(struct RECEPTION_STATISTICS_EX_S *pReceptionData, 303static void smsdvb_update_isdbt_stats_ex(struct RECEPTION_STATISTICS_EX_S *pReceptionData,
250 struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *p) 304 struct SMSHOSTLIB_STATISTICS_ISDBT_EX_ST *p)
251{ 305{
252 int i; 306 smsdvb_print_isdb_stats_ex(p);
253
254 if (sms_dbg & 2) {
255 printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked);
256 printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked);
257 printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn);
258 printk(KERN_DEBUG "SNR = %d", p->SNR);
259 printk(KERN_DEBUG "RSSI = %d", p->RSSI);
260 printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr);
261 printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset);
262 printk(KERN_DEBUG "Frequency = %d", p->Frequency);
263 printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth);
264 printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode);
265 printk(KERN_DEBUG "ModemState = %d", p->ModemState);
266 printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval);
267 printk(KERN_DEBUG "SystemType = %d", p->SystemType);
268 printk(KERN_DEBUG "PartialReception = %d", p->PartialReception);
269 printk(KERN_DEBUG "NumOfLayers = %d", p->NumOfLayers);
270 printk(KERN_DEBUG "SegmentNumber = %d", p->SegmentNumber);
271 printk(KERN_DEBUG "TuneBW = %d", p->TuneBW);
272 for (i = 0; i < 3; i++) {
273 printk(KERN_DEBUG "%d: CodeRate = %d", i, p->LayerInfo[i].CodeRate);
274 printk(KERN_DEBUG "%d: Constellation = %d", i, p->LayerInfo[i].Constellation);
275 printk(KERN_DEBUG "%d: BER = %d", i, p->LayerInfo[i].BER);
276 printk(KERN_DEBUG "%d: BERErrorCount = %d", i, p->LayerInfo[i].BERErrorCount);
277 printk(KERN_DEBUG "%d: BERBitCount = %d", i, p->LayerInfo[i].BERBitCount);
278 printk(KERN_DEBUG "%d: PreBER = %d", i, p->LayerInfo[i].PreBER);
279 printk(KERN_DEBUG "%d: TS_PER = %d", i, p->LayerInfo[i].TS_PER);
280 printk(KERN_DEBUG "%d: ErrorTSPackets = %d", i, p->LayerInfo[i].ErrorTSPackets);
281 printk(KERN_DEBUG "%d: TotalTSPackets = %d", i, p->LayerInfo[i].TotalTSPackets);
282 printk(KERN_DEBUG "%d: TILdepthI = %d", i, p->LayerInfo[i].TILdepthI);
283 printk(KERN_DEBUG "%d: NumberOfSegments = %d", i, p->LayerInfo[i].NumberOfSegments);
284 printk(KERN_DEBUG "%d: TMCCErrors = %d", i, p->LayerInfo[i].TMCCErrors);
285 }
286 }
287 307
288 /* update reception data */ 308 /* update reception data */
289 pReceptionData->IsRfLocked = p->IsRfLocked; 309 pReceptionData->IsRfLocked = p->IsRfLocked;