diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-10-21 16:11:36 +0300 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2016-10-26 12:48:47 +0000 |
commit | 76240677d95b88ffe1f3f19f5b4d76adca7d394f (patch) | |
tree | 3408d718bcbcbe221df77396e6fad364cf4e9532 /include | |
parent | b86d19d1bd7fd8430379dcb99a6ef43d948272ef (diff) |
net: buf: Make net_buf_frag_add take ownership of the buffer
This simplify buffer handling so that no extra references are needed.
Change-Id: Id99a0a75b39ca8db2216668f76c5a672713075ae
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/buf.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/buf.h b/include/net/buf.h index c39b57613..097626579 100644 --- a/include/net/buf.h +++ b/include/net/buf.h @@ -847,6 +847,11 @@ struct net_buf *net_buf_frag_last(struct net_buf *frags); /** @brief Insert a new fragment to a chain of bufs. * + * Insert a new fragment into the buffer fragments list after the parent. + * + * Note: This function takes ownership of the fragment reference so the + * caller is not required to unref. + * * @param parent Parent buffer/fragment. * @param frag Fragment to insert. */ @@ -854,6 +859,11 @@ void net_buf_frag_insert(struct net_buf *parent, struct net_buf *frag); /** @brief Add a new fragment to the end of a chain of bufs. * + * Append a new fragment into the buffer fragments list. + * + * Note: This function takes ownership of the fragment reference so the + * caller is not required to unref. + * * @param head Head of the fragment chain. * @param frag Fragment to add. * |