zephyr/tests/subsys
Henrik Brix Andersen f8a88cdb27 drivers: can: use flags fields for can_frame and can_filter structs
The can_frame and can_filter structs support a number of different flags
(standard/extended CAN ID type, Remote Transmission Request, CAN-FD format,
Bit Rate Switch, ...). Each of these flags is represented as a discrete bit
in the given structure.

This design pattern requires every user of these structs to initialize all
of these flags to either 0 or 1, which does not scale well for future flag
additions.

Some of these flags have associated enumerations to be used for assignment,
some do not. CAN drivers and protocols tend to rely on the logical value of
the flag instead of using the enumeration, leading to a very fragile
API. The enumerations are used inconsistently between the can_frame and
can_filter structures, which further complicates the API.

Instead, convert these flags to bitfields with separate flag definitions
for the can_frame and can_filter structures. This API allows for future
extensions without having to revisit existing users of the two
structures. Furthermore, this allows driver to easily check for unsupported
flags in the respective API calls.

As this change leads to the "id_mask" field of the can_filter to be the
only mask present in that structure, rename it to "mask" for simplicity.

Fixes: #50776

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-10-25 16:32:10 +02:00
..
canbus/isotp drivers: can: use flags fields for can_frame and can_filter structs 2022-10-25 16:32:10 +02:00
cpp tests: Remove explicit newlib nano override 2022-10-19 16:02:51 +02:00
debug tests: move to using CONFIG_MP_MAX_NUM_CPUS 2022-10-20 22:04:10 +09:00
dfu dfu: include MCUboot's bootutil_public.h 2022-09-19 18:36:37 +02:00
edac includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
emul
fs ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
ipc/ipc_service tests: ipc_service: Add ipc_service test of deregistered endpoint 2022-10-11 13:03:29 +02:00
jwt
logging log_link: fix the log_link test failure on adsp boards 2022-10-25 10:52:00 +02:00
mgmt tests/mgmt/mcumgr/smp_reassembly: Drop zephyr_ prefix 2022-10-18 12:05:42 +02:00
modbus
openthread ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
pm tests: move to using CONFIG_MP_MAX_NUM_CPUS 2022-10-20 22:04:10 +09:00
portability tests: move to using CONFIG_MP_MAX_NUM_CPUS 2022-10-20 22:04:10 +09:00
rtio/rtio_api
sd/sdmmc includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
settings ztest: remove the obsolete NULL appended to zassert macros 2022-09-09 07:05:38 -04:00
shell tests: shell: add missing assert 2022-09-06 14:12:33 +00:00
storage storage/flash_map: Macros for accessing fixed-partitions 2022-09-06 09:56:37 +02:00
tracing/tracing_api tests: tracing_api: move to new ztest API 2022-09-08 10:39:10 +02:00
usb