diff --git a/drivers/net/rpmsgdrv.c b/drivers/net/rpmsgdrv.c index 7f03b9b477..2873b50f73 100644 --- a/drivers/net/rpmsgdrv.c +++ b/drivers/net/rpmsgdrv.c @@ -160,7 +160,7 @@ static const rpmsg_ept_cb g_net_rpmsg_drv_handler[] = static void net_rpmsg_drv_wait(FAR sem_t *sem) { - net_lockedwait_uninterruptible(sem); + net_sem_wait_uninterruptible(sem); } /**************************************************************************** diff --git a/drivers/usrsock/usrsock_dev.c b/drivers/usrsock/usrsock_dev.c index d2cb9adc9b..0d45b2ff52 100644 --- a/drivers/usrsock/usrsock_dev.c +++ b/drivers/usrsock/usrsock_dev.c @@ -510,7 +510,7 @@ int usrsock_request(FAR struct iovec *iov, unsigned int iovcnt) /* Set outstanding request for daemon to handle. */ - net_lockedwait_uninterruptible(&dev->devlock); + net_sem_wait_uninterruptible(&dev->devlock); if (usrsockdev_is_opened(dev)) { diff --git a/drivers/usrsock/usrsock_rpmsg.c b/drivers/usrsock/usrsock_rpmsg.c index dc5f3da53e..74924bd04f 100644 --- a/drivers/usrsock/usrsock_rpmsg.c +++ b/drivers/usrsock/usrsock_rpmsg.c @@ -199,7 +199,7 @@ int usrsock_request(FAR struct iovec *iov, unsigned int iovcnt) nxsem_get_value(&priv->wait, &ret); if (ret <= 0) { - net_lockedwait_uninterruptible(&priv->wait); + net_sem_wait_uninterruptible(&priv->wait); nxsem_post(&priv->wait); } diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index 5e5cec7b0f..411997c672 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -308,7 +308,7 @@ ssize_t net_ioctl_arglen(int cmd); * * net_lock() - Locks the network via a re-entrant mutex. * net_unlock() - Unlocks the network. - * net_lockedwait() - Like pthread_cond_wait() except releases the + * net_sem_wait() - Like pthread_cond_wait() except releases the * network momentarily to wait on another semaphore. * net_ioballoc() - Like iob_alloc() except releases the network * momentarily to wait for an IOB to become @@ -369,7 +369,7 @@ int net_trylock(void); void net_unlock(void); /**************************************************************************** - * Name: net_timedwait + * Name: net_sem_timedwait * * Description: * Atomically wait for sem (or a timeout( while temporarily releasing @@ -390,10 +390,10 @@ void net_unlock(void); * ****************************************************************************/ -int net_timedwait(sem_t *sem, unsigned int timeout); +int net_sem_timedwait(sem_t *sem, unsigned int timeout); /**************************************************************************** - * Name: net_lockedwait + * Name: net_sem_wait * * Description: * Atomically wait for sem while temporarily releasing the network lock. @@ -412,13 +412,13 @@ int net_timedwait(sem_t *sem, unsigned int timeout); * ****************************************************************************/ -int net_lockedwait(sem_t *sem); +int net_sem_wait(sem_t *sem); /**************************************************************************** - * Name: net_timedwait_uninterruptible + * Name: net_sem_timedwait_uninterruptible * * Description: - * This function is wrapped version of net_timedwait(), which is + * This function is wrapped version of net_sem_timedwait(), which is * uninterruptible and convenient for use. * * Input Parameters: @@ -431,13 +431,13 @@ int net_lockedwait(sem_t *sem); * ****************************************************************************/ -int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout); +int net_sem_timedwait_uninterruptible(sem_t *sem, unsigned int timeout); /**************************************************************************** - * Name: net_lockedwait_uninterruptible + * Name: net_sem_wait_uninterruptible * * Description: - * This function is wrapped version of net_lockedwait(), which is + * This function is wrapped version of net_sem_wait(), which is * uninterruptible and convenient for use. * * Input Parameters: @@ -449,7 +449,7 @@ int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout); * ****************************************************************************/ -int net_lockedwait_uninterruptible(sem_t *sem); +int net_sem_wait_uninterruptible(sem_t *sem); #ifdef CONFIG_MM_IOB diff --git a/net/arp/arp_notify.c b/net/arp/arp_notify.c index b0edc4079d..73cc52fa7f 100644 --- a/net/arp/arp_notify.c +++ b/net/arp/arp_notify.c @@ -153,7 +153,7 @@ int arp_wait(FAR struct arp_notify_s *notify, unsigned int timeout) /* And wait for the ARP response (or a timeout). */ - net_timedwait_uninterruptible(¬ify->nt_sem, timeout); + net_sem_timedwait_uninterruptible(¬ify->nt_sem, timeout); /* Then get the real result of the transfer */ diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index ac0b45c748..bf24bd5918 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -325,12 +325,12 @@ int arp_send(in_addr_t ipaddr) netdev_txnotify_dev(dev); /* Wait for the send to complete or an error to occur. - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ do { - ret = net_timedwait_uninterruptible(&state.snd_sem, + ret = net_sem_timedwait_uninterruptible(&state.snd_sem, CONFIG_ARP_SEND_DELAYMSEC); if (ret == -ETIMEDOUT) { diff --git a/net/bluetooth/bluetooth_recvmsg.c b/net/bluetooth/bluetooth_recvmsg.c index 350c5e670d..badc7c89af 100644 --- a/net/bluetooth/bluetooth_recvmsg.c +++ b/net/bluetooth/bluetooth_recvmsg.c @@ -377,12 +377,12 @@ ssize_t bluetooth_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, state.ir_cb->event = bluetooth_recvfrom_eventhandler; /* Wait for either the receive to complete or for an error/timeout to - * occur. NOTES: (1) net_lockedwait will also terminate if a signal + * occur. NOTES: (1) net_sem_wait will also terminate if a signal * is received, (2) the network is locked! It will be un-locked while * the task sleeps and automatically re-locked when the task restarts. */ - net_lockedwait(&state.ir_sem); + net_sem_wait(&state.ir_sem); /* Make sure that no further events are processed */ diff --git a/net/bluetooth/bluetooth_sendmsg.c b/net/bluetooth/bluetooth_sendmsg.c index 2d69bf060f..3410af95c8 100644 --- a/net/bluetooth/bluetooth_sendmsg.c +++ b/net/bluetooth/bluetooth_sendmsg.c @@ -345,10 +345,10 @@ static ssize_t bluetooth_sendto(FAR struct socket *psock, netdev_txnotify_dev(&radio->r_dev); /* Wait for the send to complete or an error to occur. - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ - ret = net_lockedwait(&state.is_sem); + ret = net_sem_wait(&state.is_sem); /* Make sure that no further events are processed */ @@ -368,8 +368,8 @@ static ssize_t bluetooth_sendto(FAR struct socket *psock, return state.is_sent; } - /* If net_lockedwait failed, then we were probably reawakened by a signal. - * In this case, net_lockedwait will have returned negated errno + /* If net_sem_wait failed, then we were probably reawakened by a signal. + * In this case, net_sem_wait will have returned negated errno * appropriately. */ diff --git a/net/can/can_recvmsg.c b/net/can/can_recvmsg.c index 304535e885..451a33112c 100644 --- a/net/can/can_recvmsg.c +++ b/net/can/can_recvmsg.c @@ -480,7 +480,7 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev, * Evaluate the result of the recv operations * * Input Parameters: - * result The result of the net_lockedwait operation (may indicate EINTR) + * result The result of the net_sem_wait operation (may indicate EINTR) * pstate A pointer to the state structure to be initialized * * Returned Value: @@ -504,8 +504,8 @@ static ssize_t can_recvfrom_result(int result, return pstate->pr_result; } - /* If net_lockedwait failed, then we were probably reawakened by a signal. - * In this case, net_lockedwait will have returned negated errno + /* If net_sem_wait failed, then we were probably reawakened by a signal. + * In this case, net_sem_wait will have returned negated errno * appropriately. */ @@ -654,12 +654,12 @@ ssize_t can_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, state.pr_cb->event = can_recvfrom_eventhandler; /* Wait for either the receive to complete or for an error/timeout to - * occur. NOTES: (1) net_lockedwait will also terminate if a signal + * occur. NOTES: (1) net_sem_wait will also terminate if a signal * is received, (2) the network is locked! It will be un-locked while * the task sleeps and automatically re-locked when the task restarts. */ - ret = net_lockedwait(&state.pr_sem); + ret = net_sem_wait(&state.pr_sem); /* Make sure that no further events are processed */ diff --git a/net/can/can_sendmsg.c b/net/can/can_sendmsg.c index e86f82afed..f41bcb6115 100644 --- a/net/can/can_sendmsg.c +++ b/net/can/can_sendmsg.c @@ -255,16 +255,16 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg, netdev_txnotify_dev(dev); /* Wait for the send to complete or an error to occur. - * net_timedwait will also terminate if a signal is received. + * net_sem_timedwait will also terminate if a signal is received. */ if (_SS_ISNONBLOCK(conn->sconn.s_flags) || (flags & MSG_DONTWAIT) != 0) { - ret = net_timedwait(&state.snd_sem, 0); + ret = net_sem_timedwait(&state.snd_sem, 0); } else { - ret = net_timedwait(&state.snd_sem, UINT_MAX); + ret = net_sem_timedwait(&state.snd_sem, UINT_MAX); } /* Make sure that no further events are processed */ @@ -284,8 +284,8 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg, return state.snd_sent; } - /* If net_lockedwait failed, then we were probably reawakened by a signal. - * In this case, net_lockedwait will have returned negated errno + /* If net_sem_wait failed, then we were probably reawakened by a signal. + * In this case, net_sem_wait will have returned negated errno * appropriately. */ diff --git a/net/icmp/icmp_recvmsg.c b/net/icmp/icmp_recvmsg.c index e0f2d4289c..4b29419857 100644 --- a/net/icmp/icmp_recvmsg.c +++ b/net/icmp/icmp_recvmsg.c @@ -391,11 +391,11 @@ ssize_t icmp_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, state.recv_cb->event = recvfrom_eventhandler; /* Wait for either the response to be received or for timeout to - * occur. net_timedwait will also terminate if a signal is + * occur. net_sem_timedwait will also terminate if a signal is * received. */ - ret = net_timedwait(&state.recv_sem, + ret = net_sem_timedwait(&state.recv_sem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); if (ret < 0) { diff --git a/net/icmp/icmp_sendmsg.c b/net/icmp/icmp_sendmsg.c index 97ad179af2..1d90e01665 100644 --- a/net/icmp/icmp_sendmsg.c +++ b/net/icmp/icmp_sendmsg.c @@ -396,10 +396,10 @@ ssize_t icmp_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg, netdev_txnotify_dev(dev); /* Wait for either the send to complete or for timeout to occur. - * net_timedwait will also terminate if a signal is received. + * net_sem_timedwait will also terminate if a signal is received. */ - ret = net_timedwait(&state.snd_sem, + ret = net_sem_timedwait(&state.snd_sem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); if (ret < 0) { diff --git a/net/icmpv6/icmpv6_autoconfig.c b/net/icmpv6/icmpv6_autoconfig.c index a8021bd224..1b2939b8dd 100644 --- a/net/icmpv6/icmpv6_autoconfig.c +++ b/net/icmpv6/icmpv6_autoconfig.c @@ -222,12 +222,12 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, bool advertise) netdev_txnotify_dev(dev); /* Wait for the send to complete or an error to occur - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ do { - net_lockedwait(&state.snd_sem); + net_sem_wait(&state.snd_sem); } while (!state.snd_sent); diff --git a/net/icmpv6/icmpv6_neighbor.c b/net/icmpv6/icmpv6_neighbor.c index 1612865bad..62c42c25ac 100644 --- a/net/icmpv6/icmpv6_neighbor.c +++ b/net/icmpv6/icmpv6_neighbor.c @@ -307,12 +307,12 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr) netdev_txnotify_dev(dev); /* Wait for the send to complete or an error to occur. - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ do { - net_lockedwait(&state.snd_sem); + net_sem_wait(&state.snd_sem); } while (!state.snd_sent); diff --git a/net/icmpv6/icmpv6_notify.c b/net/icmpv6/icmpv6_notify.c index 5fdb1ccc6f..a2edf3135b 100644 --- a/net/icmpv6/icmpv6_notify.c +++ b/net/icmpv6/icmpv6_notify.c @@ -168,7 +168,7 @@ int icmpv6_wait(FAR struct icmpv6_notify_s *notify, unsigned int timeout) /* And wait for the Neighbor Advertisement (or a timeout). */ - ret = net_timedwait(¬ify->nt_sem, timeout); + ret = net_sem_timedwait(¬ify->nt_sem, timeout); if (ret >= 0) { ret = notify->nt_result; diff --git a/net/icmpv6/icmpv6_recvmsg.c b/net/icmpv6/icmpv6_recvmsg.c index 98e1649580..63bed89cb8 100644 --- a/net/icmpv6/icmpv6_recvmsg.c +++ b/net/icmpv6/icmpv6_recvmsg.c @@ -396,13 +396,13 @@ ssize_t icmpv6_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, state.recv_cb->event = recvfrom_eventhandler; /* Wait for either the response to be received or for timeout to - * occur. (1) net_timedwait will also terminate if a signal is + * occur. (1) net_sem_timedwait will also terminate if a signal is * received, (2) interrupts may be disabled! They will be * re-enabled while the task sleeps and automatically re-enabled * when the task restarts. */ - ret = net_timedwait(&state.recv_sem, + ret = net_sem_timedwait(&state.recv_sem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); if (ret < 0) { diff --git a/net/icmpv6/icmpv6_rnotify.c b/net/icmpv6/icmpv6_rnotify.c index dbafc64f60..9adb145453 100644 --- a/net/icmpv6/icmpv6_rnotify.c +++ b/net/icmpv6/icmpv6_rnotify.c @@ -250,7 +250,7 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, unsigned int timeout) /* And wait for the Neighbor Advertisement (or a timeout). */ - ret = net_timedwait(¬ify->rn_sem, timeout); + ret = net_sem_timedwait(¬ify->rn_sem, timeout); if (ret >= 0) { ret = notify->rn_result; diff --git a/net/icmpv6/icmpv6_sendmsg.c b/net/icmpv6/icmpv6_sendmsg.c index fe291359b2..5af54d7317 100644 --- a/net/icmpv6/icmpv6_sendmsg.c +++ b/net/icmpv6/icmpv6_sendmsg.c @@ -383,10 +383,10 @@ ssize_t icmpv6_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg, netdev_txnotify_dev(dev); /* Wait for either the send to complete or for timeout to occur. - * net_timedwait will also terminate if a signal is received. + * net_sem_timedwait will also terminate if a signal is received. */ - ret = net_timedwait(&state.snd_sem, + ret = net_sem_timedwait(&state.snd_sem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); if (ret < 0) { diff --git a/net/ieee802154/ieee802154_recvmsg.c b/net/ieee802154/ieee802154_recvmsg.c index 7a18e4bc00..5660bf3e5a 100644 --- a/net/ieee802154/ieee802154_recvmsg.c +++ b/net/ieee802154/ieee802154_recvmsg.c @@ -377,12 +377,12 @@ ssize_t ieee802154_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, state.ir_cb->event = ieee802154_recvfrom_eventhandler; /* Wait for either the receive to complete or for an error/timeout to - * occur. NOTES: (1) net_lockedwait will also terminate if a signal + * occur. NOTES: (1) net_sem_wait will also terminate if a signal * is received, (2) the network is locked! It will be un-locked while * the task sleeps and automatically re-locked when the task restarts. */ - net_lockedwait(&state.ir_sem); + net_sem_wait(&state.ir_sem); /* Make sure that no further events are processed */ diff --git a/net/ieee802154/ieee802154_sendmsg.c b/net/ieee802154/ieee802154_sendmsg.c index 5bc99cd1b0..fc5a49e765 100644 --- a/net/ieee802154/ieee802154_sendmsg.c +++ b/net/ieee802154/ieee802154_sendmsg.c @@ -501,10 +501,10 @@ static ssize_t ieee802154_sendto(FAR struct socket *psock, netdev_txnotify_dev(&radio->r_dev); /* Wait for the send to complete or an error to occur. - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ - ret = net_lockedwait(&state.is_sem); + ret = net_sem_wait(&state.is_sem); /* Make sure that no further events are processed */ @@ -524,8 +524,8 @@ static ssize_t ieee802154_sendto(FAR struct socket *psock, return state.is_sent; } - /* If net_lockedwait failed, then we were probably reawakened by a signal. - * In this case, net_lockedwait will have returned negated errno + /* If net_sem_wait failed, then we were probably reawakened by a signal. + * In this case, net_sem_wait will have returned negated errno * appropriately. */ diff --git a/net/igmp/igmp_msg.c b/net/igmp/igmp_msg.c index f2cfe72bbe..cad7832189 100644 --- a/net/igmp/igmp_msg.c +++ b/net/igmp/igmp_msg.c @@ -135,7 +135,7 @@ int igmp_waitmsg(FAR struct igmp_group_s *group, uint8_t msgid) { /* Wait for the semaphore to be posted */ - ret = net_lockedwait_uninterruptible(&group->sem); + ret = net_sem_wait_uninterruptible(&group->sem); if (ret < 0) { break; diff --git a/net/local/local_accept.c b/net/local/local_accept.c index bcca1eb65f..1518444389 100644 --- a/net/local/local_accept.c +++ b/net/local/local_accept.c @@ -55,7 +55,7 @@ static int local_waitlisten(FAR struct local_conn_s *server) { /* No.. wait for a connection or a signal */ - ret = net_lockedwait(&server->lc_waitsem); + ret = net_sem_wait(&server->lc_waitsem); if (ret < 0) { return ret; @@ -245,7 +245,7 @@ int local_accept(FAR struct socket *psock, FAR struct sockaddr *addr, if (ret == OK) { - ret = net_lockedwait(&client->lc_donesem); + ret = net_sem_wait(&client->lc_donesem); } return ret; diff --git a/net/local/local_connect.c b/net/local/local_connect.c index 1b001b5cbd..92584e5d74 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -137,7 +137,7 @@ static int inline local_stream_connect(FAR struct local_conn_s *client, { do { - net_lockedwait_uninterruptible(&client->lc_waitsem); + net_sem_wait_uninterruptible(&client->lc_waitsem); ret = client->u.client.lc_result; } while (ret == -EBUSY); diff --git a/net/mld/mld_msg.c b/net/mld/mld_msg.c index c763669e3e..36afafaab4 100644 --- a/net/mld/mld_msg.c +++ b/net/mld/mld_msg.c @@ -116,7 +116,7 @@ int mld_waitmsg(FAR struct mld_group_s *group, uint8_t msgtype) { /* Wait for the semaphore to be posted */ - ret = net_lockedwait_uninterruptible(&group->sem); + ret = net_sem_wait_uninterruptible(&group->sem); if (ret < 0) { break; diff --git a/net/pkt/pkt_recvmsg.c b/net/pkt/pkt_recvmsg.c index aa989da875..69edefd121 100644 --- a/net/pkt/pkt_recvmsg.c +++ b/net/pkt/pkt_recvmsg.c @@ -265,7 +265,7 @@ static void pkt_recvfrom_initialize(FAR struct socket *psock, FAR void *buf, * Evaluate the result of the recv operations * * Input Parameters: - * result The result of the net_lockedwait operation (may indicate EINTR) + * result The result of the net_sem_wait operation (may indicate EINTR) * pstate A pointer to the state structure to be initialized * * Returned Value: @@ -291,8 +291,8 @@ static ssize_t pkt_recvfrom_result(int result, return pstate->pr_result; } - /* If net_lockedwait failed, then we were probably reawakened by a signal. - * In this case, net_lockedwait will have returned negated errno + /* If net_sem_wait failed, then we were probably reawakened by a signal. + * In this case, net_sem_wait will have returned negated errno * appropriately. */ @@ -403,12 +403,12 @@ ssize_t pkt_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, state.pr_cb->event = pkt_recvfrom_eventhandler; /* Wait for either the receive to complete or for an error/timeout to - * occur. NOTES: (1) net_lockedwait will also terminate if a signal + * occur. NOTES: (1) net_sem_wait will also terminate if a signal * is received, (2) the network is locked! It will be un-locked while * the task sleeps and automatically re-locked when the task restarts. */ - ret = net_lockedwait(&state.pr_sem); + ret = net_sem_wait(&state.pr_sem); /* Make sure that no further events are processed */ diff --git a/net/pkt/pkt_sendmsg.c b/net/pkt/pkt_sendmsg.c index f7618c97bd..b8acce8e03 100644 --- a/net/pkt/pkt_sendmsg.c +++ b/net/pkt/pkt_sendmsg.c @@ -241,10 +241,10 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg, netdev_txnotify_dev(dev); /* Wait for the send to complete or an error to occur. - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ - ret = net_lockedwait(&state.snd_sem); + ret = net_sem_wait(&state.snd_sem); /* Make sure that no further events are processed */ @@ -264,8 +264,8 @@ ssize_t pkt_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg, return state.snd_sent; } - /* If net_lockedwait failed, then we were probably reawakened by a signal. - * In this case, net_lockedwait will have returned negated errno + /* If net_sem_wait failed, then we were probably reawakened by a signal. + * In this case, net_sem_wait will have returned negated errno * appropriately. */ diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c index f1b4632567..9ad0711873 100644 --- a/net/rpmsg/rpmsg_sockif.c +++ b/net/rpmsg/rpmsg_sockif.c @@ -681,7 +681,7 @@ static int rpmsg_socket_connect_internal(FAR struct socket *psock) return -EINPROGRESS; } - ret = net_timedwait(&conn->sendsem, + ret = net_sem_timedwait(&conn->sendsem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); if (ret < 0) @@ -762,7 +762,7 @@ static int rpmsg_socket_accept(FAR struct socket *psock, if (conn->sendsize == 0) { - net_lockedwait(&conn->sendsem); + net_sem_wait(&conn->sendsem); } newsock->s_domain = psock->s_domain; @@ -783,7 +783,7 @@ static int rpmsg_socket_accept(FAR struct socket *psock, } else { - ret = net_lockedwait(&server->recvsem); + ret = net_sem_wait(&server->recvsem); if (server->backlog == -1) { ret = -ECONNRESET; @@ -950,7 +950,7 @@ static ssize_t rpmsg_socket_send_continuous(FAR struct socket *psock, { if (!nonblock) { - ret = net_timedwait(&conn->sendsem, + ret = net_sem_timedwait(&conn->sendsem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); if (!conn->ept.rdev) { @@ -1049,7 +1049,7 @@ static ssize_t rpmsg_socket_send_single(FAR struct socket *psock, if (!nonblock) { - ret = net_timedwait(&conn->sendsem, + ret = net_sem_timedwait(&conn->sendsem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); if (!conn->ept.rdev) { @@ -1231,7 +1231,7 @@ static ssize_t rpmsg_socket_recvmsg(FAR struct socket *psock, nxmutex_unlock(&conn->recvlock); - ret = net_timedwait(&conn->recvsem, + ret = net_sem_timedwait(&conn->recvsem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); if (!conn->ept.rdev) { diff --git a/net/sixlowpan/sixlowpan_send.c b/net/sixlowpan/sixlowpan_send.c index ec1e441842..6b4dead38d 100644 --- a/net/sixlowpan/sixlowpan_send.c +++ b/net/sixlowpan/sixlowpan_send.c @@ -246,12 +246,12 @@ int sixlowpan_send(FAR struct net_driver_s *dev, netdev_txnotify_dev(dev); /* Wait for the send to complete or an error to occur. - * net_timedwait will also terminate if a signal is received. + * net_sem_timedwait will also terminate if a signal is received. */ ninfo("Wait for send complete\n"); - ret = net_timedwait(&sinfo.s_waitsem, timeout); + ret = net_sem_timedwait(&sinfo.s_waitsem, timeout); if (ret < 0) { if (ret == -ETIMEDOUT) diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c index a127dd9743..b3db42e815 100644 --- a/net/sixlowpan/sixlowpan_tcpsend.c +++ b/net/sixlowpan/sixlowpan_tcpsend.c @@ -642,7 +642,7 @@ static int sixlowpan_send_packet(FAR struct socket *psock, netdev_txnotify_dev(dev); /* Wait for the send to complete or an error to occur. - * net_timedwait will also terminate if a signal is received. + * net_sem_timedwait will also terminate if a signal is received. */ ninfo("Wait for send complete\n"); @@ -651,7 +651,7 @@ static int sixlowpan_send_packet(FAR struct socket *psock, { uint32_t acked = sinfo.s_acked; - ret = net_timedwait(&sinfo.s_waitsem, timeout); + ret = net_sem_timedwait(&sinfo.s_waitsem, timeout); if (ret != -ETIMEDOUT || acked == sinfo.s_acked) { if (ret == -ETIMEDOUT) diff --git a/net/tcp/tcp_accept.c b/net/tcp/tcp_accept.c index c2739dcb82..b31664bfff 100644 --- a/net/tcp/tcp_accept.c +++ b/net/tcp/tcp_accept.c @@ -268,10 +268,10 @@ int psock_tcp_accept(FAR struct socket *psock, FAR struct sockaddr *addr, conn->accept = accept_eventhandler; /* Wait for the send to complete or an error to occur: NOTES: - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ - ret = net_lockedwait(&state.acpt_sem); + ret = net_sem_wait(&state.acpt_sem); /* Make sure that no further events are processed */ @@ -290,8 +290,8 @@ int psock_tcp_accept(FAR struct socket *psock, FAR struct sockaddr *addr, return -state.acpt_result; } - /* If net_lockedwait failed, then we were probably reawakened by a - * signal. In this case, net_lockedwait will have returned negated + /* If net_sem_wait failed, then we were probably reawakened by a + * signal. In this case, net_sem_wait will have returned negated * errno appropriately. */ diff --git a/net/tcp/tcp_connect.c b/net/tcp/tcp_connect.c index 579792c7d4..72ee061402 100644 --- a/net/tcp/tcp_connect.c +++ b/net/tcp/tcp_connect.c @@ -358,17 +358,17 @@ int psock_tcp_connect(FAR struct socket *psock, { /* Wait for either the connect to complete or for an * error/timeout to occur. - * NOTES: net_lockedwait will also terminate if a + * NOTES: net_sem_wait will also terminate if a * signal is received. */ - ret = net_lockedwait(&state.tc_sem); + ret = net_sem_wait(&state.tc_sem); /* Uninitialize the state structure */ nxsem_destroy(&state.tc_sem); - /* If net_lockedwait failed, negated errno was returned. */ + /* If net_sem_wait failed, negated errno was returned. */ if (ret >= 0) { diff --git a/net/tcp/tcp_recvfrom.c b/net/tcp/tcp_recvfrom.c index cc79e5b5dd..8ebf4e40aa 100644 --- a/net/tcp/tcp_recvfrom.c +++ b/net/tcp/tcp_recvfrom.c @@ -541,7 +541,8 @@ static void tcp_recvfrom_initialize(FAR struct tcp_conn_s *conn, * Evaluate the result of the recv operations * * Input Parameters: - * result The result of the net_timedwait operation (may indicate EINTR) + * result The result of the net_sem_timedwait operation + * (may indicate EINTR) * pstate A pointer to the state structure to be initialized * * Returned Value: @@ -709,11 +710,11 @@ ssize_t psock_tcp_recvfrom(FAR struct socket *psock, FAR struct msghdr *msg, state.ir_cb->event = tcp_recvhandler; /* Wait for either the receive to complete or for an error/timeout - * to occur. net_timedwait will also terminate if a signal is + * to occur. net_sem_timedwait will also terminate if a signal is * received. */ - ret = net_timedwait(&state.ir_sem, + ret = net_sem_timedwait(&state.ir_sem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); if (ret == -ETIMEDOUT) { diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index e0a24e52e2..d7be8d0d8b 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -1218,7 +1218,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, goto errout_with_lock; } - ret = net_timedwait_uninterruptible(&conn->snd_sem, + ret = net_sem_timedwait_uninterruptible(&conn->snd_sem, tcp_send_gettimeout(start, timeout)); if (ret < 0) { diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index 4e6af943d2..f3a9e3fd96 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -634,14 +634,14 @@ ssize_t psock_tcp_send(FAR struct socket *psock, tcp_send_txnotify(psock, conn); /* Wait for the send to complete or an error to occur: NOTES: - * net_lockedwait will also terminate if a signal is received. + * net_sem_wait will also terminate if a signal is received. */ for (; ; ) { uint32_t acked = state.snd_acked; - ret = net_timedwait(&state.snd_sem, + ret = net_sem_timedwait(&state.snd_sem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); if (ret != -ETIMEDOUT || acked == state.snd_acked) { @@ -673,9 +673,9 @@ ssize_t psock_tcp_send(FAR struct socket *psock, goto errout; } - /* If net_timedwait failed, then we were probably reawakened by a signal. - * In this case, net_timedwait will have returned negated errno - * appropriately. + /* If net_sem_timedwait failed, then we were probably reawakened by a + * signal. In this case, net_sem_timedwait will have returned negated + * errno appropriately. */ if (ret < 0) diff --git a/net/tcp/tcp_sendfile.c b/net/tcp/tcp_sendfile.c index 3256942f33..b572fbd23d 100644 --- a/net/tcp/tcp_sendfile.c +++ b/net/tcp/tcp_sendfile.c @@ -537,7 +537,7 @@ ssize_t tcp_sendfile(FAR struct socket *psock, FAR struct file *infile, { uint32_t acked = state.snd_acked; - ret = net_timedwait_uninterruptible( + ret = net_sem_timedwait_uninterruptible( &state.snd_sem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); if (ret != -ETIMEDOUT || acked == state.snd_acked) { diff --git a/net/tcp/tcp_txdrain.c b/net/tcp/tcp_txdrain.c index ac41b3b0c0..2b04f611a5 100644 --- a/net/tcp/tcp_txdrain.c +++ b/net/tcp/tcp_txdrain.c @@ -144,7 +144,7 @@ int tcp_txdrain(FAR struct socket *psock, unsigned int timeout) * wait for it to drain or be be disconnected. */ - ret = net_timedwait_uninterruptible(&waitsem, timeout); + ret = net_sem_timedwait_uninterruptible(&waitsem, timeout); /* Tear down the disconnect notifier */ diff --git a/net/tcp/tcp_wrbuffer.c b/net/tcp/tcp_wrbuffer.c index b53df7373a..7501e4b382 100644 --- a/net/tcp/tcp_wrbuffer.c +++ b/net/tcp/tcp_wrbuffer.c @@ -134,7 +134,7 @@ FAR struct tcp_wrbuffer_s *tcp_wrbuffer_timedalloc(unsigned int timeout) * buffer */ - ret = net_timedwait_uninterruptible(&g_wrbuffer.sem, timeout); + ret = net_sem_timedwait_uninterruptible(&g_wrbuffer.sem, timeout); if (ret != OK) { return NULL; diff --git a/net/udp/udp_recvfrom.c b/net/udp/udp_recvfrom.c index e6d880d01d..358dd425f2 100644 --- a/net/udp/udp_recvfrom.c +++ b/net/udp/udp_recvfrom.c @@ -500,7 +500,8 @@ static void udp_recvfrom_initialize(FAR struct udp_conn_s *conn, * Evaluate the result of the recv operations * * Input Parameters: - * result The result of the net_timedwait operation (may indicate EINTR) + * result The result of the net_sem_timedwait operation + * (may indicate EINTR) * pstate A pointer to the state structure to be initialized * * Returned Value: @@ -525,9 +526,9 @@ static ssize_t udp_recvfrom_result(int result, struct udp_recvfrom_s *pstate) return pstate->ir_result; } - /* If net_timedwait failed, then we were probably reawakened by a signal. - * In this case, net_timedwait will have returned negated errno - * appropriately. + /* If net_sem_timedwait failed, then we were probably reawakened by a + * signal. In this case, net_sem_timedwait will have returned negated + * errno appropriately. */ if (result < 0) @@ -634,11 +635,11 @@ ssize_t psock_udp_recvfrom(FAR struct socket *psock, FAR struct msghdr *msg, state.ir_cb->event = udp_eventhandler; /* Wait for either the receive to complete or for an error/timeout - * to occur. net_timedwait will also terminate if a signal is + * to occur. net_sem_timedwait will also terminate if a signal is * received. */ - ret = net_timedwait(&state.ir_sem, + ret = net_sem_timedwait(&state.ir_sem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); if (ret == -ETIMEDOUT) { diff --git a/net/udp/udp_sendto_buffered.c b/net/udp/udp_sendto_buffered.c index 7263edb1c0..9a64af57e4 100644 --- a/net/udp/udp_sendto_buffered.c +++ b/net/udp/udp_sendto_buffered.c @@ -683,7 +683,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, goto errout_with_lock; } - ret = net_timedwait_uninterruptible(&conn->sndsem, + ret = net_sem_timedwait_uninterruptible(&conn->sndsem, udp_send_gettimeout(start, timeout)); if (ret < 0) { diff --git a/net/udp/udp_sendto_unbuffered.c b/net/udp/udp_sendto_unbuffered.c index db1d6ad030..a9318167e3 100644 --- a/net/udp/udp_sendto_unbuffered.c +++ b/net/udp/udp_sendto_unbuffered.c @@ -462,11 +462,11 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, netdev_txnotify_dev(state.st_dev); /* Wait for either the receive to complete or for an error/timeout to - * occur. NOTES: net_timedwait will also terminate if a signal + * occur. NOTES: net_sem_timedwait will also terminate if a signal * is received. */ - ret = net_timedwait(&state.st_sem, + ret = net_sem_timedwait(&state.st_sem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); if (ret >= 0) { diff --git a/net/udp/udp_txdrain.c b/net/udp/udp_txdrain.c index 003358c868..d02aa094f0 100644 --- a/net/udp/udp_txdrain.c +++ b/net/udp/udp_txdrain.c @@ -111,7 +111,7 @@ int udp_txdrain(FAR struct socket *psock, unsigned int timeout) /* There is pending write data.. wait for it to drain. */ - ret = net_timedwait_uninterruptible(&waitsem, timeout); + ret = net_sem_timedwait_uninterruptible(&waitsem, timeout); /* Tear down the notifier (in case we timed out or were canceled) */ diff --git a/net/udp/udp_wrbuffer.c b/net/udp/udp_wrbuffer.c index b4b14899a7..f6a0fd9324 100644 --- a/net/udp/udp_wrbuffer.c +++ b/net/udp/udp_wrbuffer.c @@ -132,7 +132,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_alloc(void) * buffer */ - net_lockedwait_uninterruptible(&g_wrbuffer.sem); + net_sem_wait_uninterruptible(&g_wrbuffer.sem); /* Now, we are guaranteed to have a write buffer structure reserved * for us in the free list. @@ -186,7 +186,7 @@ FAR struct udp_wrbuffer_s *udp_wrbuffer_timedalloc(unsigned int timeout) * buffer */ - ret = net_timedwait_uninterruptible(&g_wrbuffer.sem, timeout); + ret = net_sem_timedwait_uninterruptible(&g_wrbuffer.sem, timeout); if (ret != OK) { return NULL; diff --git a/net/usrsock/usrsock_accept.c b/net/usrsock/usrsock_accept.c index eb6992aa91..da3c372eea 100644 --- a/net/usrsock/usrsock_accept.c +++ b/net/usrsock/usrsock_accept.c @@ -326,7 +326,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, /* Wait for receive-avail (or abort, or timeout, or signal). */ - ret = net_timedwait(&state.reqstate.recvsem, + ret = net_sem_timedwait(&state.reqstate.recvsem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); usrsock_teardown_data_request_callback(&state); if (ret < 0) @@ -343,7 +343,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, } else { - nerr("net_timedwait errno: %d\n", ret); + nerr("net_sem_timedwait errno: %d\n", ret); DEBUGPANIC(); } @@ -400,7 +400,7 @@ int usrsock_accept(FAR struct socket *psock, FAR struct sockaddr *addr, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.reqstate.recvsem); + net_sem_wait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= inaddrlen); diff --git a/net/usrsock/usrsock_bind.c b/net/usrsock/usrsock_bind.c index 415011bef9..05dd73da68 100644 --- a/net/usrsock/usrsock_bind.c +++ b/net/usrsock/usrsock_bind.c @@ -191,7 +191,7 @@ int usrsock_bind(FAR struct socket *psock, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.recvsem); + net_sem_wait_uninterruptible(&state.recvsem); ret = state.result; } diff --git a/net/usrsock/usrsock_close.c b/net/usrsock/usrsock_close.c index f7d59c096b..1c2f11e1b4 100644 --- a/net/usrsock/usrsock_close.c +++ b/net/usrsock/usrsock_close.c @@ -163,7 +163,7 @@ int usrsock_close(FAR struct usrsock_conn_s *conn) { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.recvsem); + net_sem_wait_uninterruptible(&state.recvsem); ret = state.result; if (ret < 0) diff --git a/net/usrsock/usrsock_connect.c b/net/usrsock/usrsock_connect.c index 0a32d540b7..76bee98e46 100644 --- a/net/usrsock/usrsock_connect.c +++ b/net/usrsock/usrsock_connect.c @@ -223,7 +223,7 @@ int usrsock_connect(FAR struct socket *psock, { /* Wait for completion of request (or signal). */ - ret = net_lockedwait(&state.recvsem); + ret = net_sem_wait(&state.recvsem); if (ret < 0) { /* Wait interrupted, exit early. */ diff --git a/net/usrsock/usrsock_devif.c b/net/usrsock/usrsock_devif.c index 354fe40b3e..d061d5ee41 100644 --- a/net/usrsock/usrsock_devif.c +++ b/net/usrsock/usrsock_devif.c @@ -641,7 +641,7 @@ int usrsock_do_request(FAR struct usrsock_conn_s *conn, /* Set outstanding request for daemon to handle. */ - net_lockedwait_uninterruptible(&req->lock); + net_sem_wait_uninterruptible(&req->lock); if (++req->newxid == 0) { ++req->newxid; @@ -662,7 +662,7 @@ int usrsock_do_request(FAR struct usrsock_conn_s *conn, /* Wait ack for request. */ ++req->nbusy; /* net_lock held. */ - net_lockedwait_uninterruptible(&req->acksem); + net_sem_wait_uninterruptible(&req->acksem); --req->nbusy; /* net_lock held. */ } @@ -700,12 +700,12 @@ void usrsock_abort(void) * requests. */ - ret = net_timedwait(&req->lock, 10); + ret = net_sem_timedwait(&req->lock, 10); if (ret < 0) { if (ret != -ETIMEDOUT && ret != -EINTR) { - ninfo("net_timedwait errno: %d\n", ret); + ninfo("net_sem_timedwait errno: %d\n", ret); DEBUGASSERT(false); } } diff --git a/net/usrsock/usrsock_getpeername.c b/net/usrsock/usrsock_getpeername.c index 1a33e33807..9058aa1d8a 100644 --- a/net/usrsock/usrsock_getpeername.c +++ b/net/usrsock/usrsock_getpeername.c @@ -202,7 +202,7 @@ int usrsock_getpeername(FAR struct socket *psock, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.reqstate.recvsem); + net_sem_wait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= *addrlen); diff --git a/net/usrsock/usrsock_getsockname.c b/net/usrsock/usrsock_getsockname.c index 27cfad0f7c..e4de81989b 100644 --- a/net/usrsock/usrsock_getsockname.c +++ b/net/usrsock/usrsock_getsockname.c @@ -202,7 +202,7 @@ int usrsock_getsockname(FAR struct socket *psock, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.reqstate.recvsem); + net_sem_wait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= *addrlen); diff --git a/net/usrsock/usrsock_getsockopt.c b/net/usrsock/usrsock_getsockopt.c index 21da7127d8..352baacace 100644 --- a/net/usrsock/usrsock_getsockopt.c +++ b/net/usrsock/usrsock_getsockopt.c @@ -225,7 +225,7 @@ int usrsock_getsockopt(FAR struct socket *psock, int level, int option, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.reqstate.recvsem); + net_sem_wait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= *value_len); diff --git a/net/usrsock/usrsock_ioctl.c b/net/usrsock/usrsock_ioctl.c index ba93ac5112..f3c6ad5851 100644 --- a/net/usrsock/usrsock_ioctl.c +++ b/net/usrsock/usrsock_ioctl.c @@ -236,7 +236,7 @@ int usrsock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg_) { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.reqstate.recvsem); + net_sem_wait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(state.valuelen <= arglen); diff --git a/net/usrsock/usrsock_listen.c b/net/usrsock/usrsock_listen.c index 8b262030a8..3887a8831f 100644 --- a/net/usrsock/usrsock_listen.c +++ b/net/usrsock/usrsock_listen.c @@ -210,7 +210,7 @@ int usrsock_listen(FAR struct socket *psock, int backlog) /* Wait for completion of request (or signal). */ - ret = net_lockedwait(&state.recvsem); + ret = net_sem_wait(&state.recvsem); if (ret < 0) { /* Wait interrupted, exit early. */ diff --git a/net/usrsock/usrsock_recvmsg.c b/net/usrsock/usrsock_recvmsg.c index afef0548db..b79997fd98 100644 --- a/net/usrsock/usrsock_recvmsg.c +++ b/net/usrsock/usrsock_recvmsg.c @@ -324,7 +324,7 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, /* Wait for receive-avail (or abort, or timeout, or signal). */ - ret = net_timedwait(&state.reqstate.recvsem, + ret = net_sem_timedwait(&state.reqstate.recvsem, _SO_TIMEOUT(conn->sconn.s_rcvtimeo)); usrsock_teardown_data_request_callback(&state); if (ret < 0) @@ -341,7 +341,7 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, } else { - nerr("net_timedwait errno: %zd\n", ret); + nerr("net_sem_timedwait errno: %zd\n", ret); DEBUGPANIC(); } @@ -397,7 +397,7 @@ ssize_t usrsock_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.reqstate.recvsem); + net_sem_wait_uninterruptible(&state.reqstate.recvsem); ret = state.reqstate.result; DEBUGASSERT(ret <= (ssize_t)len); diff --git a/net/usrsock/usrsock_sendmsg.c b/net/usrsock/usrsock_sendmsg.c index 6f14961cd4..13428e2ced 100644 --- a/net/usrsock/usrsock_sendmsg.c +++ b/net/usrsock/usrsock_sendmsg.c @@ -306,7 +306,7 @@ ssize_t usrsock_sendmsg(FAR struct socket *psock, /* Wait for send-ready (or abort, or timeout, or signal). */ - ret = net_timedwait(&state.recvsem, + ret = net_sem_timedwait(&state.recvsem, _SO_TIMEOUT(conn->sconn.s_sndtimeo)); usrsock_teardown_request_callback(&state); if (ret < 0) @@ -323,7 +323,7 @@ ssize_t usrsock_sendmsg(FAR struct socket *psock, } else { - nerr("net_timedwait errno: %zd\n", ret); + nerr("net_sem_timedwait errno: %zd\n", ret); DEBUGPANIC(); } @@ -371,7 +371,7 @@ ssize_t usrsock_sendmsg(FAR struct socket *psock, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.recvsem); + net_sem_wait_uninterruptible(&state.recvsem); ret = state.result; } diff --git a/net/usrsock/usrsock_setsockopt.c b/net/usrsock/usrsock_setsockopt.c index 923836a41c..61e1128859 100644 --- a/net/usrsock/usrsock_setsockopt.c +++ b/net/usrsock/usrsock_setsockopt.c @@ -210,7 +210,7 @@ int usrsock_setsockopt(FAR struct socket *psock, int level, int option, { /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.recvsem); + net_sem_wait_uninterruptible(&state.recvsem); ret = state.result; } diff --git a/net/usrsock/usrsock_socket.c b/net/usrsock/usrsock_socket.c index edf7591fba..362315158a 100644 --- a/net/usrsock/usrsock_socket.c +++ b/net/usrsock/usrsock_socket.c @@ -225,7 +225,7 @@ int usrsock_socket(int domain, int type, int protocol, /* Wait for completion of request. */ - net_lockedwait_uninterruptible(&state.recvsem); + net_sem_wait_uninterruptible(&state.recvsem); if (state.result < 0) { diff --git a/net/utils/net_lock.c b/net/utils/net_lock.c index 3ce295f5b7..7f63608b65 100644 --- a/net/utils/net_lock.c +++ b/net/utils/net_lock.c @@ -216,7 +216,7 @@ int net_restorelock(unsigned int count) } /**************************************************************************** - * Name: net_timedwait + * Name: net_sem_timedwait * * Description: * Atomically wait for sem (or a timeout) while temporarily releasing @@ -237,13 +237,13 @@ int net_restorelock(unsigned int count) * ****************************************************************************/ -int net_timedwait(sem_t *sem, unsigned int timeout) +int net_sem_timedwait(sem_t *sem, unsigned int timeout) { return _net_timedwait(sem, true, timeout); } /**************************************************************************** - * Name: net_lockedwait + * Name: net_sem_wait * * Description: * Atomically wait for sem while temporarily releasing the network lock. @@ -262,16 +262,16 @@ int net_timedwait(sem_t *sem, unsigned int timeout) * ****************************************************************************/ -int net_lockedwait(sem_t *sem) +int net_sem_wait(sem_t *sem) { - return net_timedwait(sem, UINT_MAX); + return net_sem_timedwait(sem, UINT_MAX); } /**************************************************************************** - * Name: net_timedwait_uninterruptible + * Name: net_sem_timedwait_uninterruptible * * Description: - * This function is wrapped version of net_timedwait(), which is + * This function is wrapped version of net_sem_timedwait(), which is * uninterruptible and convenient for use. * * Input Parameters: @@ -284,16 +284,16 @@ int net_lockedwait(sem_t *sem) * ****************************************************************************/ -int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout) +int net_sem_timedwait_uninterruptible(sem_t *sem, unsigned int timeout) { return _net_timedwait(sem, false, timeout); } /**************************************************************************** - * Name: net_lockedwait_uninterruptible + * Name: net_sem_wait_uninterruptible * * Description: - * This function is wrapped version of net_lockedwait(), which is + * This function is wrapped version of net_sem_wait(), which is * uninterruptible and convenient for use. * * Input Parameters: @@ -305,9 +305,9 @@ int net_timedwait_uninterruptible(sem_t *sem, unsigned int timeout) * ****************************************************************************/ -int net_lockedwait_uninterruptible(sem_t *sem) +int net_sem_wait_uninterruptible(sem_t *sem) { - return net_timedwait_uninterruptible(sem, UINT_MAX); + return net_sem_timedwait_uninterruptible(sem, UINT_MAX); } #ifdef CONFIG_MM_IOB