From: Stephane Grosjean <s.grosjean@peak-system.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>, linux-can@vger.kernel.org
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Subject: Re: [PATCH] can/peak_usb: add adapter BEC callback definition
Date: Tue, 20 Jan 2015 15:46:23 +0100 [thread overview]
Message-ID: <54BE6A3F.40405@peak-system.com> (raw)
In-Reply-To: <54BE640B.2050509@pengutronix.de>
Le 20/01/2015 15:19, Marc Kleine-Budde a écrit :
> On 01/19/2015 05:15 PM, Stephane Grosjean wrote:
>> Add the definition of a new callback that enable any PEAK-System CAN USB
>> adapter to grant read access to its Bus Error Counters value.
>> This ability is not supported by all the PEAK-System adapters, thus,
>> for those, the callback pointer will be initiaized to NULL, which is
>> correct regarding the linux-can device driver specs.
>>
>> Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
>> ---
>> drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 ++
>> drivers/net/can/usb/peak_usb/pcan_usb_core.h | 2 ++
>> 2 files changed, 4 insertions(+)
>>
>> diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
>> index c23609a..7a73060 100644
>> --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
>> +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
>> @@ -794,6 +794,8 @@ static int peak_usb_create_dev(struct peak_usb_adapter *peak_usb_adapter,
>> dev->can.data_bittiming_const = &peak_usb_adapter->data_bittiming_const;
>> dev->can.do_set_data_bittiming = peak_usb_set_data_bittiming;
>> dev->can.do_set_mode = peak_usb_set_mode;
>> + dev->can.do_get_berr_counter =
>> + peak_usb_adapter->candev_get_berr_counter;
>> dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported;
>>
>> netdev->netdev_ops = &peak_usb_netdev_ops;
>> diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.h b/drivers/net/can/usb/peak_usb/pcan_usb_core.h
>> index a58d971..fb402d2 100644
>> --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.h
>> +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.h
>> @@ -70,6 +70,8 @@ struct peak_usb_adapter {
>> int (*dev_stop)(struct peak_usb_device *dev);
>> int (*dev_restart_async)(struct peak_usb_device *dev, struct urb *urb,
>> u8 *buf);
>> + int (*candev_get_berr_counter)(const struct net_device *netdev,
> ^^^^^^
>
> I think this prefix can be removed. I've done so in my series.
FYI: I added this specific prefix because this is the only callback I'm
obliged to use with the "struct net_device *" argument.
No other way to setup a specific callback to get the BEC.
>
>> + struct can_berr_counter *bec);
>> u8 ep_msg_in;
>> u8 ep_msg_out[PCAN_USB_MAX_CHANNEL];
>> u8 ts_used_bits;
>>
> Marc
--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt
Handelsregister Darmstadt HRB 9183
Geschaeftsfuehrung: Alexander Gach, Uwe Wilhelm
--
next prev parent reply other threads:[~2015-01-20 14:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 16:15 [PATCH] can/peak_usb: upgrade core to new CANFD extension Stephane Grosjean
2015-01-19 16:15 ` [PATCH] can/peak_usb: export ctrlmode_supported to adapter specific Stephane Grosjean
2015-01-20 14:18 ` Marc Kleine-Budde
2015-01-19 16:15 ` [PATCH] can/peak_usb: add adapter BEC callback definition Stephane Grosjean
2015-01-20 14:19 ` Marc Kleine-Budde
2015-01-20 14:46 ` Stephane Grosjean [this message]
2015-01-20 14:50 ` Marc Kleine-Budde
2015-01-20 14:17 ` [PATCH] can/peak_usb: upgrade core to new CANFD extension Marc Kleine-Budde
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=54BE6A3F.40405@peak-system.com \
--to=s.grosjean@peak-system.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=socketcan@hartkopp.net \
/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).