summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMatthias Fuchs <matthias.fuchs@esd.eu>2012-10-29 09:54:47 (GMT)
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-11-15 16:26:00 (GMT)
commita5f8f0e1a57025287697df78ce5e6b7d6b2b07b0 (patch)
tree1ef764763b961a9ac271a442df67c85ccbe096fd /drivers
parente4bc6c06569a90512169d98a11b3eb2ec18da4ae (diff)
downloadlinux-a5f8f0e1a57025287697df78ce5e6b7d6b2b07b0.tar.xz
can: usb: esd_usb2: Add support for listen-only mode
Add listen-only mode for esd_usb2 driver. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/can/usb/esd_usb2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index bd36e55..f4317c0 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -891,6 +891,9 @@ static int esd_usb2_set_bittiming(struct net_device *netdev)
u32 canbtr;
canbtr = ESD_USB2_UBR;
+ if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
+ canbtr |= ESD_USB2_LOM;
+
canbtr |= (bt->brp - 1) & (ESD_USB2_BRP_MAX - 1);
canbtr |= ((bt->sjw - 1) & (ESD_USB2_SJW_MAX - 1))
<< ESD_USB2_SJW_SHIFT;
@@ -971,6 +974,7 @@ static int esd_usb2_probe_one_net(struct usb_interface *intf, int index)
priv->index = index;
priv->can.state = CAN_STATE_STOPPED;
+ priv->can.ctrlmode_supported = CAN_CTRLMODE_LISTENONLY;
priv->can.clock.freq = ESD_USB2_CAN_CLOCK;
priv->can.bittiming_const = &esd_usb2_bittiming_const;
priv->can.do_set_bittiming = esd_usb2_set_bittiming;