Commit graph

21541 commits

Author SHA1 Message Date
Yong Cong Sin
74537fc87a subsys/profiling: SYS_INIT not required
The timer & dwork can be statically initialized,
SYS_INIT is not strictly required.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
af7eb76ba4 subsys/profiling: shell cmd function should be static
These shell cmd function should be static.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
e330971ec5 subsys/profiling: kill timer in a single place
Currently, the timer is stopped:
- in the timer handler, when the buffer is full, or
- in work handler, when time's up

In any cases, the work handler is bounded to run to print
the message, so we can kill the timer there instead.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
d68642c732 subsys/profiling: add some util cmds
Added:
- `clear` to discard the buffer without printing
- `info` to print info about the buffer and if the
  profiler is running

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
8fc6d8adf2 subsys/profiling: use a more universal message when perf is running
"Perf is already running" works for `record` but is a little
strange when doing `printbuf`, so remove the "already" to
make it more universal.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
d4cd1be390 subsys/profiling: reset buf_full flag when we empty the buf
The `buf_full` flag is set when it is full, but dumping the
buf currently only resets the `idx`, this means that the perf
command only works when the buffer hasn't been full before.

Reset the flag when we clear the buffer.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
f213b5b95f subsys/profiling: remove unused declaration
`PERF_EVENT_TRACING_BUF_OVERFLOW` isn't used, remove it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
0065a81a38 subsys/profiling: remove cmd_perf as it is not doing anything
`cmd_perf` isn't doing anything meaningful, remove it so that
the help message will be printed when invoked. Updated
the help message of the main command.

