Add user-configurable BSIC setting

This commit is contained in:
Harald Welte 2009-05-23 16:56:52 +00:00
parent 110c0ab6c5
commit 78f2f508e6
4 changed files with 29 additions and 2 deletions

View File

@ -15,6 +15,7 @@
#define HARDCODED_ARFCN 123
#define HARDCODED_TSC 7
#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
enum gsm_hooks {
GSM_HOOK_NM_SWLOAD,
@ -274,6 +275,8 @@ struct gsm_bts {
u_int8_t location_area_code;
/* Training Sequence Code */
u_int8_t tsc;
/* Base Station Identification Code (BSIC) */
u_int8_t bsic;
/* type of BTS */
enum gsm_bts_type type;
/* how do we talk OML with this TRX? */

View File

@ -880,6 +880,10 @@ static void patch_tables(struct gsm_bts *bts)
/* patch Control Channel Description 10.5.2.11 */
type_3->control_channel_desc = bts->chan_desc;
/* patch BSIC */
msg_2[6] = bts->bsic;
nanobts_attr_bts[sizeof(nanobts_attr_bts)-1] = bts->bsic;
}

View File

@ -109,6 +109,7 @@ struct gsm_network *gsm_network_init(unsigned int num_bts, enum gsm_bts_type bts
bts->nr = i;
bts->type = bts_type;
bts->tsc = HARDCODED_TSC;
bts->bsic = HARDCODED_BSIC;
for (j = 0; j < BTS_MAX_TRX; j++) {
struct gsm_bts_trx *trx = &bts->trx[j];

View File

@ -105,9 +105,9 @@ static void e1isl_dump_vty(struct vty *vty, struct e1inp_sign_link *e1l)
static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
{
vty_out(vty, "BTS %u is of %s type, has LAC %u, TSC %u and %u TRX%s",
vty_out(vty, "BTS %u is of %s type, has LAC %u, BSIC %u, TSC %u and %u TRX%s",
bts->nr, btstype2str(bts->type), bts->location_area_code,
bts->tsc, bts->num_trx, VTY_NEWLINE);
bts->bsic, bts->tsc, bts->num_trx, VTY_NEWLINE);
if (is_ipaccess_bts(bts))
vty_out(vty, " Unit ID: %u/%u/0%s",
bts->ip_access.site_id, bts->ip_access.bts_id,
@ -633,6 +633,25 @@ DEFUN(cfg_bts_tsc,
return CMD_SUCCESS;
}
DEFUN(cfg_bts_bsic,
cfg_bts_bsic_cmd,
"base_station_id_code <0-63>",
"Set the Base Station Identity Code (BSIC) of this BTS\n")
{
struct gsm_bts *bts = vty->index;
int bsic = atoi(argv[0]);
if (bsic < 0 || bsic > 0x3f) {
vty_out(vty, "%% TSC %d is not in the valid range (0-255)%s",
bsic, VTY_NEWLINE);
return CMD_WARNING;
}
bts->bsic = bsic;
return CMD_SUCCESS;
}
DEFUN(cfg_bts_unit_id,
cfg_bts_unit_id_cmd,
"unit_id <0-65534> <0-255>",