lynxis lazus submitted this change.

View Change

Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
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(-)

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;
}
}

To view, visit change 40690. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I0c24d98dd699748842dca271b93e58d27cf02285
Gerrit-Change-Number: 40690
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>