zephyr/include/zephyr
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
..
app_memory
arch it8xxx2: generalize ILM support 2022-10-21 20:31:47 +02:00
audio
bluetooth Bluetooth: Audio: Add CAP stream 2022-10-24 10:39:11 +02:00
canbus canbus: isotp: avoid reusing CAN controller driver API definitions 2022-10-25 16:32:10 +02:00
console
crypto
data
debug
devicetree devicetree.h: use DT_CAT<x> consistently 2022-09-09 12:19:18 +02:00
dfu dfu/mcuboot: removes BOOT_MAX_ALIGN and BOOT_MAGIC_SZ 2022-09-19 18:36:37 +02:00
display
drivers drivers: can: use flags fields for can_frame and can_filter structs 2022-10-25 16:32:10 +02:00
dt-bindings dts: usb-c: Introduce usb-c-connector 2022-10-22 18:38:35 -04:00
fs
ipc include: add missing kernel.h include 2022-10-11 18:05:17 +02:00
kernel
linker logging: Initial multidomain support 2022-10-17 10:16:53 +02:00
logging logging: Add remote link and backend 2022-10-17 10:16:53 +02:00
lorawan
math
mgmt mgmt/mcumgr: Deprecate zephyr_ prefixed API 2022-10-18 12:05:42 +02:00
modbus
multi_heap doc: doxygen: group heap APIs 2022-09-07 10:45:55 -04:00
net drivers: can: use flags fields for can_frame and can_filter structs 2022-10-25 16:32:10 +02:00
pm pm: device: expose struct pm_device 2022-10-17 10:13:37 +02:00
portability
posix includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
random
rtio rtio: Add macro to define iodev submission queue 2022-10-05 12:42:16 +02:00
sd include: add missing kernel.h include 2022-10-11 18:05:17 +02:00
settings
shell shell: add function checking shell readiness. 2022-09-06 12:36:01 +02:00
stats
storage storage/flash_map: Deprecate FLASH_AREA_ macros 2022-09-30 07:44:49 -05:00
sys smp: define arch_num_cpus always 2022-10-21 13:14:58 +02:00
task_wdt
timing
toolchain toolchain: common: iterable sections: improve documentation 2022-10-12 18:42:28 +02:00
tracing
usb
usb_c usb-c: Add USB-C Subsystem with Sink PD Support 2022-10-22 18:38:35 -04:00
xen
cache.h
device.h Revert "device: restore init_res bit field" 2022-10-19 16:27:06 +02:00
devicetree.h devicetree: Add model name helpers based on compat 2022-10-07 11:48:02 -07:00
exc_handle.h
fatal.h
init.h init: format file 2022-10-12 18:49:12 +09:00
irq.h
irq_nextlevel.h
irq_offload.h
kernel.h kernel: move _static_thread_data to ROM 2022-10-04 17:24:14 +00:00
kernel_includes.h
kernel_structs.h smp: Move arrays to use CONFIG_MP_MAX_NUM_CPUS 2022-10-17 14:40:12 +09:00
kernel_version.h
shared_irq.h
smf.h includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
spinlock.h kernel: Option to assert on spin lock time 2022-10-18 14:14:12 +02:00
sw_isr_table.h
sys_clock.h
syscall.h
syscall_handler.h
timeout_q.h
toolchain.h
types.h include: types: remove ulong_t 2022-09-06 18:16:33 +02:00
wait_q.h
zephyr.h includes: deprecate <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00