Commit graph

12719 commits

Author SHA1 Message Date
Kumar Gala c3d65b7f6b emul: espi: Remove unused struct element
espi_label struct element wasn't used anywhere so remove it.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 10:53:02 +02:00
Asbjørn Sæbø 15e025fd20 Bluetooth: Audio: Use common function for discovery complete
Use the same function at discovery complete, whether discovery failed
or succeeded.
Rename the discovery_failure() to discovery_complete(), and use that
also when discovery completes successfully.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-07-08 09:36:18 +02:00
Asbjørn Sæbø 0142bf9484 Bluetooth: Audio: MCC - serialized subscription after discovery
The media control client used to subscribe to GMCS characteristics as
the characteristics were discovered, in effect queuing ATT requests.

Since then, the ATT MTU exchange has become automatic, leading to
larger ATT MTUs and more discovered characteristics per ATT response,
which again lead to the client enqueuing more subscriptions and
running out of buffers, with discovery failing as a result.

This commit moves the subscription to GMCS characteristics to a
separate sequence, so that it happens serially after discovery, rather
than in parallel with the discovery.

- Remove separate discovery parameters for the characteristics - they
  are no longer needed.
- Add a subscription callback and a couple of subscription functions

The subscription for characteristics for the included OTS has not been
modified.  Only two of these are subscribed to, and doing that is
currently not a problem.  And I need to better understand the
interaction with OTS and how these subscriptipons are used.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>

Refactor subscription to get chaining into callback
2022-07-08 09:36:18 +02:00
Asbjørn Sæbø d4b612c615 Bluetooth: Audio: MCC - warn on subscription failure
Add warning if subscription to characteristics fails.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-07-08 09:36:18 +02:00
Asbjørn Sæbø 6c2b8e6e65 Bluetooth: Audio: MCC - refactor subscription
Move subscription to characteristics to separate function.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-07-08 09:36:18 +02:00
Asbjørn Sæbø 542e99b859 Bluetooth: Audio: Media - refactor include discovery start
Move the start of discovery of included services to a separate
function, in preparation for rewriting discovery.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-07-08 09:36:18 +02:00
Erik Brockhoff daf327de40 bluetooth: controller: Fixing feature API re. non standard bool typedef
When bool is typedef'ed to for instance char the cast from 64 bits
is not so good. Now using an explicit 'cast' to true/false

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-08 09:36:00 +02:00
Erik Brockhoff 3fbfb6537e bluetooth: controller: Implements Peripheral CIS Create Procedure
Implements PDU flow and unittest of CIS Create on Peripheral
Hooks CIS Create into the controller and fixes a few minor
things in ull to allow for running with NEW LLCP
Also handles CONFIG based comilation of CIS Create

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-08 09:36:00 +02:00
Erik Brockhoff 6cf357bd9d bluetooth: controller: Integrate CIS Terminate with controller
Hooks the CIS terminate into the controller and fixes a few minor
things in ull_conn(_iso).c
Also handles CONFIG based comilation of CIS_TERMINATE
also fixes a minor issue in helpers_pdu

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-08 09:36:00 +02:00
Erik Brockhoff 22ddc01f36 bluetooth: controller: CIS Terminate Procedure PDU flow and unittest
Implementing PDU flow and unittest for PDU flow of CIS Terminate.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-08 09:36:00 +02:00
Andrei Emeltchenko 5b633db288 ztest: Add Z_TEST_SKIP_IFNDEF macro
Add macro Z_TEST_SKIP_IFNDEF which is used when you want to skip test
if configuration option is not enabled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-07-07 15:07:02 -04:00
Adrian Bonislawski b3beafcbac logging: cavs_hda: Allow format timestamp
LOG_BACKEND_CAVS_HDA supports LOG_BACKEND_FORMAT_TIMESTAMP

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-07-07 17:58:56 +00:00
Yuval Peress 10feb693f5 unittest: support ztest_new_api
Add support for the new Ztest API when using unittest.

