diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-15 20:26:34 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-15 20:26:34 +0000 |
commit | 6353b7f4d277bc2145ad408e349f2a9a98c8c397 (patch) | |
tree | d4ccbfd8eaf3d042c0731d2ab970aea8dddeb768 /nuttx/net/uip/uip_tcpconn.c | |
parent | 69ed3e725f394bd249cb732945a0fc989b394746 (diff) | |
download | px4-nuttx-6353b7f4d277bc2145ad408e349f2a9a98c8c397.tar.gz px4-nuttx-6353b7f4d277bc2145ad408e349f2a9a98c8c397.tar.bz2 px4-nuttx-6353b7f4d277bc2145ad408e349f2a9a98c8c397.zip |
More SLIP integration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3384 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/uip/uip_tcpconn.c')
-rw-r--r-- | nuttx/net/uip/uip_tcpconn.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/nuttx/net/uip/uip_tcpconn.c b/nuttx/net/uip/uip_tcpconn.c index 60eb16bc9..932aad2f7 100644 --- a/nuttx/net/uip/uip_tcpconn.c +++ b/nuttx/net/uip/uip_tcpconn.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/uip_tcpconn.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Large parts of this file were leveraged from uIP logic: @@ -208,14 +208,14 @@ void uip_tcpinit(void) struct uip_conn *uip_tcpalloc(void) { struct uip_conn *conn; - irqstate_t flags; + uip_lock_t flags; /* Because this routine is called from both interrupt level and * and from user level, we have not option but to disable interrupts * while accessing g_free_tcp_connections[]; */ - flags = irqsave(); + flags = uip_lock(); /* Return the entry from the head of the free list */ @@ -258,7 +258,7 @@ struct uip_conn *uip_tcpalloc(void) } #endif - irqrestore(flags); + uip_unlock(flags); /* Mark the connection allocated */ @@ -284,7 +284,7 @@ void uip_tcpfree(struct uip_conn *conn) #if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0 struct uip_readahead_s *readahead; #endif - irqstate_t flags; + uip_lock_t flags; /* Because g_free_tcp_connections is accessed from user level and interrupt * level, code, it is necessary to keep interrupts disabled during this @@ -292,7 +292,7 @@ void uip_tcpfree(struct uip_conn *conn) */ DEBUGASSERT(conn->crefs == 0); - flags = irqsave(); + flags = uip_lock(); /* UIP_ALLOCATED means that that the connection is not in the active list * yet. @@ -336,7 +336,7 @@ void uip_tcpfree(struct uip_conn *conn) conn->tcpstateflags = UIP_CLOSED; dq_addlast(&conn->node, &g_free_tcp_connections); - irqrestore(flags); + uip_unlock(flags); } /**************************************************************************** @@ -508,14 +508,14 @@ int uip_tcpbind(struct uip_conn *conn, const struct sockaddr_in6 *addr) int uip_tcpbind(struct uip_conn *conn, const struct sockaddr_in *addr) #endif { - irqstate_t flags; + uip_lock_t flags; int port; /* Verify or select a local port */ - flags = irqsave(); + flags = uip_lock(); port = uip_selectport(ntohs(addr->sin_port)); - irqrestore(flags); + uip_unlock(flags); if (port < 0) { @@ -566,7 +566,7 @@ int uip_tcpconnect(struct uip_conn *conn, const struct sockaddr_in6 *addr) int uip_tcpconnect(struct uip_conn *conn, const struct sockaddr_in *addr) #endif { - irqstate_t flags; + uip_lock_t flags; int port; /* The connection is expected to be in the UIP_ALLOCATED state.. i.e., @@ -583,9 +583,9 @@ int uip_tcpconnect(struct uip_conn *conn, const struct sockaddr_in *addr) * one now. */ - flags = irqsave(); + flags = uip_lock(); port = uip_selectport(ntohs(conn->lport)); - irqrestore(flags); + uip_unlock(flags); if (port < 0) { @@ -626,9 +626,9 @@ int uip_tcpconnect(struct uip_conn *conn, const struct sockaddr_in *addr) * this operation. */ - flags = irqsave(); + flags = uip_lock(); dq_addlast(&conn->node, &g_active_tcp_connections); - irqrestore(flags); + uip_unlock(flags); return OK; } |