Commit Graph

12 Commits

Author SHA1 Message Date
Mauro Carvalho Chehab f35d09db0e [media] siano: use do_div() for 64-bits division
As reported by Frank Schäfer <fschaefer.oss@googlemail.com>:
	ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!

Reported-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Tested-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 09:46:31 -03:00
Mauro Carvalho Chehab 28a59df4d7 [media] siano: remove the remaining CamelCase compliants
Remove the remaining CamelCase checkpatch.pl compliants.
There are still a few left, but those are due to USB and
DVB APIs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:45 -03:00
Mauro Carvalho Chehab cf0e9cfcc7 [media] siano: convert structure names to lowercase
There are several structures defined in uppercase. Convert them
to lowercase, and simplify their names, when possible.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:27 -03:00
Mauro Carvalho Chehab dfef84fc13 [media] siano: get rid of CammelCase from smscoreapi.h
It is almost impossible to see a compliant with checkpatch.pl
on those Siano drivers, as there are simply too much violations
on it. So, now that a big change was done, the better is to
cleanup the checkpatch compliants.

Let's first replace all CammelCase symbols found at smscoreapi.h
using camel_case namespace. That removed 144 checkpatch.pl
compliants on this file. Of course, the other files need to be
fixed accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:16 -03:00
Mauro Carvalho Chehab 98c3f94e6d [media] siano: remove doubled new line
sms_debug() and sms_info() already adds a '\n' at the printed
strings. No need to add more.
That helps to cleanup stuff like:
	[ 4868.205648] smscore_onresponse: message not handled.
	[ 4868.205898] smscore_onresponse: message not handled.
and:
	[ 5467.959769] smscore_onresponse:
	data rate 143069 bytes/secs
While here, provides the message name, when the message is not
handled by the smsmdtv core.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:50 -03:00
Mauro Carvalho Chehab 773adad141 [media] siano: fix status report with old firmware and ISDB-T
This seems to be ever broken. That's the status report with
Firmware 2.1, before adding support for sms2270 is:
[22273.787218] smsdvb_onresponse: MSG_SMS_GET_STATISTICS_RES
[22273.792592] IsRfLocked = 1
[22273.792592] IsDemodLocked = 1
...
[22273.792598] TransmissionMode = -64
...
(all unshown fields are filled with zeros)
Of course, transmission mode being a negative number is wrong.
So, we need to take a deeper look on it.
With the debugfs patches applied, it is possible to see that, instead
of filling StatisticsType with 5, and FullSize with the size of the
payload (this is what happens with sms2270 and firmware 8.1),
those fields are also initialized with zero:
StatisticsType = 0	FullSize = 0
IsRfLocked = 1		IsDemodLocked = 1	IsExternalLNAOn = 0
SNR = 0 dB		RSSI = 0 dBm		InBandPwr = 0 dBm
CarrierOffset = 0	Bandwidth = 0		Frequency = 0 Hz
TransmissionMode = -64	ModemState = 0		GuardInterval = 0
SystemType = 0		PartialReception = 0	NumOfLayers = 0
SmsToHostTxErrors = 0
The data under "TransmissionMode" varies according with the signal,
and it is negative. It also matches the value for InBandPwr when
the tuner is on DVB-T (ok, signal doesn't lock, but the power level
should be about the same with the antena fixed, and measured at about
the same time).
So, there's a very high chance that, when StatisticsType is zero, the
signal strength is at the same position as Transmission Mode.
So, discard all other parameters, and provide only signal/rf lock and
signal strength if StatisticsType is 0, for ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:16 -03:00
Mauro Carvalho Chehab e1b2ac4d1e [media] siano: Only feed DVB data when there's a feed
Right now, the driver sends DVB data even before tunning.
It was noticed that this may lead into some mistakes at DVB
decode, as the PIDs from wrong channels may be associated with
another frequency, as they may already be inside the PID buffers.
So, prevent it by not feeding DVB demux with data while there's no
feed or while the device is not tuned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:05 -03:00
Mauro Carvalho Chehab 5c3b87435b [media] siano: Fix bandwidth report
It was expected that the bandwidth would be following the defines
at smscoreapi.h. However, this doesn't work. Instead, this field
brings just the bandwidth in MHz. Convert it to Hertz.
It should be noticed that, on ISDB, using the _EX request, the
field TuneBW seems to show the value that matches the bandwidth
code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:51:47 -03:00
Mauro Carvalho Chehab 9671045f4c [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>
2013-03-21 07:49:32 -03:00
Mauro Carvalho Chehab f5de95e246 [media] siano: fix signal strength and CNR stats measurements
There are a number of small issues with the stats refactoring:
	- InBandPwr better represents the signal strength;
	- Don't zero signal strength /cnr if no lock;
	- Fix signal strength/cnr scale;
	- Don't need to fill PER/BER if not locked, as the
	  code will disable those stats anyway.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:49:17 -03:00
Mauro Carvalho Chehab a9b9fbdf0a [media] siano: don't request statistics too fast
As each DVBv3 call may generate an stats overhead, prevent doing
it too fast. This is specially useful if a burst of get stats
DVBv3 call is sent.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:49:04 -03:00
Mauro Carvalho Chehab 503efe5cfc [media] siano: split debugfs code into a separate file
To avoid mixing two different things at the same place, move the
debugfs code into a separate file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:48:41 -03:00