aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
AgeCommit message (Collapse)AuthorFilesLines
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-05-29vty: Print the state of all GPRS OML objects in show btsHolger Hans Peter Freyther1-0/+8
For debugging GB-proxy/IPA issues it is nice to see the state of the OML objects.
2013-05-02channels: Mark channels as broken that time out on activation/releaseHolger Hans Peter Freyther1-4/+27
A channel that fails to send an ACK/NACK/REL within the four second timeout is now marked as broken. In case the release comes in late it will be ignored. The lchan should already been freed and for now we don't want to trust the channel. In the future we might want to send a "release" for a channel that got activated ack late and just set the state to none on a channel that is released acked late. The late ACK and REL has been tested with two manual tests using the fakebts. The channels remained blocked even after having received the ACK message here. The NACK case has not been manually tested.
2013-04-29ipaccess: Remove the ipaccess_gsmnet and assume there is a bsc_gsmnetHolger Hans Peter Freyther1-4/+3
Assume that there is a bsc_gsmnet and modify the ipaccess-config to provide this symbol. If a bsc_gsmmnet is not available when linked the linker will complain and fail. E.g. give an error like this: ../../src/libbsc/libbsc.a(bts_ipaccess_nanobts.o): In function `ipaccess_sign_link_up': src/libbsc/bts_ipaccess_nanobts.c:550: undefined reference to `bsc_gsmnet'
2013-04-29sysmobts: Make the nanoBTS NM code work for the sysmobtsHolger Hans Peter Freyther1-2/+2
Use the is_ipaccess_bts method to check if this is either is nanoBTS or sysmoBTS. The sysmobts type can now be used to bootstrap a bts.
2013-04-29sysmobts: Initialize the NM signal handler only once in a mixed networkHolger Hans Peter Freyther1-1/+2
Make sure that the bts_ipa_nm_sig_cb is only installed once. In a nanoBTS + sysmoBTS network the _start method will be called for each mode leading to the handler being registered twice. Make sure that there is only one handler registered by unregistering a previously installed handler. The osmo_signal_unregister_handler will remove 0 or 1 handlers per invocation and we only add one handler in this file so it is always balanced.
2013-04-29sysmobts: Avoid a crash when trying to look-up a BTSHolger Hans Peter Freyther2-26/+13
The nanoBTS code is trying to find a struct gsm_bts based on the ipaccess_gsmnet and the ipaccess_unit data. The pointer is not initialized in the case of a sysmoBTS leading to a classic NULL pointer dereference. Move the feature init into the _init method. This way we can re-use the start code of the nanoBTS. This ensures that the ipaccess_gsmnet pointer is properly initialized and that the signal handlers are installed.
2013-03-17Add VTY option to set GPRS network-control-order to enable MS measurementsAndreas Eversberg2-0/+24
In order to enable GPRS downlink measurements at mobile, the network-control-order must be set to nc1.
2013-03-12IPA: Allow RSL connection to different IP address as OMLHarald Welte2-1/+31
This patch adds a new VTY command "ip.access rsl-ip A.B.C.D" at the BTS level. If you set this IP address, the BTS will be instructed to establish the RSL link to the indiciated IP address, rather than using the same as for the OML link (default). Use "ip.access rsl-ip 0" to disable the feature.
2013-03-10si: Another round of PCS related fixesHolger Hans Peter Freyther2-4/+21
Inside the SI1 rest_octets we will need to indicate if the ARFCN is band 1800 or 1900. If the BTS is either 850 or 1900 we assume we are running a PCS network, otherwise it is a DCS network. The band indicator is not documented in GSM 04.08 but it is in the GSM 05.14 version 6.1.0 Release 1997.
2013-03-09rsl: Properly initialize the cm structure with memsetHolger Hans Peter Freyther1-1/+1
abis_rsl.c:332:23: warning: 'memset' call operates on objects of type 'struct rsl_ie_chan_mode' while the size is based on a different type 'struct rsl_ie_chan_mode *' [-Wsizeof-pointer-memaccess] memset(cm, 0, sizeof(cm)); ~~ ^~ abis_rsl.c:332:23: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(cm, 0, sizeof(cm)); ^~ 1 warning generated.
2013-03-08bsc_vty: Prevent printing -1 as unsigned integer for timeslot TSCHarald Welte1-1/+2
2013-03-03bsc: Stop "show paging" from crashing before the first pagingHolger Hans Peter Freyther1-0/+3
The paging structure is still initialized lazily and we attempt to traverse it before it is ready. The crash was discovered by Katerina. Removing the lazy initialization will take a bit of work as the gsm_data_shared is used by the osmo-bts and the OpenBSC but paging is different.
2013-03-03vty: Document some previously undocumented parametersHolger Hans Peter Freyther1-2/+2
Katerina pointed out that some nodes are not fully documented and proposed some messages. The token/timeout messages were correct, I have modified the other messages. I removed the full-stop from the PING/PONG documentation as we are normally not using a full sentence.
2013-02-08Fix of IMMIDIATE ASSIGNMENT REJECT messageAndreas Eversberg1-2/+5
The message was corrupt at several points. They are fixed now and successfully tested. A default T3122 timer value of 10 is defined by default now. If set to 0, the reject message will not be sent. Note that when using existing configs with T3122 value set to 0.
2013-02-07add some more docbook snippetsHarald Welte1-0/+9
2013-01-28bsc: Allow to page a BTS that is excluded from the RF lockHolger Hans Peter Freyther1-12/+23
The RF lock excluded BTS was not paged at all. Now forward the paging message to the handler and call a function that will check if this LAC can be paged right now. Introduce a new paging method that allows to page on a dedicated bts, refactor the code to use this method for paging.
2013-01-28bts: Allow to exclude a BTS from the global RF lock handlingHolger Hans Peter Freyther2-3/+52
Some BTS might be in locations where they can run all the time, allow to exclude them from the global lock handling.
2013-01-17si: Deal with DCS1800 and PCS1900 have overlapping ARFCN rangesHolger Hans Peter Freyther1-3/+23
For PCS1900 the SI1 does not contain the ARFCN of the serving cell. This is because the arfcn2band method will return GSM_BAND_1800 and not GSM_BAND_1900. The academic fix would be to set the ARFCN_PCS bit but this would require increasing the bitvector sizes from 1024/8 to (0x8000 + 1024) / 8. This would increase the storage size for each bitvector by three. It is not possible to have DCS1800 and PCS1900 in one network so we can avoid increasing the memory usage and check if the ARFCN resolved to 1800 and then check if the BTS is a 1900 BTS and then claim that this is compatible.
2013-01-17si: Share the ARFCN selection condition between the two statementsHolger Hans Peter Freyther1-30/+37
This makes reading the condition more easy and allows me to fix it for GSM1900 more easily and I can remove one level of indention.
2013-01-16rsl: Properly parse the RLM cause from the error indicationHolger Hans Peter Freyther1-3/+13
The code predates the TLV parser and we were parsing the RLM from the wrong offset. In general we were using the length of the TLV which happened to be equal to the T200 indication. After consulting the RLM cuases not every of them should generate a BSC_RLLR_IND_ERR_IND as these are forwarded to the MSC as a SAPI reject right now. TLV parsing now generates this due a bug in the osmo-bts code: abis_rsl.c:1605 (bts=0,trx=0,ts=2,ss=0) SAPI=0 <0000> abis_rsl.c:1547 (bts=0,trx=0,ts=2,ss=0) ERROR INDICATION cause=Fraeme not implemented
2013-01-15osmo-bsc: Add VTY command show positionDaniel Willmann1-0/+7
2013-01-15bsc: Auto RF Off in case of missing MSC connectionHolger Hans Peter Freyther1-0/+53
For short IP failures we want the RF to stay up and wait for the re-connect but in case the A-link is gone too long it is good to switch off the RF and wait for commands to enable it again.
2013-01-15bsc: Use the BSC RF CTRL to change the RF state of the TRXsHolger Hans Peter Freyther1-3/+7
Use the delayed scheduling feature of the osmo_bsc_rf class to avoid crashing the site controller of the nanoBTS.
2013-01-15bsc: Do not re-start the grace timer when we are in the grace periodHolger Hans Peter Freyther1-0/+5
2013-01-08si: Do not schedule SI1 to SI4 on the second TRXAndreas Eversberg1-3/+5
2013-01-08abis: Fix the verification of BCCH/SDCCH8 on TRX != 0 for the BS11Holger Hans Peter Freyther1-1/+1
The SDCCH8 is only allowed on trx 0 if there is no BCCH/SDCCH4 on it.
2013-01-07audio: Make the BSC handle the new mr_config request of the BSC APIHolger Hans Peter Freyther1-0/+6
Handle the mr_config request and set the AMR multirate config for the given MSC. Initialize the mr_config with the AMR5.9 default we have been using until now.
2013-01-01Stricter limits for T3212 (location update period)Daniel Willmann1-4/+3
libcommon: Default to 30min location update period libbsc: Limit VTY value for periodic update and disallow the value 0 According to GSM 04.08 Table 10.5.33 "The value 0 is used for infinite timeout value i.e. periodic updating shall not be used within the cell." This was the default value until now, but the code that deals with expiring inactive subscribers in the next commit can't handle that case so this remains a TODO for now.
2013-01-01libbsc: Make argument optional in some 'show' commandsSylvain Munaut1-6/+6
The actual command implementation was already for this, but some bad vty parsing prevented optional range arguments from working properly. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-29libbsc: With the new SAPI states we don't need sacch_deact anymoreDaniel Willmann1-1/+0
2012-12-26handover: Fix the handover signalling for IP based BTSesHolger Hans Peter Freyther1-26/+9
This was reported by Kevin when he was testing handover. The problem is the order of the signal handlers for S_ABISIP_CRCX_ACK. Right now the handover signal handler is called before the one inside the libmsc gsm_04_08.c. This means S_HANDOVER_ACK is signalled _before_ there is a rtp socket created for the channel. The result is that the MDCX will never be sent and the called will not be properly switched _after_ the handover detection. I do not want to play with the order of signal handlers, remove the CRCX ack handling from the handover_logic.c and force the NITB (and later the BSC) to check if the lchan is involved with a handover and do the switching in there. This means right now we do what two signal handlers did in one. Reproduced and tested with the FakeBTS Handover test. Log message: <0004> abis_rsl.c:1954 (bts=1,trx=0,ts=3,ss=0) IPAC_CRCX_ACK ... <000c> gsm_04_08.c:1400 no RTP socket for new_lchan <001a> rtp_proxy.c:533 rtp_socket_create(): success <001a> rtp_proxy.c:615 rtp_socket_bind(rs=0x48703c8, IP=0.0.0.0): ...
2012-12-26gsm: Do not attempt to release SAPI=0 if it was never allocatedHolger Hans Peter Freyther2-0/+24
In case of handover (but probably on RACH) we would send a RLL for SAPI=0 even if this SAPI was never established. After we have released all SAPI>0 locally check that SAPI=0 is established and if not release the rf channel directly.
2012-12-26libbsc: Fix DL QUAL decoding from measurement reportsSylvain Munaut1-2/+2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-25gsm_subscriber: change subscr_bsc_active_subscriber to pluralJan Luebbe1-5/+5
This was requested by Holger Freyther <zecke@selfish.org>.
2012-12-23lchan: Introduce T3109 handling for the release procedureHolger Hans Peter Freyther4-18/+54
T3109 is started when the SACCH is deactivated. It is stopped when the phones sends the DISC/UA/UM on LAPDm for the main signalling link. In case of timeout the abnormal release procedure will be initiated. Make sure to not issue the SACCH Deactivate twice to avoid confusing the equipment. This is still not fully spec compliant. In case of a timeout the abnormal release handling will be started which involves starting T3111+2. The error handling should be split out of the rf channel release method, e.g. lchan_release should be called and check if the channel release was already initiated.
2012-12-23lchan: Introduce a BROKEN state for the lchanHolger Hans Peter Freyther1-4/+3
If the CHAN ACTIV is NACKED we set the state backto NONE. This is problematic as our channel allocator will allocate from the front or from the back and if the channel is early in the list it might cause permanent failures. Introduce a BROKEN state and use it when the channel activation is failing for an unknown reason. Copy the cause so it can be inspected later.
2012-12-23lchan: Document the behavior/quirks for abnormal channel releaseHolger Hans Peter Freyther1-5/+29
Deactivate the SACCH and release all SAPIs locally as of GSM 04.08. Add documentation to the code and explain what will happen as part of the release process.
2012-12-23lchan: Release the lchan more quickly, align with GSM 04.08Holger Hans Peter Freyther2-49/+42
* Release all channels with SAPI > 0 with the "local end release" (as of NOTE 1 of GSM 04.08). * No need to wait for all SAPIs to be torn down and the normal REL_IND/REL_CONF will call rsl_handle_release and the channel should be released. * Update the documentation
2012-12-23lchan: Release all higher sapis on the local end.Holger Hans Peter Freyther1-1/+1
According to GSM 04.08 3.4.13.1.1 RR connection release in NOTE 1 one should release all non main signaling links using the local end link release.
2012-12-23rsl: Cosmetic changes to the release codeHolger Hans Peter Freyther1-8/+12
Put the idiom that sets the lchan state to none and respecting the error state into a shared method. This way the special handling for the abnormal case is just in one place.
2012-12-23rsl: Call the release function with the enum name and not the numberHolger Hans Peter Freyther2-11/+11
Done with the semantic patch: @rule1@ expression E; expression F; @@ - lchan_release(E, F, 1); + lchan_release(E, F, RSL_REL_LOCAL_END); @rule2@ expression E; expression F; @@ - lchan_release(E, F, 0); + lchan_release(E, F, RSL_REL_NORMAL);
2012-12-23rsl: Rename the reason to release_mode and use the enum valueHolger Hans Peter Freyther2-5/+6
The API with 0 and 1 as legal values is hard to understand. Use the recently introduced enum values instead.
2012-12-23rsl: Use LOGL_ERROR instead of LOGL_NOTICE act/deact timeoutsHolger Hans Peter Freyther1-2/+2
It is a grave error when the BTS does not respond to the ACT/DEACT requests, use LOGL_ERROR for such conditions.
2012-12-22paging: Do not page when there is no OML linkHolger Hans Peter Freyther1-0/+4
Avoid printing error messages when paging while the BTS is down. In case a BTS is going down it is best to just let the timers expire normally. We can not expire them right away as multiple BTS could be paged and we do not want to interfere with that. There is no need to stop the queue right now.
2012-12-19abis: Activate the newest available installed on the BTSHolger Hans Peter Freyther1-5/+24
Select thew newest software from all available file versions.
2012-12-19abis: Create a routine that can parse all SW Descriptions of a SW ConfigHolger Hans Peter Freyther1-32/+55
Be able to parse the entire SW Config IE. Parse the SW Descruption into a struct provided by the caller.
2012-11-11bts: Really drop the BTS in case of an OML NACKHolger Hans Peter Freyther2-7/+6
The previous code didn't work as expected. The trx and dst pointer are located in an union and in the case of the Abis code the dst is used to point to the signalling link timeslot and not the TRX. The is_ipaccess_bts always returned false because the dst was casted to a trx while it was no trx. This fix was tested with the nack_test/NACKTest.st of the test repo.
2012-10-22si: Partially implement the range encoding for the SI.Holger Hans Peter Freyther3-26/+418
I saw the old copy of the "Appendix J" code too late and I have discovered some quirks and I am more familar with my implementation. Most noticable 'w' only needs to be as big as the input arfcn but requires the 'w' to be initialized. The power_of_2 implementation differs as well (mine matches the output of wirehsark). The f0 could be chosen in a better way but right now picking the lower bound is the easiest. It is not clear if to use modulo if the range is chosen in the middle. This can be improved in the future. Right now I have no bit fiddling for range128, 256 and 1024 as I was running out of time.
2012-10-18libbsc: fix message leaks on several error pathsPablo Neira Ayuso1-5/+9
This patch fixes several leak of msgbs in uncommon error paths. Add break at the end of default to make Holger and Peter happy ;-)