1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

drivers/mcp2515: allow for can_mask == 0, promiscuos

can_mask = 0 is a valid value to reaceive all frames
This commit is contained in:
Francisco Molina 2022-04-08 13:57:25 +02:00
parent 3084928151
commit c07514ad3f

View File

@ -428,10 +428,6 @@ static int _set_filter(candev_t *dev, const struct can_filter *filter)
candev_mcp2515_t *dev_mcp = container_of(dev, candev_mcp2515_t, candev);
if (f.can_mask == 0) {
return -EINVAL; /* invalid mask */
}
if (mutex_trylock(&_mcp_mutex)) {
mode = mcp2515_get_mode(dev_mcp);
res = mcp2515_set_mode(dev_mcp, MODE_CONFIG);
@ -530,10 +526,6 @@ static int _remove_filter(candev_t *dev, const struct can_filter *filter)
candev_mcp2515_t *dev_mcp = container_of(dev, candev_mcp2515_t, candev);
if (f.can_mask == 0) {
return -1; /* invalid mask */
}
if (mutex_trylock(&_mcp_mutex)) {
mode = mcp2515_get_mode(dev_mcp);
res = mcp2515_set_mode(dev_mcp, MODE_CONFIG);