```
uart:~$ perf
perf - Lightweight profiler
Subcommands:
  record    : Start recording for <duration> ms on <frequency> Hz
             Usage: record <duration> <frequency>

  printbuf  : Print the perf buffer
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Yong Cong Sin
cd3b8dd938 subsys/profiling: no need to explicitly set idx to 0
static perf_data is zero-initialized by default, there's no
need to explicitly set `idx` to `0`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-20 14:45:23 +02:00
Pisit Sawangvonganan
8f197c955d style: subsys: comply with MISRA C:2012 Rule 15.6
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-20 10:33:51 +02:00
Jonathan Rico
cbb62333aa Bluetooth: L2CAP: remove commented-out assert
This assert cannot be turned on, as `pdu` will be NULL sometimes. This
is okay, it just means that the current channel doesn't have anything to
send and that we should probably try another one.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-20 10:33:31 +02:00
Jonathan Rico
c98bc820a3 Bluetooth: Host: remove outdated comment
This comment refers to an old piece of code that never got in main.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-20 10:33:31 +02:00
Georges Oates_Larsen
ebc7a4a2c8 net: shell: add conn_mgr shell commands
Adds commands for triggering conn_mgr functions and
tweaking conn_mgr connectivity flags.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2024-08-20 10:31:55 +02:00
Maochen Wang
1db73c3d4f wifi: Add WPA2 EAP-TLS support
Add basic WPA2 EAP-TLS support.
Also, add test infrasturcture esp. the certification handling,
non-certificate credentials are take as runtime input and certificated
are build time input for testing.

A real application can set certificates at runtime too.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-08-20 10:30:55 +02:00
Maochen Wang
0a951e2174 hostap: Support flushing PMKSA cache entries
Support flushing PMKSA cache entries in the reconnection
failed case of WPA3 SAE.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-08-20 10:30:55 +02:00
Maochen Wang
1a547dd40e hostap: Support getting Wi-Fi connection parameters recently used
Support saving and getting Wi-Fi connection parameters recently used.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-08-20 10:30:55 +02:00
Jukka Rissanen
0b985acbd7 net: tracing: Add TX time tracing
TX time tracing tells how long it took from network packet
creation to when the stack got rid of it.
So the network stack allocates net packet, this is the
start time. The end time is when the packet is fully processed (sent)
by the network device driver.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-08-19 21:50:21 -04:00
Jukka Rissanen
a679dd9578 net: tracing: Add RX time tracing
RX time tracing tells how long it took from network packet
creation to when the stack got rid of it.
So the network device driver allocates net packet, this is the
start time. The end time is when the packet is fully processed.
Currently the limitation is that the RX time duration is used
for network packets that are tied to an open socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-08-19 21:50:21 -04:00
Jukka Rissanen
4911a4f8de net: tracing: Add net_send_data function tracing
Trace when a network packet is sent.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-08-19 21:50:21 -04:00
Jukka Rissanen
ea2ff40558 net: tracing: Add net_recv_data function tracing
Trace when a network packet has been received.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-08-19 21:50:21 -04:00
Jukka Rissanen
491e12be2b net: tracing: Have a separate Kconfig option for socket API tracing
This is done for preparation to adding more network code tracing
to the system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-08-19 21:50:21 -04:00
Rex Chen
1b8fa46ac1 hostap: add 11v BTM query support
Add 11v BTM query L2 layer cmd support.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-08-19 09:58:40 -04:00
Rex Chen
ff7bb3e85c hostap: add pwe config for station
Add pwe config for station connect cmd.

Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
2024-08-19 09:58:01 -04:00
Helmut Lord
15c4df0aaa input: double tap
Added input double tap psuedo device

Signed-off-by: Helmut Lord <kellyhlord@gmail.com>
2024-08-19 09:56:26 -04:00
Jonathan Rico
6fa6c4c256 Bluetooth: L2CAP: Downgrade user_data API error to a warning
When user_data is not zeroed-out, the API returns an error. Downgrade
the API error to a warning log instead.

Introducing this check (#76489) broke a few PTS tests, as user_data is
not initialized by `net_buf_alloc()`. Doing so is in discussion:

https://github.com/zephyrproject-rtos/zephyr/issues/77088

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-19 09:55:49 -04:00
Jonathan Rico
6a3602a306 net: buf: Clear user_data on allocation
For two reasons:
- prevent exposing the previous user's info to the new user
- make NULL checks on user_data work

Since we don't really have a field that specifies what part of the
user_data array is valid, we have to rely on other checks.

Such a check, if user_data contains a callback, is comparing against
NULL before calling said callback.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-19 09:55:24 -04:00
Sean Madigan
2a46edeaed bluetooth: controller: kconfig: select power control for plm
Path loss monitoring does not work without LE Power Control
also enabled in the controller, so update the dependencies
in the kconfigs so path loss monitoring selects power
control.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2024-08-17 08:55:13 -04:00
Sean Madigan
2e7c488484 bluetooth: host: conn: Fix renamed callback_list
callback_list was renamed to conn_cbs in commit 3eb975d.

However plm callback was missed due to it not being built
anywhere.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2024-08-17 08:55:13 -04:00
Tom Burdick
caa0c0a467 rtio: Split the rx and tx buffer unions
Transmit/write buffers are expected to be constant values given to the
operation to transmit but not mutate. Seperate the OP_TX and OP_RX
operation description unions.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-08-17 08:55:01 -04:00
Jordan Yates
7598330a74 sd: lower log level for boot message
This log message does not need to be repeated 10 times at the INFO level
when the same information is provided after all the retries are done:
```
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Card does not support CMD8, assuming legacy card
```
to
```
<inf> sd: Card does not support CMD8, assuming legacy card
```

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-17 08:54:51 -04:00
Benjamin Cabé
3735ae94a1 profiling: doc: clean up grammar/spelling
Clean up documentation pages for the new perf tool
as they contained several typos, grammar errors, and
duplicated content between main doc page and sample
page

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-08-16 16:30:07 +01:00
Jonathan Rico
80a92f51a5 Bluetooth: Host: Add missing bt_tx_irq_raise()
Trigger the TX processor on connection teardown.

When a disconnection happens before the controller has acknowledged some
ACL fragments the host has sent, we run `process_unack_tx()` to free
those unacknowledged buffers and their associated TX contexts.

The problem is that the TX processor still holds a reference to the conn
object. That reference is not released until the TX processor is
triggered again and figures out that the connection is invalid.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-16 16:29:41 +01:00
Vinayak Kariappa Chettimada
3590bd648f Bluetooth: Controller: Fix missing invalid aux offset check
Fix missing invalid aux offset check that was being caught
in a development assertion check. If aux offset where less
than the PDU time of the primary channel PDU, radio was
redundantly being setup delayed for reception that was
being caught in an assertion check.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-16 16:29:28 +01:00
Vinayak Kariappa Chettimada
521ea5561a Bluetooth: Controller: Add assertion checks for delayed radio start
Add assertion checks for delayed radio start.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-16 16:29:28 +01:00
Johann Fischer
f851cad162 usb: device_next: add device configuration change notification
Notify only if the device configuration has changed. Pass only the
configuration value as the message status, the actual device speed can
be obtained with usbd_bus_speed().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-08-16 08:50:25 -04:00
Théo Battrel
f3dcaaee35 Tests: Bluetooth: Add another ISO frag test
This test create a setup where an ISO broadcaster will send fragmented
data and get stopped after sending the first fragment and repeating that
operation multiple time to verify that buffers are not leaked.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-08-16 11:20:14 +01:00
Théo Battrel
3a098c9f61 Bluetooth: Host: Unref ISO fragments after disconnection
When sending data using ISO and the data is fragmented, if the
connection is cut before all the fragments are sent, the data buffer
will be leaked.

Fix the issue by unref'ing the buffer when ISO is not in a connected
state.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-08-16 11:20:14 +01:00
Théo Battrel
70696f5b0f Bluetooth: Host: Free ISO TX context
When disconnected while sending data, if ISO doesn't get the number of
completed packets it will not call `process_unack_tx` and thus will leak
TX context.

Fix that by setting the connection state in ISO disconnection which will
trigger a call to `process_unack_tx`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-08-16 11:20:14 +01:00
Alberto Escolar Piedras
17369f6209 unit_testing: Correct one comment refering to native_posix
It should have reffered to the architecture,
not one of its board's name.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-16 09:21:18 +01:00
Henrik Brix Andersen
69fe9b0c50 net: buf: remove use of special putter and getter functions
Convert users of net_buf_put() and net_buf_get() functions to use
non-wrapped putters and getters k_fifo_put() and k_fifo_get().

Special handling of net_bufs in k_fifos is no longer needed after commit
3d306c181f, since these actions are now
atomic regardless of any net_buf fragments.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-08-16 09:55:11 +02:00
Emil Gydesen
9014bb66a6 Bluetooth: Logging: Fix typo Voluem -> Volume
Fix a small typo.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-16 09:50:03 +02:00
Luis Ubieda
775cd201c3 bluetooth: host: Add API to get a connection's UATT MTU
Similar to bt_att_get_mtu but only considering the Unenhanced ATT
channel.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-08-15 10:17:13 +01:00
Pisit Sawangvonganan
14c6925596 ztest: replace shell_fprintf(sh, SHELL_ERROR, ...) with shell_error
Replace `shell_fprintf(sh, SHELL_ERROR, ...)` with
`shell_error(sh, ...)` since it brings the same underlying
action with less typing.

Note: `shell_error` already concatenates `\n` to format strings,
so we remove `\n` from the original code.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-15 10:16:36 +01:00
Pisit Sawangvonganan
347c56c600 ztest: fix typo
Utilize a code spell-checking tool to scan for and correct spelling errors
in `subsys/testsuite/ztest/src/ztest.c` file.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-08-15 10:16:36 +01:00
Félix Piédallu
61e5958eff log: formatting: Add configuration for blue DBG log
It's usual to show debug logs as blue.
Showing dbg and info with different colors are good,
but it's preferable to keep info logs with default
color.

Signed-off-by: Félix Piédallu <felix@piedallu.me>
2024-08-14 12:35:01 -04:00
Seppo Takalo
1cd6b5f1c1 net: lwm2m: remove deprecated APIs and confs
Remove deprecated APIs and configs:
* CONFIG_LWM2M_RD_CLIENT_SUPPORT
* lwm2m_get_u64()
* lwm2m_set_u64()

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-08-14 09:14:43 -04:00
Alberto Escolar Piedras
f5f5937657 subsys/bluetooth: Correct BT_HCI_VS_EXT_DETECT default
native_sim should be treated as native_posix.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-14 09:14:10 -04:00
Jonathan Rico
73572e4151 Bluetooth: L2CAP: Initialize private channel object members
We own those fields, so we should initialize them before use.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-14 10:47:49 +01:00
Seppo Takalo
b5ac5f7eba net: lwm2m: Send is only supported on LwM2M 1.1
LwM2M SEND functionality is defined in LwM2M v1.1
So quard the condition with protocol version, not
server object version.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-08-14 10:47:24 +01:00
Jun Lin
1aff275642 soc: npcx: scfg: select host interface type in global
The Host Interface Type in the DEVCNT register sets the HIF type
(either eSPI or LPC).
Currently, it is configured in the host-interface-related drivers like
eSPI or SHI. However, some I/O pads sourced from VHIF in the other
modules such as GPIO and I3C also rely on this field. It might be
problematic when using those I/Os without enabling eSPI or SHI drivers.
This commit moves the setting from the specific drivers to the global
system initialization function scfg_init().

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-08-14 10:47:15 +01:00