aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-03-04sysmobts: Mute the cell _after_ the MphInit againzecke/lock-on-initHolger Hans Peter Freyther3-7/+36
The MphInit operation will undo the muting. So we need to mute directly after the init again.
2014-03-03sysmobts: Do not generate RF Conn failure for CCCH and PDCHHolger Hans Peter Freyther1-0/+6
This could lead to a BSC attempting to release the BCCH or a PDCH. In the case of the BCCH this lead to a funny crash. Log: <0000> rsl.c:605 (bts=0,trx=0,ts=0,ss=4) Sending Connection Failure: cause = 0x01 <0000> rsl.c:1720 (bts=0,trx=0,ts=0,ss=0) Rx RSL DEACTIVATE_SACCH Backtrace: Program received signal SIGSEGV, Segmentation fault. msgb_dequeue (queue=0x4007d2d8) at msgb.c:102 102 llist_del(lh); (gdb) bt #0 msgb_dequeue (queue=0x4007d2d8) at msgb.c:102 #1 0x4002ed28 in lapd_dl_flush_tx (dl=0x4007d220) at lapd_core.c:173 #2 0x40030cb4 in lapd_dl_reset (dl=0x4007d220) at lapd_core.c:307 #3 0x40030d00 in lapd_dl_exit (dl=0x4007d220) at lapd_core.c:321 #4 0x40033d80 in lapdm_entity_exit (le=<optimized out>) at lapdm.c:169 #5 0x40033d9c in lapdm_channel_exit (lc=0x4007d214) at lapdm.c:180 #6 0x0001a334 in rsl_tx_rf_rel_ack (lchan=0x4007d180) at rsl.c:505 #7 0x0000e908 in lchan_deactivate_sapis (lchan=0x4007d180) at oml.c:1427 #8 sapi_queue_exeute (lchan=0x4007d180) at oml.c:547 #9 0x0000ead0 in sapi_queue_send (lchan=<optimized out>) at oml.c:571 #10 queue_sapi_command (lchan=<optimized out>, cmd=<optimized out>) at oml.c:609 #11 queue_sapi_command (lchan=0x4007d180, cmd=<optimized out>) at oml.c:601 #12 0x0000faf0 in enqueue_rel_marker (lchan=0x4007d180) at oml.c:1440 #13 lchan_deactivate (lchan=0x4007d180) at oml.c:1447 #14 0x0001004c in bts_model_rsl_chan_rel (lchan=<optimized out>) at oml.c:1647 #15 0x0001b948 in rsl_rx_rf_chan_rel (lchan=0x4007d180) at rsl.c:844 #16 rsl_rx_dchan (msg=0x75a88, trx=0x4007b038) at rsl.c:1727 #17 down_rsl (trx=0x4007b038, msg=0x75a88) at rsl.c:1853 #18 0x000154d4 in sign_link_cb (msg=<optimized out>) at abis.c:132 #19 0x400701c0 in ?? () from /usr/lib/libosmoabis.so.2 #20 0x400701c0 in ?? () from /usr/lib/libosmoabis.so.2 Backtrace stopped: previous frame identical to this frame (corrupt stack?) Fixes: OW#1133
2014-02-24pcu: Avoid crash when closing the PCU socketHolger Hans Peter Freyther1-1/+3
When closing the PCU socket all channels will be closed. In that case the LAPDm structures might not have been allocated. Mark the channel as LCHAN_REL_ACT_PCU to avoid going through the RSL code for sending the message. This avoids a crash when "gprs none" is selected but one still configures a PDCH and then connects/disconnects the pcu. #0 llist_del (entry=0x0) at ../include/osmocom/core/linuxlist.h:119 #1 msgb_dequeue (queue=0x400bbc58) at msgb.c:102 #2 0x40110d28 in lapd_dl_flush_tx (dl=0x400bbba0) at lapd_core.c:173 #3 0x40112cb4 in lapd_dl_reset (dl=0x400bbba0) at lapd_core.c:307 #4 0x40112d00 in lapd_dl_exit (dl=0x400bbba0) at lapd_core.c:321 #5 0x40115d80 in lapdm_entity_exit (le=<optimized out>) at lapdm.c:169 #6 0x40115d9c in lapdm_channel_exit (lc=0x400bbb94) at lapdm.c:180 #7 0x0001a334 in rsl_tx_rf_rel_ack (lchan=0x400bbb00) at rsl.c:505 #8 0x0000e908 in lchan_deactivate_sapis (lchan=0x400bbb00) at oml.c:1427 #9 sapi_queue_exeute (lchan=0x400bbb00) at oml.c:547 #10 0x0000ead0 in sapi_queue_send (lchan=<optimized out>) at oml.c:571 #11 queue_sapi_command (lchan=<optimized out>, cmd=<optimized out>) at oml.c:609 #12 queue_sapi_command (lchan=0x400bbb00, cmd=<optimized out>) at oml.c:601 #13 0x0000faf0 in enqueue_rel_marker (lchan=0x400bbb00) at oml.c:1440 #14 lchan_deactivate (lchan=0x400bbb00) at oml.c:1447 #15 0x0001004c in bts_model_rsl_chan_rel (lchan=<optimized out>) at oml.c:1647 #16 0x0001de30 in pcu_sock_close (state=0x62788) at pcu_sock.c:654 #17 0x0001e150 in pcu_sock_read (bfd=0x627a8) at pcu_sock.c:698 #18 pcu_sock_cb (bfd=0x627a8, flags=1) at pcu_sock.c:755
2014-02-24Revert "bts/vty: Use new vty_install_default() function, adjust prompts"Holger Hans Peter Freyther1-4/+35
This reverts commit bbfd21a36cdd10c3b8d83a329042d9ebfb4c5250.
2014-02-24agch: Log error if BS_AG_BLKS_RES is != 1 in SI3Jacob Erlbeck1-0/+6
Currently, the DSP is always configured with u8NbrOfAgch = 1 before SYSINFO type 3 is received. Thus using a different value for BS_AG_BLKS_RES may lead to inconsistencies and MS failing to receive paging messages properly. This patch adds a warning and error logging and should be reverted when initialisation is done in proper order. Sponsored-by: On-Waves ehf
2014-02-22agch/pch: Put CCCH message generation into commonJacob Erlbeck3-13/+28
This patch adds a common function bts_ccch_copy_msg() that provides and schedules AGCH and PCH messages. It is basically a frontend to paging_gen_msg() and bts_agch_dequeue() and contains refactored code from l1_if.c. Sponsored-by: On-Waves ehf
2014-02-22agch: Keep track of AGCH queue lengthJacob Erlbeck2-1/+8
This patch adds and updates btsb->agch_queue_length to keep track of the queue length. Sponsored-by: On-Waves ehf
2014-02-22agch/rsl: Fix msgb handling for IMMEDIATE ASSIGNJacob Erlbeck2-2/+4
Currently, the msg->data pointer is just set to the IMMEDIATE ASSIGN message and the len is adjusted accordingly. Unfortunately, this leaves l2h (pointing to the RSL header) and l3h (pointing to the FULL_IMM_ASS_INFO IE) in an undefined state (outside of [data, tail]). The code in bts.c accesses the message via msg->data. This patch sets l3h and l2h correctly. msgb_l3() will point to the start of the IMM ASS message and should be used instead of msg->data. Sponsored-by: On-Waves ehf
2014-02-22bts/vty: Use new vty_install_default() function, adjust promptsJacob Erlbeck1-35/+4
This patch removes the local 'end' and 'exit' implementations (which aren't used anyway) and uses the generic ones provided by libosmocore instead, which are enabled automatically when vty_install_default() is used. The prompt strings are modified to match those in libosmocore/openbsc. Ticket: OW#952 Sponsored-by: On-Waves ehf
2014-02-20sysmobts: Remove debug left over from the SACCH fixes we madeHolger Hans Peter Freyther1-1/+0
2014-02-19rsl: Do not allow IPA CRCX on non traffic channelsHolger Hans Peter Freyther1-0/+5
Use 0x52 as error cause as the nanoBTS is doing the same under the situation. This has been spotted while testing handover using the VTY command for handover.
2014-02-19rsl/si: Fix resetting bits in bts->si_validJacob Erlbeck1-2/+2
Use 'var &= ~(1 << x)' to reset bits instead of 'var &= (1 << x)'. Sponsored-by: On-Waves ehf
2014-02-04systemd: Disable colors in the stdout logHolger Hans Peter Freyther1-1/+1
For journald we should not output escape sequences as it is confusing the output.
2014-01-28l1fwd-proxy: Bind to the bts VTY port to block another processHolger Hans Peter Freyther1-0/+11
Today we had the problem that multiple l1fwd-proxy instances ran at the same time and not everything working all the time (some packets were sent to a different host). Another approach is to use flock on the message queues. This appears to work fine as well.
2014-01-27sysmobts: Add the requested TA to the field ACCH headerHolger Hans Peter Freyther1-0/+1
Write the requested timing advance into the header. We are currently using the u8AutoTA mode so the value will be overwritten by the DSP before the bursts are sent to the MS.
2014-01-27sysmobts: Correct sending of LAPDm frames on the SACCHHolger Hans Peter Freyther1-4/+7
When a frame is sent on the SACCH the LAPDm code will already prepend two bytes for the tx_power and the ta. In the BTS we want to use the values that were set by the BSC though. They currently come from the RSL CHAN ACT but could also be set through the RSL MS power control command. Update the comment as the space is not empty. At the 30C3 we had a NITB crash because of a RLL timeout on a TCH/F. Jacob analyzed the problem and tracked it down to the mismatch of LAPDm and the l1 interface to the DSP.
2014-01-23bts_model_rsl_chan_act(): Handle tp==NULL case gracefullyHarald Welte1-1/+3
The PCU may call this function without a valid 'tp' (tlv parsed) pointer, we need to make sure we take this into consideration...
2014-01-21sysmoBTS OML: Don't permit TSC != BSICHarald Welte1-1/+32
The sysmoBTS L1 has the TSC as a global value, we cannot have individual per-timestamp or even per-lchan TSC, as the GSM specification would suggest (and other BTSs support). Rather than fail silently, write an error message to the log and return NM_NACK_PARAM_RANGE or RSL_ERR_SERV_OPT_UNIMPL back to the BSC.
2014-01-21common/rsl.c: Allow bts_model_rsl_chan_act() to return negative causeHarald Welte1-1/+6
If the channel couldn't be activated, the function can simply return a negated RSL_ERR_* constant which will then be propagated towards the BSC in an CHAN_ACT_NACK RSL message.
2014-01-21common/oml.c: Send OML NACK if bts_model_check_oml() returns negativeHarald Welte1-6/+4
This way, bts_model_check_oml() can return a negated NM_NACK_* constant which will then be sent as cause value in the corresponding SET_ATTR_NACK back to the BSC.
2014-01-21sysmobts: Specify TRX nominal maximum tx power as fMaxTxPowerHarald Welte1-0/+6
In the MPH ACTIVATE-RF.req, we need to specify the nominal maximum transmit power, i.e. >= what we later request during MPH-INIT.req. This field was first introduced in API version 2.2, but we never used it so far. It may help fixing a bug related to excessive power consumption of the sysmoBTS 2050.
2014-01-21sysmobts: Honor the LDFLAGS when building the sysmobts-calib utilityHolger Hans Peter Freyther1-1/+1
Address warning during system builds. Addresses: WARNING: QA Issue: No GNU_HASH in the elf binary...
2014-01-21sysmobts: Launch the sysmobts-mgr in the screen and add service fileHolger Hans Peter Freyther2-0/+13
Launch the sysmobts-mgr as well. It will monitor the temperature but it will not update the eeprom or act on any of the data. On top of that it will respond to ipaccess-find messages making it more easy to find the device.
2014-01-17sysmobts-mgr: Check the return value of the sendtoHolger Hans Peter Freyther1-1/+5
Fixes: Coverity CID 1157379
2014-01-17sysmobts-mgr: Respond to ipaccess-find broadcast messagesHolger Hans Peter Freyther5-14/+292
Bind to port 3006 and listen to incoming IPA requests. Currently we unconditionally respond with the MAC and IP Address of the unit. To determine the IP Address the kernel is asked for thesource address of the route for the destination. In contrast to a nanoBTS we will reply to the port the initial request came from.
2014-01-17sysmobts-mgr: Parse the daemonize optionHolger Hans Peter Freyther1-1/+5
Parse the daemonize option and daemonize after the full set-up of the code.
2014-01-17sysmobts-mgr: Parse logging related commands, re-order init functionHolger Hans Peter Freyther1-13/+17
2014-01-16sysmobts-mgr: Make it possible to not write to the EEPROMHolger Hans Peter Freyther3-18/+53
For testing/trial it is better to not write to the EEPROM but it is still good to see how the logic is working.
2014-01-15misc: Allow to cross-execute the testsuite using qemuHolger Hans Peter Freyther1-2/+2
When cross-compiling osmo-bts/osmo-pcu one can not easily execute the testsuite. By adding the OSMO_QEMU variable in front of the normal execution we can execute the tests. This should work for native and cross builds. $ OSMO_QEMU="qemu-arm -L /opt/poky/1.1.2/sysroots/armv5te-poky-linux-gnueabi/" make check
2014-01-03sysmobts: Specify the parameters that can be read from the EEPROMHolger Hans Peter Freyther1-0/+8
When using the utility it is not clear which parameters can be read or written. Make that more obvious.
2013-12-29sysmobts: Specify the constant as a float and not a doubleHolger Hans Peter Freyther1-1/+1
2013-12-28tch: Do not log every single RTP packet and air frameHolger Hans Peter Freyther1-9/+0
The sysmoBTS takes quite a bit of CPU time for the vfprintf that is used by osmo_hexdump. Do not dump every single frame to improve the performance a bit.
2013-12-28misc: Avoid using double numbers on our ARMHolger Hans Peter Freyther2-6/+6
In the perf the ARM EABI ddiv operation showed up in the most of expensive symbols. It doesn't really make much sense as the calls should only be done on configuration.
2013-12-28measurement: Speculative performance changeHolger Hans Peter Freyther1-1/+14
Most timeslots do not have eight lchan. Use the subslots_per_lchan map to reduce the number of iterations. Looking at the ARM assembly showed that no loop-unrolling was done so this could be a speed up.
2013-12-20contrib: Remove the stray "FIVE" print it doesn't make any senseHolger Hans Peter Freyther1-1/+0
2013-12-12sysmobts: Fix compiler warning by including utils.hHolger Hans Peter Freyther1-0/+1
calib_file.c: In function 'next_calib_file_idx': calib_file.c:126:3: warning: implicit declaration of function 'band_femto2osmo' [-Wimplicit-function-declaration]
2013-12-12sysmobts: Change the ARRAY_SIZE to a constant numberHolger Hans Peter Freyther1-1/+1
The parameter "uint8_t mute_state[8]" is actually a "uint8_t *mute_state" so the ARRAY_SIZE is not what we think it is. Fixes: Coverity CID 1125885
2013-12-12sysmobts: Fix resource leak in the error conditionHolger Hans Peter Freyther1-0/+1
Fixes: Coverity CID 1047336
2013-12-12sysmobts: Remove stray semicolon from the PCU band filtering code.Holger Hans Peter Freyther1-1/+1
The information from band_mask has never been used as the return was executed unconditionally. Fixes: Coverity CID 1113473
2013-11-27bts: Fix crash of receiving data during the release processHolger Hans Peter Freyther1-2/+13
Release/Free the lapdm resources _after_ the channel has been fully released. Do not forward data unless the lchan is in the active state. Reading this code again, there is probably a memory leak for everytime the PCU will re-connect to the BTS. (gdb) p lchan->state $4 = LCHAN_S_REL_REQ (gdb) bt #0 lapd_dl_flush_hist (dl=0x40454894) at lapd_core.c:164 #1 0x44873b54 in lapd_rx_u (lctx=0xbe9bd5a8, msg=0x92f90) at lapd_core.c:1040 #2 lapd_ph_data_ind (msg=0x92f90, lctx=0xbe9bd5a8) at lapd_core.c:1644 #3 0x44876d50 in l2_ph_data_ind (link_id=<optimized out>, chan_nr=<optimized out>, le=<optimized out>, msg=0x92f90) at lapdm.c:637 #4 lapdm_phsap_up (oph=<optimized out>, le=<optimized out>) at lapdm.c:707 #5 0x0000c504 in handle_ph_data_ind (l1p_msg=0x97358, data_ind=0x97420, fl1=<optimized out>) at l1_if.c:774 #6 l1if_handle_ind (fl1=<optimized out>, msg=0x97358) at l1_if.c:892
2013-11-27sysmobts: Activate the BCCH silently have have state set to activeHolger Hans Peter Freyther3-7/+9
Use the lchan->rel_act_kind field for the BCCH activatiob by OML. The lchan's should be marked as active but no event should be sent to the BSC. This is mostly like the PCU. We can now remove the secnd argument from lchan_activate.
2013-11-27sysmobts: Make the eeprom/nominal power reading backward compatibleHolger Hans Peter Freyther1-3/+3
There are existing deployments where the EEPROM either contains a wrong value and/or the kernel can not be updated to support the different EEPROM of revD. Revert to the old behavior that if no nominal can be derived from the model_nr we assume that it is 23.
2013-11-27sysmobts: Print the model number that is not supported.Holger Hans Peter Freyther1-0/+5
When using an old kernel on revD hardware we will read garabge from the EEPROM and it is nice for debugging to see which model number has been picked.
2013-11-27bts: Fix typos in the log messagesHolger Hans Peter Freyther3-3/+3
2013-11-27bts: Fix a typo in the log messageHolger Hans Peter Freyther1-1/+1
2013-11-14rsl: Rename abis_rsl_sendmsg to avoid symbol clash with libosmo-abisHolger Hans Peter Freyther3-21/+21
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-05sysmobts: Notify the BSC about all muted lchansJacob Erlbeck1-0/+30
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-05sysmobts: Only set RC state to LOCK if all channels are mutedJacob Erlbeck1-2/+8
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-05sysmobts: Use status flags instead of direct LED accessJacob Erlbeck3-3/+36
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-05sysmobts: Do a RF mute when Radio Carrier is lockedJacob Erlbeck3-4/+72
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