aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmo-bts/gsm_data.h3
-rw-r--r--include/osmo-bts/pcuif_proto.h6
-rw-r--r--src/common/pcu_sock.c15
3 files changed, 11 insertions, 13 deletions
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 10c9d049..16521044 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/gsm23003.h>
#include <osmo-bts/paging.h>
#include <osmo-bts/tx_power.h>
@@ -29,7 +30,7 @@ struct smscb_msg;
struct gsm_network {
struct llist_head bts_list;
unsigned int num_bts;
- uint16_t mcc, mnc;
+ struct osmo_plmn_id plmn;
struct pcu_sock_state *pcu_state;
};
diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index 00b7bd54..b06077c3 100644
--- a/include/osmo-bts/pcuif_proto.h
+++ b/include/osmo-bts/pcuif_proto.h
@@ -5,7 +5,7 @@
#define PCU_SOCK_DEFAULT "/tmp/pcu_bts"
-#define PCU_IF_VERSION 0x08
+#define PCU_IF_VERSION 0x09
#define TXT_MAX_LEN 128
/* msg_type */
@@ -122,7 +122,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, mnc;
+ uint8_t mnc_3_digits;
+ 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 0f4c0531..949a5faa 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -34,6 +34,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/socket.h>
+#include <osmocom/gsm/gsm23003.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/pcu_if.h>
@@ -143,8 +144,9 @@ int pcu_tx_info_ind(void)
info_ind->flags |= PCU_IF_FLAG_SYSMO;
/* RAI */
- info_ind->mcc = net->mcc;
- info_ind->mnc = net->mnc;
+ info_ind->mcc = net->plmn.mcc;
+ info_ind->mnc = net->plmn.mnc;
+ info_ind->mnc_3_digits = net->plmn.mnc_3_digits;
info_ind->lac = bts->location_area_code;
info_ind->rac = bts->gprs.rac;
@@ -254,14 +256,7 @@ static int pcu_if_signal_cb(unsigned int subsys, unsigned int signal,
break;
si3 = (struct gsm48_system_information_type_3 *)
bts->si_buf[SYSINFO_TYPE_3];
- 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)
- | (si3->lai.digits[2] & 0xf0)
- | ((si3->lai.digits[1] & 0xf0) >> 4);
- if ((net->mnc & 0x00f) == 0x00f)
- net->mnc >>= 4;
+ osmo_plmn_from_bcd(si3->lai.digits, &net->plmn);
bts->location_area_code = ntohs(si3->lai.lac);
bts->cell_identity = si3->cell_identity;
avail_lai = 1;