Commit Graph

1120 Commits

Author SHA1 Message Date
Neels Hofmeyr 99642656a0 vty: install orphaned trx nominal power command
The cfg_trx_nominal_power_cmd added 12 days ago in
58e4e18206 was floating.
Actually add it to the TRX_NODE.

Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0
2016-06-22 23:33:36 +00:00
Neels Hofmeyr c2874c4360 dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected()
The function would currently only be called in cases where one of the if
branches catches on, but for safety's and clarity's sake, don't ts_connect
using as_pchan if no reconnect is pending.

Change-Id: I52c34065254e902bb80662fc04540901b36cb4c3
2016-06-22 23:31:06 +00:00
Neels Hofmeyr 3f919171ef dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*()
Analogous to 63b296bdd9 on osmo-bts-sysmo.

Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1.
Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in
common/rsl.c.

Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb
to invoke dyn_pdch_connected() in common/rsl.c.

Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4
2016-06-22 23:26:15 +00:00
Neels Hofmeyr a4c6802315 dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F
Analogous to 57fc1124e1 on osmo-bts-sysmo.

Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba
2016-06-22 23:26:07 +00:00
Neels Hofmeyr 0eaa27a6be dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts
Analogous to 294fbe104b on osmo-bts-sysmo.

For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically
upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH.

Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave
ts_connect() as a thin wrapper to leave init code unchanged.

Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5
2016-06-22 23:26:01 +00:00
Neels Hofmeyr 037dcfe981 dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
Analogous to 0d10f0e482 on osmo-bts-sysmo.

According to the PDCH Active flag, handle a TS as TCH/F or PDCH.

Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba
2016-06-22 23:25:54 +00:00
Neels Hofmeyr 380a2e6d90 lc15: add L3 handle to l1prim messages
Analogous to 7158c2ed08 in osmo-bts-sysmo.

Place a layer 3 handle into GSM L1 messages to better match up confirmations to
respective requests. This handle is a uint32_t transparently returned in the
confirmation messages, so a match-up is easy to add.

So far, a GSM L1 confirmation message received for a preceding L1 Request was
matched only by the prim_id. That meant that only one instance of the same
primitive could be waiting for a confirmation at any given time, or the
responses would get mixed up: the struct wait_l1_conf instances entered into
the fl1h->wlc_list queue would be returned to a possibly mismatching
confirmation handler. (Seen during testing of dyn pdch switching.)

Send the hLayer3 handle out via prim_init(), using new static functions to
produce handles on different scopes:

* l1p_handle_for_trx()
* l1p_handle_for_ts()
* l1p_handle_for_lchan()

(These could possibly move to a more general .h/.c file later.)

Remember the hLayer3 handle in

* struct wait_l1_conf.

Match the incoming confirmations' and stored hLayer3 handles up in, and remove
a now obsolete comment from:

* is_prim_compat()

Since the hLayer3 members are at different byte offsets in
GsmL1_Prim_t.u.*, use large switch statements to set/get the value:

* In prim_init(), extend existing switch statement to set in GsmL1_Prim_t.
* Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a
more general .h/.c file later).

Note that some messages are already using the hLayer3 handle, and will
overwrite it after calling prim_init(), so those are not affected.

Change-Id: I17f95ba744c3e944a2241809106506f8dd1b24f0
2016-06-22 23:25:43 +00:00
Neels Hofmeyr ccb1148717 fix lc15 build: put src/common/libbts.a left of -losmogsm
When switching to the gsm_chan_t_names string list from libosmogsm,
libosmogsm actually became a dependency of the local libbts.a.

The breaking change is in openbsc.git 29048b2a80b5865ffc41fa4401113c5826227e23
and came in here because gsm_data_shared.h is included from openbsc.

Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b
2016-06-22 23:25:27 +00:00
Max 724412a49a Clarify logging message
Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644
Related: OS#1648
2016-06-22 23:24:43 +00:00
Max f0d6d6ba02 Use error values instead of number for RSL error
Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149
2016-06-21 17:52:01 +02:00
Max dd084e6e57 Use libosmocodec functions for AMR
Switch to using libosmocodec functions as a preparation step for DTX
support as they expose necessary bits.

