Commit Graph

3284 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther e968c4224d bts: Fix typos in the log messages 2013-11-27 10:43:01 +01:00
Holger Hans Peter Freyther 082e21dbb5 bts: Fix a typo in the log message 2013-11-27 10:40:31 +01:00
Holger Hans Peter Freyther a82cc5321e rsl: Rename abis_rsl_sendmsg to avoid symbol clash with libosmo-abis
Nicolas ended up with linker issues due abis_rsl_sendmsg being
defined twice. Rename our version of the function and update the
code.

Patched with:
 @i@
 expression E;
 @@

 - abis_rsl_sendmsg(E)
 + abis_bts_rsl_sendmsg(E)
2013-11-14 10:41:18 +01:00
Jacob Erlbeck 897f97f632 sysmobts: Notify the BSC about all muted lchans
Currently it takes some time (around 30s) until it is detected that
the radio link is down after mute. Not till then the BSC is informed
and the call terminated.

This patch modifies this behaviour by sending a RSL_MT_CONN_FAIL
message with cause RSL_ERR_RADIO_LINK_FAIL for each muted and active
lchan immediately after the corresponding Change Administrative State
Request has been acknowledged.

Ticket: OW#976
Sponsored-by: On-Waves ehf
2013-11-05 16:11:07 +01:00
Jacob Erlbeck 5eef61414a sysmobts: Only set RC state to LOCK if all channels are muted
Currently only mute_state[0] (refers to ts[0]) is inspected to
determine, whether the Radio Carrier's state is set to LOCK.

This patch changes this by looking at all channels and using LOCK
if (and only if) all channels have been muted successfully.

Sponsored-by: On-Waves ehf
2013-11-05 15:51:19 +01:00
Jacob Erlbeck 5b69ec3e72 sysmobts: Use status flags instead of direct LED access
Currently the LEDs are being accessed directly from within the
l1_if.c file. So the handling of rf mute and activate/deactivate both
access LED_RF_ACTIVE directly. This may lead to an inconsistent LED
status.

This patch replaces these calls to sysmobts_led_set() by an abstract
equivalent bts_update_status(), that uses a set of independant status
ids. The associated values can than be combined into a visible LED
status. Currently LED_RF_ACTIVE is on iff BTS_STATUS_RF_ACTIVE is set
and BTS_STATUS_RF_MUTE is not set.

Sponsored-by: On-Waves ehf
2013-11-05 15:51:19 +01:00
Jacob Erlbeck 08571b1588 sysmobts: Do a RF mute when Radio Carrier is locked
Currently a Change Administrative State Request is just applied
unconditionally to the object's state object and then acknowledged.

This patch implements the special handling of setting the Radio
Carriers state to LOCK or UNLOCK. This is done by passing the
appropriate mute command to the L1 layer. Always all radio channels
are affected, it is not possible to lock single radio channels.
On success, an ACK is sent back to the bsc with the new state (based
on the state passed in the callback by the L1 layer). If something
went wrong or the firmware doesn't support RF mute, a NACK
(REQ_NOT_GRANTED) is sent instead.

