summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2017-01-11 17:05:35 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2017-01-24 13:52:00 +0100
commit431af779256cd6cb8328ac23c5696bae63c33a51 (patch)
treefdfd3634d376b4e010649e40bb6edf2f80d35948 /include
parentc3606d438a14faa8319eccb75b9502960a97af16 (diff)
can: dev: add CAN interface API for fixed bitrates
Some CAN interfaces only support fixed fixed bitrates. This patch adds a netlink interface to get the list of the CAN interface's fixed bitrates and data bitrates. Inside the driver arrays of supported data- bitrate values are defined. const u32 drvname_bitrate[] = { 20000, 50000, 100000 }; const u32 drvname_data_bitrate[] = { 200000, 500000, 1000000 }; struct drvname_priv *priv; priv = netdev_priv(dev); priv->bitrate_const = drvname_bitrate; priv->bitrate_const_cnt = ARRAY_SIZE(drvname_bitrate); priv->data_bitrate_const = drvname_data_bitrate; priv->data_bitrate_const_cnt = ARRAY_SIZE(drvname_data_bitrate); Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/can/dev.h4
-rw-r--r--include/uapi/linux/can/netlink.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index f6a57f322f00..141b05aade81 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -41,6 +41,10 @@ struct can_priv {
const u16 *termination_const;
unsigned int termination_const_cnt;
u16 termination;
+ const u32 *bitrate_const;
+ unsigned int bitrate_const_cnt;
+ const u32 *data_bitrate_const;
+ unsigned int data_bitrate_const_cnt;
struct can_clock clock;
enum can_state state;
diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h
index 7414771926fb..fdf75f74fdaf 100644
--- a/include/uapi/linux/can/netlink.h
+++ b/include/uapi/linux/can/netlink.h
@@ -129,6 +129,8 @@ enum {
IFLA_CAN_DATA_BITTIMING_CONST,
IFLA_CAN_TERMINATION,
IFLA_CAN_TERMINATION_CONST,
+ IFLA_CAN_BITRATE_CONST,
+ IFLA_CAN_DATA_BITRATE_CONST,
__IFLA_CAN_MAX
};