Change-Id: Ie7423032fd06779d78876182ee63538d98906328
Related: OS#1750
2016-06-21 17:24:50 +02:00
Max 61372a20de Move copy-pasted code into common part
Related: OS#1750
Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9
2016-06-18 11:35:12 +00:00
Max c3fb0dcc8c DTX: add support for AMR/HR
Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04
Fixes: OS#1562
2016-06-18 11:34:51 +00:00
Neels Hofmeyr 274d29bedd debug log: log TS pchan type on connect
A whitespace error is fixed along the way.

Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 7efc2f3c5b debug log: log lchan state transitions
Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23
2016-06-17 15:50:48 +00:00
Neels Hofmeyr b231e0f6cd error log: two minor clarifications
Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 63b296bdd9 dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*()
Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1.
Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in
common/rsl.c.

Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb
to invoke dyn_pdch_connected() in common/rsl.c.

Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 57fc1124e1 dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F
Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 294fbe104b dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts
For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically
upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH.

Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave
ts_connect() as a thin wrapper to leave init code unchanged.

Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 24a31cfe43 dyn PDCH: implement main dyn PDCH logic in common/
React on IPAC PDCH ACT and DEACT messages and invoke the PCU and bts_model_ts_*
APIs to effect switchover. The dyn PDCH interaction is described in the comment
to rsl_rx_dyn_pdch(), the main entry point for PDCH switchover.

In case the bts_model_ts_* are not implemented (or return other errors),
reply with an IPAC PDCH ACT/DEACT NACK.

Add callbacks that mark steps in the PDCH switchover process,
dyn_pdch_ts_disconnected(), dyn_pdch_ts_connected() and dyn_pdch_complete().

Add hooks in l1sap.c on channel activation and release confirmation, to call
dyn PDCH callbacks.

BTS dyn PDCH implementations should invoke dyn_pdch_ts_disconnected() and
dyn_pdch_ts_connected() when bts_model_ts_disconnect() or
bts_model_ts_connect() are called, respectively. (upcoming for sysmoBTS)

Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab
2016-06-17 15:50:48 +00:00
Neels Hofmeyr 0d10f0e482 dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
According to the PDCH Active flag, handle a TS as TCH/F or PDCH.

Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501
2016-06-17 15:50:47 +00:00
Neels Hofmeyr f8bf95fa6b dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode
Introduce a static function to encapsulate the decision whether a TS is
used for PDCH. Depending on the ts->flags, handle a TCH/F_PDCH TS exactly like
a standard PDCH TS.

Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b
2016-06-17 15:50:47 +00:00
Neels Hofmeyr e6cc04827a dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH
Depending on the PDCH active flag, handle a TCH/F_PDCH like TCH/F or PDCH.

Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5
2016-06-17 15:50:47 +00:00
Neels Hofmeyr 9375aa9a68 dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs
Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used
to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH.

All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT
or DEACT *NACK* to be sent to the BSC as soon as these messages are handled.

Also add stubs in tests.

Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d
2016-06-17 15:50:47 +00:00
Neels Hofmeyr bfc9ff3118 fix two compiler warnings: add two opaque struct declarations
Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025
2016-06-17 15:34:57 +00:00
Neels Hofmeyr 6b60611a4d fix compiler warning: add missing case (PHY_LINK_CONNECTING)
Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39
2016-06-17 15:34:48 +00:00
Neels Hofmeyr bc9c42663d fix compiler warning: printf format for sizeof()
Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175
2016-06-17 15:34:42 +00:00
Max 8a75e60d0c Add .gitreview
Similar to other projects, add helper file for "git review"
command. More information:
https://www.mediawiki.org/wiki/Gerrit/git-review

Change-Id: If3406fafa5778e94ab53e858ddda4a4d55651879
2016-06-17 15:33:01 +00:00
Max ae2a8b75f9 TRX: add configuration example
Related: OS#1648
Change-Id: Icc7d15eceee8ee667fd6a29e758a38668c4946ef
2016-06-17 15:32:28 +00:00
Neels Hofmeyr 3686005180 add missing DSUM entry to bts_log_info_cat
This allows setting the 'sum' log level to debug in osmo-bts.cfg.

Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72
2016-06-17 15:32:03 +00:00
Neels Hofmeyr ea40bd60e7 doc: add ladder diagram on dynamic PDCH, add msc-README
Adjust .gitignore for dyn_pdch.svg and .png.

Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617
2016-06-17 02:46:12 +00:00
Neels Hofmeyr a8168271eb dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH
It is cosmetic since the 'default:' case already caught TCH_F_PDCH, but it's
good to mention all expected pchans explicitly.

Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f
2016-06-17 04:26:20 +02:00
Neels Hofmeyr e951042475 dyn PDCH: rsl rx dchan: also log ip.access message names
Before, only standard ABIS RSL message names were logged, add ip.access
specific ones.

