Commit graph

21541 commits

Author SHA1 Message Date
Markus Becker
638b5f389f net: openthread: OpenThread RCP mode integration into Zephyr
* Add RCP library.
* Conditionally remove non required libraries not required for RCP.
* Drop :option: marker for CONFIG_OPENTHREAD_NCP_SPINEL_ON_UART_ACM

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-11-19 12:34:14 +01:00
Lingao Meng
65395f30ec Bluetooth: Mesh: Fixes pb-adv segment recv
Wrong use of function `find_msb_set(~link.rx.seg)`,
uint8_t type is implicitly converted to uint32_t.
As a result, it always returns 32 instead of the
expected value, resulting in abnormal processing
of prov segment.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2020-11-19 13:28:28 +02:00
Lingao Meng
9cd34f8675 Bluetooth: Mesh: Fixes prov string log dump
Missing log_strdup around the string.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2020-11-19 13:28:28 +02:00
Lingao Meng
109d6d4d8c Bluetooth: Mesh: Fixes wrong prov pointer clear
The structure pointer was wrongly cleared before,
`bearer` and `role` in `bt_mesh_prov_link` structure
resulting in illegal pointer access.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2020-11-19 13:28:28 +02:00
Ilya Averyanov
d262b064a2 Bluetooth: shell: fix compilation
phy2str also used when CONFIG_BT_USER_PHY_UPDATE not only
when CONFIG_BT_OBSERVER

Signed-off-by: Ilya Averyanov <a1ien.n3t@gmail.com>
2020-11-19 13:28:06 +02:00
Lingao Meng
88f8c735a7 Bluetooth: Mesh: Fixes missing set virtual addr
Fixes missing virtual address set

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2020-11-19 13:23:48 +02:00
Lingao Meng
4fbce04372 Bluetooth: Mesh: Correction of missing beacon auth generation
When kr phase to `BT_MESH_KEY_REVOKED`, should also call beacon
authentication, since beacon flag has change(0x01-->0x00).

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2020-11-19 13:21:28 +02:00
Marcin Niestroj
8669709d1e Bluetooth: DIS: settings: select SETTINGS
DIS module builts fine when BT_DIS_SETTINGS is selected, but SETTINGS is
not. However no settings handlers are executed, just like with
BT_DIS_SETTINGS disabled, which might confuse user.

Select SETTINGS, so settings handlers are properly selected and executed
in runtime.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-11-19 13:18:16 +02:00
Marcin Niestroj
faabbb6809 Bluetooth: DIS: settings: drop dependency on BT_SETTINGS
Currently BT_DIS_SETTINGS and BT_SETTINGS are independent in
Kconfig. This seems fine, because BT_SETTINGS pulls a lot of
functionality, which is not really needed to implement DIS with values
configured in runtime (from settings subsystem).

Drop BT_SETTINGS conditional compilation and leave check on
BT_DIS_SETTINGS only.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-11-19 13:18:16 +02:00
Anas Nashif
63b7313c06 net: lldp: use llabs with int64_t
subpress warnings from llvm:

warning: absolute value function 'abs' given an argument of type
'int64_t' (aka 'long long') but has parameter of type 'int' which may
cause truncation of value [-Wabsolute-value]

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-11-19 08:41:56 +01:00
Kumar Gala
cc0c58c3af tests: coverage: GCOV counter value changed in GCC10.
Updated the GCOV_COUNTERS value, without which the coverage data
was corrupted when gcc 10.2 was used.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-11-18 22:17:58 -05:00
Marcin Niestroj
aac0f98d1d net: hostname: define public macro representing maximum hostname length
Add a macro in public header that represents maximum hostname string
length without terminating NULL character. This will allow other
modules, such as offloaded network drivers, to know how much space is
needed to allocate in order to fit whole hostname.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-11-17 19:21:43 -05:00
Andy Ross
be2a5824f3 soc/intel_adsp: Unify trace backends
This platform had separate backends for the log subsystem and printk
handler, which was silly.  Unify them to use the same backend so they
don't clobber each other.

