lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2023

  • 1 participants
  • 2205 discussions
Change in osmo-sgsn[master]: Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h
by pespin 05 Jan '23

05 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30867 ) Change subject: Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h ...................................................................... Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h Change-Id: Iea9692e7ef9bd017d89ef654d2f2ae5b30cc4550 --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/gprs_sndcp.h M src/sgsn/sgsn_main.c 3 files changed, 3 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index d464f8b..a979e68 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -460,7 +460,6 @@ /* Called on subscriber data updates */ void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx); -int gprs_sndcp_vty_init(void); struct sgsn_instance; int sgsn_gtp_init(struct sgsn_instance *sgi); diff --git a/include/osmocom/sgsn/gprs_sndcp.h b/include/osmocom/sgsn/gprs_sndcp.h index ad192fe..caf675c 100644 --- a/include/osmocom/sgsn/gprs_sndcp.h +++ b/include/osmocom/sgsn/gprs_sndcp.h @@ -60,6 +60,8 @@ extern struct llist_head gprs_sndcp_entities; +int gprs_sndcp_vty_init(void); + /* Set of SNDCP-XID negotiation (See also: TS 144 065, * Section 6.8 XID parameter negotiation) */ int sndcp_sn_xid_req(struct gprs_llc_lle *lle, uint8_t nsapi); diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c index 36ff78d..362e7aa 100644 --- a/src/sgsn/sgsn_main.c +++ b/src/sgsn/sgsn_main.c @@ -59,6 +59,7 @@ #include <osmocom/sgsn/vty.h> #include <osmocom/sgsn/sgsn.h> #include <osmocom/sgsn/gprs_llc.h> +#include <osmocom/sgsn/gprs_sndcp.h> #include <osmocom/sgsn/gprs_gmm.h> #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gprs_ns.h> -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iea9692e7ef9bd017d89ef654d2f2ae5b30cc4550 Gerrit-Change-Number: 30867 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-sgsn[master]: gprs_subscriber: Move API declarations to correct header
by pespin 05 Jan '23

05 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 ) Change subject: gprs_subscriber: Move API declarations to correct header ...................................................................... gprs_subscriber: Move API declarations to correct header Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9 --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/gprs_subscriber.h M src/sgsn/sgsn_main.c 3 files changed, 29 insertions(+), 30 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 47983e2..d464f8b 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -457,36 +457,6 @@ struct gsm_auth_tuple *sgsn_auth_get_tuple(struct sgsn_mm_ctx *mmctx, unsigned key_seq); -/* - * GPRS subscriber data - */ -#define GPRS_SUBSCRIBER_FIRST_CONTACT 0x00000001 -#define GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING (1 << 16) -#define GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING (1 << 17) -#define GPRS_SUBSCRIBER_CANCELLED (1 << 18) -#define GPRS_SUBSCRIBER_ENABLE_PURGE (1 << 19) - -#define GPRS_SUBSCRIBER_UPDATE_PENDING_MASK ( \ - GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING | \ - GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING \ -) - -int gprs_subscr_init(struct sgsn_instance *sgi); -int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx); -int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, - const uint8_t *auts, - const uint8_t *auts_rand); -int gprs_subscr_auth_sync(struct gprs_subscr *subscr, - const uint8_t *auts, const uint8_t *auts_rand); -void gprs_subscr_cleanup(struct gprs_subscr *subscr); -struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi); -struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx( struct sgsn_mm_ctx *mmctx); -struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi); -void gprs_subscr_cancel(struct gprs_subscr *subscr); -void gprs_subscr_update(struct gprs_subscr *subscr); -void gprs_subscr_update_auth_info(struct gprs_subscr *subscr); -int gprs_subscr_rx_gsup_message(struct msgb *msg); - /* Called on subscriber data updates */ void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx); diff --git a/include/osmocom/sgsn/gprs_subscriber.h b/include/osmocom/sgsn/gprs_subscriber.h index d36db75..c735a29 100644 --- a/include/osmocom/sgsn/gprs_subscriber.h +++ b/include/osmocom/sgsn/gprs_subscriber.h @@ -6,8 +6,22 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/gsm/protocol/gsm_23_003.h> +struct sgsn_instance; +struct sgsn_mm_ctx; + extern struct llist_head * const gprs_subscribers; +#define GPRS_SUBSCRIBER_FIRST_CONTACT 0x00000001 +#define GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING (1 << 16) +#define GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING (1 << 17) +#define GPRS_SUBSCRIBER_CANCELLED (1 << 18) +#define GPRS_SUBSCRIBER_ENABLE_PURGE (1 << 19) + +#define GPRS_SUBSCRIBER_UPDATE_PENDING_MASK ( \ + GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING | \ + GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING \ +) + struct gprs_subscr { struct llist_head entry; int use_count; @@ -29,3 +43,17 @@ const char *file, int line); #define gprs_subscr_get(gsub) _gprs_subscr_get(gsub, __FILE__, __LINE__) #define gprs_subscr_put(gsub) _gprs_subscr_put(gsub, __FILE__, __LINE__) + +int gprs_subscr_init(struct sgsn_instance *sgi); +int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx); +int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, + const uint8_t *auts, + const uint8_t *auts_rand); +void gprs_subscr_cleanup(struct gprs_subscr *subscr); +struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi); +struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx(struct sgsn_mm_ctx *mmctx); +struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi); +void gprs_subscr_cancel(struct gprs_subscr *subscr); +void gprs_subscr_update(struct gprs_subscr *subscr); +void gprs_subscr_update_auth_info(struct gprs_subscr *subscr); +int gprs_subscr_rx_gsup_message(struct msgb *msg); diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c index b744310..36ff78d 100644 --- a/src/sgsn/sgsn_main.c +++ b/src/sgsn/sgsn_main.c @@ -63,6 +63,7 @@ #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gprs_ns.h> #include <osmocom/sgsn/gprs_bssgp.h> +#include <osmocom/sgsn/gprs_subscriber.h> #include <osmocom/ctrl/control_if.h> #include <osmocom/ctrl/ports.h> -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9 Gerrit-Change-Number: 30866 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-sgsn[master]: Move struct sgsn_ggsn_ctx to its own file gtp_ggsn.{c,h}
by pespin 05 Jan '23

