diff options
author | David S. Miller <davem@davemloft.net> | 2014-08-23 20:12:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-23 20:12:08 +0200 |
commit | f9474ddfaa009ead12bba44fa8fd49dc4536a124 (patch) | |
tree | a1738a74ac909d84cc80af674d7c0b78af10a413 /drivers/net/can/flexcan.c | |
parent | tcp: improve undo on timeout (diff) | |
parent | vxlan: fix incorrect initializer in union vxlan_addr (diff) | |
download | linux-f9474ddfaa009ead12bba44fa8fd49dc4536a124.tar.xz linux-f9474ddfaa009ead12bba44fa8fd49dc4536a124.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pulling to get some TIPC fixes that a net-next series depends
upon.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/flexcan.c')
-rw-r--r-- | drivers/net/can/flexcan.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index ff1beb92a985..2700865efcad 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -608,6 +608,13 @@ static void do_state(struct net_device *dev, /* process state changes depending on the new state */ switch (new_state) { + case CAN_STATE_ERROR_WARNING: + netdev_dbg(dev, "Error Warning\n"); + cf->can_id |= CAN_ERR_CRTL; + cf->data[1] = (bec.txerr > bec.rxerr) ? + CAN_ERR_CRTL_TX_WARNING : + CAN_ERR_CRTL_RX_WARNING; + break; case CAN_STATE_ERROR_ACTIVE: netdev_dbg(dev, "Error Active\n"); cf->can_id |= CAN_ERR_PROT; @@ -911,6 +918,8 @@ static int flexcan_chip_start(struct net_device *dev) if (priv->devtype_data->features & FLEXCAN_HAS_BROKEN_ERR_STATE || priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) reg_ctrl |= FLEXCAN_CTRL_ERR_MSK; + else + reg_ctrl &= ~FLEXCAN_CTRL_ERR_MSK; /* save for later use */ priv->reg_ctrl_default = reg_ctrl; |