diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-22 04:54:57 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-07-28 12:18:23 +0200 |
commit | 431e085736ba958c5b69c87e401c67f0b322189d (patch) | |
tree | b2c583e4085d2e50cb5080cc2a635aeb869930f2 /src | |
parent | 19bed23065e19caac62b4a6cfe565e609046da7d (diff) |
inter-BSC HO: neighbor_ident API: drop 9bit BSIC
9-bit BSIC exist in the 3GPP specs, but we don't use them anywhere. Rather
remove that choice from the API and UI.
Change-Id: I29b92f47da2636d3a19f073755f9382fa98f9010
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo-bsc/handover_logic.c | 2 | ||||
-rw-r--r-- | src/osmo-bsc/neighbor_ident.c | 63 | ||||
-rw-r--r-- | src/osmo-bsc/neighbor_ident_vty.c | 28 |
3 files changed, 17 insertions, 76 deletions
diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 0f664c629..028b2d457 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -400,7 +400,6 @@ struct gsm_bts *bts_by_neighbor_ident(const struct gsm_network *net, struct neighbor_ident_key entry = { .from_bts = NEIGHBOR_IDENT_KEY_ANY_BTS, .arfcn = bts->c0->arfcn, - .bsic_kind = BSIC_6BIT, .bsic = bts->bsic, }; if (neighbor_ident_key_match(&entry, search_for, true)) { @@ -427,7 +426,6 @@ struct neighbor_ident_key *bts_ident_key(const struct gsm_bts *bts) static struct neighbor_ident_key key; key = (struct neighbor_ident_key){ .arfcn = bts->c0->arfcn, - .bsic_kind = BSIC_6BIT, .bsic = bts->bsic, }; return &key; diff --git a/src/osmo-bsc/neighbor_ident.c b/src/osmo-bsc/neighbor_ident.c index 8a7c580ae..4a0cd47ad 100644 --- a/src/osmo-bsc/neighbor_ident.c +++ b/src/osmo-bsc/neighbor_ident.c @@ -67,18 +67,10 @@ const char *_neighbor_ident_key_name(char *buf, size_t buflen, const struct neig APPEND_STR("invalid(%d)", ni_key->from_bts); APPEND_STR(" to "); - switch (ni_key->bsic_kind) { - default: - case BSIC_NONE: + if (ni_key->bsic == BSIC_ANY) APPEND_STR("ARFCN %u (any BSIC)", ni_key->arfcn); - break; - case BSIC_6BIT: + else APPEND_STR("ARFCN %u BSIC %u", ni_key->arfcn, ni_key->bsic & 0x3f); - break; - case BSIC_9BIT: - APPEND_STR("ARFCN %u BSIC %u(9bit)", ni_key->arfcn, ni_key->bsic & 0x1ff); - break; - } return buf; } @@ -104,18 +96,16 @@ void neighbor_ident_free(struct neighbor_ident_list *nil) } /* Return true when the entry matches the search_for requirements. - * If exact_match is false, a BSIC_NONE entry acts as wildcard to match any search_for on that ARFCN, - * and a BSIC_NONE in search_for likewise returns any one entry that matches the ARFCN; + * If exact_match is false, a BSIC_ANY entry acts as wildcard to match any search_for on that ARFCN, + * and a BSIC_ANY in search_for likewise returns any one entry that matches the ARFCN; * also a from_bts == NEIGHBOR_IDENT_KEY_ANY_BTS in either entry or search_for will match. - * If exact_match is true, only identical bsic_kind values and identical from_bts values return a match. + * If exact_match is true, only identical bsic values and identical from_bts values return a match. * Note, typically wildcard BSICs are only in entry, e.g. the user configured list, and search_for * contains a specific BSIC, e.g. as received from a Measurement Report. */ bool neighbor_ident_key_match(const struct neighbor_ident_key *entry, const struct neighbor_ident_key *search_for, bool exact_match) { - uint16_t bsic_mask; - if (exact_match && entry->from_bts != search_for->from_bts) return false; @@ -128,32 +118,13 @@ bool neighbor_ident_key_match(const struct neighbor_ident_key *entry, if (entry->arfcn != search_for->arfcn) return false; - switch (entry->bsic_kind) { - default: + if (exact_match && entry->bsic != search_for->bsic) return false; - case BSIC_NONE: - if (!exact_match) { - /* The neighbor identifier list entry matches any BSIC for this ARFCN. */ - return true; - } - /* Match exact entry */ - bsic_mask = 0; - break; - case BSIC_6BIT: - bsic_mask = 0x3f; - break; - case BSIC_9BIT: - bsic_mask = 0x1ff; - break; - } - if (!exact_match && search_for->bsic_kind == BSIC_NONE) { - /* The search is looking only for an ARFCN with any BSIC */ - return true; - } - if (search_for->bsic_kind == entry->bsic_kind - && (search_for->bsic & bsic_mask) == (entry->bsic & bsic_mask)) + + if (entry->bsic == BSIC_ANY || search_for->bsic == BSIC_ANY) return true; - return false; + + return entry->bsic == search_for->bsic; } static struct neighbor_ident *_neighbor_ident_get(const struct neighbor_ident_list *nil, @@ -189,20 +160,8 @@ bool neighbor_ident_key_valid(const struct neighbor_ident_key *key) && (key->from_bts < 0 || key->from_bts > 255)) return false; - switch (key->bsic_kind) { - case BSIC_6BIT: - if (key->bsic > 0x3f) - return false; - break; - case BSIC_9BIT: - if (key->bsic > 0x1ff) - return false; - break; - case BSIC_NONE: - break; - default: + if (key->bsic != BSIC_ANY && key->bsic > 0x3f) return false; - } return true; } diff --git a/src/osmo-bsc/neighbor_ident_vty.c b/src/osmo-bsc/neighbor_ident_vty.c index 44830abfe..a38d12311 100644 --- a/src/osmo-bsc/neighbor_ident_vty.c +++ b/src/osmo-bsc/neighbor_ident_vty.c @@ -52,8 +52,7 @@ bool neighbor_ident_bts_parse_key_params(struct vty *vty, struct gsm_bts *bts, c struct neighbor_ident_key *key) { const char *arfcn_str = argv[0]; - const char *bsic_kind = argv[1]; - const char *bsic_str = argv[2]; + const char *bsic_str = argv[1]; OSMO_ASSERT(bts); @@ -63,16 +62,9 @@ bool neighbor_ident_bts_parse_key_params(struct vty *vty, struct gsm_bts *bts, c }; if (!strcmp(bsic_str, "any")) - key->bsic_kind = BSIC_NONE; - else { - key->bsic_kind = (!strcmp(bsic_kind, "bsic9")) ? BSIC_9BIT : BSIC_6BIT; + key->bsic = BSIC_ANY; + else key->bsic = atoi(bsic_str); - if (key->bsic_kind == BSIC_6BIT && key->bsic > 0x3f) { - vty_out(vty, "%% Error: BSIC value surpasses 6-bit range: %u, use 'bsic9' instead%s", - key->bsic, VTY_NEWLINE); - return false; - } - } return true; } @@ -239,7 +231,7 @@ bool neighbor_ident_key_matches_bts(const struct neighbor_ident_key *key, struct if (!bts || !key) return false; return key->arfcn == bts->c0->arfcn - && (key->bsic_kind == BSIC_NONE || key->bsic == bts->bsic); + && (key->bsic == BSIC_ANY || key->bsic == bts->bsic); } static int add_remote_or_local_bts(struct vty *vty, const struct gsm0808_cell_id *cell_id, @@ -431,18 +423,10 @@ static bool write_neighbor_ident_list(const struct neighbor_ident_key *key, #define NEIGH_BSS_WRITE(fmt, args...) do { \ vty_out(vty, "%sneighbor add " fmt " arfcn %u ", d->indent, ## args, key->arfcn); \ - switch (key->bsic_kind) { \ - default: \ - case BSIC_NONE: \ + if (key->bsic == BSIC_ANY) \ vty_out(vty, "bsic any"); \ - break; \ - case BSIC_6BIT: \ + else \ vty_out(vty, "bsic %u", key->bsic & 0x3f); \ - break; \ - case BSIC_9BIT: \ - vty_out(vty, "bsic9 %u", key->bsic & 0x1ff); \ - break; \ - } \ vty_out(vty, "%s", VTY_NEWLINE); \ } while(0) |