Commit Graph

20 Commits

Author SHA1 Message Date
Max 1a35cc801d cleanup some compile warnings 2015-12-31 14:06:03 +01:00
Sylvain Munaut 1ccc9f8822 target: Add support for IQ swap when required
Operation in GSM850 band requires IQ swap because of the offset PLL
used in the TRF causing spectrum reversal.

Thanks to Dieter Spaar for noticing the issue and the original patch

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:11 +01: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
Sylvain Munaut f04f53d3b7 target/rf: Make the trf6151_set_arfcn use ARFCN_UPLINK flag to select UL/DL
This way we can independentely control what frequency we want and
wheter we want to TX or RX. This allow TX on DL band and RX on UL band.

This also means all call to tx_window setup now need to properly set the
ARFCN_UPLINK flag !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-01-28 13:15:18 +01: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 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 78fc76cc8f fw/layer1: Add common TPU win setup/cleanup code
Instead of each primitive doing it independently, if there is a TPU
scenario in one of the item, we do a common setup with the base tn
returned by rfch_get_params.

Then each rx / tx window setup is relative to that 'base tn'. For
TX window, you have to explicitely request an offset of 3. (this
would allow for some test code to TX on ts=0 for eg.)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut 68c40addf7 fw/layer1: Convert primitives to use common DSP/TPU scenario ending
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut f06d54ed6f fw/layer1: Add a priority field for sched_item
Each item has a priority associated to it. The standard is :
-4    -> Responses processing
-3    -> L1S parameters changes
-2    -> [Reserved for TPU window setup]
-1    -> (anything)
 0..7 -> Commands relative to time slot n
         (relative to current l1s main timeslot)
 8    -> (anything)
 9    -> [Reserved for TPU window cleanup]
10    -> (anthing)

Note that with this modification, an item scheduled for the
current frame from within a call back won't have its priority
respected !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Andreas.Eversberg 59894035c5 [layer1] Fixed double IRQ bug
During IRQ handling, disabling and enabling IRQ may cause the same IRQ to
fire again. This is because the condition for this IRQ may be fullfilled
again, while still handling it. Using local_firq_save() and
local_irq_resore() intead, the IRQ handling will be completed before it is
cleared, and may then fire again.

The problem was detected during process of messages from layer23 to layer1.
In the IRQ context, the TX-functions of l23_api.c are called. There,
messages are queued and events are scheduled. During access to a queue or
a scheduler from any IRQ context or from normal context, interrupts must be
locked to prevent nested calls.

If it is not desired to call l23_api.c inside IRQ context, a message queue
must be used. If a message is written to that queue, it must be locked.
Afterwards a signal must be sent to the main process. The main process
locks the queue and de-queues the message. This is how it is done by all
layer 1 drivers of mISDN.
2010-09-12 13:49:41 +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
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 1453c43202 layer1/tpu_window: Add experimental support for TS != 0
This is flawed, but allows testing ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-28 21:40:01 +02:00
Harald Welte 806da1525b [layer1] use __attribute__ ((constructor)) for completion initializers 2010-06-24 13:30:56 +02:00
Harald Welte 3660a25d3c [layer1] Fix RACH completion (don't use FB completion callback) 2010-06-20 19:20:42 +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 64b4a7a585 [layer1] Add L1CTL_RACH_RESP to confirm that a RACH request was sent 2010-06-20 18:13:14 +02:00
Harald Welte 452bc18470 cosmetic/whitespace change 2010-05-17 09:23:35 +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