Change in osmo-bts[master]: Use osmo_fd_*_{disable,enable}

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

laforge gerrit-no-reply at lists.osmocom.org
Wed Feb 3 12:20:22 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/20775 )

Change subject: Use osmo_fd_*_{disable,enable}
......................................................................

Use osmo_fd_*_{disable,enable}

Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
Change-Id: I0da17d851ccb83c28a70c9039d0a4d1fe63da0ec
---
M TODO-RELEASE
M src/common/pcu_sock.c
M src/osmo-bts-lc15/l1_transp_hw.c
M src/osmo-bts-oc2g/l1_transp_hw.c
M src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
M src/osmo-bts-sysmo/l1_transp_hw.c
M src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
7 files changed, 19 insertions(+), 18 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/TODO-RELEASE b/TODO-RELEASE
index 03c11eb..66a9bb3 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -1 +1,2 @@
 * update osmo-gsm-manuals dependency to > 0.3.0 for vty_cpu_sched.adoc include.
+* update libosmocore dependency for osmo_fd_{read,write}_{enable,disable}()
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index ffa8e77..fb32773 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -926,7 +926,7 @@
 		return -EIO;
 	}
 	msgb_enqueue(&state->upqueue, msg);
-	conn_bfd->when |= OSMO_FD_WRITE;
+	osmo_fd_write_enable(conn_bfd);
 
 	return 0;
 }
@@ -956,7 +956,7 @@
 	regenerate_si4_restoctets(bts);
 
 	/* re-enable the generation of ACCEPT for new connections */
-	state->listen_bfd.when |= OSMO_FD_READ;
+	osmo_fd_read_enable(&state->listen_bfd);
 
 #if 0
 	/* remove si13, ... */
@@ -1045,7 +1045,7 @@
 		msg = llist_entry(state->upqueue.next, struct msgb, list);
 		pcu_prim = (struct gsm_pcu_if *)msg->data;
 
-		bfd->when &= ~OSMO_FD_WRITE;
+		osmo_fd_write_disable(bfd);
 
 		/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
 		if (!msgb_length(msg)) {
@@ -1060,7 +1060,7 @@
 			goto close;
 		if (rc < 0) {
 			if (errno == EAGAIN) {
-				bfd->when |= OSMO_FD_WRITE;
+				osmo_fd_write_enable(bfd);
 				break;
 			}
 			goto close;
diff --git a/src/osmo-bts-lc15/l1_transp_hw.c b/src/osmo-bts-lc15/l1_transp_hw.c
index ffe8613..36b77fe 100644
--- a/src/osmo-bts-lc15/l1_transp_hw.c
+++ b/src/osmo-bts-lc15/l1_transp_hw.c
@@ -99,7 +99,7 @@
 		struct msgb *msg, *tmp;
 		int written, count = 0;
 
-		fd->when &= ~OSMO_FD_WRITE;
+		osmo_fd_write_disable(fd);
 
 		llist_for_each_entry(msg, &queue->msg_queue, list) {
 			/* more writes than we have */
@@ -117,7 +117,7 @@
 		/* Nothing scheduled? This should not happen. */
 		if (count == 0) {
 			if (!llist_empty(&queue->msg_queue))
-				fd->when |= OSMO_FD_WRITE;
+				osmo_fd_write_enable(fd);
 			return 0;
 		}
 
@@ -125,7 +125,7 @@
 		if (written < 0) {
 			/* nothing written?! */
 			if (!llist_empty(&queue->msg_queue))
-				fd->when |= OSMO_FD_WRITE;
+				osmo_fd_write_enable(fd);
 			return 0;
 		}
 
@@ -144,7 +144,7 @@
 		}
 
 		if (!llist_empty(&queue->msg_queue))
-			fd->when |= OSMO_FD_WRITE;
+			osmo_fd_write_enable(fd);
 	}
 
 	return 0;
diff --git a/src/osmo-bts-oc2g/l1_transp_hw.c b/src/osmo-bts-oc2g/l1_transp_hw.c
index daebf60..3738b23 100644
--- a/src/osmo-bts-oc2g/l1_transp_hw.c
+++ b/src/osmo-bts-oc2g/l1_transp_hw.c
@@ -99,7 +99,7 @@
 		struct msgb *msg, *tmp;
 		int written, count = 0;
 
-		fd->when &= ~OSMO_FD_WRITE;
+		osmo_fd_write_disable(fd);
 
 		llist_for_each_entry(msg, &queue->msg_queue, list) {
 			/* more writes than we have */
@@ -117,7 +117,7 @@
 		/* Nothing scheduled? This should not happen. */
 		if (count == 0) {
 			if (!llist_empty(&queue->msg_queue))
-				fd->when |= OSMO_FD_WRITE;
+				osmo_fd_write_enable(fd);
 			return 0;
 		}
 
@@ -125,7 +125,7 @@
 		if (written < 0) {
 			/* nothing written?! */
 			if (!llist_empty(&queue->msg_queue))
-				fd->when |= OSMO_FD_WRITE;
+				osmo_fd_write_enable(fd);
 			return 0;
 		}
 
@@ -144,7 +144,7 @@
 		}
 
 		if (!llist_empty(&queue->msg_queue))
-			fd->when |= OSMO_FD_WRITE;
+			osmo_fd_write_enable(fd);
 	}
 
 	return 0;
diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
index b9f8dc5..f66761a 100644
--- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
+++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
@@ -605,7 +605,7 @@
 	select_led_pattern(mgr);
 
 	/* The connection failures are to be expected during boot */
-	mgr->oc2gbts_ctrl.bts_conn->ofd->when |= OSMO_FD_WRITE;
+	osmo_fd_write_enable(mgr->oc2gbts_ctrl.bts_conn->ofd);
 	rc = ipa_client_conn_open(mgr->oc2gbts_ctrl.bts_conn);
 	if (rc < 0) {
 		LOGP(DLCTRL, LOGL_NOTICE, "Failed to connect to BTS.\n");
diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c
index 5561af4..7df74eb 100644
--- a/src/osmo-bts-sysmo/l1_transp_hw.c
+++ b/src/osmo-bts-sysmo/l1_transp_hw.c
@@ -106,7 +106,7 @@
 		struct msgb *msg, *tmp;
 		int written, count = 0;
 
-		fd->when &= ~OSMO_FD_WRITE;
+		osmo_fd_write_disable(fd);
 
 		llist_for_each_entry(msg, &queue->msg_queue, list) {
 			/* more writes than we have */
@@ -124,7 +124,7 @@
 		/* Nothing scheduled? This should not happen. */
 		if (count == 0) {
 			if (!llist_empty(&queue->msg_queue))
-				fd->when |= OSMO_FD_WRITE;
+				osmo_fd_write_enable(fd);
 			return 0;
 		}
 
@@ -132,7 +132,7 @@
 		if (written < 0) {
 			/* nothing written?! */
 			if (!llist_empty(&queue->msg_queue))
-				fd->when |= OSMO_FD_WRITE;
+				osmo_fd_write_enable(fd);
 			return 0;
 		}
 
@@ -151,7 +151,7 @@
 		}
 
 		if (!llist_empty(&queue->msg_queue))
-			fd->when |= OSMO_FD_WRITE;
+			osmo_fd_write_enable(fd);
 	}
 
 	return 0;
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
index 0126aaa..6ea2876 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
@@ -457,7 +457,7 @@
 	struct sysmobts_mgr_instance *mgr = data;
 
 	/* The connection failures are to be expected during boot */
-	mgr->calib.bts_conn->ofd->when |= OSMO_FD_WRITE;
+	osmo_fd_write_enable(mgr->calib.bts_conn->ofd);
 	rc = ipa_client_conn_open(mgr->calib.bts_conn);
 	if (rc < 0) {
 		LOGP(DLCTRL, LOGL_NOTICE, "Failed to connect to BTS.\n");

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20775
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I0da17d851ccb83c28a70c9039d0a4d1fe63da0ec
Gerrit-Change-Number: 20775
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210203/1ec19ddf/attachment.htm>


More information about the gerrit-log mailing list