Commit graph

44393 commits

Author SHA1 Message Date
Joakim Andersson
407411f1af Bluetooth: host: Fix stuck OOB get local functions SC is not supported
Fix bt_le_oob_get_local and bt_le_ext_adv_oob_get_local stuck forever
waiting for the sc_local_pkey_ready semaphore when SC HCI commands
are not supported in the controller.

By using the le_sc_supported helper function the runtime check of HCI
commands and the feature check of CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY
is combined to be handled int the same way.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-22 19:37:31 +02:00
Joakim Andersson
214175483b Bluetooth: SMP: Move le_sc_supported helper function up
Move the le_sc_supported helper function up in the source file so that
it can be re-used in other places without a forward declaration.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-22 19:37:31 +02:00
Gerson Fernando Budke
80a7f10643 dts: arm: atmel: sam4l: Fix pinctrl typo
The sam4l pinctrl contains two entries with wrong values.  Fix the
typo to create valid pinctrl map.

Fixes #28538.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-09-22 12:21:23 -05:00
Kumar Gala
fe7dd725f0 net: tcp2: Fix build failures on 64-bit platforms
Since conn->send_data_total is of time size_t we need to use %zu or
we'll get build errors in sanitycheck on 64-bit platforms

Fixes #28605

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-22 12:08:37 -05:00
Henrik Brix Andersen
4ca1f4d898 boards: arm: arty: note which boards can use the pre-built bitstream
Add a note on which Arty boards can be programmed with the pre-built
FPGA bitstream.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-22 11:25:03 -05:00
Daniel Leung
9e0090d114 tests: x86/pagetables: skip table dumping if large memory
For boards with (relatively) large memory, the test which dumps
page tables takes a long time to finish. The default timeout of
sanitycheck is not enough for those boards. UP Squared board is
such a board. So limits to pagetable dumping to boards with
less than 32MB.

Fixes #28548

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-22 10:59:53 -05:00
Jukka Rissanen
c54a511d26 net: Drop incoming packet if there is no data in it
If the network driver for some reason did not set the data in
the network packet properly, then just drop it as we cannot do
anything with just plain net_pkt.

Fixes #28131

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-22 11:22:43 +02:00
Jukka Rissanen
c4632ae424 net: pkt: Add net_pkt_is_empty() util function
The function will check that the net_pkt will contain some
data and return true in that case, and false if the net_pkt
is empty.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-22 11:22:43 +02:00
Krzysztof Chruscinski
03f4a648b1 drivers: clock_control: nrf: Fix waiting for LF clock
Algorithm for waiting for clock stabilization was failing in case when
it was waiting for clock availablity and clock was already available
before function was called. That is because nrfx_clock_is_running
was returning false because XTAL was already started but not yet
running.

Added a check for current LF source, if XTAL is picked that indicates
that RC is already running because of two stage startup procedure.

Added documentation of lfclk_spinwait with explanation of two stage
approach.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-22 09:58:19 +02:00
Luiz Augusto von Dentz
d8fd5bab04 Bluetooth: L2CAP: Truncate RX MTU if segmentation is not supported
If hannel don't have alloc_buf and the RX MTU is configured to require
segmentation this warn the user and truncate the RX MTU.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-09-22 10:56:27 +03:00
Luiz Augusto von Dentz
0c1fa00340 Bluetooth: L2CAP: Document behavior of alloc_buf
Channel that requires segmentation must set alloc_buf in order for the
stack to be able to reassemble segments of an SDU.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-09-22 10:56:27 +03:00
Erik Brockhoff
9bbbf17cf2 bluetooth: controller: fix mark/unmark error in ull_adv::disable
In case where ull_adv::disable() is disallowed, disable_mark is
erroneously re-mark instead of un-marked

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2020-09-21 17:05:19 -05:00
Wentong Wu
6cf50ac89c tests: kernel: mem_map: Explicitly cast function pointer to (void *)
To make Coverity happy.

