[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.
This commit is contained in:
parent
ff3f260e4f
commit
f520e6439a
|
@ -42,7 +42,11 @@ struct gsm48_req_ref {
|
|||
t3_low:3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Chapter 9.1.5 */
|
||||
/*
|
||||
* Chapter 9.1.5/9.1.6
|
||||
*
|
||||
* For 9.1.6 the chan_desc has the meaning of 10.5.2.5a
|
||||
*/
|
||||
struct gsm48_chan_mode_modify {
|
||||
struct gsm48_chan_desc chan_desc;
|
||||
u_int8_t mode;
|
||||
|
@ -755,5 +759,6 @@ int gsm48_paging_extract_mi(struct msgb *msg, char *mi_string, u_int8_t *mi_type
|
|||
int gsm48_handle_paging_resp(struct msgb *msg, struct gsm_subscriber *subscr);
|
||||
|
||||
int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode);
|
||||
int gsm48_rx_rr_modif_ack(struct msgb *msg);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1587,11 +1587,7 @@ static int gsm0408_rcv_rr(struct msgb *msg)
|
|||
rc = gsm48_rx_rr_pag_resp(msg);
|
||||
break;
|
||||
case GSM48_MT_RR_CHAN_MODE_MODIF_ACK:
|
||||
DEBUGP(DRR, "CHANNEL MODE MODIFY ACK\n");
|
||||
/* We've successfully modified the MS side of the channel,
|
||||
* now go on to modify the BTS side of the channel */
|
||||
msg->lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH;
|
||||
rc = rsl_chan_mode_modify_req(msg->lchan);
|
||||
rc = gsm48_rx_rr_modif_ack(msg);
|
||||
break;
|
||||
case GSM48_MT_RR_STATUS:
|
||||
rc = gsm48_rx_rr_status(msg);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue