Commit Graph

67 Commits

Author SHA1 Message Date
Harald Welte 5e3d91bff7 ip.access: Keep a full copy of local and remote IP/PORT in lchan
Keeping all parameters for each RTP connection in the abis_ip member of
lchan will help us with actual TCH handover later on.
2009-12-19 18:35:56 +01:00
Harald Welte b1d4c8ed9d logging: introduce log levels at caller site
This introduces a new LOGP() macro together with LOGL_* definition to
support multiple log levels (severities) throughout the codebase.

Please note that the actual logging system does not use them yet,
in this patch we simply introduce the new macros at the caller site.
2009-12-17 23:10:46 +01:00
Harald Welte 8d77b9540a [handover] first functional handover implementation
With this commit, we can successfully hand over a channel from one cell to
another cell.  We implement asynchronous intra-BSC (but inter-BTS) handover.

Changes:
* introduce new DHO log category
* extend rsl_chan_activate_lchan() with argument for HO reference
* introduce actual minimal handover decision making in handover_decision.c
* various fixes to bsc_handover_start() in  handover_logic.c
2009-12-17 00:31:10 +01:00
Harald Welte 33e6597720 assign measurement report lchan member after memset'ing it 2009-12-16 23:29:34 +01:00
Harald Welte 6739dfb705 print measurement reports more verbosely 2009-12-16 16:52:07 +01:00
Harald Welte d12b0fdf51 introduce cache of 6 last recently received measurement reports for each lchan 2009-12-15 21:36:05 +01:00
Harald Welte 9e2748ed3a [RSL] print human-readable channel type during channel allocation failure 2009-12-12 20:53:23 +01:00
Harald Welte 24766091d8 mark lchan2chan_nr() using a 'const' parameter
which fixes some compile warnings at some callers.
2009-12-09 19:18:32 +01:00
Harald Welte 0603c9d9e5 ip.access speech mode for TCH/H channels 2009-12-02 01:58:23 +05:30
Harald Welte 2c82899135 move RTP socket information from timeslot to lchan
With ip.access, in case of TCH/H, we have one RTP stream for each half-slot
(lchan), not just one per on-air timeslot.  This is quite different from
a classic BTS where the TRAU frames of the two TCH/H channels would be
part of the same 16k sub-slot in a E1 timeslot.
2009-12-02 01:56:49 +05:30
Harald Welte a43f789a0a Replace template-based SYSTEM INFORMATION with real implementation
Before this commit, OpenBSC used templates for the SYSTEM INFO
1, 2, 3, 4, 5 and 6 messages.  Those templates were patched in
various places to reflect the network config like ARFCN.

Now, we actually generate those SI messages ourselves, using
values from the configuration file, and even calculating neighbor
cell lists.

All bts'es that you have configured in OpenBSC will end up in
the neighbor cell list - which should be more than sufficient for
the current small-single-site networks.
2009-12-01 18:04:30 +05:30
Harald Welte dbb1d88359 [handover] export measurement reports via signal
This patch introduces the S_LCHAN_MEAS_REP signal which is used to export
measurement reports as input to the yet-to-be-written handover algorithm.
2009-11-30 19:16:47 +01:00
Harald Welte d011e8b958 [handover] Introduce new handover related LCHAN signals
This introduces the signals S_LCHAN_ACTIVATE_{ACK,NACK} and
S_LCAN_HANDOVER_{FAIL,COMPL,DETECT} as well as code that actually issues
those signals.  The signals are relevant for a yet-to-be-written handover
control logic.
2009-11-29 22:45:52 +01:00
Harald Welte 3c7dc6ed50 New complete measurement result/report handling
This patch extends struct gsm_meas_rep into a complete structure containing all
information from both uplink and downlink measurement results/reports.

This is a first step to provide this complete measurement data as a C structure
into a to-be-implemented handover decision algorithm.
2009-11-29 19:07:28 +01:00
Harald Welte 1a79d36440 RSL: catch inconsistent parameters ofr channel_mode_from_lchan() 2009-11-27 08:55:16 +01:00
Holger Hans Peter Freyther c4d88ad971 [network] Make T3101 configurable and use it in abis_rsl 2009-11-22 05:28:23 +01:00
Holger Hans Peter Freyther ea52802762 [lchan] RSL and RR need the multirate config, place it in the lchan
Both GSM 04.08 RR and GSM 08.58 RSL need the multirate config
in the channel modify. Place the config in the lchan, change
the gsm48 methods to not take the argument, change the RSL
implementation to make use of it with the right IE.