Coverity-CID: 212956
Fixes: #27837.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-09-21 16:49:21 -05:00
Johann Fischer
612ba4390b drivers: eth_enc424j600: initialize device pointer
Initialize device pointer in driver's context.

It was not done quite right in commit a1708cf2f2
("drivers: ethernet: Fix device instance const qualifier loss"),
and then completely removed in commit 113d9274ea
("drivers: ethernet: remove stray expression")'

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-09-21 16:45:03 -05:00
Dominik Ermel
b75616733b storage: flash_map: Unify partition processing macros name
Rename *_PART and *_PARTION identifiers to *_PARTITION.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-09-21 16:42:29 -05:00
Anas Nashif
c25f486322 actions: increase stale operations
Increase to 400 to have it complete the job in one run.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-21 16:05:15 -04:00
Maksim Masalski
2cd556a689 tests: arch: x86 mem protection check CPU scrubs regs after syscall
To improve Zephyr security, I decided to create a test
to check upon exit of a system call back to the calling thread,
the kernel scrubs CPU registers for sensitive data.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-09-21 10:18:17 -05:00
Jukka Rissanen
8afaadd223 net: conn: Ignore unhandled IPv4 broadcast packets
If there is no handler for IPv4 broadcast packet, then ignore it
instead of trying to send an ARP message to resolve the senders
address.

Fixes #21016

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-21 10:04:57 -05:00
David Komel
92499fc9d1 drivers: net: slip: Allow slip to co-exist with other interfaces
This commit fixes the following issue:
When using slip without TAP, i.e. CONFIG_SLIP_TAP=n (default), while
another ethernet interface is enabled and sets CONFIG_NET_L2_ETHERNET=y.

This causes ethernet_init() to be wrongly called with struct dummy_api
instead of struct ethernet_api.
ethernet_init() expects struct ethernet_api (by cast), so we end up
with the get_capabilities field pointing to garbage!
Actually, as we are using the dummy api, we don't need to call
ethernet_init() at all.

Sole dependency on CONFIG_NET_L2_ETHERNET is wrong because it
can be enabled by another interface.

Signed-off-by: David Komel <a8961713@gmail.com>
2020-09-21 10:02:06 -05:00
Julien D'Ascenzio
babc6b9e61 soc: arm: stm32[l4|wb]: fix power state exit
When we wake-up of deep sleep power state, we want to disable it.
Otherwise, when the cpu will go next to idle mode during a
SYS_POWER_STATE_ACTIVE, it will go into deep sleep mode
instead of a sleep mode.

fixes: #26896

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
2020-09-21 09:57:40 -05:00
Luiz Augusto von Dentz
25fda14702 Bluetooth: GATT: Fix assuming CCC position
Accourding to the spec the CCC descriptor may occur in any position
within the characteristic definition after the Characteristic Value.

Fixes #28324

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-09-21 17:15:19 +03:00
Luiz Augusto von Dentz
9efd93adde Bluetooth: UUID: Fix BT_UUID_ES_TRIGGER_SETTING
BT_UUID_ES_TRIGGER_SETTING was incorrectly using
BT_UUID_ES_MEASUREMENT_VAL as value instead of
BT_UUID_ES_TRIGGER_SETTING_VAL.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-09-21 17:15:19 +03:00
Vinayak Kariappa Chettimada
a8ffc03f6e Bluetooth: controller: Fix REJECT_IND PDU handling
Fix for handling REJECT_IND PDU received for PHY Update,
Connection Parameter Request and Data Length Update control
procedures.

If a link layer control procedure collision occurs, example
with local initiated PHY Update Procedure, and peer sends a
REJECT_IND PDU, then the PHY Update Procedure is stalled.

