aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-10-18 22:05:22 +0200
committerHarald Welte <laforge@osmocom.org>2021-02-03 10:41:16 +0100
commit6eb98ab25c5759e1ab385c651ca38c3447158f19 (patch)
tree439a7c722baab867289f5f4be23459dfb90c0fe3
parent98c7b44f8da542b84d018d9c14ff8b8e7b9370e8 (diff)
Use osmo_fd_*_{disable,enable}
-rw-r--r--TODO-RELEASE1
-rw-r--r--src/common/pcu_sock.c8
-rw-r--r--src/osmo-bts-lc15/l1_transp_hw.c8
-rw-r--r--src/osmo-bts-oc2g/l1_transp_hw.c8
-rw-r--r--src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c2
-rw-r--r--src/osmo-bts-sysmo/l1_transp_hw.c8
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c2
7 files changed, 19 insertions, 18 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 03c11eb2..66a9bb35 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 ffa8e77b..fb32773a 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -926,7 +926,7 @@ static int pcu_sock_send(struct gsm_network *net, struct msgb *msg)
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 @@ static void pcu_sock_close(struct pcu_sock_state *state)
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 @@ static int pcu_sock_write(struct osmo_fd *bfd)
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 @@ static int pcu_sock_write(struct osmo_fd *bfd)
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 ffe8613e..36b77fed 100644
--- a/src/osmo-bts-lc15/l1_transp_hw.c
+++ b/src/osmo-bts-lc15/l1_transp_hw.c
@@ -99,7 +99,7 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
/* 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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
}
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 daebf602..3738b237 100644
--- a/src/osmo-bts-oc2g/l1_transp_hw.c
+++ b/src/osmo-bts-oc2g/l1_transp_hw.c
@@ -99,7 +99,7 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
/* 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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
}
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 b9f8dc57..f66761af 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 @@ static void bts_recon_timer_cb(void *data)
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 5561af47..7df74eb5 100644
--- a/src/osmo-bts-sysmo/l1_transp_hw.c
+++ b/src/osmo-bts-sysmo/l1_transp_hw.c
@@ -106,7 +106,7 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
/* 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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
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 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what)
}
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 0126aaa5..6ea28763 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 @@ static void bts_recon_timer_cb(void *data)
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");