Note that a NACK for such a request hasn't been sent by the BTS to
the BSC yet, so (albeit it's spec conformant to do so) the BSC must
be prepared to handle this correctly.

Ticket: OW#976
Sponsored-by: On-Waves ehf
2013-11-05 15:46:30 +01:00
Jacob Erlbeck 9ef742f5e7 sysmobts: Add L1 support for the new RF mute request
This adds a new function

  l1if_mute_rf(femtol1_hdl, ch_mute[8])

to set the mute state for each radio channel. On completion and iff
l1if_mute_rf() returned 0 the callback

  oml_mo_rf_lock_chg(mo, ch_mute_state[8], success)

is invoked when the response from the superfemto DSP is received.

Ticket: OW#976
Sponsored-by: On-Waves ehf
2013-11-05 15:46:22 +01:00
Jacob Erlbeck f3108fafab sysmobts: Add mappings for MuteRfReq/MuteRfCnf
This add the mappings for SuperFemto_PrimId_MuteRfReq and
SuperFemto_PrimId_MuteRfCnf to the arrays femtobts_sysprim_type,
femtobts_sysprim_names, and femtobts_sysprim_req2conf.

Sponsored-by: On-Waves ehf
2013-11-05 15:39:05 +01:00
Jacob Erlbeck 0133ff3866 sysmobts: Add L1P_T_INVALID to l1prim_type
Currently uninitialized elements of the femtobts_sysprim_type array
are mistaken as L1P_T_REQ (which is accidently the first element and
thus 0).

This patch adds a new element to the enum that has the value 0 to
detect uninitialized elements of the femtobts_sysprim_type array.
Those will then show up in the log as 'SYS Prim XXX is not a
Request!'.

This patch also adds missing definitions of the CalibTbl messages
in the femtobts_sysprim_type mapping so that the requests can still
be identified as such.

Sponsored-by: On-Waves ehf
2013-11-05 15:38:57 +01:00
Holger Hans Peter Freyther f9dd260ee5 pcu: Exit the PCU in case of loss of the sysmobts connection
The PCU is not capable of cleaning up properly. For now simply
exit the PCU in case the sysmobts has exited. This requires
osmo-pcu a30f47613abb7c22a26d534d66e478265a8c2c09 or later.
2013-10-31 15:27:19 +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 6321c72522 rsl/pcu: Do not send a CHAN ACT to the BSC on PCU usage
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-25 19:14:44 +02:00
Holger Hans Peter Freyther e851e13413 lchan: Print the name of the channel already in release request 2013-10-25 16:57:02 +02:00
Holger Hans Peter Freyther d57e67e8da sysmobts: Fix the unit test after the internal band changes 2013-10-10 21:28:35 +02:00
Holger Hans Peter Freyther ac3fc27257 sysmobts: Attempt to fix the compilation for the v1 hardware 2013-10-10 21:12:39 +02:00
Holger Hans Peter Freyther ad142f84b3 misc: Fix resource leak when the ioctl is failing
Fixes: Coverity CID 1040759
2013-10-10 21:07:04 +02:00
Harald Welte b2a8a642d6 sysmobts: Permit local override of transmit power above 23 dBm
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-09 23:05:38 +02:00
Harald Welte 5c0e7b1f2c sysmobts: don't call sysmobts_get_nominal_power() twice
... no need for that
2013-10-09 22:35:46 +02:00
Harald Welte e843f80832 sysmobts: make L1 power configurable
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-09 22:35:27 +02:00
Harald Welte cfa54328e2 sysmobts: Don't use the clock calibration value on external clocks
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-09 16:06:41 +02:00
Harald Welte 50e63fa9e7 sysmobts: Set nominal transmit power depending on sysmoBTS model
This enables the use of up to 5W for each TRX in a sysmoBTS 2050.
2013-10-09 15:38:33 +02:00
Harald Welte 19009f2d7a Do not attempt to initialize L1 with a band unsupported by hardware
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-09 15:38:33 +02:00
Harald Welte de0ca823f1 sysmobts: Read supported bands from EEPROM
...rather than assuming that any v2 hardware supports all bands.
2013-10-09 15:38:32 +02:00
Holger Hans Peter Freyther 6d76c1c701 Merge branch 'shared/libosmo-abis-late-init' 2013-10-06 15:51:56 +02:00
Harald Welte d92774b4ac abis: delay l1if_reset() until OML link is established 2013-10-06 15:50:36 +02:00
Harald Welte 359fb8caf4 abis: Use OML remote (BSC) address if RSL CONNECT contains no IP
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-06 15:50:36 +02:00
Harald Welte b77ae3bc60 Call e1inp_vty_init() to make abis interface accessible from VTY
It might not be particularly useful, but then there's no disadvantage
either...
2013-10-06 15:50:36 +02:00
Harald Welte 6d5dc060ea migrate away from our own abis.c code to libosmoabis
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-06 15:50:36 +02:00
Harald Welte b469e73148 Use GPS as default clock source on sysmoBTS 2050 2013-10-04 19:58:14 +02:00
Harald Welte 33fe4ca97b add sysmobts-util command-line utility to read/write EEPROM parameters 2013-10-04 18:29:54 +02:00
Harald Welte 870f1f1f84 sysmobts_par: add value_string definitions for parameters 2013-10-04 18:29:25 +02:00
Harald Welte 7410bc3020 sysmobts_par: Implement new EEPROM parameters (trx_nr, model_nr, model_flags) 2013-10-04 18:28:46 +02:00
Harald Welte ff41a47c65 sysmobts_par: support for negative parameters
by splitting the rerutn code/status from the actual value, we support
negative values to be stored in the EEPROM
2013-10-04 18:27:16 +02:00
Harald Welte ad89cd978a EEPROM: add model_nr, model_flags and trx_nr to EEPROM 2013-10-04 18:24:34 +02:00
Andreas Eversberg 971a95d259 Remove obsolete osmo-bts-bb code 2013-09-03 17:47:26 +02:00
Holger Hans Peter Freyther ac98b545a8 sysmobts-calib: For gps the sign/difference appears to be different
For the sysmoBTS 2050 this appears to have a different sign. We can't
test this with NWL right now so we will need to see if this is a case
of ping/pong.
2013-07-26 21:24:37 +02:00
Nicolas J. Bouliane ad10f0f533 sysmobts: Set the clock calibration to the value read from the eeprom
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-16 19:13:46 +02: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 91d204e2db eeprom: Check the return value of the fseek in all calls
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-16 18:36:44 +02:00
Holger Hans Peter Freyther f333387748 eeprom: After eeprom_write g_file could point to a closed file
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-16 18:36:44 +02:00
Holger Hans Peter Freyther 95c6eed436 oml: Remove the unused nofh variable from oml_mo_tx_sw_act_rep
The variable was assigned but nothing was done with it, just
remove it for now.

Fixes: Coverity CID 1040758
2013-07-16 18:36:44 +02:00
Holger Hans Peter Freyther 612f387fc9 rsl: Fix the audio handling after the 'alignment' handling fix
The issue got introduced in fcdba6bfac
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-09 18:18:45 +02:00
Holger Hans Peter Freyther ed966f0428 sysmobts: The code allowed a out of bounds access to temp_type_str
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-09 15:46:50 +02:00
Holger Hans Peter Freyther 481f14d87f sysmobts: Cache the eeprom_Cfg_t for reading tx/rx calib data
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-04 17:38:15 +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 eebdfb8e6f sysmobts: Fix a typo that broke the ciphering with A5/0 > 0
Commit 5643130664 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-04 17:37:39 +02:00