Move ns_dialect field from BTS to PCU

Change-Id: Iffb22b776b91f93d6d2a7ccfa47deeecc22c33f0
This commit is contained in:
Pau Espin 2021-01-14 13:36:02 +01:00
parent 54b159aab9
commit 113fb419ec
6 changed files with 8 additions and 12 deletions

View File

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

View File

@ -120,9 +120,6 @@ struct gprs_rlcmac_bts {
*/ */
struct BTS *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 /* 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. */ * more than one message, because they get sent so rarely. */
struct msgb *app_info; struct msgb *app_info;

View File

@ -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); bts->nse = gprs_ns2_nse_by_nsei(the_pcu->nsi, nsei);
if (!bts->nse) if (!bts->nse)
bts->nse = gprs_ns2_create_nse(the_pcu->nsi, nsei, 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) { if (!bts->nse) {
LOGP(DBSSGP, LOGL_ERROR, "Failed to create NSE\n"); LOGP(DBSSGP, LOGL_ERROR, "Failed to create NSE\n");
@ -997,7 +997,7 @@ static int ns_create_nsvc(struct gprs_rlcmac_bts *bts,
continue; continue;
/* FIXME: for SNS we just use the first successful NS-VC instead of all for the initial connect */ /* 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]); rc = gprs_ns2_sns_add_endpoint(bts->nse, &remote[i]);
if (!rc) if (!rc)
return 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_nses(the_pcu->nsi);
gprs_ns2_free_binds(the_pcu->nsi); gprs_ns2_free_binds(the_pcu->nsi);
rc = ns_create_nsvc(bts, nsei, local, remote, nsvci, valid); 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 */ /* 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); const struct osmo_sockaddr *initial = gprs_ns2_nse_sns_remote(bts->nse);
for (unsigned int i = 0; i < PCU_IF_NUM_NSVC; i++) { for (unsigned int i = 0; i < PCU_IF_NUM_NSVC; i++) {

View File

@ -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[7].high = 24;
pcu->vty.mcs_lqual_ranges[8].low = 23; pcu->vty.mcs_lqual_ranges[8].low = 23;
pcu->vty.mcs_lqual_ranges[8].high = 256; pcu->vty.mcs_lqual_ranges[8].high = 256;
pcu->vty.ns_dialect = NS2_DIALECT_IPACCESS;
pcu->T_defs = T_defs_pcu; pcu->T_defs = T_defs_pcu;
osmo_tdefs_reset(pcu->T_defs); osmo_tdefs_reset(pcu->T_defs);

View File

@ -88,6 +88,7 @@ struct gprs_pcu {
/* Link quality range for each UL (M)CS. Below or above, next/prev (M)CS is selected. */ /* 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; } cs_lqual_ranges[MAX_GPRS_CS];
struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_EDGE_MCS]; 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; } vty;
struct gsmtap_inst *gsmtap; struct gsmtap_inst *gsmtap;

View File

@ -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); vty_out(vty, " gb-dialect ip-sns%s", VTY_NEWLINE);
else else
vty_out(vty, " gb-dialect classic%s", VTY_NEWLINE); 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" "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") "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")) { if (!strcmp(argv[0], "ip-sns")) {
bts->ns_dialect = NS2_DIALECT_SNS; the_pcu->vty.ns_dialect = NS2_DIALECT_SNS;
} else { } else {
bts->ns_dialect = NS2_DIALECT_IPACCESS; the_pcu->vty.ns_dialect = NS2_DIALECT_IPACCESS;
} }
return CMD_SUCCESS; return CMD_SUCCESS;