Commit graph

15305 commits

Author SHA1 Message Date
PawelX Dobrowolski 0bff695d2c coredump: Intel ADSP memory window backend
For debug usage is added backend for memory window.
Coredump is being dumped in raw data. It needs to be converted to
ACSII for later analysis. Data is written to telemetry slot
in memory window which is a space where is located all debbug
information.

Signed-off-by: PawelX Dobrowolski <pawelx.dobrowolski@intel.com>
2023-05-17 14:10:49 -04:00
Fredrik Danebjer f3fdb1f96f Bluetooth: Audio: Make VCS optional notify characteristics optional
This change makes VCS Volume Flag characteristic Notify property
optional and selectable through Kconfig.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-05-17 19:26:54 +02:00
Andrei Emeltchenko 303a0af68f net: tcp: Make sure we shift by less then bit width
Shifting "timeout <<= conn->zwp_retries" by more then 63 bits results in
undefined behaviour.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-05-17 19:26:44 +02:00
Tomasz Moń 7ba5ecf451 usb: device_next: report medium error on Mass Storage failed writes
End Write command with Medium Error / Write Error when underlying disk
write or sync fails.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-05-17 11:45:45 +02:00
Tomasz Moń 3532c2563a usb: device_next: accept padded Mass Storage CDBs
Universal Serial Bus Mass Storage Specification For Bootability requires
that device shall accept Bulk-Only-Transport bCBWCBLength of 12 for all
commands documented in the specification. Allow padding for commands
documented in Bootability specification, but leave others intact.

This fixes Request Sense on Windows 11 which previously failed due to
bCBWCBLength being 12 instead of 6.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-05-17 11:45:45 +02:00
Dominik Ermel ac38411e2e mgmt/MCUmgr/grp/img: Rework image list to support DirectXIP
Image list will only report active flag for active image and pending
flag for other slot, but only if image in that slot has higher
version than currently running image.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-05-17 09:47:54 +02:00
Krishna T b7cabb72fa net: wifi: Fix typo in event
Wrong macro was copied, this causes the event to fail.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-05-16 11:41:43 -04:00
Krishna T 2c129609d0 net: context: Set priority based on DSCP
If a socket has DSCP set then the packets from the socket should also be
marked with appropriate priority in case traffic classes are used in
networking stack.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-05-16 13:21:25 +02:00
Krishna T 10f3ca2e1d net: wifi: Add an event for disconnect complete
This is needed for applications that rely on WPA supplicant being
in disconnected state before issue subsequent commands (e.g., issue scan
immediately after disconnect fails, until disconnect is completed).

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2023-05-16 13:21:10 +02:00
Vinayak Kariappa Chettimada 9ff23ed029 Bluetooth: Controller: Fix Central CIS SN/NESN for skipped events
Fix Central CIS SN and NESN for skipped events during CIS
setup. It is possible that CIG event may overlap the ACL or
other events at the CIS create instant, and hence have non
zero lazy value during the CIS setup events until CIS is
established.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-05-16 13:20:15 +02:00
Vinayak Kariappa Chettimada 3b3d53f09e Bluetooth: Controller: Fix CIS offset_min for dissimilar interval
Fix CIS offset_min calculation to consider that ACL interval
and ISO interval can be dissimilar and the offset value has
to be compensated for the latency until the instant at which
the offset is used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-05-16 13:20:15 +02:00
Vinayak Kariappa Chettimada 22e67eac6e Bluetooth: Controller: Fix sn on Peripheral CIS event abort
Fix SN value on Peripheral CIS event abort. Adjust the SN
value based on the burst number such that the ISO data where
transmitted as normal.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-05-16 13:20:15 +02:00
Andrei Emeltchenko 2c0fcdf22b bluetooth: shell: Add missing return
Avoid invalid bit shift by adding return.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-05-16 12:08:06 +02:00
Yuval Peress 7153157f88 rtio: Add support for multishot reads
- Introduce multishot reads which remain on the SQ until canceled

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-15 10:10:12 -04:00
Yuval Peress 2c30920b40 rtio: add cancel support
- Add a new API `rtio_sqe_cancel` to attempt canceling a queued SQE
- Add a new syscall `rtio_sqe_copy_in_get_handles` which allows getting
  back the SQE handles generated by the copy_in operation so that they
  can be canceled.

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-15 10:10:12 -04:00
Emil Gydesen c66f210f6b Bluetooth: BAP: Broadcast source fix idle state
The idle state was never set, thus providing a poorly
implemented state machine. Updated the code so that unused
code was removed and so that the idle state is properly set.

