Move files to net/utils; make appropriate name changes, most for uip_lock to net_lock

This commit is contained in:
Gregory Nutt
2014-06-26 14:23:21 -06:00
parent 690d8c6e61
commit 64ba574ecc
44 changed files with 387 additions and 243 deletions
+3 -3
View File
@@ -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;
}
+6 -6
View File
@@ -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 */
+3 -3
View File
@@ -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;
}