lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40690?usp=email )
Change subject: routing area: move cell.cell_id behind a geran union ......................................................................
routing area: move cell.cell_id behind a geran union
To prepare for Iu support, use the SGSN RA cell for both, a GERAN Cell and a UTRAN Service Area.
Change-Id: I0c24d98dd699748842dca271b93e58d27cf02285 --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c 2 files changed, 11 insertions(+), 5 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index f6f6173..3bdc057 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -56,13 +56,13 @@ struct sgsn_ra *ra;
enum sgsn_ra_ran_type ran_type; - - uint16_t cell_id; union { struct { uint16_t nsei; uint16_t bvci; + uint16_t cell_id; } geran; + struct { /* TODO: unused */ uint16_t rncid; diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 4bb1fb8..4d04ed7 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -102,8 +102,8 @@ return NULL;
cell->ra = ra; - cell->cell_id = cell_id; cell->ran_type = RA_TYPE_GERAN_Gb; + cell->u.geran.cell_id = cell_id; cell->u.geran.bvci = bvci; cell->u.geran.nsei = nsei;
@@ -207,7 +207,10 @@ return NULL;
llist_for_each_entry(cell, &ra->cells_alive_list, list) { - if (cell->cell_id == cell_id) + if (cell->ran_type != RA_TYPE_GERAN_Gb) + continue; + + if (cell->u.geran.cell_id == cell_id) return cell; }
@@ -230,7 +233,10 @@ continue;
llist_for_each_entry(cell, &ra->cells_alive_list, list) { - if (cell->cell_id == cell_id) + if (cell->ran_type != RA_TYPE_GERAN_Gb) + continue; + + if (cell->u.geran.cell_id == cell_id) return cell; } }