aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-02-05power: Make it possible to force a power levelsysmocom/0.3.0-doraHolger Hans Peter Freyther1-0/+23
Use the standard RSL commands to order a logical channel to use a fixed power level. The code is not fully verified and there was a last minute change to invoke bts_model_adjst_ms_pwr. Conflicts: tests/stubs.c
2015-02-05power/sysmobts: Add a manual ms power level controlHolger Hans Peter Freyther6-15/+139
Currently the DSP is instructed to achieve a given uplink power target but there are circumstances (e.g. EMV testing) where we need more control over it. The "manual/software/osmo" power control can only be implemented per TRX and not per lchan. Add a very very basic control that checks the MS Power used by the phone, the actual receive level and then adjust the power. The code doesn't take the history into account, if the phone can not reach the requested power level the code will be stuck (e.g. no timeout based on multiframes). It has a mode for a fixed power control but no way to set it yet. The change of the mode requires a restart of the software. Conflicts: include/osmo-bts/bts_model.h src/common/vty.c src/osmo-bts-sysmo/l1_if.c src/osmo-bts-sysmo/l1_if.h src/osmo-bts-sysmo/oml.c tests/sysmobts/sysmobts_test.c
2014-07-25sysmobts: Provide VTY routines to do clock calibrationsHolger Hans Peter Freyther3-2/+150
The sysmoBTS2050 does not have a OCXO and we should not rely on the GPS module to always have a fix. Instead use the TCXO by default and from time to time (and we know we have a fix calibrate the TCXO). This can be done by: trx 0 rf-clock-info reset wait... trx 0 rf-clock-info correct write The output is currently only written to the log as the VTY connection might go away during the operation. The reset will set the approriate reference clock and the correct will attempt to determine and apply the correction. The write terminal will make sure that next on start a known good value will be used.
2014-07-25sysmobts: Free the message on older firmware releasesHolger Hans Peter Freyther1-0/+1
Seen while implementing a new functionality in the code.
2014-07-25sysmobts: Include the model and master/slave in the unitidHolger Hans Peter Freyther1-0/+31
Make it more easy to find the right BTS model and know what is the master/slave.
2014-07-25amr: Avoid toggling the CMR from none and a set oneHolger Hans Peter Freyther2-9/+11
For LCR and other systems without out-of-band information we need to indicate the CMR. Not every air message will include the mode and we sent a stream that had the CMR set and not-set. This lead to the AudioCodes MGW only playing every second frame. Remember the last used mode and initialize it to _NONE when we receive the multirate config. In case of a real error we will still use AMR_CMR_NONE. The initial patch is from Harald. I have added the initialization and moving of the defines to amr.h. Manually verified by enabling AMR5.9 and looking at two RTP packages in sequence. In both cases the CMR was 2. I have looked at "amr.nb.cmr != 2" in wireshark and only found the MGCP dummy packet.
2014-06-22sysmobts: Fix typo in the commentHolger Hans Peter Freyther1-1/+1
2014-05-30sysmobts: Fix the initialization of the BTS manager codeHolger Hans Peter Freyther1-8/+8
The code should only run for the sysmoBTS 2050 and TRX 0. If the device is not marked as 2050 the code would attempt to open /dev/ttyS0 and block forever.
2014-05-25sysmobts: Revert all sysmobts-mgr related changesHolger Hans Peter Freyther9-903/+4
Harald is right and that the code is generally not ready for inclusion. I fell victim of trying to finish it while the code is not ready at all. It is better to re-introduce the patches in a smaller and more tested way. The right way would have been a branch were ready things are split-off the main/wip commit until everything is ready. Revert "sysmobts: Have a common prefix for the enum" This reverts commit 44980347f308fe5bbe48a933dbc81b82b53d310a. Revert "utils: Used the enum manuf_type_id in the parameter of add_manufacturer_id_label" This reverts commit 7d36e5ed46b630203167fc9d5d28e0087fdbd394. Revert "utils: Classify the OML message using the return type" This reverts commit afee0b7929a00500f9c204f3bc7e12f72451e832. Revert "sysmobts: Do not access out of bound string" This reverts commit f5f41e805195c8c3294a9e6a68b10f975fbabbbd. Revert "sysmobts: Separate IPA and OML check into two methods" This reverts commit 13a224063dfcee0be529fba1c8fb9be9c1fb261e. Revert "screenrc: osmobts-mgr now needs a config file" This reverts commit 0a1699ff8a5462c167c24e8b28186abb26331698. Revert "make sure osmobts-mgr.cfg file is included in tarballs" This reverts commit 14c60b425f8146f6a392d2d3de2979c817cd975e. Revert "sysmobts-mgr: Add VTY support for configuring it" This reverts commit c5fedd24c96a4ef6d7a0c0ed3c70d6ef0abd5c17. Revert "sysmobts: Add beginnings of an OML router and create Failure Messages in the sysmobts-manager" This reverts commit c6ab90b27006ff2d1fdfb0b1d7fc01e1dd4a696d.
2014-05-22common: Ignore "si.valid" outside of _MAX_SYSINFO_TYPEHolger Hans Peter Freyther1-1/+1
Limit the range from 0 to (_MAX_SYSINFO_TYPE - 1) instead of 0 to 31. This way we will never access the lchan->si.buf[] out of bounds. This is only a theoretical issue though as the code filling the lchan->si.buf for the SACCH will not have valid >= _MAX_SYSINFO_TYPE. Add a small regression test to check we still schedule all SIs. Fixes: CID 1040765
2014-05-22common: Remove unused gsm_time parameter from lchan_sacch_getHolger Hans Peter Freyther2-2/+2
2014-05-22sysmobts: Avoid memleak when multiple -c arguments are passedHolger Hans Peter Freyther1-1/+1
Rely on optarg pointing to an address that will be valid for the run of the entire application. Fixes: CID 1206578
2014-05-20sysmobts: Have a common prefix for the enumHolger Hans Peter Freyther3-5/+5
Make the manuf_type_id enum have a common prefix for the symbols.
2014-05-20utils: Used the enum manuf_type_id in the parameter of add_manufacturer_id_labelÁlvaro Neira Ayuso2-3/+3
Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-05-20utils: Classify the OML message using the return typeÁlvaro Neira Ayuso2-5/+13
Classify the OML message and return the manufacturer type or an error. Currently ETSI, ip.access and Osmocom are known. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-05-20sysmobts: Do not access out of bound stringÁlvaro Neira Ayuso1-3/+3
One can either use "strlen(str) + 1" but not add one to the result of the sizeof.
2014-05-20sysmobts: Separate IPA and OML check into two methodsÁlvaro Neira Ayuso3-24/+38
I have split the function check_oml_msg, in two functions. One for checking if the ipa header is well-formed and in check_oml_msg, Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-05-19Revert "sysmobts: Add support for changing the transmit power in sbts2050"Harald Welte5-231/+11
This reverts commit c64d42573894d8295b58b268a64541c914b69bcd. There are unfrtunately still too many problems with this patch to be merged at this point.
2014-05-18sysmoBTS TCH: Set CMR in AMR RTP framesHarald Welte1-12/+7
Enable the previously commented-out logic to set the CMR (Codec Mode Request) in AMR RTP frames based on the CMI (CMR Index) of the AMR speech frame on the Um interface. This is of course anyway the right thing to do, but also required for an AMR receiver which doesn't have out-of-band information on the codec mode, and which also doesn't determine the AMR codec mode based on the size of the AMR frame (such as lcr as of current master). We also move the entire CMR generation into the #ifdef section which is only compiled-in if we do _not_ use the RTP mode of L1.
2014-05-18sysmobts: Add support for changing the transmit power in sbts2050Álvaro Neira Ayuso5-11/+231
Make the sysmobts-mgr send a manufacturer O&M message with the power reduction we want the sysmobts to apply. The sysmobts will handle this message and set the new tx output power. An ACK/NACK will be send as a response to the power reduction. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-05-18sysmobts-mgr: Add VTY support for configuring itÁlvaro Neira Ayuso4-3/+342
This patch allows to configure the warning temperature threshold, the severe temperature threshold of the board and the PA and the actions like the relative value power that we want to reduce the transmit power to and the part that we want to switch off or not. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-05-18sysmobts: Add beginnings of an OML router and create Failure Messages in the ↵Álvaro Neira Ayuso8-3/+541
sysmobts-manager Make the sysmobts listen for OML messages on a Unix Domain Socket. Messages passing a sanity check will be forwarded to the BSC. In case the sysmobts-mgr detects a temperature above or below temperature threshold an OML failure message will be sent to the BTS. [moved confinfo into the #ifdef BUILD_SBTS2050] Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-05-17sysmobts: Support DSP API >= 3.8.1 (u8MaxCellSize)Harald Welte1-0/+4
2014-05-15abis: Separate initialization from connect for AbisHolger Hans Peter Freyther2-12/+13
Initialize the libosmo-abis VTY nodes more early so we can parse the config file that was created by "write". Introduce abis_init to initialize the libosmo-abis and modify abis_open to re-use an existing line. Update the comments. This has only been tried with the sysmobts-remote on x86. A TCP connection is opened toward the configured BSC. Fixes: SYS#285
2014-05-15sysmobts: Fix compiler warning about missing declarationÁlvaro Neira Ayuso1-0/+1
Include utils.h to have a declaration of sysmobts_get_nominal_power, l1_if.c: In function 'l1if_activate_rf': l1_if.c:1144:6: warning: implicit declaration of function 'sysmobts_get_nominal_power' [-Wimplicit-function-declaration] Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-04-29osmo-bts-sysmo/utils.c: Added a function for calculate the power transmitterÁlvaro Neira Ayuso3-2/+14
Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-04-19handover: Call the right function and avoid recursionHolger Hans Peter Freyther1-1/+1
Fix a brown paper bag bug and call the right method. The above was an infinite recursion. The stack didn't overflow as the compiler optimized the tail-recursion and coverity didn't complain either. The issue was introduced in the last minutes before the merge when I renamed "reset_handover" to "handover_reset" to follow the object_verb approach throughout the handover.c code. While doing that I sadly replaced reset_handover with handover_frame and not handover_reset.
2014-04-07sysmobts: Add log message in case the channel activation failsHolger Hans Peter Freyther1-0/+3
2014-04-07rsl: Use unique values for the call to rsl_tx_chan_act_nackHolger Hans Peter Freyther1-1/+1
This way we can easily find the place in the code that is responsible for the NACK.
2014-04-03oml: Pass all valid state change requests to the modelJacob Erlbeck1-5/+4
Currently ADM state change request that tries to set the administrative state to the current value are immediately ACK'ed. Beside the caching problem, this could lead the protocol inconsistencies if two such requests are sent one after the other and the second arrives before the procedure of the first has finished. This patch removes the shortcut in oml_rx_chg_adm_state() which immediately called oml_mo_statechg_ack(mo). Ticket: OW#1132 Sponsored-by: On-Waves ehf
2014-03-29sysmobts: Fix build for the v1 of the sysmobtsHolger Hans Peter Freyther1-0/+2
2014-03-27agch/pcu: Fix crash for AGCH commands queued by the PCUHolger Hans Peter Freyther1-1/+2
The dequeue code assumed that msg->l3h is a valid pointer but in the case of the PCU socket it was a null pointer. This lead to memcpy copying a lot more than 23 bytes which ultimately lead to a crash. The issue was introduced in the git commits 37c332e5bfdb9591a1cd3cc6746afffdb1cd13b9 and the commit d290ee029a827c870f97372b98f0dbd7d057402a. use msg->l3h = msgb_put(msg, len) to make sure that there is a valid L3 pointer for the message. (gdb) bt #0 0x419d6384 in memcpy () from /tmp/ow/lib/libc.so.6 #1 0x0001894c in bts_ccch_copy_msg (bts=0x62248, out_buf=0x62248 "p\025\003", gt=0x1, is_ag_res=100684) at bts.c:572 #2 0x0000c958 in handle_ph_readytosend_ind (rts_ind=<optimized out>, fl1=0x62e78) at l1_if.c:515 #3 l1if_handle_ind (fl1=0x62e78, msg=0x8bb08) at l1_if.c:920 #4 0x000147e8 in read_dispatch_one (queue=<optimized out>, msg=0x8bb08, fl1h=<optimized out>) at l1_transp_hw.c:190 #5 l1if_fd_cb (ofd=0x62f04, what=<optimized out>) at l1_transp_hw.c:224 #6 0x41b9d028 in osmo_select_main (polling=<optimized out>) at select.c:158 #7 0x0000b204 in main (argc=<optimized out>, argv=<optimized out>) at main.c:384 (gdb) p *msg $12 = {list = {next = 0x100100, prev = 0x200200}, {dst = 0x0, trx = 0x0}, lchan = 0x0, l1h = 0x0, l2h = 0x0, l3h = 0x0, l4h = 0x0, cb = {0, 0, 0, 0, 0}, data_len = 23, len = 23, head = 0x8572c "-\006?\020\r\340*q\224#", tail = 0x85743 "", data = 0x8572c "-\006?\020\r\340*q\224#", _data = 0x8572c "-\006?\020\r\340*q\224#"}
2014-03-26sysmobts: Apply the potentially new max_power_red on the TRXHolger Hans Peter Freyther1-0/+9
In case the max power reduction has been changed through OML, let us call the l1if_set_txpower routine to update the nominal power. This has been manually verified with both BTS #1 and #57. ./bsc_control.py -d localhost -p 4249 -s bts.0.trx.0.max-power-reduction 0 The above command and GNUradio have been used to determine if the power level has changed at all. Fixes: SYS#268
2014-03-26oml: Indicate the kind of object passed as the void*Holger Hans Peter Freyther2-4/+4
These routines do not pass the gsm_abis_mo and parsing the FOM header of the msg does not seem to be a good idea either. Pass in the OML object so that the model code can determine what the void pointer is.
2014-03-26sysmobts: Honor power reduction on older sysmoBTSv2 hardwareHolger Hans Peter Freyther2-7/+25
Older hardware didn't have the external attentuator that was used to control the wanted output power. So starting from the git commit 3c8ff3c70bc52d0a1d75a1e6b87b0069d92f10f9 older hardware was always transmitting with 23 dBm regardless of the power reduction. Remember the hardware revision returned by the SystemInformation primitive, postpone the call to l1if_activate_rf until we know the board revision. Manually verified on BTS #1 and #57. On BTS#1 the external attenuator has not been configured and on BTS#57 it was.
2014-03-21systemd: Do not restart with a broken config file or suchHolger Hans Peter Freyther1-1/+1
Only restart in case of a crash or the exit(42) when the OML/RSL link is going down.
2014-03-16sysmobts: Add a magic number to the hLayer2 to differentiate itHolger Hans Peter Freyther1-1/+8
The DSP/FPGA appears to report bogus PhDataInd with hlayer2 == 0. Currently this would match the TRX==0,TS==0 and SS=0 and then we report bad measurement reports. Add a magic number to the lower eight bit of the hLayer2 to differentiate valid numbers. Addresses: <0004> measurement.c:97 (bts=0,trx=0,ts=0,ss=0) measurement during state: NONE <0004> measurement.c:102 (bts=0,trx=0,ts=0,ss=0) no space for uplink measurement
2014-03-16sysmobts: Change the order to follow the RX handling codeHolger Hans Peter Freyther1-1/+1
2014-03-16sysmobts: Improve the log message and print the hLayer2 we don't knowHolger Hans Peter Freyther1-1/+3
2014-03-16misc/sysmobts_misc: function for switching off/on and requesting status powerÁlvaro Neira Ayuso2-0/+103
I have extended the principal function that we use for requesting information to the microcontroller for switching off/on the board and the PA. And I have extended it for requesting the power status information of the board and the PA. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-03-12misc/sysmobts_mgr: Added new header created in the configureÁlvaro Neira Ayuso1-0/+1
Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-03-12misc: Fix the build breakage now that we have btsconfig.hHolger Hans Peter Freyther2-0/+4
Include the btsconfig.h for the PACKAGE_VERSION variable.
2014-03-12misc/sysmobts_misc.c: Read temperature from microcontrollerÁlvaro Neira Ayuso3-0/+243
Add function for requesting the temperature information to the microcontroller. I have added a function that we can extend for requesting more information but in this case we only need to know the temperature. I have added to a microcontroller temperature handling function in the manager for monitoring this information. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-03-10agch: Remove obsolete commentJacob Erlbeck1-1/+0
Use of configuration variables has already been implemented here, so the TODO comment is removed. Sponsored-by: On-Waves ehf
2014-03-10sysmobts: Do a RF mute at initialization when the RC is lockedHolger Hans Peter Freyther3-7/+36
Currently a locked cell is actively broadcasting when it is being bootstrapped after the lock. This patch adds an initial update of the RF mute state when the TRX is initialized. Ticket: OW#1131 Sponsored-by: On-Waves ehf
2014-03-10handover,sysmobts: Handle handover in the sysmobts codeHolger Hans Peter Freyther2-2/+77
When the lchan was activated for handover configure it to wait for a RACH burst. On release make sure to always release the RACH SAPI (in case it has been allocated). On the first frame inform handover.c about it and forward the received access burst to the handover layer. Using an E71 it was possible to make a handover for SDCCH and TCH/F from a nanoBTS but also from itself to itself. The vty commands of OpenBSC and the silent-call have been used for that. I didn't verify audio handling so far.
2014-03-10handover,sysmobts: Handle idle needed for preparation of rach handlingHolger Hans Peter Freyther2-0/+4
2014-03-10handover,sysmobts: Refactor the parsing/handling of the access delayHolger Hans Peter Freyther1-5/+10
2014-03-10handover: Add generic handling for handoverAndreas Eversberg2-0/+121
The BTS layer needs to inform the handover code when an access burst has been received. In turn the handover layer will ask the bts to modify the channel, it will schedule the physical information inform the BSC with the HANDOVER DETECTION and waits for the BTS layer to inform it about the first received frame to stop a timer.
2014-03-10handover: Set basic values for handover, remember the activation reasonAndreas Eversberg5-3/+67
Introduce the handover.h/handover.c and initialize handover parameters in OML and remember the activation through RSL.