diff options
Diffstat (limited to 'nuttx/net/iob/iob_free_qentry.c')
-rw-r--r-- | nuttx/net/iob/iob_free_qentry.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/nuttx/net/iob/iob_free_qentry.c b/nuttx/net/iob/iob_free_qentry.c index 55d4cf848..3f5a517b9 100644 --- a/nuttx/net/iob/iob_free_qentry.c +++ b/nuttx/net/iob/iob_free_qentry.c @@ -39,6 +39,14 @@ #include <nuttx/config.h> +#if defined(CONFIG_DEBUG) && defined(CONFIG_NET_IOB_DEBUG) +/* Force debug output (from this file only) */ + +# undef CONFIG_DEBUG_NET +# define CONFIG_DEBUG_NET 1 +#endif + +#include <semaphore.h> #include <assert.h> #include <nuttx/arch.h> @@ -46,6 +54,8 @@ #include "iob.h" +#if CONFIG_IOB_NCHAINS > 0 + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -70,7 +80,7 @@ * Name: iob_free_qentry * * Description: - * Free the I/O buffer chain container by returning it to the free list. + * Free the I/O buffer chain container by returning it to the free list. * The link to the next I/O buffer in the chain is return. * ****************************************************************************/ @@ -86,11 +96,17 @@ FAR struct iob_qentry_s *iob_free_qentry(FAR struct iob_qentry_s *iobq) */ flags = irqsave(); - iobq->qe_flink = g_iob_freeqlist; + iobq->qe_flink = g_iob_freeqlist; g_iob_freeqlist = iobq; + + /* Signal that an I/O buffer chain container is available */ + + sem_post(&g_qentry_sem); irqrestore(flags); /* And return the I/O buffer chain container after the one that was freed */ return nextq; } + +#endif /* CONFIG_IOB_NCHAINS > 0 */ |