The `pm` field is used to provide a reference to pre-allocated PM
resources. Its usage as a callback was removed a while ago, and these
headers missed the migration.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The dev_id is already unique for DT devices (dts_ord_XX), there's no
need to rely on the full node identifier.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename Z_DEVICE_DT_DEV_NAME to Z_DEVICE_DT_DEV_ID to make it more clear,
as the macro is generating a token that identifies the created struct
device.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The macro is not using node_id, so remove it from the arg list. Do the
same for I2C/CAN "sub-macros".
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a new helper macro to define a device init entry. This helps
de-cluttering Z_DEVICE_DEFINE.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This adds a new helper to define the base struct device, without any
other required objects. This helps de-cluttering Z_DEVICE_DEFINE.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The usage of dev_name is misleading, since it does not represent the
device name (struct device name field) but the name given to the defined
struct device. In practice, it is used as a kind of unique device
identtifier, so let's rename it to dev_id.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This allows us to use regular Doxygen docstrings to document internal
helpers while keeping them out of public API docs.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Define Z_DEVICE_NAME_CHECK to perform a build time assertion on device
name length. This allows de-cluttering Z_DEVICE_DEFINE.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Remove trailing ; in Z_DEVICE_DEFINE_HANDLES as it results in a more
idiomatic usage of the macro.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Z_DEVICE_DEFINE_PRE existed when PM was tightly coupled to the device
API, but now it is just a shim for Z_DEVICE_DEFINE_HANDLES, so it adds
no value.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Define an initializer for `struct device`. This allows de-cluttering
Z_DEVICE_DEFINE and allows for re-usability if needed somewhere else.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Format the macro (using 80 cols for \). This improves readability and
further rework.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Linker scripts contains a `.last_section` section that is placed in rom
region as NOLOAD for the purpose of retrieve the actual number of bytes
contained in the image. See d85efe0b10
However, a previous section may cause the location counter to be
incremented for alignment purposes. This can result in the size of the
image to be 0x10FA but location counter to be 0x1100 because it has been
aligned for next section placement.
Therefore, two new Kconfig settings are introduced.
Those settings request the linker to will write a pattern in
`.last_section`. Together with removing NOLOAD and writing a patten to
the section then we ensure that data is written after alignment of
location counter, and thereby forces the image size to be in sync with
the location counter.
The default pattern used will be 0xE015 (end of last section).
Some systems may fill up the flash completely, or simply write data at
the end of the flash, which in both cases can result in overflow.
Therefore, the new settings can be disabled.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Renamed LWM2M_RD_CLIENT_EVENT_REG_UPDATE_FAILURE to
LWM2M_RD_CLIENT_EVENT_REG_TIMEOUT.
Changed reported event type for registration timeout to
LWM2M_RD_CLIENT_EVENT_REG_TIMEOUT from
LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE.
LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE should be only
reported case when server reject by response registration.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
This removes the callbacks from capabilities. The callbacks are used for
unicast server role only, while the capabilities are used for the
broadcast sink role as well. Thus the callbacks can be removed as there
is another bt_audio_unicast_server_cb API that is specific for unicast
server role.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add a new set of helpers for expanding property entries with a
separator. These macros complement DT(_INST)FOREACH_PROP_ELEM(_VARGS) by
adding the capability to expand with a custom separator between property
entries. This allows, in some cases, to re-use existing macros (e.g.
DT_PROP_BY_IDX) without creating an auxiliary macro that just appends a
separator. Example:
```dts
n: node {
...
my-gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>,
<&gpiob 1 GPIO_ACTIVE_HIGH>;
};
```
Before:
```c
#define GPIO_DT_SPEC_BY_IDX_AND_COMMA(node_id, prop, idx) \
GPIO_DT_SPEC_BY_IDX(node_id, prop, idx),
struct gpio_dt_spec specs[] = {
DT_FOREACH_PROP_ELEM(DT_NODELABEL(n), my_gpios,
GPIO_DT_SPEC_BY_IDX_AND_COMMA)
};
```
After:
```c
struct gpio_dt_spec specs[] = {
DT_FOREACH_PROP_ELEM_SEP(DT_NODELABEL(n), my_gpios,
GPIO_DT_SPEC_BY_IDX, (,))
};
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
It's useful for the default RAM region to have a uniform name across
architectures so higher-level build processes do not need to have their
own awareness of the names. Since NIOS2 uniformly uses 'SRAM', change it
to 'RAM' to match most other architectures.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
As with 32-bit ARM, it is useful to make the RAMABLE_REGION name uniform
across architectures so the build system does not need to be aware of
the differences when CODE_DATA_RELOCATION is supported. Generalize the
name to just 'RAM' for uniformity.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
It's useful for RAMABLE_REGION to have a uniform name when
CODE_DATA_RELOCATION is supported, because otherwise the build system
needs to be aware of how the region name differs between architectures.
Since architectures tend to prefer one of 'SRAM' or 'RAM' for that
region, prefer to use 'RAM' as the more general term.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
This function allows the application to close an ipc_service instance.
It is intended for use when the remote agent it is communicating with
has gone down and allows for cleanup.
It first checks that the endpoints have been separately deregistered
with the instance using the deregister_endpoint function before
calling into previously added functions in ipc_static_vrings.c
and ipc_rpmsg.c to close those instances.
Signed-off-by: Jackson Cooper-Driver <jackson.cooper---driver@amd.com>
This function deinitialises the static vrings used by the ipc_service
instance. It acheieves this by tearing down the initialised
virtqueues before closing the various aspects of libmetal which
are in use.
Signed-off-by: Jackson Cooper-Driver <jackson.cooper---driver@amd.com>
This function does the opposite of the ipc_rpmsg_init function and
allows the rpmsg instance to be torndown in the case that the application
wishes to do so. It is intended to be used by the ipc_service subsystem.
Signed-off-by: Jackson Cooper-Driver <jackson.cooper---driver@amd.com>
Some systems may need to query the available memory regions in runtime.
For those, this patch adds a simple API that memory management drivers
can implement to provide such discovery.
A small test also added to exercise the default, empty implementation.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
FLASH_AREA_ macros and usage of label property to identify
fixed-partitions, for purpose of usage with flash map API,
has been deprecated and now FIXED_PARTITION_ macros
should be used with DTS node labels.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit removes all stale references in the kernel header to the
memory pool API, which was removed in the v2.5.0 release.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit removes the `k_mem_pool` section for the memory pool API,
which was removed in the v2.5.0 release.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
Remove the support for caching ASEs on release.
This is mainly due to the 2-stage design in Zephyr: We
have the bt_audio_stream and the bt_audio_ep, where the
the latter represents an ASE in most cases.
However, once the endpoint goes into the codec configured
state, then a stream must be bound to it. This would be fine
(although a stream is technically not established at this point),
except that a stream is also, for unicast, specified for a
specific ACL. Once the ACL disconnects, the stream technically
becomes invalid, and if the stream is invalid, so is the endpoint.
Based on that, there's no reason (or even option) to keep the
endpoint in a codec configured state, as it would not
have a valid stream associated with it.
If we want to support an ASE going into the codec
configured state on ASE release (or ACL disconnect),
the relationsship between ASEs and streams needs to
be redefined.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
We compile with the gcc compiler flags -Werror and -Wshadow. So
the mentioned macro rasies a warning (and with the flags the
warning becoms to an error). It uses the same variable names
as on of its caller. Add an addidional underscore to the
affected variables to prevent this warning.
Signed-off-by: Peter Tönz <peter.tonz@husqvarnagroup.com>
This callback allows use-cases where the SDU is much larger than the l2cap
MPS. The stack will then try to allocate using this callback if specified,
and fall-back on using the buffer's pool (previous behavior).
This way one can define two buffer pools, one with a very large buffer
size, and one with a buffer size >= MPS, and the stack will allocate from
that instead.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Update the documentation for can_stop() to mention that it shall abort any
pending CAN frame transmissions.
Fixes: #50545
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Provide a default, internal callback to CAN controller drivers
implementation of can_send() if no callback was provided by the caller.
This allows for simplifying the CAN driver implementations of can_send() as
these no longer need special handling for callback/no callback operation.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>