Bluetooth: Remove usage of BT_BUF_USER_DATA_MIN
This define is not of use anymore since there's a global net_buf user data Kconfig variable and its definition already guarantees a sufficient minimum for Bluetooth. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
be71e68fcb
commit
39291fbbbe
13 changed files with 39 additions and 46 deletions
|
@ -130,8 +130,8 @@ static struct k_thread tx_thread_data;
|
|||
|
||||
/* HCI command buffers */
|
||||
#define CMD_BUF_SIZE BT_BUF_RX_SIZE
|
||||
NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
||||
NULL);
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_TX_BUFFER_SIZE)
|
||||
#define BT_L2CAP_MTU (CONFIG_BT_CTLR_TX_BUFFER_SIZE - BT_L2CAP_HDR_SIZE)
|
||||
|
@ -148,8 +148,7 @@ NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
|||
#define TX_BUF_COUNT 6
|
||||
#endif
|
||||
|
||||
NET_BUF_POOL_DEFINE(acl_tx_pool, TX_BUF_COUNT, BT_BUF_ACL_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(acl_tx_pool, TX_BUF_COUNT, BT_BUF_ACL_SIZE, NULL);
|
||||
|
||||
static K_FIFO_DEFINE(tx_queue);
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ const static struct spi_buf_set tx_bufs = {
|
|||
/* HCI buffer pools */
|
||||
#define CMD_BUF_SIZE BT_BUF_RX_SIZE
|
||||
|
||||
NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
||||
NULL);
|
||||
|
||||
#if defined(CONFIG_BT_CTLR)
|
||||
#define BT_L2CAP_MTU (CONFIG_BT_CTLR_TX_BUFFER_SIZE - \
|
||||
|
@ -89,8 +89,7 @@ NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
|||
#define TX_BUF_COUNT 6
|
||||
#endif
|
||||
|
||||
NET_BUF_POOL_DEFINE(acl_tx_pool, TX_BUF_COUNT, BT_BUF_ACL_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(acl_tx_pool, TX_BUF_COUNT, BT_BUF_ACL_SIZE, NULL);
|
||||
|
||||
static struct device *spi_hci_dev;
|
||||
static struct spi_config spi_cfg = {
|
||||
|
|
|
@ -36,8 +36,8 @@ static struct k_thread tx_thread_data;
|
|||
|
||||
/* HCI command buffers */
|
||||
#define CMD_BUF_SIZE BT_BUF_RX_SIZE
|
||||
NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
||||
NULL);
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_TX_BUFFER_SIZE)
|
||||
#define BT_L2CAP_MTU (CONFIG_BT_CTLR_TX_BUFFER_SIZE - BT_L2CAP_HDR_SIZE)
|
||||
|
@ -54,8 +54,7 @@ NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BT_HCI_CMD_COUNT, CMD_BUF_SIZE,
|
|||
#define TX_BUF_COUNT 6
|
||||
#endif
|
||||
|
||||
NET_BUF_POOL_DEFINE(acl_tx_pool, TX_BUF_COUNT, BT_BUF_ACL_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(acl_tx_pool, TX_BUF_COUNT, BT_BUF_ACL_SIZE, NULL);
|
||||
|
||||
static K_FIFO_DEFINE(tx_queue);
|
||||
|
||||
|
|
|
@ -35,9 +35,15 @@
|
|||
#include "att_internal.h"
|
||||
#include "gatt_internal.h"
|
||||
|
||||
struct tx_meta {
|
||||
struct bt_conn_tx *tx;
|
||||
};
|
||||
|
||||
#define tx_data(buf) ((struct tx_meta *)net_buf_user_data(buf))
|
||||
|
||||
NET_BUF_POOL_DEFINE(acl_tx_pool, CONFIG_BT_L2CAP_TX_BUF_COUNT,
|
||||
BT_L2CAP_BUF_SIZE(CONFIG_BT_L2CAP_TX_MTU),
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
sizeof(struct tx_meta), NULL);
|
||||
|
||||
#if CONFIG_BT_L2CAP_TX_FRAG_COUNT > 0
|
||||
|
||||
|
@ -68,12 +74,6 @@ const struct bt_conn_auth_cb *bt_auth;
|
|||
static struct bt_conn conns[CONFIG_BT_MAX_CONN];
|
||||
static struct bt_conn_cb *callback_list;
|
||||
|
||||
struct tx_meta {
|
||||
struct bt_conn_tx *tx;
|
||||
};
|
||||
|
||||
#define tx_data(buf) ((struct tx_meta *)net_buf_user_data(buf))
|
||||
|
||||
static struct bt_conn_tx conn_tx[CONFIG_BT_CONN_TX_MAX];
|
||||
K_FIFO_DEFINE(free_tx);
|
||||
|
||||
|
|
|
@ -148,11 +148,11 @@ static struct cmd_data cmd_data[CONFIG_BT_HCI_CMD_COUNT];
|
|||
* the same buffer is also used for the response.
|
||||
*/
|
||||
#define CMD_BUF_SIZE BT_BUF_RX_SIZE
|
||||
NET_BUF_POOL_DEFINE(hci_cmd_pool, CONFIG_BT_HCI_CMD_COUNT,
|
||||
CMD_BUF_SIZE, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(hci_cmd_pool, CONFIG_BT_HCI_CMD_COUNT,
|
||||
CMD_BUF_SIZE, NULL);
|
||||
|
||||
NET_BUF_POOL_DEFINE(hci_rx_pool, CONFIG_BT_RX_BUF_COUNT,
|
||||
BT_BUF_RX_SIZE, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, CONFIG_BT_RX_BUF_COUNT,
|
||||
BT_BUF_RX_SIZE, NULL);
|
||||
|
||||
#if defined(CONFIG_BT_CONN)
|
||||
/* Dedicated pool for HCI_Number_of_Completed_Packets. This event is always
|
||||
|
@ -160,13 +160,12 @@ NET_BUF_POOL_DEFINE(hci_rx_pool, CONFIG_BT_RX_BUF_COUNT,
|
|||
* Having a dedicated pool for it ensures that exhaustion of the RX pool
|
||||
* cannot block the delivery of this priority event.
|
||||
*/
|
||||
NET_BUF_POOL_DEFINE(num_complete_pool, 1, BT_BUF_RX_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(num_complete_pool, 1, BT_BUF_RX_SIZE, NULL);
|
||||
#endif /* CONFIG_BT_CONN */
|
||||
|
||||
#if defined(CONFIG_BT_DISCARDABLE_BUF_COUNT)
|
||||
NET_BUF_POOL_DEFINE(discardable_pool, CONFIG_BT_DISCARDABLE_BUF_COUNT,
|
||||
BT_BUF_RX_SIZE, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(discardable_pool, CONFIG_BT_DISCARDABLE_BUF_COUNT,
|
||||
BT_BUF_RX_SIZE, NULL);
|
||||
#endif /* CONFIG_BT_DISCARDABLE_BUF_COUNT */
|
||||
|
||||
struct event_handler {
|
||||
|
@ -270,7 +269,7 @@ static void report_completed_packet(struct net_buf *buf)
|
|||
|
||||
#define ACL_IN_SIZE BT_L2CAP_BUF_SIZE(CONFIG_BT_L2CAP_RX_MTU)
|
||||
NET_BUF_POOL_DEFINE(acl_in_pool, CONFIG_BT_ACL_RX_COUNT, ACL_IN_SIZE,
|
||||
BT_BUF_USER_DATA_MIN, report_completed_packet);
|
||||
sizeof(struct acl_data), report_completed_packet);
|
||||
#endif /* CONFIG_BT_HCI_ACL_FLOW_CONTROL */
|
||||
|
||||
struct net_buf *bt_hci_cmd_create(u16_t opcode, u8_t param_len)
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
static struct k_fifo *raw_rx;
|
||||
|
||||
NET_BUF_POOL_DEFINE(hci_rx_pool, CONFIG_BT_RX_BUF_COUNT,
|
||||
BT_BUF_RX_SIZE, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, CONFIG_BT_RX_BUF_COUNT,
|
||||
BT_BUF_RX_SIZE, NULL);
|
||||
|
||||
struct bt_dev_raw bt_dev;
|
||||
|
||||
|
|
|
@ -32,9 +32,8 @@
|
|||
|
||||
struct bt_hfp_hf_cb *bt_hf;
|
||||
|
||||
NET_BUF_POOL_DEFINE(hf_pool, CONFIG_BT_MAX_CONN + 1,
|
||||
BT_RFCOMM_BUF_SIZE(BT_HF_CLIENT_MAX_PDU),
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(hf_pool, CONFIG_BT_MAX_CONN + 1,
|
||||
BT_RFCOMM_BUF_SIZE(BT_HF_CLIENT_MAX_PDU), NULL);
|
||||
|
||||
static struct bt_hfp_hf bt_hfp_hf_pool[CONFIG_BT_MAX_CONN];
|
||||
|
||||
|
|
|
@ -81,9 +81,8 @@ static sys_slist_t br_servers;
|
|||
|
||||
|
||||
/* Pool for outgoing BR/EDR signaling packets, min MTU is 48 */
|
||||
NET_BUF_POOL_DEFINE(br_sig_pool, CONFIG_BT_MAX_CONN,
|
||||
BT_L2CAP_BUF_SIZE(L2CAP_BR_MIN_MTU),
|
||||
BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(br_sig_pool, CONFIG_BT_MAX_CONN,
|
||||
BT_L2CAP_BUF_SIZE(L2CAP_BR_MIN_MTU), NULL);
|
||||
|
||||
/* BR/EDR L2CAP signalling channel specific context */
|
||||
struct bt_l2cap_br {
|
||||
|
|
|
@ -68,8 +68,8 @@ static u8_t num_services;
|
|||
static struct bt_sdp bt_sdp_pool[CONFIG_BT_MAX_CONN];
|
||||
|
||||
/* Pool for outgoing SDP packets */
|
||||
NET_BUF_POOL_DEFINE(sdp_pool, CONFIG_BT_MAX_CONN,
|
||||
BT_L2CAP_BUF_SIZE(SDP_MTU), BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(sdp_pool, CONFIG_BT_MAX_CONN,
|
||||
BT_L2CAP_BUF_SIZE(SDP_MTU), NULL);
|
||||
|
||||
#define SDP_CLIENT_CHAN(_ch) CONTAINER_OF(_ch, struct bt_sdp_client, chan.chan)
|
||||
|
||||
|
|
|
@ -38,12 +38,11 @@ static struct bt_conn *pairing_conn;
|
|||
|
||||
#define DATA_BREDR_MTU 48
|
||||
|
||||
NET_BUF_POOL_DEFINE(data_pool, 1, DATA_BREDR_MTU, BT_BUF_USER_DATA_MIN,
|
||||
NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(data_pool, 1, DATA_BREDR_MTU, NULL);
|
||||
|
||||
#define SDP_CLIENT_USER_BUF_LEN 512
|
||||
NET_BUF_POOL_DEFINE(sdp_client_pool, CONFIG_BT_MAX_CONN,
|
||||
SDP_CLIENT_USER_BUF_LEN, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(sdp_client_pool, CONFIG_BT_MAX_CONN,
|
||||
SDP_CLIENT_USER_BUF_LEN, NULL);
|
||||
|
||||
static int cmd_auth_pincode(const struct shell *shell,
|
||||
size_t argc, char *argv[])
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
#define L2CAP_POLICY_WHITELIST 0x01
|
||||
#define L2CAP_POLICY_16BYTE_KEY 0x02
|
||||
|
||||
NET_BUF_POOL_DEFINE(data_tx_pool, 1, DATA_MTU, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_DEFINE(data_rx_pool, 1, DATA_MTU, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(data_tx_pool, 1, DATA_MTU, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(data_rx_pool, 1, DATA_MTU, NULL);
|
||||
|
||||
static u8_t l2cap_policy;
|
||||
static struct bt_conn *l2cap_whitelist[CONFIG_BT_MAX_CONN];
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#define DATA_MTU 48
|
||||
|
||||
NET_BUF_POOL_DEFINE(pool, 1, DATA_MTU, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(pool, 1, DATA_MTU, NULL);
|
||||
|
||||
static struct bt_sdp_attribute spp_attrs[] = {
|
||||
BT_SDP_NEW_SERVICE,
|
||||
|
|
|
@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
|||
#define CHANNELS 2
|
||||
#define SERVERS 1
|
||||
|
||||
NET_BUF_POOL_DEFINE(data_pool, 1, DATA_MTU, BT_BUF_USER_DATA_MIN, NULL);
|
||||
NET_BUF_POOL_FIXED_DEFINE(data_pool, 1, DATA_MTU, NULL);
|
||||
|
||||
static struct channel {
|
||||
u8_t chan_id; /* Internal number that identifies L2CAP channel. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue