Commit e3629f56 authored by Stephane Grosjean's avatar Stephane Grosjean Committed by Marc Kleine-Budde

can: peak_usb: add adapter BEC callback definition

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: default avatarStephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent e3c5ea60
...@@ -750,6 +750,7 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, ...@@ -750,6 +750,7 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter,
dev->can.bittiming_const = &peak_usb_adapter->bittiming_const; dev->can.bittiming_const = &peak_usb_adapter->bittiming_const;
dev->can.do_set_bittiming = peak_usb_set_bittiming; dev->can.do_set_bittiming = peak_usb_set_bittiming;
dev->can.do_set_mode = peak_usb_set_mode; dev->can.do_set_mode = peak_usb_set_mode;
dev->can.do_get_berr_counter = peak_usb_adapter->do_get_berr_counter;
dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported; dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported;
netdev->netdev_ops = &peak_usb_netdev_ops; netdev->netdev_ops = &peak_usb_netdev_ops;
......
...@@ -67,6 +67,8 @@ struct peak_usb_adapter { ...@@ -67,6 +67,8 @@ struct peak_usb_adapter {
int (*dev_stop)(struct peak_usb_device *dev); int (*dev_stop)(struct peak_usb_device *dev);
int (*dev_restart_async)(struct peak_usb_device *dev, struct urb *urb, int (*dev_restart_async)(struct peak_usb_device *dev, struct urb *urb,
u8 *buf); u8 *buf);
int (*do_get_berr_counter)(const struct net_device *netdev,
struct can_berr_counter *bec);
u8 ep_msg_in; u8 ep_msg_in;
u8 ep_msg_out[PCAN_USB_MAX_CHANNEL]; u8 ep_msg_out[PCAN_USB_MAX_CHANNEL];
u8 ts_used_bits; u8 ts_used_bits;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment