aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-08-02 11:54:15 +0200
committerHarald Welte <laforge@osmocom.org>2020-08-02 11:57:55 +0200
commiteb8240d56422b23a6aa2ba62ad57c9dee19047d1 (patch)
tree1e97350a031cd2b61286a82ad686ab0ca76e5a8a
parentb5518a8f1f30e286b6399926fb773dafbc96caff (diff)
i460: Add back-pointer from sub-channel to timeslot
A user may want to walk back from a sub-channel to the timeslot to which it belongs. Change-Id: Id6e5e208c5daa63fd23ac719d62314622b5d0ed9
-rw-r--r--include/osmocom/gsm/i460_mux.h1
-rw-r--r--src/gsm/i460_mux.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/gsm/i460_mux.h b/include/osmocom/gsm/i460_mux.h
index dd752db0..e7ea9bd5 100644
--- a/include/osmocom/gsm/i460_mux.h
+++ b/include/osmocom/gsm/i460_mux.h
@@ -62,6 +62,7 @@ struct osmo_i460_subchan_mux {
};
struct osmo_i460_subchan {
+ struct osmo_i460_timeslot *ts; /* back-pointer */
enum osmo_i460_rate rate; /* 8/16/32/64k */
uint8_t bit_offset; /* bit offset inside each byte of the B-channel */
struct osmo_i460_subchan_demux demux;
diff --git a/src/gsm/i460_mux.c b/src/gsm/i460_mux.c
index dfd50e52..3b2a589f 100644
--- a/src/gsm/i460_mux.c
+++ b/src/gsm/i460_mux.c
@@ -339,6 +339,7 @@ void osmo_i460_ts_init(struct osmo_i460_timeslot *ts)
for (i = 0; i < ARRAY_SIZE(ts->schan); i++) {
struct osmo_i460_subchan *schan = &ts->schan[i];
+ schan->ts = ts;
subchan_reset(schan, true);
}
}