Commit Graph

48 Commits

Author SHA1 Message Date
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
Harald Welte fa899ddf58 [Layer1] Allow for some jitter in TDMA lost interrupt detection
The need for this has been pointed out by Sylvain...
2010-07-15 10:32:44 +02:00
Sylvain Munaut f2190983c8 fw/layer1: When resetting hw, reset both SYNCHRO & OFFSET to l1s.tpu_offset
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:36:18 +02:00
Harald Welte e05dfe99f1 [layer1] Introduce function to reset the gsmtime scheduler 2010-06-20 18:44:27 +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 dbfa321c42 layer1: Disable FIQ as well as IRQ for locking between L1S and L1A 2010-05-17 09:23:35 +02:00
Harald Welte 5da81b609e layer1: add missing header includes for local_irq_save() 2010-05-17 09:23:35 +02:00
Harald Welte 2c852e9bcc layer1: remove 'l1s_cb' and l1_signal mechanism
the l1s signal was an old mechanism between l1test and the layer1
before we introduced the L1CTL protocol.  This commit removes all
leftover references to it.

It also disables the l1test app, as it would no longer work without
major modifications (using l1ctl from within the phone).
2010-05-17 09:23:35 +02:00
Harald Welte ea3b3826f2 layer1: introduce concept of a 'l1 completion'
The idea is that the L1S part can schedule a completion handler which
will then execute in the asynchronous L1A part.  This should keep the
FIQ priority L1S extremely short, deferring most of the work into
the L1A part that runs in regular process context.
2010-05-17 09:23:35 +02:00
Sylvain Munaut 2afc002e12 fw/layer1: Encapsulate mframe scheduler function better
There was some code meddling with mf_tasks directly. This is
fine if it's just setting/clearing a bit but since we're
gonna need some 'cleverness' into when to activate what to prevent
conflict, it's better to abstract that logic.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-28 10:17:04 +02:00
Sylvain Munaut ce51a07fef Remove some gsm time keeping utils now in libosmocore
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-28 10:16:29 +02:00
Sylvain Munaut 5571e573f3 fw/layer1: Fix a printf warning uint32_t is 'long unsigned'
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-28 10:14:24 +02:00
Harald Welte 5f751d3db8 layer1: move FB and SB detection into prim_fbsb.c 2010-04-09 21:32:56 +02:00
Harald Welte a955cfd4e2 layer1: move normal burst receive code to prim_rx_nb.c 2010-04-09 21:25:13 +02:00
Harald Welte f8eb577fe1 layer1: move transmit normal burst routines to prim_tx_nb.c 2010-04-09 20:02:16 +02:00
Harald Welte f7af19661a layer1: reorganize code, introduce prim_{pm,rach}.c
The new plan for layer1 is to structure the source code not based on
whether it is part of l1s/l1a or other parts, but based on 'primitives'.

All code that relates to transmitting a RACH burst should be in one
file, same for all code related to power management.  Those files are
called layer1/prim_*.c
2010-04-09 19:56:12 +02:00
Harald Welte 48dfd41e7c layer1: add 'struct mon_state' argument to read_{fb,sb}_result()
rather than operating on a global variable.
2010-04-07 07:35:41 +02:00
Harald Welte a8878aaaa5 layer1: coding style cleanup
I didn't touch the TX side, as it is still very fragile...
2010-04-07 07:35:41 +02:00
Harald Welte 25a8aa8798 layer1: reset l1s.sb.count to 0 in l1s_rest()
When we reset layer1, the SB counter should be set to 0 again to
correctly perform multiple SB l1 tasks without rebooting.
2010-04-07 07:35:41 +02:00
Harald Welte 9319ac57a1 layer1: remove sb_cnt and sb_once static global variables
and instead move them into the l1s data structure
2010-04-07 07:35:41 +02:00
Harald Welte 63b898b1f9 layer1: remove static global variable last_task_fnr 2010-04-07 07:35:41 +02:00
Harald Welte bb1ff47273 layer1: cosmetic cleanup 2010-04-07 07:35:41 +02:00
Harald Welte 52ba855271 layer1: replace fb_once with l1s.fb.mode
It's time to get rid of some of the old global static variables.
2010-04-07 07:35:41 +02:00
Harald Welte 4e47a7a6ce layer1: properly reset fb_once and sb_once when syncing to new cell 2010-04-06 10:00:16 +08:00
Harald Welte 2bfeb17e06 l1ctl protocol: Introduce multi-part message DONE flag
In case a single request from L2 triggers multiple response messages
from L1, we need a way to signal via L1CTL if the response is the
final or some intermediate response.
2010-04-05 22:19:49 +08:00
Harald Welte d40071b3b0 layer1: include last ARFCN of PM range in report 2010-03-27 19:20:22 +08:00
Harald Welte 1e4d22cb5f Implement L23-triggered L1 power measurement scan
Now layer23 can ask L1 to scan an entire range of ARFCN's and do power
measurements.  This is the first step in the cell (re)selection process.
2010-03-27 18:42:43 +08:00
Harald Welte bee63154c4 L1A/L23 interface (L1CTL) cleanup
* introduce a new 'l1ctl_hdr' structure common to all messages
  on this interface
