Browse Source

lib: net_buf: remove deprecated net_buf_put() and net_buf_get() functions

Remove the deprecated net_buf_put() and net_buf_get() functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
pull/87012/head
Henrik Brix Andersen 4 months ago committed by Benjamin Cabé
parent
commit
4d01efbf90
  1. 4
      doc/releases/release-notes-4.0.rst
  2. 33
      include/zephyr/net_buf.h
  3. 29
      lib/net_buf/buf.c

4
doc/releases/release-notes-4.0.rst

@ -105,7 +105,7 @@ Removed APIs in this release @@ -105,7 +105,7 @@ Removed APIs in this release
Deprecated in this release
==========================
* Deprecated the :c:func:`net_buf_put` and :c:func:`net_buf_get` API functions in favor of
* Deprecated the ``net_buf_put()`` and ``net_buf_get()`` API functions in favor of
:c:func:`k_fifo_put` and :c:func:`k_fifo_get`.
* The :ref:`kscan_api` subsystem has been marked as deprecated.
@ -119,8 +119,6 @@ Deprecated in this release @@ -119,8 +119,6 @@ Deprecated in this release
``include/zephyr/net_buf.h>``. The old header will be removed in future releases
and its usage should be avoided.
* Deprecated the :c:func:`net_buf_put` and :c:func:`net_buf_get` API functions.
Architectures
*************

33
include/zephyr/net_buf.h

@ -1423,29 +1423,6 @@ struct net_buf * __must_check net_buf_alloc_with_data(struct net_buf_pool *pool, @@ -1423,29 +1423,6 @@ struct net_buf * __must_check net_buf_alloc_with_data(struct net_buf_pool *pool,
k_timeout_t timeout);
#endif
/**
* @brief Get a buffer from a FIFO.
*
* @deprecated Use @a k_fifo_get() instead.
*
* @param fifo Which FIFO to take the buffer from.
* @param timeout Affects the action taken should the FIFO be empty.
* If K_NO_WAIT, then return immediately. If K_FOREVER, then wait as
* long as necessary. Otherwise, wait until the specified timeout.
*
* @return New buffer or NULL if the FIFO is empty.
*/
#if defined(CONFIG_NET_BUF_LOG)
__deprecated struct net_buf * __must_check net_buf_get_debug(struct k_fifo *fifo,
k_timeout_t timeout,
const char *func, int line);
#define net_buf_get(_fifo, _timeout) \
net_buf_get_debug(_fifo, _timeout, __func__, __LINE__)
#else
__deprecated struct net_buf * __must_check net_buf_get(struct k_fifo *fifo,
k_timeout_t timeout);
#endif
/**
* @brief Destroy buffer from custom destroy callback
*
@ -1505,16 +1482,6 @@ void net_buf_slist_put(sys_slist_t *list, struct net_buf *buf); @@ -1505,16 +1482,6 @@ void net_buf_slist_put(sys_slist_t *list, struct net_buf *buf);
*/
struct net_buf * __must_check net_buf_slist_get(sys_slist_t *list);
/**
* @brief Put a buffer to the end of a FIFO.
*
* @deprecated Use @a k_fifo_put() instead.
*
* @param fifo Which FIFO to put the buffer to.
* @param buf Buffer.
*/
__deprecated void net_buf_put(struct k_fifo *fifo, struct net_buf *buf);
/**
* @brief Decrements the reference count of a buffer.
*

29
lib/net_buf/buf.c

@ -388,27 +388,6 @@ struct net_buf *net_buf_alloc_with_data(struct net_buf_pool *pool, @@ -388,27 +388,6 @@ struct net_buf *net_buf_alloc_with_data(struct net_buf_pool *pool,
return buf;
}
#if defined(CONFIG_NET_BUF_LOG)
struct net_buf *net_buf_get_debug(struct k_fifo *fifo, k_timeout_t timeout,
const char *func, int line)
#else
struct net_buf *net_buf_get(struct k_fifo *fifo, k_timeout_t timeout)
#endif
{
struct net_buf *buf;
NET_BUF_DBG("%s():%d: fifo %p", func, line, fifo);
buf = k_fifo_get(fifo, timeout);
if (!buf) {
return NULL;
}
NET_BUF_DBG("%s():%d: buf %p fifo %p", func, line, buf, fifo);
return buf;
}
static struct k_spinlock net_buf_slist_lock;
void net_buf_slist_put(sys_slist_t *list, struct net_buf *buf)
@ -439,14 +418,6 @@ struct net_buf *net_buf_slist_get(sys_slist_t *list) @@ -439,14 +418,6 @@ struct net_buf *net_buf_slist_get(sys_slist_t *list)
return buf;
}
void net_buf_put(struct k_fifo *fifo, struct net_buf *buf)
{
__ASSERT_NO_MSG(fifo);
__ASSERT_NO_MSG(buf);
k_fifo_put(fifo, buf);
}
#if defined(CONFIG_NET_BUF_LOG)
void net_buf_unref_debug(struct net_buf *buf, const char *func, int line)
#else

Loading…
Cancel
Save