drivers: can: move CAN utility function to public header

Rename the can_utils_filter_match() utility function to
can_frame_matches_filter(), move it to the public
include/zephyr/drivers/can.h header file, and add a missing mismatch for
standard (11-bit) ID frames passing extended (29-bit) filters.

This allows using the utility function in out-of-tree CAN drivers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-02-07 10:26:19 +01:00 committed by Carles Cufí
commit 36bffb20ae
7 changed files with 54 additions and 62 deletions

View file

@ -17,7 +17,6 @@
#include <zephyr/net/socketcan.h>
#include <zephyr/net/socketcan_utils.h>
#include "can_utils.h"
#include "can_native_posix_linux_socketcan.h"
LOG_MODULE_REGISTER(can_npl, CONFIG_CAN_LOG_LEVEL);
@ -60,8 +59,7 @@ static void dispatch_frame(const struct device *dev, struct can_frame *frame)
continue;
}
if (!can_utils_filter_match(frame,
&data->filters[filter_id].filter)) {
if (!can_frame_matches_filter(frame, &data->filters[filter_id].filter)) {
continue;
}