summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-11-14 18:45:19 +0100
committerSylvain Munaut <tnt@246tNt.com>2011-11-13 20:26:22 +0100
commitbddab255d888994af048cf1230b2a86f85a702bd (patch)
tree283324f90e96523a0641008e7a867957e544559e
parentab4b5f43a95140910079dce00617e7d6179f8255 (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 ab7c2502..7cec8575 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -92,6 +92,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 {
@@ -128,4 +129,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 f998ebcf..2369b454 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -265,6 +265,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)
{
@@ -917,6 +952,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;