Commit graph

50337 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
fa95660b63 Bluetooth: controller: Fix reject extended indication checks
Fix reject extended indication PDU dispatch to check
transaction violations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 19:42:46 +02:00
Vinayak Kariappa Chettimada
ef9e429228 Bluetooth: controller: Fix unknown control PDU checks
Fix unknown control procedure handling to check transaction
violations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 19:42:46 +02:00
Vinayak Kariappa Chettimada
9cb8b0af89 Bluetooth: controller: Fix Feature Exchange checks
Fix Feature Exchange procedure to check transaction
violations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 19:42:46 +02:00
Vinayak Kariappa Chettimada
fb5b5b7069 Bluetooth: controller: Add control procedure lock
Add control procedure lock flag to detection procedure
transaction violations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 19:42:46 +02:00
Erwan Gouriou
2493030cd3 samples/tfm_integration: Fix warnings in stm32 boards overlays
Unit name should not have leading 0s.
Unit name should not use caps.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-30 19:19:59 +02:00
Erwan Gouriou
ceca94704c samples: psa_level_1: Enable on stm32l562e_dk_ns
Add minimum configuration changes to allow stm32l562e_dk_ns
to run psa_level_1 sample

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-30 19:19:59 +02:00
Kumar Gala
ccbc86eccf ci: Bump to SDK 0.12.4
Bump docker image to pull in SDK 0.12.4 to support split
of arm & arm64.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-30 13:14:35 -04:00
Anas Nashif
3b6294ab9e tests: drivers: sensors: use integration_platforms
add integration_platforms and cleanup testcase.yaml

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
6071aa5d3c tests: sensor: check for -ENOSYS
if function is not implemented, check for ENOSYS instead of ENOTSUP.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
3aab352361 drivers: video: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
84f1cd6833 drivers: uart: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
75fd7bc0a5 drivers: sensor: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
0f92d760b0 drivers: pwm: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
44fb8c7276 drivers: ps2: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
ba4284bcc3 drivers: lora: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
7f3cf38f16 drivers: led: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Also, explicitly check for NULL.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
d24c4ef430 drivers: kscan: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
0e3b774b80 drivers: i2c: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
7f54c4dc31 drivers: clock_control: fix NOTSUP vs NOSYS usage
Return -ENOSYS when implementation is missing and -ENOTSUP if the
feature is not supported. Those are 2 things. Missing implementation
(-ENOSYS) means that the driver is lacking support for the feature,
-ENOTSUP means we have an implementation but some parameters or
conditions makes the request unsupported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Anas Nashif
bbddfbdfd0 checkpatch: ignore linux specific ENOSYS warning
Remove Linux specific warning which has been causing confusion and
incorrect usage of return codes just to comply with checkpatch.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-30 10:50:14 -05:00
Emil Gydesen
929aec19ed Bluetooth: services: Fix ID check for bt_gatt_ots_obj_manager_obj_get
The ID validation check would always fail with IDs less than
OTS_OBJ_ID_START_RANGE, where the intention was that it should
allow the OTS_OBJ_ID_DIR_LIST (0) value as well if
CONFIG_BT_OTS_DIR_LIST_OBJ was enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-30 11:01:06 -04:00
Dominik Ermel
f4b6231a9d usb/dfu: Pick DFU target image label from DTS
Instead of defining the string, that will be reported by DFU
as a name for DFU target, in code, pick it from the DTS label that
will be the DFU target.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-30 09:01:20 -05:00
Dominik Ermel
73b29d68e7 usb/dfu: Removed unused NUMOF_ALTERNATE_SETTINGS
Alternative settings are determined by number of flash partitions
available for DFU from DTS.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-30 09:01:20 -05:00
Dominik Ermel
81f842ef64 storage/flash_map: Add macro to get string label from DTS
The commit adds macro that, using the DTS identifier, allows to
extract flash area label from DTS.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-30 09:01:20 -05:00
Hubert Miś
a41a3b703d net: ip: select src ip address with valid scope for mcast dst
IPv6 source address selection procedure selected link-local address
for any muticast destination with other scope than mesh-local. It
was a cause of problems for broader multicast scopes like admin-, or
site-local. For such broader scopes source address must be at least
as broad as the scope of multicast destination.

