From: matthias.fuchs@esd.eu
To: linux-can@vger.kernel.org
Cc: Matthias Fuchs <matthias.fuchs@esd.eu>
Subject: [PATCH v2 1/2] can: usb: esd_usb2: Add support for listen-only mode
Date: Mon, 29 Oct 2012 10:54:47 +0100 [thread overview]
Message-ID: <1351504488-7060-2-git-send-email-matthias.fuchs@esd.eu> (raw)
In-Reply-To: <1351504488-7060-1-git-send-email-matthias.fuchs@esd.eu>
From: Matthias Fuchs <matthias.fuchs@esd.eu>
Add listen-only mode for esd_usb2 driver.
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
---
drivers/net/can/usb/esd_usb2.c | 4 ++++
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;
--
1.7.4.1
next prev parent reply other threads:[~2012-10-29 9:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 9:54 [PATCH v2 0/2] can: usb: esd_usb2: Add support for CAN-USB/Micro and listen-only mode matthias.fuchs
2012-10-29 9:54 ` matthias.fuchs [this message]
2012-10-29 10:08 ` [PATCH v2 1/2] can: usb: esd_usb2: Add support for " Marc Kleine-Budde
2012-10-29 9:54 ` [PATCH v2 2/2] can: usb: esd_usb2: Add support for CAN-USB/Micro matthias.fuchs
2012-10-29 10:26 ` Marc Kleine-Budde
2012-10-29 10:27 ` Marc Kleine-Budde
2012-10-29 11:33 ` Matthias Fuchs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351504488-7060-2-git-send-email-matthias.fuchs@esd.eu \
--to=matthias.fuchs@esd.eu \
--cc=linux-can@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).