Compare commits

...

9 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther
ce701d7c5f new release with possible fix for the blackberry... 2010-06-16 12:55:14 +08:00
Holger Hans Peter Freyther
f3759a4934 si13: Use the correct pseudo length for the SI13 message
The GSM04.08 Section 10.5.2.19 specifies the L2 Pseudo Length
and the length does not include rest octets, so we will need
to use a zero for the length.

The patch is coming from Dieter Spaar.
2010-06-16 12:05:56 +08:00
Holger Hans Peter Freyther
5bfb9102af bsc_init: Enable DTX in Cell Options...
Allow the MS to use uplink discontinous transmission has
it can save some power for the MS and we can save some
bandwidth on the uplink as well.
2010-06-16 12:02:13 +08:00
Holger Hans Peter Freyther
2300d69df6 bsc: Increase the hand_off variable when we are done with the lchan.
Every time the highlevel code is done with the channel, increase
the value. This way we will be able to see if we are leaking a
channel that was never used or should have returned to the system.
2010-06-14 17:27:49 +08:00
Holger Hans Peter Freyther
c67cd2e11a vty: Dump the state of the SAPIs of a lchan as well. 2010-06-14 17:20:56 +08:00
Holger Hans Peter Freyther
2afb915758 lchan: Introduce a handoff variable...
This variable can be used by higher levels to declare they
were done with lchan...
2010-06-14 17:20:04 +08:00
Holger Hans Peter Freyther
dbac9295e7 chan_alloc: Swicth to LOGP from DEBUGP 2010-06-14 17:15:54 +08:00
Holger Hans Peter Freyther
9f972a5fb0 vty: Add show lchan-status to show the status...
Sometimes we see channels being allocated and never be freed.
This command should help to understand why this is happening
and in which state this channel is.
2010-06-14 17:00:35 +08:00
Holger Hans Peter Freyther
33f3dcbbca vty: Rename show lchan summary to show lchan-summary. 2010-06-14 17:00:19 +08:00
8 changed files with 45 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT(openbsc, 0.3.99.15onwaves)
AC_INIT(openbsc, 0.3.99.16onwaves)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
dnl kernel style compile messages
@@ -15,7 +15,7 @@ dnl checks for libraries
AC_SEARCH_LIBS(crypt, crypt,
[LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])])
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.1.7)
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.1.11)
dnl checks for header files
AC_HEADER_STDC

View File

@@ -218,6 +218,7 @@ struct gsm_subscriber_connection {
/* use count. how many users use this channel */
unsigned int use_count;
int hand_off;
/* Are we part of a special "silent" call */
int silent_call;

View File

@@ -1044,8 +1044,8 @@ static int bootstrap_bts(struct gsm_bts *bts)
}
/* some defaults for our system information */
bts->si_common.cell_options.radio_link_timeout = 2; /* 12 */
bts->si_common.cell_options.dtx = 2; /* MS shall not use upplink DTX */
bts->si_common.cell_options.radio_link_timeout = 7; /* 12 */
bts->si_common.cell_options.dtx = 0; /* MS may use upplink DTX */
bts->si_common.cell_options.pwrc = 0; /* PWRC not set */
bts->si_common.cell_sel_par.acs = 0;

View File

