Use OSMO_FD_* instead of deprecated BSC_FD_*
New define is available since libosmocore 1.1.0, and we already require 1.3.0, so no need to update dependenices. Let's change it to avoid people re-using old BSC_FD_* symbols when copy-pasting somewhere else. Change-Id: Ifc89fffac0443d94f3e49555684975b293ef90fb
This commit is contained in:
parent
3c8fc13b39
commit
c95c0b6dd6
|
@ -65,7 +65,7 @@ int mncc_sock_from_cc(struct gsm_network *net, struct msgb *msg)
|
|||
|
||||
/* Actually enqueue the message and mark socket write need */
|
||||
msgb_enqueue(&net->upqueue, msg);
|
||||
net->mncc_state->conn_bfd.when |= BSC_FD_WRITE;
|
||||
net->mncc_state->conn_bfd.when |= OSMO_FD_WRITE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ static void mncc_sock_close(struct mncc_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;
|
||||
|
||||
/* release all existing calls */
|
||||
gsm0408_clear_all_trans(state->net, TRANS_CC);
|
||||
|
@ -146,7 +146,7 @@ static int mncc_sock_write(struct osmo_fd *bfd)
|
|||
msg = llist_entry(net->upqueue.next, struct msgb, list);
|
||||
mncc_prim = (struct gsm_mncc *)msg->data;
|
||||
|
||||
bfd->when &= ~BSC_FD_WRITE;
|
||||
bfd->when &= ~OSMO_FD_WRITE;
|
||||
|
||||
/* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
|
||||
if (!msgb_length(msg)) {
|
||||
|
@ -161,7 +161,7 @@ static int mncc_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;
|
||||
|
@ -185,12 +185,12 @@ static int mncc_sock_cb(struct osmo_fd *bfd, unsigned int flags)
|
|||
{
|
||||
int rc = 0;
|
||||
|
||||
if (flags & BSC_FD_READ)
|
||||
if (flags & OSMO_FD_READ)
|
||||
rc = mncc_sock_read(bfd);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
if (flags & BSC_FD_WRITE)
|
||||
if (flags & OSMO_FD_WRITE)
|
||||
rc = mncc_sock_write(bfd);
|
||||
|
||||
return rc;
|
||||
|
@ -222,7 +222,7 @@ static void queue_hello(struct mncc_sock_state *mncc)
|
|||
hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type);
|
||||
|
||||
msgb_enqueue(&mncc->net->upqueue, msg);
|
||||
mncc->conn_bfd.when |= BSC_FD_WRITE;
|
||||
mncc->conn_bfd.when |= OSMO_FD_WRITE;
|
||||
}
|
||||
|
||||
/* accept a new connection */
|
||||
|
@ -245,13 +245,13 @@ static int mncc_sock_accept(struct osmo_fd *bfd, unsigned int flags)
|
|||
LOGP(DMNCC, LOGL_NOTICE, "MNCC app connects but we already have "
|
||||
"another active connection ?!?\n");
|
||||
/* We already have one MNCC app 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 = mncc_sock_cb;
|
||||
conn_bfd->data = state;
|
||||
|
||||
|
@ -294,7 +294,7 @@ int mncc_sock_init(struct gsm_network *net, const char *sock_path)
|
|||
return -1;
|
||||
}
|
||||
|
||||
bfd->when = BSC_FD_READ;
|
||||
bfd->when = OSMO_FD_READ;
|
||||
bfd->cb = mncc_sock_accept;
|
||||
bfd->data = state;
|
||||
|
||||
|
|
|
@ -931,7 +931,7 @@ static int link_accept_cb(struct smsc *smsc, int fd,
|
|||
osmo_wqueue_init(&esme->wqueue, 10);
|
||||
esme->wqueue.bfd.fd = fd;
|
||||
esme->wqueue.bfd.data = esme;
|
||||
esme->wqueue.bfd.when = BSC_FD_READ;
|
||||
esme->wqueue.bfd.when = OSMO_FD_READ;
|
||||
|
||||
if (osmo_fd_register(&esme->wqueue.bfd) != 0) {
|
||||
close(fd);
|
||||
|
|
Loading…
Reference in New Issue