wireless/bluetooth and net/bluetooth: Clean up some garbage left in Kconfig file that broke 'make menuconfig'. Clean up some craziness with Bluetooth frame length definitions.

This commit is contained in:
Gregory Nutt
2018-04-01 15:21:58 -06:00
parent 7e05d5e9c7
commit aae0d92598
11 changed files with 44 additions and 100 deletions
-12
View File
@@ -96,18 +96,6 @@ config BLUETOOTH_MAXSCANRESULT
This contributes to a static memory allocation that will be greater
than CONFIG_BLUETOOTH_MAXSCANDATA * CONFIG_BLUETOOTH_MAXSCANRESULT
#if !defined(CONFIG_BLUETOOTH_BUFFER_PREALLOC) || \
CONFIG_BLUETOOTH_BUFFER_PREALLOC < 0
# undef CONFIG_BLUETOOTH_BUFFER_PREALLOC
# define CONFIG_BLUETOOTH_BUFFER_PREALLOC 20
#endif
#if !defined(CONFIG_) || \
CONFIG_BLUETOOTH_BUFFER_IRQRESERVE < 0
# undef CONFIG_BLUETOOTH_BUFFER_IRQRESERVE
# define CONFIG_BLUETOOTH_BUFFER_IRQRESERVE 0
#endif
config BLUETOOTH_BUFFER_PREALLOC
int "Number of pre-allocated buffer structures"
default 20
+4 -3
View File
@@ -50,6 +50,7 @@
#include <errno.h>
#include <debug.h>
#include <nuttx/net/bluetooth.h>
#include <nuttx/wireless/bt_hci.h>
#include <nuttx/wireless/bt_core.h>
#include <nuttx/wireless/bt_uuid.h>
@@ -559,9 +560,9 @@ static uint8_t att_mtu_rsp(FAR struct bt_conn_s *conn, FAR struct bt_buf_s *buf)
* L2CAP, ACL and driver headers.
*/
maxmtu = BT_BUF_MAX_DATA - (sizeof(struct bt_l2cap_hdr_s) +
sizeof(struct bt_hci_acl_hdr_s) +
g_btdev.dev->head_reserve);
maxmtu = BLUETOOTH_MAX_FRAMELEN - (sizeof(struct bt_l2cap_hdr_s) +
sizeof(struct bt_hci_acl_hdr_s) +
g_btdev.dev->head_reserve);
if (mtu > maxmtu)
{
mtu = maxmtu;
+2 -1
View File
@@ -53,6 +53,7 @@
#include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include <nuttx/mm/iob.h>
#include <nuttx/net/bluetooth.h>
#include <nuttx/wireless/bt_hci.h>
#include <nuttx/wireless/bt_core.h>
#include <nuttx/wireless/bt_buf.h>
@@ -641,5 +642,5 @@ size_t bt_buf_headroom(FAR struct bt_buf_s *buf)
size_t bt_buf_tailroom(FAR struct bt_buf_s * buf)
{
return BT_BUF_MAX_DATA - bt_buf_headroom(buf) - buf->len;
return BLUETOOTH_MAX_FRAMELEN - bt_buf_headroom(buf) - buf->len;
}
+2 -1
View File
@@ -54,6 +54,7 @@
#include <nuttx/kthread.h>
#include <nuttx/semaphore.h>
#include <nuttx/net/bluetooth.h>
#include <nuttx/wireless/bt_core.h>
#include <nuttx/wireless/bt_hci.h>
@@ -1102,7 +1103,7 @@ static int hci_init(void)
hbs = bt_buf_extend(buf, sizeof(*hbs));
memset(hbs, 0, sizeof(*hbs));
hbs->acl_mtu = BT_HOST2LE16(BT_BUF_MAX_DATA -
hbs->acl_mtu = BT_HOST2LE16(BLUETOOTH_MAX_FRAMELEN -
sizeof(struct bt_hci_acl_hdr_s) -
g_btdev.dev->head_reserve);
hbs->acl_pkts = BT_HOST2LE16(CONFIG_BLUETOOTH_RXTHREAD_NMSGS);
+7 -24
View File
@@ -85,10 +85,8 @@
/* Frame size */
#if defined(CONFIG_NET_BLUETOOTH_FRAMELEN)
# define MACNET_FRAMELEN CONFIG_NET_BLUETOOTH_FRAMELEN
#else
# define MACNET_FRAMELEN BLUETOOTH_MAX_PHY_PACKET_SIZE
#if BLUETOOTH_MAX_FRAMELEN > CONFIG_IOB_BUFSIZE
# error CONFIG_IOB_BUFSIZE to small for max Bluetooth frame
#endif
/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per second */
@@ -861,7 +859,7 @@ static int btnet_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
static int btnet_get_mhrlen(FAR struct radio_driver_s *netdev,
FAR const void *meta)
{
return sizeof(struct bt_l2cap_hdr_s);
return BLUETOOTH_FRAME_HDRLEN;
}
/****************************************************************************
@@ -919,7 +917,7 @@ static int btnet_req_data(FAR struct radio_driver_s *netdev,
/* Allocate a buffer to contain the IOB */
buf = bt_buf_alloc(BT_ACL_OUT, iob, sizeof(struct bt_l2cap_hdr_s));
buf = bt_buf_alloc(BT_ACL_OUT, iob, BLUETOOTH_FRAME_HDRLEN);
if (buf == NULL)
{
wlerr("ERROR: Failed to allocate buffer container\n");
@@ -962,25 +960,10 @@ static int btnet_properties(FAR struct radio_driver_s *netdev,
/* General */
properties->sp_addrlen = BLUETOOTH_ADDRSIZE; /* Length of an address */
properties->sp_framelen = MACNET_FRAMELEN; /* Fixed frame length */
properties->sp_addrlen = BLUETOOTH_ADDRSIZE; /* Length of an address */
properties->sp_framelen = BLUETOOTH_MAX_FRAMELEN; /* Fixed frame length */
/* Multicast address -- not supported */
properties->sp_mcast.nv_addrlen = BLUETOOTH_ADDRSIZE;
memset(properties->sp_mcast.nv_addr, 0xff, RADIO_MAX_ADDRLEN);
/* Broadcast address -- not supported */
properties->sp_bcast.nv_addrlen = BLUETOOTH_ADDRSIZE;
memset(properties->sp_mcast.nv_addr, 0xff, RADIO_MAX_ADDRLEN);
#ifdef CONFIG_NET_STARPOINT
/* Star hub node address -- not supported. */
properties->sp_hubnode.nv_addrlen = BLUETOOTH_ADDRSIZE;
memset(properties->sp_hubnode.nv_addr, RADIO_MAX_ADDRLEN);
#endif
/* Multicast, multicast, and star hub node addresses not supported */
return OK;
}