Commit Graph

2059 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 754e801826 [paging] Simplify the last request and treat llist as a queue
The current code was overly complex. It tried to iterate over
the list in a round robin and we had to keep track of the last
element, see if we remove that one, check if the list becomes
empty... This can all replaced by treating the double linked
list as a queue. We take the item at the front, do something
on it and then and then put it back to the list at the end.
2010-04-10 00:00:15 +02:00
Holger Hans Peter Freyther 19722d4411 paging: Avoid integer underflow on ipaccess
On the nanoBTS we do not receive any load indication for the
paging channel and we just decrement our available slots and
the unsigned int wraps to the maximum value. Together with a
not yet understood bug this makes us go amock.

For the nanoBTS and even the Siemens BS11 resetting the load
to 20 after two seconds should be just fine. For the nanoBTS
we would need to reset the 20 a lot more earlier but we need
to take a look at how often we run low.
2010-04-09 23:59:52 +02:00
Holger Hans Peter Freyther 5615b982c2 [mgcp] Improve the endpoint display on the vty..
Make sure one understands the two values for number of
incoming packets..
2010-04-09 23:53:08 +02:00
Holger Hans Peter Freyther aff596b8e1 [mgcp] Print the IP addr of the BTS we have detected. 2010-04-09 23:53:00 +02:00
Holger Hans Peter Freyther f795164f04 [paging] Start with a smaller paging limit...
The value 20 is just a random number and it really depends
on the number of TRX on a bts to be a sane or insane limit.
2010-04-09 23:20:11 +02:00
Holger Hans Peter Freyther b6c6d43daa [paging] Move code to use LOGP and print some more information 2010-04-09 23:20:11 +02:00
Holger Hans Peter Freyther 82df124c8e [paging] Simplify the last request and treat llist as a queue
The current code was overly complex. It tried to iterate over
the list in a round robin and we had to keep track of the last
element, see if we remove that one, check if the list becomes
empty... This can all replaced by treating the double linked
list as a queue. We take the item at the front, do something
on it and then and then put it back to the list at the end.
2010-04-09 23:20:04 +02:00
Holger Hans Peter Freyther 189587f428 paging: Fix format compiler warning... 2010-04-09 21:31:16 +02:00
Holger Hans Peter Freyther 45ab581f37 [mgcp] Improve the endpoint display on the vty..
Make sure one understands the two values for number of
incoming packets..
2010-04-09 18:53:24 +02:00
Holger Hans Peter Freyther f48776ea6a [mgcp] Print the IP addr of the BTS we have detected. 2010-04-09 18:53:01 +02:00
Holger Hans Peter Freyther 7fc17cff64 nat: Set a dummy bts_ip to avoid misdetection of the bts...
It was possible that the nat detected the core network
gateway as the bts just due being the first to send data
to the port. Fix it by setting a dummy bts_ip to force
the mgcp_network code to compare the in_addr.
2010-04-09 18:51:01 +02:00
Holger Hans Peter Freyther a5a7075fe5 paging: Avoid integer underflow on ipaccess
On the nanoBTS we do not receive any load indication for the
paging channel and we just decrement our available slots and
the unsigned int wraps to the maximum value. Together with a
not yet understood bug this makes us go amock.

For the nanoBTS and even the Siemens BS11 resetting the load
to 20 after two seconds should be just fine. For the nanoBTS
we would need to reset the 20 a lot more earlier but we need
to take a look at how often we run low.
2010-04-09 18:38:06 +02:00
Holger Hans Peter Freyther 2b4e366083 Bump the version to 0.3.94... 2010-04-09 17:18:25 +02:00
Holger Hans Peter Freyther bf1eb64b02 [rsl] Set the right state when asking for the activation.
Set the state to activation to avoid a warning about the
getting a CHAN ACK without waiting for it. We set it in
the code to make sure it is set after all error checking
to avoid inconsistent state as the state is only set back
to NONE/ACT due replies from the BTS.
2010-04-09 15:04:17 +02:00
Holger Hans Peter Freyther f0fbae94ea [rsl] Rework the lchan channel release procedure
1.) free every SAPI from 1-7 and wait for the confirmation
    and then continue until all of them are freed. If the
    SAPI is not torn down we will receive a timeout and then
    we force the RF Channel Release...
2.) once SAPI is down we send the RR Release, SACCH Deact
3.) the abis_rsl will see that all SAPIs are down and then
    will release channel...
