diff options
author | Stephane Grosjean <s.grosjean@peak-system.com> | 2015-01-23 05:31:20 -0500 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-01-28 08:47:05 -0500 |
commit | e3629f5657e653c413b2970a91e5f9ea123b36dc (patch) | |
tree | 11240bb5878a4722773b10cc12baac38fd2e7fa3 /drivers/net/can | |
parent | e3c5ea60b474f9ba7e99542325416ca6d833cba9 (diff) |
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: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_core.c | 1 | ||||
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_core.h | 2 |
2 files changed, 3 insertions, 0 deletions
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 2768399a52fa..38634323ec51 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c | |||
@@ -750,6 +750,7 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, | |||
750 | dev->can.bittiming_const = &peak_usb_adapter->bittiming_const; | 750 | dev->can.bittiming_const = &peak_usb_adapter->bittiming_const; |
751 | dev->can.do_set_bittiming = peak_usb_set_bittiming; | 751 | dev->can.do_set_bittiming = peak_usb_set_bittiming; |
752 | dev->can.do_set_mode = peak_usb_set_mode; | 752 | dev->can.do_set_mode = peak_usb_set_mode; |
753 | dev->can.do_get_berr_counter = peak_usb_adapter->do_get_berr_counter; | ||
753 | dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported; | 754 | dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported; |
754 | 755 | ||
755 | netdev->netdev_ops = &peak_usb_netdev_ops; | 756 | 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 54fdb5978a05..739a344427a2 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.h +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.h | |||
@@ -67,6 +67,8 @@ struct peak_usb_adapter { | |||
67 | int (*dev_stop)(struct peak_usb_device *dev); | 67 | int (*dev_stop)(struct peak_usb_device *dev); |
68 | int (*dev_restart_async)(struct peak_usb_device *dev, struct urb *urb, | 68 | int (*dev_restart_async)(struct peak_usb_device *dev, struct urb *urb, |
69 | u8 *buf); | 69 | u8 *buf); |
70 | int (*do_get_berr_counter)(const struct net_device *netdev, | ||
71 | struct can_berr_counter *bec); | ||
70 | u8 ep_msg_in; | 72 | u8 ep_msg_in; |
71 | u8 ep_msg_out[PCAN_USB_MAX_CHANNEL]; | 73 | u8 ep_msg_out[PCAN_USB_MAX_CHANNEL]; |
72 | u8 ts_used_bits; | 74 | u8 ts_used_bits; |