* use struct l1ctl_hdr in both the firmware and layer23
* add a new L1CTL_PM_REQ request for performing layer23-initiated
  power measurements (firmware does not implement them yet)
2010-03-21 12:57:28 +08:00
Harald Welte 75b6fe2d84 remove 'l1s.task' value for local DSP task checking
As the check no longer works with our higher-levle schedulers,
we can remove this field from the l1s structure and all references
to it.
2010-03-17 19:21:46 +08:00
Harald Welte 97c8b6f33b start to use libosmocore within the firmware
* remove linuxlist.h copy and use osmocore
 * don't put 'struct gsm_time' into l1ctl packets
 * include rx_level and snr for each burst in l1ctl
 * properly build libosmocore.a for target
 * move gsmtime functions into libosmocore
 * move ctype.h to standard location
2010-03-07 20:56:12 +01:00
Harald Welte a4bb938b39 fix even more compiler warnings 2010-03-07 13:44:52 +01:00
Harald Welte 279cc2e3d8 fix compiler warnings 2010-03-07 13:27:25 +01:00
Harald Welte 6037588fec layer1/sync: denote unused function arguments with __unused 2010-03-07 13:21:03 +01:00
Harald Welte 86dced0b2d ensure RF_ARFCN is part of l1ctl messages sent to host 2010-03-04 20:03:00 +01:00
Harald Welte ba18970f83 Layer1: various fixes + debugging aid
* print HDLC packets received from L2
* print Tx MAC block as it is written to DSP API RAM
* ensure we don't msgb_free() a message that we've enqueued for l1s
2010-03-03 13:55:51 +01:00
Harald Welte d43fadf410 fix merge artefacts, make firmware build again 2010-03-02 20:25:02 +01:00
Harald Welte 092d57bef9 Inter-Layer intergration work
L1 and L2 now pass UI frames like BCCH and CCCH downlink up into
L3, which detects an IMMediate ASSignment command and instructs
the L1 to switch to SDCCH/4.

From this point on, SDCCH/4 and SACCH4/C messages end up in our
L2 LAPDm implementation and are forwarded to L3.
2010-03-02 18:47:01 +01:00
Harald Welte 43dd25c493 Include channel number and link identifier in L1 DL info
This enables the layer2 to identify on which channel
(BCCH/CCCH/SDCCH/TCH/...) the respective message was received.
* Encode MFrame Task Number + SACCH info in 'p3' parameter
* Generate channel number and link identifier
* Decode channel number in layer2 program
2010-03-01 23:48:45 +01:00
Harald Welte 2f60aee6d9 extend TDMA scheduler functions to use third parameter (p3)
The idea of the third parameter is that it can be specified on a
tdma_schedule_set() level.  The multi-frame scheduler can thus use
it to pass some context information into the l1s_{cmd,resp}_*()
functions, such as the MF TASK and whether or not it is SDCCH or
SACCH.
2010-03-01 23:48:45 +01:00
Harald Welte 3e7861e937 Add and use gsmtime scheduler to L1S 2010-03-01 23:48:44 +01:00
Harald Welte 023289de74 Layer1 Sync support for TX of Normal Burst and RACH burst
Using the new rach_sched_set_ul and nb_sched_set_ul TDMA scheduler
sets it is possible to transmit RACH bursts as well as sets of four
normal bursts, i.e. everything needed to get a SDCCH established
on a combined CCCH (with SDCCH/4).

Known Limitations:
* Uses constant transmit power (2 dBm)
* Only works on SDCCH/4 so far
* SACCH is received but cannot be transmitted yet
* TSC (traning sequence code) is hard-coded to '7'
2010-03-01 23:48:44 +01:00
Harald Welte 59b128a679 layer1/sync: Add msgb queues for transmit/uplink to l1s data structure 2010-03-01 23:48:44 +01:00
Harald Welte ca9f6eea61 Use new multiframe scheduler for scheduling of normal bursts 2010-02-28 10:15:35 +01:00
Harald Welte b909a3b8a6 Add multiframe-level scheduler (mframe_sched.[ch])
This scheduler enables us to schedule repeating events that occur
every multiframe.  It e.g. includes definitions for BCCH and CCCH
reading.

The mframe_sched is layered on top of the tdma_sched.
2010-02-28 10:12:14 +01:00
Harald Welte 89e05fd346 tdma_sched: Explicitly advance the bucket at end of l1_sync() 2010-02-28 10:06:19 +01:00
Harald Welte c468741500 explicitly terminate the TDMA scheduler set with SCHED_END_SET()
This has the advantage that any caller or other reference does not
need to know the size of the set, which makes it simpler to use the
sched_set as a constant initializer in some other const/static data
structure.
2010-02-27 21:20:42 +01:00
Harald Welte 2df0b01363 frequency error is actually twice of what we thought.
The cause is really not clear.  The formual using 2*Pi to convert
from radians to frequency is perfectly correct.

However, measurements with various test equipment (including Racal 6103)
have shown our frequency error estimate is always off by a power of two...
2010-02-18 19:32:07 +01:00
Harald Welte fbe7b94c9c Initial import of OsmocomBB into git repository 2010-02-18 16:46:36 +01:00