RSL: keep track of ip.access dynamic TCH/PDCH activation

We use the (currently unusued) flags member of the bts_trx_ts structure
to track if a dynamic TCH/PDCH is currently on PDCH mode or not.
This commit is contained in:
Harald Welte 2010-03-28 14:42:09 +08:00
parent 332442d6c7
commit 4563eab30e
3 changed files with 14 additions and 5 deletions

View File

@ -59,7 +59,7 @@ int rsl_ipacc_crcx(struct gsm_lchan *lchan);
int rsl_ipacc_mdcx(struct gsm_lchan *lchan, u_int32_t ip,
u_int16_t port, u_int8_t rtp_payload2);
int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan);
int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan);
int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan, int act);
int abis_rsl_rcvmsg(struct msgb *msg);

View File

@ -267,7 +267,7 @@ struct gsm_e1_subslot {
u_int8_t e1_ts_ss;
};
#define BTS_TRX_F_ACTIVATED 0x0001
#define TS_F_PDCH_MODE 0x1000
/* One Timeslot in a TRX */
struct gsm_bts_trx_ts {
struct gsm_bts_trx *trx;

View File

@ -992,12 +992,14 @@ static int abis_rsl_rx_dchan(struct msgb *msg)
break;
case RSL_MT_IPAC_PDCH_ACT_ACK:
DEBUGPC(DRSL, "%s IPAC PDCH ACT ACK\n", ts_name);
msg->lchan->ts->flags |= TS_F_PDCH_MODE;
break;
case RSL_MT_IPAC_PDCH_ACT_NACK:
LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH ACT NACK\n", ts_name);
break;
case RSL_MT_IPAC_PDCH_DEACT_ACK:
DEBUGP(DRSL, "%s IPAC PDCH DEACT ACK\n", ts_name);
msg->lchan->ts->flags &= ~TS_F_PDCH_MODE;
break;
case RSL_MT_IPAC_PDCH_DEACT_NACK:
LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH DEACT NACK\n", ts_name);
@ -1491,17 +1493,24 @@ int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan)
return rc;
}
int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan)
int rsl_ipacc_pdch_activate(struct gsm_lchan *lchan, int act)
{
struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh;
u_int8_t msg_type;
if (act)
msg_type = RSL_MT_IPAC_PDCH_ACT;
else
msg_type = RSL_MT_IPAC_PDCH_DEACT;
dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
init_dchan_hdr(dh, RSL_MT_IPAC_PDCH_ACT);
init_dchan_hdr(dh, msg_type);
dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN;
dh->chan_nr = lchan2chan_nr(lchan);
DEBUGP(DRSL, "%s IPAC_PDCH_ACT\n", gsm_lchan_name(lchan));
DEBUGP(DRSL, "%s IPAC_PDCH_%sACT\n", gsm_lchan_name(lchan),
act ? "" : "DE");
msg->trx = lchan->ts->trx;