Commit Graph

23 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther e28a20a2d9 sysmobts: Catch up with the API changes and specify the version
API revision 5.1 allows us to pass a version number for the rx/tx
calibration and the DSP/FPGA will inform us about clock errors.
2015-12-07 11:23:36 +01:00
Harald Welte 9d0fd073e9 l1_if: pass private 'void *data' from call to callback
When enqueueing a command towards the L1, we can now pass along
a private data pointer, which then gets passed to the call-back
upon completion.
2014-08-24 17:05:23 +02:00
Holger Hans Peter Freyther 540f608c2c sysmobts: Fix compiler warning by including utils.h
calib_file.c: In function 'next_calib_file_idx':
calib_file.c:126:3: warning: implicit declaration of function 'band_femto2osmo' [-Wimplicit-function-declaration]
2013-12-12 17:34:20 +01:00
Holger Hans Peter Freyther 96264b6dd9 sysmobts: Remove stray semicolon from the PCU band filtering code.
The information from band_mask has never been used as the return
was executed unconditionally.

Fixes: Coverity CID 1113473
2013-12-12 17:26:15 +01:00
Harald Welte 99fb43f41a sysmobts calibration: Load further tables even if one fails
Even if one calibration table cannot be loaded, continue to try to
load the other tables, instead of aborting very early.
2013-10-28 10:15:48 +01:00
Harald Welte b8687024ea sysmobts calibration: skip bands not supported by L1
If L1 tells us that a certain band is not supported, then there is no
point in even trying to read+load calibration tables from EEPROM or
files.
2013-10-28 10:15:47 +01:00
Harald Welte 501673fcf3 sysmbts calibration: print error if we fail to read from EEPROM 2013-10-28 10:15:47 +01:00
Holger Hans Peter Freyther fbf97e35eb calib: The call to fscanf can fail and we should check the return value
Coverity wants us to check that fscanf has scanned the amount of
variables we want to have. Initialize the scan result to 0/0.0f
and warn if the scan has failed.

Fixes: Coverity CID 1040774, CID 1040773
2013-07-16 18:36:44 +02:00
Holger Hans Peter Freyther 89582f7e77 sysmobts: Add a method to free cached epprom resources
Close the cached file descriptor once the calibration data is
loaded and applied.
2013-07-04 17:38:15 +02:00
Holger Hans Peter Freyther 270cf418fc sysmobts: Read the mac and determine fixup only once during start 2013-07-04 17:38:15 +02:00
Holger Hans Peter Freyther 123caa3c83 calib: Attempt to fix the build for v2.7 of the api headers
This should fix:
calib_file.c: In function 'calib_eeprom_read':
calib_file.c:262: error: 'SuperFemto_SetRxCalibTblReq_t' undeclared (first use in this function)
calib_file.c:262: error: (Each undeclared identifier is reported only once
calib_file.c:262: error: for each function it appears in.)
2013-06-24 11:18:54 +02:00
Holger Hans Peter Freyther 593080ebab calib: Attempt to fix the build for v2.7 of the api headers
This should fix:
calib_file.c: In function 'calib_fixup_rx':
calib_file.c:148: error: 'SuperFemto_SetRxCalibTblReq_t' undeclared (first use in this function)
calib_file.c:148: error: (Each undeclared identifier is reported only once
2013-06-24 11:11:16 +02:00
Holger Hans Peter Freyther 25346fe0d7 sysmobts: Fix potential memory leaks in the prim callback handling
Make sure the l1msg is always freed in the callback. There were
several error conditions were the msgb would not have been freed,
in the case of the calib data and the system information the message
was not freed even in normal condition.

I will modify this code to __use a msgb. This allows to re-use
the allocated msgb across read operations.
2013-06-24 08:02:34 +02:00
Harald Welte 40ca16766d calib: Add fixup for incompatible calib data / firmware version
For certain sysmoBTS units, a fixup to the calibration table is needed,
if the firmware is >= 3.3.0.
2013-06-22 19:30:55 +02:00
Harald Welte 2563267757 calib: Read calibration data from EEPROM, not just files
On v2D (and later) hardware, the calibration data can be read directly
from the EEPROM and doesn't have to be read from files.

If there is no trx-calib-path set in the VTY, we will read from EEPROM.
2013-06-22 19:27:13 +02:00
Holger Hans Peter Freyther b7eb9865df calib: Use 2.4.0 as cut-off for the firmware, log errors
In case opening a calibration file is failing an error will will be
logged, the caller and implementation were inconsistent about the API
version that is supported for the calibration data, attempt to make
the cut-off at 2.4.0.
2013-02-27 11:10:33 +01:00
Holger Hans Peter Freyther 3d383c22c7 sysmobts: Remove the is_system_primitive from l1if_req_compl
All users (but the gsm_compl) of the l1if_req_compl use it with
is_system_primitive=1. We can now remove this parameter from the
method. Introduce _l1if_req_compl that will insert the item into
the queue for us.
2013-02-27 09:07:18 +01:00
Holger Hans Peter Freyther 654fe73b78 sysmobts: We can now pass the trx to the callback change the signatures 2013-02-27 09:07:18 +01:00
Holger Hans Peter Freyther 6142f9262a sysmobts: Remove the trx parameter from the signature
l1if_gsm_req_compl everyone is passing the trx as data pointer right
now, remove it from the request procedure right now as it can be
deducted from the femtol1_hdl.
2013-02-27 09:07:17 +01:00
Holger Hans Peter Freyther 64c5e3a19c sysmobts: Embed the calib state in the femtol1_hdl and use hdl->priv 2013-02-27 09:07:17 +01:00
Harald Welte 36e73dd7ed Ensure osmo-bts builds agsainst sysmobts-v1 headers (again) 2012-11-18 10:38:32 +01:00
Harald Welte d1335d878b sysmobts: Add support for reading calibration tables
'trx-calibration-path' is the new VTY command indicating the path
name where the calibration files can be found.

Calibration is only implemented for SUPERFEMTO API version 2.4.0 or
later.
2012-10-28 10:58:41 +01:00
Harald Welte c3646a80a7 sysmobts: Add code to read calibration files
... and convert them to L1 primitives.  The code is not yet used.
2012-10-27 21:44:18 +02:00