mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Move files to net/utils; make appropriate name changes, most for uip_lock to net_lock
This commit is contained in:
@@ -80,7 +80,7 @@ int net_addroute(uip_ipaddr_t target, uip_ipaddr_t netmask,
|
||||
uip_ipaddr_t router)
|
||||
{
|
||||
FAR struct net_route_s *route;
|
||||
uip_lock_t save;
|
||||
net_lock_t save;
|
||||
|
||||
/* Allocate a route entry */
|
||||
|
||||
@@ -99,12 +99,12 @@ int net_addroute(uip_ipaddr_t target, uip_ipaddr_t netmask,
|
||||
|
||||
/* Get exclusive address to the networking data structures */
|
||||
|
||||
save = uip_lock();
|
||||
save = net_lock();
|
||||
|
||||
/* Then add the new entry to the table */
|
||||
|
||||
sq_addlast((FAR sq_entry_t *)route, (FAR sq_queue_t *)&g_routes);
|
||||
uip_unlock(save);
|
||||
net_unlock(save);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,18 +127,18 @@ void net_initroute(void)
|
||||
FAR struct net_route_s *net_allocroute(void)
|
||||
{
|
||||
FAR struct net_route_s *route;
|
||||
uip_lock_t save;
|
||||
net_lock_t save;
|
||||
|
||||
/* Get exclusive address to the networking data structures */
|
||||
|
||||
save = uip_lock();
|
||||
save = net_lock();
|
||||
|
||||
/* Then add the new entry to the table */
|
||||
|
||||
route = (FAR struct net_route_s *)
|
||||
sq_remfirst((FAR sq_queue_t *)&g_freeroutes);
|
||||
|
||||
uip_unlock(save);
|
||||
net_unlock(save);
|
||||
return route;
|
||||
}
|
||||
|
||||
@@ -158,18 +158,18 @@ FAR struct net_route_s *net_allocroute(void)
|
||||
|
||||
void net_freeroute(FAR struct net_route_s *route)
|
||||
{
|
||||
uip_lock_t save;
|
||||
net_lock_t save;
|
||||
|
||||
DEBUGASSERT(route);
|
||||
|
||||
/* Get exclusive address to the networking data structures */
|
||||
|
||||
save = uip_lock();
|
||||
save = net_lock();
|
||||
|
||||
/* Then add the new entry to the table */
|
||||
|
||||
sq_addlast((FAR sq_entry_t *)route, (FAR sq_queue_t *)&g_freeroutes);
|
||||
uip_unlock(save);
|
||||
net_unlock(save);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET && CONFIG_NET_ROUTE */
|
||||
|
||||
@@ -74,12 +74,12 @@ int net_foreachroute(route_handler_t handler, FAR void *arg)
|
||||
{
|
||||
FAR struct net_route_s *route;
|
||||
FAR struct net_route_s *next;
|
||||
uip_lock_t save;
|
||||
net_lock_t save;
|
||||
int ret = 0;
|
||||
|
||||
/* Prevent concurrent access to the routing table */
|
||||
|
||||
save = uip_lock();
|
||||
save = net_lock();
|
||||
|
||||
/* Visit each entry in the routing table */
|
||||
|
||||
@@ -95,7 +95,7 @@ int net_foreachroute(route_handler_t handler, FAR void *arg)
|
||||
|
||||
/* Unlock uIP */
|
||||
|
||||
uip_unlock(save);
|
||||
net_unlock(save);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user