aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/trau_mux.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-06-10 23:11:52 +0800
committerHarald Welte <laforge@gnumonks.org>2009-06-10 23:25:50 +0800
commit4bfdfe7f70376612ad2343dd71e8b6ad52124ee6 (patch)
treecfe0b6321dc1346d72471f1805d5bdf02384498b /openbsc/src/trau_mux.c
parentec44e1ff4139f60483dfcaa8329e39b41bfb8c4a (diff)
reworked MNCC codebase
This is Harald's reworked MNCC base, slowly heading towards integration into master. The key changes are: * provide much more structure to the data in gsm_mncc * encode_* and decode_* functions now take a structure rather than tons of individual arguments (whose order nobody can remember) * make sure we don't have copies of the same code everywhere by introducing mncc_set_cause() and mncc_release_ind() * save horizontal screen space if possible * make sure we break lines > 80 characters
Diffstat (limited to 'openbsc/src/trau_mux.c')
-rw-r--r--openbsc/src/trau_mux.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/openbsc/src/trau_mux.c b/openbsc/src/trau_mux.c
index 96f85899..196d15fa 100644
--- a/openbsc/src/trau_mux.c
+++ b/openbsc/src/trau_mux.c
@@ -145,6 +145,9 @@ int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
u_int8_t trau_bits_out[TRAU_FRAME_BITS];
struct gsm_e1_subslot *dst_e1_ss = lookup_trau_mux_map(src_e1_ss);
struct subch_mux *mx;
+ struct upqueue_entry *ue;
+ struct msgb *msg;
+ struct gsm_trau_frame *frame;
int rc;
/* decode TRAU, change it to downlink, re-encode */
@@ -152,8 +155,23 @@ int trau_mux_input(struct gsm_e1_subslot *src_e1_ss,
if (rc)
return rc;
- if (!dst_e1_ss)
- return -EINVAL;
+ if (!dst_e1_ss) {
+ /* frame shall be sent to upqueue */
+ if (!(ue = lookup_trau_upqueue(src_e1_ss)))
+ return -EINVAL;
+ if (!ue->callref)
+ return -EINVAL;
+ msg = msgb_alloc(sizeof(struct gsm_trau_frame) + sizeof(tf));
+ if (!msg)
+ return -ENOMEM;
+ frame = (struct gsm_trau_frame *)msg->data;
+ frame->msg_type = GSM_TRAU_FRAME;
+ frame->callref = ue->callref;
+ memcpy(frame->data, &tf, sizeof(tf));
+ msgb_enqueue(&ue->net->upqueue, msg);
+
+ return 0;
+ }
mx = e1inp_get_mux(dst_e1_ss->e1_nr, dst_e1_ss->e1_ts);
if (!mx)