The other code should use the t(l)v_put routines as well but
were left untouched for now.
2009-11-19 11:42:03 +01:00
Holger Hans Peter Freyther 231163d365 [ipa] Change names of RTP methods to follow MGCP naming
IPA is naming these functions CRCX, MDCX, DLCX to follow
the naming of the MediaGatewayControlProtocol. Change the
code to go from BIND to CRCX (create connection) and from
CONNECT to MDCX (modify connection).

Connect indicates that it is only possible to call it once
while it is possible to call it more than once to modify
the audio parmaters and such. So the IPA terminology is
making a bit more sense here (now that we know it).
2009-11-19 09:40:03 +01:00
Holger Hans Peter Freyther f7d752f7ac [si] Make it possible to set the NECI value...
Allow to configure the NECI value... and change code
that is relying on the NECI value.
2009-11-17 09:46:33 +01:00
Holger Hans Peter Freyther 0fef39a8ac [rsl] Improve error message when the lchan allocation is failing 2009-11-17 09:46:33 +01:00
Holger Hans Peter Freyther 5ba6f48092 [lchan] Keep track which SAPIs has been established with the BTS
Keep track of which SAPIs have been established either by the
BTS (from the MS) or by us. This can be used by the on-waves
BSC code to figure out if a new request should be made.
2009-10-29 04:20:21 +01:00
Holger Hans Peter Freyther e81a6109f9 [gsm48] Add generation of ASSIGNMENT COMMAND to the 0408 utils
Add code to generate an assignment command for a given lchan. It
is expected that the lchan is modified already and the mode will
be picked up from their. Currently only the mandantory items
are supported.
2009-10-27 04:52:29 +01:00
Harald Welte 9c880c9a9b [GPRS] Add RSL function for ip.access PDCH activation
If we have a dynamic TCH/F / PDCH channel configuration, then
we can either ACTIVATE CHANNEL it for a TCH/F, or we need to send
this vendor-specific PDCH ACTIVATE command to use it as a PDCH.

As opposed to a fixed configuration, this allows an intelligent
BSC channel allocator to use otherwise idle channels as PDCH
as long as no more TCH's are needed.
2009-10-24 10:29:22 +02:00
Harald Welte a1499d00a5 [GPRS] introudce PDCH and PDCH/TCH physical channels
GPRS needs PDCH (Packet Data Channels), and we need support in
our data model as well as OML and RSL for it
2009-10-24 10:25:50 +02:00
Holger Hans Peter Freyther ddd918f7ec Fix compiler warning and cast const away.
TLVP_VAL returns a const u_int8_t* and we assign it
to a non const, cast const away.
2009-10-22 15:43:55 +02:00
Sylvain Munaut 82aa6843ba [abis_rsl] Fix rsl_encryption_cmd L3 length computation
msg->l3h doesn't have any coherent value at that point,
can't use that.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-09-27 11:13:18 +02:00
Harald Welte 08d91a5b26 A5 support for RSL and 04.08 (not used yet)
This just adds the 04.08 and RSL bits for A5, but not the logic
for performing authentication.

