Commit Graph

62 Commits

Author SHA1 Message Date
Vadim Yanitskiy a6c837cd98 l1gprs: implement UL BLOCK.cnf (L1CTL_GPRS_UL_BLOCK_CNF)
Change-Id: I56e0b5631c7446390adbfc5664e56f56ebb88cc1
2024-02-05 15:33:54 +00:00
Andreas Eversberg 23d46f003f ASCI: Add UIC support to random access burst
A different identity code can be used on uplink access bursts on voice
group channel. This is optional for the network, but mandatory for the
MS side. If the network does not define a UIC, the BSIC is used instead.
BSIC is used for RACH channel and handover.

Related: OS#5364
Change-Id: I4039734676949aefa5be4b5298764b8ba7e1b8ed
2023-09-28 10:42:38 +02:00
Andreas Eversberg 28d9a4880c ASCI: Add a flag to turn transmitter off or on
This flag can be used to turn transmitter off for "group receive mode"
or for handover procedure. The flag is stored in the channel description
of the mobile application. It is sent to layer 1 when switching to
dedicated channel or when changing TCH mode.

At the layer 1 the transmitter is turned off while the receiver is still
active. This is done by:

 * scheduling a TX dummy task for TCH bursts
 * scheduling no TX task for SACCH bursts
 * not enabling the transmit window

Related: OS#5364
Change-Id: I20133523adc3b204cd2181bfe664fe66020a10e3
2023-09-27 14:02:41 +00:00
Pau Espin fa833e4095 l1gprs/l1ctl: Decouple RTS.ind from DL_BLOCK.ind
Before this patch, the RTS:ind was crafted up in the stack when
receiving the DL_BLOCK.ind. This created some problems since the
internal low level state has to be updated in between signalling
DL_BLOCK.ind and RTS.ind, as there's a fn-advnace of one block between
those 2 signals (hence the timeslot allocation has to be applied at the
time when the fn-advance is applied).
This is actually not fixing the whole issue, since there's several
timeslots and hence the following events will have the internal timeslot updated
during the event in the middle, hence potentially causing problems in the
remaining TS:
DL_BLOCK.ind(FN=N, TS=1),  RTS.ind(FN=N+4, TS=1), DL_BLOCK.ind(FN=N, TS=2)

In any case, this decoupling already improves the situation and is step
needed anyway towards fully fixing the problem (by, for instance,
maintaining a timeslot state duplicated both for DL and Ul directions,
since they drive based on differnet FN time (1 PDCH block).

Change-Id: I1494e0aac7555f6e01b4b435b77140afc42c098e
2023-09-04 22:34:08 +00:00
Vadim Yanitskiy 71e39bccf1 l1gprs: implement TBF starting time support
Change-Id: I174e3c43d2f4c828a528710b284e62c9bb794122
Related: OS#5500
2023-08-24 15:47:54 +02:00
Vadim Yanitskiy fb384998fb trxcon: properly handle PDCH slotmask in UL/DL TBF CFG.Req
Change-Id: I4c2ff25217fba0b6b4704f023071b86ed9afb55c
Related: OS#5500
2023-08-11 19:47:32 +02:00
Vadim Yanitskiy 8b4640ec19 l1ctl_proto: add 'start_fn' field to UL/DL TBF CFG.req messages
Change-Id: Ibb6a05165fe1c81268fb0e3674adae4065e78171
Related: OS#5500
2023-08-10 15:16:49 +02:00
Vadim Yanitskiy d0a1ec6204 l1gprs: reorder #includes, add missing <stdbool.h>
Change-Id: I6fe3b5d85c79a28bc116155c75f7ccd012007f56
Related: OS#5500
2023-04-26 16:40:54 +07:00
Vadim Yanitskiy 080310982d l1ctl_proto: fix unpacked struct in l1ctl_gprs_dl_block_ind
The __attribute__((packed)) does not apply to inner structures.
I found this problem when testing the new TTCN-3 message definitions.

Change-Id: I90e74330073a9090c2638fc3175ff0216b0da5ec
Related: OS#5500
2023-03-18 17:43:47 +07:00
Vadim Yanitskiy 2b462dd89d {trxcon,virt_phy}: shared GPRS L1 (MAC) implementation
Change-Id: I9567d64f9d00262e36147e8d7e541e5e246bda5f
Related: OS#5500
2023-03-17 12:15:29 +00:00
Vadim Yanitskiy 0f06148896 l1ctl_proto.h: explicitly assign message type values
Explicit is better than implicit.  Having the message type values
assigned explicitly allows rearranging messages in the middle
without affecting the message type values following them.

Change-Id: I1ec32289a24c5704ea0676b508cb12ee0b4890d7
2023-02-27 22:56:32 +07:00
Pau Espin a53e93fe9c trxcon: Initial support for forwarding AMR
This allows TTCN3 L1CTL module (used in BTS_Tests) to transmit and
receive AMR payloads towards osmo-bts-trx.

Related: SYS#5987
Change-Id: Ia20bc96e39726a919a556c83c8be48cb31af7331
2022-09-07 00:01:53 +07:00
Oliver Smith 1741372556 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I73be012c01c0108fb6951dbff91d50eb19b40c51
2021-12-14 12:52:04 +00:00
Vadim Yanitskiy 7c7632de3e firmware: add possibility to configure TCH loops in the DSP
Change-Id: Ide7b0527ad64a044977a10da4a82a8ecd1fbd8dc
2020-07-31 00:42:01 +07:00
Vadim Yanitskiy 5e473cb478 l1ctl_proto.h: add extended RACH (11-bit) request message
According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit)
Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS
capability. One of the alternative synch. sequences (see 3GPP TS
05.02, TS1 and TS2) shall be used.

