aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-06-30WIP: delay l1if_reset() until OML link is establishedlaforge/late_l1ifresetHarald Welte2-3/+10
2013-06-30abis: Use OML remote (BSC) address if RSL CONNECT contains no IPHarald Welte4-7/+25
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-06-30Call 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-06-30migrate away from our own abis.c code to libosmoabisHarald Welte8-496/+177
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-06-30make oml_mo_state_init() a void functionHarald Welte2-2/+2
... so we don't get warnings about not returning anything
2013-06-30Don't send OML STATE CHANGE before OML is connectedHarald Welte3-5/+15
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-26sysmobts.service: Use multi-user.target as target to fix orderingHolger Hans Peter Freyther1-1/+1
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 Freyther12-21/+287
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.service: Reset the firmware after the service exitedHolger Hans Peter Freyther1-2/+2
These should have been ExecStopPost from the beginning. Currently they reset the firmware while the software is starting. Reload the DSP and FPGA firmware.
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
2013-06-22initial import of EEPROM calibration read routinesHarald Welte2-0/+1750
2013-06-20sysmobts: Do not write "trx-calibration-path (null)" in the config fileHolger Hans Peter Freyther1-2/+3
When not specifying a config path, then saving the running config it would end up as "(null)" and then leads to an error like this: <0006> calib_file.c:147 Failed to open '(null)/calib_rxu_850.cfg' for calibration data. Add a NULL check to avoid this issue when writing the config file.
2013-06-20misc: Please ignore the commit. It is done to test a jenkins triggerHolger Hans Peter Freyther1-0/+2
2013-06-20rsl: fix the unaligned memory access0.3.0sysmocom/0.3.0-stableNicolas J. Bouliane1-14/+18
the armv5 can do 32bit/16bit reads only from the aligned address use tlv.h macro to copy data to local variable Signed-off-by: Nicolas J. Bouliane <nicolas.bouliane@nutaq.com>
2013-06-20sysmobts: Fix a crash when the DSP2ARM queue runs fullHolger Hans Peter Freyther1-1/+1
When not reading quick enough from the queue we will get a bogus response which will lead to marking the lchan as broken and to clear the sapi queue. The sapi_queue_dispatch was checking if the queue was empty before calling the callback but not taking into account that it might have been flushed. Stop processing if the queue was empty before calling the callback or if it is empty after the callback. Backtrace: #0 0x4eb1f1cc in raise () from /lib/libc.so.6 #1 0x4eb22f48 in abort () from /lib/libc.so.6 #2 0x4ecc2cb8 in talloc_abort (reason=<optimized out>) at talloc.c:167 #3 0x4ecbc854 in talloc_abort_unknown_value () at talloc.c:180 #4 0x4ecc6bc8 in talloc_chunk_from_ptr (ptr=0x4ec2d494) at talloc.c:192 #5 _talloc_free (ptr=0x4ec2d494) at talloc.c:517 #6 talloc_free (ptr=0x4ec2d494) at talloc.c:990 #7 0x0000f294 in sapi_queue_exeute (lchan=0x402414a0) at oml.c:528 #8 0x0000f2d4 in sapi_queue_send (lchan=0x402414a0) at oml.c:542 #9 0x0000f3e0 in sapi_queue_dispatch (lchan=0x402414a0, status=-4) at oml.c:565 #10 0x000114d0 in lchan_deact_compl_cb (trx=0x4021e038, l1_msg=0x7e690) at oml.c:1269 #11 0x0000d70c in l1if_handle_l1prim (wq=1, fl1h=0x607c8, msg=0x7e690) at l1_if.c:938
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer5-5/+5
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-05-11sysmobts: Allow to enable realtime priority for the BTS processHolger Hans Peter Freyther2-2/+22
The latency to respond to a PH-READY_TO_SEND.ind may not be higher than 18ms. Currently we are using nice to increase our priority but for a heavily loaded cell this is not enough. Add an option to enable realtime scheduling and use it in the screenrc. Linux offers two realtime scheduling classes these are SCHED_FIFO and SCHED_RR. For SCHED_FIFO the process is running as long as possible (potentially taking all the CPU and never yielding it), for SCHED_RR the process can still be pre-empted at the end of the timeslice. Using SCHED_RR appears to be the more safe option as a run-a-way sysmobts process will not be able to take all the CPU time. For a very loaded cell we also require to use readv/writev to allow writing multiple primitives in one syscall.
2013-05-04measurement: Mark the internal functions as internalHolger Hans Peter Freyther2-4/+2
In terms of assembly code this only removes the ".global FN" from the code. GCC does not attempt to inline it right now.
2013-05-01sysmobts: Use msgb_free instead of talloc_free to free the messageHolger Hans Peter Freyther1-2/+2
Currently msgb_free is calling talloc_free but we might introduce a msgb pool in the future. So make sure to use the designated free method for the msgb.
2013-05-01sysmobts: Print the lchan name for the S counter.Holger Hans Peter Freyther1-5/+8
2013-04-30rsl: Add the channel name to the act nack and conn fail messageHolger Hans Peter Freyther1-2/+6
2013-04-18osmo-bts: fix linking order in Makefile.amNicolas J. Bouliane1-1/+1
On some system (e.g. ubuntu) libosmovty must precede libosmocore otherwise we get undefined reference errors while linking. Signed-off-by: Nicolas J. Bouliane <nicolas.bouliane@nutaq.com>
2013-04-07sysmobts.service: Install the sysmobts.service at the default targetHolger Hans Peter Freyther1-0/+3
2013-03-24sysmobts: Document the known MphConfig conflict in the codeHolger Hans Peter Freyther1-0/+2
Right now changing the TxPower through the VTY could conflict with a channel activation.
2013-03-24sysmobts: Do not re-configure the channel on non-active channelsHolger Hans Peter Freyther1-0/+7
In case the channel is not active we can omit the external requests to modify it. For the channel modification the higher level is already acking it and for the ciphering it is probably too late to do anything.
2013-03-24oml: Use the queue for the release handling of a channelHolger Hans Peter Freyther1-67/+212
There are three new commands. There are two markers and a deactivate command. The markers are used to wait until all previous commands are executed and then to decide if the SAPI needs to be released at all. When asked to release the SACCH the marker will be queued, then on execution of the marker the SACCH in Up-/Downlink will be released. For the RF Channel Release we use another marker, when the marker is executed we check all the SAPIs we want to release. It is possible that the queue looks like this: (SACCH_REL_MARKER is done) REL_MARKER, SACCH DEACT, SACCH DEACT This could happen if a BSC sends SACCH Deactivate and RF Channel Release at the same time. We deal with issue by changing the SAPI state to the REL_REQ state and check_sapi_release will not ask for another release. So after the execution the queue will look like this: SACCH DEACT, FACCH DEACT, TCHF DEACT.. This code does not check that all allocated SAPIs are released. The lchan_deactivate_sapis could be changed to go through all sapis_dl and sapis_ul to fix that. The normal flow should now be: 1.) lchan_deactivate 2.) Check if the queue is empty then go to 4 3.) REL_MARKER is executed and lchan_deactivate_sapis is called 4.) For all SAPIs to be released, check if they are allocated and then schedule a CMD_DEACTIVATE. If there is an error remember something went wrong but continue. 5.) Once all commands are executed send the channel release ack. For the release markers we need to be careful as they might not schedule any work. E.g. if the BSC sends two SACCH DEACTIVATE the second marker will not generate any release requests and we should proceed with the next command. Make sapi_queue_command return 1 in case the command has been directly executed. So a queue like SACCH_REL_MARKER, LOGCH will result in LOGCH, SACCH DEACT Rx, SACCH DEACT Tx but a 0 will be returned and the sapi_queue_next will then call sapi_queue_exeute again. NITB has been modified to trigger these corner cases more easily. * Do not send IMM.ASSIGNMENT for some timeslots to go through the error path * Issue multile SACCH deactivates in the normal release mode * Send rsl_chan_mode_modify_req before the SACCH DEACT and also when the RLL is being released.
2013-03-24oml: Print out power setting in txpower completion callbackDaniel Willmann1-5/+18
2013-03-24oml: Use sapi command queue for setting the logical channel paramsDaniel Willmann1-3/+25
2013-03-24oml: Enqueue ciphering message through sapi cmd queue as wellDaniel Willmann1-10/+44
2013-03-24oml: Introduce a SAPI queue for activation and deactivation of SAPIsDaniel Willmann2-31/+163
Put all SAPI requests into a queue and handle them one after another. Begin with the channel activation. Once the queue is empty the channel activate will be sent. For the BCCH activation we do not want to send a channel activation message and this is why we set the lchan->state to NONE. One change is that we do not attempt to call the ciphering routines on the BCCH anymore. This change is necessary to fix issues with LCHANs staying open and being marked as broken by the BSC and will help in implementing handover support as this requires a re-configuration of the lchan on the fly.
2013-03-24measurement: Add debug helper when we have a report for an inactive channelHolger Hans Peter Freyther1-0/+5
2013-03-24sysmobts: Prepare to address the documented limitation of this codeHolger Hans Peter Freyther1-3/+12
2013-03-23oml: Only shut the bts down onceHolger Hans Peter Freyther1-0/+6
If the shutdown timer is already running do not deactivate the RF and do not close the trx. This is addressing another instance of the following warning: [ERROR] : DeviceMng_ValidateL1Handle() => Invalid layer 1 handle
2013-03-18fixup e2cde1f48379657402332b5a95d4ce242d63069aAndreas Eversberg1-1/+1
2013-03-17Add VTY option to define minimum C/I level for RACH and normal burstAndreas Eversberg3-3/+38
2013-03-17Get RSSI from received uplink data and send to PCUAndreas Eversberg4-5/+11
This bumps the PCU API version and thus requires a new version of the code on the sysmoBTS side!
2013-03-16sysmobts: Name the screen and use '-X quit' to shut it downHolger Hans Peter Freyther3-2/+5
Use "kill -2 0" for the PCU as SIGTERM is not handled yet. With the current set of code the stop function will stop both the PCU and the BTS.
2013-03-16respawn: Adjust the oom score for the supervisor and bts/pcu, increase sleepHolger Hans Peter Freyther2-2/+20
Make the script mostly unkillable due to OOM and make sure that the process has a score of zero. Wait 10 seconds before re-launching. The combination of ( && exec ) & appears to save one sub-process. The script has been tested with bash and busybox's ash.
2013-03-15Fix: Stop RADIO LINK TIMEOUT couter S from counting, if it has reached 0Andreas Eversberg2-22/+40
In case that the counter S reached 0, it will stay 0. Subsequent received good and bad SACCH frames must not cause to trigger radio link failure again. Once the BSC has been indicated about link failure, it will release channel. The counting of S has been moved to a seperate function. This patch will ensure that the link failure is indicated only once. But even if the link failure would be sent multiple times, the BSC should ignore it. The BSC releases the channel and may only reuse it after confirm from BTS. (There cannot be any link failure indications after confirm of channel release.) The allowed timeout value range is 4..64, as defined in TS 05.08, so if the BSC sends an attribute with value out of range or other failure criterion, the Set BTS Attributes message is NACKed.