This patch removes the local 'end' and 'exit' implementations (which
aren't used anyway) and uses the generic ones provided by libosmocore
instead, which are enabled automatically when vty_install_default()
is used.
The prompt strings are modified to match those in
libosmocore/openbsc.
Ticket: OW#952
Sponsored-by: On-Waves ehf
---
src/common/vty.c | 39 ++++-----------------------------------
1 file changed, 4 insertions(+), 35 deletions(-)
diff --git a/src/common/vty.c b/src/common/vty.c
index 5eddc8d..d818f3f 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -71,37 +71,6 @@ int bts_vty_is_config_node(struct vty *vty, int node)
}
}
-gDEFUN(ournode_exit, ournode_exit_cmd, "exit",
- "Exit current node, go down to provious node")
-{
- switch (vty->node) {
- case TRX_NODE:
- vty->node = BTS_NODE;
- {
- struct gsm_bts_trx *trx = vty->index;
- vty->index = trx->bts;
- }
- break;
- default:
- break;
- }
- return CMD_SUCCESS;
-}
-
-gDEFUN(ournode_end, ournode_end_cmd, "end",
- "End current mode and change to enable mode")
-{
- switch (vty->node) {
- default:
- vty_config_unlock(vty);
- vty->node = ENABLE_NODE;
- vty->index = NULL;
- vty->index_sub = NULL;
- break;
- }
- return CMD_SUCCESS;
-}
-
static const char osmobts_copyright[] =
"Copyright (C) 2010, 2011 by Harald Welte, Andreas Eversberg and
On-Waves\r\n"
"License AGPLv3+: GNU AGPL version 3 or later
<http://gnu.org/licenses/agpl-3.0.html>\r\n"
@@ -140,13 +109,13 @@ struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num)
static struct cmd_node bts_node = {
BTS_NODE,
- "%s(bts)#",
+ "%s(config-bts)# ",
1,
};
static struct cmd_node trx_node = {
TRX_NODE,
- "%s(trx)#",
+ "%s(config-bts-trx)# ",
1,
};
@@ -509,7 +478,7 @@ int bts_vty_init(const struct log_info *cat)
install_node(&bts_node, config_write_bts);
install_element(CONFIG_NODE, &cfg_bts_cmd);
- install_default(BTS_NODE);
+ vty_install_default(BTS_NODE);
install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
install_element(BTS_NODE, &cfg_bts_oml_ip_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_bind_ip_cmd);
@@ -523,7 +492,7 @@ int bts_vty_init(const struct log_info *cat)
/* add and link to TRX config node */
install_element(BTS_NODE, &cfg_bts_trx_cmd);
install_node(&trx_node, config_write_dummy);
- install_default(TRX_NODE);
+ vty_install_default(TRX_NODE);
install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd);
--
1.7.9.5
Show replies by date
Currently, the msg->data pointer is just set to the IMMEDIATE ASSIGN
message and the len is adjusted accordingly. Unfortunately, this
leaves l2h (pointing to the RSL header) and l3h (pointing to the
FULL_IMM_ASS_INFO IE) in an undefined state (outside of [data, tail]).
The code in bts.c accesses the message via msg->data.
This patch sets l3h and l2h correctly. msgb_l3() will point to the
start of the IMM ASS message and should be used instead of msg->data.
Sponsored-by: On-Waves ehf
---
src/common/rsl.c | 4 +++-
src/osmo-bts-sysmo/l1_if.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 6a54612..821b1be 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -466,7 +466,9 @@ static int rsl_rx_imm_ass(struct gsm_bts_trx *trx, struct msgb *msg)
return rsl_tx_error_report(trx, RSL_ERR_MAND_IE_ERROR);
/* cut down msg to the 04.08 RR part */
- msg->data = (uint8_t *) TLVP_VAL(&tp, RSL_IE_FULL_IMM_ASS_INFO);
+ msg->l3h = (uint8_t *) TLVP_VAL(&tp, RSL_IE_FULL_IMM_ASS_INFO);
+ msg->data = msg->l3h;
+ msg->l2h = NULL;
msg->len = TLVP_LEN(&tp, RSL_IE_FULL_IMM_ASS_INFO);
/* put into the AGCH queue of the BTS */
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 3cd3be5..39c020b 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -519,7 +519,7 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
if (!msg)
memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
else {
- memcpy(msu_param->u8Buffer, msg->data, msg->len);
+ memcpy(msu_param->u8Buffer, msgb_l3(msg), msgb_l3len(msg));
msgb_free(msg);
}
}
--
1.7.9.5
Currently, the DSP is always configured with u8NbrOfAgch = 1 before
SYSINFO type 3 is received. Thus using a different value for
BS_AG_BLKS_RES may lead to inconsistencies and MS failing to receive
paging messages properly.
This patch adds a warning and error logging and should be reverted
when initialisation is done in proper order.
Sponsored-by: On-Waves ehf
---
src/common/paging.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/common/paging.c b/src/common/paging.c
index cd1c370..7c71c6f 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -535,6 +535,12 @@ static int paging_signal_cbfn(unsigned int subsys, unsigned int
signal, void *hd
struct paging_state *ps = btsb->paging_state;
struct gsm48_system_information_type_3 *si3 = (void *) bts->si_buf[SYSINFO_TYPE_3];
+#warning "TODO: Remove this when setting u8NbrOfAgch is implemented properly"
+ if (si3->control_channel_desc.bs_ag_blks_res != 1)
+ LOGP(DPAG, LOGL_ERROR,
+ "Paging: BS_AG_BLKS_RES = %d != 1 not fully supported\n",
+ si3->control_channel_desc.bs_ag_blks_res);
+
paging_si_update(ps, &si3->control_channel_desc);
}
return 0;
--
1.7.9.5
On Fri, Feb 21, 2014 at 03:09:13PM +0100, Jacob Erlbeck wrote:
Dear Jacob,
Currently, the DSP is always configured with
u8NbrOfAgch = 1 before
SYSINFO type 3 is received. Thus using a different value for
BS_AG_BLKS_RES may lead to inconsistencies and MS failing to receive
paging messages properly.
thanks for finding and pointing out this inconsistency! I think the
log message will not help much as not many people will look at the
log output and specially not during the bring-up of the BTS. I think
we should/could do:
* Add this check to OpenBSC for the sysmoBTS bts type.
* Document this in our manual as a known issue.
* Create a backlog item to resolve this issue.
holger
This patch adds and updates btsb->agch_queue_length to keep track of
the queue length.
Sponsored-by: On-Waves ehf
---
include/osmo-bts/gsm_data.h | 1 +
src/common/bts.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index c6cd7e4..aee56a9 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -49,6 +49,7 @@ struct gsm_bts_role_bts {
uint8_t ny1;
uint8_t max_ta;
struct llist_head agch_queue;
+ int agch_queue_length;
struct paging_state *paging_state;
char *bsc_oml_host;
unsigned int rtp_jitter_buf_ms;
diff --git a/src/common/bts.c b/src/common/bts.c
index 2ac411d..35fc302 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -65,6 +65,7 @@ int bts_init(struct gsm_bts *bts)
bts->role = btsb = talloc_zero(bts, struct gsm_bts_role_bts);
INIT_LLIST_HEAD(&btsb->agch_queue);
+ btsb->agch_queue_length = 0;
/* configurable via VTY */
btsb->paging_state = paging_init(btsb, 200, 0);
@@ -214,6 +215,7 @@ int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg)
/* FIXME: implement max queue length */
msgb_enqueue(&btsb->agch_queue, msg);
+ btsb->agch_queue_length++;
return 0;
}
@@ -221,8 +223,12 @@ int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg)
struct msgb *bts_agch_dequeue(struct gsm_bts *bts)
{
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+ struct msgb *msg = msgb_dequeue(&btsb->agch_queue);
+ if (!msg)
+ return NULL;
- return msgb_dequeue(&btsb->agch_queue);
+ btsb->agch_queue_length--;
+ return msg;
}
int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher)
--
1.7.9.5
This patch adds a common function bts_ccch_copy_msg() that provides
and schedules AGCH and PCH messages. It is basically a frontend to
paging_gen_msg() and bts_agch_dequeue() and contains refactored code
from l1_if.c.
Sponsored-by: On-Waves ehf
---
include/osmo-bts/bts.h | 2 ++
src/common/bts.c | 22 ++++++++++++++++++++++
src/osmo-bts-sysmo/l1_if.c | 17 ++++-------------
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index e202035..49ef617 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -26,6 +26,8 @@ void bts_setup_slot(struct gsm_bts_trx_ts *slot, uint8_t comb);
int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg);
struct msgb *bts_agch_dequeue(struct gsm_bts *bts);
+int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
+ int is_ag_res);
uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time);
uint8_t *lchan_sacch_get(struct gsm_lchan *lchan, struct gsm_time *g_time);
diff --git a/src/common/bts.c b/src/common/bts.c
index 35fc302..e17428d 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -231,6 +231,28 @@ struct msgb *bts_agch_dequeue(struct gsm_bts *bts)
return msg;
}
+int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
+ int is_ag_res)
+{
+ struct msgb *msg;
+ struct gsm_bts_role_bts *btsb = bts->role;
+ int rc;
+
+ if (!is_ag_res)
+ return paging_gen_msg(btsb->paging_state, out_buf, gt);
+
+ /* special queue of messages from IMM ASS CMD */
+ msg = bts_agch_dequeue(bts);
+ if (!msg)
+ return 0;
+
+ memcpy(out_buf, msgb_l3(msg), msgb_l3len(msg));
+ rc = msg->len;
+ msgb_free(msg);
+
+ return rc;
+}
+
int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher)
{
int sup;
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 39c020b..ba34c69 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -373,7 +373,6 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
{
struct gsm_bts_trx *trx = fl1->priv;
struct gsm_bts *bts = trx->bts;
- struct gsm_bts_role_bts *btsb = bts->role;
struct msgb *resp_msg;
GsmL1_PhDataReq_t *data_req;
GsmL1_MsgUnitParam_t *msu_param;
@@ -513,19 +512,11 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
}
break;
case GsmL1_Sapi_Agch:
- /* special queue of messages from IMM ASS CMD */
- {
- struct msgb *msg = bts_agch_dequeue(bts);
- if (!msg)
- memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
- else {
- memcpy(msu_param->u8Buffer, msgb_l3(msg), msgb_l3len(msg));
- msgb_free(msg);
- }
- }
- break;
case GsmL1_Sapi_Pch:
- rc = paging_gen_msg(btsb->paging_state, msu_param->u8Buffer, &g_time);
+ rc = bts_ccch_copy_msg(bts, msu_param->u8Buffer, &g_time,
+ rts_ind->sapi == GsmL1_Sapi_Agch);
+ if (rc <= 0)
+ memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
break;
case GsmL1_Sapi_TchF:
case GsmL1_Sapi_TchH:
--
1.7.9.5
Hi Holger,
in case you merge, please fix the length computation below:
On 21.02.2014 15:09, Jacob Erlbeck wrote:
--- a/src/common/bts.c
+++ b/src/common/bts.c
+int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
+ int is_ag_res)
+{
+
+ memcpy(out_buf, msgb_l3(msg), msgb_l3len(msg));
+ rc = msg->len;
It's
rc = msgb_l3len(msg);
which accidentally delivers the same value.
Thanks,
Jacob
This patch adds a common function bts_ccch_copy_msg() that provides
and schedules AGCH and PCH messages. It is basically a frontend to
paging_gen_msg() and bts_agch_dequeue() and contains refactored code
from l1_if.c.
Sponsored-by: On-Waves ehf
---
include/osmo-bts/bts.h | 2 ++
src/common/bts.c | 22 ++++++++++++++++++++++
src/osmo-bts-sysmo/l1_if.c | 17 ++++-------------
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index e202035..49ef617 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -26,6 +26,8 @@ void bts_setup_slot(struct gsm_bts_trx_ts *slot, uint8_t comb);
int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg);
struct msgb *bts_agch_dequeue(struct gsm_bts *bts);
+int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
+ int is_ag_res);
uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time);
uint8_t *lchan_sacch_get(struct gsm_lchan *lchan, struct gsm_time *g_time);
diff --git a/src/common/bts.c b/src/common/bts.c
index 35fc302..7bbf587 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -231,6 +231,28 @@ struct msgb *bts_agch_dequeue(struct gsm_bts *bts)
return msg;
}
+int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
+ int is_ag_res)
+{
+ struct msgb *msg;
+ struct gsm_bts_role_bts *btsb = bts->role;
+ int rc;
+
+ if (!is_ag_res)
+ return paging_gen_msg(btsb->paging_state, out_buf, gt);
+
+ /* special queue of messages from IMM ASS CMD */
+ msg = bts_agch_dequeue(bts);
+ if (!msg)
+ return 0;
+
+ memcpy(out_buf, msgb_l3(msg), msgb_l3len(msg));
+ rc = msgb_l3len(msg);
+ msgb_free(msg);
+
+ return rc;
+}
+
int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher)
{
int sup;
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 39c020b..ba34c69 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -373,7 +373,6 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
{
struct gsm_bts_trx *trx = fl1->priv;
struct gsm_bts *bts = trx->bts;
- struct gsm_bts_role_bts *btsb = bts->role;
struct msgb *resp_msg;
GsmL1_PhDataReq_t *data_req;
GsmL1_MsgUnitParam_t *msu_param;
@@ -513,19 +512,11 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
}
break;
case GsmL1_Sapi_Agch:
- /* special queue of messages from IMM ASS CMD */
- {
- struct msgb *msg = bts_agch_dequeue(bts);
- if (!msg)
- memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
- else {
- memcpy(msu_param->u8Buffer, msgb_l3(msg), msgb_l3len(msg));
- msgb_free(msg);
- }
- }
- break;
case GsmL1_Sapi_Pch:
- rc = paging_gen_msg(btsb->paging_state, msu_param->u8Buffer, &g_time);
+ rc = bts_ccch_copy_msg(bts, msu_param->u8Buffer, &g_time,
+ rts_ind->sapi == GsmL1_Sapi_Agch);
+ if (rc <= 0)
+ memcpy(msu_param->u8Buffer, fill_frame, GSM_MACBLOCK_LEN);
break;
case GsmL1_Sapi_TchF:
case GsmL1_Sapi_TchH:
--
1.7.9.5