aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2013-01-03 23:35:12 +0100
committerDaniel Willmann <daniel@totalueberwachung.de>2013-01-03 23:35:12 +0100
commit35a1714367f22a7b902877af9dad60f76f638ef2 (patch)
treefb3827593e9f768215e153af71e4ff5731b7cce1
parent480141bc892de458c5f68ffa15015a40108e2d0a (diff)
oml: Use sapi command queue for setting the logical channel params
-rw-r--r--src/osmo-bts-sysmo/oml.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index a4853cd..881afb1 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -43,6 +43,7 @@ enum sapi_cmd_type {
SAPI_CMD_RELEASE,
SAPI_CMD_RELEASE_ALL,
SAPI_CMD_CONFIG_CIPHERING,
+ SAPI_CMD_CONFIG_LOGCH_PARAM,
};
struct sapi_cmd {
@@ -460,6 +461,7 @@ static const struct lchan_sapis sapis_for_lchan[_GSM_LCHAN_MAX] = {
static int mph_send_activate_req(struct gsm_lchan *lchan, struct sapi_cmd *cmd);
static int mph_send_config_ciphering(struct gsm_lchan *lchan, struct sapi_cmd *cmd);
+static int mph_send_config_logchpar(struct gsm_lchan *lchan, struct sapi_cmd *cmd);
static void sapi_queue_dispatch(struct gsm_lchan *lchan, int status)
{
@@ -489,6 +491,9 @@ static void sapi_queue_dispatch(struct gsm_lchan *lchan, int status)
case SAPI_CMD_CONFIG_CIPHERING:
mph_send_config_ciphering(lchan, cmd);
break;
+ case SAPI_CMD_CONFIG_LOGCH_PARAM:
+ mph_send_config_logchpar(lchan, cmd);
+ break;
default:
LOGP(DL1C, LOGL_NOTICE,
"Unimplemented command type %d\n", cmd->type);
@@ -908,6 +913,8 @@ static int chmod_modif_compl_cb(struct msgb *l1_msg, void *data)
dump_lch_par(LOGL_INFO,
&cc->cfgParams.setLogChParams.logChParams,
cc->cfgParams.setLogChParams.sapi);
+
+ sapi_queue_dispatch(lchan, cc->status);
break;
case GsmL1_ConfigParamId_SetTxPowerLevel:
LOGPC(DL1C, LOGL_INFO, "setTxPower %f dBm\n",
@@ -948,8 +955,7 @@ err:
return 0;
}
-
-static int tx_confreq_logchpar(struct gsm_lchan *lchan, uint8_t direction)
+static int mph_send_config_logchpar(struct gsm_lchan *lchan, struct sapi_cmd *cmd)
{
struct femtol1_hdl *fl1h = trx_femtol1_hdl(lchan->ts->trx);
struct msgb *msg = l1p_msgb_alloc();
@@ -964,7 +970,7 @@ static int tx_confreq_logchpar(struct gsm_lchan *lchan, uint8_t direction)
conf_req->cfgParams.setLogChParams.sapi = lchan_to_GsmL1_Sapi_t(lchan);
conf_req->cfgParams.setLogChParams.u8Tn = lchan->ts->nr;
conf_req->cfgParams.setLogChParams.subCh = lchan_to_GsmL1_SubCh_t(lchan);
- conf_req->cfgParams.setLogChParams.dir = direction;
+ conf_req->cfgParams.setLogChParams.dir = cmd->dir;
lch_par = &conf_req->cfgParams.setLogChParams.logChParams;
lchan2lch_par(lch_par, lchan);
@@ -986,6 +992,29 @@ static int tx_confreq_logchpar(struct gsm_lchan *lchan, uint8_t direction)
return l1if_req_compl(fl1h, msg, 0, chmod_modif_compl_cb, lchan);
}
+static void enqueue_sapi_logchpar_cmd(struct gsm_lchan *lchan, int dir)
+{
+ struct sapi_cmd *cmd = talloc_zero(lchan->ts->trx, struct sapi_cmd);
+ int start;
+
+ cmd->dir = dir;
+ cmd->type = SAPI_CMD_CONFIG_LOGCH_PARAM;
+
+ start = llist_empty(&lchan->sapi_cmds);
+
+ llist_add_tail(&cmd->entry, &lchan->sapi_cmds);
+
+ if (start)
+ mph_send_config_logchpar(lchan, cmd);
+}
+
+static int tx_confreq_logchpar(struct gsm_lchan *lchan, uint8_t direction)
+{
+ enqueue_sapi_logchpar_cmd(lchan, direction);
+
+ return 0;
+}
+
int l1if_set_txpower(struct femtol1_hdl *fl1h, float tx_power)
{
struct msgb *msg = l1p_msgb_alloc();