diff options
author | Wolfgang Grandegger <wg@grandegger.com> | 2012-02-01 11:14:13 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-02-03 01:21:26 +0100 |
commit | 79d0d8a7d5edca459f544c2ad75088e99307795e (patch) | |
tree | 97126b05dd6906f42ce717ba97f5ac9361bfaecb /drivers/net/can/ti_hecc.c | |
parent | 03c49daa8168b58e6256f0cad88771b9440ca5f7 (diff) | |
download | blackbird-op-linux-79d0d8a7d5edca459f544c2ad75088e99307795e.tar.gz blackbird-op-linux-79d0d8a7d5edca459f544c2ad75088e99307795e.zip |
can: bfin_can/ti_hecc/mscan: add missing do_get_berr_counter callback
Cc: Anant Gole <anantgole@ti.com>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/ti_hecc.c')
-rw-r--r-- | drivers/net/can/ti_hecc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c index df809e3f130e..aee925ab0de8 100644 --- a/drivers/net/can/ti_hecc.c +++ b/drivers/net/can/ti_hecc.c @@ -458,6 +458,17 @@ static int ti_hecc_do_set_mode(struct net_device *ndev, enum can_mode mode) return ret; } +static int ti_hecc_get_berr_counter(const struct net_device *ndev, + struct can_berr_counter *bec) +{ + struct ti_hecc_priv *priv = netdev_priv(ndev); + + bec->txerr = hecc_read(priv, HECC_CANTEC); + bec->rxerr = hecc_read(priv, HECC_CANREC); + + return 0; +} + /* * ti_hecc_xmit: HECC Transmit * @@ -922,6 +933,7 @@ static int ti_hecc_probe(struct platform_device *pdev) priv->can.bittiming_const = &ti_hecc_bittiming_const; priv->can.do_set_mode = ti_hecc_do_set_mode; priv->can.do_get_state = ti_hecc_get_state; + priv->can.do_get_berr_counter = ti_hecc_get_berr_counter; priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES; spin_lock_init(&priv->mbx_lock); |