ABIS: Support of multiple RSL connections for ABIS/ipaccess

This commit is contained in:
Andreas Eversberg 2014-01-20 13:08:21 +01:00
parent 96735bb4c9
commit e5beda8f83
5 changed files with 33 additions and 20 deletions

View File

@ -17,7 +17,7 @@ enum {
};
struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
const char *model_name);
const char *model_name, int trx_num);
int abis_oml_sendmsg(struct msgb *msg);

View File

@ -71,6 +71,8 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line,
enum e1inp_sign_type type)
{
struct e1inp_sign_link *sign_link = NULL;
struct gsm_bts_trx *trx;
uint8_t trx_nr;
switch (type) {
case E1INP_SIGN_OML:
@ -81,16 +83,22 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line,
sign_link->trx = g_bts->c0;
bts_link_estab(g_bts);
break;
case E1INP_SIGN_RSL:
LOGP(DABIS, LOGL_INFO, "RSL Signalling link up\n");
sign_link = g_bts->c0->rsl_link =
e1inp_sign_link_create(&line->ts[E1INP_SIGN_RSL-1],
E1INP_SIGN_RSL, NULL, 0, 0);
/* FIXME: This assumes there is only one TRX! */
sign_link->trx = g_bts->c0;
trx_link_estab(sign_link->trx);
break;
default:
trx_nr = type - E1INP_SIGN_RSL;
LOGP(DABIS, LOGL_INFO, "RSL Signalling link for TRX %d up\n",
trx_nr);
trx = gsm_bts_trx_num(g_bts, trx_nr);
if (!trx) {
LOGP(DABIS, LOGL_ERROR, "TRX #%d does not exits\n",
trx_nr);
break;
}
e1inp_ts_config_sign(&line->ts[type-1], line);
sign_link = trx->rsl_link =
e1inp_sign_link_create(&line->ts[type-1],
E1INP_SIGN_RSL, NULL, 0, 0);
sign_link->trx = trx;
trx_link_estab(trx);
break;
}
@ -99,12 +107,16 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line,
static void sign_link_down(struct e1inp_line *line)
{
struct gsm_bts_trx *trx;
LOGP(DABIS, LOGL_ERROR, "Signalling link down\n");
if (g_bts->c0->rsl_link) {
e1inp_sign_link_destroy(g_bts->c0->rsl_link);
g_bts->c0->rsl_link = NULL;
trx_link_estab(g_bts->c0);
llist_for_each_entry(trx, &g_bts->trx_list, list) {
if (trx->rsl_link) {
e1inp_sign_link_destroy(trx->rsl_link);
trx->rsl_link = NULL;
trx_link_estab(trx);
}
}
if (g_bts->oml_link)
@ -225,9 +237,10 @@ static struct e1inp_line_ops line_ops = {
* global initialization as well as the actual opening of the A-bis link
* */
struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
const char *model_name)
const char *model_name, int trx_num)
{
struct e1inp_line *line;
int i;
g_bts = bts;
@ -251,7 +264,7 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
return NULL;
e1inp_line_bind_ops(line, &line_ops);
e1inp_ts_config_sign(&line->ts[E1INP_SIGN_OML-1], line);
for (i = 0; i < num_trx; i++)
for (i = 0; i < trx_num; i++)
e1inp_ts_config_sign(&line->ts[E1INP_SIGN_RSL-1+i], line);
/* This is what currently starts both the outbound OML and RSL

View File

@ -1041,8 +1041,8 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts_trx *trx, struct msgb *msg,
}
in.s_addr = htonl(ip);
LOGP(DOML, LOGL_INFO, "Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n",
inet_ntoa(in), port, stream_id);
LOGP(DOML, LOGL_INFO, "Rx IPA RSL CONNECT TRX=%d IP=%s PORT=%u "
"STREAM=0x%02x\n", trx->nr, inet_ntoa(in), port, stream_id);
if (trx->rsl_link) {
LOGP(DOML, LOGL_INFO, "Sign Link already up\n");

View File

@ -384,7 +384,7 @@ int main(int argc, char **argv)
exit(1);
}
line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS");
line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS", 1);
if (!line) {
fprintf(stderr, "unable to connect to BSC\n");
exit(1);

View File

@ -361,7 +361,7 @@ int main(int argc, char **argv)
exit(1);
}
line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS");
line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS", trx_num);
if (!line) {
fprintf(stderr, "unable to connect to BSC\n");
exit(1);