summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/host/layer23/src/common/gps.c4
-rw-r--r--src/host/layer23/src/mobile/mncc_sock.c18
-rw-r--r--src/host/layer23/src/mobile/script_lua.c2
-rw-r--r--src/host/osmocon/osmocon.c36
-rw-r--r--src/host/trxcon/l1ctl_link.c4
-rw-r--r--src/host/virt_phy/src/l1ctl_sock.c6
-rw-r--r--src/host/virt_phy/src/shared/osmo_mcast_sock.c2
-rw-r--r--src/host/virt_phy/src/shared/virtual_um.c2
8 files changed, 37 insertions, 37 deletions
diff --git a/src/host/layer23/src/common/gps.c b/src/host/layer23/src/common/gps.c
index 807beed4..ef907d18 100644
--- a/src/host/layer23/src/common/gps.c
+++ b/src/host/layer23/src/common/gps.c
@@ -138,7 +138,7 @@ int osmo_gpsd_open(void)
LOGP(DGPS, LOGL_INFO, "Connecting to gpsd at '%s:%s'\n", g.gpsd_host, g.gpsd_port);
gps_bfd.data = NULL;
- gps_bfd.when = BSC_FD_READ;
+ gps_bfd.when = OSMO_FD_READ;
gps_bfd.cb = osmo_gpsd_cb;
#if GPSD_API_MAJOR_VERSION >= 5
@@ -327,7 +327,7 @@ int osmo_serialgps_open(void)
LOGP(DGPS, LOGL_INFO, "Open GPS device '%s'\n", g.device);
gps_bfd.data = NULL;
- gps_bfd.when = BSC_FD_READ;
+ gps_bfd.when = OSMO_FD_READ;
gps_bfd.cb = osmo_serialgps_cb;
gps_bfd.fd = open(g.device, O_RDONLY);
if (gps_bfd.fd < 0)
diff --git a/src/host/layer23/src/mobile/mncc_sock.c b/src/host/layer23/src/mobile/mncc_sock.c
index 48221905..db76ef64 100644
--- a/src/host/layer23/src/mobile/mncc_sock.c
+++ b/src/host/layer23/src/mobile/mncc_sock.c
@@ -72,13 +72,13 @@ int mncc_sock_from_cc(struct mncc_sock_state *state, struct msgb *msg)
/* Actually enqueue the message and mark socket write need */
msgb_enqueue(&state->upqueue, msg);
- state->conn_bfd.when |= BSC_FD_WRITE;
+ state->conn_bfd.when |= OSMO_FD_WRITE;
return 0;
}
void mncc_sock_write_pending(struct mncc_sock_state *state)
{
- state->conn_bfd.when |= BSC_FD_WRITE;
+ state->conn_bfd.when |= OSMO_FD_WRITE;
}
static void mncc_sock_close(struct mncc_sock_state *state)
@@ -92,7 +92,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;
/* FIXME: make sure we don't enqueue anymore */
@@ -156,7 +156,7 @@ static int mncc_sock_write(struct osmo_fd *bfd)
msg = llist_entry(state->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)) {
@@ -171,7 +171,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;
@@ -195,12 +195,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;
@@ -226,13 +226,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;
diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index c8868b54..269c9dff 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -512,7 +512,7 @@ static int lua_register_fd(lua_State *L)
/* Set the filedescriptor */
fdu->fd.fd = (int) lua_tonumber(L, -3);
fdu->fd.cb = lua_fd_cb;
- fdu->fd.when = BSC_FD_READ;
+ fdu->fd.when = OSMO_FD_READ;
fdu->fd.data = fdu;
/* Assuming that an error here will lead to a GC */
diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index f4d91113..a755102f 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -500,7 +500,7 @@ static int romload_prepare_block(void)
dnload.block_ptr = dnload.block;
dnload.block_number++;
- dnload.serial_fd.when = BSC_FD_READ | BSC_FD_WRITE;
+ dnload.serial_fd.when = OSMO_FD_READ | OSMO_FD_WRITE;
return 0;
}
@@ -586,7 +586,7 @@ static int handle_write_block(void)
printf("Progress: %i%%\r", progress);
fflush(stdout);
dnload.write_ptr = dnload.data;
- dnload.serial_fd.when &= ~BSC_FD_WRITE;
+ dnload.serial_fd.when &= ~OSMO_FD_WRITE;
if (dnload.romload_state == SENDING_LAST_BLOCK) {
dnload.romload_state = LAST_BLOCK_SENT;
printf("Finished, sent %i blocks in total\n",
@@ -638,7 +638,7 @@ static int handle_write_dnload(void)
} else if (dnload.write_ptr >= dnload.data + dnload.data_len) {
printf("finished\n");
dnload.write_ptr = dnload.data;
- dnload.serial_fd.when &= ~BSC_FD_WRITE;
+ dnload.serial_fd.when &= ~OSMO_FD_WRITE;
return 1;
}
@@ -682,7 +682,7 @@ static int handle_sercomm_write(void)
}
if (end)
- dnload.serial_fd.when &= ~BSC_FD_WRITE;
+ dnload.serial_fd.when &= ~OSMO_FD_WRITE;
return 0;
}
@@ -751,7 +751,7 @@ static void hdlc_send_to_phone(uint8_t dlci, uint8_t *data, int len)
sercomm_sendmsg(dlci, msg);
- dnload.serial_fd.when |= BSC_FD_WRITE;
+ dnload.serial_fd.when |= OSMO_FD_WRITE;
}
static void hdlc_console_cb(uint8_t dlci, struct msgb *msg)
@@ -842,12 +842,12 @@ static int handle_read(void)
}
} else if (!memcmp(buffer, phone_prompt2, sizeof(phone_prompt2))) {
printf("Received PROMPT2 from phone, starting download\n");
- dnload.serial_fd.when = BSC_FD_READ | BSC_FD_WRITE;
+ dnload.serial_fd.when = OSMO_FD_READ | OSMO_FD_WRITE;
dnload.state = DOWNLOADING;
} else if (!memcmp(buffer, phone_ack, sizeof(phone_ack))) {
printf("Received DOWNLOAD ACK from phone, your code is"
" running now!\n");
- dnload.serial_fd.when = BSC_FD_READ;
+ dnload.serial_fd.when = OSMO_FD_READ;
dnload.state = WAITING_PROMPT1;
dnload.write_ptr = dnload.data;
dnload.expect_hdlc = 1;
@@ -868,18 +868,18 @@ static int handle_read(void)
} else if (!memcmp(buffer, phone_nack, sizeof(phone_nack))) {
printf("Received DOWNLOAD NACK from phone, something went"
" wrong :(\n");
- dnload.serial_fd.when = BSC_FD_READ;
+ dnload.serial_fd.when = OSMO_FD_READ;
dnload.state = WAITING_PROMPT1;
dnload.write_ptr = dnload.data;
} else if (!memcmp(buffer, phone_nack_magic, sizeof(phone_nack_magic))) {
printf("Received MAGIC NACK from phone, you need to"
" have \"1003\" at 0x803ce0\n");
- dnload.serial_fd.when = BSC_FD_READ;
+ dnload.serial_fd.when = OSMO_FD_READ;
dnload.state = WAITING_PROMPT1;
dnload.write_ptr = dnload.data;
} else if (!memcmp(buffer, ftmtool, sizeof(ftmtool))) {
printf("Received FTMTOOL from phone, ramloader has aborted\n");
- dnload.serial_fd.when = BSC_FD_READ;
+ dnload.serial_fd.when = OSMO_FD_READ;
dnload.state = WAITING_PROMPT1;
dnload.write_ptr = dnload.data;
}
@@ -1000,7 +1000,7 @@ static int handle_read_romload(void)
if (!memcmp(buffer, romload_branch_ack,
sizeof(romload_branch_ack))) {
printf("Received branch ack, your code is running now!\n");
- dnload.serial_fd.when = BSC_FD_READ;
+ dnload.serial_fd.when = OSMO_FD_READ;
dnload.romload_state = FINISHED;
dnload.write_ptr = dnload.data;
dnload.expect_hdlc = 1;
@@ -1116,7 +1116,7 @@ static int handle_read_mtk(void)
printf("Received size ack\n");
dnload.expect_hdlc = 1;
dnload.mtk_state = MTK_SENDING_BLOCKS;
- dnload.serial_fd.when = BSC_FD_READ | BSC_FD_WRITE;
+ dnload.serial_fd.when = OSMO_FD_READ | OSMO_FD_WRITE;
bufptr -= 3;
break;
case MTK_SENDING_BLOCKS:
@@ -1138,7 +1138,7 @@ static int handle_read_mtk(void)
printf("Received Block %i preparing next block\n",
dnload.block_number);
mtk_prepare_block();
- dnload.serial_fd.when = BSC_FD_READ | BSC_FD_WRITE;
+ dnload.serial_fd.when = OSMO_FD_READ | OSMO_FD_WRITE;
}
break;
case MTK_WAIT_BRANCH_CMD_ACK:
@@ -1156,7 +1156,7 @@ static int handle_read_mtk(void)
break;
printf("Received branch address ack, code should run now\n");
osmo_serial_set_baudrate(dnload.serial_fd.fd, MODEM_BAUDRATE);
- dnload.serial_fd.when = BSC_FD_READ;
+ dnload.serial_fd.when = OSMO_FD_READ;
dnload.mtk_state = MTK_FINISHED;
dnload.write_ptr = dnload.data;
dnload.expect_hdlc = 1;
@@ -1172,7 +1172,7 @@ static int handle_read_mtk(void)
static int serial_read(struct osmo_fd *fd, unsigned int flags)
{
int rc;
- if (flags & BSC_FD_READ) {
+ if (flags & OSMO_FD_READ) {
switch (dnload.mode) {
case MODE_ROMLOAD:
while ((rc = handle_read_romload()) > 0);
@@ -1188,7 +1188,7 @@ static int serial_read(struct osmo_fd *fd, unsigned int flags)
exit(2);
}
- if (flags & BSC_FD_WRITE) {
+ if (flags & OSMO_FD_WRITE) {
rc = handle_write();
if (rc == 1)
dnload.state = WAITING_PROMPT1;
@@ -1323,7 +1323,7 @@ static int tool_accept(struct osmo_fd *fd, unsigned int flags)
con->server = srv;
con->fd.fd = rc;
- con->fd.when = BSC_FD_READ;
+ con->fd.when = OSMO_FD_READ;
con->fd.cb = un_tool_read;
con->fd.data = con;
if (osmo_fd_register(&con->fd) != 0) {
@@ -1458,7 +1458,7 @@ int main(int argc, char **argv)
flags |= O_NONBLOCK;
fcntl(dnload.serial_fd.fd, F_SETFL, flags);
- dnload.serial_fd.when = BSC_FD_READ;
+ dnload.serial_fd.when = OSMO_FD_READ;
dnload.serial_fd.cb = serial_read;
/* initialize the HDLC layer */
diff --git a/src/host/trxcon/l1ctl_link.c b/src/host/trxcon/l1ctl_link.c
index b7ea262a..511ae0ca 100644
--- a/src/host/trxcon/l1ctl_link.c
+++ b/src/host/trxcon/l1ctl_link.c
@@ -165,7 +165,7 @@ static int l1ctl_link_accept(struct osmo_fd *bfd, unsigned int flags)
l1l->wq.write_cb = l1ctl_link_write_cb;
l1l->wq.read_cb = l1ctl_link_read_cb;
- conn_bfd->when = BSC_FD_READ;
+ conn_bfd->when = OSMO_FD_READ;
conn_bfd->data = l1l;
conn_bfd->fd = cfd;
@@ -270,7 +270,7 @@ struct l1ctl_link *l1ctl_link_init(void *tall_ctx, const char *sock_path)
/* Bind connection handler */
bfd->cb = l1ctl_link_accept;
- bfd->when = BSC_FD_READ;
+ bfd->when = OSMO_FD_READ;
bfd->data = l1l;
/**
diff --git a/src/host/virt_phy/src/l1ctl_sock.c b/src/host/virt_phy/src/l1ctl_sock.c
index bf28895f..d247bef0 100644
--- a/src/host/virt_phy/src/l1ctl_sock.c
+++ b/src/host/virt_phy/src/l1ctl_sock.c
@@ -72,7 +72,7 @@ static int l1ctl_sock_data_cb(struct osmo_fd *ofd, unsigned int what)
int rc;
/* Check if request is really read request */
- if (!(what & BSC_FD_READ))
+ if (!(what & OSMO_FD_READ))
return 0;
msg = msgb_alloc(L1CTL_SOCK_MSGB_SIZE, "L1CTL sock rx");
@@ -126,7 +126,7 @@ static int l1ctl_sock_accept_cb(struct osmo_fd *ofd, unsigned int what)
lsc->l1ctl_sock = lsi;
lsc->ofd.fd = fd;
- lsc->ofd.when = BSC_FD_READ;
+ lsc->ofd.when = OSMO_FD_READ;
lsc->ofd.cb = l1ctl_sock_data_cb;
lsc->ofd.data = lsc;
if (lsi->accept_cb) {
@@ -164,7 +164,7 @@ struct l1ctl_sock_inst *l1ctl_sock_init(
lsi = talloc_zero(ctx, struct l1ctl_sock_inst);
lsi->priv = NULL;
lsi->ofd.data = lsi;
- lsi->ofd.when = BSC_FD_READ;
+ lsi->ofd.when = OSMO_FD_READ;
lsi->ofd.cb = l1ctl_sock_accept_cb;
rc = osmo_sock_unix_init_ofd(&lsi->ofd, SOCK_STREAM, 0, path, OSMO_SOCK_F_BIND);
diff --git a/src/host/virt_phy/src/shared/osmo_mcast_sock.c b/src/host/virt_phy/src/shared/osmo_mcast_sock.c
index 9a713fcf..b111a654 100644
--- a/src/host/virt_phy/src/shared/osmo_mcast_sock.c
+++ b/src/host/virt_phy/src/shared/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/host/virt_phy/src/shared/virtual_um.c b/src/host/virt_phy/src/shared/virtual_um.c
index 14a444cf..ef3ad379 100644
--- a/src/host/virt_phy/src/shared/virtual_um.c
+++ b/src/host/virt_phy/src/shared/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;