[GPRS] add data structures for OML of NSE,CELL,NSVCE

Supporting GPRS means we have a number of additional OML objects to
deal with.  We need to extend our gsm_bts structure to at least
include the nm_state for each of those objects.
This commit is contained in:
Harald Welte 2009-10-24 10:19:14 +02:00
parent 73310c3c83
commit 55dd443ac2
3 changed files with 45 additions and 0 deletions

View File

@ -289,6 +289,12 @@ struct gsm_envabtse {
struct gsm_nm_state nm_state;
};
struct gsm_bts_gprs_nsvc {
struct gsm_bts *bts;
int id;
struct gsm_nm_state nm_state;
};
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
@ -356,6 +362,17 @@ struct gsm_bts {
struct gsm_envabtse envabtse[4];
} bs11;
};
/* Not entirely sure how ip.access specific this is */
struct {
struct {
struct gsm_nm_state nm_state;
} nse;
struct {
struct gsm_nm_state nm_state;
} cell;
struct gsm_bts_gprs_nsvc nsvc[2];
} gprs;
/* transceivers */
int num_trx;

View File

@ -656,6 +656,17 @@ objclass2nmstate(struct gsm_bts *bts, u_int8_t obj_class,
return NULL;
nm_state = &bts->bs11.envabtse[obj_inst->trx_nr].nm_state;
break;
case NM_OC_GPRS_NSE:
nm_state = &bts->gprs.nse.nm_state;
break;
case NM_OC_GPRS_CELL:
nm_state = &bts->gprs.cell.nm_state;
break;
case NM_OC_GPRS_NSVC:
if (obj_inst->trx_nr > ARRAY_SIZE(bts->gprs.nsvc))
return NULL;
nm_state = &bts->gprs.nsvc[obj_inst->trx_nr].nm_state;
break;
}
return nm_state;
}
@ -695,6 +706,17 @@ objclass2obj(struct gsm_bts *bts, u_int8_t obj_class,
case NM_OC_SITE_MANAGER:
obj = &bts->site_mgr;
break;
case NM_OC_GPRS_NSE:
obj = &bts->gprs.nse;
break;
case NM_OC_GPRS_CELL:
obj = &bts->gprs.cell;
break;
case NM_OC_GPRS_NSVC:
if (obj_inst->trx_nr > ARRAY_SIZE(bts->gprs.nsvc))
return NULL;
obj = &bts->gprs.nsvc[obj_inst->trx_nr];
break;
}
return obj;
}

View File

@ -139,6 +139,7 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
u_int8_t tsc, u_int8_t bsic)
{
struct gsm_bts *bts = talloc(net, struct gsm_bts);
int i;
if (!bts)
return NULL;
@ -153,6 +154,11 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
INIT_LLIST_HEAD(&bts->trx_list);
bts->ms_max_power = 15; /* dBm */
for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) {
bts->gprs.nsvc[i].bts = bts;
bts->gprs.nsvc[i].id = i;
}
/* create our primary TRX */
bts->c0 = gsm_bts_trx_alloc(bts);
if (!bts->c0) {