Change-Id: Iae0267a31b3314c990eb41acb2f570ca3219021c
2019-04-22 05:10:13 +07:00
Vadim Yanitskiy 219ed20cb5 l1ctl_proto.h: use flexible array member for traffic messages
Unlike the DATA messages, traffic frames may have different length.
Instead of having fixed payload (i.e. TCH frame) length, let's
introduce a flexible array member. This would allow one to
calculate the frame length using the MSGB API.

Change-Id: I119fa36c84e95c3003d57c19e25f8146ed45c3c6
2018-11-05 05:13:57 +00:00
Vadim Yanitskiy a49b63ce5a l1ctl_proto.h: extend ccch_mode enum with CBCH
According to GSM TS 05.02, there are two ways to enable CBCH:

  a) replace sub-slot number 2 of CCCH+SDCCH/4 (comb. V),
  b) replace sub-slot number 2 of SDCCH/8 (comb. VII).

Unlike SDCCH/8 (case b), CCCH+SDCCH/4 can be allocated on TS0
only, and shall not use frequency hopping. This means that
implementing CBCH support on SDCCH/8 would require much more
efforts than on combined CCCH+SDCCH/4, as in last case CBCH
messages can be received without the need to switch from
idle to dedicated mode.

This change introduces a new ccch_mode item, which should be
used by the higher layers to indicate presence of CBCH channel
on C0/TS0, so the PHY would enable decoding of CBCH messages
on CCCH+SDCCH/4 (case a) in idle mode.

Regarding to CBCH on SDCCH/8 (case b), it makes sense to
extend the 'l1ctl_dm_est_req', so it would be handled in
dedicated mode on request from the higher layers.

Change-Id: Ia94ebf22a2ec439dfe1f31d703b832ae57b48ef2
2018-10-03 08:37:11 +00:00
Vadim Yanitskiy 2d911d7842 include/osmocore: remove unused headers
Both removed headers are not used anywhere, and probably left
from the time when there was no libosmocore as a shared library.

Change-Id: I821e2958e07176c1031c636019dffd1cee62bb10
2018-05-20 15:26:40 +03:00
Vadim Yanitskiy a4d255269a L1CTL/L1CTL_CRYPTO_REQ: add key length and channel info
Previously, the L1CTL_CRYPTO_REQ message contained only a ciphering
algorithm and actual Kc key to be used. The key length was
calculated manually using the MSGB API.

Let's avoid manual calculations here, as it may cause unexpected
behavior if the message structure is changed. Also, let's fill
the UL header with minimal information about a channel, which
is going to be encrypted.

Change-Id: I5fab079907c5276322d3ec2b46cab81f10c7ed09
2018-03-14 22:22:39 +07:00
Sylvain Munaut 9fa291dd2b l1ctl_proto.h: define burst indication messages
One burst indication message carries a single raw burst, forwarded
to the higher layers from DSP. The burst bits are hard-bits (0 or 1)
coming from demodulator, packed to 14.5 bytes. This is why we call
them 'raw' - no bit correction nor deciphering is performed.

Related: OS#1672
Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
2018-02-06 02:56:31 +07:00
Harald Welte b2c19fc5d3 VIRT-PHY: Add support for GPRS / TBF mode
we add a new STATE_TBF to vthe MS model and add some L1CTL primitives
to configure that TBF mode as well as to enqueue transmissions for
blocks at a given USF+TS.

Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a
2017-08-20 22:19:17 +02:00
Harald Welte 73a809e57b Tell L1CTL_FBSB_REQ the expected received signal level
As Dieter points out, this drastically improves the resiliance to high
receive levels on the C155.  We cannot blindly assume a received signal
level of -85 dBm if the BTS is 2m away and we actually receive -40 dBm.

