aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael McTernan <mike.mcternan@wavemobile.com>2015-07-03 10:48:37 +0100
committerMichael McTernan <mike.mcternan@wavemobile.com>2015-07-03 10:48:37 +0100
commit5bd5a65dfccd8b11243fd3c9163bedf04b6736a2 (patch)
tree879a9fe8637472fd722053eef2c9b4f9179a3d1a
parentcc4ada5bc4fdd1eb0b20ad2512312f20c253669b (diff)
Updates to build with mnc_t.
Signed-off-by: Michael McTernan <mike.mcternan@wavemobile.com>
-rw-r--r--include/osmo-bts/gsm_data.h4
-rw-r--r--include/osmo-bts/pcuif_proto.h4
-rw-r--r--src/common/pcu_sock.c14
3 files changed, 17 insertions, 5 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index c7a0fc61..fb6b6616 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -4,6 +4,7 @@
#include <osmocom/core/timer.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/lapdm.h>
+#include <osmocom/gsm/gsm48.h>
#include <osmo-bts/paging.h>
@@ -17,7 +18,8 @@ struct pcu_sock_state;
struct gsm_network {
struct llist_head bts_list;
unsigned int num_bts;
- uint16_t mcc, mnc;
+ uint16_t mcc;
+ gsm_mnc_t mnc;
struct pcu_sock_state *pcu_state;
};
diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index 9d740ac1..a7db9f48 100644
--- a/include/osmo-bts/pcuif_proto.h
+++ b/include/osmo-bts/pcuif_proto.h
@@ -84,7 +84,9 @@ struct gsm_pcu_if_info_ind {
struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */
uint8_t bsic;
/* RAI */
- uint16_t mcc, mnc, lac, rac;
+ uint16_t mcc;
+ gsm_mnc_t mnc;
+ uint16_t lac, rac;
/* NSE */
uint16_t nsei;
uint8_t nse_timer[7];
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index a978e469..f9e08eae 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -249,11 +249,19 @@ static int pcu_if_signal_cb(unsigned int subsys, unsigned int signal,
net->mcc = ((si3->lai.digits[0] & 0x0f) << 8)
| (si3->lai.digits[0] & 0xf0)
| (si3->lai.digits[1] & 0x0f);
- net->mnc = ((si3->lai.digits[2] & 0x0f) << 8)
+ net->mnc.network_code = ((si3->lai.digits[2] & 0x0f) << 8)
| (si3->lai.digits[2] & 0xf0)
| ((si3->lai.digits[1] & 0xf0) >> 4);
- if ((net->mnc & 0x00f) == 0x00f)
- net->mnc >>= 4;
+ if ((net->mnc.network_code & 0x00f) == 0x00f)
+ {
+ net->mnc.two_digits = true;
+ net->mnc.network_code >>= 4;
+ }
+ else
+ {
+ net->mnc.two_digits = false;
+ }
+
bts->location_area_code = ntohs(si3->lai.lac);
bts->cell_identity = si3->cell_identity;
avail_lai = 1;