summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-11-14 18:45:19 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-15 21:33:56 +0100
commitdf9775d95aa0bf0fc08163914d1afa3832fbc5cf (patch)
tree25d884498f980b5e5dcf39c2db55dd1e35e57c3a
parent7b2f1e1bbf79c647b4519df5908628605fe01628 (diff)
[HACK] Disptach the received BURST_IND with a signal
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h6
-rw-r--r--src/host/layer23/src/common/l1ctl.c38
2 files changed, 44 insertions, 0 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index 17dad10d..bc5ad1b6 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -94,6 +94,7 @@ enum osmobb_l1ctl_sig {
S_L1CTL_TCH_MODE_CONF,
S_L1CTL_LOSS_IND,
S_L1CTL_NEIGH_PM_IND,
+ S_L1CTL_BURST_IND,
};
enum osmobb_global_sig {
@@ -130,4 +131,9 @@ struct osmobb_neigh_pm_ind {
uint8_t rx_lev;
};
+struct osmobb_msg_ind {
+ struct osmocom_ms *ms;
+ struct msgb *msg;
+};
+
#endif
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index c75872e4..3fa72427 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -277,6 +277,41 @@ printf("Dropping frame with %u bit errors\n", dl->num_biterr);
return lapdm_phsap_up(&pp.oph, le);
}
+/* Receive L1CTL_BURST_IND (Data Indication from L1) */
+static int rx_ph_burst_ind(struct osmocom_ms *ms, struct msgb *msg)
+{
+ struct l1ctl_burst_ind *bi;
+ struct osmobb_msg_ind mi;
+ uint8_t chan_type, chan_ts, chan_ss;
+ struct gsm_time rx_time;
+ uint16_t arfcn;
+
+ /* Header handling */
+ bi = (struct l1ctl_burst_ind *) msg->l1h;
+
+ rsl_dec_chan_nr(bi->chan_nr, &chan_type, &chan_ss, &chan_ts);
+ gsm_fn2gsmtime(&rx_time, ntohl(bi->frame_nr));
+ arfcn = ntohs(bi->band_arfcn);
+
+ /* Debug print */
+ LOGP(DL1C, LOGL_NOTICE, "BURST IND: @(%6d = %.4u/%.2u/%.2u) (%4d dBm, SNR %3d%s%s)\n",
+ rx_time.fn, rx_time.t1, rx_time.t2, rx_time.t3,
+ (int)bi->rx_level-110, bi->snr,
+ arfcn & ARFCN_UPLINK ? ", UL" : "",
+ bi->flags & BI_FLG_SACCH ? ", SACCH" : ""
+ );
+
+ /* Dispatch signal !HACK! */
+ mi.ms = ms;
+ mi.msg = msg;
+ osmo_signal_dispatch(SS_L1CTL, S_L1CTL_BURST_IND, &mi);
+
+ /* Done with the message */
+ msgb_free(msg);
+
+ return 0;
+}
+
/* Receive L1CTL_DATA_CONF (Data Confirm from L1) */
static int rx_ph_data_conf(struct osmocom_ms *ms, struct msgb *msg)
{
@@ -945,6 +980,9 @@ int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg)
case L1CTL_DATA_IND:
rc = rx_ph_data_ind(ms, msg);
break;
+ case L1CTL_BURST_IND:
+ rc = rx_ph_burst_ind(ms, msg);
+ break;
case L1CTL_DATA_CONF:
rc = rx_ph_data_conf(ms, msg);
break;