diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-10-22 15:23:11 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-10-27 04:52:30 +0100 |
commit | f520e6439a917777a4a456fea7eb0f214e027c67 (patch) | |
tree | 55c177c49c9a104cd680a039685186692476cfe2 /openbsc/src/gsm_04_08_utils.c | |
parent | ff3f260e4fdc8445c7460cb8af1b23fb397467b2 (diff) |
[gsm48] Handle the RR CHAN MODIFY ACK in the gsm04_08_utils
Move the handling code to the gsm_04_08_utils.c and add a
note that the method value needs to be checked.
Diffstat (limited to 'openbsc/src/gsm_04_08_utils.c')
-rw-r--r-- | openbsc/src/gsm_04_08_utils.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/openbsc/src/gsm_04_08_utils.c b/openbsc/src/gsm_04_08_utils.c index 598775c03..2545f33a6 100644 --- a/openbsc/src/gsm_04_08_utils.c +++ b/openbsc/src/gsm_04_08_utils.c @@ -559,3 +559,39 @@ int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode) return rc; } +int gsm48_rx_rr_modif_ack(struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + struct gsm48_chan_mode_modify *mod = + (struct gsm48_chan_mode_modify *) gh->data; + + DEBUGP(DRR, "CHANNEL MODE MODIFY ACK\n"); + + if (mod->mode != msg->lchan->tch_mode) { + DEBUGP(DRR, "CHANNEL MODE change failed. Wanted: %d Got: %d\n", + msg->lchan->tch_mode, mod->mode); + return -1; + } + + /* update the channel type */ + switch (mod->mode) { + case GSM48_CMODE_SIGN: + msg->lchan->rsl_cmode = RSL_CMOD_SPD_SIGN; + break; + case GSM48_CMODE_SPEECH_V1: + case GSM48_CMODE_SPEECH_EFR: + case GSM48_CMODE_SPEECH_AMR: + msg->lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH; + break; + case GSM48_CMODE_DATA_14k5: + case GSM48_CMODE_DATA_12k0: + case GSM48_CMODE_DATA_6k0: + case GSM48_CMODE_DATA_3k6: + msg->lchan->rsl_cmode = RSL_CMOD_SPD_DATA; + break; + } + + /* We've successfully modified the MS side of the channel, + * now go on to modify the BTS side of the channel */ + return rsl_chan_mode_modify_req(msg->lchan); +} |