[PATCH 5/8] misc: Move the nsvc_unblocked into the struct osmo_pcu

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/osmocom-net-gprs@lists.osmocom.org/.

Holger Freyther hfreyther at sysmocom.de
Sat Jul 27 20:20:51 UTC 2013


From: Holger Hans Peter Freyther <holger at moiji-mobile.com>

---
 src/gprs_bssgp_pcu.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 8c68bf6..edb088c 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -27,6 +27,8 @@ struct osmo_pcu {
 
 	struct osmo_timer_list bvc_timer;
 
+	int nsvc_unblocked;
+
 	int bvc_sig_reset;
 	int bvc_reset;
 	int bvc_unblocked;
@@ -492,7 +494,6 @@ static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, struct msg
 	return rc;
 }
 
-static int nsvc_unblocked = 0;
 
 static int nsvc_signal_cb(unsigned int subsys, unsigned int signal,
 	void *handler_data, void *signal_data)
@@ -510,8 +511,8 @@ static int nsvc_signal_cb(unsigned int subsys, unsigned int signal,
 
 	switch (signal) {
 	case S_NS_UNBLOCK:
-		if (!nsvc_unblocked) {
-			nsvc_unblocked = 1;
+		if (!the_pcu.nsvc_unblocked) {
+			the_pcu.nsvc_unblocked = 1;
 			LOGP(DPCU, LOGL_NOTICE, "NS-VC %d is unblocked.\n",
 				the_pcu.nsvc->nsvci);
 			the_pcu.bvc_sig_reset = 0;
@@ -521,8 +522,8 @@ static int nsvc_signal_cb(unsigned int subsys, unsigned int signal,
 		}
 		break;
 	case S_NS_BLOCK:
-		if (nsvc_unblocked) {
-			nsvc_unblocked = 0;
+		if (the_pcu.nsvc_unblocked) {
+			the_pcu.nsvc_unblocked = 0;
 			osmo_timer_del(&the_pcu.bvc_timer);
 			the_pcu.bvc_sig_reset = 0;
 			the_pcu.bvc_reset = 0;
-- 
1.8.3.2





More information about the osmocom-net-gprs mailing list