Fixes #47420

Signed-off-by: Yuval Peress <peress@google.com>
2022-07-07 18:22:14 +02:00
YanBiao Hao 93df0e6d86 Bluetooth: Mesh: Removing the duplicated entry
Removing the duplicated entry net_transmit_status

Signed-off-by: YanBiao Hao <haoyanbiao@xiaomi.com>
2022-07-07 15:50:02 +00:00
YanBiao Hao 076843fae5 Bluetooth: Mesh: async cfg client api
support node reset status, TTL status, friend status,
network transmit status, GATT proxy status, beacon status

Signed-off-by: YanBiao Hao <haoyanbiao@xiaomi.com>
2022-07-07 15:50:02 +00:00
Pavel Vasilyev 4808f6f82a Bluetooth: Mesh: Don't open prov link after being provisioned
It is possible to open provisioning link again after being provisioned.
Though this has no immediate consequences, the node shall not open
provisioning after being provisioned.

Reset link.cb so that any following provisioning advs are dropped.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-07-07 15:47:59 +00:00
Pavel Vasilyev 0f27ecd29b Bluetooth: Mesh: Fix mesh shell compilation without provisionee support
cmd_pb_adv and cmd_pb_gatt are only used when provisionee role is
supported. They should not be compiled if provisionee role is disabled.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-07-07 10:01:09 +02:00
Thomas Ebert Hansen 154d67d90b Bluetooth: controller: llcp: Fix data pause/resume
llcp_tx_pause_data() calls ull_tx_q_pause_data() for each pause_mask,
while llcp_tx_resume_data() only calls ull_tx_q_resume_data() when
conn->llcp.tx_q_pause_data_mask == 0 leading to an unbalanced number of
calls to ull_tx_q_pause_data()/ull_tx_q_resume_data() which can leave
the data path of the TX Q paused.

Fix such that only the first call to llcp_tx_pause_data() will pause the
data path of the TX Q.

Add unit test to verify correct pause/resume behavior.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-07-07 10:00:44 +02:00
Pieter De Gendt aba4c4ea3e uart_pipe: move driver from console to serial
The uart_pipe driver is not dependent on any console driver,
however a serial driver is required.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-07 09:59:49 +02:00
Emil Gydesen 5a79445feb Bluetooth: ISO: Add connecting->disconnecting state transition
Add the state transition from connecting to disconnecting
as a valid transition for ISO. This can occur if a ISO channel
is disconnected before it is fully connected, of if a BIG
or a BIG sync is terminated before established.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Emil Gydesen 05ace181d7 Bluetooth: Audio: Add enabling state to broadcast source
There is a brief period between the bt_iso_big_create
and when the ISO channels are established. In this state
it should be possible to call bt_audio_broadcast_source_stop
to stop the BIG from being created.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Emil Gydesen 590ab0567c Bluetooth: Audio: Fix state check in bass
Fix bad state check in biginfo_recv in bass.c which
would cause null-pointer access.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-07 09:59:17 +02:00
Aaron Massey 83253023cf ztest: Track skipping test versus entire suite
The addition of the assumption API introduced a bug where a skipped test
would subsequently skip later tests within the same suite. A skipped test
was being treated as an entire skipped test suite.

Keep track of tests being skipped due to skipping in the suite setup versus
being skipped within their test function.

TEST=west build -p -b native_posix tests/kernel/condvar/condvar_api/ -t run
TEST=twister -T tests/ztest -p native_posix

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2022-07-06 18:50:35 -04:00
Damian Krolik fc9f59ce0f shell: fix synchronization in log immediate mode
When LOG_MODE_IMMEDIATE is used, logs processed by the shell
log backend may be intertwined with messages printed by
shell commands running on the shell thread.