The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN
discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan()
should be able to log ip.access message types properly.

Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f
2016-06-17 04:24:57 +02:00
Neels Hofmeyr 65efa691f8 oml, Set Chan Attr: treat unknown PCHAN types as error
Change-Id: Id79585993df15362ba0e1271d03302597182ceff
2016-06-17 01:31:03 +00:00
Neels Hofmeyr 6ab1ed580d fix typo in error message ('at lEast')
Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f
2016-06-17 01:30:08 +00:00
Neels Hofmeyr 213db32e30 tests/stubs.c: remove unused stubs
Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b
2016-06-17 01:30:00 +00:00
Neels Hofmeyr 703c2d6eb8 pcu_sock: add pcu_connected() to query PCU availability
Will be used in upcoming dyn PDCH switching.

Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a
2016-06-17 01:24:25 +00:00
Max ecd5bc2aef TRX: Add vty command to power on/off transceiver
Add vty command (under "phy X instance Y" hierarchy) to manually send
POWERON or POWEROFF command. It's useful for debugging issues related to
BTS/TRX initialization.

Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4
Related: OS#1648
2016-06-16 13:39:42 +00:00
Max 7cc3c3156e Fix OML activation
Previously software activation could have been reported multiple times
which broke proper BTS init. Introduce guard variable to ensure
reporting happens only once.

Note: this is just minimal workaround - ideally proper OML state machine
should be implemented.

Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af
Related: OS#1648
2016-06-16 12:43:44 +02:00
Minh-Quang Nguyen 58e4e18206 LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration
Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e
2016-06-15 09:45:02 +00:00
Minh-Quang Nguyen cbbce0be09 LC15: Hardware changes:
- Change system devices path
- Remove obsoleted sensors and add new sensors
- Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD)

Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42
2016-06-15 09:44:58 +00:00
Minh-Quang Nguyen d0d2c9217a LC15: Bring back DSP trace argument
Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da
2016-06-15 09:44:51 +00:00
Neels Hofmeyr 7158c2ed08 sysmo: add L3 handle to l1prim messages
Place a layer 3 handle into GSM L1 messages to better match up confirmations to
respective requests. This handle is a uint32_t transparently returned in the
confirmation messages, so a match-up is easy to add.

So far, a GSM L1 confirmation message received for a preceding L1 Request was
matched only by the prim_id. That meant that only one instance of the same
primitive could be waiting for a confirmation at any given time, or the
responses would get mixed up: the struct wait_l1_conf instances entered into
the fl1h->wlc_list queue would be returned to a possibly mismatching
confirmation handler. (Seen during testing of dyn pdch switching.)

Send the hLayer3 handle out via prim_init(), using new static functions to
produce handles on different scopes:

* l1p_handle_for_trx()
* l1p_handle_for_ts()
* l1p_handle_for_lchan()

(These could possibly move to a more general .h/.c file later.)

Remember the hLayer3 handle in

* struct wait_l1_conf.

Match the incoming confirmations' and stored hLayer3 handles up in, and remove
a now obsolete comment from:

* is_prim_compat()

Since the hLayer3 members are at different byte offsets in
GsmL1_Prim_t.u.*, use large switch statements to set/get the value:

* In prim_init(), extend existing switch statement to set in GsmL1_Prim_t.
* Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a
  more general .h/.c file later).

Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b
2016-06-15 09:30:24 +00:00
Holger Hans Peter Freyther a55b166c6c sysmobts: Add the barebox boot state reservation
We are using up to 48 (actually only 8) bytes to manage the boot
state of the device. Add it to the eeprom reservation. It turns out
the current padding was too large (37 + 84 don't end at 120).

Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de
2016-06-15 09:33:23 +02:00
Minh-Quang Nguyen 3f3f34ba52 common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703)
Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d
2016-06-14 21:57:57 +00:00
Minh-Quang Nguyen 495fed9f43 l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6
We have seen that the DSP time to time rejects PTCCH message from BTS due to invalid block number.
As a result, we patched FN2PTCCHBLOCK calculation according TS 45.0002 Table 6.


Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212
2016-06-14 21:57:06 +00:00
Max a10ac248c6 DTXu: mark beginning of speech burst in RTP
Set Marker bit in RTP header to mark the beginning of talkspurt.

Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e
Related: OS#1562
2016-06-14 10:19:13 +00:00
Max 60970056c8 DTXd: store/repeat last SID
Store last SID received over RTP and repeat is if necessary (no new SID
or SPEECH frames) according to codec-specific scheduling rules.

Related: OS#1563
Copy-paster from I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 for LC15.

Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679
2016-06-14 10:18:59 +00:00
Max 8ecadc66ce DTXd: store/repeat last SID
Store last SID received over RTP and repeat is if necessary (no new SID
or SPEECH frames) according to codec-specific scheduling rules.

Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305
Related: OS#1563
2016-06-14 10:18:59 +00:00
Max 9302abe054 Fix debug output
Previously frame number was not saved in case of PRIM_TCH rendering many
debug statements with g_time useless.

Copy-paste from ef30f50d5d.

Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951
2016-06-14 10:18:59 +00:00