summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/layer1
AgeCommit message (Collapse)AuthorFilesLines
2019-05-23[WIP] HO: Add RX only mode for handoverAndreas Eversberg2-0/+15
When establishing dedicate mode, a flag is used to disable transitter. When transmitter is disabled, access bursts are allowed. After sending a L1CTL_PARAM_REQ, the transmitter is enabled with given parameters. Change-Id: I43b14089e0b8988db6a73dd143c8ea806284ab7a
2019-05-23[WIP] HO: Add SCH read of neighbor cells to TCH channelsAndreas Eversberg5-0/+171
The task will try to sync to neighbor cell during search (idle) frame. Change-Id: I7f2c6b5438676a816c546cb9dce404762ee5d5b5
2019-05-23[WIP] HO: Add power measurement of neighbor cells to TCH channelsAndreas Eversberg3-42/+198
The task will measure power between TX and RX of successive TCH frames. Change-Id: I0c5a1714249799ff0f2031ca0585ec051c61cc6b
2019-05-23[WIP] Change TPU offset on TS change or sync changeAndreas Eversberg5-26/+85
When TPU offset must be changed (assignment to different timeslot or handover to a different cell), all tasks will be disabled until new TPU offset has been applied. Currently scheduled tasks are finished before the new TPU offset is applied. On change of TPU offset, the TPU's interrupt may skip one frame when changing backwards in time. Also it may generate two interrupts when changing significantly forward in time. This is compensated by changing the GSM time. Change-Id: If858484a9cf497e0f6e8d84593ab3637c2668869
2018-11-05l1ctl_proto.h: use flexible array member for traffic messagesVadim Yanitskiy1-2/+4
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-10-03l1ctl_proto.h: extend ccch_mode enum with CBCHVadim Yanitskiy2-0/+8
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-03firmware/layer1: add scheduler tasks for CBCHAlex Badea2-0/+31
According to GSM TS 05.02, section 3.3.5, Cell Broadcast Channel (CBCH) is a downlink only channel, which is used to carry the short message service cell broadcast (SMSCB). CBCH is optional, and uses the same physical channel as SDCCH. More precisely, CBCH replaces sub-slot number 2 of SDCCH channels when enabled. This change introduces the following CBCH related tasks: - MF_TASK_SDCCH4_CBCH (CBCH on C0/TS0 SDCCH/4), - MF_TASK_SDCCH8_CBCH (CBCH on SDCCH/8), which are identified using the following Osmocom specific cbits: - MF_TASK_SDCCH4_CBCH - 0x18 (0b11000), - MF_TASK_SDCCH8_CBCH - 0x19 (0b11001). The only way to enable these tasks at the moment is to send L1CTL_DM_EST_REQ message with required cbits and tn. Change-Id: I1d7f02cba1cd8f6527360589d2d2747b6426f78b
2018-10-03firmware/layer1: inform about unhandled scheduler tasksVadim Yanitskiy1-3/+5
The mframe_task2chan_nr() is used to get the channel number (encoded according to 08.58 Chapter 9.3.1) corresponding to a given multi-frame task type. It makes sense to at least print some debug message in cases when there is no matching channel number for a given task type. Change-Id: I34587b6c67015513de35d85a7a3291f452ee7f3b
2018-09-06firmware/l23_api.c: cosmetic: use proper format specifierVadim Yanitskiy1-1/+1
The '%u' format specifier should be used for unsigned values. Change-Id: I1108c34e864304126e581d30b75bbd95b93f60b8
2018-03-14common/l1ctl.c move TCH bit-ordering to the firmwareVadim Yanitskiy1-0/+52
Previously, TCH frames coming from L1 were reordered to the RTP format. Moreover, the implementation had a few problems: - L1CTL is not the best place for such manipulations; - payloads with other than FR codec were corrupted. Let's use RTP-ordered payloads on the L1CTL interface, performing TCH frame reordering at the firmware. Please note, that actual FR reordering was moved to the firmware as is, without any codec determination. This could be fixed in a separate change. Change-Id: I81ec8ed3c9e72a62b22c1720c299cdc68b733cf1
2018-03-14L1CTL/L1CTL_CRYPTO_REQ: add key length and channel infoVadim Yanitskiy1-3/+2
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
2017-01-15fix various other compiler warningsHarald Welte1-2/+3
2015-12-31cleanup some compile warningsMax5-16/+10
2015-07-21layer1: fix chan_nr2mf_task_mask for TCH/H channelFelix Domke1-1/+2
"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>
2013-01-02target: Add support for IQ swap when requiredSylvain Munaut4-8/+29
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-02fw/build: Add ENV_ APP_ BOARD_ prefix to variables to cleanup namespaceSylvain Munaut1-4/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-11-20Tell L1CTL_FBSB_REQ the expected received signal levelHarald Welte1-1/+2
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-03-29fw/prim_tch: Fix regression introduced in ↵Sylvain Munaut1-1/+1
f04f53d3b7909cc77d1b451bc8596c4d69ce8172 Thanks to Andreas for spotting this. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-29Fixed neighbour cell measurement task for SDCCH/8 multiframesAndreas Eversberg2-6/+13
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-02-12firmware: add missing includesSteve Markgraf6-2/+9
This fixes all 'implicit-function-declaration'-warnings. Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-04Improvement of neighbour cell power measurement task.Andreas Eversberg3-4/+13
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-01-28layer1: Fixed power measurement, adding ARFCN wrappingAndreas Eversberg2-3/+4
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-28target/rf: Make the trf6151_set_arfcn use ARFCN_UPLINK flag to select UL/DLSylvain Munaut3-4/+4
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-28firmware/layer1: Using queue to process received l23 frames in main loopAndreas Eversberg1-1/+24
Instead of processing the frames out of the interrupt context, they are queued until serial interrupt returns and main loop is processed.
2012-01-28Added callback function to forward L1CTL packets to rather than SERCOMAndreas Eversberg1-2/+9
This is experimental, maybe there should be a better way to do that.
2011-11-13target/fw/sim: SIM Layer 1 driverSylvain Munaut1-0/+24
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-09-16fw/layer1/tpu_window: Open and close RFFE tx_window at the right point of timeSteve Markgraf1-3/+10
So far, the PA-enable signal has been enabled way to early and also has been disabled much too late. We're now setting the RFFE to TX-mode after opening the ABB window, and setting the RFFE to RX-mode again after TX. This yields to an almost perfectly timed TX-window, just like with the stock firmware of the phone. Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-08-31fw/layer1/fbsb: fix newline in a printf()-callSteve Markgraf1-1/+1
Found by clang: warning: unknown escape sequence '\m' Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-07-28fw/prim_tch: Add support for sending frame from l23 (TRAFFIC_REQ/CONF)Sylvain Munaut1-3/+73
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28fw/prim_tch: Add support for sending traffic frames to l23 (TRAFFIC_IND)Sylvain Munaut1-2/+28
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28fw/layer1/l23_api: Add processing of the new audio_modeSylvain Munaut2-10/+29
This currently just stores it into the l1 sync state struct Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28fw/l1: Add a queue for traffic frame to send to network (TRAFFIC_REQ)Sylvain Munaut1-0/+27
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-28l1ctl: Add definition for TRAFFIC_{REQ,CONF,IND}Sylvain Munaut1-1/+1
Also adapt packet creation length in L1 Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-17[layer1] Adding neighbour cell measurement code to layer1.Andreas Eversberg3-9/+172
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[rf] Adding rffe_set_gain() and rffe_get_gain() to get/set computed gainAndreas Eversberg4-5/+8
rffe_compute_gain() is the new name for rffe_set_gain(). I needed to change this, to solve the name collision with the rffe_set_gain() function, which actually sets the absolute gain. rffe_get_gain() will now read the absolute gain which has been computed by rffe_compute_gain() or set by rffe_set_gain().
2011-07-16tpu_window: Fix int16_t overflow in tpu_window calculationHarald Welte1-2/+3
First we add 55500 to an int16_t, then later we subtract it again. The bug only didn't become apparent as we wrap twice, once adding then subtracting. Discovered by Smatch: firmware/layer1/tpu_window.c +127 l1s_rx_win_ctrl(24) warn: value 55000 can't fit into 32767 'stop'
2011-06-25fw/l1a: Add a message to safely count the length of a txqueueAndreas Eversberg1-0/+15
(that is by locking) Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-04-26src: use new libosmogsm and include/osmocom/[gsm|core] path to headersPablo Neira Ayuso19-31/+31
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-03-20fw/layer1: Adding TAO loop to correct TPU window offsetAndreas Eversberg6-2/+100
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-01-24target/fw: set the TRF6151 tsp IDs from the rffe initializationSteve Markgraf1-1/+0
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-11fixed typos in commentsThomas Waldmann4-6/+6
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-12-27fw/layer1: Resync TCH primitive on mode changesSylvain Munaut1-0/+2
This is needed for audio to work properly in VEA mode Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-28fw/layer1: Fix reset of dedicated channel stateSylvain Munaut1-0/+3
Thanks to Alex Badea <vamposdecampos@gmail.com> for pointing this out. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-24fw/layer1: Fix missing include in prim_pm.cSylvain Munaut1-0/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-14fw/l1/mframe_sched: Fix the TCH_A entries to include the MF_F_SACCH flagSylvain Munaut1-4/+8
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-14fw/layer1: Use dbm2rxlev instead of just '+110' so that overflows are handledSylvain Munaut2-3/+3
Without this, we would sometime get +143 dBm reported ... which is obviously false. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-07target/fw/l1: Fix TCH/H1 by properly loading the TCH mode during TCH_A taskSylvain Munaut1-3/+3
Altough quite counterintuitive, the TCH_A task does some voice coding work ... at least during TCH/H subchannel 1 ... Go figure ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-07target/fw/l1: Fix TCH/H by properly scheduling the TCHD task during 'off' slotsSylvain Munaut2-0/+62
Apparently the DSP needs to be run even during the slots without actual bursts exchange. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-30target/fw/layer1: Change L1CTL RACH req to properly use all slotsAndreas.Eversberg2-7/+31
Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25target/fw/layer1: correctly initialize afc_retriesSteve Markgraf1-0/+1
Otherwise, when it reached AFC_RETRY_COUNT, no new FB0 tasks were scheduled, and you needed to restart the phone in order to successfully sync to a cell Signed-off-by: Steve Markgraf <steve@steve-m.de>