It is because the shell uses a mutex while the shell log
backend uses the IRQ lock for synchronization. Switch the
latter to use the mutex as well whenever it's possible.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2022-07-06 17:59:32 +00:00
Anas Nashif 718750f962 fs/testsuite: add mising braces to single line if statements
Following zephyr's style guideline, all if statements, including single
line statements shall have braces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 11:00:45 -04:00
Anas Nashif 077c979f6c debug: coredump: add mising braces to single line if statements
Following zephyr's style guideline, all if statements, including single
line statements shall have braces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 11:00:45 -04:00
Anas Nashif 2d4759ec17 Bluetooth: controller: add mising braces to single line if statements
Following zephyr's style guideline, all if statements, including single
line statements shall have braces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 11:00:45 -04:00
Anas Nashif 0aefa654da net: add mising braces to single line if statements
Following zephyr's style guideline, all if statements, including single
line statements shall have braces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 11:00:45 -04:00
Erik Brockhoff 1ff458ec87 Bluetooth: controller: llcp: fixing tx buffer queue handling
Misc. fixups to get the tx buffer alloc mechanism to work as intended

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-07-06 13:08:09 +02:00
Juha Heiskanen d4bf2ad6cc net: lwm2m: Fix socket offload and native TLS conflict
Removed auto select from LWM2M_DTLS_SUPPORT
* TLS_CREDENTIALS
* NET_SOCKETS_SOCKOPT_TLS
* NET_SOCKETS_ENABLE_DTLS

LwM2M stack shouldn't enforce these options as they
are not needed with socket offloading.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2022-07-06 11:28:19 +02:00
Kumar Gala a204d16bfb ec_host_cmd: Convert to DEVICE_DT_GET
We are working on phasing out use of the devicetree 'label'
property.  We can use DEVICE_DT_GET and drop use of DT_LABEL.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:12:32 +02:00
Emil Gydesen 504feb77c4 Bluetooth: Audio: Updated samples and shell to use seq_num
Update the samples and the shell to use the sequence number
and timestamp when sending.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 11:03:27 +02:00
Emil Gydesen aabe7f4835 Bluetooth: Audio: Add seq_num and ts to bt_audio_stream_send
Added sequence number and timestamp to the bt_audio_stream_send
function. This allows an application to better
control the audio transmission, as it can schedule
one or more audio streams to send a buffer in a specific
SDU interval (ensuring that e.g. left and right is sent in
the same SDU interval).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 11:03:27 +02:00
Aleksandar Radovanovic 69690e3505 ipc_service: static_vrings: Fix TX virtqueue alignment
This patch fixes an issues where the TX virtqueue is misaligned by
2 bytes due to the way the virtqueue start address is calculated.
It is currently set to immediatelly follow the RX virtqueue:

    vr->tx_addr = vr->rx_addr + vring_size(num_desc, VRING_ALIGNMENT);

but the RX virtqueue does not end on an aligned boundary (last field,
avail_event is uint16_t). The resulting misaligned virtqueue causes
alignment faults on architectures that do not support unaligned
accesses (and is suboptimal otherwise)

The fix is to realign tx_addr to requested VRING_ALIGNMENT.

Signed-off-by: Aleksandar Radovanovic <aleksandar.radovanovic@amd.com>
2022-07-06 11:03:04 +02:00
Emil Gydesen 2fd3fcedcd Bluetooth: Audio: Remove CSIS minimum set size requirement
The requirement was removed by
https://www.bluetooth.org/errata/errata_view.cfm?errata_id=17007
and the implementation has been updated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:58:08 +02:00
Fredrik Danebjer 2283aad798 Bluetooth: Audio: Removed Streaming Context from LC3 PAC Record
This fix removes the Streaming_Audio_Context LTV from the LC3 Codec
helper macro, and subsequently a faulty exposure of this LTV in the
PAC records used.

Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
2022-07-06 10:46:22 +02:00
Emil Gydesen 8e08d79676 Bluetooth: Audio: Rename MICP mic_dev disable to mute disable
Made it more clear that the disable functionality is to
disable the mute functionality, but and not disabling
the microphone device itself.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen 28f6e37ba8 Bluetooth: Audio: Rename struct bt_micp and cleanup
Rename struct bt_micp to bt_mic_ctlr as it is only
used ofr microphone controller now.