Optimized the way that a state is set for all endpoints
for a broadcast source with a new function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-15 15:26:14 +02:00
Sjors Hettinga a28a656aa0 net: tcp: Avoid double acknowlegding retransmitted data
In the FIN_WAIT_1 any incoming data is dropped, but anknowledged. Add a
check to see if the data is already acknowleged to prevent double
acknowledging of the data and bringing the acknowlegde counter out of
sync. When the acknowledge counter gets out of sync, the connection will
never properly terminate any more.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2023-05-15 15:25:51 +02:00
Vinayak Kariappa Chettimada 354226022e Bluetooth: Controller: Fix peer ISO feature support check
Fix peer ISO feature support check, by using feature support
bit instead of whether locally supported bit value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-05-15 13:38:38 +02:00
Vinayak Kariappa Chettimada 0249006813 Bluetooth: Controller: Use swapped role specific features bit
Use swapped role specific features bit to calculate features
usable by local device, on feature exchange procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-05-15 13:38:38 +02:00
Vinayak Kariappa Chettimada fe53891788 Bluetooth: Controller: Fix Central ISO establish assertion failure
Fix Central ISO assetion failure on being established due to
regression in commit a53d89450a ("Bluetooth: controller:
fixing CIS establish flow for refactored LLCP") that
required changes due to Create CIS LLCP being refactored.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-05-15 13:38:38 +02:00
Herman Berget 93f36d4bff Bluetooth: Host: Fix double conversion of phy
The phy was converted both when reading from the event
and when reading from the sync, leading to incorrect
value in the synced callback.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2023-05-15 13:10:29 +02:00
Emil Gydesen 6862884f87 Bluetooth: BAP: Broadcast sink fix interval to timeout calc
The calculation in interval_to_sync_timeout did not take into
account that the periodic advertising sync interval was in units
of 1.25ms, and not ms.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-15 10:53:54 +00:00
Gerard Marull-Paretas a8b36ffb4d bluetooth: mesh: use STRUCT_SECTION_ITERABLE_ARRAY
STRUCT_SECTION_ITERABLE cannot be used with arrays, because of
preprocessor tokenization issues.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-15 18:52:07 +09:00
Jamie McCrae f59b857f6a mgmt: mcumgr: smp: Convert functions to function pointer array
Converts the list of functions for registering an MCUmgr SMP
transport from function arguments to a single list which contains
the function pointers.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-15 10:23:35 +02:00
Jamie McCrae 6f5b974949 mgmt: mcumgr: Add command result codes (ret)
Adds a new map to responses that command handlers can use to
return result codes of functions themselves, unrelated to SMP
error codes. This is achieved by adding an optional "ret" map
which contains a 16-bit "group" and 16-bit "rc" error code,
this map will not be included if the "ret rc" is 0 (which
implies success).

In order to allow this, a new version of the protocol has been
which can be indicated for use by setting a bit in the header.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-15 09:27:16 +02:00
Lukas Woodtli fb924e2b62 net: lwm2m: Handle CONTINUE in registration message
The continue code is not considered an error in case of
block-wise transfer.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-05-15 09:18:09 +02:00
Lukas Woodtli 73fb4e73a8 net: lwm2m: Handle CONTINUE response and send new block
After sending a CoAP block and receiving the CONTINUE response
code the next block is sent.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-05-15 09:18:09 +02:00
Lukas Woodtli 49f8d08f98 net: lwm2m: Split message into blocks for sending
Add functionality that creates blocks from a big payload body.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-05-15 09:18:09 +02:00
Lukas Woodtli 3707a0d229 net: lwm2m: Provide buffer for block transfer
Allow to use a buffer for the complete message body if block transfer is
enabled. This buffer is used when serializing the message. For sending
the message the body is split into blocks.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-05-15 09:18:09 +02:00
Lukas Woodtli 12de4018ef net: coap: Add function for getting BLOCK1 option
The function gets the the BLOCK1 option from a received message
and extracts the block number, block size and has-more flag from
it.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-05-15 09:18:09 +02:00
Lukas Woodtli db480169a0 net: coap: Add function for inserting block option for sending
The function adds a block option to a CoAP message. If the message
is a request the BLOCK1 option is added. Otherwise (response) the
BLOCK2 option is added.

Signed-off-by: Lukas Woodtli <lukas.woodtli@husqvarnagroup.com>
2023-05-15 09:18:09 +02:00
Dawid Niedzwiecki 65bd27246f mgmt: ec_host_cmd: fix node chosen strings
Update the backend device node chosen strings.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-05-15 09:16:53 +02:00
Emil Gydesen 07f32b732a Bluetooth: ASCS: Add support for long writes
Add support for long writes to the control point
to handle e.g. metadata that's larger than the MTU.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen 8c4908b3f2 Bluetooth: ASCS: Add support for long read
Increase the size of the ase_buf to support
the maximum size of the Codec Configuration
and Metadata.

The ase_buf is not also guarded by a semaphore, so no
more than one thread will use it at any time. This is
needed as ase_status_changed can be called from multiple
threads.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen 572055e205 Bluetooth: Audio: Add long read support to BAP unicast client
Add support for long read by adding a read_buf and store
the data when long data is being read.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen 892819ede8 Bluetooth: Audio: ASCS ASE discover by UUID added
Instead of using the read by UUID, we do a "proper"
discover by UUID. The reason for this is that read by
UUID is not mandatory in the BAP specs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen be781b2a56 Bluetooth: Audio: PACS context discover by UUID added
Instead of using the read by UUID, we do a "proper"
discover by UUID. The reason for this is that read by
UUID is not mandatory in the BAP specs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen ec1b2a1844 Bluetooth: Audio: PAC discover by UUID added
Instead of using the read by UUID, we do a "proper"
discover by UUID. The reason for this is that read by
UUID is not mandatory in the BAP specs, and that we need
to do a long read on the PAC records anyhow, and that
cannot be done with the read by type/UUID.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen ba19bf3d96 Bluetooth: Audio: Add unicast_client struct
Add a new struct unicast_client to hold all the conn-specific
data for the Unicast Client implementation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen 3ff3d8db2c Bluetooth: PACS: Set PACS read_buf size to BT_ATT_MAX_ATTRIBUTE_LEN
The maximum size of the characteristic is BT_ATT_MAX_ATTRIBUTE_LEN.
The previous size limited the size of the characteristic to
the maximum possible MTU, thus not utlizing support for the
Read Long procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen 3d4622b4d4 Bluetooth: PACS: Fix bad __ASSERT condition
__ASSERT(true will never be triggered.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen 5a28d80893 Bluetooth: PACS: Removed unused conn arg from get_pac_records
The `conn` argument was not used.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Emil Gydesen 98adaf0811 Bluetooth: PACS: Add read_buf_sem
Add a semaphore to guard the read buf. The reason for this
is that the read buf is populated from either the BT RX
thread, or the workqueue thread. The semaphore ensures
that both threads will never have attempted to
add any data to the buffer at the same time.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-12 15:29:17 +02:00
Erik Brockhoff 5ca6724664 Bluetooth: controller: adding release of rx/tx nodes retained in LLCP
On connection clean-up release nodes held by LLCP. These are released
in two steps, first on LLCP terminate (in local/remote) by moving
to rx/tx_node_release chains, and then on conn_cleanup_finalize
nodes are released back to appropriate mem-pool/queue.
Rename abort functions to refer to terminate.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-05-12 12:53:16 +02:00
Erik Brockhoff eece00e4b0 Bluetooth: controller: updating TX node pre-alloc store mechanism
Instead of using the node ref used for TX ack for storing a TX node
pre-allocated in case of NTF RX node availability delay, introduce a
separate store to TX node. This to avoid misunderstanding on clean-up
in terminate flow.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-05-12 12:53:16 +02:00
Erik Brockhoff a53d89450a Bluetooth: controller: fixing CIS establish flow for refactored LLCP
Latest modification to LLCP removed 'monitoring' of cis->established
flag in LLCP, relying instead on signal through ULL.

For this to work properly the signal must also be generated, so this is
introduced. Note - checking of cis->established flag could be removed
if caller ensures only calling once (on establish condition)

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-05-12 12:53:16 +02:00
Erik Brockhoff 998512f59b Bluetooth: controller: use RX node piggy-back for NTF when possible
When possible re-use the already allocated RX node for notifications.
Store (retain) RX node and Link element on RX if NTF could occur.
Pass link element to LLCP (ull_cp_rx()) together with RX node.
New RX node type RETAIN introduced to signal retention

When no RX node is available allocate one and hold off TX on procedures
until such time that a node is available for NTF.

In case waiting for NTF buffer avail is needed, allocate and store TX
node to use for TX once NTF becomes available.

CIS Established (incl. timeout handling) is now handled entirely as a
specific event driven by ull_conn_iso - ie removal of procedure check
of cis->established and cis->expire, as this is doubling mechanism
in the conn_iso context.

Unit test and helpers updated to handle new node type.
Function ull_cp_release_ntf() was used only in unit test, so moved to
helper context.
Updating release_ntf to handle the fact that with piggy-backing in test
context the node used for NTF can be from two different memory pools

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-05-12 12:53:16 +02:00
Ajay Parida e70bb70651 net: wifi_mgmt: Support to provide raw scan data
Support to provide raw beacon and probe response data
to registered application.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-05-12 10:50:21 +00:00
Gerard Marull-Paretas d0e58ad0a6 device: use iterable sections
Use iterable sections to handle devices list. This simplifies devices
implementation by using standard APIs.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-12 12:01:10 +02:00
Gerard Marull-Paretas f0db892d7b toolchain: add trailing _ to iterable section name
Add a trailing _ to the section iterable name. This is useful, for
example, to implement numeric sorting like this:

SORT(.z_device_LEVEL_?_)
SORT(.z_device_LEVEL_??_)

Without the trailing _ it would not be possible to use the ?? wildcard
without triggering into trigraphs issues, because linker-defs.h header
is included in C files as well.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-12 12:01:10 +02:00