This patch extends the L1CTL_FBSB_REQ data structure in layer 1 with the
respective field, as well as the l1ctl_tx_fbsb_req() API function called
from the various layer23 apps.

"mobile" and "bcch_scan" already did a PM request and thus know the
expected signal power.  "ccch_scan" and "cbch_sniff" apparently don't
do, so the -85 dBm constant is now hardcoded into the host-side source
code there, and should probably be fixed in a follow-up patch.
2012-11-20 10:13:44 +01:00
Andreas Eversberg 7cc4a4b324 Improvement of neighbour cell power measurement task.
5 measurements are now performed during a 51 multiframe. They are performed
at one of the 5 FCCH.

Additionally a timeslot offset can be given for each measurement. This way
it is possible to measure each timeslot seperately. The given ARFCN must be in
sync with the serving cell.
2012-02-04 00:04:58 +01:00
Sylvain Munaut 7855e405cf l1ctl: Add definitions for the audio_mode configuration
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Sylvain Munaut c7d20dfc41 l1ctl: Add definition for TRAFFIC_{REQ,CONF,IND}
Also adapt packet creation length in L1

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Andreas Eversberg 87c597abf6 [layer23] Adding neighbour cell measurement to L1CTL interface. 2011-07-17 09:36:49 +02:00
Pablo Neira Ayuso ade79a0083 src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
This patch changes include paths to get osmocom-bb working with
the current libosmocore tree.

Among all these renames, you can notice several tweaks that I
added on purpose, and that require some explanation, they are:

* hexdump() in osmocon.c and osmoload.c has been renamed to avoid
clashing with hexdump() defined in libosmocore.

* gsmmap now depends on libosmogsm. Actually I had to cleanup
Makefile.am because I was experiencing weird linking problems,
probably due to a bug in the autotools. With the change included
in this patch, I got it compiled and linked here correctly.

This patch has been tested with the phone Motorola C123 and the
following images files:

* firmware/board/compal_e88/hello_world.compalram.bin
* firmware/board/compal_e88/layer1.compalram.bin

Using the osmocon, bcch_scan and mobile tools.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-04-26 02:55:30 +02:00
Andreas.Eversberg 072d7dd4bf target/fw/layer1: Change L1CTL RACH req to properly use all slots
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-30 17:31:09 +02:00
Sylvain Munaut 9257fe53bf l1ctl: Add initial tch_mode value in DM_EST_REQ
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Andreas.Eversberg 602dcf4d0d [layer23] Added support for changing TCH mode via L1CTL messages 2010-09-26 17:06:06 +00:00
Andreas.Eversberg 0856c8a6a5 [layer23] SIM client completion
The SIM client is now complete. Because it usefull for multiple
applications, i moved it to the layer23/src/common directory.

The SIM reader works together with mobile process. Fixes were made.
Thanx to all for testing, finding bugs, and making it work as it is
supposed to do.

The current version uses special L1CTL messages to send and receive APDUs.
This will change in the future, when BTSAP interface is completed.

Please note that this client will not work until the layer1 SIM reader
fixes and extensions are committed.
2010-09-18 19:15:15 +00:00
Andreas.Eversberg fa686fd4c9 [layer23 / layer1] Added interface for changing crypto mode of DSP
The layer23 will now set crypto mode and key when CIPHERING MODE COMMAND is
received. After crypto mode has been set, CIPHERING MODE COMPLETE is sent.

NOTE: Layer1 implements only the interface, there is no functionality to it
yet.
2010-09-11 12:10:31 +00:00
Andreas.Eversberg ac98bbe971 [l1ctl] Introducing L1CTL_FREQ_REQ to change frequency hopping sequence
This is only the header, so there is no functionality yet. The
functionality for layer1 works, but it is not yet ready for commit.

