Since `NONE` is a valid option for key management in `connect`
command, we should remove the part in help text which says:
"valid only for secure SSIDs".
Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
UBSan was showing the following error:
```
runtime error: left shift of 137 by 24 places cannot be represented in
type 'int'
```
Cast the value to `uint32_t` to make UBSan happy.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The comment states the reason for this requirement is to detect
violations by a remote peer. The ATT version of this was removed in
ea04fd95f9. TLDR: It's neither possible
for, nor the job of the host to police the remote device.
We remove this requirement to be more flexible about the number of
priority levels in the system, and to avoid the temptation of using
priorities as a synchronization mechanism.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
The remote domain may send unsolicited Z_LOG_MULTIDOMAIN_ID_DROPPED IPC
messages, which are not handled in log_multidomain_link_on_recv_cb().
With CONFIG_ASSERT=y, this will cause an assertion failure. With asserts
disabled, this message would be treated as a reply to any in progress
request and cause getter_msg_process() to return early. In turn, this
can cause various kinds of memory corruption when the real reply arrives
and the callback reads/writes stack variables that are no longer valid.
Fix this by explicitly ignoring Z_LOG_MULTIDOMAIN_ID_DROPPED, and also
don't treat unrecognized message types as replies.
Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
This fixes warnings when building with icbmsg
backend for IPC service by defining
_POSIX_C_SOURCE 200809L in source file.
Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
In hawkbit there are currently a lot of values send to the server, that
are not required or even optional. This commit corrects that.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit change a method of printing multicast routes by showing
all interfaces per entry instead of aggregating them by interface.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
In order to save memory, a single multicast routing entry now
contains configurable number of network interfaces.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
This commit adds a check to determine if the packet wasn't already
forwarded to a given interface.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
This commmit changes the way of iterating over multicast routing
entries from explicit for-loop to ARRAY_FOR_EACH_PTR().
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
The log message header "source" field for messages received from a
remote domain contains the source ID, rather than a pointer to the
source data (which would not be valid in the local domain).
msg_filter_check() did not handle this case and obtained a garbage source
ID for remote log messages. This caused an assertion failure in
filter_get().
Consistently handle this by adding a log_msg_get_source_id() function
that returns the source ID for both local and remote messages. This
function was implemented based on code factored out of
log_output_msg_process().
Signed-off-by: Ben Wolsieffer <benwolsieffer@gmail.com>
Add support for decoding incoming LC3 data. At this point
we only instantiate a single LC3 decoder, so only one frequency
and duration is supported.
To accomodate for the increased RAM usage, the number of unicast
streams support have been decreased.
Further more, the LC3 handling in the shell has overall been
improved, also for encoding.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Returned values are copies, so trying to "const" return values cannot
have any effect.
Fixes the following compiler warning:
```
llext.h:165: warning: type qualifiers ignored on function return type
```
Fixes commit 41e0a4a371 ("llext: Linkable loadable extensions")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
`ret` is the amount sent from the current buffer. `sent` contains the
total amount that was transferred in the while loop.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Modifies the audio configuration (ac) commands for CAP
and GMAP to use the default presets instead of supplying
the preset as arguments. This will allow the user to
use the `bap preset` command to configure everything in the
codec configuration before the AC commands are issued.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When creating a broadcast sink using the auto scan feature,
the call to bt_le_per_adv_sync_create would use a local
PA sync pointer, instead of one from the per_adv_syncs
array, making it impossible to stop the PA sync afterwards.
This commit modifed the auto_scan so that it properly uses
the per_adv_syncs array, while still assigning the PA sync
in the shell broadcast sink struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The print_codec_cfg_chan_allocation did not take the case where
chan_allocation == BT_AUDIO_LOCATION_MONO_AUDIO into account,
in which case it should print "Mono".
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The commit 8256d02d3a introduced
getopt parsing for the wifi connect command
This needs to be updated for the wifi ap enable since ap
enable also uses the same parsing as connect.
The use of getopt removes the parameter ordering restrictions
Signed-off-by: Brad Kemp <brad@beechwoods.com>
In case FIN packet included data bytes, Zephyr would ignore the
data. It wasn't passed to the application, and it wasn't considered
when bumping the ACK counter. This ended out in connection timing out,
instead of being properly terminated.
Fix this, by refactoring FIN processing in TCP_ESTABLISHED state.
Instead of handling FIN/FIN,ACK/FIN,ACK,PSH cases separately, have a
common handler when FIN flag is present, and when ACK flag is present
along with FIN. When FIN is present, take any potentially incoming data
into account.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
`bt_recv` is invoked from the BT long work queue, which is preemptible.
The host uses cooperative scheduling to ensure thread safety.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Allow changing the CoAP Block-wise transfers block-size
for subsequent GET requests.
It looks like Leshan switches block size back to its
configured value, if it is smaller.
So even when we send block N=0 with size of 512, Leshan
seem to handle that properly but still asks N=2 with
block size 256(if that is configured).
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Implement test version of the LE Create BIG command ll_big_test_create
(BT_HCI_OP_LE_CREATE_BIG_TEST) in the controller.
This enables use of CONFIG_BT_ISO_ADVANCED, which supports use of
the following BIG/QoS configuration parameters (otherwise derived):
- ISO_Interval
- NSE
- Max_PDU
- BN
- IRC
- PTO
Signed-off-by: Morten Priess <mtpr@oticon.com>
Fix regression in BT_RX_STACK_SIZE use due to
commit b91728619c ("Bluetooth: host: remove
`CONFIG_BT_RECV_BLOCKING`").
Profiling of Controller Rx thread has been mentioned in
commit 586ba9fd13 ("Bluetooth: Controller: Increase
BT_RX_STACK_SIZE for BT_HCI_RAW enabled").
Also, move the TX_STACK_SIZE value as default in Kconfig
from the explicit value being set in hci_ipc sample.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Minor improvements to usage of zperf_shell upload.
Added common defaults for the upload commands arguments.
Print defaults in cmd help.
Throw warning when user sets baud rate for TCP upload.
Signed-off-by: Adam Matus <adam.matus@nxp.com>
The network interface parameter for net_eth_get_vlan_tag() should
be the VLAN interface so use the search loop properly.
Earlier the main interface could be checked.
Add also test cases for this so that we can catch that the func
works properly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add more error logs in case of (mostly) mbed TLS errors, so it's easier
to get an initial idea of what went wrong based on logs only. Getting
an information on an actual mbed TLS error code is quite helpful in such
cases.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Generic node_rx_hdr struct contains data not used for done event, so this
pdu specific data is moved to node_rx_pdu to minimize memory usage for
MFIFO_done alloc.
This however calls for a considerable write-through replacing the generic
node_rx_hdr with node_rx_pdu when relevant and needed.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Use CONFIG_BT_CTLR_CENTRAL_ISO instead of CONFIG_BT_CENTRAL in
declaring central CIS CREATE procedure context data. In some configs the
size of this data structure is bound by central CIS CREATE, so doing it
correctly will save memory in the procedure context allocation.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit adds support for building relocatable (partially linked)
ELF files as the binary object type for the llext subsystem.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Add a new Kconfig option to select the binary object type for the llext
subsystem. This will allow to fully decouple the architecture type from
the kind of binary object that is expected by the loader.
The defaults have been chosen to match the current behavior of the ARM
and Xtensa architectures, but developers can now more easily experiment
with other object types.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
If central initiates incompatible procedure after having replied (with
_IND), peripheral fails to disconnect as spec'ed.
Fix by correctly setting the INCOMPAT flag to reserved on IND receipt to
enforce the disconnect.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Block size is a 3-bit value mapping values [0, 6] to powers of 2 in the
range [16, 1024]. Value 7 is invalid.
The previous formula was not working in case the client's preferred size
was 4 (or more) times bigger than the server's.
This commit takes into account also the case the client's preferred size
is smaller than the server's.
Signed-off-by: Marco Argiolas <marco.argiolas@ftpsolutions.com.au>
It's needless complexity, and the terminology clashes with
Bluetooth (HCI frags).
It has one user, IPSP, that is going away soon.
Removing frag support will allow a future optimization, removing the
need for HCI and L2CAP fragment buffer pools, saving memory.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Remove IPSP support from the tree.
It has no maintainers, and is regularly broken. The fact that it's
nontrivial to set-up in linux makes it hard to fix reported issues.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
By exposing the underlying iso channel, the application can retrieve
properties of the iso channel.
This can be useful in case the application wants to use the connection
handle for vendor specific HCI commands or to retrieve the particular
parameters used for the given channel.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
First sector starts at CONFIG_EXT2_DISK_STARTING_SECTOR.
This commit fixes calculating free space, based on that value.
Signed-off-by: Franciszek Pindel <fpindel@antmicro.com>
Adds support for all relocation type produced by GCC
on ARM platform using partial linking (-r flag) or
shared link (-fpic and -shared flag).
Signed-off-by: Cedric Lescop <cedric.lescop@se.com>
This extends the thread abort hook to support memory mapped
stack. The calculation to find out to which instance of thread
pools the outgoing thread belongs requires physical address.
So find the physical address via the memory mapped stack for
that.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The "struct sockaddr" should only be used in casts and never
as a standalone variable because it might not have enough
space allocated for all the protocol specific fields.
So refactor the port_in_use() function to reflect that.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
errno values are positive, therefore they should be negated when
assigned as return values for net_dhcpv4_server_start().
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The commit adds dependency on Kconfig FLASH_PAGE_LAYOUT to subsystems
that really require it:
FCB, NVS, LittleFS
and removes direct selection from '*.conf' files where no longer
needed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
`setsockopt` is enabled by `CONFIG_POSIX_API`, use
`zsock_setsockopt` instead, otherwise there will be a
compilation error if `CONFIG_NET_SOCKETS_SOCKOPT_TLS` is
enabled.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Check if the interface is down before joining IPv4 mDNS multicast
group. This avoids warning later when the network packet cannot be sent.
Fixes#71121
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This API is not widely used and it is actually broken since device
runtime power management is not checking it when suspending and
resuming.
On top of that, this API is very close to pm_device_busy* API,
close enough to consolidate in only one API.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Commit e99b5228a1 changed the default
networking behavior on qemu platforms, as the SLIP_TAP driver no longer
selected Ethernet L2. In results, qemu platforms in default
configuration had no network interface to work with.
Fix this, by restoring select for NET_L2_ETHERNET, but this time in
NET_SLIP_TAP. The difference is that SLIP_TAP is a generic driver
config, which could be enabled on any platform, so not changing the
behavior here, while NET_SLIP_TAP is a config dedicated for qemu only,
so it's reasonable to enable all that's needed to get SLIP to work with
qemu by default.
As there were circular Kconfig dependencies, move the respective qemu
configs outside of NET_RAW_MODE if block (as this caused the circular
dependency with ETH_DRIVER_RAW_MODE). Also, remove dependency to
NET_L2_BT, as it made little sense there, and also caused dependency
problems.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
There is no limitations for dwell time. Just add
valid condition for positive value. So , it's better
to remove those constraints.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
The bt_debug_dump_recv_state did not care if the receive
state being dumped to log was active or not, and if it was
not actice, then it may just contain random data.
Added a check to see if it was active.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Running out of connection contexts is most likely due to app
misconfiguration, therefore it's useful to get an explicit information
that context allocation failed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The cap_initiator unicast_stop command will now stop
all streams by default, without supplying the "all" argument.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some part of the descriptions were wrong. Also, the description of
`BT_BUF_ACL_RX_SIZE` was too verbose and no longer needed with the
updated L2CAP documentation.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The buffers for the PBP advertising data as well as the
buffers for the BASE periodic advertising data were
not cleared, so calling the functions multiple times
would simply append the data rather than just setting
the new data.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There are devices that will send empty SDUs instead of
empty PDUs, and while that should be harmless, it is nice
to know what is going on, and we may want to deal with
empty SDUs and empty PDUs differently.
This also modifies the state for TS and PSN to only be
applied for valid ISO packets.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
It is a common occurance that a specific type is not
found in the codec configuration, and the main way of
knowing that is by calling the function.
The debug log does not help debug anything (as it does also
return a specific error code), but rather just clutters up
the log if enabled.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When returning an error code directly to an application
in the API, it should not log as a warning or error.
The lack of PAC records is also reported directly to the
application, and is not an error (in fact it is valid not to have
e.g. sink or source pacs).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add printing of the broadcast ID and whether an existing PA
sync was found in the bap_broadcast_assistant_recv_state_cb
function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bap_broadcast_assistant mod_src command can now take "unknown"
as a value to supply BT_BAP_PA_INTERVAL_UNKNOWN to the scan
delegator.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The documentation for the command
bap_broadcast_assistant broadcast_code
was incorrect and has been fixed.
Additionally, and example of the command has been added
in the shell documentation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When a PA is synced via PAST, the receive state does not
have a PA sync object, and the address and SID must be
used.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The audio configuration 5 is defined to have 2 sink channels
per stream and 1 source channel per stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If pa_sync_past returns 0 then that means we are ready to
sync to past, and the BT_BAP_PA_STATE_INFO_REQ state should be set.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some toolchains cannot create shared objects for Xtensa, with them we
have to use relocatable objects. Add support for them to llext.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Correct various small edge-case behaviors that have been accidentally
introduced in the http_client.
- http_client_req no longer incorrectly returns -ETIMEDOUT on NULL HTTP
resonse. -ETIMEDOUT is now only returned when the underlying TLS
socket times out.
- http_client_req now returns -ECONRESET upon incomplete (but non-NULL)
HTTP response. The request callback is no longer called in this case
(as with any other error state).
- http_wait_data has been refactored slightly to increase clarity.
Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
If the packet cloning fails (can easily happen when working with
loopback interface and when having low net_buf count), then
print a warning to the user. Error could also be possible but
as the situation might correct itself in this case, the warning
should be enough.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Adds the CAP Commander Change Microphone Mute procedure.
This procedure changes the microphone mute state on one or more
CAP Acceptors.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If we fail to join all nodes or solicit node multicast groups
when the interface is down, then there is no need to print an
error message. The groups are automatically re-joined when the
interface comes up.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
remove unnecessary condition for CONFIG_HAWKBIT_POLL_INTERVAL,
changes poll_sleep to be in seconds,
change type of sleep_time in hawkbit_update_sleep(), so the return
value of hawkbit_time2sec() is interpreted correctly.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
In addition to flushing the dcache, to ensure that the new code is
actually read by the CPU when loading an extension, the icache must
be invalidated as well.
Without this, some tests are failing in hardware because the CPU is
executing stale code from its instruction cache.
Fixes#70906 on arduino_giga_r1/stm32h747xx/m7.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Resolved a data race in shell.c by copying the user-provided
prompt-string into a private buffer within the shell, ensuring
proper synchronization with the shell-thread.
Fixes: #64972
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
If user created the capture device using the API and not via
the shell, then the device name was not set. Use the default
capture device in this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The event NET_EVENT_CAPTURE_STARTED is generated when the
capture is enabled, and NET_EVENT_CAPTURE_STOPPED when capture
is disabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The net_capture_pkt() does not return information what happened
to the net_pkt because the packet was always cloned. With cooked
capture we can avoid the cloning in which case we need to know
the capture status in order to unref the packet if needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for capturing arbitrary data via the cooked mode (sll)
capture API. The actual packet capture is done using net_capture_data()
function, the packet capture infrastructure does not need any changes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow user to create a kitchen sink pseudo a.k.a any network
interface that one is only able to write to. This might seem
unnecessary, but it is possible to attach virtual network
interfaces on top of this pseudo interface. These virtual
interfaces could then process the data for example for
packet capture purposes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
For debugging purposes it would be nice to see the verdict
printed as a string instead of number.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add a recv callback to dummy API. After this it is possible to
receive data by a dummy network interface. This is only useful
if one attaches a virtual interface on top of the dummy one.
One such example is the cooked mode capture interface.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Change 'Hawkbit' and 'hawkbit' to 'hawkBit' wherever
makes sense, and a bit of touch ups here and there.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit fixes an issue where due to inverted logic (static function
returned 0 on success but the caller expected true/false) the MLDv2
reports were silently dropped.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
Added a check for checking duplication when adding a source in the
broadcast assistant, as per requirement in BAP 6.5.4. It is not
permitted to add a source such that a combination of broadcast_id,
adv_sid and address type would result in same triple of values.
Added a recv_state struct to cache these values when read, and moved
past_avail and srd_ids into this as well.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
Deprecate CONFIG_NET_TCP_ACK_TIMEOUT as it is redundant with the
combination of CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT and
CONFIG_NET_TCP_RETRY_COUNT. The total retransmission timeout (i. e.
waiting for ACK) should depend on the individual retransmission timeout
and retry count, having separate config is simply ambiguous and
confusing for users.
Moreover, the config was currently only used during TCP handshake, and
for that purpose we could use the very same timeout that is used for the
FIN timeout. Therefore, repurpose the fin_timeout_ms to be a generic,
maximum timeout at the TCP stack.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add hostname changed printout to event monitor. As the name
says, it is generated when the hostname of the device changes.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Starting with b1d24e425c (net: lwm2m:
device object: optionally store error list in settings), it was no
longer possible to build the code with coverage enabled when the
settings subsystem was disabled.
The build would fail with an error like this:
> subsys/net/lib/lwm2m/lwm2m_obj_device.c:262: undefined reference to
> `settings_name_steq'
This fixes#70923.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Add `gdb_q_packet` function to handle proccessing of query packets. Also
add `gdb_qsupported` function to serve as a single place to process and
respond to `qSupported` packets.
Signed-off-by: Robert Zieba <robertzieba@google.com>
Make the current gdb loop enum public under the name `gdb_loop_state`.
This will allow for extending the current stub with further
functionality in the future as new features will require control over
the loop state.
Signed-off-by: Robert Zieba <robertzieba@google.com>
According to the `RFC8415` the length of the DUID is at least 1 octet
up to 128 octets. Now a user can choose buffer length without the need
for source code modification.
Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
For BR/EDR L2CAP, if the function bt_l2cap_br_chan_send_cb
instead of bt_l2cap_chan_send is called, the ACL conn and
L2CAP chennel status will not be checked.
Check conn/channel status before sending data in
function bt_l2cap_br_chan_send_cb.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
eth_stats.h is using ethernet api but not including the header,
it must be working by luck in files that include it after
something else that includes ethernet.h, fix by just including it.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Change the receive workque name to "BT RX WQ" to distinguish it from the
receive thread, and the long workque one to "BT LW WQ" to make the
format consistent with the other Bluetooth threads.
On an nRF52 now "kernel stacks" looks like:
0x200016c8 BT RX (real size 448): unused 280 )
0x20001780 BT RX pri (real size 448): unused 224 )
0x200012c0 BT RX WQ (real size 2240): unused 1360 )
0x20001208 BT TX (real size 768): unused 408 )
0x20001130 BT LW WQ (real size 1344): unused 408 )
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change the input callback function name to make it easier to identify
what it belongs to. This clears some ambiguity when observing the symbol
names corresponding to the function pointers in the callback section.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Users should be able to call fs_mkfs() manually even if FS_FATFS_MOUNT_MKFS
is disabled.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
Instead of having a single config specifying the memory pool size for
variable-sized net buffers, have a separate one for TX and RX for better
configuration granularity when optimizing memory usage of the
application.
Deprecate the old configuration but use its value as a default (for now)
for the new configs. This will need to change when the config is
deleted.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
To wait for the asynchronous suspending work item to complete, a
combination of semaphores and events is used. First, the semaphore is
released, then the events are cleared (through the boolean argument to
k_event_wait), then events are awaited.
However, if the event flag happens to be set by the work handler in the
short time between k_sem_give and k_event_wait, it is then cleared by
k_event_wait and k_event_wait blocks forever waiting for the event.
Make sure that we clear the event flag before releasing the semaphore.
Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
With CONFIG_BINDESC_BUILD_TIME_ALWAYS_REBUILD a re-run was called for
the entire project.
This can result in issues with the zephyr linker mechanism.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
There should be a particular defines which clarify the
use of that number. So, replacing numbers with defines
in wifi shell.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Outgoing block-transfers now set the socket hint
to ONGOING as long as the BLOCK1/BLOCK2 header has
MORE flag set to true.
This means as only the last packet in the block-transfer
set the socket hint to LAST or ONE_RESPONSE.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Once Wi-Fi is associated few parameters like listen interval and
power-save mode cannot be changed. The state for association is
"ASSOCIATED" and not completed. Even after state transitions to
COMPLETE, it can still go back to other states, e.g., PTK/GTK renewal.
Fix the state check.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
If host is not reading RTT data (because there is no PC connection
or RTT reading application is not running on the host), thread will
stuck continuously trying to write to RTT. All threads with equal or
lower priority are blocked then. Adding detection of that case and
if host is not reading data for configurable period then data is
dropped until host accepts new data.
Similar solution is using in RTT logging backend.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
All implementations of random number generator where duplicating logic
for sys_rand32_get. Since this subsystem already has a logic to
generate random values of arbitrary size, we can generically implement
sys_rand32_get on top of that.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The gPTP is not suppose to be run on top of VLAN and the
earlier support was just for testing purposes. Remove VLAN
support now after the VLAN overhaul.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print also network interface index together with the pointer value
in order to get more useful information what is going on in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print information whether a multicast address is properly
joined to a multicast group when print addresses using
"net iface" command.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
As the interface type is always Virtual, no need to print it.
Print instead the name of the network interface as it is more
useful to the user.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If an IPv6 address was added to the interface while the
interface was down, its solicited node multicast address
is not joined properly and IPv6 communication will to
other hosts will fail. So make sure to rejoin all the
solicited node multicast groups that were joined already
when the network inteface is going up.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add debug information to print when the network L2 enable
callback is called and fails. Useful to see this information
as at that point the interface goes down.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Start any pending IPv6 DAD timers when interface comes up.
If IPv6 addresses have been added to the network interface when
it was down, the addresses would never work properly if the DAD
is not done.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of printing just a network interface pointer, print
also the interface index so debugging is a bit faster as no
lookup from interface listing is needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
No need to do the checks any more because user has specified
the VLAN count and so many VLAN virtual interface are already
created.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Re-implement the VLAN support inside the network stack.
All the user facing APIs stay as is but internally the VLANs
are implemented using the L2 virtual interfaces.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Simple rename to align the kernel naming scheme. This is being
used throughout the tree, especially in the architecture code.
As this is not a private API internal to kernel, prefix it
appropriately with K_.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Some compilers have trouble parsing variables directly after a case
statement.
Fixes: #70792
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Changing remaining users of fcntl.h to use the include from our own
POSIX file so that the values in there are consistent in all parts
of the sources.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use only Zephyr specific POSIX header files so that the whole
system is getting values from the same files. There was an issue with
native_sim run of tests/net/socket/af_packet which had O_BLOCKING set
to 0x4000 from include/zephyr/posix/fcntl.h, but then the file
subsys/net/lib/socket/sockets.c was having O_BLOCKING set to 0x0800
because different header files were used.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit fixes this error seen in CI so that things
work even if CONFIG_POSIX_API is enabled.
subsys/shell/backends/shell_mqtt.c:727:12: error:
conflicting types for 'write'; have
'int(const struct shell_transport *, const void *, size_t, size_t *)'
727 | static int write(const struct shell_transport *transport,
const void *data, size_t length)
include/zephyr/posix/unistd.h:230:9: note: previous declaration
of 'write' with type
'ssize_t(int, const void *, size_t)'
230 | ssize_t write(int file, const void *buffer, size_t count);
subsys/shell/backends/shell_mqtt.c:787:12: error:
conflicting types for 'read'; have
'int(const struct shell_transport *, void *, size_t, size_t *)'
787 | static int read(const struct shell_transport *transport,
void *data, size_t length, size_t *cnt)
include/zephyr/posix/unistd.h:231:9: note: previous declaration
of 'read' with type
'ssize_t(int, void *, size_t)'
231 | ssize_t read(int file, void *buffer, size_t count);
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The library should be using internal socket API functions
so that we do not need to depend on POSIX_API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Currently the socks library does not use sockets so there
is no need to select socket symbols.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The library should be using internal socket API functions
so that we do not need to depend on POSIX_API inside the
network stack.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Have special wrappers for zsock_fcntl and zsock_ioctl functions
so that gcc warning can be avoided.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The CONFIG_NET_SOCKETS_POSIX_NAMES option is marked as deprecated in
favor of using normal POSIX socket API includes found under the
include/zephyr/posix directory. If you want to use BSD socket API calls,
you need to select POSIX_API and use the socket headers found in the
POSIX subsystem. If you do not want to or cannot enable POSIX_API,
then you must use zsock_ prefix when working with BSD socket calls.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>