Fixes #28282.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-09-21 14:52:41 +02:00
Siddharth Chandrasekaran
07756e5332 board: stm32_min_dev: Fix LED0 connection inversion
The on-board LED of the blue and black variants of these boards have LED
logic inverted. This was never observed as most of the time, the LED was
used as a blinky. Fix this by setting its DT bindings to active low.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-21 13:06:58 +02:00
Ievgenii Meshcheriakov
1375b1d332 drivers/flash/soc_flash_nrf: Remove blank lines at the end of config files
This should make CI happier.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Ievgenii Meshcheriakov
b7c9d9d34f drivers/flash/soc_flash_nrf: Enable ticker radio sync only with Zephyr LL
Ticker API is part of Zephyr software BLE Link Layer.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Ievgenii Meshcheriakov
d27c32efc3 drivers/flash/soc_flash_nrf: Rename config option SOC_FLASH_NRF_RADIO_SYNC
Call it SOC_FLASH_NRF_RADIO_SYNC_TICKER so it is not too generic.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Ievgenii Meshcheriakov
70c5371666 drivers/flash/soc_flash_nrf: Name flash sync choice
Named choice is needed in order to be able to extend it
in other modules.

Closes: #28559

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2020-09-21 13:06:16 +02:00
Lingao Meng
4cc8cb1c15 Bluetooth: Mesh: Fix send input_complete before public key
According Mesh Profile Spec 5.4.2.4 Authentication, if device
use Input OOB Authentication method, should send input complete
pub after local public key has been acked.

`bt_mesh_input_string` or `bt_mesh_input_number` directly send
`input_complete`, however does not check whether the pub key has
been sent.

Mesh Provisioning timeout set to `60` seconds, so even this
probability is extremely low, it does not mean that there is no
such probability.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-09-21 13:07:18 +03:00
Ioannis Glaropoulos
14f248fe1b arch: arm: cortex_m: cleanup SW_VECTOR_RELAY_CLIENT dependencies
CPU Cortex-M implies Mainline Cortex-M, therfore, the dependency
on ARMV6_M_ARMV8_M_BASELINE is redundant and can be removed. The
change in this commit is a no-op.

We also add the ARMV6_M_ARMV8_M_BASELINE dependency on option
CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP to make sure it cannot be
selected for non Cortex-M Baseline SoCs (at least, not without
a warning).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-09-21 11:19:22 +02:00
Alexandre Bourdiol
2e1499eb4b soc: arm: st_stm32: stm32f0: take into account SW_VECTOR_RELAY
This STM32 serie redefines function relocate_vector_table()
It should take into account features:
SW_VECTOR_RELAY and SW_VECTOR_RELAY_CLIENT

fixes #28289

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-21 11:19:22 +02:00
Eric Johnson
a142f5a26c tests: kernel: common: Add tests for 24-bit byteorder functions
Adds missing tests for 24-bit byteorder functions

Signed-off-by: Eric Johnson <eric@liveathos.com>
2020-09-21 11:17:59 +02:00
Eric Johnson
a18688eebd tests: kernel: common: Add tests for 48-bit byteorder functions
Adds missing tests for 48-bit byteorder functions

Signed-off-by: Eric Johnson <eric@liveathos.com>
2020-09-21 11:17:59 +02:00
Eric Johnson
c27561d984 sys: byteorder: Fix incorrect shift in sys_get_be48/le48
Fixes an incorrect left-shift value that was introducing
extra 0x00 bytes to the result.

Signed-off-by: Eric Johnson <eric@liveathos.com>
2020-09-21 11:17:59 +02:00
Anas Nashif
e01a4df3fb tracing: handle null thread names with systemview
Default to autogenerated thread name in case no name was assigned.