This commit is required for radio ressource protocol commited later.
2010-08-21 15:02:32 +00:00
Sylvain Munaut d1028f49a3 l1ctl_proto: Use an enum for the message type rather than #defines
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:51:45 +02:00
Sylvain Munaut 09b2ed2f3a l1ctl_proto.h: Fixup name of the guard ifdef
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:51:39 +02:00
Sylvain Munaut c382fbf943 include: Rename l1a_l23_interface.h to l1ctl_proto.h
The interface between l1 and upper layer is called by several
name. IMHO l1ctl is shorted and sounds good so try to unify
using that.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:51:29 +02:00
Andreas.Eversberg c6ff4723ce [layer 1] L1CTL_PARAM_REQ is introduced to change TX power and TA.
Currently only TA (timing advance) is supported. It ranges from -128 to 128.
2010-07-13 14:07:37 +00:00
Andreas.Eversberg 9a422ceb25 [layer 1] Reset option for scheduled frames.
This is usefull to drop a scheduled RACH request after an IMM.ASS is
received.
2010-07-13 14:03:13 +00:00
Andreas.Eversberg f2b1e55c1e [layer23] Updated layer23 to current L1 support and forthcomming hopping. 2010-06-28 13:33:14 +00:00
Harald Welte d919186ca4 [l1ctl] add dedicated mode release request 2010-06-25 18:00:16 +02:00
Sylvain Munaut 16cd41e809 l1a_l23_interface: Update DM EST REQ format
We include all the parameters we're gonna need to support
TS!=0, hopping, TSC, ...

We also assume the upper layer have decoded the low level
bit fields and gives us neat accessible variables and a
sorted ARFCN array for the Mobile Allocation

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-24 18:57:28 +02:00
Sylvain Munaut 38c6b4b35a fw/layer1: Add support CCCH combined/non-combined
We introduce the concept of CCCH mode. It can be either
 - NONE: receive BCCCH only
 - COMBINED: CCCH on a BCCH/CCCH+SDDCH/4
 - NON_COMBINED: CCCH on a BCCH/CCCH

There is also a new command to change the mode without having
to do the resync.

Currently, we keep the previous default behavior of requesting
a combined CCCH by default

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:37:09 +02:00
Harald Welte c819bd88b1 [L1CTL] Introduce completion for transmit of L2 frame
Every time we have completed the transmit of a L2 frame (mac block),
we send L1CTL_DATA_CONF up to L2.
2010-06-20 19:21:32 +02:00
Harald Welte 281ea80498 [L1CTL] rename primitives to comply with official naming s/_REQ/_CONF/
When L23 issues a REQ, we should respond with CONF, rather than _RESP
2010-06-20 19:10:21 +02:00
Harald Welte cb38815c0b [L1CTL] Introduce L1CTL_RESET_RESP
1) On boot, L23 is notified by L1CTL_RESET_IND:
2) At any time, L23 can call L1CTL_RESET_REQ and get a
   L1CTL_RESET_RESP once the reset has been performed.

Also, there is no 'l1ctl_info_dl' in the RESET_IND anymore, as it
is useless.
2010-06-20 18:44:28 +02:00
Harald Welte cdc91973ee [L1CTL] rename L1CTL_RESET to L1CTL_RESET_IND
and define a new structure that indicates the type of reset
2010-06-20 18:44:27 +02:00
Harald Welte 64b4a7a585 [layer1] Add L1CTL_RACH_RESP to confirm that a RACH request was sent 2010-06-20 18:13:14 +02:00
Harald Welte 5e2f9900e5 L1CTL: Include num_biterr/fire_crc in downlink info + proper alignment/padding 2010-05-29 12:47:07 +02:00
Harald Welte cb71b972bd Make new L1CTL_FBSB_REQ work reliably
* port 'mobile' application to new l1ctl_tx_fbsb_req()
* make sure we have a proper downlinke header in front of l1ctl_fbsb_resp
* remove duplicate band_arfcn member of struct l1ctl_fbsb_resp
* reset the AFC to its default value when starting new FBSB task
* remove bogus l1s.sb.{synced.count} variables
* allocate msg and send l1ctl_fbsb_resp() only from process context, not FIQ
* properly report SNR and BSIC in fbsb_resp
* introduce arbitrary SNR thresholds for FB0->FB1 and FB1->SB switching
2010-05-20 23:26:42 +02:00
Harald Welte 8978ec571e layer1/l1ctl: Split L1CTL_NEW_CCCH_REQ in FBSB_REQ nad SYNC_REQ
We really want to have those two as distinct operations - and we
want proper state machines in L1 to quickly return if they've
managed to acquire a FB or SB or not.  Otherwise scanning will
take ages...

This code now introduces a new l1ctl_fbsb_req that is sent via
L1CTL to ask for a bitmask of FB0/FB1/SB operations.  The actual
FB0/FB1 detection now no longer runs for 500 TDMA interrupts
but completes as soon as we either know there is no FCCH,
or that our frequency error is smaller than a caller-specified
threshold.

FB0/FB1 are already working, SB is not yet, sorry.
2010-05-19 21:41:24 +02:00