[MERGED] osmo-bts[master]: pcu_sock: add pcu_connected() to query PCU availability

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Jun 17 01:24:25 UTC 2016


Neels Hofmeyr has submitted this change and it was merged.

Change subject: pcu_sock: add pcu_connected() to query PCU availability
......................................................................


pcu_sock: add pcu_connected() to query PCU availability

Will be used in upcoming dyn PDCH switching.

Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a
---
M include/osmo-bts/pcu_if.h
M src/common/pcu_sock.c
2 files changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index 0c4fb69..3ce4d0b 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -19,4 +19,6 @@
 int pcu_sock_init(const char *path);
 void pcu_sock_exit(void);
 
+bool pcu_connected(void);
+
 #endif /* _PCU_IF_H */
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 7c835fb..ea4267d 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -922,3 +922,13 @@
 	return 0;
 }
 
+bool pcu_connected(void) {
+	struct gsm_network *net = &bts_gsmnet;
+	struct pcu_sock_state *state = net->pcu_state;
+
+	if (!state)
+		return false;
+	if (state->conn_bfd.fd <= 0)
+		return false;
+	return true;
+}

-- 
To view, visit https://gerrit.osmocom.org/291
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list