aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/abis_rsl.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-12-23 12:59:52 +0100
committerHarald Welte <laforge@gnumonks.org>2010-12-23 14:41:40 +0100
commit53cd7ac44c342ece21a175d22be0f6b7c5ed7911 (patch)
tree0617fed0e37161fe85e0d541ae682e564ed206f3 /openbsc/src/abis_rsl.c
parentd4e6872d6c9d5cdc0658180091710d4b34c9f723 (diff)
Dynamic PDCH: rsl_ipacc_pdch_activate() operates on a timeslot
... not on the lchan.
Diffstat (limited to 'openbsc/src/abis_rsl.c')
-rw-r--r--openbsc/src/abis_rsl.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c
index 11d59477..c0769853 100644
--- a/openbsc/src/abis_rsl.c
+++ b/openbsc/src/abis_rsl.c
@@ -130,9 +130,8 @@ struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, u_int8_t chan_nr)
}
/* See Table 10.5.25 of GSM04.08 */
-u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan)
+static u_int8_t ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr)
{
- struct gsm_bts_trx_ts *ts = lchan->ts;
u_int8_t cbits, chan_nr;
switch (ts->pchan) {
@@ -143,15 +142,15 @@ u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan)
break;
case GSM_PCHAN_TCH_H:
cbits = 0x02;
- cbits += lchan->nr;
+ cbits += lchan_nr;
break;
case GSM_PCHAN_CCCH_SDCCH4:
cbits = 0x04;
- cbits += lchan->nr;
+ cbits += lchan_nr;
break;
case GSM_PCHAN_SDCCH8_SACCH8C:
cbits = 0x08;
- cbits += lchan->nr;
+ cbits += lchan_nr;
break;
default:
case GSM_PCHAN_CCCH:
@@ -164,6 +163,11 @@ u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan)
return chan_nr;
}
+u_int8_t lchan2chan_nr(const struct gsm_lchan *lchan)
+{
+ return ts2chan_nr(lchan->ts, lchan->nr);
+}
+
/* As per TS 03.03 Section 2.2, the IMSI has 'not more than 15 digits' */
u_int64_t str_to_imsi(const char *imsi_str)
{
@@ -1671,7 +1675,7 @@ int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan)
return rc;
}
-int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan, int act)
+int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act)
{
struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh;
@@ -1685,12 +1689,12 @@ int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan, int act)
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
init_dchan_hdr(dh, msg_type);
dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN;
- dh->chan_nr = lchan2chan_nr(lchan);
+ dh->chan_nr = ts2chan_nr(ts, 0);
- DEBUGP(DRSL, "%s IPAC_PDCH_%sACT\n", gsm_lchan_name(lchan),
+ DEBUGP(DRSL, "%s IPAC_PDCH_%sACT\n", gsm_ts_name(ts),
act ? "" : "DE");
- msg->trx = lchan->ts->trx;
+ msg->trx = ts->trx;
return abis_rsl_sendmsg(msg);
}