Skip to contentSkip to conversation

can/peak_usb: export ctrlmode_supported to adapter specific

PATCH Stéphane Grosjean 2 participants 2 messages Jan 27, 2015 CAN network drivers

lore
Share & tools
lore
#0 lore raw

Hum… forget about my last email acking something I signed-off… Sorry for the noise…

Quoted 66 lines · Stéphane Grosjean

Hi Mark,

You've got my Ack for this patch (too)(again).

Quoted 60 lines · Marc Kleine-Budde

From: Stephane Grosjean <[email protected]>

Export the ctrlmode_supported value from the core file to each adapter specific file. This has been mandatory for supporting the new CANFD extension.

---
drivers/net/can/usb/peak_usb/pcan_usb.c      | 1 + drivers/net/can/usb/peak_usb/pcan_usb_core.c | 3 +-- drivers/net/can/usb/peak_usb/pcan_usb_core.h | 1 + drivers/net/can/usb/peak_usb/pcan_usb_pro.c  | 1 +

4 files changed, 4 insertions(+), 2 deletions(-) 
drivers/net/can/usb/peak_usb/pcan_usb.c +1 -0
index d57d3f64a5bf..72427f21edff 100644 
@@ -859,6 +859,7 @@ const struct peak_usb_adapter pcan_usb = { 
 .name = "PCAN-USB", 
 .device_id = PCAN_USB_PRODUCT_ID, 
 .ctrl_count = 1, 
+ .ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY, 
 .clock = { 
 .freq = PCAN_USB_CRYSTAL_HZ / 2 , 
 }, 
drivers/net/can/usb/peak_usb/pcan_usb_core.c +1 -2
index 729b80d78322..2768399a52fa 100644 
@@ -750,8 +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.do_set_bittiming = peak_usb_set_bittiming; 
 dev->can.do_set_mode = peak_usb_set_mode; 
- dev->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | 
-       CAN_CTRLMODE_LISTENONLY; 
+ dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported; 
 
 netdev->netdev_ops = &peak_usb_netdev_ops; 
 
drivers/net/can/usb/peak_usb/pcan_usb_core.h +1 -0
index 10f2fcac7c13..54fdb5978a05 100644 
@@ -44,6 +44,7 @@ struct peak_usb_device; 
 struct peak_usb_adapter { 
 char *name; 
 u32 device_id; 
+ u32 ctrlmode_supported; 
 struct can_clock clock; 
 const struct can_bittiming_const bittiming_const; 
 unsigned int ctrl_count; 
drivers/net/can/usb/peak_usb/pcan_usb_pro.c +0 -0
index 56855b2b1fa1..03f517160a67 100644 
@@ -1016,6 +1016,7 @@ const struct peak_usb_adapter pcan_usb_pro = { 
 .name = "PCAN-USB Pro", 
 .device_id = PCAN_USBPRO_PRODUCT_ID, 
Quoted 8 lines
Quoted 8 lines
drivers/net/can/usb/peak_usb/pcan_usb_pro.c +1 -0
 .ctrl_count = PCAN_USBPRO_CHANNEL_COUNT, 
+ .ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY, 
 .clock = { 
 .freq = PCAN_USBPRO_CRYSTAL_HZ, 
 }, 
Signature · 1 line
2.1.4 

--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt
Handelsregister Darmstadt HRB 9183
Geschaeftsfuehrung: Alexander Gach, Uwe Wilhelm
--

#1 lore raw
Quoted 1 line · Stéphane Grosjean

Hum… forget about my last email acking something I signed-off… Sorry for the noise…

:D

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |