• M
    can: dev: add CAN interface API for fixed bitrates · 431af779
    Marc Kleine-Budde 提交于
    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: NMarc Kleine-Budde <mkl@pengutronix.de>
    431af779
dev.c 32.8 KB