aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-10-18 22:25:26 +0200
committerlaforge <laforge@osmocom.org>2020-11-11 20:15:22 +0000
commiteb77a2971b6724adbd855ceb84179446446490bb (patch)
treee030938e12395b226babb0a554106546579fa35c /src/osmo-bsc
parent98439edd85882bf9e8377f78af1bd5f63ba0212a (diff)
Use osmo_fd_*_{disable,enable}
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/meas_feed.c4
-rw-r--r--src/osmo-bsc/pcu_sock.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/osmo-bsc/meas_feed.c b/src/osmo-bsc/meas_feed.c
index 889f6efc3..881f40919 100644
--- a/src/osmo-bsc/meas_feed.c
+++ b/src/osmo-bsc/meas_feed.c
@@ -119,7 +119,7 @@ static int feed_read_cb(struct osmo_fd *ofd)
char buf[256];
rc = read(ofd->fd, buf, sizeof(buf));
- ofd->fd &= ~OSMO_FD_READ;
+ osmo_fd_read_disable(ofd);
return rc;
}
@@ -159,7 +159,7 @@ int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port)
if (rc < 0)
return rc;
- g_mfs.wqueue.bfd.when &= ~OSMO_FD_READ;
+ osmo_fd_read_disable(&g_mfs.wqueue.bfd);
if (g_mfs.dst_host)
talloc_free(g_mfs.dst_host);
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index d59df33bb..541fc8493 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -495,7 +495,7 @@ static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg)
return -EIO;
}
msgb_enqueue(&state->upqueue, msg);
- conn_bfd->when |= OSMO_FD_WRITE;
+ osmo_fd_write_enable(conn_bfd);
return 0;
}
@@ -518,7 +518,7 @@ static void pcu_sock_close(struct pcu_sock_state *state)
osmo_fd_unregister(bfd);
/* 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, ... */
@@ -597,7 +597,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)) {
@@ -612,7 +612,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;
@@ -667,7 +667,7 @@ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags)
LOGP(DPCU, LOGL_NOTICE, "PCU connects but we already have "
"another active connection ?!?\n");
/* We already have one PCU connected, this is all we support */
- state->listen_bfd.when &= ~OSMO_FD_READ;
+ osmo_fd_read_disable(&state->listen_bfd);
close(rc);
return 0;
}