The caller would first set lchan->encr and then call
gsm48_send_rr_ciph_mode(lchan), which encapsulates the 04.08
CIPHERING MODE COMMAND into a RSL ENCRYPTION COMMAND and sends it
to the BTS for execution + forwarding.
2009-08-30 15:37:11 +09:00
Harald Welte 196d0528ff [abis_rsl] Set lchan->tch_mode properly when responding to CHAN_RQD
This fixes the 'only first call works' problem that some of us were
having with the nanoBTS.
(the field just happenned to be 0 == GSM48_CMODE_SIGN after startup)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-08-28 23:28:28 +09:00
Harald Welte (local) daef606502 respect the link_id, not only the SAPI from SMS code
SMS related messages are all sent over SAPI=3.  But in addition
to that, we also need to send it over the correct link identifier,
i.e. SACCH or main signalling channel
2009-08-14 11:41:12 +02:00
Harald Welte (local) 0e451d0f2e add 'ms max power' vty command to set the maximum MS power in dBm 2009-08-13 10:14:26 +02:00
Harald Welte 9c31b5eeca now that we send MRPCI, we can treat T_MSRFPCI error message as fatal 2009-08-10 14:43:59 +02:00
Harald Welte 99b4ecd78a Merge commit 'origin/master' 2009-08-10 11:43:52 +02:00
Harald Welte 115d1036d6 rename rsl_channel_release to rsl_rf_channel_release
and add some more comments to help understand the complex release
procedures.
2009-08-10 11:43:22 +02:00
Harald Welte 3c456d06e0 use proper message discriminator for MRPCI
Siemens overloaded the definition for location based services, so
our automatic determination of the message discriminator no longer
works fine.
2009-08-10 11:26:14 +02:00
Harald Welte 31c489390c make rsl_siemens_mrpci() use struct rsl_mrpci 2009-08-10 10:07:33 +02:00
Harald Welte 67fa91bf42 Add function to generate siemens-specific MRPCI RSL message
MRPCI (MS RF Power Indicator) informs the BTS about the power
capabilities of the MS.
2009-08-10 09:51:40 +02:00
Harald Welte 0b2124be48 set BS power to Pn == nominal output power
This is only relevant for TRX1, since TRX0 will always opwerate at constant
power.  However, when channels on TRX0 are activated, we should provide
a reasonable BS poewr level.
2009-08-10 00:45:40 +02:00
Harald Welte b7e8116bfa add T3101 to release lchan in case MS never responds to IMMEDIATE ASSIGN 2009-08-10 00:26:10 +02:00
Harald Welte 6c3d2edebf the RELEAESE MODE IE is mandatory 2009-08-10 00:19:36 +02:00
Harald Welte 3073a9f241 if we receive CHANNEL ACTIVATE NACK, we should release the lchan 2009-08-09 19:50:08 +02:00
Harald Welte 66b6a8dde0 move ms_pwr utility function to gsm_utils.c
also, they should both take the gsm_band parameter, not a BTS
2009-08-09 14:45:18 +02:00
Harald Welte 1c40927355 fix timer and linked list handling of new RLL code 2009-08-09 14:13:58 +02:00
Harald Welte edcc527371 Add new BSC RLL layer of code
A caller can call rll_establish(lchan, link_id) and a callback to the GSM RLL
code.  He will get called back if the RLL link is established or receives some
error message, or the establishment times out.

We need this for proper SMS implementation, where we need to restablish a SAPI3
RLL link before transmitting the actual CP-DATA messages.
2009-08-09 13:47:35 +02:00
Harald Welte d2dc1de9d9 start using the RLL RELEASE procedures
So far, we immediately disable the RF channel without following a proper
RLL RELEASE procedure.  This patch changes this.

If we locally terminate the connection, the channel allocator now triggers a
RLL RELEASE REQuest, which is responsed by the MS with a RLL RELEASE CONFirm,
based on which we send the RF CHANnel RELease to the BTS.

If the MS terminates the connection, we receive a RLL RELEASE INDication,
based on which we trigger RF CHANnel RELease to the BTS.
2009-08-08 13:15:07 +02:00
Harald Welte 602f2b88d6 fix \n at end of line of certain RSL debug messages 2009-08-04 02:50:21 +02:00
Harald Welte f89abbd16a alter initial MS RF power to 100mW 2009-08-04 02:31:55 +02:00
Harald Welte 2da8629b7c parse and decode Siemens specific T_MSRFPCI message 2009-08-04 02:31:05 +02:00
Harald Welte 9943c5bbac generalize channel activation / channel mode modify
* we only need one piece of code to calculate rsl_ie_chan_mode from
  our run-time data structures (gsm_lchan)
* add some more channel modes for TCH/H and data
* use enum's to make the compiler warn us about unhandled enum values
* make sure the caller determines the (signalling,speech,data) mode
2009-07-29 15:41:29 +02:00
Harald Welte 58ca5b7ae7 actually derive the ip.access speech mode from tch_mode
also make sure we always print the speech_mode on IPAC_BIND
and IPAC_CONNECT.
2009-07-29 12:12:18 +02:00
Harald Welte 470abb773b add support for more RSL channel modes 2009-07-29 11:38:15 +02:00