This patch appears to be a lot of lines, but it's really mostly code
motion and renaming.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-11-17 12:28:10 -08:00
Morten Priess
5a10f27f13 Bluetooth: controller: Make WL size configurable
In architectures supporting more than 8 WL entries, e.g. pure
software implementations, it is desirable to be able to increase the
WL size. This change increases the range to 1..16 for SOCs other than
nRF5x and OpenISA.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2020-11-17 20:03:00 +01:00
Vinayak Kariappa Chettimada
ef2ece82c0 Bluetooth: controller: openisa: Fix sanitycheck failures
Fix sanitycheck failures when building
samples/bluetooth/peripheral_hr for rv32m1_vega_ri5cy
platform.

Updates from nRF platform related to 255 byte AD data
support have been directly copied into openisa port to
fix build failures.

Relates to commit c2fc629dd2 ("Bluetooth: controller:
255 byte AD payload support").

Fixes #29967.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 19:47:27 +01:00
Vinayak Kariappa Chettimada
05ca10001e Bluetooth: controller: nrf: Fix sanitycheck failures
Fix sanitycheck failures covered by following tests:

`./scripts/sanitycheck -p nrf51dk_nrf51422 -T tests/bluetooth/init`

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 19:47:27 +01:00
Vinayak Kariappa Chettimada
b2b93871a3 Bluetooth: controller: Fix minor typo in comment
Fix minor typo in comment that was not caught by check
compliance stage in PR CI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 19:47:27 +01:00
Thomas Ebert Hansen
002b579416 bluetooth: controller: Add vendor operations to TICKER_USER_THREAD_OPS
Allow vendor specific increase of user operation capacity for
THREAD, to support queuing additional ticker operations.

Relocate TICKER_USER_<XXX>_VENDOR_OPS to before TICKER_USER_<XXX>_OPS.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2020-11-17 19:37:39 +01:00
Emil Obalski
773f02e6e9 usb: drivers: Fix ZLP handling for Nordic driver.
ZLP - zero length packet is used to indicate that the device
has no more data to send. If the Host asks for more data that the
device can provide and the data size is mutliplication of Endpoint
wMaxPacketSize then the device must terminate the data transfer
with ZLP.

Until this patch Nordic device driver controller was not aware of
the requested data length and could not determine when the ZLP was
required.

This patch introduces a fix that prevents the driver from starting
setup stage before the ZLP is being send.

For consistance with the Zephyr USB stack sending ZLP must be
issued from the stack level. Making trans_zlp flag true results
in blocking the driver from starting setup stage without required
ZLP.

After the data transfer finishes the driver will be prepared for ZLP
and will call back the stack to start writing ZLP. After the ZLP
is being send the driver will automatically start status stage and
end the Control Transfer.

This patch also removes CONFIG_USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
and aligns Nordic driver with others.

Without this patch the issue could occur when handling get requests.
Typical case is string descriptor of length equal to wMaxPacketSize.
Hosts usually asks for wLength = 255 Bytes when string descriptors
are being requested. In that case to successfully finish the data
stage of the Control transfer the device must send wMacPacketSize
Bytes of actual string descriptor and then ZLP to indicate that no
more data are present. After ZLP the status stage may start and the
request is finished successfully.

Without this patch the driver will not send ZLP making it unable
to end the Control Request successful - this may lead to failing
'Device Descriptor Test' from USB3CV test tool.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-11-17 18:06:26 +01:00
Wentong Wu
c85d353ca4 logging: add STP transport and raw data output support for syst
Add STP transport support for MIPI SyS-T with Kconfig MIPI_SYST_STP,
this is following SyS-T spec Section 7.
And with Kconfig MIPI_SYST_RAW_DATA, add raw data output support for
MIPI SyS-T protocol stack.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-11-17 10:09:19 -06:00
Vinayak Kariappa Chettimada
27dcc39494 Bluetooth: controller: Fix regression in central event close
Fix regression in connection radio event close in central
role introduced in commit 222dca5598

Fixes #29957.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 12:16:36 +01:00
Andrzej Puzdrowski
450b82aeb7 storage/stream: elimination of usage of the flash API internals
Module was using flash driver implementation API call
`page_layout()` which is part driver implementation
interface API.

This patch re-implement this part of code using
`flash_page_foreach()` public API function.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-17 11:34:35 +01:00
Marek Pieta
3b4ead139f Bluetooth: controller: Fix TX power dependencies
Change adds missing TX power dependencies. nRF52833 and nRF52820 SoCs
also support higher TX power values.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2020-11-17 11:52:06 +02:00
Martin Åberg
3658f74d17 net: ipv6: fixed endian issue
A cast made assumption on how data is stored.

This commit makes the following test pass on qemu_leon3:
- net.udp

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
634b8fd58c net: dhcpv4: fixed endian issue
This makes the following test pass on qemu_leon3:
- net.dhcp

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
fb18a6e2f7 net: ipv6_fragment: fixed endian issue
A cast made assumption on how data is stored.

This commit makes the following test pass on qemu_leon3:
- net.ipv6.fragment

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Marcin Niestroj
09f6e8a112 net: hostname: fix logging hostname string
Following errors occuring after enabling debug logs:

  log: argument 2 in source net_hostname log message "%s: (%s): \
    Hostname set to %s" missinglog_strdup().
  log: argument 2 in source net_hostname log message "%s: (%s): \
    New hostname %s" missinglog_strdup().

Fix that by printing CONFIG_NET_HOSTNAME directly in the first case and
using log_strdup() in the second.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-11-17 10:41:49 +02:00
Emil Gydesen
919ba04988 Bluetooth: host: Periodic advertiser list support
Adds support for using the periodic advertiser list.
This list allows the application to rely on specific
devices when creating periodic advertising syncs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-11-16 16:35:44 +01:00
Jukka Rissanen
82dbda3b57 net: tcp2: Use proper int type for connection MSS
When printing MSS (Maximum Segment Size) value, use uint16_t
always.

Fixes #29997

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 09:19:21 -05:00
Jukka Rissanen
7d5ef1f952 net: shell: Print detailed information when TCP2 is enabled
If user has enabled TCP debugging, print detailed internal TCP2
information too when user gives "net conn" command. This is useful
to have when debugging.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 16:07:10 +02:00
Jukka Rissanen
6a54b1f013 net: tcp: Reorganize internal TCP header file
Comment out TCP1 specific stuff when TCP2 is enabled. This means
shuffling the code around a bit so that common code is placed at
the end. Introduce also net_tcp_foreach() function to TCP2 so that
it can be used from net-shell.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 16:07:10 +02:00
Emil Gydesen
1dada244c1 Bluetooth: host: Periodic Advertising Sync Transfer
Adds support for the periodic advertising sync transfer
(PAST) feature, which allows a synced device, or an
advertiser, to transfer synchronization of a periodic
advertising train to a connected device.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-11-16 13:40:09 +01:00
Dominik Ermel
4832fe43e0 fs/fcb: Enable FCB to work with non-0xff erase value flash
The FCB has been strongly tied to 0xff erased flash devices and this
commit adds support for other erase values.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-11-16 13:39:04 +01:00
Jukka Rissanen
b519ba54f5 net: tcp2: Only accept a valid RST packet
If the seq number is not valid, then drop incoming RST.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 14:29:07 +02:00
Kiril Petrov
539c3e7fa8 lwm2m: handle return code from lwm2m_socket_add
Handle return code from lwm2m_socket_add

Signed-off-by: Kiril Petrov <retfie@gmail.com>
2020-11-16 14:28:08 +02:00
Jukka Rissanen
be4380f5e2 net: tcp2: Remove unnecessary data length calculation
The data length is already calculated in tcp_in() so no need
to do it again in tcp_data_get(). Just pass the length to the
tcp_data_get() function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-16 14:22:13 +02:00
Martin Åberg
5d38a006a5 sparc: Add testsuite support
This commit provides the timestamp_serialize() define for the SPARC
architecture.

Co-authored-by: Nikolaus Huber <nikolaus.huber.melk@gmail.com>
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg
188efb5bfb logging: change default stack size on SPARC
The default stack size of 768 is just too small for SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Martin Åberg
2b1baf6e33 debug: openocd: Support for building on SPARC
This adds the pieces needed for openocd.c to compile when ARCH=SPARC.
In particular, it allows the tracing.osawareness.openocd sample to
build and run.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-13 14:53:55 -08:00
Joakim Andersson
2cc4d8d95c Bluetooth: mesh: Fix use of deprecated scan parameter filter_dup
Fix use of deprecated scan parameter filter_dup.
Should have been changed to options as part of:
be57dfbe2a

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-11-13 16:49:28 -05:00
Andrzej Puzdrowski
8cadc9c249 usb/class/usb_dfu: makes USB_DFU_WAIT_DELAY_MS configurable
Kconfig USB_DFU_WAIT_DELAY_MS was hidden.
Added prompt for it so it can be configured.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-13 13:37:18 +01:00
Andrzej Puzdrowski
5cfafb041b dfu/boot/mcuboot: made able to compile within MCUBoot
Use rather MCUBoot implementation of some function than
zephyr's implementations once avielabel.

Zephyr implementations are needed while compiling application
supposed to be chainloaded by the MCUBoot or when they are
tested.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-13 13:37:18 +01:00
Andrzej Puzdrowski
9ca16e98e9 usb/class/usb_dfu: allow to operate only on the primary slot
It is possible that USB DFU class is used by MCUBoot
itself while it has enabled CONFIG_SINGLE_APPLICATIO_SLOT.
In this mode only application slot is the primary slot.

Adapted DFU class descriptor and services to optionally
serve only for one image.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-13 13:37:18 +01:00
Andrzej Puzdrowski
9fd8508f71 dfu: allow to operate on primary slot
It is possible that dfu libraries are used by MCUBoot
itself while it has enabled CONFIG_SINGLE_APPLICATIO_SLOT.
In this mode only application slot is the primary slot.

Patch is required for supports USB DFU class in mentioned
MCUBoot's mode.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-13 13:37:18 +01:00
Daniel Leung
c7a0cdd1a5 shell: kernel: fix interrupt stack size calculation on SMP
When calculating the size of unused interrupt stacks on SMP,
the "unused" variable is not cleared between CPUs. So this
value keeps incrementing and does not reflect actual unused
size for CPUs other than the first one. So clear the "unused"
variable for each CPU.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-11-13 07:13:07 -05:00
Peter Bigot
017bca3920 tracing: switch to cbprintf as basis for printf functionality
Replace use of z_prf with cbprintf.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-13 06:38:01 -05:00
Peter Bigot
125c5752a6 shell: switch to cbprintf as basis for printf functionality
Replace use of z_prf with cbprintf.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-13 06:38:01 -05:00
Peter Bigot
ee0b32682a logging: switch to cbprintf as basis for printf functionality
Replace use of z_prf with cbprintf.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-13 06:38:01 -05:00
Peter Bigot
abb3a28c94 Revert "shell: support floating point output with newlib"
This reverts commit e812ee6c21.

This is the initial step towards replacing the core Zephyr formatting
infrastructure with a common functionally-complete solution.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-13 06:38:01 -05:00
Vinayak Kariappa Chettimada
59888103d2 Bluetooth: controller: Fix AD data size overflow check
pdu->len is only 8 bits and CONFIG_BT_CTLR_ADV_DATA_LEN_MAX
can be upto 1650 bytes. Fix the implementation to use 16
bit auto variable to check AD data length overflow.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-13 09:56:53 +01:00