aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-10-18 22:41:40 +0200
committerHarald Welte <laforge@osmocom.org>2020-10-18 22:41:40 +0200
commit08970c562fe688812137ec6f3960a4311d92254b (patch)
tree479c3119d3eceec9658e80e1ba15cff62dbf046a
parente91544d740a8606a994053b2f9eaf99059f40e33 (diff)
ipc: Use OSMO_FD_* instead of deprecated BSC_FD_*
-rw-r--r--Transceiver52M/device/ipc/IPCDevice.cpp18
-rw-r--r--Transceiver52M/device/ipc/ipc-driver-test.c2
-rw-r--r--Transceiver52M/device/ipc/ipc_chan.c14
-rw-r--r--Transceiver52M/device/ipc/ipc_sock.c16
4 files changed, 25 insertions, 25 deletions
diff --git a/Transceiver52M/device/ipc/IPCDevice.cpp b/Transceiver52M/device/ipc/IPCDevice.cpp
index 32a46e5..102cb9b 100644
--- a/Transceiver52M/device/ipc/IPCDevice.cpp
+++ b/Transceiver52M/device/ipc/IPCDevice.cpp
@@ -522,7 +522,7 @@ static int ipc_sock_send(struct ipc_per_trx_sock_state *state, struct msgb *msg)
return -EIO;
}
msgb_enqueue(&state->upqueue, msg);
- conn_bfd->when |= BSC_FD_WRITE;
+ conn_bfd->when |= OSMO_FD_WRITE;
return 0;
}
@@ -659,7 +659,7 @@ int IPCDevice::ipc_sock_write(struct osmo_fd *bfd)
msg = llist_entry(master_sk_state.upqueue.next, struct msgb, list);
ipc_prim = (struct ipc_sk_if *)msg->data;
- bfd->when &= ~BSC_FD_WRITE;
+ bfd->when &= ~OSMO_FD_WRITE;
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
if (!msgb_length(msg)) {
@@ -676,7 +676,7 @@ int IPCDevice::ipc_sock_write(struct osmo_fd *bfd)
goto close;
if (rc < 0) {
if (errno == EAGAIN) {
- bfd->when |= BSC_FD_WRITE;
+ bfd->when |= OSMO_FD_WRITE;
break;
}
goto close;
@@ -706,7 +706,7 @@ int IPCDevice::ipc_chan_sock_write(struct osmo_fd *bfd)
/* peek at the beginning of the queue */
msg = llist_entry(sk_chan_state[bfd->priv_nr].upqueue.next, struct msgb, list);
ipc_prim = (struct ipc_sk_chan_if *)msg->data;
- bfd->when &= ~BSC_FD_WRITE;
+ bfd->when &= ~OSMO_FD_WRITE;
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
if (!msgb_length(msg)) {
LOGP(DDEV, LOGL_ERROR,
@@ -722,7 +722,7 @@ int IPCDevice::ipc_chan_sock_write(struct osmo_fd *bfd)
goto close;
if (rc < 0) {
if (errno == EAGAIN) {
- bfd->when |= BSC_FD_WRITE;
+ bfd->when |= OSMO_FD_WRITE;
break;
}
goto close;
@@ -746,12 +746,12 @@ static int ipc_sock_cb(struct osmo_fd *bfd, unsigned int flags)
IPCDevice *device = static_cast<IPCDevice *>(bfd->data);
int rc = 0;
- if (flags & BSC_FD_READ)
+ if (flags & OSMO_FD_READ)
rc = device->ipc_sock_read(bfd);
if (rc < 0)
return rc;
- if (flags & BSC_FD_WRITE)
+ if (flags & OSMO_FD_WRITE)
rc = device->ipc_sock_write(bfd);
return rc;
@@ -762,12 +762,12 @@ static int ipc_chan_sock_cb(struct osmo_fd *bfd, unsigned int flags)
IPCDevice *device = static_cast<IPCDevice *>(bfd->data);
int rc = 0;
- if (flags & BSC_FD_READ)
+ if (flags & OSMO_FD_READ)
rc = device->ipc_chan_sock_read(bfd);
if (rc < 0)
return rc;
- if (flags & BSC_FD_WRITE)
+ if (flags & OSMO_FD_WRITE)
rc = device->ipc_chan_sock_write(bfd);
return rc;
diff --git a/Transceiver52M/device/ipc/ipc-driver-test.c b/Transceiver52M/device/ipc/ipc-driver-test.c
index 44c8b0e..0cccbda 100644
--- a/Transceiver52M/device/ipc/ipc-driver-test.c
+++ b/Transceiver52M/device/ipc/ipc-driver-test.c
@@ -394,7 +394,7 @@ int ipc_sock_init(const char *path, struct ipc_sock_state **global_state_var,
return -1;
}
- bfd->when = BSC_FD_READ;
+ bfd->when = OSMO_FD_READ;
bfd->cb = sock_callback_fn;
bfd->data = state;
bfd->priv_nr = n;
diff --git a/Transceiver52M/device/ipc/ipc_chan.c b/Transceiver52M/device/ipc/ipc_chan.c
index 9e35fb2..af18aab 100644
--- a/Transceiver52M/device/ipc/ipc_chan.c
+++ b/Transceiver52M/device/ipc/ipc_chan.c
@@ -142,7 +142,7 @@ int ipc_chan_sock_send(struct msgb *msg, uint8_t chan_nr)
return -EIO;
}
msgb_enqueue(&state->upqueue, msg);
- conn_bfd->when |= BSC_FD_WRITE;
+ conn_bfd->when |= OSMO_FD_WRITE;
return 0;
}
@@ -160,7 +160,7 @@ static int ipc_chan_sock_write(struct osmo_fd *bfd)
msg = llist_entry(state->upqueue.next, struct msgb, list);
ipc_prim = (struct ipc_sk_chan_if *)msg->data;
- bfd->when &= ~BSC_FD_WRITE;
+ bfd->when &= ~OSMO_FD_WRITE;
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
if (!msgb_length(msg)) {
@@ -177,7 +177,7 @@ static int ipc_chan_sock_write(struct osmo_fd *bfd)
goto close;
if (rc < 0) {
if (errno == EAGAIN) {
- bfd->when |= BSC_FD_WRITE;
+ bfd->when |= OSMO_FD_WRITE;
break;
}
goto close;
@@ -200,12 +200,12 @@ static int ipc_chan_sock_cb(struct osmo_fd *bfd, unsigned int flags)
{
int rc = 0;
- if (flags & BSC_FD_READ)
+ if (flags & OSMO_FD_READ)
rc = ipc_chan_sock_read(bfd);
if (rc < 0)
return rc;
- if (flags & BSC_FD_WRITE)
+ if (flags & OSMO_FD_WRITE)
rc = ipc_chan_sock_write(bfd);
return rc;
@@ -231,13 +231,13 @@ int ipc_chan_sock_accept(struct osmo_fd *bfd, unsigned int flags)
"osmo-trx connects but we already have "
"another active connection ?!?\n");
/* We already have one IPC connected, this is all we support */
- state->listen_bfd.when &= ~BSC_FD_READ;
+ state->listen_bfd.when &= ~OSMO_FD_READ;
close(rc);
return 0;
}
conn_bfd->fd = rc;
- conn_bfd->when = BSC_FD_READ;
+ conn_bfd->when = OSMO_FD_READ;
conn_bfd->cb = ipc_chan_sock_cb;
conn_bfd->data = state;
diff --git a/Transceiver52M/device/ipc/ipc_sock.c b/Transceiver52M/device/ipc/ipc_sock.c
index 435dc3c..26865bf 100644
--- a/Transceiver52M/device/ipc/ipc_sock.c
+++ b/Transceiver52M/device/ipc/ipc_sock.c
@@ -84,7 +84,7 @@ int ipc_sock_send(struct msgb *msg)
return -EIO;
}
msgb_enqueue(&state->upqueue, msg);
- conn_bfd->when |= BSC_FD_WRITE;
+ conn_bfd->when |= OSMO_FD_WRITE;
return 0;
}
@@ -102,7 +102,7 @@ void ipc_sock_close(struct ipc_sock_state *state)
osmo_fd_unregister(bfd);
/* re-enable the generation of ACCEPT for new connections */
- state->listen_bfd.when |= BSC_FD_READ;
+ state->listen_bfd.when |= OSMO_FD_READ;
/* flush the queue */
while (!llist_empty(&state->upqueue)) {
@@ -172,7 +172,7 @@ static int ipc_sock_write(struct osmo_fd *bfd)
msg = llist_entry(state->upqueue.next, struct msgb, list);
ipc_prim = (struct ipc_sk_if *)msg->data;
- bfd->when &= ~BSC_FD_WRITE;
+ bfd->when &= ~OSMO_FD_WRITE;
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
if (!msgb_length(msg)) {
@@ -189,7 +189,7 @@ static int ipc_sock_write(struct osmo_fd *bfd)
goto close;
if (rc < 0) {
if (errno == EAGAIN) {
- bfd->when |= BSC_FD_WRITE;
+ bfd->when |= OSMO_FD_WRITE;
break;
}
goto close;
@@ -212,12 +212,12 @@ static int ipc_sock_cb(struct osmo_fd *bfd, unsigned int flags)
{
int rc = 0;
- if (flags & BSC_FD_READ)
+ if (flags & OSMO_FD_READ)
rc = ipc_sock_read(bfd);
if (rc < 0)
return rc;
- if (flags & BSC_FD_WRITE)
+ if (flags & OSMO_FD_WRITE)
rc = ipc_sock_write(bfd);
return rc;
@@ -244,13 +244,13 @@ int ipc_sock_accept(struct osmo_fd *bfd, unsigned int flags)
"ip clent connects but we already have "
"another active connection ?!?\n");
/* We already have one IPC connected, this is all we support */
- state->listen_bfd.when &= ~BSC_FD_READ;
+ state->listen_bfd.when &= ~OSMO_FD_READ;
close(rc);
return 0;
}
conn_bfd->fd = rc;
- conn_bfd->when = BSC_FD_READ;
+ conn_bfd->when = OSMO_FD_READ;
conn_bfd->cb = ipc_sock_cb;
conn_bfd->data = state;