summaryrefslogtreecommitdiff
path: root/nuttx/net/iob/iob_alloc.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-06-03 14:28:16 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-06-03 14:28:16 -0600
commit5b5247ff8e66897bbb42f36490676ddcebb48c3a (patch)
tree7b5da0acf3a2094d144ecadb16f01bac902585ef /nuttx/net/iob/iob_alloc.c
parentc6098e91372476fa93e89d96345a06611ea1b9c2 (diff)
downloadpx4-nuttx-5b5247ff8e66897bbb42f36490676ddcebb48c3a.tar.gz
px4-nuttx-5b5247ff8e66897bbb42f36490676ddcebb48c3a.tar.bz2
px4-nuttx-5b5247ff8e66897bbb42f36490676ddcebb48c3a.zip
Add iob_copyin()
Diffstat (limited to 'nuttx/net/iob/iob_alloc.c')
-rw-r--r--nuttx/net/iob/iob_alloc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/nuttx/net/iob/iob_alloc.c b/nuttx/net/iob/iob_alloc.c
index c2c060d84..390883c83 100644
--- a/nuttx/net/iob/iob_alloc.c
+++ b/nuttx/net/iob/iob_alloc.c
@@ -75,5 +75,18 @@
FAR struct iob_s *iob_alloc(void)
{
- return (FAR struct iob_s *)sq_remfirst(&g_iob_freelist);
+ FAR struct iob_s *iob;
+
+ iob = (FAR struct iob_s *)sq_remfirst(&g_iob_freelist);
+ if (iob)
+ {
+ iob->io_link.flink = NULL; /* Not in a list */
+ iob->io_flags = 0; /* Flags associated with the I/O buffer */
+ iob->io_len = 0; /* Length of the data in the entry */
+ iob->io_pktlen = 0; /* Total length of the packet */
+ iob->io_vtag = 0; /* VLAN tag */
+ iob->io_priv = NULL; /* User private data attached to the I/O buffer */
+ }
+
+ return iob;
}