summaryrefslogtreecommitdiff
path: root/drivers/net/can/ti_hecc.c
diff options
context:
space:
mode:
authorWolfgang Grandegger <wg@grandegger.com>2012-02-01 11:14:13 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-02-03 01:21:26 +0100
commit79d0d8a7d5edca459f544c2ad75088e99307795e (patch)
tree97126b05dd6906f42ce717ba97f5ac9361bfaecb /drivers/net/can/ti_hecc.c
parent03c49daa8168b58e6256f0cad88771b9440ca5f7 (diff)
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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index df809e3f130..aee925ab0de 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);