aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-10-28sysmbts calibration: print error if we fail to read from EEPROMHarald Welte1-2/+10
2013-10-25rsl/pcu: Do not send a CHAN ACT to the BSC on PCU usageHolger Hans Peter Freyther2-0/+21
The PCU is forcing the activation of a PDCH. Currently the BSC will receive a channel act ack for a channel that was not activated at all. Use the "release_reason" flag of the lchan to see if we have requested a normal activation or a silent one. It feels a bit odd to do it in the TX function but it is the most easy solution right now. I have added logging so it will not be totally silent.
2013-10-25lchan: Print the name of the channel already in release requestHolger Hans Peter Freyther1-1/+5
2013-10-10sysmobts: Attempt to fix the compilation for the v1 hardwareHolger Hans Peter Freyther1-0/+4
2013-10-10misc: Fix resource leak when the ioctl is failingHolger Hans Peter Freyther1-2/+2
Fixes: Coverity CID 1040759
2013-10-09sysmobts: Permit local override of transmit power above 23 dBmHarald Welte1-1/+1
This is used in the sysmoBTS 2050, where the maximum power is 40 dBm We might want to add a safeguard of some kind to prevent people from overdriving their transmitters.
2013-10-09sysmobts: don't call sysmobts_get_nominal_power() twiceHarald Welte1-1/+1
... no need for that
2013-10-09sysmobts: make L1 power configurableHarald Welte1-0/+18
The TRX nominal output power (as seen by OML) is the aggregate power of any gain internal to the sysmoBTS (and managed by L1) and any external PA. This is what is used in trx->nominal_power; fl1h->l1_power is the transmit power to which we configure the sysmoBTS L1. This is 23 dBm (200mW) by default in the sysmoBTS 1002, and 40 dBm (5W) in the sysmoBTS 2050. However, if sysmoBTS 2050 is used in single-TRX configuration, it may be used with higher power, which we can now configure in the config file / vty. TODO: A separate, additional field that keeps track of any gain added by an external PA, e.g. if the sysmoBTS 1002 is used with a sysmoAMP.
2013-10-09sysmobts: Don't use the clock calibration value on external clocksHarald Welte1-3/+21
If the clock is provided by an external (like GPS) clock, we should not use the calibration value. The latter is only used in context of the OCXO or VCTCXO.
2013-10-09sysmobts: Set nominal transmit power depending on sysmoBTS modelHarald Welte3-1/+32
This enables the use of up to 5W for each TRX in a sysmoBTS 2050.
2013-10-09Do not attempt to initialize L1 with a band unsupported by hardwareHarald Welte3-11/+21
If the EEPROM tells us that a given unit doesn't support a given band, we shouldn't try to use it, even if the BSC tells us to use an ARFCN in such an unsupported band. The reason is simple: The given BTS unit might have band specific filter / duplexer / PA.
2013-10-09sysmobts: Read supported bands from EEPROMHarald Welte1-2/+21
...rather than assuming that any v2 hardware supports all bands.
2013-10-06abis: delay l1if_reset() until OML link is establishedHarald Welte2-3/+10
2013-10-06abis: Use OML remote (BSC) address if RSL CONNECT contains no IPHarald Welte3-7/+23
This introduces a new get_signlink_remote_ip() function whcih we also use in the RSL code to determine the RTP remote address if the CRCX/MDCX contains no remote IP address IE.
2013-10-06Call e1inp_vty_init() to make abis interface accessible from VTYHarald Welte1-0/+1
It might not be particularly useful, but then there's no disadvantage either...
2013-10-06migrate away from our own abis.c code to libosmoabisHarald Welte6-477/+174
libosmoabis has a BTS-side implementation of the IPA protocol for years, and osmo-bts should have used that all the time. Unfortunately it had its own local hack, this patch is migrating to the libosmocore implementation.
2013-10-04Use GPS as default clock source on sysmoBTS 2050Harald Welte3-3/+41
2013-10-04add sysmobts-util command-line utility to read/write EEPROM parametersHarald Welte2-1/+132
2013-10-04sysmobts_par: add value_string definitions for parametersHarald Welte2-1/+18
2013-10-04sysmobts_par: Implement new EEPROM parameters (trx_nr, model_nr, model_flags)Harald Welte2-0/+21
2013-10-04sysmobts_par: support for negative parametersHarald Welte3-23/+23
by splitting the rerutn code/status from the actual value, we support negative values to be stored in the EEPROM
2013-10-04EEPROM: add model_nr, model_flags and trx_nr to EEPROMHarald Welte1-1/+9
2013-09-03Remove obsolete osmo-bts-bb codeAndreas Eversberg4-528/+1
2013-07-16sysmobts: Set the clock calibration to the value read from the eepromNicolas J. Bouliane4-1/+50
By default read the clock calibration from the EEPROM. It is still possible to set it using the cli. Signed-off-by: Nicolas J. Bouliane <nicolas.bouliane@nutaq.com>
2013-07-16calib: The call to fscanf can fail and we should check the return valueHolger Hans Peter Freyther1-4/+14
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-16eeprom: Check the return value of the fseek in all callsHolger Hans Peter Freyther1-3/+20
Coverity insists that we should check the return value of the calls to fseek. In general this is a good idea. Fixes: Coverity CID 1040770, CID 1040771, CID 1040772
2013-07-16eeprom: After eeprom_write g_file could point to a closed fileHolger Hans Peter Freyther1-0/+1
Calling eeprom_write would either re-use g_file or newly open the file and set g_file but it will close the file as well. This will lead to other code using fseek/fread on a closed file. On top of that the general rule for the eeprom code now is that read and write may not be mixed (due caching and other bits).
2013-07-16oml: Remove the unused nofh variable from oml_mo_tx_sw_act_repHolger Hans Peter Freyther1-3/+1
The variable was assigned but nothing was done with it, just remove it for now. Fixes: Coverity CID 1040758
2013-07-09rsl: Fix the audio handling after the 'alignment' handling fixHolger Hans Peter Freyther1-26/+21
The issue got introduced in fcdba6bfaca9e016f35fc9fa826948ec74f66121 when moving from the uint32_t pointer to a plain int. The code was now like this: if (connect_ip > 0) { if (connect_ip == 0) lookup_ip_based_on_rsl ... Coverity detected this as logically dead code and it was breaking audio handling for the osmo-bsc case. Remove the tristate handling, the RSL behavior is that leaving out port/ip is like specifying it as zero. Fixes: Coverity CID 1040769
2013-07-09sysmobts: The code allowed a out of bounds access to temp_type_strHolger Hans Peter Freyther1-1/+1
The array has three elements but check was for > _NUM_TEMP_TYPES (3) so an access at array[3] was possible. It is unlikely to have happened due the usage of enums. Use ARRAY_SIZE and >= on the real array to avoid this problem. Fixes: Coverity CID 1040760
2013-07-04sysmobts: Cache the eeprom_Cfg_t for reading tx/rx calib dataHolger Hans Peter Freyther1-67/+75
The current code has 26 fseek/fread. Only the minority really results in a call to read. Nevertheless the time for reading during the bootstrap can take up to 7.82 seconds. Caching the header (which is already done by fopen/fread) will result in one call to fseek/fread and only consumes 0.784 seconds.
2013-07-04sysmobts: Add a method to free cached epprom resourcesHolger Hans Peter Freyther3-0/+9
Close the cached file descriptor once the calibration data is loaded and applied.
2013-07-04sysmobts: Read the mac and determine fixup only once during startHolger Hans Peter Freyther2-8/+32
2013-07-04sysmobts: Fix a typo that broke the ciphering with A5/0 > 0Holger Hans Peter Freyther1-2/+2
Commit 564313066464197af58b02152c379e1c02336bcf by Daniel changed the ciphering to go through the command queue. In this commit the direction for the ciphering got turned around and was not spotted by review. It worked in testing due the usage of A5/0 and in that case the direction did not matter.
2013-07-01misc: Fix various warnings in the codeHolger Hans Peter Freyther2-1/+5
sysmobts_vty.c: In function 'activate_lchan': sysmobts_vty.c:373:3: warning: implicit declaration of function 'lchan_activate' [-Wimplicit-function-declaration] sysmobts_vty.c:375:3: warning: implicit declaration of function 'lchan_deactivate' [-Wimplicit-function-declaration] eeprom.c: In function 'eeprom_ReadEthAddr': eeprom.c:305:5: warning: pointer targets in passing argument 3 of 'eeprom_read' differ in signedness [-Wpointer-sign] eeprom.c:260:12: note: expected 'char *' but argument is of type 'uint8_t *'
2013-06-30make oml_mo_state_init() a void functionHarald Welte1-1/+1
... so we don't get warnings about not returning anything
2013-06-30Don't send OML STATE CHANGE before OML is connectedHarald Welte2-5/+12
Instead of calling oml_mo_state_chg() [which transmits OML STATE CHG] during bts_init(), we use a new oml_mo_state_init() function which simply sets the state.
2013-06-24calib: Attempt to fix the build for v2.7 of the api headersHolger Hans Peter Freyther1-0/+2
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-24calib: Attempt to fix the build for v2.7 of the api headersHolger Hans Peter Freyther1-0/+2
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-24sysmobts: Introduce an auto-band config to ease DCS/DCS, PCS/PCS changesHolger Hans Peter Freyther5-20/+131
During development one switches from GSM900 to GSM1800 and GSM850 to GSM1900. This commit attempts to make this switch more easy. GSM1800 and GSM1900 have overlapping ARFCNs. This means that the mapping from bands to arfcn is not injective. Because of that I removed the code to deduce the band from the ARFCN. This was done in commit 8c3d807b3fc785ffb18aeb97355150c92221e8a0. The auto-band option allows to move between GSM900/GSM1800 and GSM850/GSM1900. Add a simple testcase with these auto-band configurations.
2013-06-24sysmobts: Make sure we receive every SACCH frame to count S properlyHolger Hans Peter Freyther1-7/+6
In case there is no transmitter the S counter might never be decreased. This means that no radio link timeout will not be sent and the lchan will remain open forever. There are several ways to resolve this. The first would be to use the MphTimeInd and after each multiframe check if there has been a SACCH message for the open lchan's. This could be similar to the trx_meas_check_compute. I decided to change fBFILevel to always receive SACCH frames and move the code down to the PDTCH/PACCH handling and update the comment.
2013-06-24sysmobts: Read multiple primitives at once but only up to 3Holger Hans Peter Freyther1-25/+56
In most cases there are multiple messages ready to be read from the queue and it is more efficient to read them in one go instead of going through the select again.
2013-06-24sysmobts: Use writev for the outgoing data of the write queueHolger Hans Peter Freyther1-0/+69
Attempt to write multiple primitives at the same time instead of the select/write, select/write that is currently done. The queue size is big enough to hold several entries at the same time and it is unlikely we get the -EAGAIN from the kernel driver. The writev code works by assuming that each element in the queue has the same size. This is not verified by the code and if this assumption breaks at some point the code will drop primitives or send some twice.
2013-06-24sysmobts: Fix potential memory leaks in the prim callback handlingHolger Hans Peter Freyther3-3/+8
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-24lapd: Fix a +ptrsize memory leak for each opened lchanHolger Hans Peter Freyther1-1/+1
The lapdm/lapd_core code needs to keep a history of messages sent. This history is not freed when lapdm_channel_reset is called and the init code will just allocate a new array. This means there is a memory leak on every released channel every time it is released.
2013-06-22calib: Fix for new EEPROM Mode; better log msgsHarald Welte1-4/+8
2013-06-22calib: Add fixup for incompatible calib data / firmware versionHarald Welte6-9/+173
For certain sysmoBTS units, a fixup to the calibration table is needed, if the firmware is >= 3.3.0.
2013-06-22calib: Read calibration data from EEPROM, not just filesHarald Welte2-5/+75
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-22eeprom: wrap DISP_ERROR #ifdef/endif in PERROR() macroHarald Welte1-132/+50
This has the advantage that an user application might simply re-define the PERROR() macro rather than patching the code all over the place.
2013-06-22eeprom: cache the file descriptor instead of fopen/fclose all the timeHarald Welte1-14/+19