Fixes #27592

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-20 21:27:55 -04:00
Anas Nashif
75d159bf0d tracing: x86_64: move switched_in to switch function
Tracing switched in threads in C code does not work, it needs to happen
in the arch_switch code. See also Xtensa and ARC.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-20 21:27:55 -04:00
Anas Nashif
2718a23781 samples: synchronisation: handle empty thread name
In some cases we were returning empty thread names, so make sure we
check for the thread names correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-20 21:27:55 -04:00
Anas Nashif
53cc54516d tracing: fix empty thread name
Report thread names as 'unknown' when we can't determine thread name
from kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-20 21:27:55 -04:00
Anas Nashif
74576a0515 samples: tracing: print out useful information
Instead if printing the line number, output the context (thread,
semaphore, mutex, ..) and the ID of the event where applicable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-20 21:27:55 -04:00
Maureen Helm
122bc38fad release: Zephyr 2.4.0-rc2
Set version to 2.4.0-rc2

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-19 10:30:14 -05:00
Daniel Leung
4a9ee68e12 samples: basic/minimal: disable memory pool when MT=n
This adds the option to disable kernel memory pool when
multithreading is also not enabled. This saves some
code space.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-19 05:49:13 -04:00
Daniel Leung
b5c2ff9397 kernel: add kconfig CONFIG_KERNEL_MEM_POOL
Adds a kconfig CONFIG_KERNEL_MEM_POOL to decide whether
kernel memory pool related code is compiled. This option
can be disabled to shrink code size. If k_heap is not
being used at all, kheap.c will also not be compiled,
resulting in further smaller code size.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-19 05:49:13 -04:00
Daniel Leung
4f106c32d5 linker: do not force keep common kernel objects
This uses the new macros so the common kernel objects can be
garbage collected if they are not referred directly anywhere
in the code. This is useful for reducing library data size
as not all library functions and their corresponding kobjects
are being used.

Fixes #20663

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-19 05:49:13 -04:00
Daniel Leung
04d706b450 linker: add macros so iterable sections can be garbage collected
The iterable section macros Z_ITERABLE_SECTION_ROM()/_RAM() uses
Z_LINK_ITERABLE() which does KEEP() on all symbols. This results
in all symbols under those sections being kept in final image
even though these symbols are not referred directly from the code.
This adds the new set of macros which does not force KEEP() on
the symbols, and allows symbols to be garbage collected.
The existing macros are kept as-is so as not to change their
behaviors.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-19 05:49:13 -04:00
Joakim Andersson
0fe62c6392 Bluetooth: host: Fix bug in device name shortening handling
Fix bug in device name shortening handling leading to memory
corruption.
This is triggered by an underflow in the length field of the shortened
name when set_data_len + 2 > set_data_len_max.

Fixes: #27693

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-19 10:25:49 +02:00
Joakim Andersson
f332d51d60 Bluetooth: host: Ignore failure to set passive scanner address
Ignore error when failing to set the passive scanner private address.
This can happen because in between the time we checked if the
advertiser was enabled and the time we execute the set random address
command the state of the advertiser could have changed in the
controller, and we only set the state once the command has completed
in the controller.

Fixes: #25672

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-19 10:19:03 +02:00
Joakim Andersson
2cb4548a42 Bluetooth: host: Fix not setting NRPA before starting scanner
Fix not setting NRPA before starting scanner.
Occurs with BT_PRIVACY=n and BT_EXT_ADV=y

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-19 10:19:03 +02:00
Armando Visconti
ce0cc3a7cc drivers: sensor: lsm6dsl: make the driver multi-instance
Make this driver multi-instance and use the new API.
Fixes #28390

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-09-18 22:08:44 -04:00
Jukka Rissanen
0e49f5570c net: tcp2: Check that connection exists in net_tcp_put()
Unit test tests/net/tcp2/net.tcp2.simple might have conn set to
null so check it here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-18 22:07:53 -04:00
Jukka Rissanen
ac7866c663 net: tcp2: Fix connection termination
We need to have timer that closes the connection for good if
we do not get the FIN and ACK reponse from the peer.

If there is any pending data when application does close(),
send them before sending FIN.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-18 22:07:53 -04:00