aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bssap.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-24 14:21:03 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-24 14:21:03 +0100
commita26ebe40f5a30fef9fb4bc5b65eb58123d8102bb (patch)
treef15b0b2a71e8a6463f622e42741e4f90530f6a06 /openbsc/src/bssap.c
parenta52f1cacb3ccc3e652c988ff0f3076488f2dfd54 (diff)
bssap: Allow to submit a SMS on the TCH
Similar to the bsc_rll.c code we need to indicate if we want to send the data on the SACH or on the normal signalling link. For CC and any other SAPI=0 usage this bits must be zero, whener we try to do something with SMS this bit needs to be set to one.
Diffstat (limited to 'openbsc/src/bssap.c')
-rw-r--r--openbsc/src/bssap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/openbsc/src/bssap.c b/openbsc/src/bssap.c
index f1b5bab7a..50dff9289 100644
--- a/openbsc/src/bssap.c
+++ b/openbsc/src/bssap.c
@@ -640,6 +640,7 @@ int dtap_rcvmsg(struct gsm_lchan *lchan, struct msgb *msg, unsigned int length)
struct dtap_header *header;
struct msgb *gsm48;
u_int8_t *data;
+ u_int8_t link_id;
if (!lchan) {
DEBUGP(DMSC, "No lchan available\n");
@@ -693,7 +694,14 @@ int dtap_rcvmsg(struct gsm_lchan *lchan, struct msgb *msg, unsigned int length)
}
}
- bts_queue_send(gsm48, header->link_id);
+ link_id = header->link_id;
+
+ /* If we are on a TCH and need to submit a SMS (on SAPI=3) we need to use the SACH */
+ if ((lchan->type == GSM_LCHAN_TCH_F ||
+ lchan->type == GSM_LCHAN_TCH_H) && (link_id & 0x7) != 0)
+ link_id |= 0x40;
+
+ bts_queue_send(gsm48, link_id);
return 0;
}