can: peak_usb: export ctrlmode_supported to adapter specific definition
authorStephane Grosjean <s.grosjean@peak-system.com>
Fri, 23 Jan 2015 10:31:19 +0000 (11:31 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 28 Jan 2015 13:47:05 +0000 (14:47 +0100)
Export the ctrlmode_supported value from the core file to each adapter specific
file. This has been mandatory for supporting the new CANFD extension.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb.c
drivers/net/can/usb/peak_usb/pcan_usb_core.c
drivers/net/can/usb/peak_usb/pcan_usb_core.h
drivers/net/can/usb/peak_usb/pcan_usb_pro.c

index d57d3f64a5bfc2661617105d5fc89f4efe65dde4..72427f21edffaa9fed0874085e277aa4c83783b7 100644 (file)
@@ -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 ,
        },
index 729b80d78322669cb563ccf88cb02d8f909a7b9a..2768399a52fa99dadfdf615056d4efda668da3db 100644 (file)
@@ -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;
 
index 10f2fcac7c13d09f917c951260b80bf3bff7d993..54fdb5978a057471c49ca8b93f2f2a8f7e6b30dd 100644 (file)
@@ -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;
index 56855b2b1fa1180b22851ee9fffa9a1636289569..03f517160a67607289deae17df25f1784d5bc619 100644 (file)
@@ -1016,6 +1016,7 @@ const struct peak_usb_adapter pcan_usb_pro = {
        .name = "PCAN-USB Pro",
        .device_id = PCAN_USBPRO_PRODUCT_ID,
        .ctrl_count = PCAN_USBPRO_CHANNEL_COUNT,
+       .ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
        .clock = {
                .freq = PCAN_USBPRO_CRYSTAL_HZ,
        },