Commit graph

21541 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
bee6aa325b Bluetooth: controller: Increased thread context operation queue count
When ticker job is disabled inside radio events then all
advertising, scanning, and slave latency cancel ticker
operations will be deferred, requiring increased ticker
thread context operation queue count.

Relates to #32430.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-23 13:01:20 +01:00
Vinayak Kariappa Chettimada
03ea3463c9 Bluetooth: controller: Facilitate reuse of BT_CTLR_MAX_CONNECTABLE
Minor rearrange order of definition BT_CTLR_MAX_CONNECTABLE
to better reuse it.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-23 13:01:20 +01:00
Vinayak Kariappa Chettimada
73308a3333 Bluetooth: controller: Consistent use of internal BT_CTLR_ADV_SET
Consistently use the internal BT_CTLR_ADV_SET value in the
controller's implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-23 13:01:20 +01:00
Piotr Pryga
1785129a3d Bluetooth: controller: pdu: Add offset_adjust filed to pdu_adv_sync_info
Add missing offset_adjust filed to pdu_adv_sync_info.
Add handling of the field when sync_info is added to advertising PDU.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-23 12:37:06 +01:00
Eduardo Montoya
beed76247f net: openthread: style adjustments in radio.c
Avoid splitting lines when possible while keeping length below 100
chars. Some other minor style corrections.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-02-23 11:30:25 +01:00
Eduardo Montoya
2e8836f076 net: openthread: separated variable for rx/tx operations results
The use of a single error variable for RX and TX operations has
shown the OpenThread code to be asserting in some conditions.

This commit splits tx_rx_result into rx_result and tx_result
to avoid such cases.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-02-23 11:30:25 +01:00
Jukka Rissanen
157c11d6e7 net: context: Check interface status when sending
If the network interface is down when trying to send a message,
return -ENETDOWN as we cannot send a message in this case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-02-23 11:30:08 +01:00
Vinayak Kariappa Chettimada
ca220e4a9d Bluetooth: controller: Fix tertiary PDU and extended header length
Fix the tertiary PDU and extended header length value after
the refactoring in the commit c8475b9a3e ("Bluetooth:
controller: ULL: enable TX of CTE with per. adv. PDU").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-23 10:22:21 +01:00
Reto Schneider
545fb92fc1 net: pkt: Fix headroom edge case
This commit fixes some edge cases when using net_bufs with reserved
bytes (headroom) as fragments of a net_pkt.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2021-02-22 19:33:16 +02:00
Reto Schneider
1919766d7b net: buf: Simplify querying maximum len
net_buf_max_len() provides the maximum number of bytes which can be put
behind the data pointer. This provides a save alternative to using the
size field of the net_buf structure directly, which does not take the
reserved bytes (headroom) into account.

This commit also replaces the usage of the size field in places where
size got used directly. Code has not been adjusted when it is easy to
recognise that the buffer does not have any reserved bytes, which is the
case after allocation or reset. Same goes for the faulty usage by
net_pkt as exposed by the last commit and begin fixed by a separate
commit.

Even though it would be cleaner, I decided to not rename the size field
to e.g. __buf_size in order to keep the amount of code changes low.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2021-02-22 19:33:16 +02:00
Dan Kalowsky
305ba26c6e subsys/shell: check for shell context before accessing it
The ASSERT order is backwards, where the shell->ctx is being accessed
before it is being checked as valid.  Moving the check for the
shell->ctx to before the using it.

Signed-off-by: Dan Kalowsky <dkalowsky@amperecomputing.com>
2021-02-22 15:20:37 +01:00
Peter Bigot
1fa3447b4e shell: device_service: refine level output
Fix the order so that it reflects the actual initialization order,
rather than putting PRE_KERNEL initializations after APPLICATION.

Add SMP in the proper location.

Use the helper function to provide unique identifiers for "devices"
that don't have a device pointer (so don't have a name).

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-19 15:46:16 -05:00
Peter Bigot
f0df72c269 shell: device_service: add dependency information
Refactor the output of device list to use standard API to retrieve the
list of devices, and to always display a status rather than hiding
disabled/failed devices.

Add API to associate a distinct identifier with any "device" that does
not have a name.

Where a device has requires dependencies display the devices on which
it depends.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-19 15:46:16 -05:00
Johann Fischer
9a3ebcccfa usb: hid: make config USB_DEVICE_HID menuconfig
This makes USB device support menu appear more tidy.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Johann Fischer
dac91c0bdc usb: move USB Loopback class configuration to its own Kconfig
Move USB Loopback class configuration to its own Kconfig

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Johann Fischer
092a9de285 usb: move USB Bluetooth classes configuration to its own Kconfig
Move USB Bluetooth classes configuration to its own Kconfig.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Johann Fischer
12e32c2b70 usb: move USB MSC configuration to its own Kconfig file
Move USB MSC configuration to its own Kconfig file.

