Commit Graph

1018 Commits

Author SHA1 Message Date
Philipp Maier e4403464ed octphy: add conditional compilation to support latest octasic header release
With octasics latest release (octsdr-2g-02.07.01-B1351-beta), some struct
members are moved or renamed. This patch adds ifdef-logic and configure
checks to restore compatibilty.

Change-Id: I73287983e8bed8bf64b2ab87e6b810c2c59ea6fd
2017-04-13 19:03:56 +02:00
Philipp Maier 7a21dccec1 octphy: display hint in case of wrongly configured transceiver number
Making use of the multi-trx feature requires to tell osmo-bts that
more than one transceiver are available. Otherwise it will complain
that not enough transceivers are available. This can be quite
confusing, even a correct config file will fail to parse if it
specifies more transcrivers than available.

This patch adds a hint to the error message so that the user knows
that he should check the -t commandline option

Change-Id: Ifbeacd9d43f7c6cd74a1e1b33288e66828fe843f
2017-04-13 19:03:56 +02:00
Philipp Maier d040bf97de octphy: print log message for multi-trx support
Some header file versions support multi-trx and some do not. After
to compiling it is very difficult to find out if the binary is
multi-trx capable por not. This patch adds a log line that should
rule out any doubts.

Change-Id: I257c0a5e7c5ff5df2f0a603d1ede6db5679382e0
2017-04-13 19:03:44 +02:00
Philipp Maier 1fde15c8bd l1sap: improve log output
Print toa and ra value with the "RACH for packet access" log
message.

Change-Id: I3a2dde95947438aa8348a0a9fc8566cbc177aa2d
2017-04-13 19:02:46 +02:00
Philipp Maier 8e7a51d8c3 octphy: add CBCH support
add Support for CBCH channels in osmo-bts-octphy

Change-Id: Ic5c8363b4dd8ba78ab22bd5527c08d1162331540
2017-04-13 19:02:29 +02:00
Philipp Maier 416ee3ec89 octphy: fix usage of wrong define constant
octphy_hw_get_rf_ant_tx_config() uses define constant
cOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_RX_CONFIG_CID instead of
cOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_TX_CONFIG_CID. This commit
replaces exchanges the wrong constant with the correct one.

Change-Id: Ie4de23daf79bb07ca0c0b818eefe350d18d27e4d
2017-04-13 19:02:07 +02:00
Max dafb363533 Handle TXT indication from OsmoPCU
* handle OML message
* handle OsmoPCU version message
* show stored PCU version in 'show bts ..' vty command

Requires OpenBSc with I6710d53115f34634a7b70969cc05fd5c72ff8ab2.

Change-Id: I16e73198501487a5b1076bf83390b85538d5af73
Related: OS#1614, 1615
2017-04-10 06:57:39 +00:00
Harald Welte bbe90fd651 sysmobts: Don't start with 0dBm TRX output power before ramping
In case a system has a high-gain external PA (like a 40dB PA) connected
externally, we cannot simply switch the transceiver to 0 dBm in
trx_init() only to then start the ramping at much lower levels once the
PHJ completes in trx_init_compl_cb().  The result would be a short
0 + 40 dBm spike followed by later ramping.  We want to avoid that
spike, particularly its associated inrush current, so let's bring up the
board with smething very conservative like -50 dBm, and then ramp from
there.

Change-Id: I0ad91fce64f65e0213c9fcfde3390ace519055db
Fixes: SYS#3259
2017-04-06 18:41:01 +02:00
Max e16b593574 vty: reduce code duplication
Use libosmocore's osmo_str2lower() instead of local equivalent.

Change-Id: I7faced2eaf0f6f87f06081235eea9d4c3ba71a7e
2017-03-23 13:08:39 +01:00
Vadim Yanitskiy 957843959d osmo-bts-trx/l1_if.c: use channel combination III for TCH/H
Currently the channel combination II is used for TCH/H, which
allows only one lchan to be allocated. The reason is that it
saves a bit of CPU by disabling UL burst detection on lchan 1.

There is also the channel combination III, which allows to
increase channel capacity, providing two lchans on a single
TCH/H timeslot.

Ideally we should implement some dynamic II <-> III switching
depending on the network load level. But for now this change
replaces the channel combination of TCH/H by III, until dynamic
switching is implemented.

Fixes issue: https://osmocom.org/issues/1795

