Commit graph

21541 commits

Author SHA1 Message Date
Eduardo Montoya
3417c9a132 net: openthread: remove unneded Kconfig dependency
`OPENTHREAD_SHELL` does no longer dependend on
`OPENTHREAD_COPROCESSOR` being disabled.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-06-19 16:54:44 -05:00
Chih Hung Yu
421ff4758f net: ip: Fix TCP unacked_len
TCP unacked_len can be set to zero in tcp_resend_data(),
and then be minus by len_acked when ACK is received,
resulting in a negative unacked_len value.

Fixes #36390

Signed-off-by: Chih Hung Yu <chyu313@gmail.com>
2021-06-18 16:21:29 +03:00
Ilya Tagunov
05957b66cb lorawan: update LoRaMac-node and move CMakeLists.txt to the main repo
Update the LoRaMac-node library to the last stable release and fix
the Zephyr glue code to match it. Move CMakeLists.txt to the main
Zephyr repository to simplify loramac-node module maintenance.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-06-18 11:22:03 +02:00
Emil Gydesen
22cfbd3dbd Bluetooth: Host: Modify check for read buffer size v2
Modify the check from checking the feature bit to
checking the command bit. This ensures that we
don't send the read buffer size V2 to a controller
that does not support it.

This also moves the entire ISO init procedure into
a separate function to avoid having a large
ISO-only block in `le_init`.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-18 11:21:14 +02:00
Krzysztof Kopyściński
9bf65e557b Bluetooth: gatt: add checks for db out of sync on read mult requests
This check is present in att_read_rsp(), but att_read_mult_req and
att_read_mult_vl_req do not use it. Add this check to these functions.

This was affecting GATT/SR/GAS/BV-08-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-06-18 00:41:23 +03:00
Jukka Rissanen
703233e115 net: socket: Allow microsecond accuracy in zsock_select()
Allow caller to specify microsecond accuracy and not convert
to milliseconds.

Fixes #36072

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-06-17 15:23:13 +03:00
Jukka Rissanen
1b025c8d64 net: socket: Make zsock_select() a syscall
Make zsock_select() a syscall so that the following commit
can call the internal poll implementation directly. This is
needed as zsock_select() will not call zsock_poll() directly
in order to allow select to use microsecond timeout accuracy.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-06-17 15:23:13 +03:00
Johann Fischer
7ec174df0d usb: fix request hijack through Audio class workaround
Because it is not always possible to determine whether
a request is for Audio class or not, all requests are passed
to it. This can lead to the requests, to e.g. HID interface,
being hijacked by Audio class.
Ignore return value of Audio custom handler as it is not relevant here.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-06-17 12:41:33 +02:00
Johann Fischer
afecdc97ef usb: audio: rework custom request handler callback
Since the settings are stored in the core now,
we can remove REQ_GET_INTERFACE part from custom handler
and simplify the code. Return value is no longer relevant
since custom callback does not need to interfere with the
request handling process.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-06-17 12:41:33 +02:00
Johann Fischer
1e71cef151 usb: store alternate interface settings
Store alternate interface settings and
return alternate on GetInterface request.

Fixes: #24200

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-06-17 12:41:33 +02:00
Andrzej Puzdrowski
fd3b20b81d dfu/boot: add CONFIG_UPDATEABLE_IMAGE_NUMBER option
This option is deciding whether bootutil_public library supports
multi-image procedures. MCUboot have its own definition which is
unavailable zephyr application. Introduced option declares similar
option for the application.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-06-17 12:41:17 +02:00
Andrzej Puzdrowski
ccddd74488 dfu/boot: request upgrade & confirm for multimage
Add boot_write_confirm_multi() and boot_request_upgrade_multi() APIs so
that the user can set the image with given index as pending, confirmed.

This is needed for enabling the mcuboot multi-mage boot feature by
the zephyr.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-06-17 12:41:17 +02:00
Lingao Meng
3e492665c0 Bluetooth: Controller: Add net_buf_ref ret value to variables
Return value should assigns to variables instead of ignoring them.

