diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2023-02-13 12:05:50 +0100 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2023-02-14 09:32:02 +0100 |
commit | cc42444539a342dfdaff22373dd528bc07d6ffe9 (patch) | |
tree | fd78ea8685e9f675c261d573d6ae79bf349bb85a | |
parent | 31ab400147809f103c650fce9d331d3d0fb0db8f (diff) |
e1_input: add timeslot type NONE
Allow to configure a timeslot as type E1INP_TS_TYPE_NONE. The timeslot
is then put back in its unconfigured state
Change-Id: I073cfaba0d5073447842f22665e213135ea3f635
Related: OS#5198
-rw-r--r-- | include/osmocom/abis/e1_input.h | 3 | ||||
-rw-r--r-- | src/e1_input.c | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index ebf94bd..7b97a46 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -325,6 +325,9 @@ int e1inp_ts_config_hdlc(struct e1inp_ts *ts, struct e1inp_line *line, void (*hdlc_recv_cb)(struct e1inp_ts *ts, struct msgb *msg)); +/* configure and initialize one timeslot dedicated to nothing */ +int e1inp_ts_config_none(struct e1inp_ts *ts, struct e1inp_line *line); + /* obtain a string identifier/name for the given timeslot */ void e1inp_ts_name(char *out, size_t out_len, const struct e1inp_ts *ts); diff --git a/src/e1_input.c b/src/e1_input.c index cdf061c..a7313dd 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -444,6 +444,17 @@ int e1inp_ts_config_hdlc(struct e1inp_ts *ts, struct e1inp_line *line, return 0; } +int e1inp_ts_config_none(struct e1inp_ts *ts, struct e1inp_line *line) +{ + if (ts->type == E1INP_TS_TYPE_NONE && ts->line && line) + return 0; + + ts->type = E1INP_TS_TYPE_NONE; + ts->line = line; + + return 0; +} + static int e1inp_line_use_cb(struct osmo_use_count_entry *use_count_entry, int32_t old_use_count, const char *file, int file_line) { |