Change-Id: I8fd4abb42c153fcd26bcfe22a2554b5c2d02d810
2017-03-23 11:35:05 +00:00
Max a80c7024f8 osmo-bts-trx: fix scheduling of broken frames
* DTXu: don't set marker for broken frames
* do not attempt to send 0-length bursts to avoid flood of errors after
  bts startup

Change-Id: Icb536f951386b9abe34c0dacbb203f3db1e41bb3
2017-03-23 10:03:27 +00:00
Max 9dfdf54d30 Check for suitable lchan type when detecting HO
Log error when handover RACH is detected on wrong channel: according to
3GPP TS 44.018 it can only be seen on SACCH and DCCH.

Change-Id: Iacbcc8441d6cfbb8f808948a8baddde1ebca488a
Related: OS#1898
2017-03-14 14:17:44 +00:00
Max 6f5e398ccb Handle ctrl cmd allocation failures
Check that ctrl command was successfully allocated before using it.

Fixes: CID163884
Change-Id: Id19e1ce5fae6f936c9ed93f9a6317b57d28d7311
2017-03-14 08:59:19 +00:00
Max a1b891aab4 Remove code duplication
Use gsm_bts_trx_num() from OpenBSC instead of static function.

Change-Id: Iba80e7a12c85976981a49a9424db069fc4110373
2017-03-07 18:42:27 +01:00
Max 4acc98e68a Use oml-alert CTRL command for temp report
Send temperature reports via OML alert facility exposed by CTRL
protocol.

Change-Id: If29fbd0ab01fefc76e87b90cf1fbc81b2089ba76
Related: OS#1615
2017-02-24 15:03:37 +01:00
Philipp Maier 758522947f octphy: Fix VTY commands
The VTY commands show phy 0 rf-port-stats and show phy 0 clk-sync-stats
do not output their results on the VTY console. If one of those commands
is entered the user is prompted to view the logtext, which is an
uncomfortable solution. This commit adds the missing functionality to
print the information in the VTY as well.

octphy_hw_api.c contains two value_string structs (radio_std_vals and
clocksync_state_vals) which are now exported in octphy_hw_api.h in
order to access them from octphy_vty.c

Change-Id: Iae5aa91fe2ebba7c2874eed88b15ed66e8c9cd61
2017-02-22 10:09:32 +00:00
Ivan Kluchnikov 64d16028eb oml: Fix incorrect usage of const variable abis_nm_att_tlvdef_ipa
This bug was introduced during moving oml definitions from osmo-bts to libosmocore
in libosmocore 0bee65c0d89f81a4b90aa3d484016d9ba680dd46 and
osmo-bts 2cf6b73a4278627331bdbbb4addf1a8bc1d964ce:

The type of abis_nm_att_tlvdef_ipa was changed from struct tlv_definition to
const struct tlv_definition, so:
 * create static abis_nm_att_tlvdef_ipa_local variable for oml attribute
   definitions
 * copy abis_nm_att_tlvdef_ipa to abis_nm_att_tlvdef_ipa_local
 * merge abis_nm_att_tlvdef with abis_nm_att_tlvdef_ipa_local
 * use abis_nm_att_tlvdef_ipa_local in oml_tlv_parse function

Change-Id: Ia9f3c94ab247adeecb26a01c3ccd6f3a8c17ba1c
2017-02-20 13:28:38 +00:00
Ivan Klyuchnikov 70c68853c2 osmo-trx-bts: Fix incorrect bts shutdown procedure in case of clock loss from osmo-trx
This issue occurs in case of osmo-trx restart which leads to losing clock from osmo-trx.
Function bts_shutdown from common/bts.c should be used in this case for proper bts shutdown.

Change-Id: Ie65cf2e8f98cb8bf3314a00048aa53c1f8cd4c25
2017-02-19 08:58:20 +00:00
Harald Welte 6b4c6aa375 sysmobts: fully support trx_power_params
The simplistic approach of sysmobts_get_nominal_power() is insufficient
to cope for devices that have an internal PA.  The Actual transceiver
board is driven to a certain level (0..23 dBm typically), and the
external PA must be handled independent of that.  Increasing the return
value of sysmobts_get_nominal_power() would result in the sysmoBTS
mainboard attempting to reach a higher power, which is wrong.

This change affects sysmoBTS 1020 and 1100.  It causes power-ramping to
be used by default.  For 1002 and 2050, no behavior change is expected.

