To avoid starvation of a traffic class by another, limit the maximum amount
of packets, that can sit in a single traffic-class-fifo to a fraction of
the maximum amount of available packets. In the tx-case also reserve
packets for direct sending, in the case, where
CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO is enabled.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
The GPIO peripheral on Silabs Series 2 devices is responsible for
allocating analog buses to analog peripherals. Enable support for
this in the pinctrl driver. Since these bus allocations are not
digital pins, introduce a new property silabs,analog-bus for this
purpose.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
The commit marks stream_flash_erase_page as deprecated.
After the function is removed users will have to rely on stream
flash to erase space it needs prior to write.
The stream_flash_erase_page has several issues like using non-relative
offset for erases, allowing to destroy data already written or even
erase out of area available for stream flash.
This fixes#67407
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Switches flash_sync to use stream_flash_erase_to_append
instead of stream_flash_erase_page in preparation of deprecating
the later and reming control on erase from API user.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The original commit (1716bbdb19) clarifies
that this is supposed to be GCC v4.5.0, not GCC v40.5.0.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
The usbd_uac2_send function sometimes took ownership of the
provided buffer in error cases, and sometimes not.
The commit modifies the function so that ownership is never
taken in case a non-0 return value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
State that the name given to `bt_set_name` must be null terminated.
If not, the behavior of the function may be wrong as it's using `strlen`
to get the length of the given name and `strcmp` to compare it to the
current device name. Both of those functions expect null terminated string.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The user of the ft8xx driver can register a callback function called
on a touch detection interrupt event. This function is extended to
include a user-defined pointer. The user-defined pointer helps to share
a callback with multiple driver instances.
Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
Improve the FT8xx display driver to support multiple driver instances.
The ft8xx_reference_api.h still follows the FT8xx programming guides,
limiting the usage of the driver to one instance.
Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
As our implementations do not meet all of the requirements of a
POSIX.1-conforming implementation.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Currently altitude is only provided above MSL. Adding
geoid seperation allows for ellipsoidal height to be
determined.
Signed-off-by: Maxmillion McLaughlin <max@sorcerer.earth>
A _res_fallback parameter to HTTP_SERVICE_DEFINE is added to optionally
specify a fallback resource detail, which will be served if no other
resource matches the URL.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Added initial CCP client implementation that simply
does discovery of TBS on a remote CCP server.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This header file provides the public API of the UDC driver,
however it also contains inline function definitions.
Unfortunately these definitions contain implicit pointer conversions,
which are one of the cases where valid C syntax is invalid C++ syntax,
meaning that any C++ source code that intends to use the UDC API
cannot be compiled error-free (or warning-free, if using -fpermissive).
Signed-off-by: Benedek Kupper <kupper.benedek@gmail.com>
Within the K_THREAD_DEFINE macro, a nested set of macros is expanded to
populate the values of a global _static_thread_data structure.
The K_THREAD_DEFINE macro expands to statements including the
Z_THREAD_COMMON_DEFINE macro, which expands to statements including the
Z_THREAD_INITIALIZER macro, which expands to an initialization expression
of a _static_thread_data struct. The init_delay member of that struct is
then initialized with the Z_THREAD_INIT_DELAY_INITIALIZER macro, which
expands to an expression including the SYS_TIMEOUT_MS macro which
converts a number of milliseconds to a number of ticks.
For example, take the following macro:
K_THREAD_DEFINE(
thread_X,
STACKSIZE,
thread_X_entry_point, NULL, NULL, NULL,
PRIORITY,
0,
0);
In abbreviated form, it expands as follows:
typedef struct {
int ticks;
} k_timeout_t;
struct _static_thread_data {
/* ... */
k_timeout_t init_delay;
};
struct _static_thread_data _k_thread_data_thread_X = {
/* ... */
.init_delay = (k_timeout_t){ .ticks = 0 }
};
However, in GCC versions before 5.1, the code fails to compile with the
error "initializer element is not constant", when compiled with the
following options:
gcc -std=gnu99 -c test.c
In the above code, the error can be corrected by replacing...
.init_delay = (k_timeout_t){ .ticks = 0 }
...with...
.init_delay = { .ticks = 0 }
...i.e. removing initialization with a compound literal.
In order to achieve this, this patch reworks the system of macros.
The Z_TIMEOUT_TICKS(t) macro is refactored into Z_TIMEOUT_TICKS_INIT(t)
which defines the initializer part: { .ticks = t }, and Z_TIMEOUT_TICKS(t)
which is defined as ((k_timeout_t) Z_TIMEOUT_TICKS_INIT(t)) .
For symmetry, Z_TIMEOUT_NO_WAIT_INIT is split out of Z_TIMEOUT_NO_WAIT.
Similarly, SYS_TIMEOUT_MS_INIT(ms) is split out of SYS_TIMEOUT_MS(ms) so
that the Z_THREAD_INIT_DELAY_INITIALIZER(ms) macro can use
SYS_TIMEOUT_MS_INIT(ms) which expands Z_TIMEOUT_TICKS_INIT(t) to initialize
init_delay without using a compound literal.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
__SIZEOF_INT__ is required by zephyr_stdint.h, however the __SIZEOF_*__
macros were only introduced in GCC 4.3.
This patch adds a work-around similar to that present in picolibc's
_default_types.h which attempts to guess the correct value of the
definition based on the value of __INT_MAX__ or from INT_MAX from
POSIX <limits.h> .
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Support for __builtin_unreachable() was added to GCC in the 4.5.0 release.
This patch adds a fallback to __builtin_trap() for older compilers which
do not have this built-in available.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Add wsen_tids_2521020222501 driver with
the corrected name and compatibility with
the hal update as well as added new features.
Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
This was present in the form of video_pix_fmt_bpp() inside ST and NXP
drivers, and was returning the number of bytes, which does not allow
support for 10-bits, 4-bits or non-byte aligned video formats.
The helper leverages the VIDEO_PIX_FMT_*_BITS macros.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Rename video_fourcc() to VIDEO_FOURCC(), differing from the Linux
implementation, but more compliant with the coding style.
Also introduce a VIDEO_FOURCC_FROM_STR() to generate a FOURCC format
code out of a 4-characters string.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Introduce a new text documentation of the video formats, describing
every bit, gives the position of the most significant bit, outline how
it is cut in bytes, and show the pixel segmentation.
Extra care is taken for the RGB565 which requies paying attention to the
bit endianess as well as the byte endianess.
Signed-off-by: Josuah Demangeon <me@josuah.net>
In linker-defs.h, lnkr_pinned_rodata_[start/end] are declared as
extern char. However, in linker/utils.h:linker_is_in_rodata(),
they are declared as extern const char. So remove the const in
linker_is_in_rodata() to align both declarations.
Fixes#83461
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
To request heap statistics, a pointer to a heap structure is required.
This is straightforward for a user-defined heap. However, such a pointer
is not known for heaps created by other components or libraries, like
libc. Therefore, it is not possible to calculate the total heap memory.
The proposed solution is to use an array of pointers, which is filled in
on every sys_heap_init() call. One can then iterate through it to sum up
the total memory allocated for all heaps.
The array size is configurable. The default array size is zero,
which means the feature is disabled. Any other integer greater then zero
defines the array size and enables the feature.
A list of pointers instead of an array could be another approach,
but it requeres a heap, which is not always available.
Signed-off-by: Ivan Pankratov <ivan.pankratov@silabs.com>
net_pkt_get_len() was commonly used yet not documented, move the
function out of the doxygen-ignored section of the header and add
a doxygen API description for the function so that it's rendered in
the documentation properly.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The exception stack frame type `z_arch_esf_t` had been deprecated
since #73593 for 2 releases, it is not used in the kernel since, and
applications/drivers should have been updated to use the
`struct arch_esf` now, remove it.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Add new Ethernet driver config option,
ETHERNET_CONFIG_TYPE_EXTRA_TX_PKT_HEADROOM, which allows Ethernet
drivers to inform L2 about the extra net_pkt headroom they need to be
allocated.
This is only supported when CONFIG_NET_L2_ETHERNET_RESERVE_HEADER is
enabled, so that it's possible to fit entire packet into a single
net_buf, which is needed for zero-copy transmission.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduced a new Kconfig option `SHELL_PRINTF_AUTOFLUSH` to allow
configuring the autoflush behavior of shell printing functions.
Updated `Z_SHELL_FPRINTF_DEFINE` to use the
`CONFIG_SHELL_PRINTF_AUTOFLUSH` setting instead of hardcoding
the autoflush behavior to `true`.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
Reverts the change made in d4d53010f00cadbb4f89c6d41391937646fc1740
(The changes was moved to another file in a restructuring)
The commit incorrectly assumed that no blocking would be allowed in
the syswq. This has caused issues observed among others
in #77241 and #80167
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Z_GENERIC_SECTION() uses STRINGIFY() to convert its argument to a
string, therefore the argument shouldn't contain additional quotes.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Added option to set the PACS Characteristics through the bap API,
making PACS configuration runtime available. Source and Sink PAC, as
well as Source/Sink PAC Location is can be set through a register
function in the PACS api.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
This new option allows to export devices using identifiers generated
from the hash of the devicetree node path, instead of the device's
ordinal number. Identifiers generated this way are stable across
rebuilds.
Add new test cases to test this new option.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Add a new set of macros that allow customizing the symbol name when
exporting symbols. This is useful when the symbol name that extensions
need to look up is different from the identifier used in the base image.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Add a new "hash" attribute to all Devicetree EDT nodes. The hash is
calculated on the full path of the node; this means that its value
remains stable across rebuilds.
The hash is checked for uniqueness among nodes in the same EDT.
This computed token is then added to `devicetree_generated.h` and made
accessible to Zephyr code via a new DT_NODE_HASH(node_id) macro.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Packets are forwarded to the native interface or in other words,
the vlan header is simply stripped and ignored. This feature is called
'priority tagging'.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow DSA_TAG_SIZE to be set based on the size determined by Kconfig
and the enabled switch hardware.
This fixes support for the KSZ8863 which also has a tail tag of
one byte.
Signed-off-by: Bas van Loon <s.r.vanloon@ziggo.nl>
If there are pending readers, it is best to perform a single data copy
directly into their final destination buffer rather than doing one copy
into the ring buffer just to immediately copy the same data out of it.
Incidentally, this allows for supporting pipes with no ring buffer at all.
The pipe implementation being deprecated has a similar capability so better
have it here too.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Remove the build assert from NET_L3_REGISTER() macro as that
is causing an issue with llvm. Add runtime check of the handler
pointer value.
subsys/net/l2/ethernet/arp.c:1044:1: error: static_assert expression
is not an integral constant expression
ETH_NET_L3_REGISTER(ARP, NET_ETH_PTYPE_ARP, arp_recv);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/net/net_core.h:190:2: note: expanded from
macro 'NET_L3_REGISTER'
BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/zephyr/toolchain/gcc.h:87:51: note: expanded from
macro 'BUILD_ASSERT'
define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
^~~~~~
subsys/net/l2/ethernet/arp.c:1044:1: note: cast from 'void *' is not
allowed in a constant expression
include/zephyr/net/ethernet.h:1272:2: note: expanded from
macro 'ETH_NET_L3_REGISTER'
NET_L3_REGISTER(&NET_L2_GET_NAME(ETHERNET), name, ptype, handler)
^
include/zephyr/net/net_core.h:190:29: note: expanded from
macro 'NET_L3_REGISTER'
BUILD_ASSERT((_handler) != NULL, "Handler is not defined")
^
/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h:89:16: note: expanded
from macro 'NULL'
define NULL ((void*)0)
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>