drivers: can: mcan: add generic support for can_get_max_filters()
Add generic support for can_get_max_filters() to the Bosch M_CAN base driver and use it in all driver frontends. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
3e80e75c19
commit
5fd079bd68
6 changed files with 17 additions and 23 deletions
|
@ -828,6 +828,17 @@ static int can_mcan_get_free_std(volatile struct can_mcan_std_filter *filters)
|
|||
return -ENOSPC;
|
||||
}
|
||||
|
||||
int can_mcan_get_max_filters(const struct device *dev, enum can_ide id_type)
|
||||
{
|
||||
ARG_UNUSED(dev);
|
||||
|
||||
if (id_type == CAN_STANDARD_IDENTIFIER) {
|
||||
return NUM_STD_FILTER_DATA;
|
||||
} else {
|
||||
return NUM_EXT_FILTER_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
/* Use masked configuration only for simplicity. If someone needs more than
|
||||
* 28 standard filters, dual mode needs to be implemented.
|
||||
* Dual mode gets tricky, because we can only activate both filters.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue