zephyr/include/bluetooth
Johan Hedberg c3e08c8fea net: buf: Redesigned pool & buffer allocation API
Until now it has been necessary to separately define a k_fifo and
an array of buffers when creating net_buf pools. This has been a bit
of an inconvenience as well as blurred the line of what exactly
constitutes the "pool".

This patch removes the NET_BUF_POOL() macro and replaces it with a
NET_BUF_POOL_DEFINE() macro that internally expands into the buffer
array and new net_buf_pool struct with a given name:

	NET_BUF_POOL_DEFINE(pool_name, ...);

Having a dedicated context struct for the pool has the added benefit
that we can start moving there net_buf members that have the same
value for all buffers from the same pool. The first such member that
gets moved is the destroy callback, thus shrinking net_buf by four
bytes. Another potential candidate is the user_data_size, however
right not that's left out since it would just leave 2 bytes of padding
in net_buf (i.e. not influence its size). Another common value is
buf->size, however that one is also used by net_buf_simple and can
therefore not be moved.

This patch also splits getting buffers from a FIFO and allocating a
new buffer from a pool into two separate APIs: net_buf_get and
net_buf_alloc, thus simplifying the APIs and their usage. There is no
separate 'reserve_head' parameter anymore when allocating, rather the
user is expected to call net_buf_reserve() afterwards if something
else than 0 headroom is desired.

Change-Id: Id91b1e5c2be2deb1274dde47f5edebfe29af383a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-13 21:41:53 +00:00
..
a2dp.h Bluetooth: A2DP: Added Connect API 2016-10-04 10:55:04 +00:00
att.h Bluetooth: ATT: Rework buffer pools to minimize extra data 2016-11-01 21:40:39 +02:00
avdtp.h Bluetooth: AVDTP: SEP Definition 2016-12-03 17:09:38 +00:00
bluetooth.h Bluetooth: Fix format specifier in address helpers 2016-12-09 08:18:24 +02:00
buf.h Bluetooth: doc: Fix displacement of HCI buffer description 2016-07-19 07:27:48 +00:00
conn.h Bluetooth: Rename BT_SECURITY_ZERO to BT_SECURITY_NONE 2016-11-01 21:40:39 +02:00
gatt.h Bluetooth: GATT: Fix using out of scope variable 2016-11-18 07:47:50 +02:00
hci_raw.h Bluetooth: Use unified k_fifo API for FIFOs 2016-11-11 07:59:15 +02:00
hci.h Bluetooth: Make LE random address helpers public 2016-12-09 08:18:24 +02:00
hfp_hf.h Bluetooth: HFP HF: Initialize Handsfree profile 2016-09-14 08:45:45 +03:00
l2cap.h Bluetooth: L2CAP: Fix using nano_delayed_work API 2016-11-11 07:59:15 +02:00
log.h Bluetooth: Fix stack overhead amount when debug is enabled 2016-12-09 12:57:37 +00:00
rfcomm.h net: buf: Redesigned pool & buffer allocation API 2016-12-13 21:41:53 +00:00
sdp.h Bluetooth: SDP: Shorten Service Class macro name 2016-10-21 07:47:31 +03:00
storage.h Bluetooth: Add well known keys to storage API for legacy pairing 2016-10-16 09:01:28 +03:00
uuid.h Bluetooth: UUID: Add protocol UUIDs 2016-10-21 07:47:31 +03:00