summaryrefslogtreecommitdiff
path: root/nuttx/net/send.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-22 14:42:52 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-22 14:42:52 +0000
commit7d4b2f6253d8ac898def6839b2ccc2ae61e24135 (patch)
tree36587b181e76fc8790f7472f64316c9bb620a31e /nuttx/net/send.c
parent2ad451b8005afc667718569077c816195f8bd9ec (diff)
downloadpx4-nuttx-7d4b2f6253d8ac898def6839b2ccc2ae61e24135.tar.gz
px4-nuttx-7d4b2f6253d8ac898def6839b2ccc2ae61e24135.tar.bz2
px4-nuttx-7d4b2f6253d8ac898def6839b2ccc2ae61e24135.zip
Add TX data notification
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@397 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/send.c')
-rw-r--r--nuttx/net/send.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/nuttx/net/send.c b/nuttx/net/send.c
index c758b8eba..29633b380 100644
--- a/nuttx/net/send.c
+++ b/nuttx/net/send.c
@@ -304,19 +304,23 @@ ssize_t send(int sockfd, const void *buf, size_t len, int flags)
conn->data_private = (void*)&state;
conn->data_event = send_interrupt;
- /* Wait for the send to complete or an error 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 and
- * automatically re-enabled when the task restarts.
- */
+ /* Notify the device driver of the availaibilty of TX data */
- ret = sem_wait(&state. snd_sem);
+ netdev_txnotify(&conn->ripaddr);
- /* Make sure that no further interrupts are processed */
+ /* Wait for the send to complete or an error 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 and
+ * automatically re-enabled when the task restarts.
+ */
- conn->data_private = NULL;
- conn->data_event = NULL;
- }
+ ret = sem_wait(&state. snd_sem);
+
+ /* Make sure that no further interrupts are processed */
+
+ conn->data_private = NULL;
+ conn->data_event = NULL;
+ }
sem_destroy(&state. snd_sem);
irqrestore(save);