aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_08_utils.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-11-18 22:57:02 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-11-19 11:42:03 +0100
commitea52802762b7e485d5d9aa4aa6f30b4c88425a53 (patch)
treeea9515eebd83711c9931ec911c2c419262c8543e /openbsc/src/gsm_04_08_utils.c
parent251e991372adf36bfd700842de25d29b25029993 (diff)
[lchan] RSL and RR need the multirate config, place it in the lchan
Both GSM 04.08 RR and GSM 08.58 RSL need the multirate config in the channel modify. Place the config in the lchan, change the gsm48 methods to not take the argument, change the RSL implementation to make use of it with the right IE. The other code should use the t(l)v_put routines as well but were left untouched for now.
Diffstat (limited to 'openbsc/src/gsm_04_08_utils.c')
-rw-r--r--openbsc/src/gsm_04_08_utils.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/openbsc/src/gsm_04_08_utils.c b/openbsc/src/gsm_04_08_utils.c
index 1a0af3735..b2fbdc2c3 100644
--- a/openbsc/src/gsm_04_08_utils.c
+++ b/openbsc/src/gsm_04_08_utils.c
@@ -504,8 +504,7 @@ int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv)
}
/* Chapter 9.1.2: Assignment Command */
-int gsm48_send_rr_ass_cmd(struct gsm_lchan *lchan, u_int8_t power_command,
- struct gsm48_multi_rate_conf *conf)
+int gsm48_send_rr_ass_cmd(struct gsm_lchan *lchan, u_int8_t power_command)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -536,13 +535,13 @@ int gsm48_send_rr_ass_cmd(struct gsm_lchan *lchan, u_int8_t power_command,
/* in case of multi rate we need to attach a config */
if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
- if (!conf) {
+ if (lchan->mr_conf.ver == 0) {
DEBUGP(DRR, "BUG: Using multirate codec without multirate config.\n");
} else {
u_int8_t *data = msgb_put(msg, 4);
data[0] = GSM48_IE_MUL_RATE_CFG;
data[1] = 0x2;
- memcpy(&data[2], conf, 2);
+ memcpy(&data[2], &lchan->mr_conf, 2);
}
}
@@ -550,8 +549,7 @@ int gsm48_send_rr_ass_cmd(struct gsm_lchan *lchan, u_int8_t power_command,
}
/* 9.1.5 Channel mode modify: Modify the mode on the MS side */
-int gsm48_tx_chan_mode_modify(struct gsm_lchan *lchan, u_int8_t mode,
- struct gsm48_multi_rate_conf *conf)
+int gsm48_tx_chan_mode_modify(struct gsm_lchan *lchan, u_int8_t mode)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
@@ -576,26 +574,25 @@ int gsm48_tx_chan_mode_modify(struct gsm_lchan *lchan, u_int8_t mode,
cmm->mode = mode;
/* in case of multi rate we need to attach a config */
- if (mode == GSM48_CMODE_SPEECH_AMR) {
- if (!conf) {
+ if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) {
+ if (lchan->mr_conf.ver == 0) {
DEBUGP(DRR, "BUG: Using multirate codec without multirate config.\n");
} else {
u_int8_t *data = msgb_put(msg, 4);
data[0] = GSM48_IE_MUL_RATE_CFG;
data[1] = 0x2;
- memcpy(&data[2], conf, 2);
+ memcpy(&data[2], &lchan->mr_conf, 2);
}
}
return gsm48_sendmsg(msg, NULL);
}
-int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode,
- struct gsm48_multi_rate_conf *conf)
+int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode)
{
int rc;
- rc = gsm48_tx_chan_mode_modify(lchan, lchan_mode, conf);
+ rc = gsm48_tx_chan_mode_modify(lchan, lchan_mode);
if (rc < 0)
return rc;