2010-04-09 14:30:52 +02:00
Holger Hans Peter Freyther 8fe4df503c [rsl] Remove method that is not called by anything. 2010-04-09 13:06:56 +02:00
Holger Hans Peter Freyther 8da7103070 [rsl] Set the release state from within the lchan class
Currently our GSM04.11 code is closing the link for SAPI=3
and this would mean that the whole channel would be scheduled
for close... where we only want to close everything when freeing
the lchan or handling an error.
2010-04-09 12:44:21 +02:00
Holger Hans Peter Freyther f73f6fad8c [rsl] Introduce a method to set the state of the lchan
Setting the state through a dedicated method allows us to
track the state transitions and check if they are done in
a proper way.
2010-04-09 12:42:37 +02:00
Holger Hans Peter Freyther 25cb84be12 [rsl] Introduce an error state for the lchan and set it on release
When we issue a RF Channel Release in case of a failure we receive
RLL release indications after the channel was tearn down and we
issue another RF Channel Release as a result. The channel allocator
might have already allocated this channel and we release the channel
again with another MS on it.

Make rsl_rf_chan_release take an error argument and make it set
a new state in case of an error and change the RF Channel Release
ack to not set the state back to none in case of an error but wait
for a timeout that is a bit higher than T3111.

I tested this with removing the battery during a phonecall and
waiting for the channel failure. With this test we only send the
release once.
2010-04-09 12:26:32 +02:00
Holger Hans Peter Freyther d9ae25c1bf [rsl] Implement the T3111 timer to delay the RF Channel release 2010-04-09 11:53:35 +02:00
Holger Hans Peter Freyther 5c011366c9 [rsl] Check the assumption that RF Channel Release is sent during release
We assume that the lchan_free will initiate the release and
that when we handle the RLL release indication or the release
request as part of the shutdown sequence.
2010-04-09 11:53:12 +02:00
Holger Hans Peter Freyther 79e2d4230d bsc_msc_ip.c: Fix crash when gsmnet is not yet initialized. 2010-04-09 11:53:12 +02:00
Holger Hans Peter Freyther 8ecd029b12 [rsl] Move rf channel release scheduling to a new method
The current channel release has a couple of issues we will
need to fix in a set of upcoming commits.

The issues include:
    1.) sending release twice
    2.) reassigning the channel inbetween the relase..
2010-04-08 22:39:34 +02:00
Holger Hans Peter Freyther 3c0508e94a [vty] Add ipa specific command to provoke failures to test OML/RSL reconnect
We need to simulate OML/RSL failure in an easy and fast way
and adding a command to do so seems like a good way to achieve
this. The command is a bit misplaced, in one way it is no config
and does not belong into the config node but then again it does
not belong into the VIEW_NODE either as it is manipulating content.
2010-04-08 22:11:29 +02:00
Holger Hans Peter Freyther f535aad612 bssap: Reset the msc_data on the lchan earlier/just in case
The refcount should drop to zero immediately and then the
msc_data would be reset automatically but it is better to
remove all traces of it right away.
2010-04-08 22:11:29 +02:00
Holger Hans Peter Freyther d0ac8866f1 bssap: Use the new method to give up the secondary lchan and related resources 2010-04-08 22:11:24 +02:00
Holger Hans Peter Freyther 73f9a65f12 bssap: Forget the secondary lchan in the MSC data and forget the MSC data
We will handle sending the assignment failure inside the T10
timer but it is better to reset the secondary_lchan inside the
msc_data right away before we might accidently use it.
2010-04-08 21:35:00 +02:00
Holger Hans Peter Freyther b2c55c49a8 bsc_msc_ip: Attempt to handle assignment failures more properly
1.) when we do get a assignment failure from the MS. It is coming
    on the old channel and not the new one. Fix the comparison. Also
    always reset the msc_data to NULL before dropping the reference
2.) the LCHAN signal handler in bssap.c claims that the T10 expire
    cb should free the secondary channel. It currently does not do
    it and we have to do it now...