Change-Id: Ieff75d5becaa80a2097b6e744c75c2d16259c9a4
2017-02-14 17:31:27 +00:00
Ivan Klyuchnikov c4ac69dcc2 osmo-trx-bts: Fix incorrect bts shutdown procedure in case of abis connection closure
This issue occurs in case of osmo-nitb restart which leads to abis connection closure.
Function bts_shutdown from common/bts.c should be used in this case for proper bts shutdown.

Change-Id: Id025e703dd5c91896d450d200e88e46552f178f0
2017-02-14 16:50:11 +00:00
Max b390dfb90d Fix typo in TCH/H interleaving table
According to Table 4 in 3GPP TS 45.003 j=11, b=3 case corresponds to
k=91 and not j=12 as was previously used.

Change-Id: Iad3cf545b2f7e16276466cc37dd7a1e7858467e5
2017-02-10 16:43:44 +01:00
Ivan Klyuchnikov 0418ef588c osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance parameters from config file
pinst->u.osmotrx.hdl should be allocated before reading phy_instance parameters from config file and applying them.
So allocation of pinst->u.osmotrx.hdl should be moved from l1if_open function to bts_model_phy_instance_set_defaults function,
which is proper place for this allocation according to start-up procedure of osmo-bts.

Change-Id: I6e23f92644400acb268818c9373a8fb10c003da1
2017-02-10 13:37:50 +00:00
Ivan Klyuchnikov e2e0ed5a89 osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second channel (TRX1) of osmo-trx
Move rxgain and tx-attenuation (power) parameters from phy_link layer to phy_inst layer.
Rxgain and tx-attenuation parameters should be set for each phy_inst and send for each osmo-trx channel accordingly via control commands.

Change-Id: I4861a59d10d1ef91954e0c6ea265e66dec08844f
2017-02-10 13:35:41 +00:00
Alexander Chemeris d5414cc30e rsl: Output RTP stats before closing the socket.
It's useful to know RTP statistics (number of packets lost, jitter, etc)
when looking at voice call quality issues. Right now this information is
not avialable anywhere and this looks like the best place to start.

Change-Id: Ife9f27c43157b4a1bf71aba41cd7b0f5f41ac99f
2017-02-10 12:23:38 +00:00
Neels Hofmeyr ae50f7dac2 cosmetic: lchan_sacch_get: early-exit instead of nested-if
Change-Id: I1fbf7d7f619cc8194c8094cf4a1826b6114f0e11
2017-02-10 12:18:49 +00:00
Neels Hofmeyr 7a18906cfa all models: fix vty write: bts_model_config_write_phy
The vty write for phy/inst is broken, leading to a written-out config being
unparsable; fix all of these:

- in common/vty.c, actually call bts_model_config_write_phy_inst().

- in sysmo and lc15 write the phy instance elements in
  bts_model_config_write_phy_inst() and not in bts_model_config_write_phy(),
  which lead to writing the members above their parent 'instance'.

- sysmo, lc15 and oct omit the bts_model_config_write_phy_inst()
  implementation. This did not cause a compilation problem because it
  was in fact never called.