This patch updates IPv6 source address selection procedure. Now
link-local address is selected only for link-local destinations,
including multicast destinations. For broader destination scope,
source address with broader scope is selected.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-03-30 15:57:43 +03:00
Enjia Mai
95cddd4df7 testsuite: utils: move the interrupt_util.h into testsuite
The interrupt_util.h provides utils of trigger irq, now move them into
testsuite. All of the needed test cases can make use of them.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-03-30 08:18:23 -04:00
JuHyun Kim
b486c35bc9 driver: sensor: icm42605: Fixed Dereference afterr null check issue
Fixed Coverity CID: 219524 : Dereference after null check
For fix this issue added null check before call function pointer

Fixes #32913

Signed-off-by: JuHyun Kim <jkim@invensense.com>
2021-03-30 08:17:47 -04:00
Joakim Andersson
b6323abaad Bluetooth: host: Fix missing big_disconnect when invalid number of BIS
Fix missing big_disconnect in hci_le_big_complete when the number of
BIS in the event is invalid.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-30 08:17:22 -04:00
Joakim Andersson
f4477df803 Bluetooth: host: Validate big_handle before using it as an array index
Validate the big_handle before received from the controller before
using it as an array into the bigs array.

Discover by coverity: Insecure data handling  (TAINTED_SCALAR)
  Using tainted variable "big_handle" as an index into an array "bigs".

