diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-05-09 18:58:33 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-05-09 18:59:47 +0200 |
commit | 63920cefa6465e53b732217194e387b817b61458 (patch) | |
tree | 0880ada9c9fab71d6be43280e46e909abd3defa7 | |
parent | ee320d5b36378bcfebde055323a4d9ec46c354cb (diff) |
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_READ symbol when
copy-pasting somewhere else.
Change-Id: Id51ccb2c273c5f0fa4986f28bbd69a72d2dbaa0e
-rw-r--r-- | src/common/pcu_sock.c | 18 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/l1_transp_hw.c | 18 | ||||
-rw-r--r-- | src/osmo-bts-litecell15/oml_router.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-oc2g/l1_transp_hw.c | 18 | ||||
-rw-r--r-- | src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c | 4 | ||||
-rw-r--r-- | src/osmo-bts-oc2g/oml_router.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-octphy/l1_if.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_fwd_main.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_transp_fwd.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_transp_hw.c | 18 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c | 4 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/oml_router.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-trx/scheduler_trx.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-virtual/osmo_mcast_sock.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-virtual/virtual_um.c | 2 |
15 files changed, 49 insertions, 49 deletions
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 579f8cc4..7ced69cc 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -742,7 +742,7 @@ static int pcu_sock_send(struct gsm_network *net, struct msgb *msg) return -EIO; } msgb_enqueue(&state->upqueue, msg); - conn_bfd->when |= BSC_FD_WRITE; + conn_bfd->when |= OSMO_FD_WRITE; return 0; } @@ -772,7 +772,7 @@ static void pcu_sock_close(struct pcu_sock_state *state) regenerate_si3_restoctets(bts); /* re-enable the generation of ACCEPT for new connections */ - state->listen_bfd.when |= BSC_FD_READ; + state->listen_bfd.when |= OSMO_FD_READ; #if 0 /* remove si13, ... */ @@ -862,7 +862,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 &= ~BSC_FD_WRITE; + bfd->when &= ~OSMO_FD_WRITE; /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ if (!msgb_length(msg)) { @@ -877,7 +877,7 @@ static int pcu_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; @@ -901,12 +901,12 @@ static int pcu_sock_cb(struct osmo_fd *bfd, unsigned int flags) { int rc = 0; - if (flags & BSC_FD_READ) + if (flags & OSMO_FD_READ) rc = pcu_sock_read(bfd); if (rc < 0) return rc; - if (flags & BSC_FD_WRITE) + if (flags & OSMO_FD_WRITE) rc = pcu_sock_write(bfd); return rc; @@ -932,13 +932,13 @@ 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 &= ~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 = pcu_sock_cb; conn_bfd->data = state; @@ -983,7 +983,7 @@ int pcu_sock_init(const char *path) return -1; } - bfd->when = BSC_FD_READ; + bfd->when = OSMO_FD_READ; bfd->cb = pcu_sock_accept; bfd->data = state; diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index c8972be5..c353f43f 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -88,18 +88,18 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what) queue = container_of(fd, struct osmo_wqueue, bfd); - if (what & BSC_FD_READ) + if (what & OSMO_FD_READ) queue->read_cb(fd); - if (what & BSC_FD_EXCEPT) + if (what & OSMO_FD_EXCEPT) queue->except_cb(fd); - if (what & BSC_FD_WRITE) { + if (what & OSMO_FD_WRITE) { struct iovec iov[5]; struct msgb *msg, *tmp; int written, count = 0; - fd->when &= ~BSC_FD_WRITE; + fd->when &= ~OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; } return 0; @@ -269,7 +269,7 @@ int l1if_transport_open(int q, struct lc15l1_hdl *hdl) read_ofd->priv_nr = q; read_ofd->data = hdl; read_ofd->cb = l1if_fd_cb; - read_ofd->when = BSC_FD_READ; + read_ofd->when = OSMO_FD_READ; rc = osmo_fd_register(read_ofd); if (rc < 0) { close(read_ofd->fd); @@ -292,7 +292,7 @@ int l1if_transport_open(int q, struct lc15l1_hdl *hdl) write_ofd->fd = rc; write_ofd->priv_nr = q; write_ofd->data = hdl; - write_ofd->when = BSC_FD_WRITE; + write_ofd->when = OSMO_FD_WRITE; rc = osmo_fd_register(write_ofd); if (rc < 0) { close(write_ofd->fd); diff --git a/src/osmo-bts-litecell15/oml_router.c b/src/osmo-bts-litecell15/oml_router.c index 198d5e30..e20ce5b5 100644 --- a/src/osmo-bts-litecell15/oml_router.c +++ b/src/osmo-bts-litecell15/oml_router.c @@ -122,7 +122,7 @@ int oml_router_init(struct gsm_bts *bts, const char *path, read_fd->cb = oml_router_read_cb; read_fd->data = bts; - read_fd->when = BSC_FD_READ; + read_fd->when = OSMO_FD_READ; read_fd->fd = -1; rc = osmo_sock_unix_init_ofd(accept_fd, SOCK_SEQPACKET, 0, diff --git a/src/osmo-bts-oc2g/l1_transp_hw.c b/src/osmo-bts-oc2g/l1_transp_hw.c index e1d46581..f9d4510f 100644 --- a/src/osmo-bts-oc2g/l1_transp_hw.c +++ b/src/osmo-bts-oc2g/l1_transp_hw.c @@ -88,18 +88,18 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what) queue = container_of(fd, struct osmo_wqueue, bfd); - if (what & BSC_FD_READ) + if (what & OSMO_FD_READ) queue->read_cb(fd); - if (what & BSC_FD_EXCEPT) + if (what & OSMO_FD_EXCEPT) queue->except_cb(fd); - if (what & BSC_FD_WRITE) { + if (what & OSMO_FD_WRITE) { struct iovec iov[5]; struct msgb *msg, *tmp; int written, count = 0; - fd->when &= ~BSC_FD_WRITE; + fd->when &= ~OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; } return 0; @@ -269,7 +269,7 @@ int l1if_transport_open(int q, struct oc2gl1_hdl *hdl) read_ofd->priv_nr = q; read_ofd->data = hdl; read_ofd->cb = l1if_fd_cb; - read_ofd->when = BSC_FD_READ; + read_ofd->when = OSMO_FD_READ; rc = osmo_fd_register(read_ofd); if (rc < 0) { close(read_ofd->fd); @@ -292,7 +292,7 @@ int l1if_transport_open(int q, struct oc2gl1_hdl *hdl) write_ofd->fd = rc; write_ofd->priv_nr = q; write_ofd->data = hdl; - write_ofd->when = BSC_FD_WRITE; + write_ofd->when = OSMO_FD_WRITE; rc = osmo_fd_register(write_ofd); if (rc < 0) { close(write_ofd->fd); diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c index 3ddf0e8c..bb2984ed 100644 --- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c +++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c @@ -222,7 +222,7 @@ static void mgr_gps_open(struct oc2gbts_mgr_instance *mgr) mgr->gps.gpsfd.data = mgr; mgr->gps.gpsfd.cb = mgr_gps_read; - mgr->gps.gpsfd.when = BSC_FD_READ | BSC_FD_EXCEPT; + mgr->gps.gpsfd.when = OSMO_FD_READ | OSMO_FD_EXCEPT; mgr->gps.gpsfd.fd = mgr->gps.gpsdata.gps_fd; if (osmo_fd_register(&mgr->gps.gpsfd) < 0) { LOGP(DCALIB, LOGL_ERROR, "Failed to register GPSD fd\n"); @@ -607,7 +607,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 |= BSC_FD_WRITE; + mgr->oc2gbts_ctrl.bts_conn->ofd->when |= OSMO_FD_WRITE; 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-oc2g/oml_router.c b/src/osmo-bts-oc2g/oml_router.c index 198d5e30..e20ce5b5 100644 --- a/src/osmo-bts-oc2g/oml_router.c +++ b/src/osmo-bts-oc2g/oml_router.c @@ -122,7 +122,7 @@ int oml_router_init(struct gsm_bts *bts, const char *path, read_fd->cb = oml_router_read_cb; read_fd->data = bts; - read_fd->when = BSC_FD_READ; + read_fd->when = OSMO_FD_READ; read_fd->fd = -1; rc = osmo_sock_unix_init_ofd(accept_fd, SOCK_SEQPACKET, 0, diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index bdf85ca7..fb62f8b7 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -1826,7 +1826,7 @@ struct octphy_hdl *l1if_open(struct phy_link *plink) fl1h->phy_wq.write_cb = octphy_write_cb; fl1h->phy_wq.read_cb = octphy_read_cb; fl1h->phy_wq.bfd.fd = sfd; - fl1h->phy_wq.bfd.when = BSC_FD_READ; + fl1h->phy_wq.bfd.when = OSMO_FD_READ; fl1h->phy_wq.bfd.cb = osmo_wqueue_bfd_cb; fl1h->phy_wq.bfd.data = fl1h; rc = osmo_fd_register(&fl1h->phy_wq.bfd); diff --git a/src/osmo-bts-sysmo/l1_fwd_main.c b/src/osmo-bts-sysmo/l1_fwd_main.c index bc9fc21c..8e8bd83f 100644 --- a/src/osmo-bts-sysmo/l1_fwd_main.c +++ b/src/osmo-bts-sysmo/l1_fwd_main.c @@ -213,7 +213,7 @@ int main(int argc, char **argv) wq->write_cb = udp_write_cb; wq->read_cb = udp_read_cb; - wq->bfd.when |= BSC_FD_READ; + wq->bfd.when |= OSMO_FD_READ; wq->bfd.data = l1fh; wq->bfd.priv_nr = i; rc = osmo_sock_init_ofd(&wq->bfd, AF_UNSPEC, SOCK_DGRAM, diff --git a/src/osmo-bts-sysmo/l1_transp_fwd.c b/src/osmo-bts-sysmo/l1_transp_fwd.c index 87c230bb..97200ce9 100644 --- a/src/osmo-bts-sysmo/l1_transp_fwd.c +++ b/src/osmo-bts-sysmo/l1_transp_fwd.c @@ -128,7 +128,7 @@ int l1if_transport_open(int q, struct femtol1_hdl *fl1h) ofd->data = fl1h; ofd->priv_nr = q; - ofd->when |= BSC_FD_READ; + ofd->when |= OSMO_FD_READ; rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, bts_host, fwd_udp_ports[q], diff --git a/src/osmo-bts-sysmo/l1_transp_hw.c b/src/osmo-bts-sysmo/l1_transp_hw.c index 01bc2005..45f4a071 100644 --- a/src/osmo-bts-sysmo/l1_transp_hw.c +++ b/src/osmo-bts-sysmo/l1_transp_hw.c @@ -95,18 +95,18 @@ static int wqueue_vector_cb(struct osmo_fd *fd, unsigned int what) queue = container_of(fd, struct osmo_wqueue, bfd); - if (what & BSC_FD_READ) + if (what & OSMO_FD_READ) queue->read_cb(fd); - if (what & BSC_FD_EXCEPT) + if (what & OSMO_FD_EXCEPT) queue->except_cb(fd); - if (what & BSC_FD_WRITE) { + if (what & OSMO_FD_WRITE) { struct iovec iov[5]; struct msgb *msg, *tmp; int written, count = 0; - fd->when &= ~BSC_FD_WRITE; + fd->when &= ~OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; 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 |= BSC_FD_WRITE; + fd->when |= OSMO_FD_WRITE; } return 0; @@ -275,7 +275,7 @@ int l1if_transport_open(int q, struct femtol1_hdl *hdl) read_ofd->priv_nr = q; read_ofd->data = hdl; read_ofd->cb = l1if_fd_cb; - read_ofd->when = BSC_FD_READ; + read_ofd->when = OSMO_FD_READ; rc = osmo_fd_register(read_ofd); if (rc < 0) { close(read_ofd->fd); @@ -295,7 +295,7 @@ int l1if_transport_open(int q, struct femtol1_hdl *hdl) write_ofd->fd = rc; write_ofd->priv_nr = q; write_ofd->data = hdl; - write_ofd->when = BSC_FD_WRITE; + write_ofd->when = OSMO_FD_WRITE; rc = osmo_fd_register(write_ofd); if (rc < 0) { close(write_ofd->fd); diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c index d769ce7d..2fbdfa6c 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c @@ -169,7 +169,7 @@ static void mgr_gps_open(struct sysmobts_mgr_instance *mgr) #endif mgr->calib.gpsfd.data = mgr; mgr->calib.gpsfd.cb = mgr_gps_read; - mgr->calib.gpsfd.when = BSC_FD_READ | BSC_FD_EXCEPT; + mgr->calib.gpsfd.when = OSMO_FD_READ | OSMO_FD_EXCEPT; mgr->calib.gpsfd.fd = mgr->calib.gpsdata->gps_fd; if (osmo_fd_register(&mgr->calib.gpsfd) < 0) { LOGP(DCALIB, LOGL_ERROR, "Failed to register GPSD fd\n"); @@ -459,7 +459,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 |= BSC_FD_WRITE; + mgr->calib.bts_conn->ofd->when |= OSMO_FD_WRITE; rc = ipa_client_conn_open(mgr->calib.bts_conn); if (rc < 0) { LOGP(DLCTRL, LOGL_NOTICE, "Failed to connect to BTS.\n"); diff --git a/src/osmo-bts-sysmo/oml_router.c b/src/osmo-bts-sysmo/oml_router.c index f3d08373..faaf1b57 100644 --- a/src/osmo-bts-sysmo/oml_router.c +++ b/src/osmo-bts-sysmo/oml_router.c @@ -119,7 +119,7 @@ int oml_router_init(struct gsm_bts *bts, const char *path, read_fd->cb = oml_router_read_cb; read_fd->data = bts; - read_fd->when = BSC_FD_READ; + read_fd->when = OSMO_FD_READ; read_fd->fd = -1; rc = osmo_sock_unix_init_ofd(accept_fd, SOCK_SEQPACKET, 0, diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 8c3dd64f..e5c55192 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1719,7 +1719,7 @@ static int trx_fn_timer_cb(struct osmo_fd *ofd, unsigned int what) int64_t elapsed_us, error_us; int rc, i; - if (!(what & BSC_FD_READ)) + if (!(what & OSMO_FD_READ)) return 0; /* read from timerfd: number of expirations of periodic timer */ diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.c b/src/osmo-bts-virtual/osmo_mcast_sock.c index c0f0af58..91203b7b 100644 --- a/src/osmo-bts-virtual/osmo_mcast_sock.c +++ b/src/osmo-bts-virtual/osmo_mcast_sock.c @@ -44,7 +44,7 @@ int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16 unsigned int flags = OSMO_SOCK_F_BIND | OSMO_SOCK_F_NO_MCAST_ALL | OSMO_SOCK_F_UDP_REUSEADDR; ofd->cb = fd_rx_cb; - ofd->when = BSC_FD_READ; + ofd->when = OSMO_FD_READ; ofd->data = osmo_fd_data; /* Create mcast client socket */ diff --git a/src/osmo-bts-virtual/virtual_um.c b/src/osmo-bts-virtual/virtual_um.c index 280ba79f..de32e49d 100644 --- a/src/osmo-bts-virtual/virtual_um.c +++ b/src/osmo-bts-virtual/virtual_um.c @@ -39,7 +39,7 @@ static int virt_um_fd_cb(struct osmo_fd *ofd, unsigned int what) { struct virt_um_inst *vui = ofd->data; - if (what & BSC_FD_READ) { + if (what & OSMO_FD_READ) { struct msgb *msg = msgb_alloc(VIRT_UM_MSGB_SIZE, "Virtual UM Rx"); int rc; |