@@ -136,12 +136,14 @@ static void bss_close_lchans(struct bss_sccp_connection_data *bss)
{
if (bss->lchan) {
bss->lchan->msc_data = NULL;
bss->lchan->conn.hand_off += 1;
put_subscr_con(&bss->lchan->conn, 0);
bss->lchan = NULL;
}
if (bss->secondary_lchan) {
bss->secondary_lchan->msc_data = NULL;
bss->secondary_lchan->conn.hand_off += 1;
put_subscr_con(&bss->secondary_lchan->conn, 0);
bss->secondary_lchan = NULL;
}
@@ -422,12 +424,14 @@ static int handle_ass_compl(struct msgb *msg)
if (!msg->lchan->msc_data) {
LOGP(DMSC, LOGL_ERROR, "No MSC data\n");
msg->lchan->conn.hand_off += 1;
put_subscr_con(&msg->lchan->conn, 0);
return -1;
}
if (msg->lchan->msc_data->secondary_lchan != msg->lchan) {
LOGP(DMSC, LOGL_ERROR, "Wrong assignment complete.\n");
msg->lchan->conn.hand_off += 1;
put_subscr_con(&msg->lchan->conn, 0);
return -1;
}
@@ -435,6 +439,7 @@ static int handle_ass_compl(struct msgb *msg)
if (msgb_l3len(msg) - sizeof(*gh) != 1) {
LOGP(DMSC, LOGL_ERROR, "assignment compl invalid: %d\n",
msgb_l3len(msg) - sizeof(*gh));
msg->lchan->conn.hand_off += 1;
put_subscr_con(&msg->lchan->conn, 0);
return -1;
}
@@ -453,6 +458,7 @@ static int handle_ass_compl(struct msgb *msg)
if (old_chan->conn.subscr)
subscr_put(old_chan->conn.subscr);
old_chan->conn.subscr = NULL;
old_chan->conn.hand_off += 1;
put_subscr_con(&old_chan->conn, 1);
}
@@ -476,6 +482,7 @@ static int handle_ass_fail(struct msgb *msg)
LOGP(DMSC, LOGL_ERROR, "ASSIGNMENT FAILURE from MS, forwarding to MSC\n");
if (!msg->lchan->msc_data) {
LOGP(DMSC, LOGL_ERROR, "No MSC data\n");
msg->lchan->conn.hand_off += 1;
put_subscr_con(&msg->lchan->conn, 0);
return -1;
}
@@ -484,6 +491,7 @@ static int handle_ass_fail(struct msgb *msg)
if (msg->lchan->msc_data->lchan != msg->lchan) {
LOGP(DMSC, LOGL_NOTICE, "Failure should come on the old link.\n");
msg->lchan->msc_data = NULL;
msg->lchan->conn.hand_off += 1;
put_subscr_con(&msg->lchan->conn, 0);
return -1;
}
@@ -612,6 +620,7 @@ int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id)
} else if (rc <= 0 && !msg->lchan->msc_data && msg->lchan->conn.use_count == 0) {
if (msg->lchan->state == LCHAN_S_ACTIVE) {
LOGP(DMSC, LOGL_NOTICE, "Closing unowned channel.\n");
msg->lchan->conn.hand_off += 1;
use_subscr_con(&msg->lchan->conn);
put_subscr_con(&msg->lchan->conn, 0);
}

View File

@@ -170,6 +170,7 @@ static int bssmap_handle_clear_command(struct sccp_connection *conn,
bssmap_free_secondary(msg->lchan->msc_data);
msg->lchan->msc_data = NULL;
msg->lchan->conn.hand_off += 1;
put_subscr_con(&msg->lchan->conn, 0);
}
@@ -294,6 +295,7 @@ static void bssmap_free_secondary(struct bss_sccp_connection_data *data)
if (lchan->conn.subscr)
subscr_put(lchan->conn.subscr);
lchan->conn.subscr = NULL;
lchan->conn.hand_off += 1;
put_subscr_con(&lchan->conn, 1);
}
@@ -451,6 +453,7 @@ static void continue_new_assignment(struct gsm_lchan *new_lchan)
{
if (!new_lchan->msc_data) {
LOGP(DMSC, LOGL_ERROR, "No BSS data found.\n");
new_lchan->conn.hand_off += 1;
put_subscr_con(&new_lchan->conn, 0);
return;
}
@@ -458,6 +461,7 @@ static void continue_new_assignment(struct gsm_lchan *new_lchan)
if (new_lchan->msc_data->secondary_lchan != new_lchan) {
LOGP(DMSC, LOGL_ERROR, "This is not the secondary channel?\n");
new_lchan->msc_data = NULL;
new_lchan->conn.hand_off += 1;
put_subscr_con(&new_lchan->conn, 0);
return;
}

View File

@@ -426,11 +426,11 @@ int rsl_lchan_rll_release(struct gsm_lchan *lchan, u_int8_t link_id)
int _lchan_release(struct gsm_lchan *lchan, u_int8_t release_reason)
{
if (lchan->conn.use_count > 0) {
DEBUGP(DRLL, "BUG: _lchan_release called without zero use_count.\n");
LOGP(DRLL, LOGL_ERROR, "BUG: _lchan_release called without zero use_count.\n");
return 0;
}
DEBUGP(DRLL, "%s Recycling Channel\n", gsm_lchan_name(lchan));
LOGP(DRLL, LOGL_NOTICE, "%s Recycling Channel.\n", gsm_lchan_name(lchan));
rsl_lchan_set_state(lchan, LCHAN_S_REL_REQ);
lchan->release_reason = release_reason;
_lchan_handle_release(lchan);

View File

@@ -451,7 +451,8 @@ static int generate_si13(u_int8_t *output, struct gsm_bts *bts)
if (ret < 0)
return ret;
si13->header.l2_plen = ret & 0xff;
/* length is coded in bit 2 an up */
si13->header.l2_plen = 0x01;
return sizeof (*si13) + ret;
}

View File

@@ -779,6 +779,19 @@ static void lchan_dump_short_vty(struct vty *vty, struct gsm_lchan *lchan)
VTY_NEWLINE);
}
static void lchan_dump_status_vty(struct vty *vty, struct gsm_lchan *lchan)
{
vty_out(vty, "Lchan: %u/%u/%u/%u Type: %s State: %s ref: %u HO: %d Subscriber: %d "
"Time: %lu SAPI: %d/%d%s",
lchan->nr, lchan->ts->nr, lchan->ts->trx->nr,
lchan->ts->trx->bts->nr, gsm_lchant_name(lchan->type),
gsm_lchans_name(lchan->state), lchan->conn.use_count,
lchan->conn.hand_off,
lchan->conn.subscr != NULL, (unsigned long) lchan->alloc_time.tv_sec,
lchan->sapis[0], lchan->sapis[3],
VTY_NEWLINE);
}
static int lchan_summary(struct vty *vty, int argc, const char **argv,
void (*dump_cb)(struct vty *, struct gsm_lchan *))
{
@@ -859,12 +872,20 @@ DEFUN(show_lchan,
DEFUN(show_lchan_summary,
show_lchan_summary_cmd,
"show lchan summary [bts_nr] [trx_nr] [ts_nr] [lchan_nr]",
"show lchan-summary [bts_nr] [trx_nr] [ts_nr] [lchan_nr]",
SHOW_STR "Display a short summary about a logical channel\n")
{
return lchan_summary(vty, argc, argv, lchan_dump_short_vty);
}
DEFUN(show_lchan_status,
show_lchan_status_cmd,
"show lchan-status [bts_nr] [trx_nr] [ts_nr] [lchan_nr]",
SHOW_STR "Display a short stat about a logical channel\n")
{
return lchan_summary(vty, argc, argv, lchan_dump_status_vty);
}
static void e1drv_dump_vty(struct vty *vty, struct e1inp_driver *drv)
{
vty_out(vty, "E1 Input Driver %s%s", drv->name, VTY_NEWLINE);
@@ -2171,6 +2192,7 @@ int bsc_vty_init(struct gsm_network *net)
install_element(VIEW_NODE, &show_ts_cmd);
install_element(VIEW_NODE, &show_lchan_cmd);
install_element(VIEW_NODE, &show_lchan_summary_cmd);
install_element(VIEW_NODE, &show_lchan_status_cmd);
install_element(VIEW_NODE, &show_e1drv_cmd);
install_element(VIEW_NODE, &show_e1line_cmd);