Commit Graph

70 Commits

Author SHA1 Message Date
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
Max 1a35cc801d cleanup some compile warnings 2015-12-31 14:06:03 +01:00
Felix Domke 8a2e935cdb layer1: fix chan_nr2mf_task_mask for TCH/H channel
"multiframe", the frame layout (used to compute neighbor
cell monitoring pattern) was uninitialized in TCH/H case.

This, in combination with gcc optimizing the
"switch(multiframe)"-statement into a LUT without bounds-
checking (since using an uninitialized value is undefined
behavior) caused neigh_task to be filled with an out-of-
bounds value, eventually crashing the TDMA scheduler.

Written-by: Felix Domke <tmbinc@elitedvb.net>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-07-21 13:19:16 +02:00
Andreas Eversberg e7997163b2 Fixed neighbour cell measurement task for SDCCH/8 multiframes
Only on BCCH's multiframe we are allowed to measure on frames 0, 10, 20,
30, 40. On SDCCH/8 multiframe, measurements are performed on frame 50
only.
2012-03-29 09:07:57 +02:00
Steve Markgraf 978ec28b71 firmware: add missing includes
This fixes all 'implicit-function-declaration'-warnings.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-12 23:43:05 +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
Andreas Eversberg 40fc521088 layer1: Fixed power measurement, adding ARFCN wrapping
Power measurement returned the first measurement result twice, now it is
returned only once.

Wrapping of ARFCN allows to measure the E-band en block. After measuring the
ARFCN 1023, the ARFCN wraps to 0. Special flags like ARFCN_UPLINK or
ARFCN_PCS are preserved while wrapping.
2012-01-28 13:16:14 +01:00
Andreas Eversberg 6ab18bedb1 firmware/layer1: Using queue to process received l23 frames in main loop
Instead of processing the frames out of the interrupt context, they are
queued until serial interrupt returns and main loop is processed.
2012-01-28 13:14:45 +01:00
Andreas Eversberg c4701d4204 Added callback function to forward L1CTL packets to rather than SERCOM
This is experimental, maybe there should be a better way to do that.
2012-01-28 13:13:38 +01:00
Sylvain Munaut de4f00d931 target/fw/sim: SIM Layer 1 driver
Originally written by dexter and then Andreas did a lot of cleanup
work to bring it into shape for inclusion in master

Written-by: Philipp Maier <zero-kelvin@gmx.de>
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Sylvain Munaut e809248b66 fw/layer1/l23_api: Add processing of the new audio_mode
This currently just stores it into the l1 sync state struct

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Sylvain Munaut 643aad2ef4 fw/l1: Add a queue for traffic frame to send to network (TRAFFIC_REQ)
Also hard limit to maximum 4 pending frames (should not happen !), the
upstream is supposed to do its own flow control.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
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 74e7535ea2 [layer1] Adding neighbour cell measurement code to layer1.
When listening to BCCH, layer1 may measure the power level of neighbour
cells. A list of neighbour cell frequencies need to be sent to layer1.
After the measurement is done, the results are indicated to layer23.
2011-07-17 09:41:19 +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
Sylvain Munaut 45890fe657 fw/layer1: Resync TCH primitive on mode changes
This is needed for audio to work properly in VEA mode

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-27 16:07:30 +01: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 8c9b8f446f target/fw/l23_api: Enable/Disable audio path appropriately
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:32 +02:00
Sylvain Munaut 69c84c45e5 target/fw/l23_api: Properly sync tch in DM EST REQ
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:32 +02:00
Sylvain Munaut f1d942b8f4 target/fw/layer1: Add support for the various TCH multi frame tasks
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:32 +02:00
Sylvain Munaut 61fdec01f5 fw/layer1: Process the tch_mode and store it for later use
Currently unused since no TCH support ...
Will be used by future commits.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:19 +02:00
Andreas.Eversberg 732f102cc2 fw/layer1: Add support for measurement messages from layer2/3
Written-by: Andreas.Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Sylvain Munaut aef1e05d9a fw/layer1: Introduce prim.h for all primitive related things
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Sylvain Munaut 6c6b073f54 Remove the various checks for high TS as those should now work
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:23 +02:00
Sylvain Munaut daa8630468 target/layer1: Implement host-driven Tx power control
It's up to L23 to change the parameters using the appropriate
L1CTL call.

This is a mix between Harald's version and Dieter's version of
the TX control code.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:22 +02:00
Sylvain Munaut 3cdabae2cf fw/l23_api: Fix cut&paste typo in comment
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut df0f386cdb fw/layer1: Properly set/reset ciphering parameters when needed
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut 54b77bc07e fw & layer23: Remove limitation about the SDCCH subchannel 4..8
This is now supported :)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Andreas.Eversberg 04ffc9bdc0 [layer1] Fixed memory leak issue after releasing dedicated mode
While releasing dedicated mode, pending SDCCH and SACCH messages need to be
flushed. Without it, it would also cause old pending messages to be sent
during next dedicated mode.
2010-09-14 19:13:36 +00:00
Andreas.Eversberg 3967b5a1a2 [layer1] Added frequency change control to layer 1 (L1CTL_FREQ_REQ)
The given new frequency set will be used at given frame number.
If the frame number is already reached, the frequency set will be changed
directly.

The functionality has been successfully tested.
2010-09-11 18:10:14 +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
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
Sylvain Munaut a4b1b1bcc1 layer1/l23_api: Fix the L3_MSG_SIZE to include l1ctl header size
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:51:14 +02:00
Sylvain Munaut 7d84bf5e38 layer1: Fix DM_REL_REQ to release all dedicated state
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-15 16:43:54 +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 0719e9ac7d [layer1] Added mf_off to shedule next RACH request.
The mf_off value defines the offset of multiframes.
2010-07-13 13:58:41 +00:00
Sylvain Munaut 08aa1e7615 layer1/l23_api: Use the fn51 given in the l1a_rach_req
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-28 23:13:12 +02:00
Sylvain Munaut 2d843b8be1 layer1/l2a_api: Update DM EST REQ limitations
Try to be more precise about what's supported and what's not

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-28 21:40:01 +02:00
Andreas.Eversberg 4e03d6f822 [layer23] Fixed DM est./release for current supported channel types.
Now layer23 supports selecting TS 0-4 with SDCCH/8 channels.
But some tests showed me that it doesn't work. Please help debugging.

Added DM release function to l1ctl.c and gsm48_rr.c.
2010-06-26 09:35:27 +00:00
Harald Welte d919186ca4 [l1ctl] add dedicated mode release request 2010-06-25 18:00:16 +02:00
Harald Welte 207c3a6c2c [layer1] remove superfluous rx_window call
The prim_fbsb code internally will set up the right arfcn/window,
so there is no need to repeat it.
2010-06-25 16:54:02 +02:00
Harald Welte bc860c43c2 [layer23] use the TSC that is passed from L1 when going in dedicated mode 2010-06-24 18:57:28 +02:00
Sylvain Munaut f92038e7c0 layer1: Introduce a decicated channel state in l1s
We also make sure to set it properly during a DED EST REQ.
The state is currently unused tough.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-24 18:57:28 +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 15c584ef62 fw/layer1/l23_api: Process each message in a function
Instead of processing directly in the switch, we put
real ..._rx_... functions to make things clearer.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:37:09 +02:00
Sylvain Munaut 5d253a2828 fw/layer1: Fix compiler warning about mismatched ptr types
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:37:09 +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 9a44046765 [layer1] add missing break statment at end of switch() 2010-06-20 19:43:57 +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