Related to PR(#36259).

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-06-17 12:46:05 +03:00
Lingao Meng
4820989195 Bluetooth: Add missing store net_buf_ref ret value
... related to(#36259)

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-06-17 12:46:05 +03:00
YanBiao Hao
d466a807ee Bluetooth: Mesh: comp pointer check
comp data pointer check before using

Signed-off-by: YanBiao Hao <haoyanbiao@xiaomi.com>
2021-06-16 22:58:44 -05:00
Krzysztof Kopyściński
5f9d760755 bluetooth: l2cap: fix ecred conn response for all connections refused
If all connections were refused, we haven't reached part of
le_ecred_conn_req with connecting channels - thus i was never
incremented. PDU shall be created always with the length containing
full size of scid array - we always respond with all of the CIDs filled,
they just will be all zeros when all connections were refused.

This was affecting L2CAP/ECFC/BV-26-C

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-06-16 10:41:51 +02:00
Hans Wilmers
414603fc9c shell: optionally set shell root command using Kconfig
If the shell root command shall be set in the application, e.g. for
implementing a login scheme, it is an advantage to set this already
during shell init.

This is now implemented using a new Kconfig variable SHELL_CMD_ROOT.

Signed-off-by: Hans Wilmers <hans@wilmers.no>
2021-06-16 10:41:17 +02:00
Robert Lubos
d42eb134a0 net: dhcpv4: Prevent DHCP client from clearing the gateway
In case both, static IP address configuration and DHCP were used, and no
DHCP server was avaliable in the network, clearing the gateway address
rendered the network interface unusable as it's gateway configuration
was cleared.

Prevent this by removing the gateway clearing during the DHCP
inititalization. If the DHCP server is available in the network, the
gateway address will be overwriten after receiving the DHCP OFFER
message or cleared if there's no Router option is avaiable in the
DHCP OFFER message.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-06-16 10:40:54 +02:00
Morten Priess
d1f71e93a0 Bluetooth: controller: CIS/CIG teardown at ACL disconnect
When an ACL connection with active CISes terminates, inject CIS/CIG
teardown to ensure CIS is stopped before ACL disconnection completes.
This includes stopping CIG ticker when last CIS has stopped.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-06-16 10:38:38 +02:00
Morten Priess
01e7dd853f Bluetooth: controller: Remove cis_handles array from ISO groups
Maintaining the cis_handles array in ULL/LLL ISO group data amounts to
double book-keeping. This commit eliminates the array and introduces a
'getter' for obtaining CISes owned by a specific CIG, and iterate
through them.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-06-16 10:38:38 +02:00
Morten Priess
ab40e57894 Bluetooth: host: Disconnect all ISO channels on BT_CONN_DISCONNECTED
When an ACL changes state to disconnected, all associated ISO channels
must be disconnected and cleaned up. This commit ensures that.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-06-16 10:38:38 +02:00
Lingao Meng
c45ec6fc0d Bluetooth: Mesh: Fix missing proxy send status
Add an error judgment during `proxy_send` to avoid
missing `net_buf_unref`.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-06-16 11:01:41 +03:00
YanBiao Hao
f6d7f8f36f bluetooth: mesh: sequence number limit config
set sequence number limit by Kconfig

Signed-off-by: YanBiao Hao <haoyanbiao@xiaomi.com>
2021-06-15 12:51:50 +03:00
Flavio Ceolin
4f609886de pm: Fix policy manager header
Policy manager header has to be in the include for applications.
Also it had several function prototypes that are not part of the policy.
These functions were moved from the policy header to a dedicated private
header.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-06-14 21:48:27 -04:00
Vinayak Kariappa Chettimada
97598c4d61 Bluetooth: controller: Yield scan window when scanning Aux PDUs
Use ticker_yield_abs interface to make scan window on
primary channel to yield when trying to scan auxiliary PDUs.

Fixes #30244.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-14 15:19:33 +02:00
Vinayak Kariappa Chettimada
bce82ad49b Bluetooth: controller: Add ticker_yield_abs interface
Add ticker_yield_abs interface to reduce ticks_slot_previous
value when radio events yield/stop earlier than their time
reservations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-14 15:19:33 +02:00
Trond Einar Snekvik
f2579cb3f2 Bluetooth: Mesh: Increase default CDB node count
The old default of 1 makes provisioner devices useless, as they can only
provision themselves before they run out of space.

Increase the default value for CONFIG_BT_MESH_CDB_NODE_COUNT to 8.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-06-14 15:19:07 +02:00
Emil Gydesen
b450e63f28 Bluetooth: Audio: AICS use bt_aics instead of bt_aics_server
Modify aics.c to use the bt_aics struct instead of the
bt_aics_server struct. This is done so that there is less
difference between the internal struct usage and the struct
type used in the API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 14:54:59 +02:00
Emil Gydesen
6b2cc7e57e Bluetooth: Audio: Rename bt_vcs to bt_vcs_included
Rename the struct from bt_vcs to bt_vcs_included, and
rename bt_vcs_get to bt_vcs_included_get as that is more
descriptive of the value returned.

Furthermore, this will also allow us to use bt_vcs as
an opaque pointer to a VCS service instance (local
or remote) to match the service instance pointers of
AICS and VOCS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 14:25:55 +02:00
Emil Gydesen
d52b4ac4bf Bluetooth: Audio: Rename bt_mics to bt_mics_included
Rename the struct from bt_mics to bt_mics_included, and
rename bt_mics_get to bt_mics_included_get as that is more
descriptive of the value returned.

Furthermore, this will also allow us to use bt_mics as
an opaque pointer to a MICS service instance (local
or remote) to match the service instance pointers of
AICS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 14:25:49 +02:00
Emil Gydesen
b683bea5d7 Bluetooth: Audio: VOCS client add function to get conn pointer
Add a function that returns the bluetooth connection
pointer of a given VOCS client instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-14 14:25:42 +02:00
Kiril Petrov
613677daf8 net: lwm2m: fix build with bootstrap enabled
After lwm2m async io was introduced with 32989a38f0,
one instance of function lwm2m_send_message() was left unchanged,
and makes build to fail when boostrap support is enabled.

Signed-off-by: Kiril Petrov <retfie@gmail.com>
2021-06-14 14:10:36 +03:00
Kiril Petrov
a0fd010455 net: lwm2m: code clean-up after switch to async socket io
Three is no need to check return code as lwm2m_send_message_async()
never fails.

Signed-off-by: Kiril Petrov <retfie@gmail.com>
2021-06-14 14:10:36 +03:00
Jukka Rissanen
10762673db net: shell: Add more Ethernet capability strings
Add descriptions for Qbv, Qbu and TXTIME capability bits.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-06-14 07:00:10 -04:00
Kweh Hock Leong
77d8662454 net: eth: Add TXTIME configuration support
Allow caller to either set or receive per queue Ethernet TXTIME
configuration option.

Signed-off-by: Kweh Hock Leong <hock.leong.kweh@intel.com>
2021-06-14 07:00:10 -04:00
Jukka Rissanen
44efc18a78 net: eth: Add Qbu configuration support
Allow caller to either set or receive various Ethernet Qbu
configuration options defined in IEEE Std 802.1Qbu-2016
specification.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-06-14 07:00:10 -04:00
Jukka Rissanen
d0a45e243f net: eth: Add Qbv configuration support
Allow caller to either set or receive various Ethernet Qbv
configuration options defined in IEEE Std 802.1Qbv-2015
specification.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-06-14 07:00:10 -04:00
Lingao Meng
7531d2e3c8 Bluetooth: Mesh: Add proxy send callback
Zephyr Bluetooth Mesh did not check whether the proxy message
was actually sent out, so that the response message could
not be received during reset. It did not solve the status
callback of the proxy sending message, so a new problem was
introduced after PR(#28457) merged.

bt_mesh_prov_send(&buf, public_key_sent))

This PR will try to solve the above problem, and will fix
the problem due to thread competition, and PR(#26668) will
not be necessary.

Compared with PR(#30138), it no longer consumes extra RAM
space and supports synchronization of group addresses

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-06-14 11:52:21 +03:00
Lingao Meng
a63f2d8d60 Bluetooth: Mesh: Reconstructing adv callback logic
The adv callback logic is reconstructed to coexist
with proxy send callback.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-06-14 11:52:21 +03:00
Dominik Dess
f55c473a06 net: lwm2m: lwm2m stops sending messages after encountering signals on send
Fixed issue that caused message to be not correctly reset even after
 it is consumed after send sets errno to EAGAIN or EWOULDBLOCK

Signed-off-by: Dominik Dess <dominik.dess@grandcentrix.net>
2021-06-12 08:51:08 -05:00
Kumar Gala
3f149f0828 bluetooth: Removed deprecated bt_set_id_addr function
The function have been deprecated for 2 releases so remove the code
associated with it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-11 16:35:19 -05:00
Piotr Pryga
15375d4478 Bluetooth: controller: Fix wrong channel index in IQ samples report
Fix wrong channel index send by controller in connectionless
IQ samples report. Former implementation reported value from
lll->data_chan_id which is not valid channel index.
Updated implementation reports value stored in IQ samples receive
node during periodic scanning event preparation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-06-11 17:14:29 +02:00
Morten Priess
fa20fa95d0 Bluetooth: controller: Improve ticker_by_next_slot_get
Fixes ticker_by_next_slot_get for JIT scheduler by allowing iterating
through ticker nodes without ticks_slot information, and improves
performance for legacy ticker scheduling use.

To reduce the processing and context switching overhead, a new feature
is introduced via BT_TICKER_NEXT_SLOT_GET_MATCH, by which an operation
callback may be added via the ticker_next_slot_get_ext interface, and
the match function is then called when the ticker_job is processing the
request.
By returning true in this callback, iteration stops and normal operation
callback is invoked. If the match function returns false, node iteration
continues. This reduces the number of ticker_job executions for node
iteration.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-06-11 16:18:55 +02:00
Joakim Andersson
d97186e1ec mgmt: mcumgr: smp_bt: Use UUID encode macro for 128-bit UUIDs
Use UUID encode macro fro 128-bit UUIDs for readability. This makes
it easier to see which service you are working with as the
bt_uuid_to_str prints the 128-bit UUIDs in this format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-06-11 16:13:35 +02:00
Joakim Andersson
946cf25f78 Bluetooth: shell: Use UUID encode macro for 128-bit UUIDs
Use UUID encode macro fro 128-bit UUIDs for readability. This makes
it easier to see which service you are working with as the
bt_uuid_to_str prints the 128-bit UUIDs in this format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-06-11 16:13:35 +02:00
Emil Gydesen
18f1745d29 Bluetooth: ISO: Add packet status flag to iso recv info
Add the packet status flag value to the iso receive info
struct. This will allow an application to handle potential
lost or erroneous messages.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-11 16:12:34 +02:00
Pavel Vasilyev
65f798a00a Bluetooth: Mesh: Add API to manually store pending RPL entries
The current approach with storing RPL by timeout doesn't solve all
issues as the node may loss power before the timer is fired.
In addition to that this may wear out flash quickly if short timeout is
used.

This change adds an API to store the pending RPL entry upon user
request. Additional Kconfig option allows to completely disable timer
so that the whole storing relies on the user.

The mesh stack still stays responsible for outdating RPL entries in case
of IV Index update as this happens implicitly for the user.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-06-11 15:47:09 +02:00
Bartosz Bilas
75a2ef8fc0 shell: allow disabling VT100 commands
Allow the user to disable VT100 commands to have a plain shell
without terminal emulation in order to avoid a lot of garbage
ASCII characters in shell output.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2021-06-11 09:22:31 +02:00
Pavel Vasilyev
f5ba999257 Bluetooth: Mesh: Fix setting remote public key in provisioner
This aligns provisioner and provisionee APIs in terms of endianess
of public key provided by an application.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-06-10 17:14:03 -04:00
Pavel Vasilyev
0335d5fb01 Bluetooth: Mesh: Add OOB Public Key support for provisionee role
This commit allows an unprovisioned device to exchange its public key
using out-of-band techology (see MeshPRFv1.0.1, table 5.19 and section
5.4.2.3).

For in-band public key exchange, the mesh stack uses HCI commands to
generate public and private keys, and DH key. This, however, doesn't
work for OOB public key exchange since there is no command to generate
DH key with a private key provided by an application. Therefore, this
commit adds direct usage of TinyCrypto into the mesh stack for DH key
generation for OOB public key support.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-06-10 17:14:03 -04:00