We are trying to modify the flexcan driver on a specific device to only receive certain CAN IDs. We are able to patch the driver to receive NO CAN IDs, but we are having trouble configuring the registers to only accept a list of certain CAN IDs.
Inside flexcan.c, we were able to find the code that configures the filtering in flexcan_chip_start (starting around line 1687):
/* acceptance mask/acceptance code (accept everything) */
priv->write(0x0, ®s->rxgmask);
priv->write(0x0, ®s->rx14mask);
priv->write(0x0, ®s->rx15mask);
if (priv->devtype_data.quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
priv->write(0x0, ®s->rxfgmask);
/* clear acceptance filters */
for (i = 0; i < priv->mb_count; i++)
priv->write(0, ®s->rximr[i]);
This patch is able to prevent us from receiving any CAN IDs, but we want to have a list of specific CAN IDs we receive:
We would appreciate any help on this, thanks.