Align with other class designations and rename
mass_storage.c to msc.c

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Johann Fischer
2feee774bb usb: move CDC ACM configuration to to its own Kconfig file
Move CDC ACM configuration to to its own Kconfig file.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-19 14:39:26 -05:00
Wolfgang Puffitsch
1a7157d316 Bluetooth: controller: Add missing compilation guard
Add missing compilation guard for initialization of "force" flag in
ull_slave.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-02-19 07:32:01 -05:00
Vinayak Kariappa Chettimada
8e75fff580 Bluetooth: controller: Move auto variables closer to local reference
Move auto variables closer to their locality of reference.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-19 10:29:10 +01:00
Vinayak Kariappa Chettimada
69869d1834 Bluetooth: controller: Move ull_adv_sync_pdu_set_clear
Move ull_adv_sync_pdu_set_clear function after LL interface
functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-19 10:28:55 +01:00
Vinayak Kariappa Chettimada
b230d23938 Bluetooth: controller: Rename pdu_biginfo to pdu_big_info
Rename struct pdu_biginfo to struct pdu_big_info.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-19 10:28:41 +01:00
Vinayak Kariappa Chettimada
4b4267fa09 Bluetooth: controller: Rearrange LL interface functions
Rearrange the LL interface functions in the ll.h file to
group functions use by HCI separate from other buffer and
control flow related functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-19 10:28:11 +01:00
Vinayak Kariappa Chettimada
cba60c56bd Bluetooth: controller: Minor rearrange LLL Adv structures
Minor refactoring/rearranging of LLL adv structures.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-19 10:27:48 +01:00
Vinayak Kariappa Chettimada
9527c04c60 Bluetooth: controller: Move version define to ll_feat.h file
Move the controller version define into ll_feat.h file to
keep the version number and featureset bitmaps together.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-19 10:26:48 +01:00
Thomas LE ROUX
37dca20444 net: lwm2m: Utility functions added to LWM2M Engine
Added 3 utility functions :
- lwm2m_engine_update_period_service() which updates the period of a
given service.
- lwm2m_engine_update_period_min_observer() which updates the
min_period_sec for a given observe node.
- lwm2m_engine_update_period_max_observer() which updates the
max_period_sec for a given observe node.

Signed-off-by: Thomas LE ROUX <thomas.leroux@smile.fr>
2021-02-19 10:52:08 +02:00
Kumar Gala
de57449407 disk: sdhc: NXP: Convert clock control to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the clock controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-18 12:27:48 -06:00
Wolfgang Puffitsch
9b3c0572cb Bluetooth: controller: Align include paths in hci.c
Align include paths for LLL include files in hci.c.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-02-18 12:03:13 -05:00
Wolfgang Puffitsch
cfa668fd51 Bluetooth: controller: Restructure LLL include files
Move LLL header files for all roles to common folder. Move
vendor-specific content to internal header files, in particular ADV
buffer handling. Define the vendor-specific type lll_adv_pdu in a
separate header file lll_adv_pdu.h to avoid cyclic dependency when
moving ADV buffer handling to internal header file. Make sure all
internal header files are in vendor-specific folders.

