Move ns_dialect field from BTS to PCU

Change-Id: Iffb22b776b91f93d6d2a7ccfa47deeecc22c33f0
changes/87/22187/4
Pau Espin 2 years ago
parent 54b159aab9
commit 113fb419ec
  1. 1
      src/bts.cpp
  2. 3
      src/bts.h
  3. 6
      src/gprs_bssgp_pcu.cpp
  4. 1
      src/gprs_pcu.c
  5. 1
      src/gprs_pcu.h
  6. 8
      src/pcu_vty.c

@ -201,7 +201,6 @@ static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj)
bts->n3103 = 4;
bts->n3105 = 8;
bts->si13_is_set = false;
bts->ns_dialect = NS2_DIALECT_IPACCESS;
/* TODO: increase them when CRBB decoding is implemented */
bts->ws_base = 64;

@ -120,9 +120,6 @@ struct gprs_rlcmac_bts {
*/
struct BTS *bts;
/* Are we talking Gb with IP-SNS (true) or classic Gb? */
enum gprs_ns2_dialect ns_dialect;
/* Packet Application Information (3GPP TS 44.060 11.2.47, usually ETWS primary message). We don't need to store
* more than one message, because they get sent so rarely. */
struct msgb *app_info;

@ -984,7 +984,7 @@ static int ns_create_nsvc(struct gprs_rlcmac_bts *bts,
bts->nse = gprs_ns2_nse_by_nsei(the_pcu->nsi, nsei);
if (!bts->nse)
bts->nse = gprs_ns2_create_nse(the_pcu->nsi, nsei,
GPRS_NS2_LL_UDP, bts->ns_dialect);
GPRS_NS2_LL_UDP, the_pcu->vty.ns_dialect);
if (!bts->nse) {
LOGP(DBSSGP, LOGL_ERROR, "Failed to create NSE\n");
@ -997,7 +997,7 @@ static int ns_create_nsvc(struct gprs_rlcmac_bts *bts,
continue;
/* FIXME: for SNS we just use the first successful NS-VC instead of all for the initial connect */
if (bts->ns_dialect == NS2_DIALECT_SNS) {
if (the_pcu->vty.ns_dialect == NS2_DIALECT_SNS) {
rc = gprs_ns2_sns_add_endpoint(bts->nse, &remote[i]);
if (!rc)
return rc;
@ -1066,7 +1066,7 @@ int gprs_ns_config(struct gprs_rlcmac_bts *bts, uint16_t nsei,
gprs_ns2_free_nses(the_pcu->nsi);
gprs_ns2_free_binds(the_pcu->nsi);
rc = ns_create_nsvc(bts, nsei, local, remote, nsvci, valid);
} else if (bts->ns_dialect == NS2_DIALECT_SNS) {
} else if (the_pcu->vty.ns_dialect == NS2_DIALECT_SNS) {
/* SNS: check if the initial nsvc is the same, if not recreate it */
const struct osmo_sockaddr *initial = gprs_ns2_nse_sns_remote(bts->nse);
for (unsigned int i = 0; i < PCU_IF_NUM_NSVC; i++) {

@ -89,6 +89,7 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx)
pcu->vty.mcs_lqual_ranges[7].high = 24;
pcu->vty.mcs_lqual_ranges[8].low = 23;
pcu->vty.mcs_lqual_ranges[8].high = 256;
pcu->vty.ns_dialect = NS2_DIALECT_IPACCESS;
pcu->T_defs = T_defs_pcu;
osmo_tdefs_reset(pcu->T_defs);

@ -88,6 +88,7 @@ struct gprs_pcu {
/* Link quality range for each UL (M)CS. Below or above, next/prev (M)CS is selected. */
struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS];
struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_EDGE_MCS];
enum gprs_ns2_dialect ns_dialect; /* Are we talking Gb with IP-SNS (true) or classic Gb? */
} vty;
struct gsmtap_inst *gsmtap;

@ -243,7 +243,7 @@ static int config_write_pcu(struct vty *vty)
}
}
if (bts->ns_dialect == NS2_DIALECT_SNS)
if (the_pcu->vty.ns_dialect == NS2_DIALECT_SNS)
vty_out(vty, " gb-dialect ip-sns%s", VTY_NEWLINE);
else
vty_out(vty, " gb-dialect classic%s", VTY_NEWLINE);
@ -1067,12 +1067,10 @@ DEFUN_USRATTR(cfg_pcu_gb_dialect,
"Classic Gb interface with NS-{RESET,BLOCK,UNBLOCK} and static configuration\n"
"Modern Gb interface with IP-SNS (Sub Network Service) and dynamic configuration\n")
{
struct gprs_rlcmac_bts *bts = bts_main_data();
if (!strcmp(argv[0], "ip-sns")) {
bts->ns_dialect = NS2_DIALECT_SNS;
the_pcu->vty.ns_dialect = NS2_DIALECT_SNS;
} else {
bts->ns_dialect = NS2_DIALECT_IPACCESS;
the_pcu->vty.ns_dialect = NS2_DIALECT_IPACCESS;
}
return CMD_SUCCESS;

Loading…
Cancel
Save