This also allow cleanup of the bt_micp struct, thus
removing the common internal micp_internal.h header file
and reducing the size of the implementation by not
using a union of the structs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen c8a6a51566 Bluetooth: Audio: Remove bt_micp argument for MICP mic_dev API
Since there is a split API now, the mic_dev does not need
to take a bt_micp pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen e95b640df6 Bluetooth: Audio: Specify MICP Mic Dev API
Modify the existing bt_micp API for the
MICP Microphone Device to be more specific
by adding mic_dev as an infix. This follows
the naming scheme used for the MICP microphone
controller (mic_ctlr).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen 3cf59fae72 Bluetooth: Audio: Add separate API for MICP mic ctlr
Add a bt_micp_mic_ctlr API that is used only
for the MICP Microphone Controller (Client).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen ff509027c1 Bluetooth: Audio: Rename bt_micp_aics functions
The AICS functionality is also possible via the bt_aics
API, and this was just a way to ensure that the AICS
instance was part of a MICS.

Removing makes MICP much simpler, and we can expect user
to know the context of a AICS.

This also fixes a few bad/missing guards.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen 1245da298e Bluetooth: Audio: Rename remaning MICS files to MICP roles
Rename mics => micp_mic_dev (MICP Microphone Device)
Rename mics_client -> micp_mic_ctlr (MICP Microphone Controller)

This does not change any lines in the code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen 9eb5d0795f Bluetooth: Audio: Rename MICS to MICP
Use the profile abbreviation, MICP, instead of the
service abbreviation, MICS, for the MICP implementation.

The server implementation will use MICP and the client
implementation will use MICP_CLIENT for now, as that will
be updated in a future commit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Emil Gydesen 67e570ea7e Bluetooth: Audio: Rename mics.h the Kconfig to micp
Rename the files to match the name of the profile (MICP)
instead of the service (MICS).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 10:41:52 +02:00
Gerard Marull-Paretas 32b9934b0f pm: remove PM_DEVICE_ACTION_FORCE_SUSPEND
PM_DEVICE_ACTION_FORCE_SUSPEND has been equivalent to
PM_DEVICE_ACTION_SUSPEND for a while. Release notes for Zephyr 2.7
mentioned its removal (see 76702e8ff3) but
for some reason it was kept.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-06 10:30:14 +02:00
Andreas Chmielewski 363e2f3014 net: coap: make coap vars configurable
COAP_DEFAULT_MAX_RETRANSMIT and COAP_DEFAULT_ACK_RANDOM_FACTOR
should be configurable to determine the max transmission
timeout of a CoAP packet.

Signed-off-by: Andreas Chmielewski <andreas.chmielewski@grandcentrix.net>
2022-07-05 21:56:34 +00:00
Enjia Mai 5a57e0264e samples: subsys: tracing: No tracing during switch in/out using EFI console
Due to the limitation of the current x86 EFI cosnole implementation,
we skip hte printk which is called by tracing API:
sys_trace_thread_switched_in_user/out_user.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-05 16:52:32 -04:00
Enjia Mai d1f2aa5516 logging: add a logging backend of EFI console
Add a EFI console logging backend to support logging sub-system.
To fix those testcases have no log output due to no logging backend.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-07-05 16:52:32 -04:00
Fredrik Danebjer 961bc352f3 Bluetooth: Audio: Fix bad buffer pointer in get_pac_records
This change fixes a buffer use from pointer-by-value to correctly
intended pointer.

Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
2022-07-05 19:59:40 +02:00