The goal is to have a more consistent structure for LLL header files
and allow unconditional inclusion of non-internal LLL header files.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-02-18 12:03:13 -05:00
Kamil Kasperczyk
7b26544547 net: openthread: added heap related otPlat methods implementation
* Added implementations of otPlatCAlloc and otPlatFree methods
necessary for the OpenThread in case of using EXTERNAL_HEAP.
* Added CONFIG_OPENTHREAD_DNSSD_SERVER option to allow enabling
OT_DNSS_SERVER feature.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
2021-02-18 18:23:06 +02:00
Joakim Andersson
a4f0ca8649 Bluetooth: host: Refactor host ECC handling to own source file
Move the host ECC handling under BT_ECC to its own source file.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-18 13:50:22 +01:00
Joakim Andersson
4a25fb7136 Bluetooth: host: Remove dependency on host emulation for debug ECC keys
Remove the depency on host emulation of ECC for the Use debug keys
option.
This allows the application to use debug keys without shifting the
ECC from the controller to the host, which could potentially alter
the behavior of the application and make debugging this way less useful.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-18 13:50:22 +01:00
Joakim Andersson
9235b1b8b3 Bluetooth: Refactor ECC emulation supported commands bits
Refactor the ECC emulation setting the supported command bits in order
to group the supported commands together with the implementation of
these commands.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-18 13:50:22 +01:00
Morten Priess
5412f61ac6 Bluetooth: controller: Introduce separate done memq
In order to avoid stalling LLCP procedures blocking done event
processing, done events are now put in a separate memory queue,
and processed by own mayfly function.
This ensures prepare/done refcount balancing and prevents assertion
due to lack of done events.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-02-18 13:42:43 +01:00
Andrzej Kaczmarek
def2d7cf4e Bluetooth: controller: Fix reset with ext adv enabled
We need to make sure aux is cleared on reset, otherwise we may end up
with legacy advertising with aux.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-02-18 13:29:37 +01:00
Andrzej Kaczmarek
74d6b9fae9 Bluetooth: controller: Improve readability
Create shortcuts to set and lll to make code easier to read.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-02-18 13:29:37 +01:00
Andrzej Kaczmarek
9d8503c3b1 Bluetooth: controller: Initialize PDUs in set #0 on reset
Set #0 is used for legacy advertising when legacy HCI commands are used
and in such case it's possible to enable advertising without any prior
configuration. This means we should better always have PDUs in set #0
initialized with default empty data.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-02-18 13:29:37 +01:00
Andrzej Kaczmarek
55698d26b6 Bluetooth: controller: Remove all advertising sets on reset
We should remove all advertising sets when resetting controller. It's
enough to just clear is_created flag for each set.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-02-18 13:29:37 +01:00
Andrzej Kaczmarek
d5fc34491c Bluetooth: controller: Disable advertising before cleanup on reset
It seems more reasonable to first disable all advertising sets before
final cleanup.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-02-18 13:29:37 +01:00
Trond Einar Snekvik
135af76666 Bluetooth: Mesh: Reduce proxy rx buffer to an exact fit
Removes the 3 byte padding at the end of each proxy connection's rx
buffer.

Fixes #18509.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-02-17 23:16:29 +03:00
Jukka Rissanen
7699563d81 net: mgmt: Use proper coop thread priority value
If user sets CONFIG_NUM_PREEMPT_PRIORITIES=0, then the priority
of the net_mgmt thread will be -1 which is the same as idle thread.
This will trigger assert in kernel as then the minimum coop priority
is -2 in this case. Remove the net_mgmt thread priority setting from
Kconfig file as it is low value and set the coop thread priority
the same way as other network threads are doing it.

Fixes #32375

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-02-17 16:42:15 +02:00
Alexander Wachter
0c1877a999 ztest: fix z_assert_within() bounds
zassert_within should also compare on equality instead
of only greater/lower.
example:
zassert_within(1,1,0); // should return true
zassert_within(1,2,1); // should return true

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2021-02-17 06:32:02 -05:00
Jacob Siverskog
3781d5f553 usb: mass storage: set thread stack size from Kconfig
allow user to select stack size depending on the situation.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-02-17 11:49:52 +01:00
Hubert Miś
ce3dcf2394 net: socket: getsockopt SO_PROTOCOL implementation
This patch adds implementation of socket option used to get
protocol used for given socket (e.g. IPPROTO_TCP). This option
is not defined in POSIX, but it is Linux extension.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-02-17 10:36:58 +02:00
Hubert Miś
f6263c8143 net: socket: getsockopt SO_TYPE implementation
This patch adds implementation of socket option used to get
type of given socket (e.g. SOCK_STREAM).

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-02-17 10:36:58 +02:00
Kumar Gala
b275fec8c4 soc: stm32: convert to use DEVICE_DT_GET for clocks
Convert from device_get_binding to DEVICE_DT_GET.  In doing this we
no longer need the label in the devicetree node so we remove that.

Removed all __ASSERT_NO_MSG(clk) since we'll get a build error if
DEVICE_DT_GET cant be satisfied, and the clock control api's will
handle reporting if the device_is_ready.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-16 17:01:37 -06:00
Wolfgang Puffitsch
fcadabadb5 Bluetooth: controller: openisa: Add missing include file
Add obviously missing include file in openisa Bluetooth controller.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-02-16 12:02:00 -05:00
Wolfgang Puffitsch
70f3e5a726 Bluetooth: controller: Add guards for feature_rsp_send
Add compilation guards for the feature_rsp_send function to avoid
compilation errors for some configurations.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-02-16 12:02:00 -05:00
Jukka Rissanen
0c324e7b14 net: tcp2: Use private work queue
As the work might have some delays, use private work queue
for TCP work.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-02-16 18:09:45 +02:00
Emil Gydesen
86f22aa526 Bluetooth: Audio: Move BT audio to new directory
It was decided that the Bluetooth audio subsystem should
be in subsys/bluetooth/audio instead of subsys/bluetooth/host/audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-02-16 08:55:17 -05:00