Hi guys,
I think some of us would like to move to redmine and start using public tickets more frequently. So in case we move there are some topics to be discussed and I would like to start with a couple of them right now.
Tickets:
Redmine has a global linear sequence of ticket numbers. If we move from many tracs to a single redmine we can either:
* not import tickets
* only import from one project
* deal with changing ticket numbers
In terms of installations the GMR trac is broken in regard to tickets, there are some for SDR that are probably not being fixed anytime soon, baseband might be relevant and OpenBSC is unlikely to be relevant. I don't think we have ever used ticket reference in OpenBSC commit messages so in terms of OpenBSC having changing ticket numbers would not be a big deal. E.g. we could add a custom field with the old trac number?
Wiki:
We have external references that should be redirected to the new place. Is there any way besides maintaining a list in the apache2/nginx configuration and making redirects as we find broken references? Can we proactively manage this? Is anybody willing to come up with a script and nginx configuration for doing this?
kind regards
holger
Hi Tom and List,
we're currently introducing some code that will make more use of
measurement related information associated with the PH-RACH.req and
PH-DATA.ind coming from the PHY up into L2.
The first part is to introduce a reasonable BER limit fo 17% for RACH
ghost elimination, but I have more plans for unifying the measurement
processing/generation accross all supported BTS models.
For osmo-bts-{sysmo,lc15,octphy} it is clear to me how to get the
related information on RSSI, BER and LinkQuality for each of the RACH
and DATA indications from the PHY.
However, how can I get the related information from osmo-bts-trx?
osmo-bts-trx seems to lack any BER reporting toward the common part,
which among other things is the reason why link/rate adaption in the PCU
can not work with it.
Could you sched some light on this?
--
- Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
On Tue, Jun 28, 2016 at 10:05:28AM +0200, Harald Welte wrote:
> [translated from german]
> is it certain that we switch a channel to PDCH only when
> gprs mode != none?
A TS can be GSM_PCHAN_TCH_F_PDCH; those are the only ones for which we
send a PDCH ACT message.
We send a PDCH ACT message
- during init (CHANNEL OML's state changed to enabled -> send PDCH ACT),
- and upon channel release ack when pchan == GSM_PCHAN_TCH_F_PDCH.
So the question is, when we receive a channel release ack, could that be
the PDCH release and we switch PDCH right back on by accident? No, because
we only receive a chan rel ack when the *TCH/F* is being released.
That is because the PDCH release is initiated "internally" from the PDCH
DEACT, and thus this condition in common/rsl.c rsl_tx_rf_rel_ack() catches
on, which existed before dyn PDCH:
if (lchan->rel_act_kind != LCHAN_REL_ACT_RSL) {
LOGP(DRSL, LOGL_NOTICE, "%s not sending REL ACK\n",
gsm_lchan_name(lchan));
return 0;
}
In rsl_rx_rf_chan_rel() the rel_act_kind is set to LCHAN_REL_ACT_RSL, but
not in the rsl_rx_dyn_pdch().
This is analogous to the ip.access way -- the ip.access nanobts replies to
a PDCH DEACT with a PDCH DEACT ACK and doesn't send a separate channel
release ack.
Maybe we could set rel_act_kind to some new LCHAN_REL_ACT_IPAC_DYN_PDCH
for clarity? (But we shouldn't actually send a release ack, to stay
compatible.)
Even though it works as-is, we should indeed add another flag check:
- We do check the flags that no ACT/DEACT is already pending;
- And we do send a PDCH DEACT only if ts->flags & TS_F_PDCH_ACTIVE;
- But we would send a PDCH ACT despite ts->flags & TS_F_PDCH_ACTIVE.
This should never happen, but it would make sense to ensure that.
~Neels
Hi all
I am installing OpenBSC.I just following
http://openbsc.osmocom.org/trac/wiki/Building_OpenBSC
(I am just Building libosmocore, Building libosmo-abis, Building
libosmo-netif, Building OpenBSC and install library.)
But when I tried to run OpenBSC,I encounter with this error(problem).
user12@ubuntu:~$ cd '/home/user12/openbsc/openbsc/src/osmo-nitb'
user12@ubuntu:~/openbsc/openbsc/src/osmo-nitb$ sudo ./osmo-nitb
<0005> bsc_init.c:492 Failed to parse the config file: 'openbsc.cfg'
Or how do I run the software(OpenBSC)!
Or do I have to install something missing?
Note: My Linux is version ubuntu 12.04 .
Please help me.
thank you.
Hi all,
Would somebody who is familiar with the relevant part of the GSM spec be
able to comment?
I'm wondering if there's any issue in GSM running a dual TRX BTS with
two ARFCNs on opposite ends of the band?
For example, in GSM850, this would mean the downlinks could be on 869.2
and 893.8 Mhz so the phone could have to tune across a wider range
between the SDCCH and TCH for example.
Thanks!
On Jun 29, 2016 10:04 PM, "Tom Tsou" <tom(a)tsou.cc> wrote:
>
> On Wed, Jun 29, 2016 at 8:31 AM, Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
wrote:
> Another non-startup error message I found is bad PDTCH and PTCCH and
> blocks under ideal RF signal conditions. It appears that you have seen
> this behavior as well.
>
> DL1C <0006> scheduler_trx.c:835 Received bad data frame at fn=372020
> (12/104) for PTCCH
> DL1C <0006> scheduler_trx.c:918 Received bad PDTCH block ending at
> fn=310516 (76/104) for PDTCH
>
> The cause of these errors with excellent signal is the following piece
> of code where zero-filled buffers are passed to the decoder. I have no
> idea why this is done. Removing the code prevents the bad PDTCH/PTCCH
> blocks with no loss of GPRS functionality.
>
> diff --git a/src/common/scheduler.c b/src/common/scheduler.c
> @@ -1598,10 +1598,6 @@ int trx_sched_ul_burst()
>
> func(l1t, tn, fn, chan, bid, bits, rssi, toa);
> } else if (chan != TRXC_RACH && !l1cs->ho_rach_detect) {
> - sbit_t spare[148];
> -
> - memset(spare, 0, 148);
> - func(l1t, tn, fn, chan, bid, spare, -128, 0);
> }
Each L2 frame consists of several L1 bursts, so you need to accumulate them
all before you can pass them to Viterbi for decoding.
If I remember this part of the code correctly, this zeroing is required to
make this work when there are lost bursts. E.g. if you need 4 bursts, but
you only received bursts 0, 1 and 2 you should let the device know that
your missing burst 3. If you don't do that, decoder won't run at all and to
will miss what could be a decodable frame.
By disabling this code you essentially start decoding only perfect frames,
which are obviously decoded fine in perfect conditions. I.e. this only
makes the actual problem, whatever it is.
Please excuse typos. Written with a touchscreen keyboard.
--
Regards,
Alexander Chemeris
CEO Fairwaves, Inc.
https://fairwaves.co
I notice that apparently osmo-bts-trx is the only caller of the trx_sched_*
API, yet it is implemented in common/scheduler.c and compiled to
libl1sched.a. Is osmo-bts-trx really the only caller?
Also in osmo-bts-trx, the "trx" to me means SDR, like B200.
But any BTS has one or more TRXs. So why isn't it osmo-bts-sdr?
That's why I thought: maybe trx_sched_ is for all BTS models?
Thanks for any clarification / confirmation :)
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Harald Welte
Hi.
I've got following problem while trying to make osmotrx work in multitrx
setting on USRP B210:
sudo chrt 20 ./Transceiver52M/osmo-trx -c 2
sudo chrt 15 ./src/osmo-bts-trx/osmo-bts-trx -t 2 -c
~/.config/osmocom/osmo-bts-mtrx.cfg -d DRTP:DCC:DRSL:DOML:DL1C:DTRX
The bts quits from trx_if.c after checking "if (tcm->critical) {...".
The command sequence seems to be the same for both phy0.0 and phy0.1
However 0.0 one accepts SETTSC command and 0.1 rejects it:
trx_if.c:380 transceiver (phy0.1) rejected TRX command with response:
'RSP SETTSC 1 7'
So far I fail to see where this difference comes from.
Full log:
<0001> oml.c:1249 Initializing OML attribute definitions
<000b> trx_if.c:560 Open transceiver for phy0.0
<000b> trx_if.c:222 Adding new control 'CMD POWEROFF'
<000b> trx_if.c:169 Sending control 'CMD POWEROFF' to phy0.0
<000b> trx_if.c:560 Open transceiver for phy0.1
<000b> trx_if.c:348 Response message: 'RSP POWEROFF 0'
<0001> oml.c:547 Ignoring T200[0] (150 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[1] (180 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[2] (180 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[3] (1680 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[4] (520 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[5] (165 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[6] (1680 ms) as sent by BSC due to
suspected LAPDm bug!
<000b> trx_if.c:222 Adding new control 'CMD POWEROFF'
<000b> trx_if.c:169 Sending control 'CMD POWEROFF' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP POWEROFF 0'
<0001> oml.c:884 ADM state already was Unlocked
<000b> trx_if.c:222 Adding new control 'CMD RXTUNE 1783400'
<000b> trx_if.c:169 Sending control 'CMD RXTUNE 1783400' to phy0.0
<000b> trx_if.c:222 Adding new control 'CMD TXTUNE 1878400'
<000b> trx_if.c:222 Adding new control 'CMD SETTSC 7'
<000b> trx_if.c:222 Adding new control 'CMD POWERON'
<000b> trx_if.c:222 Adding new control 'CMD SETRXGAIN 1'
<000b> trx_if.c:222 Adding new control 'CMD SETPOWER 0'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 0 4'
<0005> paging.c:545 Paging: BS_AG_BLKS_RES = 0 != 1 not fully supported
<000b> trx_if.c:348 Response message: 'RSP RXTUNE 0 1783400'
<000b> trx_if.c:169 Sending control 'CMD TXTUNE 1878400' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP TXTUNE 0 1878400'
<000b> trx_if.c:169 Sending control 'CMD SETTSC 7' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETTSC 0 7'
<000b> trx_if.c:169 Sending control 'CMD POWERON' to phy0.0
<0005> paging.c:545 Paging: BS_AG_BLKS_RES = 0 != 1 not fully supported
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 1 7'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 2 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 3 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 4 13'
<000b> trx_if.c:348 Response message: 'RSP POWERON 0'
<000b> trx_if.c:169 Sending control 'CMD SETRXGAIN 1' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETRXGAIN 0 1'
<000b> trx_if.c:169 Sending control 'CMD SETPOWER 0' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETPOWER 0 0'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 0 4' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 0 4'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 1 7' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 1 7'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 2 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 2 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 3 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 3 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 4 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 4 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 5 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 5 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 5 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 6 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 6 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 6 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 7 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 7 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 7 13'
<0001> oml.c:884 ADM state already was Unlocked
<000b> trx_if.c:222 Adding new control 'CMD RXTUNE 1783800'
<000b> trx_if.c:169 Sending control 'CMD RXTUNE 1783800' to phy0.1
<000b> trx_if.c:222 Adding new control 'CMD TXTUNE 1878800'
<000b> trx_if.c:222 Adding new control 'CMD SETTSC 7'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 0 7'
<000b> trx_if.c:348 Response message: 'RSP RXTUNE 0 1783800'
<000b> trx_if.c:169 Sending control 'CMD TXTUNE 1878800' to phy0.1
<000b> trx_if.c:348 Response message: 'RSP TXTUNE 0 1878800'
<000b> trx_if.c:169 Sending control 'CMD SETTSC 7' to phy0.1
<000b> trx_if.c:348 Response message: 'RSP SETTSC 1 7'
<000b> trx_if.c:380 transceiver (phy0.1) rejected TRX command with
response: 'RSP SETTSC 1 7'
<0001> bts.c:203 Shutting down BTS 0, Reason TRX-CTRL-MSG: CRITICAL
<000b> trx_if.c:222 Adding new control 'CMD POWEROFF'
<000b> trx_if.c:169 Sending control 'CMD POWEROFF' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP POWEROFF 0'
<0001> oml.c:547 Ignoring T200[0] (150 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[1] (180 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[2] (180 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[3] (1680 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[4] (520 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[5] (165 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:547 Ignoring T200[6] (1680 ms) as sent by BSC due to
suspected LAPDm bug!
<0001> oml.c:884 ADM state already was Unlocked
<000b> trx_if.c:222 Adding new control 'CMD POWERON'
<000b> trx_if.c:169 Sending control 'CMD POWERON' to phy0.0
<000b> trx_if.c:222 Adding new control 'CMD SETRXGAIN 1'
<000b> trx_if.c:222 Adding new control 'CMD SETPOWER 0'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 0 4'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 1 7'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 2 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 3 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 4 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 5 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 6 13'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 7 13'
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<000b> trx_if.c:348 Response message: 'RSP POWERON 0'
<000b> trx_if.c:169 Sending control 'CMD SETRXGAIN 1' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETRXGAIN 0 1'
<000b> trx_if.c:169 Sending control 'CMD SETPOWER 0' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETPOWER 0 0'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 0 4' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 0 4'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 1 7' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 1 7'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 2 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 2 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 3 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 3 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 4 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 4 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 5 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 5 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 6 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 6 13'
<000b> trx_if.c:169 Sending control 'CMD SETSLOT 7 13' to phy0.0
<000b> trx_if.c:348 Response message: 'RSP SETSLOT 0 7 13'
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 0 7'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 1 1'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 2 1'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 3 1'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 4 1'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 5 1'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 6 1'
<000b> trx_if.c:222 Adding new control 'CMD SETSLOT 7 1'
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<0001> oml.c:884 ADM state already was Unlocked
<000b> trx_if.c:138 Clock indication: fn=999376
<000b> trx_if.c:470 TX burst tn=0 fn=999396 pwr=0
<000b> trx_if.c:470 TX burst tn=1 fn=999396 pwr=0
<000b> trx_if.c:470 TX burst tn=2 fn=999396 pwr=0
...
--
Max Suraev <msuraev(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
Hi,
when trying to work with multiple BTS as noted in http://umtrx.org/multi-bts-with-osmocom-and-a-single-umtrx/ , I faced a problem related to paging. When I start the BTS, I can send SMS to any connected phone but after a few minutes no SMS is sent and I can’t even make calls. I noticed that the target phone is not being paged anymore. If I restart the openBSC instance the old pending messages get sent sometimes. Also if I run the same code but with only one OSMO-BTS instance, everything works fine.
I would really appreciate some help.
Best regards,
Hi.
While testing I've got iphone (non-jailbroken) which regularly attempts
to send following sms to number 447537410247 (uk?):
REG-REQ?v=3;t=C335D183C5A2FC0E2501543EBCEB8263D55683FB63A2E8CAF98B8874D940263F;r=165209558
without asking user for anything.
Is this some sort of Apple's backdoor? Or GCHQ is so bored that they are
trying to spy on me? :)
Have you guys seen this before?
--
Max Suraev <msuraev(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
Hi.
I've noticed check for device type around
Transceiver52M/UHDDevice.cpp:772 - seems like USRP B200 is not supported
for multitrx configurations:
sudo chrt 20 ./Transceiver52M/osmo-trx -c 2
sudo chrt 15 ./src/osmo-bts-trx/osmo-bts-trx -c
~/.config/osmocom/osmo-bts-trx.cfg -i 192.168.122.1 -t 2
Where does this limitation comes from? Is it just smth which is not
implemented (yet) or it's impossible to implement due to X and Y?
--
Max Suraev <msuraev(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
On Jun 15, 2016 10:38 PM, "Tom Tsou" <tom(a)tsou.cc> wrote:
>
> On Wed, Jun 15, 2016 at 10:08 AM, Max <msuraev(a)sysmocom.de> wrote:
> > I've tried it with manually sending POWERON - the issue with CHAN RQD is
> > gone but the phone still does not work. I'll look into OML/RSL/whatever
> > is preventing it from working.
>
> Make sure that the static variable 'settsc_enabled' is set.
>
> diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
> index a4c16dc..8c9a839 100644
> --- a/src/osmo-bts-trx/trx_if.c
> +++ b/src/osmo-bts-trx/trx_if.c
> @@ -47,7 +47,7 @@
> //#define TOA_RSSI_DEBUG
>
> int transceiver_available = 0;
> -int settsc_enabled = 0;
> +int settsc_enabled = 1;
> int setbsic_enabled = 0;
Could you explain why is that required?
I don't remember the code exactly, but IIRC this is equivalent to setting
or removing 'tsc' line in the config file.
Please excuse typos. Written with a touchscreen keyboard.
--
Regards,
Alexander Chemeris
CEO Fairwaves, Inc.
https://fairwaves.co
Hi Harald,
On Wed, Apr 6, 2016 at 12:59 AM, Harald Welte <laforge(a)gnumonks.org> wrote:
> Can you or somebody else interested in getting this resolved provide a
> full bug report, including
> * debug log output on OsmoNITB side for for the rsl and nm
> * debug log output on OsmoBTS side for oml / transceiver interface or
> anything else related
> * pcap file of A-bis traffic between OsmoBTS and OsmoNITB, as well as
> the control commands between osmo-bts-trx and osmo-trx
Attached are the logs for master branches of OpenBSC, OsmoBTS, and
OsmoTRX leading up to the following RACH access behavior.
<0004> abis_rsl.c:1423 BTS 0 CHAN RQD: no resources for SDCCH 0x2
Hopefully, somebody more familiar than myself with A-bis and related
L1/L2 dependencies can provide some insight on why the above is
happening or where to start debugging. I'll be happy to test any
subsequent changes or look into specific parts of the A-bis code.
-TT
I am a bit ambiguous on our use of comments in gerrit.
We do discuss at least some fairly interesting things in the comments on
patches waiting for approval in gerrit.
When these discussions are attempted on openbsc@ or osmocom-net-gprs@, you
tend to block off and redirect the discussion back to the gerrit comments
infrastructure.
However, we have moved the gerrit mails to a separate and very noisy
mailing list, and these potentially interesting discussions are moved
essentially out of the public focus.
Also, if we in future would like to investigate discussion on some topic,
we need to search both the main ML and the gerrit ML.
IMHO it would make sense to copy the human originated comments to our
"human" mailing lists, so that the automatic jenkins and gerrit
notifications remain on the noisy ML while we see all discussions here.
Is that easy to achieve (filter on originator of comment),
and would you guys agree?
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Harald Welte
Hi.
So far release process for new versions of osmocom components was rather
quiet (unless I'm looking at the wrong place). This is different from
many other open source projects some of which do announcements in ML,
some use blogposts etc. Is there any interest/value in the release
announcements for osmocom projects? Or maybe partially (applications but
not libraries for example)? Or only major but not minor? Or not at all?
To me personally the value is twofold: a) we generate some news which
might be good thing to attract attention of potential contributors (if
we won't overdo it :) and b) it makes it clear when some feature is
"officially shipped" so we have to start paying attention to things like
backward compatibility.
Of course writing such announcements is boring regardless of a medium so
if we follow this road we should automate the process as much as possible.
What do you guys think?
--
Max Suraev <msuraev(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
Today I've taken another close look at branches and gerrit, and have written
down my conclusions here:
http://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit#Submitting-…
In summary:
* Branch re-submission needs the workaround of tweaking the first commit.
It would be nice to fix gerrit to not need this, but for the time being the
effort of cosmetically changing the first commit log is acceptable.
* It *is* possible to have private branches in the gerrit repos and still be
able to submit them to master, with the proper project config.
I have thus switched all our gerrit projects' configs to rebase-if-necessary
with the flags as described on the wiki page.
(Except for osmo-pcap, where we still disallow content merges.)
I will now go back to pushing my "private" developments to the public
repository (gerrit) under the neels/ or sysmocom/ namespaces.
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Harald Welte
I'm testing things related to our gerrit bug report, if it's not working
for you right now it may be because I'm restarting gerrit to test with/out
our fix.
I'll repost when I'm done.
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Harald Welte
Hi.
Repository over git.osmocom.org/osmo-trx is not (yet?) converted to
gerrit. Can I get commit access so I can push (not to master of course)
some branches for review/testing if necessary?
--
Max Suraev <msuraev(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
> Date: Fri, 27 May 2016 18:02:28 +0200
> From: Pierre Baudry <pierre.baudry(a)diateam.net>
> I noticed that since several weeks that osmo-pcu did not work as good as
> previously.
Yes we have also seen similar failures for GPRS calls in the osmo-pcu. Our setup uses NuRAN hardware with osmo-bts-sysmo
> The latest "good" revision I am aware of is commit
> d87e1d6ab747423d3668c74d16201a5d967accf0 (2015/12/14)
This is a useful information for us that the above mentioned commit works for GPRS.
> Can somebody confirm or reproduce this attitude ?
The PCU log that we have during failure matches with the one you have reported.
We have tried a workaround for this GPRS call failure by forcing two-phase-access in osmo-pcu.cfg.
Based on our analysis done till now it seems One phase access of GPRS is broken.
> I will try to provide more logs and a pcap capture as soon as I get
> hands back on the hardware.
It will be quite useful to narrow down the issue, so please share the relevant logs collected
Regards
Saurabh
On Wed, Jun 15, 2016 at 07:11:06PM +0200, Max wrote:
> Repository over git.osmocom.org/osmo-trx is not (yet?) converted to gerrit.
I believe that we could move all repositories to gerrit now.
Are there reasons to keep some of the repositories out of gerrit?
Almost all of my problems with gerrit have been resolved, and the last one is
solved by not pushing private branches to gerrit. Instead, I have my own bare
git clones on our sysmocom-office machine to sync my home and office work. It
would be nice to be able to publicly push private branches again, and indeed I
think the fix for gerrit wouldn't be too difficult, but for now I'm fine.
I would like to switch all projects to 'rebase-if-necessary', but first want to
verify the differences to the cherry-pick strategy. IIRC cherry-pick is no good
for commits that depend on each other, but only 80% sure about that...
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Harald Welte
Hi.
While running osmo-trx with B200 I've noticed following log messages
repeated multiple times:
1) WARNING 3011271488 16:59:00.1 Transceiver.cpp:674:pullRadioVector:
Clipping detected on received RACH or Normal Burst
2) ERR 3011304256 16:58:12.9 UHDDevice.cpp:1512:write: Skipping buffer
data: timestamp=210353475 time_end=202360063
How bad is that: are those break everything completely or can be
sometimes ignored? What could be causing it and what can be done to try
to fix it (hw/sw)?
Note, I run it as follows:
sudo chrt 20 ./Transceiver52M/osmo-trx
--
Max Suraev <msuraev(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte
Hi all
I am installing OpenBSC.I just following
http://openbsc.osmocom.org/trac/wiki/Building_OpenBSC
(I am just Building libosmocore, Building libosmo-abis, Building
libosmo-netif, Building OpenBSC and install library.)
But when I tried to run OpenBSC,I encounter with this error(problem).
user12@ubuntu:~$ cd '/home/user12/openbsc/openbsc/src/osmo-nitb'
user12@ubuntu:~/openbsc/openbsc/src/osmo-nitb$ sudo ./osmo-nitb
<0005> bsc_init.c:492 Failed to parse the config file: 'openbsc.cfg'
Or how do I run the software(OpenBSC)!
Or do I have to install something missing?
Note: My Linux is version 12.04 .
Please help me.
thank you.
Hello,
I am trying to generate ephemeris data (that I get from a ublox receiver)
in RRLP format. I have came across the following discussing n openbsc
mailing list.
http://openbsc.osmocom.narkive.com/8rLcJRc2/rrlp-ephemeris-data#post9
at the end of the discussion, Dieter Spaar wrote that he found a bug fix
for a problem.
Can you please guide me about where to look for this feature in the git
repository?
In the discussion, Slyvian has attached a project but I am not sure whether
this bug fix is there or not
I am planning to buy/manufacture the board that Slyvian has designed for
ublox lea 6 and try producing assisted gps data in rrlp format
http://openbsc.osmocom.org/trac/wiki/osmo-lea6t-gps
Thanks a lot for your help
rifo
Hi,
as a part of my master thesis I am currently trying to complete the
implementation of the virtual physical layer in the laforge/virt-bts
branch in osmo-bts.git.
I already set up the projects and analyzed/debugged some of the code.
Now I have a few things to ask or be confirmed by the pros :).
1. The sent messages on the virtual physical layer will be wrapped
in a GSM_TAP header. I would like to analyze and implement the Uplink
(MS->BTS) on the BTS side first, by sending dummy messages a small
program and then processing them in the BTS. Unfortunately I don't
have these dummy messages. Can anyone of you provide me with some
examples for the msgs coming from the MS side (Access Burst on RACH,
Uplink Burst on TCH, RSSI on SACCH, Location Update Request on SDCCH,
Authentication Response on SDCCH) or tell me how else I can get my
fingers on them?
2. Did I correctly understand that the virt_um_rcv_cb() method in
l1_id.c will unwrap incoming GSM_TAP messages and distribute/forward
them to layer2? Is the correct l2 interface to use l1sap.c from the
common part? E.g. l1sap_ph_rach_ind(..) for incoming RACH msg from MS.
3. Does any logic to unwrap and forward GSM_TAP messages already
exist or was that solely used for logging via wireshark by now.
4. I added some comments to the code, mostly to document my own
unterstandings. But as I am no expert yet, they might contain some
logical errors. Can I keep these in the code when commiting or better
remove them?
5. Should I create a new branch for my work (e.g. stumpf/virt_phy) or
commit to the existing?
Not so important Questions:
6. I had a compilation error caused by 2 missing methods in the
main.c.I added empty method bodies for
bts_model_phy_link_set_defaults(..) and
bts_model_phy_instance_set_defaults(..) and everything seems okay so
far. Can I do that or did I miss something here?
7. To check if I receive incoming messages from the registered
virtual UM multicast socket I periodically wrote a dummy text to it
with a small program. As the registered callback method
virt_um_rcvcb(..) wasn't called I checked the initialization of the
multicast socket (virtual_um.c->virt_um_init(..)). After some research
it seems that mcast sockets do not support a call of connect() after a
bind(). Removing the call that connects the socket to the multicast
group and port, seems to work. Is that okay or are there any problems
I could run into by not connecting to the mcast socket? I think
connect() is usally used on tcp sockets.
Thank you very much in advance for your answers!
Kind Regards,
Sebastian Stumpf
Hi,
in some tutorials fn-advance value is set to 20 and in some other tutorials it is set to 30. What is better to choose and does it really affect the performance of the BTS.
Best regards,
It seems that http://jenkins.osmocom.org/jenkins/job/OpenBSC-gerrit/186/ is stuck:
Configuration OpenBSC-gerrit ? --disable-mgcp-transcoding,--enable-smpp,linux_amd64_ubuntu_1504 is still in the queue: Ubuntu-1504-64 is offline
and http://jenkins.osmocom.org/jenkins/computer/Ubuntu-1504-64/log :
ERROR: [06/06/16 15:46:34] [SSH] Error deleting file.
java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:205)
at hudson.plugins.sshslaves.SSHLauncher.afterDisconnect(SSHLauncher.java:1279)
at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:618)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[06/06/16 15:46:34] [SSH] Connection closed.
ERROR: [06/06/16 15:46:34] [SSH] Error deleting file.
java.lang.IllegalStateException: Cannot open session, you need to establish a connection first.
at com.trilead.ssh2.Connection.openSession(Connection.java:1124)
at com.trilead.ssh2.Connection.exec(Connection.java:1551)
at hudson.plugins.sshslaves.SSHLauncher$3.run(SSHLauncher.java:1259)
[06/06/16 15:46:34] [SSH] Opening SSH connection to 127.0.6.1:2222.
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Harald Welte
Hello,
I am trying to generate ephemeris data (that I get from a ublox receiver)
in RRLP format. I have came across the following discussing n openbsc
mailing list.
<goog_1065096623>
http://openbsc.osmocom.narkive.com/8rLcJRc2/rrlp-ephemeris-data#post9
at the end of the discussion, Dieter Spaar wrote that he found a bug fix
for a problem.
Can you please guide me about where to look for this feature in the git
repository?
In the discussion, Slyvian has attached a project but I am not sure whether
this bug fix is there or not
Thanks a lot
rifo
On Jun 1, 2016 9:37 PM, "Holger Freyther" <holger(a)freyther.de> wrote:
>
>
> > On 01 Jun 2016, at 17:18, Max <msuraev(a)sysmocom.de> wrote:
> >
> > Hi.
> >
>
> > Right now in osmobts when sending/receiving frames with osmo_rtp_* it's
> > assumed that no frame is lost and timestamp is always advanced in 160ms
> > steps. In practice (especially when DTX is in place) frames do get lost
> > so we have to adjust the step to compensate.
> >
>
>
> > However the result sound not much better than using hardcoded value
> > which suggest that I might be doing FN -> ms conversion (or smth else)
> > wrong. Any ideas/advices?
>
> Don't do it. I don't find the relevant spec within the time frame I had
but I think I recently saw a piece of documentation that SQN (and
timestamp) should only be incremented if data is being sent.
>
> Either in the RTP RFC, RTP AMR RFC or the A over IP spec.. I think I saw
it while going through the documents Harald had pointed while I introduced
my ideas for the SIP connector.
>
It's in the RTP RFC.
Sequence number is incremented by 1 with every packet, even if the packet
is sent after a long pause (due to DTX). This way you know when you miss a
packet.
Timestamp is measured in samples and this is incremented by a number of
samples since the last packet. This way you know when to start playing the
packet in case of DTX.
A proper RTP library or rather a jitter buffer should handle this
automatically, but I'm not sure how does ortp handle it.
Please excuse typos. Written with a touchscreen keyboard.
--
Regards,
Alexander Chemeris
CEO Fairwaves, Inc.
https://fairwaves.co
Dear 3G folks,
this is to draw your attention to the new --enable-iu flag added to openbsc's
./configure on the sysmocom/iups branch (and awaiting approval on gerrit right
now https://gerrit.osmocom.org/189 ).
So if you update your sysmocom/iups branch and want to re-build for 3G, you now
have to pass --enable-iu to ./configure, or no Iu* interface support will
actually be built. (This means we can omit libasn1c etc. for a 2G build.)
* We should probably add --enable-iu to the jenkins build soon -- either to
always include it, or if we have the build time, as another matrix multiplier,
I mean build once with --enable-iu and once without.
It would make sense to add --enable-iu to jenkins before I go on to submit any
more IuPS branch commits for review.
* But we should merge the 3G branches in the other repositories to their
masters before adding --enable-iu to the jenkins build:
asn1c.git aper-prefix
libosmo-sccp.git sysmocom/iu
libosmo-sigtran.git sysmocom/sctp
Any help there would be appreciated.
* To be able to add --enable-iu to jenkins, we need to add asn1c,
libasn1c, libosmo-sigtran and osmo-iuh to the build.
I will have my attention directed mostly to other tasks, but I hope we can get
these things done along the way.
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Harald Welte
Hi,
we have the first round of contributions through Gerrit and maybe now is a good time to look at the mail setup. My goal was to:
* Have diff's/patches be sent to the MailingList to see what is going on
* Have comments be sent to the MailingList to have people learn from feedback
In terms of technology Gerrit offers us the following notifications[1]
new_changes Somebody created a new change
new_patchsets Somebody updated/added a patch(set) to a change
all_comments Somebody but jenkins commented
submitted_changes Somebody has pushed the submit button and it is in
abandoned_changes Somebody gave up on the change
all Everything
Currently we are using "all" and maybe we want to limit it to "new_patchsets" and "all_comments". "all_comments" is a bit troublesome as it includes empty messages like "+2" with actual review comments.
What would be the close to ideal solution?
* Be able to reply by mail to changes (most likely not to come)
* Mails sent have the author name as From (but gerrit mail address)?
* Empty mails like "+2" not sent to the Mailinglist?
* Subject changed? [PATCH] and omit branch name? Or omit project name?
Other proposals? Move it to a new mailinglist and leave OpenBSC as low-volume mailinglist?
comments? feedback? ideas?
holger
[1] https://gerrit-review.googlesource.com/Documentation/user-notify.html#notif…
Review at https://gerrit.osmocom.org/163
Add Finite State Machine abstraction code
This code is supposed to formalize some of the state machine handling in
Osmocom code.
Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466
---
M include/Makefile.am
A include/osmocom/core/fsm.h
M src/Makefile.am
A src/fsm.c
M tests/Makefile.am
A tests/fsm/fsm_test.c
A tests/fsm/fsm_test.err
M tests/testsuite.at
8 files changed, 546 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/163/1
diff --git a/include/Makefile.am b/include/Makefile.am
index 2e58d7e..b775c9f 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -17,6 +17,7 @@
osmocom/core/crcgen.h \
osmocom/core/endian.h \
osmocom/core/defs.h \
+ osmocom/core/fsm.h \
osmocom/core/gsmtap.h \
osmocom/core/gsmtap_util.h \
osmocom/core/linuxlist.h \
diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h
new file mode 100644
index 0000000..0e6a372
--- /dev/null
+++ b/include/osmocom/core/fsm.h
@@ -0,0 +1,87 @@
+#pragma once
+
+#include <stdint.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/core/utils.h>
+
+/*! \defgroup fsm Finite State Machine abstraction
+ * @{
+ */
+
+/*! \file fsm.h
+ * \brief Finite State Machine
+ */
+
+struct osmo_fsm_inst;
+
+/*! \brief description of a rule in the FSM */
+struct osmo_fsm_state {
+ /*! \brief bit-mask of permitted input events for this state */
+ uint32_t in_event_mask;
+ /*! \brief bit-mask to which other states this state may transiton */
+ uint32_t out_state_mask;
+ /*! \brief human-readable name of this state */
+ const char *name;
+ /*! \brief function pointer to be called for this state */
+ void (*action)(struct osmo_fsm_inst *fi, uint32_t event, void *data);
+};
+
+/*! \brief a description of an osmocom finite state machine */
+struct osmo_fsm {
+ /*! \brief global list */
+ struct llist_head list;
+ /*! \brief list of instances of this FSM */
+ struct llist_head instances;
+ /*! \brief human readable name */
+ const char *name;
+ /*! \brief table of state transition rules */
+ struct osmo_fsm_state *states;
+ /*! \brief bit-mask of events permitted in all states */
+ uint32_t allstate_event_mask;
+ /*! \brief function pointer to be called for allstate events */
+ void (*allstate_action)(struct osmo_fsm_inst *fi, uint32_t event, void *data);
+ /*! \brief number of entries in \ref states */
+ unsigned int num_states;
+ /*! \brief logging sub-system for this FSM */
+ int log_subsys;
+ /*! \brief human-readable names of events */
+ const struct value_string *event_names;
+};
+
+/*! \brief a single instanceof an osmocom finite state machine */
+struct osmo_fsm_inst {
+ /*! \brief member in the fsm->instances list */
+ struct llist_head list;
+ /*! \brief back-pointer to the FSM of which we are an instance */
+ struct osmo_fsm *fsm;
+ /*! \brief human readable name */
+ const char *name;
+ /*! \brief some private data of this instance */
+ void *priv;
+ /*! \brief logging level for this FSM */
+ int log_level;
+ /*! \brief current state of the FSM */
+ uint32_t state;
+
+ /*! \brief timer call-back for states with time-out */
+ void (*timer_cb)(struct osmo_fsm_inst *fi);
+ /*! \brief timer number for states with time-out */
+ int T;
+ /*! \brief timer back-end for states with time-out */
+ struct osmo_timer_list timer;
+};
+
+struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv,
+ int log_level);
+void osmo_fsm_inst_free(struct osmo_fsm_inst *fi);
+const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event);
+const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi);
+const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state);
+int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state,
+ unsigned long timeout_secs, int T);
+int osmo_fsm_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data);
+int osmo_fsm_register(struct osmo_fsm *fsm);
+
+/*! @} */
diff --git a/src/Makefile.am b/src/Makefile.am
index 45a77e3..7a6f464 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,7 +9,7 @@
libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS)
libosmocore_la_SOURCES = timer.c select.c signal.c msgb.c bits.c \
- bitvec.c bitcomp.c statistics.c \
+ bitvec.c bitcomp.c statistics.c fsm.c \
write_queue.c utils.c socket.c \
logging.c logging_syslog.c rate_ctr.c \
gsmtap_util.c crc16.c panic.c backtrace.c \
diff --git a/src/fsm.c b/src/fsm.c
new file mode 100644
index 0000000..10be332
--- /dev/null
+++ b/src/fsm.c
@@ -0,0 +1,283 @@
+/* Osmocom generic Finite State Machine implementation
+ *
+ * (C) 2016 by Harald Welte <laforge(a)gnumonks.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include <errno.h>
+
+#include <osmocom/core/fsm.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/core/utils.h>
+
+/*! \addtogroup fsm
+ * @{
+ */
+
+/*! \file fsm.c
+ * \brief Finite State Machine abstraction
+ *
+ * This is a generic C-language abstraction for implementing finite
+ * state machines within the Osmocom framework. It is intended to
+ * replace existing hand-coded or even only implicitly existing FSMs
+ * all over the existing code base.
+ *
+ * An libosmocore FSM is described by its \ref osmo_fsm description,
+ * which in turn refers to an array of \ref osmo_fsm_state descriptor,
+ * each describing a single state in the FSM.
+ *
+ * The general idea is that all actions performed within one state are
+ * located at one position in the code (the state's action function),
+ * as opposed to the 'message-centric' view of e.g. the existing
+ * state machines of the LAPD(m) coe, where there is one message for
+ * eahc possible event (primitive), and the function then needs to
+ * concern itself on how to handle that event over all possible states.
+ *
+ * For each state, there is a bit-mask of permitted input events for
+ * this state, as well as a bit-mask of permitted new output states to
+ * which the state can change. Furthermore, there is a function
+ * pointer implementing the actual handling of the input events.
+ *
+ * As there can often be many concurrent FSMs of one given class, we
+ * introduce the concept of \ref osmo_fsm_inst, i.e. an FSM instance.
+ * The instance keeps the actual state, while the \ref osmo_fsm
+ * descriptor contains the static/const descriptor of the FSM's states
+ * and possible transitions.
+ *
+ * osmo_fsm are integrated with the libosmocore logging system. The
+ * logging sub-system is determined by the FSM descriptor, as we assume
+ * one FSM (let's say one related to a location update procedure) is
+ * inevitably always tied to a sub-system. The logging level however
+ * is configurable for each FMS instance, to ensure that e.g. DEBUG
+ * logging can be used for the LU procedure of one subscriber, while
+ * NOTICE level is used for all other subscribers.
+ */
+
+static LLIST_HEAD(g_fsms);
+
+/*! \brief register a FSM with the core
+ *
+ * A FSM descriptor needs to be registered with the core before any
+ * instances can be created for it.
+ *
+ * \param[in] fsm Descriptor of Finite State Machine to be registered
+ * \returns 0 on success; negative on error
+ */
+int osmo_fsm_register(struct osmo_fsm *fsm)
+{
+ /* FIXME:check for duplicate name? */
+ llist_add_tail(&fsm->list, &g_fsms);
+ INIT_LLIST_HEAD(&fsm->instances);
+
+ return 0;
+}
+
+/*! \brief unregister a FSM from the core
+ *
+ * Once the FSM descriptor is unregistered, active instances can still
+ * use it, but no new instances may be created for it.
+ *
+ * \param[in] fsm Descriptor of Finite State Machine to be removed
+ */
+void osmo_fsm_unregister(struct osmo_fsm *fsm)
+{
+ llist_del(&fsm->list);
+}
+
+/* small wrapper function around timer expiration (for logging) */
+static void fsm_tmr_cb(void *data)
+{
+ struct osmo_fsm_inst *fi = data;
+ struct osmo_fsm *fsm = fi->fsm;
+
+ LOGP(fsm->log_subsys, fi->log_level, "%s(%s): Timeout of T%u\n",
+ osmo_fsm_inst_name(fi),
+ osmo_fsm_state_name(fsm, fi->state), fi->T);
+
+ fi->timer_cb(fi);
+}
+
+/*! \brief allocate a new instance of a specified FSM
+ * \param[in] fsm Descriptor of the FSM
+ * \param[in] ctx talloc context from which to allocate memory
+ * \param[in] priv private data reference store in fsm instance
+ * \param[in] log_level The log level for events of this FSM
+ * \returns newly-allocated, initialized and registered FSM instance
+ */
+struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv,
+ int log_level)
+{
+ struct osmo_fsm_inst *fi = talloc_zero(ctx, struct osmo_fsm_inst);
+ fi->fsm = fsm;
+ fi->priv = priv;
+ fi->log_level = log_level;
+ fi->timer.data = fi;
+ fi->timer.cb = fsm_tmr_cb;
+ llist_add(&fi->list, &fsm->instances);
+ return fi;
+}
+
+/*! \brief delete a given instance of a FSM
+ * \param[in] fsm The FSM to be un-registered and deleted
+ */
+void osmo_fsm_inst_free(struct osmo_fsm_inst *fi)
+{
+ osmo_timer_del(&fi->timer);
+ llist_del(&fi->list);
+ talloc_free(fi);
+}
+
+/*! \brief get human-readable name of FSM event
+ * \param[in] fsm FSM descriptor of event
+ * \param[in] event Event integer value
+ * \returns string rendering of the event
+ */
+const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event)
+{
+ static char buf[32];
+ if (!fsm->event_names) {
+ snprintf(buf, sizeof(buf), "%u", event);
+ return buf;
+ } else
+ return get_value_string(fsm->event_names, event);
+}
+
+/*! \brief get human-readable name of FSM instance
+ * \param[in] fi FSM instance
+ * \returns string rendering of the FSM identity
+ */
+const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi)
+{
+ if (fi->name)
+ return fi->name;
+ else
+ return fi->fsm->name;
+}
+
+/*! \brief get human-readable name of FSM instance
+ * \param[in] fsm FSM descriptor
+ * \param[in] state FSM state number
+ * \returns string rendering of the FSM state
+ */
+const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state)
+{
+ static char buf[32];
+ if (state >= fsm->num_states) {
+ snprintf(buf, sizeof(buf), "unknown %u", state);
+ return buf;
+ } else
+ return fsm->states[state].name;
+}
+
+/*! \brief perform a state change of the given FSM instance
+ *
+ * All changes to the FSM instance state must be made via this
+ * function. It verifies that the existing state actually permits a
+ * transiiton to new_state.
+ *
+ * timeout_secs and T are optional parameters, and only have any effect
+ * if timeout_secs is not 0. If the timeout function is used, then the
+ * new_state is entered, and the FSM instances timer is set to expire
+ * in timeout_secs functions. At that time, the FSM's timer_cb
+ * function will be called for handling of the timeout by the user.
+ *
+ * \param[in] fi FSM instance whose state is to change
+ * \param[in] new_state The new state into which we should change
+ * \param[in] timeout_secs Timeout in seconds (if !=0)
+ * \param[in] T Timer number (if \ref timeout_secs != 0)
+ * \returns 0 on success; negative on error
+ */
+int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state,
+ unsigned long timeout_secs, int T)
+{
+ struct osmo_fsm *fsm = fi->fsm;
+ struct osmo_fsm_state *st = &fsm->states[fi->state];
+
+ /* validate if new_state is a valid state */
+ if (!(st->out_state_mask & (1 << new_state))) {
+ LOGP(fsm->log_subsys, LOGL_ERROR, "%s(%s): transition to "
+ "state %s not permitted!\n",
+ osmo_fsm_inst_name(fi),
+ osmo_fsm_state_name(fsm, fi->state),
+ osmo_fsm_state_name(fsm, new_state));
+ return -EPERM;
+ }
+
+ LOGP(fsm->log_subsys, fi->log_level, "%s(%s): state_chg to %s\n",
+ osmo_fsm_inst_name(fi),
+ osmo_fsm_state_name(fsm, fi->state),
+ osmo_fsm_state_name(fsm, new_state));
+
+ fi->state = new_state;
+
+ if (timeout_secs) {
+ if (!fi->timer_cb)
+ LOGP(fsm->log_subsys, LOGL_ERROR, "cannot start "
+ "timer for FSM without timer call-back\n");
+ else {
+ fi->T = T;
+ osmo_timer_schedule(&fi->timer, timeout_secs, 0);
+ }
+ }
+
+ return 0;
+}
+
+/*! \brief dispatch an event to an osmocom finite state machine instance
+ *
+ * Any incoming events to \ref osmo_fsm instances must be dispatched to
+ * them via this function. It verifies, whether the event is permitted
+ * based on the current state of the FSM. If not, -1 is returned.
+ *
+ * \param[in] fi FSM instance
+ * \param[in] event Event to send to FSM instance
+ * \param[in] data Data to pass along with the event
+ * \returns 0 in case of success; negative on error
+ */
+int osmo_fsm_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ struct osmo_fsm *fsm = fi->fsm;
+ struct osmo_fsm_state *fs;
+
+ OSMO_ASSERT(fi->state < fsm->num_states);
+
+ fs = &fi->fsm->states[fi->state];
+
+
+ LOGP(fsm->log_subsys, fi->log_level, "%s(%s): Received Event %s\n",
+ osmo_fsm_inst_name(fi), osmo_fsm_state_name(fsm, fi->state),
+ osmo_fsm_event_name(fsm, event));
+
+ if (((1 << event) & fsm->allstate_event_mask) && fsm->allstate_action) {
+ fsm->allstate_action(fi, event, data);
+ return 0;
+ }
+
+ if (!((1 << event) & fs->in_event_mask)) {
+ LOGP(fsm->log_subsys, LOGL_ERROR, "%s(%s): Event %s not "
+ "permitted\n", osmo_fsm_inst_name(fi),
+ osmo_fsm_state_name(fsm, fi->state),
+ osmo_fsm_event_name(fsm, event));
+ return -1;
+ }
+ fs->action(fi, event, data);
+
+ return 0;
+}
+
+/*! @} */
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 55aaa07..263af0a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,7 +13,7 @@
vty/vty_test comp128/comp128_test utils/utils_test \
smscb/gsm0341_test stats/stats_test \
bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \
- sim/sim_test tlv/tlv_test gsup/gsup_test
+ sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test
if ENABLE_MSGFILE
check_PROGRAMS += msgfile/msgfile_test
@@ -118,6 +118,9 @@
gsup_gsup_test_SOURCES = gsup/gsup_test.c
gsup_gsup_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la
+fsm_fsm_test_SOURCES = fsm/fsm_test.c
+fsm_fsm_test_LDADD = $(top_builddir)/src/libosmocore.la
+
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
:;{ \
@@ -152,7 +155,8 @@
vty/vty_test.ok comp128/comp128_test.ok \
utils/utils_test.ok stats/stats_test.ok \
bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \
- sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok
+ sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok \
+ fsm/fsm_test.ok
DISTCLEANFILES = atconfig
diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c
new file mode 100644
index 0000000..d8db908
--- /dev/null
+++ b/tests/fsm/fsm_test.c
@@ -0,0 +1,152 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <osmocom/core/utils.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/core/fsm.h>
+
+enum {
+ DMAIN,
+};
+
+static void *g_ctx;
+
+
+enum test_fsm_states {
+ ST_NULL = 0,
+ ST_ONE,
+ ST_TWO,
+};
+
+enum test_fsm_evt {
+ EV_A,
+ EV_B,
+};
+
+static void test_fsm_null(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ switch (event) {
+ case EV_A:
+ OSMO_ASSERT(data == (void *) 23);
+ osmo_fsm_inst_state_chg(fi, ST_ONE, 0, 0);
+ break;
+ default:
+ OSMO_ASSERT(0);
+ break;
+ }
+}
+
+static void test_fsm_one(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ switch (event) {
+ case EV_B:
+ OSMO_ASSERT(data == (void *) 42);
+ osmo_fsm_inst_state_chg(fi,ST_TWO, 1, 2342);
+ break;
+ default:
+ OSMO_ASSERT(0);
+ break;
+ }
+}
+
+static void test_fsm_tmr_cb(struct osmo_fsm_inst *fi)
+{
+ OSMO_ASSERT(fi->T == 2342);
+ OSMO_ASSERT(fi->state == ST_TWO);
+ LOGP(DMAIN, LOGL_INFO, "Timer\n");
+
+ exit(0);
+}
+
+static struct osmo_fsm_state test_fsm_states[] = {
+ [ST_NULL] = {
+ .in_event_mask = (1 << EV_A),
+ .out_state_mask = (1 << ST_ONE),
+ .name = "NULL",
+ .action = test_fsm_null,
+ },
+ [ST_ONE]= {
+ .in_event_mask = (1 << EV_B),
+ .out_state_mask = (1 << ST_TWO),
+ .name = "ONE",
+ .action= test_fsm_one,
+ },
+ [ST_TWO]= {
+ .in_event_mask = 0,
+ .name = "TWO",
+ .action = NULL,
+ },
+};
+
+static struct osmo_fsm fsm = {
+ .name = "Test FSM",
+ .states = test_fsm_states,
+ .num_states = ARRAY_SIZE(test_fsm_states),
+ .log_subsys = DMAIN,
+};
+
+static int foo(void)
+{
+ struct osmo_fsm_inst *fi;
+
+ LOGP(DMAIN, LOGL_INFO, "Checking FSM allocation\n");
+ fi = osmo_fsm_inst_alloc(&fsm, g_ctx, NULL, LOGL_DEBUG);
+ OSMO_ASSERT(fi);
+ OSMO_ASSERT(fi->fsm == &fsm);
+ OSMO_ASSERT(!strcmp(osmo_fsm_inst_name(fi), fsm.name));
+ OSMO_ASSERT(fi->state == ST_NULL);
+ OSMO_ASSERT(fi->log_level == LOGL_DEBUG);
+
+ /* Try invalid state transition */
+ osmo_fsm_dispatch(fi, EV_B, (void *) 42);
+ OSMO_ASSERT(fi->state == ST_NULL);
+
+ /* Legitimate state transition */
+ osmo_fsm_dispatch(fi, EV_A, (void *) 23);
+ OSMO_ASSERT(fi->state == ST_ONE);
+
+ /* Legitimate transition with timer */
+ fi->timer_cb = test_fsm_tmr_cb;
+ osmo_fsm_dispatch(fi, EV_B, (void *) 42);
+ OSMO_ASSERT(fi->state == ST_TWO);
+
+
+ return 0;
+}
+
+static const struct log_info_cat default_categories[] = {
+ [DMAIN] = {
+ .name = "DMAIN",
+ .description = "Main",
+ .enabled = 1, .loglevel = LOGL_DEBUG,
+ },
+};
+
+static const struct log_info log_info = {
+ .cat = default_categories,
+ .num_cat = ARRAY_SIZE(default_categories),
+};
+
+int main(int argc, char **argv)
+{
+ struct log_target *stderr_target;
+
+ log_init(&log_info, NULL);
+ stderr_target = log_target_create_stderr();
+ log_add_target(stderr_target);
+
+ g_ctx = NULL;
+ osmo_fsm_register(&fsm);
+
+ foo();
+
+ while (1) {
+ osmo_select_main(0);
+ }
+
+ exit(0);
+}
diff --git a/tests/fsm/fsm_test.err b/tests/fsm/fsm_test.err
new file mode 100644
index 0000000..1d0bce2
--- /dev/null
+++ b/tests/fsm/fsm_test.err
@@ -0,0 +1,9 @@
+<0000> fsm/fsm_test.c:94 Checking FSM allocation
+[0;m<0000> fsm.c:111 Test FSM(NULL): Event 1 not permitted
+[0;m<0000> fsm.c:117 Test FSM(NULL): Received Event 0
+[0;m<0000> fsm.c:81 Test FSM(NULL): state_chg to ONE
+[0;m<0000> fsm.c:117 Test FSM(ONE): Received Event 1
+[0;m<0000> fsm.c:81 Test FSM(ONE): state_chg to TWO
+[0;m<0000> fsm.c:30 Test FSM(TWO): Timeout of T2342
+[0;m<0000> fsm/fsm_test.c:60 Timer
+[0;m
\ No newline at end of file
diff --git a/tests/testsuite.at b/tests/testsuite.at
index d49f7ff..93373c1 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -201,3 +201,10 @@
cat $abs_srcdir/gsup/gsup_test.ok > expout
AT_CHECK([$abs_top_builddir/tests/gsup/gsup_test], [0], [expout], [ignore])
AT_CLEANUP
+
+AT_SETUP([fsm])
+AT_KEYWORDS([fsm])
+cat $abs_srcdir/fsm/fsm_test.ok > expout
+cat $abs_srcdir/fsm/fsm_test.err > experr
+AT_CHECK([$abs_top_builddir/tests/fsm/fsm_test], [0], [expout], [experr])
+AT_CLEANUP
--
To view, visit https://gerrit.osmocom.org/163
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge(a)gnumonks.org>
Review at https://gerrit.osmocom.org/173
gprs_gmm.c: Perform LLME operations only if we have one
In case the GMM message did not arrive over a Gb interface, there is no
LLME (and thus the associated pointer is NULL). Don't try to perform
operations on a NULL LLME.
Change-Id: If7f24161cd2826f8ee238d4bc1090adf555cea4e
---
M openbsc/src/gprs/gprs_gmm.c
1 file changed, 7 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/73/173/1
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index d521342..c8f687b 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -1208,10 +1208,12 @@
}
if (!mmctx) {
- /* send a XID reset to re-set all LLC sequence numbers
- * in the MS */
- LOGMMCTXP(LOGL_NOTICE, mmctx, "LLC XID RESET\n");
- gprs_llgmm_reset(llme);
+ if (llme) {
+ /* send a XID reset to re-set all LLC sequence numbers
+ * in the MS */
+ LOGMMCTXP(LOGL_NOTICE, mmctx, "LLC XID RESET\n");
+ gprs_llgmm_reset(llme);
+ }
/* The MS has to perform GPRS attach */
/* Device is still IMSI attached for CS but initiate GPRS ATTACH,
* see GSM 04.08, 4.7.5.1.4 and G.6 */
@@ -1314,7 +1316,7 @@
/* MMCTX can be NULL when called */
- if (!mmctx &&
+ if (llme && !mmctx &&
gh->msg_type != GSM48_MT_GMM_ATTACH_REQ &&
gh->msg_type != GSM48_MT_GMM_RA_UPD_REQ) {
LOGP(DMM, LOGL_NOTICE, "Cannot handle GMM for unknown MM CTX\n");
--
To view, visit https://gerrit.osmocom.org/173
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If7f24161cd2826f8ee238d4bc1090adf555cea4e
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge(a)gnumonks.org>
Review at https://gerrit.osmocom.org/171
gprs_gmm.c: Don't try to de-reference NULL mmctx
There was a comment in the code that certain GMM messages require a
valid mmctx pointer. However, nothing actually checked if that pointer
was in fact non-NULL. We plainly crashed if a MS would send us the
wrong message in the wrong state.
Original patch by Harald Welte, but it broke message validity checking,
resulting in sgsn_test failure. This re-implements the NULL check in a
different way, as explained by in-code comment.
Change-Id: I7908de65bec91599f7042549b832cbbd7ae5a9a8
---
M openbsc/src/gprs/gprs_gmm.c
1 file changed, 32 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/71/171/1
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 1e10701..e788e3d 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -1339,6 +1339,15 @@
return rc;
}
+ /*
+ * For a few messages, mmctx may be NULL. For most, we want to ensure a
+ * non-NULL mmctx. At the same time, we want to keep the message
+ * validity check intact, so that all message types appear in the
+ * switch statement and the default case thus means "unknown message".
+ * If we split the switch in two parts to check non-NULL halfway, the
+ * unknown-message check breaks, or we'd need to duplicate the switch
+ * cases in both parts. Just keep one large switch and add some gotos.
+ */
switch (gh->msg_type) {
case GSM48_MT_GMM_RA_UPD_REQ:
rc = gsm48_rx_gmm_ra_upd_req(mmctx, msg, llme);
@@ -1348,20 +1357,30 @@
break;
/* For all the following types mmctx can not be NULL */
case GSM48_MT_GMM_ID_RESP:
+ if (!mmctx)
+ goto null_mmctx;
rc = gsm48_rx_gmm_id_resp(mmctx, msg);
break;
case GSM48_MT_GMM_STATUS:
+ if (!mmctx)
+ goto null_mmctx;
rc = gsm48_rx_gmm_status(mmctx, msg);
break;
case GSM48_MT_GMM_DETACH_REQ:
+ if (!mmctx)
+ goto null_mmctx;
rc = gsm48_rx_gmm_det_req(mmctx, msg);
break;
case GSM48_MT_GMM_DETACH_ACK:
+ if (!mmctx)
+ goto null_mmctx;
LOGMMCTXP(LOGL_INFO, mmctx, "-> DETACH ACK\n");
mm_ctx_cleanup_free(mmctx, "GPRS DETACH ACK");
rc = 0;
break;
case GSM48_MT_GMM_ATTACH_COMPL:
+ if (!mmctx)
+ goto null_mmctx;
/* only in case SGSN offered new P-TMSI */
LOGMMCTXP(LOGL_INFO, mmctx, "-> ATTACH COMPLETE\n");
mmctx_timer_stop(mmctx, 3350);
@@ -1380,6 +1399,8 @@
osmo_signal_dispatch(SS_SGSN, S_SGSN_ATTACH, &sig_data);
break;
case GSM48_MT_GMM_RA_UPD_COMPL:
+ if (!mmctx)
+ goto null_mmctx;
/* only in case SGSN offered new P-TMSI */
LOGMMCTXP(LOGL_INFO, mmctx, "-> ROUTING AREA UPDATE COMPLETE\n");
mmctx_timer_stop(mmctx, 3350);
@@ -1398,6 +1419,8 @@
osmo_signal_dispatch(SS_SGSN, S_SGSN_UPDATE, &sig_data);
break;
case GSM48_MT_GMM_PTMSI_REALL_COMPL:
+ if (!mmctx)
+ goto null_mmctx;
LOGMMCTXP(LOGL_INFO, mmctx, "-> PTMSI REALLLICATION COMPLETE\n");
mmctx_timer_stop(mmctx, 3350);
mmctx->t3350_mode = GMM_T3350_MODE_NONE;
@@ -1409,6 +1432,8 @@
rc = 0;
break;
case GSM48_MT_GMM_AUTH_CIPH_RESP:
+ if (!mmctx)
+ goto null_mmctx;
rc = gsm48_rx_gmm_auth_ciph_resp(mmctx, msg);
break;
default:
@@ -1419,6 +1444,13 @@
}
return rc;
+
+null_mmctx:
+ LOGP(DMM, LOGL_ERROR,
+ "Received GSM 04.08 message type 0x%02x,"
+ " but no MM context available\n",
+ gh->msg_type);
+ return -EINVAL;
}
static void mmctx_timer_cb(void *_mm)
--
To view, visit https://gerrit.osmocom.org/171
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7908de65bec91599f7042549b832cbbd7ae5a9a8
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
Review at https://gerrit.osmocom.org/184
dyn PDCH: Add new_lchan argument to bsc_handover_start()
This is useful if the caller already allocated a new lchan, which will be used
to dynamically re-assign lchans.
The old behavior is maintained by passing NULL.
Change-Id: I2b7151f32f0c04c22f294eb5dd3c7d7dfddf35e7
---
M openbsc/include/openbsc/handover.h
M openbsc/src/libbsc/handover_decision.c
M openbsc/src/libbsc/handover_logic.c
M openbsc/src/libmsc/vty_interface_layer3.c
4 files changed, 15 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/84/184/1
diff --git a/openbsc/include/openbsc/handover.h b/openbsc/include/openbsc/handover.h
index 3fe71a2..a4844c5 100644
--- a/openbsc/include/openbsc/handover.h
+++ b/openbsc/include/openbsc/handover.h
@@ -3,7 +3,8 @@
struct gsm_subscriber_connection;
-int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts);
+int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
+ struct gsm_bts *bts);
/* clear any operation for this connection */
void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan);
diff --git a/openbsc/src/libbsc/handover_decision.c b/openbsc/src/libbsc/handover_decision.c
index 0f07bca..8b92177 100644
--- a/openbsc/src/libbsc/handover_decision.c
+++ b/openbsc/src/libbsc/handover_decision.c
@@ -48,7 +48,7 @@
}
/* and actually try to handover to that cell */
- return bsc_handover_start(lchan, new_bts);
+ return bsc_handover_start(lchan, NULL, new_bts);
}
/* did we get a RXLEV for a given cell in the given report? */
diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c
index 641cee4..3e38fda 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -87,10 +87,13 @@
/* Hand over the specified logical channel to the specified new BTS. This is
* the main entry point for the actual handover algorithm, after the decision
- * whether to initiate HO to a specific BTS. */
-int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts)
+ * whether to initiate HO to a specific BTS.
+ *
+ * If new_lchan is NULL, allocate a new lchan. If not NULL, new_lchan must be a
+ * newly allocated lchan passed in by the caller. */
+int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
+ struct gsm_bts *new_bts)
{
- struct gsm_lchan *new_lchan;
struct bsc_handover *ho;
static uint8_t ho_ref;
int rc;
@@ -101,19 +104,20 @@
return -EBUSY;
DEBUGP(DHO, "(old_lchan on BTS %u, new BTS %u)\n",
- old_lchan->ts->trx->bts->nr, bts->nr);
+ old_lchan->ts->trx->bts->nr, new_bts->nr);
- osmo_counter_inc(bts->network->stats.handover.attempted);
+ osmo_counter_inc(new_bts->network->stats.handover.attempted);
if (!old_lchan->conn) {
LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n");
return -ENOSPC;
}
- new_lchan = lchan_alloc(bts, old_lchan->type, 0);
+ if (!new_lchan)
+ new_lchan = lchan_alloc(new_bts, old_lchan->type, 0);
if (!new_lchan) {
LOGP(DHO, LOGL_NOTICE, "No free channel\n");
- osmo_counter_inc(bts->network->stats.handover.no_channel);
+ osmo_counter_inc(new_bts->network->stats.handover.no_channel);
return -ENOSPC;
}
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 5d74e04..2ad7eab 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -641,7 +641,7 @@
}
/* now start the handover */
- ret = bsc_handover_start(conn->lchan, bts);
+ ret = bsc_handover_start(conn->lchan, NULL, bts);
if (ret != 0) {
vty_out(vty, "%% Handover failed with errno %d.%s",
ret, VTY_NEWLINE);
--
To view, visit https://gerrit.osmocom.org/184
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b7151f32f0c04c22f294eb5dd3c7d7dfddf35e7
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
Review at https://gerrit.osmocom.org/183
comment tweak for bsc_handover_start()
Have a comment only in the .c file to remove dup, tweak wording.
Change-Id: I6d19e2b5a794f8b5d8fb71791719447362c5ce85
---
M openbsc/include/openbsc/handover.h
M openbsc/src/libbsc/handover_logic.c
2 files changed, 3 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/183/1
diff --git a/openbsc/include/openbsc/handover.h b/openbsc/include/openbsc/handover.h
index bd0d8ad..3fe71a2 100644
--- a/openbsc/include/openbsc/handover.h
+++ b/openbsc/include/openbsc/handover.h
@@ -3,9 +3,6 @@
struct gsm_subscriber_connection;
-/* Hand over the specified logical channel to the specified new BTS.
- * This is the main entry point for the actual handover algorithm,
- * after it has decided it wants to initiate HO to a specific BTS */
int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts);
/* clear any operation for this connection */
diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c
index 2b8c386..641cee4 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -85,9 +85,9 @@
return NULL;
}
-/* Hand over the specified logical channel to the specified new BTS.
- * This is the main entry point for the actual handover algorithm,
- * after it has decided it wants to initiate HO to a specific BTS */
+/* Hand over the specified logical channel to the specified new BTS. This is
+ * the main entry point for the actual handover algorithm, after the decision
+ * whether to initiate HO to a specific BTS. */
int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts)
{
struct gsm_lchan *new_lchan;
--
To view, visit https://gerrit.osmocom.org/183
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d19e2b5a794f8b5d8fb71791719447362c5ce85
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger(a)freyther.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>
Hi Guys,
I am a bit fed-up to have to receive Neels non-productive mails every single day and given my tight work schedule let's have him win, declare Gerrit a failure and return to patchwork.
The twist is that I am no longer willing to clean behind everyone on the patchwork UI. So somebody else needs to sign-up for the patch merging and gardening in the WebUI.
My proposal would be:
* Sunday morning we change all ACLs (no more pushes, no more merges/submits/reviews)
* Luckily we have all patches in our patchwork and can continue from there.
agreed?
holger
Hi all,
I have just changed the access configuration of gerrit.osmocom.org:
* added a group of "known users"
* allow create+push to refs/heads/users/* to this group
* disallow access to refs/users/* (except to admins for cleanup)
* added a sysmocom group
* allow create+push to refs/heads/sysmocom/* to this group
Questions:
* allow global namespace access to "known users"?
* or move old user branches to users/?
Causality:
Previously, gerrit granted create+push access to refs/users/* (note: no
"heads") to anybody. However, branches pushed there were not being replicated
to git.osmocom.org. IMHO we should not have this fragmentation of repositories.
Instead, we could allow create+push to refs/heads/users/* (note: "heads") to
any registered user. The refs/heads/users/* namespace will replicate to
git.osmocom.org repositories automatically. But:
Before gerrit, anyone would be able to push to any branch. We relied on trust
that we wouldn't mess with other devs' branches or push to master without
review. That worked out pretty well. But, before gerrit, we would actively
enable users we trust. With gerrit, ANYONE can register without any project
member even noticing, and start pushing right away. Thus we should rather
limit the push access, e.g. to refs/heads/users/*
When granting push access to the users/* namespace to ANYONE, one problem
remains: any troll could commit any amount of completely unrelated data, and we
would readily replicate it to our "upstream" git.osmocom.org repositories.
So, actually, instead of allowing push access to users/* to anyone, I have
added a group "known users" to gerrit, which should typically contain anyone we
trust not to be a troll. I have added all gerrit users I know to this group.
Anyone who wishes to push to a users/* branch must request to be added to the
"known users" group. The threshold to join this group should be low.
(The ability to push patches for review is not affected.)
Since certain subgroups like to collaborate on given branches (e.g. fairwaves,
sysmocom, ...), we can add specific namespaces for these groups. I have so far
added a refs/heads/sysmocom/* namespace and a "sysmocom group access" gerrit
group. I can add more groups on request. The only advantage here is that you
can drop the "users/" path element. Any "known users" member can collaborate on
users/* branches already, e.g. refs/heads/users/sysmocom/topic.
To make this less config prone, we could go one step further and allow global
push access to the group of known users, going back to the model of trust that
users take care not to push nonsense. That would include access to master. We
also still have various branches in git.osmocom.org that don't have the 'users'
path element. If we grant global namespace access to known users, these would
continue to be useful. If not, we could rename these to users/ to allow further
access.
Opinions welcome!
~Neels
--
- Neels Hofmeyr <nhofmeyr(a)sysmocom.de> http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschäftsführer / Managing Directors: Holger Freyther, Harald Welte
Review at https://gerrit.osmocom.org/182
dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP
Add dyn_pdch_init() and call from inp_sig_cb() upon RSL UP.
Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will
now be set after dyn_pdch_init() sent out the PDCH ACT, i.e. when the PDCH ACT
ACK messages are received.
Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161
---
M openbsc/src/libbsc/bsc_init.c
1 file changed, 34 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/82/182/1
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 110e160..02c949c 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -302,6 +302,36 @@
generate_ma_for_ts(&trx->ts[i]);
}
+static void dyn_pdch_init(struct gsm_bts_trx *trx)
+{
+ unsigned int i;
+ struct gsm_bts_trx_ts *ts;
+ int rc;
+ unsigned int pdch_act_count = 0;
+
+ for (i = 0; i < TRX_NR_TS; i++) {
+ ts = &trx->ts[i];
+ if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) {
+ rc = rsl_ipacc_pdch_activate(ts, 1);
+ if (rc != 0) {
+ LOGP(DRSL, LOGL_ERROR,
+ "Failed to activate PDCH on"
+ " BTS %u TRX %u TS %u: %d\n",
+ trx->bts->nr, trx->nr, i, rc);
+ continue;
+ }
+ pdch_act_count ++;
+ }
+ }
+
+ if (pdch_act_count) {
+ LOGP(DRSL, LOGL_NOTICE,
+ "Activated PDCH on %u dynamic TCH/F_PDCH time slots"
+ " for BTS %u TRX %u\n",
+ pdch_act_count, trx->bts->nr, trx->nr);
+ }
+}
+
/* Callback function to be called every time we receive a signal from INPUT */
static int inp_sig_cb(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
@@ -328,14 +358,14 @@
generate_cell_chan_list(ca, trx->bts);
llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) {
- for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) {
+ for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++)
generate_ma_for_ts(&cur_trx->ts[i]);
- cur_trx->ts[i].flags |= TS_F_PDCH_MODE;
- }
}
}
- if (isd->link_type == E1INP_SIGN_RSL)
+ if (isd->link_type == E1INP_SIGN_RSL) {
bootstrap_rsl(trx);
+ dyn_pdch_init(trx);
+ }
break;
case S_L_INP_TEI_DN:
LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx);
--
To view, visit https://gerrit.osmocom.org/182
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr(a)sysmocom.de>