Cleanup state of BIG in pending or syncing state if it exists.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-30 08:17:22 -04:00
Joakim Andersson
c9aa26efe2 Bluetooth: host: Fix parsing BIG handle as a two byte field
Fix parsing BIG handle which is just one octet as a two octet field,
which could have caused problems on big-endian systems.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-30 08:17:22 -04:00
Joakim Andersson
1f1c6c097e Bluetooth: host: Refactor BIG initialized handling to use bit flags
Refactor the BIG initialized atomic handling to use bits instead of a
single atomic.
This allows for more bit flags to be added.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-30 08:17:22 -04:00
Martí Bolívar
dbca294ac7 devicetree: spi: clean up DT_SPI_DEV_CS_GPIOS_CTLR
Write this in terms of DT_GPIO_CTLR_BY_IDX instead of the lower level
DT_PHANDLE_BY_IDX for clarity and parallelism with things like
DT_SPI_DEV_CS_GPIOS_PIN, which is written using DT_GPIO_PIN_BY_IDX
instead of DT_PHA_BY_IDX.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-30 07:06:48 -05:00
Vinayak Kariappa Chettimada
77cfd3cf52 Bluetooth: controller: Fix race in create connection cancel
Fix race conditional when create connection cancel is called
and actually a connection did get setup while initiator is
being stopped.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 14:04:23 +02:00
Vinayak Kariappa Chettimada
34451a9970 Bluetooth: controller: Conditional compile adv addr used by initiator
Conditional compile adv_addr which is only used by
controller when supporting initiator/central role.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 14:04:23 +02:00
Vinayak Kariappa Chettimada
b2e802b018 Bluetooth: controller: Move initiated flag into role specific union
Move the initiated bit flag into role specific union, so that
other role specific bit flags can share bit space in the LLL
context structure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 14:04:23 +02:00
Vinayak Kariappa Chettimada
cd798202cb Bluetooth: controller: Fix flash driver sync regression
Fix flash driver sync regression introduced due to changed
default ULL_HIGH in the commit 30634334a8 ("Bluetooth:
controller: Fix ULL_HIGH priority to be lower than LLL").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 10:55:36 +02:00
Vinayak Kariappa Chettimada
433fad53bf Bluetooth: controller: Remove duplicate radio_isr_set call
Remove the redundant radio_isr_set function call.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 10:54:51 +02:00
Vinayak Kariappa Chettimada
0df70608a7 Bluetooth: controller: Fix SyncInfo with correct event counter
Fix Periodic Advertising SyncInfo structure to be filled
with correct event counter value considering accumulated
latency and ticker lazy value.

Fixes #32860.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 10:54:23 +02:00
Vinayak Kariappa Chettimada
f708f861bc Bluetooth: controller: Ticker next slot get to return lazy value
Updated ticker implementation to return lazy value for a
ticker when enumerating active tickers with time
reservations.

This is required to find offsets and to use the lazy value
to correctly calculate event and payload counter values that
needs to be filled into SyncInfo and BigInfo structures.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-30 10:54:23 +02:00
Jose Alberto Meza
ae4a28ca08 boards: arm: mec1501_modular: Use internal pull-up for kscan
Even though possible to use external pull-up and open drain buffer,
prefer internal pull-up to reduce power consumption.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2021-03-29 19:18:37 -04:00
James Harris
59a3def756 net: utils: fix strlen issue in net_addr_pton
Previously, a non null-terminated "string" could
be passed to z_impl_net_addr_pton if the string was
exactly `INET6_ADDRSTRLEN` long.

Signed-off-by: James Harris <james.harris@intel.com>
2021-03-29 16:22:58 -05:00
Ningx Zhao
b7bd2e5173 tests: stack: add a testcase
Add a testcase to test pop data from stack by
mutil-threads, verify data will be poped by
the highest priority thread that has waited longest
firstly.

stack integration

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2021-03-29 16:19:50 -05:00
Wealian Liao
d3469f99e7 soc: npcx: fix warning message for psl function
The compiler shows the array bounds warning message for some boards
which don't set the PSL function.
Change npcx_pinctrl_psl_input_asserted() input parameter from int to
uint32_t to fix it.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-03-29 16:15:41 -05:00
Dominik Ermel
f47334aa15 mgmt/mcumgr: Fixing use of k_fifo function on net buf
Fixing problem where k_fifo functions have been used to get/put
data from/info net buf, where documentation has been strictly
forbidding so.

Found, reported and solution suggested by jrhees-cae.

Fixes: #32579

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-29 16:13:38 -05:00
Henrik Brix Andersen
019e2ffa76 dts: nxp: kinetis: ke1xf: Add chip specific dtsi files
Add remaining NXP KE1xF SoC dtsi files to support out-of-tree boards
using other variants of the KE1xF than the single in-tree board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-29 15:03:24 -05:00
Gerard Marull-Paretas
87659aa71b doc: board_porting: fix code block language
Language of the sample dts was not specified.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-03-29 15:40:57 -04:00
Artur Lipowski
3b269bb033 lib: cmsis_rtos_v2: Fix timing and logic for osEventFlagsWait.
Consistently use ticks for timing purposes.
Fix retry logic.
Check flags when osFlagsWaitAll is not set.

Fixes #31103

Signed-off-by: Artur Lipowski <Artur.Lipowski@hidglobal.com>
2021-03-29 13:52:12 -04:00
Emil Gydesen
a71fec83bd Bluetooth: samples: Add central ISO sample
Adds a sample of setting up and using an ISO central as
a source of ISO data. This will periodically send ISO
data to a connected ISO peripheral with varying sizes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-29 13:51:44 -04:00
Emil Gydesen
ea48757a9a Bluetooth: samples: Add peripheral ISO sample
Adds a sample of setting up and using an ISO server as
a sink for incoming ISO data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-29 13:51:44 -04:00
Andrzej Puzdrowski
6acc4a2521 drivers/flash/flash_stm32g4x: fixed build issue
This driver file couldn't be compiled due the syntax error.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-03-29 13:43:55 -04:00