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/sendto.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/sendto.c')
-rw-r--r-- | nuttx/net/sendto.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index 89f478810..8e2bf29b2 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/sendto.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -233,7 +233,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, FAR const struct sockaddr_in *into = (const struct sockaddr_in *)to; #endif struct sendto_s state; - irqstate_t save; + uip_lock_t save; int ret; #endif int err; @@ -294,7 +294,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, * are ready. */ - save = irqsave(); + save = uip_lock(); memset(&state, 0, sizeof(struct sendto_s)); sem_init(&state.st_sem, 0, 0); state.st_buflen = len; @@ -306,7 +306,7 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, ret = uip_udpconnect(conn, into); if (ret < 0) { - irqrestore(save); + uip_unlock(save); err = -ret; goto errout; } @@ -329,19 +329,19 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, netdev_txnotify(&conn->ripaddr); /* Wait for either the receive to complete or for an error/timeout to occur. - * NOTES: (1) sem_wait will also terminate if a signal is received, (2) - * interrupts are disabled! They will be re-enabled while the task sleeps + * NOTES: (1) uip_lockedwait 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. */ - sem_wait(&state.st_sem); + uip_lockedwait(&state.st_sem); /* Make sure that no further interrupts are processed */ uip_udpdisable(conn); uip_udpcallbackfree(conn, state.st_cb); } - irqrestore(save); + uip_unlock(save); sem_destroy(&state.st_sem); |