05 Jan '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/30862 ) Change subject: Move struct sgsn_ggsn_ctx to its own file gtp_ggsn.{c,h} ...................................................................... Move struct sgsn_ggsn_ctx to its own file gtp_ggsn.{c,h} Similar to what we already have for struct sgsn_mme_ctx in gtp_mme.{c,h}. This is just the nth step of properly splitting different protocol layers, data model, etc. Change-Id: Iad1895f09e43e299df7bb126bf52fdb98268392e --- M include/osmocom/sgsn/Makefile.am M include/osmocom/sgsn/gprs_sgsn.h A include/osmocom/sgsn/gtp_ggsn.h M src/sgsn/Makefile.am M src/sgsn/gprs_ranap.c M src/sgsn/gprs_sgsn.c M src/sgsn/gprs_sm.c A src/sgsn/gtp_ggsn.c M src/sgsn/sgsn_cdr.c M src/sgsn/sgsn_libgtp.c M src/sgsn/sgsn_vty.c M tests/sgsn/Makefile.am M tests/sgsn/sgsn_test.c 13 files changed, 229 insertions(+), 169 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 64ba16f..dbbc0c6 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -22,6 +22,7 @@ gprs_subscriber.h \ gprs_utils.h \ gtphub.h \ + gtp_ggsn.h \ gtp_mme.h \ sgsn.h \ sgsn_rim.h \ diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index dcda5c3..47983e2 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -20,6 +20,7 @@ struct gprs_llc_lle; struct ctrl_handle; struct gprs_subscr; +struct sgsn_ggsn_ctx; enum gsm48_gsm_cause; @@ -366,35 +367,6 @@ void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp); void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp); - -struct sgsn_ggsn_ctx { - struct llist_head list; - uint32_t id; - unsigned int gtp_version; - struct in_addr remote_addr; - int remote_restart_ctr; - struct gsn_t *gsn; - struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */ - struct osmo_timer_list echo_timer; - unsigned int echo_interval; -}; -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id); -void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc); -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id); -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); -void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx); -int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except); -int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); -void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); -void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); -void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc); - -#define LOGGGSN(ggc, level, fmt, args...) { \ - char _buf[INET_ADDRSTRLEN]; \ - LOGP(DGTP, level, "GGSN(%" PRIu32 ":%s): " fmt, (ggc)->id, inet_ntop(AF_INET, &(ggc)->remote_addr, _buf, sizeof(_buf)), ## args); \ - } while (0) - struct apn_ctx { struct llist_head list; struct sgsn_ggsn_ctx *ggsn; diff --git a/include/osmocom/sgsn/gtp_ggsn.h b/include/osmocom/sgsn/gtp_ggsn.h new file mode 100644 index 0000000..224fa35 --- /dev/null +++ b/include/osmocom/sgsn/gtp_ggsn.h @@ -0,0 +1,40 @@ +#pragma once + +#include <stdint.h> +#include <netinet/in.h> +#include <inttypes.h> + +#include <osmocom/core/linuxlist.h> +#include <osmocom/core/timer.h> +#include <osmocom/gprs/protocol/gsm_24_301.h> + +struct gsn_t; +struct sgsn_pdp_ctx; + +struct sgsn_ggsn_ctx { + struct llist_head list; + uint32_t id; + unsigned int gtp_version; + struct in_addr remote_addr; + int remote_restart_ctr; + struct gsn_t *gsn; + struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */ + struct osmo_timer_list echo_timer; + unsigned int echo_interval; +}; +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id); +void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc); +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id); +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); +void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx); +int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except); +int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); +void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); +void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); +void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc); + +#define LOGGGSN(ggc, level, fmt, args...) { \ + char _buf[INET_ADDRSTRLEN]; \ + LOGP(DGTP, level, "GGSN(%" PRIu32 ":%s): " fmt, (ggc)->id, inet_ntop(AF_INET, &(ggc)->remote_addr, _buf, sizeof(_buf)), ## args); \ + } while (0) diff --git a/src/sgsn/Makefile.am b/src/sgsn/Makefile.am index f97d2ba..638eacc 100644 --- a/src/sgsn/Makefile.am +++ b/src/sgsn/Makefile.am @@ -54,6 +54,7 @@ gprs_sndcp_pcomp.c \ gprs_sndcp_vty.c \ gprs_sndcp_xid.c \ + gtp_ggsn.c \ gtp_mme.c \ sgsn_main.c \ sgsn_vty.c \ diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c index ab3a968..72d744d 100644 --- a/src/sgsn/gprs_ranap.c +++ b/src/sgsn/gprs_ranap.c @@ -37,6 +37,7 @@ #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gprs_gmm_attach.h> #include <osmocom/sgsn/gprs_mm_state_iu_fsm.h> +#include <osmocom/sgsn/gtp_ggsn.h> /* Send RAB activation requests for all PDP contexts */ void activate_pdp_rabs(struct sgsn_mm_ctx *ctx) diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c index 304ecc5..8cfee69 100644 --- a/src/sgsn/gprs_sgsn.c +++ b/src/sgsn/gprs_sgsn.c @@ -47,6 +47,7 @@ #include <osmocom/sgsn/gprs_mm_state_iu_fsm.h> #include <osmocom/sgsn/gprs_gmm_fsm.h> #include <osmocom/sgsn/gprs_llc.h> +#include <osmocom/sgsn/gtp_ggsn.h> #include <pdp.h> @@ -535,88 +536,6 @@ talloc_free(pdp); } -void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc) -{ - bool pending = osmo_timer_pending(&ggc->echo_timer); - - /* Only enable if allowed by policy and at least 1 pdp ctx exists against ggsn */ - if (!llist_empty(&ggc->pdp_list) && ggc->echo_interval) { - if (!pending) - osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); - } else { - if (pending) - osmo_timer_del(&ggc->echo_timer); - } -} - -/* GGSN contexts */ -static void echo_timer_cb(void *data) -{ - struct sgsn_ggsn_ctx *ggc = (struct sgsn_ggsn_ctx *) data; - sgsn_ggsn_echo_req(ggc); - osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); -} - -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id) -{ - struct sgsn_ggsn_ctx *ggc; - - ggc = talloc_zero(tall_sgsn_ctx, struct sgsn_ggsn_ctx); - if (!ggc) - return NULL; - - ggc->id = id; - ggc->gtp_version = 1; - ggc->remote_restart_ctr = -1; - /* if we are called from config file parse, this gsn doesn't exist yet */ - ggc->gsn = sgsn->gsn; - INIT_LLIST_HEAD(&ggc->pdp_list); - osmo_timer_setup(&ggc->echo_timer, echo_timer_cb, ggc); - llist_add(&ggc->list, &sgsn_ggsn_ctxts); - - return ggc; -} - -void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc) -{ - OSMO_ASSERT(llist_empty(&ggc->pdp_list)); - llist_del(&ggc->list); - talloc_free(ggc); -} - -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id) -{ - struct sgsn_ggsn_ctx *ggc; - - llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) { - if (id == ggc->id) - return ggc; - } - return NULL; -} - -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr) -{ - struct sgsn_ggsn_ctx *ggc; - - llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) { - if (!memcmp(addr, &ggc->remote_addr, sizeof(*addr))) - return ggc; - } - return NULL; -} - - -struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id) -{ - struct sgsn_ggsn_ctx *ggc; - - ggc = sgsn_ggsn_ctx_by_id(id); - if (!ggc) - ggc = sgsn_ggsn_ctx_alloc(id); - return ggc; -} - /* APN contexts */ static struct apn_ctx *sgsn_apn_ctx_alloc(const char *ap_name, const char *imsi_prefix) @@ -764,64 +683,6 @@ return GSM_RESERVED_TMSI; } -void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx) -{ - /* the MM context can be deleted while the GGSN is not reachable or - * if has been crashed. */ - if (pctx->mm && pctx->mm->gmm_fsm->state == ST_GMM_REGISTERED_NORMAL) { - gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true); - sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx); - } else { - /* FIXME: GPRS paging in case MS is SUSPENDED */ - LOGPDPCTXP(LOGL_NOTICE, pctx, "Hard-dropping PDP ctx due to GGSN " - "recovery\n"); - /* FIXME: how to tell this to libgtp? */ - sgsn_pdp_ctx_free(pctx); - } -} - -/* High-level function to be called in case a GGSN has disappeared or - * otherwise lost state (recovery procedure). It will detach all related pdp ctx - * from a ggsn and communicate deact to MS. Optionally (!NULL), one pdp ctx can - * be kept alive to allow handling later message which contained the Recovery IE. */ -int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except) -{ - int num = 0; - - struct sgsn_pdp_ctx *pdp, *pdp2; - llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { - if (pdp == except) - continue; - sgsn_ggsn_ctx_drop_pdp(pdp); - num++; - } - - return num; -} - -int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn) -{ - return sgsn_ggsn_ctx_drop_all_pdp_except(ggsn, NULL); -} - -void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) -{ - llist_add(&pdp->ggsn_list, &ggc->pdp_list); - sgsn_ggsn_ctx_check_echo_timer(ggc); -} -void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) -{ - llist_del(&pdp->ggsn_list); - sgsn_ggsn_ctx_check_echo_timer(ggc); - if (pdp->destroy_ggsn) - sgsn_ggsn_ctx_free(pdp->ggsn); - pdp->ggsn = NULL; - /* Drop references to libgtp since the conn is down */ - if (pdp->lib) - pdp_freepdp(pdp->lib); - pdp->lib = NULL; -} - void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx) { OSMO_ASSERT(mmctx != NULL); diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c index 6c09c4f..182528d 100644 --- a/src/sgsn/gprs_sm.c +++ b/src/sgsn/gprs_sm.c @@ -36,6 +36,7 @@ #include <osmocom/sgsn/gprs_sm.h> #include <osmocom/sgsn/gprs_gmm.h> #include <osmocom/sgsn/gprs_utils.h> +#include <osmocom/sgsn/gtp_ggsn.h> #include <osmocom/sgsn/sgsn.h> #include <osmocom/sgsn/debug.h> #include <osmocom/sgsn/gprs_llc.h> diff --git a/src/sgsn/gtp_ggsn.c b/src/sgsn/gtp_ggsn.c new file mode 100644 index 0000000..0a670e1 --- /dev/null +++ b/src/sgsn/gtp_ggsn.c @@ -0,0 +1,178 @@ +/* GGSN context (peer) */ + +/* (C) 2009 by Harald Welte <laforge(a)gnumonks.org> + * (C) 2023 by sysmocom - s.m.f.c. GmbH <info(a)sysmocom.de> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <stdint.h> + +#include <osmocom/core/linuxlist.h> +#include <osmocom/core/talloc.h> +#include <osmocom/core/timer.h> +#include <osmocom/core/rate_ctr.h> +#include <osmocom/core/stats.h> + +#include <osmocom/sgsn/gtp_ggsn.h> +#include <osmocom/sgsn/sgsn.h> +#include <osmocom/sgsn/debug.h> +#include <osmocom/sgsn/gprs_gmm_fsm.h> +#include <osmocom/sgsn/gprs_sm.h> + +extern void *tall_sgsn_ctx; + +void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc) +{ + bool pending = osmo_timer_pending(&ggc->echo_timer); + + /* Only enable if allowed by policy and at least 1 pdp ctx exists against ggsn */ + if (!llist_empty(&ggc->pdp_list) && ggc->echo_interval) { + if (!pending) + osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); + } else { + if (pending) + osmo_timer_del(&ggc->echo_timer); + } +} + +/* GGSN contexts */ +static void echo_timer_cb(void *data) +{ + struct sgsn_ggsn_ctx *ggc = (struct sgsn_ggsn_ctx *) data; + sgsn_ggsn_echo_req(ggc); + osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); +} + +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id) +{ + struct sgsn_ggsn_ctx *ggc; + + ggc = talloc_zero(tall_sgsn_ctx, struct sgsn_ggsn_ctx); + if (!ggc) + return NULL; + + ggc->id = id; + ggc->gtp_version = 1; + ggc->remote_restart_ctr = -1; + /* if we are called from config file parse, this gsn doesn't exist yet */ + ggc->gsn = sgsn->gsn; + INIT_LLIST_HEAD(&ggc->pdp_list); + osmo_timer_setup(&ggc->echo_timer, echo_timer_cb, ggc); + llist_add(&ggc->list, &sgsn_ggsn_ctxts); + + return ggc; +} + +void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc) +{ + OSMO_ASSERT(llist_empty(&ggc->pdp_list)); + llist_del(&ggc->list); + talloc_free(ggc); +} + +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id) +{ + struct sgsn_ggsn_ctx *ggc; + + llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) { + if (id == ggc->id) + return ggc; + } + return NULL; +} + +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr) +{ + struct sgsn_ggsn_ctx *ggc; + + llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) { + if (!memcmp(addr, &ggc->remote_addr, sizeof(*addr))) + return ggc; + } + return NULL; +} + + +struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id) +{ + struct sgsn_ggsn_ctx *ggc; + + ggc = sgsn_ggsn_ctx_by_id(id); + if (!ggc) + ggc = sgsn_ggsn_ctx_alloc(id); + return ggc; +} + +void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx) +{ + /* the MM context can be deleted while the GGSN is not reachable or + * if has been crashed. */ + if (pctx->mm && pctx->mm->gmm_fsm->state == ST_GMM_REGISTERED_NORMAL) { + gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true); + sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx); + } else { + /* FIXME: GPRS paging in case MS is SUSPENDED */ + LOGPDPCTXP(LOGL_NOTICE, pctx, "Hard-dropping PDP ctx due to GGSN " + "recovery\n"); + /* FIXME: how to tell this to libgtp? */ + sgsn_pdp_ctx_free(pctx); + } +} + +/* High-level function to be called in case a GGSN has disappeared or + * otherwise lost state (recovery procedure). It will detach all related pdp ctx + * from a ggsn and communicate deact to MS. Optionally (!NULL), one pdp ctx can + * be kept alive to allow handling later message which contained the Recovery IE. */ +int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except) +{ + int num = 0; + + struct sgsn_pdp_ctx *pdp, *pdp2; + llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { + if (pdp == except) + continue; + sgsn_ggsn_ctx_drop_pdp(pdp); + num++; + } + + return num; +} + +int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn) +{ + return sgsn_ggsn_ctx_drop_all_pdp_except(ggsn, NULL); +} + +void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) +{ + llist_add(&pdp->ggsn_list, &ggc->pdp_list); + sgsn_ggsn_ctx_check_echo_timer(ggc); +} + +void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) +{ + llist_del(&pdp->ggsn_list); + sgsn_ggsn_ctx_check_echo_timer(ggc); + if (pdp->destroy_ggsn) + sgsn_ggsn_ctx_free(pdp->ggsn); + pdp->ggsn = NULL; + /* Drop references to libgtp since the conn is down */ + if (pdp->lib) + pdp_freepdp(pdp->lib); + pdp->lib = NULL; +} diff --git a/src/sgsn/sgsn_cdr.c b/src/sgsn/sgsn_cdr.c index a50b4df..24d7524 100644 --- a/src/sgsn/sgsn_cdr.c +++ b/src/sgsn/sgsn_cdr.c @@ -27,6 +27,7 @@ #include <osmocom/gsm/apn.h> #include <osmocom/sgsn/vty.h> +#include <osmocom/sgsn/gtp_ggsn.h> #include <gtp.h> #include <pdp.h> diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index a2d0c7a..58e912d 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -55,6 +55,7 @@ #include <osmocom/sgsn/gprs_ranap.h> #include <osmocom/sgsn/gprs_gmm_fsm.h> #include <osmocom/sgsn/gprs_mm_state_gb_fsm.h> +#include <osmocom/sgsn/gtp_ggsn.h> #include <osmocom/sgsn/gtp_mme.h> #include <osmocom/sgsn/sgsn_rim.h> #include <osmocom/sgsn/gprs_bssgp.h> diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index 7a94f79..18951f8 100644 --- a/src/sgsn/sgsn_vty.c +++ b/src/sgsn/sgsn_vty.c @@ -39,6 +39,7 @@ #include <osmocom/sgsn/gprs_gmm.h> #include <osmocom/sgsn/gprs_bssgp.h> #include <osmocom/sgsn/gprs_sgsn.h> +#include <osmocom/sgsn/gtp_ggsn.h> #include <osmocom/sgsn/gtp_mme.h> #include <osmocom/sgsn/vty.h> #include <osmocom/gsupclient/gsup_client.h> diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 6d8fb76..e6cb71b 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -56,6 +56,7 @@ $(top_builddir)/src/sgsn/gprs_gmm_fsm.o \ $(top_builddir)/src/sgsn/gprs_mm_state_gb_fsm.o \ $(top_builddir)/src/sgsn/gprs_sgsn.o \ + $(top_builddir)/src/sgsn/gtp_ggsn.o \ $(top_builddir)/src/sgsn/gtp_mme.o \ $(top_builddir)/src/sgsn/sgsn_vty.o \ $(top_builddir)/src/sgsn/sgsn_libgtp.o \ diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 91a3dcf..44218de 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -38,6 +38,7 @@ #include <osmocom/sgsn/gprs_subscriber.h> #include <osmocom/sgsn/gprs_utils.h> #include <osmocom/sgsn/gprs_gmm_fsm.h> +#include <osmocom/sgsn/gtp_ggsn.h> #include <stdio.h> -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Iad1895f09e43e299df7bb126bf52fdb98268392e Gerrit-Change-Number: 30862 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-bsc[master]: pcu_sock: move code that fills in trx info to helper function
by dexter 05 Jan '23

05 Jan '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30874 ) Change subject: pcu_sock: move code that fills in trx info to helper function ...................................................................... pcu_sock: move code that fills in trx info to helper function The function pcu_tx_info_ind() fills the trx information in the info indication. Since the function is already quite long, move the trx related part into a sperate helper function. Change-Id: Ic30185c9364adcc61d0a9d3483b0550ac1cdf894 Related: OS#5198 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 35 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/74/30874/1 diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index c7a6560..a1174dd 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -103,6 +103,39 @@ ts_info->ma_bit_len = ts->hopping.ma_len * 8 - ts->hopping.ma.cur_bit; } +/* Fill the TRX parameter */ +static void info_ind_fill_trx(struct gsm_pcu_if_info_trx *trx_info, const struct gsm_bts_trx *trx) +{ + unsigned int tn; + const struct gsm_bts_trx_ts *ts; + + trx_info->hlayer1 = 0x2342; + trx_info->pdch_mask = 0; + trx_info->arfcn = trx->arfcn; + + for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { + ts = &trx->ts[tn]; + if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED || + ts->pchan_is != GSM_PCHAN_PDCH) + continue; + + trx_info->pdch_mask |= (1 << tn); + trx_info->ts[tn].tsc = + (ts->tsc >= 0) ? ts->tsc : trx->bts->bsic & 7; + + if (ts->hopping.enabled) + info_ind_fill_fhp(&trx_info->ts[tn], ts); + + LOGP(DPCU, LOGL_INFO, "trx=%d ts=%d: PDCH is available " + "(tsc=%u ", trx->nr, ts->nr, trx_info->ts[tn].tsc); + if (ts->hopping.enabled) + LOGPC(DPCU, LOGL_INFO, "hopping=yes hsn=%u maio=%u ma_bit_len=%u)\n", + ts->hopping.hsn, ts->hopping.maio, trx->ts[tn].hopping.ma.data_len - trx->ts[tn].hopping.ma.cur_bit); + else + LOGPC(DPCU, LOGL_INFO, "hopping=no arfcn=%u)\n", trx->arfcn); + } +} + /* Send BTS properties to the PCU */ static int pcu_tx_info_ind(struct gsm_bts *bts) { @@ -113,8 +146,7 @@ struct gsm_bts_sm *bts_sm; struct gsm_gprs_nsvc *nsvc; struct gsm_bts_trx *trx; - struct gsm_bts_trx_ts *ts; - int i, tn; + int i; OSMO_ASSERT(bts); OSMO_ASSERT(bts->network); @@ -232,30 +264,7 @@ PCU_IF_VERSION, ARRAY_SIZE(info_ind->trx)); continue; } - info_ind->trx[i].hlayer1 = 0x2342; - info_ind->trx[i].pdch_mask = 0; - info_ind->trx[i].arfcn = trx->arfcn; - for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { - ts = &trx->ts[tn]; - if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED || - ts->pchan_is != GSM_PCHAN_PDCH) - continue; - - info_ind->trx[i].pdch_mask |= (1 << tn); - info_ind->trx[i].ts[tn].tsc = - (ts->tsc >= 0) ? ts->tsc : bts->bsic & 7; - - if (ts->hopping.enabled) - info_ind_fill_fhp(&info_ind->trx[i].ts[tn], ts); - - LOGP(DPCU, LOGL_INFO, "trx=%d ts=%d: PDCH is available " - "(tsc=%u ", trx->nr, ts->nr, info_ind->trx[i].ts[tn].tsc); - if (ts->hopping.enabled) - LOGPC(DPCU, LOGL_INFO, "hopping=yes hsn=%u maio=%u ma_bit_len=%u)\n", - ts->hopping.hsn, ts->hopping.maio, trx->ts[tn].hopping.ma.data_len - trx->ts[tn].hopping.ma.cur_bit); - else - LOGPC(DPCU, LOGL_INFO, "hopping=no arfcn=%u)\n", trx->arfcn); - } + info_ind_fill_trx(&info_ind->trx[trx->nr], trx); } return pcu_sock_send(bts, msg); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ic30185c9364adcc61d0a9d3483b0550ac1cdf894 Gerrit-Change-Number: 30874 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: pcu_sock: check trx mo state
by dexter 05 Jan '23

05 Jan '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30875 ) Change subject: pcu_sock: check trx mo state ...................................................................... pcu_sock: check trx mo state Make sure that the TRX MO state is enabled and unlocked before filling in any TRX information into the info indication Change-Id: I7a93826e6b0df187425310cb82854e7d7fb47e72 Related: OS#5198 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/30875/1 diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index a1174dd..1be8196 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -33,6 +33,7 @@ #include <osmocom/core/logging.h> #include <osmocom/gsm/l1sap.h> #include <osmocom/gsm/gsm0502.h> +#include <osmocom/bsc/abis_nm.h> #include <osmocom/bsc/gsm_data.h> #include <osmocom/bsc/pcu_if.h> @@ -113,6 +114,13 @@ trx_info->pdch_mask = 0; trx_info->arfcn = trx->arfcn; + if (trx->mo.nm_state.operational != NM_OPSTATE_ENABLED || trx->mo.nm_state.administrative != NM_STATE_UNLOCKED) { + LOG_BTS(trx->bts, DPCU, LOGL_INFO, "unavailable for PCU (op=%s adm=%s)\n", + abis_nm_opstate_name(trx->mo.nm_state.operational), + abis_nm_admin_name(trx->mo.nm_state.administrative)); + return; + } + for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { ts = &trx->ts[tn]; if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED || -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30875 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I7a93826e6b0df187425310cb82854e7d7fb47e72 Gerrit-Change-Number: 30875 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: pcu_sock: guard against too many TRX
by dexter 05 Jan '23

05 Jan '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30873 ) Change subject: pcu_sock: guard against too many TRX ...................................................................... pcu_sock: guard against too many TRX The pcuif only supports a limited but sufficient number of TRXs. When filling in the TRX array in info_ind, we must guard against overflowing the maximum number of TRXs Change-Id: I351080a112f3d3fdf833ee7fa0d77c4cd1d13e42 Related: OS#5198 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/73/30873/1 diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 1dcab56..c7a6560 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -226,6 +226,12 @@ trx = gsm_bts_trx_num(bts, i); if (!trx) continue; + if (trx->nr >= ARRAY_SIZE(info_ind->trx)) { + LOG_BTS(trx->bts, DPCU, LOGL_NOTICE, "PCU interface (version %u) " + "cannot handle more than %zu transceivers => skipped\n", + PCU_IF_VERSION, ARRAY_SIZE(info_ind->trx)); + continue; + } info_ind->trx[i].hlayer1 = 0x2342; info_ind->trx[i].pdch_mask = 0; info_ind->trx[i].arfcn = trx->arfcn; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I351080a112f3d3fdf833ee7fa0d77c4cd1d13e42 Gerrit-Change-Number: 30873 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: pcu_sock: rework check logic for ts
by dexter 05 Jan '23

05 Jan '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30876 ) Change subject: pcu_sock: rework check logic for ts ...................................................................... pcu_sock: rework check logic for ts Befor filling in the TS in the info indication, it is checked that the MO opstate is enabled. Also it is checked that the TS serves a PDCH. Lets restructure this check and move the PDCH check into a helper function as we need to check for PDCH from other location as well later. Change-Id: Icaab52ab73c38889dfadb523b89bb54cafacc99a Related: OS#5198 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/30876/1 diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 1be8196..5964f9c 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -92,6 +92,12 @@ return msg; } +/* Check if the timeslot can be utilized as PDCH */ +static bool ts_is_pdch(const struct gsm_bts_trx_ts *ts) +{ + return (ts->pchan_is == GSM_PCHAN_PDCH); +} + /* Fill the frequency hopping parameter */ static void info_ind_fill_fhp(struct gsm_pcu_if_info_trx_ts *ts_info, const struct gsm_bts_trx_ts *ts) @@ -123,8 +129,9 @@ for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { ts = &trx->ts[tn]; - if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED || - ts->pchan_is != GSM_PCHAN_PDCH) + if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED) + continue; + if (!ts_is_pdch(ts)) continue; trx_info->pdch_mask |= (1 << tn); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30876 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Icaab52ab73c38889dfadb523b89bb54cafacc99a Gerrit-Change-Number: 30876 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: pcu_sock: clean up logging in info_ind_fill_trx
by dexter 05 Jan '23

05 Jan '23
Attention is currently required from: pespin. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bsc/+/30850 to look at the new patch set (#3). Change subject: pcu_sock: clean up logging in info_ind_fill_trx ...................................................................... pcu_sock: clean up logging in info_ind_fill_trx Change-Id: Ie5c1abcf7b25fe00b6c228c49648e018f94190f0 Related: OS#5198 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/30850/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30850 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ie5c1abcf7b25fe00b6c228c49648e018f94190f0 Gerrit-Change-Number: 30850 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-bsc[master]: abis_om2000: send TS_EV_OML_READY when TRX is fully done
by dexter 05 Jan '23

05 Jan '23
Attention is currently required from: dexter. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bsc/+/30748 to look at the new patch set (#4). Change subject: abis_om2000: send TS_EV_OML_READY when TRX is fully done ...................................................................... abis_om2000: send TS_EV_OML_READY when TRX is fully done We send the TS_EV_OML_READY event early, even though the TRX is not fully done with all OML initialization steps. Lets complete the TRX initialization first and then notify each timeslot FSM with TS_EV_OML_READY. Change-Id: If5251b102c8aa45dfc8cc4ee4e0223d7dc438938 --- M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/timeslot_fsm.c 2 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/30748/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30748 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: If5251b102c8aa45dfc8cc4ee4e0223d7dc438938 Gerrit-Change-Number: 30748 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-bsc[master]: pcu_sock: clean up logging in info_ind_fill_trx
by dexter 05 Jan '23

05 Jan '23
Attention is currently required from: pespin. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30850 ) Change subject: pcu_sock: clean up logging in info_ind_fill_trx ...................................................................... Patch Set 3: (1 comment) Patchset: PS1: > As mentioned earlier (iirc) please if possible split this into 2 patches: 1 moving to helper functio […] I have done that now, in the end I have seen that most of the changes are just about refactoring and adding checks. It should be simpler to review now. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30850 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ie5c1abcf7b25fe00b6c228c49648e018f94190f0 Gerrit-Change-Number: 30850 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 05 Jan 2023 15:40:18 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • ...
  • 221
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.