From 7d4b2f6253d8ac898def6839b2ccc2ae61e24135 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 22 Nov 2007 14:42:52 +0000 Subject: Add TX data notification git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@397 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/net/send.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'nuttx/net/send.c') 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); -- cgit v1.2.3