the whole thing was not tested and even after this commit this
behavior is not heavily excercised... with OsmocoreBB we would be
able to do this in the future.
2010-04-08 21:29:31 +02:00
Holger Hans Peter Freyther 8dc241959c bsc_msc_ip.c: Move from DEBUG to LOG logging
Use the oppurtunity to flag errors as errors in the code
base.
2010-04-08 20:29:36 +02:00
Holger Hans Peter Freyther f99709430a bsc_msc_ip.c: Mention the timestamp config option. 2010-04-08 20:17:12 +02:00
Holger Hans Peter Freyther b9bc45b1b0 bssap: Speculative crash fix when queueing messages for the BTS
It appears to be possible that we attempt to submit a DTAP
on a SCCP connection when we have a channel without the msc_data
assigned. This change should fix the crash (which is not well
understood), fix a memleak in the case of the queue being full.
2010-04-08 20:09:48 +02:00
Holger Hans Peter Freyther 07d838a3bf [paging] Do not use request after it was was destroyed..
Increment the counter before we call the remove request
which is freeing the request...
2010-04-08 17:10:37 +02:00
Holger Hans Peter Freyther 65d10c1320 bsc_msc_ip: Specify the size we can read directly...
data_len is wrong as well as we have reserved... specifying
it directly seems to make valgrind happy. This also means that
we might receive more than one UDP message and do not properly
forward things. I will need to investigate.
2010-04-08 17:07:45 +02:00
Holger Hans Peter Freyther 414ba77f75 [paging] Do not use request after it was was destroyed..
Increment the counter before we call the remove request
which is freeing the request...
2010-04-08 16:48:46 +02:00
Holger Hans Peter Freyther 59f2470650 nat: Handle unknown RLSD by send a RLC back to the network. 2010-04-08 11:28:12 +02:00
Holger Hans Peter Freyther 339dfdb624 nat: Attempt to handle exceptions on the fd and trat them as connection loss 2010-04-08 11:16:43 +02:00
Holger Hans Peter Freyther 9e2e2e04d1 nat: Print the IP address of the connected BSCs 2010-04-08 10:35:20 +02:00
Holger Hans Peter Freyther 2ab6db0153 nat: Rename variable to make it use msc in the name 2010-04-08 10:31:07 +02:00
Holger Hans Peter Freyther 6cb97bdebe nat: Attempt to have a single BSC write method
This method currently prepends the IPA header and sends
the data. In the future we might be able to use SCTP for
it.

We have to remove the IPA header from the static messages
for that to work.

This code is untested.
2010-04-08 10:24:57 +02:00
Holger Hans Peter Freyther 8c3694a282 Bump the version for the BSC. 2010-04-08 10:09:49 +02:00
Holger Hans Peter Freyther 191d23a889 nat: Rename bsc_write to bsc_send_data 2010-04-08 09:20:48 +02:00
Holger Hans Peter Freyther d4e7888ae3 [paging] Increase the time used to send paging messages to the BTS
Send a Paging Request to the BTS every two seconds. This way it is
unlikely that a phone will try to respond to two paging requests as
it is currently happening.
2010-04-07 23:14:36 +02:00
Holger Hans Peter Freyther 6c8c0ddbe2 [ipa] When including MGCP our messages might be bigger than 300 byte
The length field of the IPA header allows to have 16bit numbers
and I just ran into the 300 byte limit with MGCP messages. Make it
three times the size and see how long this is going to be enough.
2010-04-07 23:10:38 +02:00
Holger Hans Peter Freyther 19bab73d79 [rsl] Speculative crash fix in the RSL rcv message
The theory is that the BTS is almost dead and sends out
a incomplete message and we crash with that. I have not
been able to completely verify that.
2010-04-07 23:09:21 +02:00
Holger Hans Peter Freyther c19a65baae Merge branch 'master' into on-waves/mgcp 2010-04-07 23:03:27 +02:00
Holger Hans Peter Freyther 1ea8dbec90 [mgcp] Fix navigation in the vty hierachy (make exit work)
Make exit from the MGCP node work properly.
2010-04-07 23:01:08 +02:00
Holger Hans Peter Freyther 500ff97c21 Fix compiler warning about void return in non void method. 2010-04-07 23:00:23 +02:00
Holger Hans Peter Freyther 441273766a [mgcp] Add the logging commands for the MGCP command. 2010-04-07 22:55:17 +02:00
Holger Hans Peter Freyther 014136da47 Merge branch 'on-waves/sccp' 2010-04-07 22:54:12 +02:00
Holger Hans Peter Freyther 91b5a31a2c Merge branch 'on-waves/mgcp' 2010-04-07 22:54:07 +02:00