zephyr/modules
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
..
TraceRecorder
canopennode drivers: can: use flags fields for can_frame and can_filter structs 2022-10-25 16:32:10 +02:00
hal_gigadevice modules: Add option for enabling HAL debug functions 2022-10-03 18:07:16 +02:00
hal_infineon
hal_nordic modules: hal_nordic: nrf_802154 serialization race condition fix 2022-09-19 10:31:50 +00:00
hal_nxp drivers: usb: mcux: Restructure driver for SDK updates 2022-09-09 09:44:46 -05:00
hal_rpi_pico modules: hal_rpi_pico: Enable ADC driver 2022-09-06 17:11:19 +02:00
liblc3
littlefs modules: littlefs: use ##__VA_ARGS__ for littlefs log wrappers 2022-09-05 13:41:19 +00:00
loramac-node modules: loramac-node: fix CN470 linking 2022-09-26 09:38:49 +00:00
lz4
mbedtls modules: mbedtls: Replace select statement with depends on for EC 2022-10-07 15:12:42 +02:00
nanopb
openthread drivers: ieee802154: properly announce promisc mode 2022-10-17 16:54:37 +02:00
segger
tflite-micro
trusted-firmware-a modules: tfa: integrate trusted-firmware-a 2022-09-09 16:36:37 +00:00
trusted-firmware-m tfm: Add option to enable the SFN model 2022-10-03 10:17:45 +02:00
uoscore-uedhoc
zcbor modules: zcbor: Fix ZCBOR_ASSERT kconfig typo 2022-09-08 15:30:47 +00:00
Kconfig soc: arm: introduce NXP S32Z/E support 2022-10-14 09:51:14 +02:00
Kconfig.altera
Kconfig.atmel
Kconfig.cmsis
Kconfig.cmsis_dsp
Kconfig.cmsis_nn
Kconfig.cypress
Kconfig.eos_s3
Kconfig.esp32
Kconfig.imx
Kconfig.infineon drivers: flash: Add xmc4xxx flash drivers 2022-10-03 13:56:49 +02:00
Kconfig.libmetal
Kconfig.lvgl
Kconfig.mcuboot_bootutil
Kconfig.mcux
Kconfig.microchip
Kconfig.nuvoton
Kconfig.open-amp
Kconfig.s32 soc: arm: introduce NXP S32Z/E support 2022-10-14 09:51:14 +02:00
Kconfig.silabs
Kconfig.simplelink
Kconfig.sof
Kconfig.st
Kconfig.stm32
Kconfig.syst
Kconfig.telink
Kconfig.tinycbor
Kconfig.tinycrypt
Kconfig.vega
Kconfig.wurthelektronik modules: Added hal_wurthelektronik module. 2022-08-31 21:47:58 +00:00
Kconfig.xtensa
modules.cmake