summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Badea <vamposdecampos@gmail.com>2018-10-01 21:19:13 +0700
committerHarald Welte <laforge@gnumonks.org>2018-10-03 08:37:11 +0000
commitbd7e58f91421be130fca954c123693ab42bf01b5 (patch)
tree01ac9c962c0a750b1fe6a83df03433ff188b73ac
parent087626042ecb5f13c73a57de0eeb804ff81b42f5 (diff)
firmware/layer1: add scheduler tasks for CBCH
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
-rw-r--r--src/target/firmware/include/layer1/mframe_sched.h3
-rw-r--r--src/target/firmware/include/layer1/sync.h2
-rw-r--r--src/target/firmware/layer1/l23_api.c10
-rw-r--r--src/target/firmware/layer1/mframe_sched.c21
4 files changed, 36 insertions, 0 deletions
diff --git a/src/target/firmware/include/layer1/mframe_sched.h b/src/target/firmware/include/layer1/mframe_sched.h
index ecdb1ec8..74e2d271 100644
--- a/src/target/firmware/include/layer1/mframe_sched.h
+++ b/src/target/firmware/include/layer1/mframe_sched.h
@@ -23,6 +23,9 @@ enum mframe_task {
MF_TASK_SDCCH8_6,
MF_TASK_SDCCH8_7,
+ MF_TASK_SDCCH4_CBCH,
+ MF_TASK_SDCCH8_CBCH,
+
MF_TASK_TCH_F_EVEN,
MF_TASK_TCH_F_ODD,
MF_TASK_TCH_H_0,
diff --git a/src/target/firmware/include/layer1/sync.h b/src/target/firmware/include/layer1/sync.h
index dae85a1a..3565ee20 100644
--- a/src/target/firmware/include/layer1/sync.h
+++ b/src/target/firmware/include/layer1/sync.h
@@ -119,7 +119,9 @@ struct l1s_state {
enum {
GSM_DCHAN_NONE = 0,
GSM_DCHAN_SDCCH_4,
+ GSM_DCHAN_SDCCH_4_CBCH,
GSM_DCHAN_SDCCH_8,
+ GSM_DCHAN_SDCCH_8_CBCH,
GSM_DCHAN_TCH_H,
GSM_DCHAN_TCH_F,
GSM_DCHAN_UNKNOWN,
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index e46ca09d..404a2f98 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -97,6 +97,11 @@ static uint32_t chan_nr2mf_task_mask(uint8_t chan_nr, uint8_t neigh_mode)
lch_idx = cbits & 0x7;
master_task = MF_TASK_SDCCH8_0 + lch_idx;
multiframe = MF51;
+ } else if ((cbits & 0x1e) == 0x18) {
+ /* Osmocom specific extension for CBCH */
+ master_task = (cbits & 0x01) ? /* 0b1100T */
+ MF_TASK_SDCCH4_CBCH : MF_TASK_SDCCH8_CBCH;
+ multiframe = MF51;
#if 0
} else if (cbits == 0x10) {
/* FIXME: when to do extended BCCH? */
@@ -136,7 +141,12 @@ static int chan_nr2dchan_type(uint8_t chan_nr)
return GSM_DCHAN_SDCCH_4;
} else if ((cbits & 0x18) == 0x08) {
return GSM_DCHAN_SDCCH_8;
+ } else if ((cbits & 0x1e) == 0x18) {
+ /* Osmocom-specific extension for CBCH */
+ return (cbits & 0x01) ? /* 0b1100T */
+ GSM_DCHAN_SDCCH_8_CBCH : GSM_DCHAN_SDCCH_4_CBCH;
}
+
return GSM_DCHAN_UNKNOWN;
}
diff --git a/src/target/firmware/layer1/mframe_sched.c b/src/target/firmware/layer1/mframe_sched.c
index 01ae1678..7fa38c13 100644
--- a/src/target/firmware/layer1/mframe_sched.c
+++ b/src/target/firmware/layer1/mframe_sched.c
@@ -198,6 +198,16 @@ static const struct mframe_sched_item mf_sdcch8_7[] = {
{ .sched_set = NULL }
};
+/* CBCH replaces sub-slot 2 of SDCCH, see GSM 05.02, section 6.4 */
+static const struct mframe_sched_item mf_sdcch8_cbch[] = {
+ { .sched_set = NB_QUAD_FH_DL, .modulo = 51, .frame_nr = 8 },
+ { .sched_set = NULL }
+};
+static const struct mframe_sched_item mf_sdcch4_cbch[] = {
+ { .sched_set = NB_QUAD_DL, .modulo = 51, .frame_nr = 32 },
+ { .sched_set = NULL }
+};
+
/* Measurement for MF 51 C0 */
static const struct mframe_sched_item mf_neigh_pm51_c0t0[] = {
{ .sched_set = NEIGH_PM , .modulo = 51, .frame_nr = 0 },
@@ -327,6 +337,9 @@ static const struct mframe_sched_item *sched_set_for_task[32] = {
[MF_TASK_SDCCH8_6] = mf_sdcch8_6,
[MF_TASK_SDCCH8_7] = mf_sdcch8_7,
+ [MF_TASK_SDCCH4_CBCH] = mf_sdcch4_cbch,
+ [MF_TASK_SDCCH8_CBCH] = mf_sdcch8_cbch,
+
[MF_TASK_TCH_F_EVEN] = mf_tch_f_even,
[MF_TASK_TCH_F_ODD] = mf_tch_f_odd,
[MF_TASK_TCH_H_0] = mf_tch_h_0,
@@ -401,6 +414,14 @@ uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts)
cbits = 0x02 + 1;
break;
+ /* Osmocom specific extensions */
+ case MF_TASK_SDCCH4_CBCH:
+ cbits = 0x18;
+ break;
+ case MF_TASK_SDCCH8_CBCH:
+ cbits = 0x19;
+ break;
+
case MF_TASK_UL_ALL_NB:
default:
printd("ERROR: cannot express mf_task=%d as "