ipc: Use OSMO_FD_* instead of deprecated BSC_FD_*

Change-Id: I98b3f9525954d6882f7488d650038a8e28f7b769
This commit is contained in:
Harald Welte 2020-10-18 22:41:40 +02:00
parent e91544d740
commit 08970c562f
4 changed files with 25 additions and 25 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;