- sysmo writes 'clock-source None' when clk_src is zero, leading to unparsable
  config (related: OS#1944). Instead omit the 'clock-source' when zero.

- osmo-bts-trx seems to be the only part that lacks nothing, yet it
  also didn't work properly because bts_model_config_write_phy_inst()
  was never called.
  
This problem existed since commit d784e50747
"Introduce new phy_link and phy_instance abstraction"

Change-Id: Icc54fa70045c8fa58e78cf9f788c21a437edfbd4
2017-02-10 07:27:51 +00:00
Neels Hofmeyr d15dc832c9 SACCH SI: assert that SI enum vals fit in bit mask
In case our SI enums ever move past 31, this static assert will warn us to
enlarge osmo_si_shifted.

Change-Id: I4185d7de590329ff5f523b241721c586ffdbcd8b
2017-02-08 19:34:14 +01:00
Neels Hofmeyr 1631266993 SACCH: fix sending of SI with an enum value > 7
In copy_sacch_si_to_lchan(), the variable to hold the bit mask for SI-is-valid
was chosen as uint8_t, and as a result none of the SIs with an enum value >= 8
would ever be sent. Use int for enum value and uint32_t for the bit mask.

Fixes: #1945
Change-Id: I85fa9a50691601bcd103845c6811caa061a39824
2017-02-08 19:34:06 +01:00
Neels Hofmeyr 3c144069da fix missing ~ in bit logic for lchan->si.valid in rsl_rx_sacch_inf_mod()
Upon rx of a SACCH INFO Modify for an lchan that has no L3 INFO IE, clear only
the si.valid bit in question, instead of clearing all but the one in question.

BTW, It first looked like it could be, but is *not* the cause for OS#1945
(SI5ter never sent to MS).

Change-Id: I0df20b6643b0bfd219ce1df594075838d8406719
2017-02-08 18:00:57 +01:00
Harald Welte df5ac9aa11 tx_power: Change PA calibration tables to use delta vales
It seems more user friendly to look at a calibration table in terms of
the delta (positive or negative) compared to the nominal gain value,
rather than a collection of absolute gain values.  It has the added
benefit that the (API/data model) user doesn't have to specify a gain
value for each ARFCN, but rather can rely on the default nominal gain in
absence of a calibration table for this specific unit.

Change-Id: I7311815902a88d2fc9d211cf4c62fa6fdc5e86ad
2017-02-07 20:17:27 +01:00
Harald Welte 13d0feb404 tx_power: various cosmetic fixes in comments
Change-Id: I542b74d79bc8ffedd7c435b41b042edd5152f61c
2017-02-07 20:17:27 +01:00
Harald Welte 4ba7363286 Revert "sysmobts: Add correct nominal transmit power for sysmoBTS 1020"
This reverts commit 1965b0d880, which was
a premature change.  The 10dB gain are not the power of the TRX board,
but are due to an internal, factory mounted PA, i.e. the
trx_power_params.pa.  This will be introduced after adding a set of
tx_power.c unit tests.

Change-Id: I524b63c51fb0fe1f90ced28486a8e712f2dc50ae
2017-02-07 20:17:26 +01:00
Jean-Francois Dionne eb4a3392e1 Fix SACCH channel release indication not sent to BSC after location update.
Based on GSM 04.08 3.4.13 RR connection release procedure, after the network
sends a deactivate SACCH it receives DISC from MS which cause BTS to
send RLL release indication to BSC in order to stop T3109 timer. It has been
found that after a location update BSC never receives RLL release indication
which causes a T3109 timeout because no TCH is currently allocated. This fix
ensures RLL release indication to be sent to BSC when no TCH is allocated
in the particular case of a location update.

Change-Id: Ibe2a365641eb8c9a7f0a462b7393ec3fd28cc366
2017-02-03 17:18:04 -05:00
Harald Welte 1beb9bcbe0 sysmobts_eeprom.h: Fix/extend model number definitions
Fix the model number definition for the 1020 and add the one for 1002.

Change-Id: Iba4cfbbda1000d7e34eca614b3a6165d2feb65e1
2017-02-02 18:43:29 +01:00
Harald Welte 1965b0d880 sysmobts: Add correct nominal transmit power for sysmoBTS 1020
The sysmoBTS 1020 is a 2W BTS, hence its nominal transmit powre is
33dBm.  We must handle this correctly based on the model-nr in the
EEPROM.   As a result, proper power ramping will be made during start of
the unit by default.

Change-Id: I91a78dadfd7d2e1bc74c8086808c55effdcdd132
2017-02-02 18:41:02 +01:00
Philipp Maier 67bc885c5d octphy: Improve OML ADM state handling
Improve state handling for for lock/unlock of OC_RADIO_CARRIER obj class. in
bts_model_chg_adm_state()

Change-Id: I034114beca95210169429d8ac1eb8648df12fc6c
2017-02-01 19:16:17 +00:00
Jean-Francois Dionne a760a043c4 Fix AMR HR DTX FSM logic.
Fix SID_FIRST_INH detection during speech and when SID_FIRST is interrupted by FACCH.
Fix SID_UPDATE_INH detection during silence and when SID_UPDATE is interrupted by FACCH.
Add a delay for SID_FIRST to appear at the right time after FACCH.
Fix extra byte sent in downlink for SID_FIRST and SID_UPDATE.

Change-Id: Ia811305e15541f2376005df736bd610e8b0d2f69
2017-02-01 19:13:16 +00:00
Minh-Quang Nguyen 16b4179fbe rsl: Fix dropping of LAPDm UA message.
In some cases, when successive mobile originated calls are made, the LAPDm UA
message gets lost because the channel is relased to early. Too overcome the
problem we do not send relase indications immediately. Instead a flag will be
set and the message stored and sent on the next TCH-RTS-IND.

This commit adds the functionality to store the release indication msg, to
rsl.c. It also addes the mechanism to forward the release indication to l1sap.c
See also coresponding change in openbsc.git:
Change-Id I15fc1ef8e9e83f009bde96de9a8e95702cffbce6

This patch is is a slightly improved/reformatted version of:
95d1f15ad1

Change-Id: Ie4f70c75f0137b4bd72d579b3a32575bac2fca38
2017-02-01 16:35:42 +00:00
Jean-Francois Dionne 42ffb325f8 DTX: fix "unexpected burst" error
Fix error during FACCH interruption of DTX for AMR HR.

Max's note: added fix for sysmobts.

Change-Id: Ib064952331b4f89676ee68a3d8078b1d9debe570
Related: OS#1801
2017-02-01 14:25:14 +00:00
Philipp Maier 9344080109 cosmetic: remove stray newline in octphy's l1_oml.c
Change-Id: I6b60e5ee03b9afe6595bf44c4a963d23d03a4eb7
2017-01-31 11:14:49 +00:00
Jean-Francois Dionne 8c45ae59f9 sysmo,lc15: fix memory leak at each call placed
Max's note: added same fix for default case and ported it to sysmobts.

Change-Id: Ife1293e3238cfda16eac9c28e7e81ffe5595e031
2017-01-31 11:06:52 +00:00
Philipp Maier d81e5e963a cosmetic: Remove stray newlines in octphy_vty.c
Change-Id: I33f5c4a3f40c0299a7cdb9c62094f0f914edfc98
2017-01-31 11:02:40 +00:00
Philipp Maier c1d8f5a490 octphy VTY: fix vty write output for octphy's phy section
Fix invalid configuration generated by VTY 'write' command for the 'phy'
section of osmo-bts-octphy.

The problem was introduced during refactoring
commit d784e50747 (Sat Jan 9 13:13:37
2016 +0100, "Introduce new phy_link and phy_instance abstraction")

Change-Id: Ib018e07e332aa8a6144fb2d87889032bd5fc2533
2017-01-31 10:39:25 +00:00
Max f65b57a707 Add ctrl command to send OML alert
Change-Id: I228cb71ab945e19e3747843469a52f577ee32f97
Related: OS#1615
2017-01-25 13:29:03 +01:00
Max 871e0bec7e OML: internalize failure reporting
* make oml_tx_failure_event_rep() static and use osmo_signal_dispatch()
  wrapped into oml_fail_rep() to trigger event reports outside of oml.c
  instead of directly calling into OML layer
* remove unnecessary formatting from text messages

Related: OS#1615
Change-Id: I738555c547926e97b325ab53763c0076c42309bc
2017-01-25 13:24:52 +01:00
Holger Hans Peter Freyther 10b11325a7 build: Do not require more headers from OpenBSC
There should be no other OpenBSC headers included and nobody is using
bsc_controlif_setup. Remove the include. This was introduced in
4723a19508.

Change-Id: I581f938e8fe9161b1d7076cedd74ff192cea86b2
2017-01-24 14:56:44 +01:00
Philipp Maier 2b763cc30c octphy: set tx attenuation via VTY
add code to configure the transmision power via VTY

Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
2017-01-23 12:23:17 +00:00
Philipp Maier c37fd88985 l1sap: fix missing 'else's causing wrong rach frame expiry counts
This bug was introduced in the recently merged
commit 1e399f888e
aka change-id I87f40f5f160a4f6750c4f3d06997fc4f24049303

Fixes: coverity-scan CID#160156 and CID#160155
Change-Id: I88ed1b3e59213acdf97f88eda097b8172b952a5e
2017-01-16 23:38:30 +00:00
Philipp Maier 1e399f888e l1sap: Fix expired rach slot counting
The counting of the expired rach slots in l1sap.c is not correctly
implemented. This commit fixes the implementation. The expired
rach slots are now conted correctly according to the configured
channel combination. If a CCCH and SDCCH are combined, only the
frames related to rach slots are counted.

Change-Id: I87f40f5f160a4f6750c4f3d06997fc4f24049303
2017-01-12 23:36:04 +00:00
Jean-Francois Dionne 0e5b12f981 lc15,sysmobts l1_if: fix memleak in handle_mph_time_ind()
Change-Id: I3061060235a488b114b636b3af9a2253a94de1e8
2017-01-12 11:13:35 +00:00