aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-09-01 09:19:45 +0200
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:39:03 +0200
commit793e713c4bcf0929c2656760acb42e875f743da9 (patch)
tree8df08612c8518368418ebbbd76d5a25685a2b1a6
parentfaba84b9b7c035691fd831ad26871a63417d22d0 (diff)
Move chan act/rel/modify from bts_model to PH-/MPH-/TCH-SAP interface
This part replaces channel activation/deactivation/modification routines by MPH_INFO messages.
-rw-r--r--include/osmo-bts/bts_model.h6
-rw-r--r--include/osmo-bts/l1sap.h2
-rw-r--r--src/common/handover.c3
-rw-r--r--src/common/l1sap.c145
-rw-r--r--src/common/pcu_sock.c8
-rw-r--r--src/common/rsl.c25
-rw-r--r--src/osmo-bts-sysmo/l1_if.c41
-rw-r--r--src/osmo-bts-sysmo/l1_if.h7
-rw-r--r--src/osmo-bts-sysmo/oml.c60
9 files changed, 240 insertions, 57 deletions
diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h
index 35e9517..1cfc975 100644
--- a/include/osmo-bts/bts_model.h
+++ b/include/osmo-bts/bts_model.h
@@ -25,12 +25,6 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo,
void *obj, uint8_t adm_state);
-int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp);
-int bts_model_rsl_chan_rel(struct gsm_lchan *lchan);
-int bts_model_rsl_chan_mod(struct gsm_lchan *lchan);
-int bts_model_rsl_deact_sacch(struct gsm_lchan *lchan);
-int bts_model_rsl_mode_modify(struct gsm_lchan *lchan);
-
int bts_model_trx_deact_rf(struct gsm_bts_trx *trx);
int bts_model_trx_close(struct gsm_bts_trx *trx);
diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h
index a1dc303..dee430f 100644
--- a/include/osmo-bts/l1sap.h
+++ b/include/osmo-bts/l1sap.h
@@ -56,7 +56,7 @@ void l1sap_rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl,
unsigned int rtp_pl_len);
/* channel control */
-int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr);
+int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed *tp);
int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr);
int l1sap_chan_deact_sacch(struct gsm_bts_trx *trx, uint8_t chan_nr);
int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr);
diff --git a/src/common/handover.c b/src/common/handover.c
index 26a3f51..03433ea 100644
--- a/src/common/handover.c
+++ b/src/common/handover.c
@@ -33,6 +33,7 @@
#include <osmo-bts/rsl.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/handover.h>
+#include <osmo-bts/l1sap.h>
/* Transmit a handover related PHYS INFO on given lchan */
static int ho_tx_phys_info(struct gsm_lchan *lchan)
@@ -114,7 +115,7 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay)
/* Stop handover detection, wait for valid frame */
lchan->ho.active = HANDOVER_WAIT_FRAME;
- if (bts_model_rsl_chan_mod(lchan) != 0) {
+ if (l1sap_chan_modify(lchan->ts->trx, gsm_lchan2chan_nr(lchan)) != 0) {
LOGP(DHO, LOGL_ERROR,
"%s failed to modify channel after handover\n",
gsm_lchan_name(lchan));
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 9bbbdf3..e9d815c 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -126,6 +126,67 @@ static int l1sap_mph_info_ind(struct gsm_bts_trx *trx,
return rc;
}
+/* activation confirm received from bts model */
+static int l1sap_info_act_cnf(struct gsm_bts_trx *trx,
+ struct osmo_phsap_prim *l1sap,
+ struct info_act_cnf_param *info_act_cnf)
+{
+ struct gsm_lchan *lchan;
+
+ LOGP(DL1P, LOGL_INFO, "activate confirm chan_nr=%02x trx=%d\n",
+ info_act_cnf->chan_nr, trx->nr);
+
+ lchan = &trx->ts[L1SAP_CHAN2TS(info_act_cnf->chan_nr)]
+ .lchan[l1sap_chan2ss(info_act_cnf->chan_nr)];
+
+ if (info_act_cnf->cause)
+ rsl_tx_chan_act_nack(lchan, info_act_cnf->cause);
+ else
+ rsl_tx_chan_act_ack(lchan);
+
+ return 0;
+}
+
+/* activation confirm received from bts model */
+static int l1sap_info_rel_cnf(struct gsm_bts_trx *trx,
+ struct osmo_phsap_prim *l1sap,
+ struct info_act_cnf_param *info_act_cnf)
+{
+ struct gsm_lchan *lchan;
+
+ LOGP(DL1P, LOGL_INFO, "deactivate confirm chan_nr=%02x trx=%d\n",
+ info_act_cnf->chan_nr, trx->nr);
+
+ lchan = &trx->ts[L1SAP_CHAN2TS(info_act_cnf->chan_nr)]
+ .lchan[l1sap_chan2ss(info_act_cnf->chan_nr)];
+
+ rsl_tx_rf_rel_ack(lchan);
+
+ return 0;
+}
+
+/* any L1 MPH_INFO confirm prim recevied from bts model */
+static int l1sap_mph_info_cnf(struct gsm_bts_trx *trx,
+ struct osmo_phsap_prim *l1sap, struct mph_info_param *info)
+{
+ int rc = 0;
+
+ switch (info->type) {
+ case PRIM_INFO_ACTIVATE:
+ rc = l1sap_info_act_cnf(trx, l1sap, &info->u.act_cnf);
+ break;
+ case PRIM_INFO_DEACTIVATE:
+ rc = l1sap_info_rel_cnf(trx, l1sap, &info->u.act_cnf);
+ break;
+ default:
+ LOGP(DL1P, LOGL_NOTICE, "unknown MPH_INFO cnf type %d\n",
+ info->type);
+ break;
+ }
+
+ return rc;
+}
+
/* PH-RTS-IND prim recevied from bts model */
static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx,
struct osmo_phsap_prim *l1sap, struct ph_data_param *rts_ind)
@@ -322,6 +383,9 @@ int l1sap_up(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_INDICATION):
rc = l1sap_mph_info_ind(trx, l1sap, &l1sap->u.info);
break;
+ case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_CONFIRM):
+ rc = l1sap_mph_info_cnf(trx, l1sap, &l1sap->u.info);
+ break;
case OSMO_PRIM(PRIM_PH_RTS, PRIM_OP_INDICATION):
rc = l1sap_ph_rts_ind(trx, l1sap, &l1sap->u.data);
break;
@@ -376,3 +440,84 @@ int l1sap_pdch_req(struct gsm_bts_trx_ts *ts, int is_ptcch, uint32_t fn,
return l1sap_down(ts->trx, l1sap);
}
+
+static int l1sap_chan_act_dact_modify(struct gsm_bts_trx *trx, uint8_t chan_nr,
+ enum osmo_mph_info_type type, uint8_t sacch_only)
+{
+ struct osmo_phsap_prim l1sap;
+
+ memset(&l1sap, 0, sizeof(l1sap));
+ osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_REQUEST,
+ NULL);
+ l1sap.u.info.type = type;
+ l1sap.u.info.u.act_req.chan_nr = chan_nr;
+ l1sap.u.info.u.act_req.sacch_only = sacch_only;
+
+ return l1sap_down(trx, &l1sap);
+}
+
+int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed *tp)
+{
+ struct gsm_bts_role_bts *btsb = trx->bts->role;
+ struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)]
+ .lchan[l1sap_chan2ss(chan_nr)];
+ struct gsm48_chan_desc *cd;
+ int rc;
+
+ LOGP(DL1P, LOGL_INFO, "activating channel chan_nr=%02x trx=%d\n",
+ chan_nr, trx->nr);
+
+ if (tp && TLVP_PRESENT(tp, GSM48_IE_CHANDESC_2) &&
+ TLVP_LEN(tp, GSM48_IE_CHANDESC_2) >= sizeof(*cd)) {
+ cd = (struct gsm48_chan_desc *)
+ TLVP_VAL(tp, GSM48_IE_CHANDESC_2);
+
+ /* our L1 only supports one global TSC for all channels
+ * one one TRX, so we need to make sure not to activate
+ * channels with a different TSC!! */
+ if (cd->h0.tsc != (lchan->ts->trx->bts->bsic & 7)) {
+ LOGP(DRSL, LOGL_ERROR, "lchan TSC %u != BSIC-TSC %u\n",
+ cd->h0.tsc, lchan->ts->trx->bts->bsic & 7);
+ return -RSL_ERR_SERV_OPT_UNIMPL;
+ }
+ }
+
+ lchan->sacch_deact = 0;
+ lchan->s = btsb->radio_link_timeout;
+
+ rc = l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_ACTIVATE, 0);
+ if (rc)
+ return -RSL_ERR_EQUIPMENT_FAIL;
+ return 0;
+}
+
+int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr)
+{
+ LOGP(DL1P, LOGL_INFO, "deactivating channel chan_nr=%02x trx=%d\n",
+ chan_nr, trx->nr);
+
+ return l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_DEACTIVATE,
+ 0);
+}
+
+int l1sap_chan_deact_sacch(struct gsm_bts_trx *trx, uint8_t chan_nr)
+{
+ struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)]
+ .lchan[l1sap_chan2ss(chan_nr)];
+
+ LOGP(DL1P, LOGL_INFO, "deactivating sacch chan_nr=%02x trx=%d\n",
+ chan_nr, trx->nr);
+
+ lchan->sacch_deact = 1;
+
+ return l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_DEACTIVATE,
+ 1);
+}
+
+int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr)
+{
+ LOGP(DL1P, LOGL_INFO, "modifying channel chan_nr=%02x trx=%d\n",
+ chan_nr, trx->nr);
+
+ return l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_MODIFY, 0);
+}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 515993e..a4ca25f 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -39,7 +39,6 @@
#include <osmo-bts/bts.h>
#include <osmo-bts/rsl.h>
#include <osmo-bts/signal.h>
-#include <osmo-bts/bts_model.h>
#include <osmo-bts/l1sap.h>
uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx);
@@ -543,9 +542,9 @@ static int pcu_rx_act_req(struct gsm_bts *bts,
return -EINVAL;
}
if (act_req->activate)
- bts_model_rsl_chan_act(lchan, NULL);
+ l1sap_chan_act(trx, gsm_lchan2chan_nr(lchan), NULL);
else
- bts_model_rsl_chan_rel(lchan);
+ l1sap_chan_rel(trx, gsm_lchan2chan_nr(lchan));
return 0;
}
@@ -650,7 +649,8 @@ static void pcu_sock_close(struct pcu_sock_state *state)
if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED
&& ts->pchan == GSM_PCHAN_PDCH) {
ts->lchan->rel_act_kind = LCHAN_REL_ACT_PCU;
- bts_model_rsl_chan_rel(ts->lchan);
+ l1sap_chan_rel(trx,
+ gsm_lchan2chan_nr(ts->lchan));
}
}
}
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 07bd4d0..724bd36 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -47,6 +47,7 @@
#include <osmo-bts/pcu_if.h>
#include <osmo-bts/handover.h>
#include <osmo-bts/cbch.h>
+#include <osmo-bts/l1sap.h>
//#define FAKE_CIPH_MODE_COMPL
@@ -857,7 +858,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
/* actually activate the channel in the BTS */
lchan->rel_act_kind = LCHAN_REL_ACT_RSL;
- rc = bts_model_rsl_chan_act(msg->lchan, &tp);
+ rc = l1sap_chan_act(lchan->ts->trx, dch->chan_nr, &tp);
if (rc < 0)
return rsl_tx_chan_act_nack(lchan, -rc);
@@ -865,10 +866,8 @@ static int rsl_rx_chan_activ(struct msgb *msg)
}
/* 8.4.14 RF CHANnel RELease is received */
-static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan)
+static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan, uint8_t chan_nr)
{
- int rc;
-
if (lchan->abis_ip.rtp_socket) {
rsl_tx_ipac_dlcx_ind(lchan, RSL_ERR_NORMAL_UNSPEC);
osmo_rtp_socket_free(lchan->abis_ip.rtp_socket);
@@ -880,9 +879,11 @@ static int rsl_rx_rf_chan_rel(struct gsm_lchan *lchan)
handover_reset(lchan);
lchan->rel_act_kind = LCHAN_REL_ACT_RSL;
- rc = bts_model_rsl_chan_rel(lchan);
+ l1sap_chan_rel(lchan->ts->trx, chan_nr);
- return rc;
+ lapdm_channel_exit(&lchan->lapdm_ch);
+
+ return 0;
}
#ifdef FAKE_CIPH_MODE_COMPL
@@ -1065,10 +1066,10 @@ static int rsl_tx_mode_modif_ack(struct gsm_lchan *lchan)
/* 8.4.9 MODE MODIFY */
static int rsl_rx_mode_modif(struct msgb *msg)
{
+ struct abis_rsl_dchan_hdr *dch = msgb_l2(msg);
struct gsm_lchan *lchan = msg->lchan;
struct rsl_ie_chan_mode *cm;
struct tlv_parsed tp;
- int rc;
rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg));
@@ -1109,12 +1110,12 @@ static int rsl_rx_mode_modif(struct msgb *msg)
/* 9.3.53 MultiRate Control */
/* 9.3.54 Supported Codec Types */
- rc = bts_model_rsl_mode_modify(msg->lchan);
+ l1sap_chan_modify(lchan->ts->trx, dch->chan_nr);
/* FIXME: delay this until L1 says OK? */
- rsl_tx_mode_modif_ack(msg->lchan);
+ rsl_tx_mode_modif_ack(lchan);
- return rc;
+ return 0;
}
/* 8.4.15 MS POWER CONTROL */
@@ -1825,13 +1826,13 @@ static int rsl_rx_dchan(struct gsm_bts_trx *trx, struct msgb *msg)
ret = rsl_rx_chan_activ(msg);
break;
case RSL_MT_RF_CHAN_REL:
- ret = rsl_rx_rf_chan_rel(msg->lchan);
+ ret = rsl_rx_rf_chan_rel(msg->lchan, dch->chan_nr);
break;
case RSL_MT_SACCH_INFO_MODIFY:
ret = rsl_rx_sacch_inf_mod(msg);
break;
case RSL_MT_DEACTIVATE_SACCH:
- ret = bts_model_rsl_deact_sacch(msg->lchan);
+ ret = l1sap_chan_deact_sacch(trx, dch->chan_nr);
break;
case RSL_MT_ENCR_CMD:
ret = rsl_rx_encr_cmd(msg);
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index bf7cc4c..0618e03 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -542,6 +542,44 @@ static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg,
return 0;
}
+static int mph_info_req(struct gsm_bts_trx *trx, struct msgb *msg,
+ struct osmo_phsap_prim *l1sap)
+{
+ uint8_t u8Tn, ss;
+ uint8_t chan_nr;
+ struct gsm_lchan *lchan;
+ int rc = 0;
+
+ switch (l1sap->u.info.type) {
+ case PRIM_INFO_ACTIVATE:
+ case PRIM_INFO_DEACTIVATE:
+ case PRIM_INFO_MODIFY:
+ chan_nr = l1sap->u.info.u.act_req.chan_nr;
+ u8Tn = L1SAP_CHAN2TS(chan_nr);
+ ss = l1sap_chan2ss(chan_nr);
+ lchan = &trx->ts[u8Tn].lchan[ss];
+ if (l1sap->u.info.type == PRIM_INFO_ACTIVATE)
+ l1if_rsl_chan_act(lchan);
+ else if (l1sap->u.info.type == PRIM_INFO_MODIFY) {
+ if (lchan->ho.active == HANDOVER_WAIT_FRAME)
+ l1if_rsl_chan_mod(lchan);
+ else
+ l1if_rsl_mode_modify(lchan);
+ } else if (l1sap->u.info.u.act_req.sacch_only)
+ l1if_rsl_deact_sacch(lchan);
+ else
+ l1if_rsl_chan_rel(lchan);
+ msgb_free(msg);
+ break;
+ default:
+ LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n",
+ l1sap->u.info.type);
+ rc = -EINVAL;
+ }
+
+ return rc;
+}
+
/* primitive from common part */
int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
{
@@ -552,6 +590,9 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST):
rc = ph_data_req(trx, msg, l1sap);
break;
+ case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_REQUEST):
+ rc = mph_info_req(trx, msg, l1sap);
+ break;
default:
LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n",
l1sap->oph.primitive, l1sap->oph.operation);
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 5f05f1d..9acee0b 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -119,6 +119,13 @@ int l1if_set_ciphering(struct femtol1_hdl *fl1h,
struct gsm_lchan *lchan,
int dir_downlink);
+/* channel control */
+int l1if_rsl_chan_act(struct gsm_lchan *lchan);
+int l1if_rsl_chan_rel(struct gsm_lchan *lchan);
+int l1if_rsl_chan_mod(struct gsm_lchan *lchan);
+int l1if_rsl_deact_sacch(struct gsm_lchan *lchan);
+int l1if_rsl_mode_modify(struct gsm_lchan *lchan);
+
/* calibration loading */
int calib_load(struct femtol1_hdl *fl1h);
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 81ec19e..8c70164 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -37,11 +37,27 @@
#include <osmo-bts/bts.h>
#include <osmo-bts/bts_model.h>
#include <osmo-bts/handover.h>
+#include <osmo-bts/l1sap.h>
#include "l1_if.h"
#include "femtobts.h"
#include "utils.h"
+static int mph_info_chan_confirm(struct gsm_lchan *lchan,
+ enum osmo_mph_info_type type, uint8_t cause)
+{
+ struct osmo_phsap_prim l1sap;
+
+ memset(&l1sap, 0, sizeof(l1sap));
+ osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_CONFIRM,
+ NULL);
+ l1sap.u.info.type = type;
+ l1sap.u.info.u.act_cnf.chan_nr = gsm_lchan2chan_nr(lchan);
+ l1sap.u.info.u.act_cnf.cause = cause;
+
+ return l1sap_up(lchan->ts->trx, &l1sap);
+}
+
enum sapi_cmd_type {
SAPI_CMD_ACTIVATE,
SAPI_CMD_CONFIG_CIPHERING,
@@ -974,7 +990,7 @@ static int sapi_activate_cb(struct gsm_lchan *lchan, int status)
gsm_lchan_name(lchan), status);
lchan_set_state(lchan, LCHAN_S_BROKEN);
sapi_clear_queue(&lchan->sapi_cmds);
- rsl_tx_chan_act_nack(lchan, RSL_ERR_PROCESSOR_OVERLOAD);
+ mph_info_chan_confirm(lchan, PRIM_INFO_ACTIVATE, RSL_ERR_PROCESSOR_OVERLOAD);
return -1;
}
@@ -985,7 +1001,7 @@ static int sapi_activate_cb(struct gsm_lchan *lchan, int status)
return 0;
lchan_set_state(lchan, LCHAN_S_ACTIVE);
- rsl_tx_chan_act_ack(lchan);
+ mph_info_chan_confirm(lchan, PRIM_INFO_ACTIVATE, 0);
/* set the initial ciphering parameters for both directions */
l1if_set_ciphering(fl1h, lchan, 0);
@@ -1007,7 +1023,6 @@ static void enqueue_sapi_act_cmd(struct gsm_lchan *lchan, int sapi, int dir)
int lchan_activate(struct gsm_lchan *lchan)
{
- struct gsm_bts_role_bts *btsb = lchan->ts->trx->bts->role;
struct femtol1_hdl *fl1h = trx_femtol1_hdl(lchan->ts->trx);
const struct lchan_sapis *s4l = &sapis_for_lchan[lchan->type];
unsigned int i;
@@ -1041,8 +1056,6 @@ int lchan_activate(struct gsm_lchan *lchan)
#warning "FIXME: Should this be in sapi_activate_cb?"
lchan_init_lapdm(lchan);
- lchan->s = btsb->radio_link_timeout;
-
return 0;
}
@@ -1317,7 +1330,7 @@ int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan)
return 0;
}
-int bts_model_rsl_mode_modify(struct gsm_lchan *lchan)
+int l1if_rsl_mode_modify(struct gsm_lchan *lchan)
{
if (lchan->state != LCHAN_S_ACTIVE)
return -1;
@@ -1427,7 +1440,7 @@ static int sapi_deactivate_cb(struct gsm_lchan *lchan, int status)
gsm_lchan_name(lchan));
lchan_set_state(lchan, LCHAN_S_BROKEN);
sapi_clear_queue(&lchan->sapi_cmds);
- rsl_tx_rf_rel_ack(lchan);
+ mph_info_chan_confirm(lchan, PRIM_INFO_DEACTIVATE, 0);
return -1;
}
@@ -1439,7 +1452,7 @@ static int sapi_deactivate_cb(struct gsm_lchan *lchan, int status)
return 0;
lchan_set_state(lchan, LCHAN_S_NONE);
- rsl_tx_rf_rel_ack(lchan);
+ mph_info_chan_confirm(lchan, PRIM_INFO_DEACTIVATE, 0);
return 0;
}
@@ -1514,7 +1527,7 @@ static int lchan_deactivate_sapis(struct gsm_lchan *lchan)
LOGP(DL1C, LOGL_ERROR, "%s all SAPIs already released?\n",
gsm_lchan_name(lchan));
lchan_set_state(lchan, LCHAN_S_BROKEN);
- rsl_tx_rf_rel_ack(lchan);
+ mph_info_chan_confirm(lchan, PRIM_INFO_DEACTIVATE, 0);
}
return res;
@@ -1677,30 +1690,11 @@ int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo,
return oml_mo_statechg_nack(mo, NM_NACK_REQ_NOT_GRANT);
}
-int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp)
+
+int l1if_rsl_chan_act(struct gsm_lchan *lchan)
{
//uint8_t mode = *TLVP_VAL(tp, RSL_IE_CHAN_MODE);
//uint8_t type = *TLVP_VAL(tp, RSL_IE_ACT_TYPE);
- struct gsm48_chan_desc *cd;
-
- /* osmo-pcu calls this without a valid 'tp' parameter, so we
- * need to make sure we don't crash here */
- if (tp && TLVP_PRESENT(tp, GSM48_IE_CHANDESC_2) &&
- TLVP_LEN(tp, GSM48_IE_CHANDESC_2) >= sizeof(*cd)) {
- cd = (struct gsm48_chan_desc *)
- TLVP_VAL(tp, GSM48_IE_CHANDESC_2);
-
- /* our L1 only supports one global TSC for all channels
- * one one TRX, so we need to make sure not to activate
- * channels with a different TSC!! */
- if (cd->h0.tsc != (lchan->ts->trx->bts->bsic & 7)) {
- LOGP(DRSL, LOGL_ERROR, "lchan TSC %u != BSIC-TSC %u\n",
- cd->h0.tsc, lchan->ts->trx->bts->bsic & 7);
- return -RSL_ERR_SERV_OPT_UNIMPL;
- }
- }
-
- lchan->sacch_deact = 0;
lchan_activate(lchan);
return 0;
}
@@ -1709,7 +1703,7 @@ int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp)
* Modify the given lchan in the handover scenario. This is a lot like
* second channel activation but with some additional activation.
*/
-int bts_model_rsl_chan_mod(struct gsm_lchan *lchan)
+int l1if_rsl_chan_mod(struct gsm_lchan *lchan)
{
const struct lchan_sapis *s4l = &sapis_for_lchan[lchan->type];
unsigned int i;
@@ -1733,7 +1727,7 @@ int bts_model_rsl_chan_mod(struct gsm_lchan *lchan)
return 0;
}
-int bts_model_rsl_chan_rel(struct gsm_lchan *lchan)
+int l1if_rsl_chan_rel(struct gsm_lchan *lchan)
{
/* A duplicate RF Release Request, ignore it */
if (lchan->state == LCHAN_S_REL_REQ) {
@@ -1746,7 +1740,7 @@ int bts_model_rsl_chan_rel(struct gsm_lchan *lchan)
return 0;
}
-int bts_model_rsl_deact_sacch(struct gsm_lchan *lchan)
+int l1if_rsl_deact_sacch(struct gsm_lchan *lchan)
{
/* Only de-activate the SACCH if the lchan is active */
if (lchan->state != LCHAN_S_ACTIVE)