zephyr/samples/net
Joakim Andersson 6483e12a8a Bluetooth: Refactor bluetooth buffer configuration for simplification
Refactor and simplify the bluetooth buffer configurations to improve the
easy of configurations and eliminate invalid ones.
By moving configurations out of host and controller specific
configurations and into a common one it becomes easier to configure
the host and controller separately as the same configurations can be
used as would be for a combined build.

All HCI configurations are now given exluding the matching HCI header,
which eases the configuration as the application don't have to know the
different header sizes.
The BT_RX_BUF_LEN is split into ACL and Event, as well as the suprising
use of Command size.
BT_L2CAP_RX_MTU is removed as the stack does not support reassembling of
HCI ACL data to larger L2CAP PDUs. The application will have to set
ACL RX size and account for the L2CAP PDU header itself.
BT_EATT_RX_MTU was removed as it is only used for setting a different
default value for another option which leads to the stuck kconfig symbol
problem.

The configurations can be updated according to the table below:

** New configuration         | ** Old configuration
All configurations
BT_BUF_ACL_RX_SIZE           | BT_L2CAP_RX_MTU + 4
BT_BUF_ACL_RX_SIZE           | BT_RX_BUF_LEN - 4
BT_BUF_EVT_RX_SIZE           | BT_RX_BUF_LEN - 2
BT_BUF_CMD_TX_SIZE           | BT_RX_BUF_LEN - 3
BT_BUF_CMD_TX_COUNT          | BT_HCI_CMD_COUNT
BT_BUF_EVT_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_ACL_RX_COUNT
BT_BUF_EVT_DISCARDABLE_SIZE  | BT_DISCARDABLE_BUF_SIZE - 2
BT_BUF_EVT_DISCARDABLE_COUNT | BT_DISCARDABLE_BUF_COUNT
Controller-build
BT_BUF_ACL_TX_SIZE           | BT_CTLR_TX_BUFFERS_SIZE
BT_BUF_ACL_TX_COUNT          | BT_CTLR_TX_BUFFER
HCI-bridge
BT_BUF_ACL_TX_SIZE           | BT_HCI_ACL_DATA_SIZE
BT_BUF_ACL_TX_COUNT          | 6

Fixed invalid configurations setting either BT_L2CAP_RX_MTU or
BT_CTLR_DATA_LENGTH_MAX larger than BT_RX_BUF_LEN could lead to buffer
overruns.

Fix advertising report max data length calculation.
This always used the BT_DISCARDABLE_BUF_SIZE macro but this feature
can be turned off and advertising reports will be allocated from the RX
buffer in that case. Also controller-build does not have this buffer
(in hci_raw.c). Also the wrong HCI header was used in the calculation,
HCI event header should have been used instead of HCI ACL header.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-06 14:56:18 +02:00
..
capture samples: net: capture: Network packet capture app 2021-04-02 07:24:06 -04:00
civetweb samples: civetweb: websocket_server: Fix build issue 2021-04-17 07:47:42 -04:00
cloud arm: nxp: kinetis: Remove explicity setting of pincfg to GPIO 2021-04-15 12:25:05 +02:00
common license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
dhcpv4_client zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
dns_resolve net: Conversion of k_work API 2021-04-14 07:07:40 -04:00
dsa dsa: config: sample: Add SHELL support via RTT to DSA sample's prj.conf 2021-01-20 10:03:42 +02:00
eth_native_posix sanitycheck: inclusive language 2020-08-27 07:04:07 -04:00
gptp net: Conversion of k_work API 2021-04-14 07:07:40 -04:00
gsm_modem samples: net: gsm: Add suspend/resume shell commands 2020-10-21 00:08:39 +03:00
ipv4_autoconf sanitycheck: inclusive language 2020-08-27 07:04:07 -04:00
lldp samples: net: Fix vlan error message in samples 2021-01-07 09:52:21 -06:00
lwm2m_client Bluetooth: Refactor bluetooth buffer configuration for simplification 2021-05-06 14:56:18 +02:00
mdns_responder samples: net: mdns_responder: Fix coverity resource leak issue 2021-03-09 13:10:48 +02:00
mqtt_publisher samples/net/mqtt_publisher: undefined reference to z_impl_sys_rand32_get 2021-01-20 13:20:54 +02:00
openthread/coprocessor samples: openthread: Add test configuration for coprocessor sample 2021-04-30 12:58:31 -05:00
promiscuous_mode zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
sockets samples: net: socket: txtime: Simple app for SO_TXTIME 2021-04-27 12:02:19 +03:00
stats net: Conversion of k_work API 2021-04-14 07:07:40 -04:00
syslog_net samples: net: syslog: remove case without newlib 2021-04-22 07:42:58 -04:00
telnet zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
virtual samples: net: virtual: remove usage of device_pm_control_nop 2021-04-28 20:40:00 -04:00
vlan samples: make find_package(Zephyr...) REQUIRED 2020-05-29 10:47:25 +02:00
wifi drivers: spi: Remove unused Kconfig symbols 2021-03-09 04:53:46 -05:00
wpan_serial coccinelle: Remove extra semicolon 2021-03-25 11:35:30 -05:00
wpanusb samples: net: Adjust the thread priorities 2020-11-20 12:57:29 +02:00
zperf clock: renmae z_timeout_end_calc -> sys_clock_timeout_end_calc 2021-03-19 11:22:17 -04:00
net.rst doc: add labels to net sample docs for linking 2017-04-04 19:52:06 +00:00