This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/3088 BSSGP: add function to reset all PTP BVC Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 Related: OS#1638 --- M include/osmocom/gprs/gprs_bssgp_bss.h M src/gb/gprs_bssgp.c M src/gb/libosmogb.map 3 files changed, 27 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/3088/1 diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index 9374e73..74211fd 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -26,7 +26,7 @@ #include <osmocom/gprs/gprs_bssgp.h> uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); - +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause); int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 8daf39f..92cd5ad 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -77,6 +77,31 @@ return NULL; } +/*! Initiate reset procedure for all PTP BVC on a given NSEI. + * + * This function initiates reset procedure for all PTP BVC with a given cause. + * \param[in] nsei NSEI to which PTP BVC should belong to + * \param[in] cause Cause of BVC RESET + * \returns 0 on success, negative error code otherwise + */ +int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause) +{ + int rc; + struct bssgp_bvc_ctx *bctx; + + llist_for_each_entry(bctx, &bssgp_bvc_ctxts, list) { + if (bctx->nsei == nsei && bctx->bvci != BVCI_SIGNALLING) { + LOGP(DBSSGP, LOGL_DEBUG, "NSEI=%u/BVCI=%u RESET due to %s\n", + nsei, bctx->bvci, bssgp_cause_str(cause)); + rc = bssgp_tx_bvc_reset(bctx, bctx->bvci, cause); + if (rc < 0) + return rc; + } + } + + return 0; +} + /* Find a BTS context based on BVCI+NSEI tuple */ struct bssgp_bvc_ctx *btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei) { diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 6aad8fd..9a0dba5 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -34,6 +34,7 @@ bssgp_rx_paging; bssgp_set_log_ss; bssgp_tx_dl_ud; +bssgp_tx_bvc_ptp_reset; bssgp_tx_paging; bssgp_vty_init; bssgp_nsi; -- To view, visit https://gerrit.osmocom.org/3088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de>