ip link set can0 up type can - crash in kernel

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ip link set can0 up type can - crash in kernel

1,393 次查看
fatalfeel
Contributor V

in Target terminal input command

root@matrix_io:/ # ip link set can0 up type can

crash in linux kernel

0 项奖励
2 回复数

949 次查看
igorpadykov
NXP Employee
NXP Employee

Hi jesse

for flexcan configuaration one can look at i.MX6 Sabre AI dts:

arch/arm/boot/dts/imx6qdl-sabreauto.dtsi

http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/arch/arm/boot/dts/imx6qdl-sabreauto.dts... 

and check sect.5.1 Build configurations attached Yocto Guide.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励

949 次查看
fatalfeel
Contributor V

in myandroid/kernel_imx/drivers/net/can/dev.c

static int can_validate(struct nlattr *tb[], struct nlattr *data[])
{
    bool is_can_fd = false;

    /* begin: issue #: prevent  crash */
    if( data != NULL ) //add this can prevent from crash
    {
        if (data[IFLA_CAN_CTRLMODE]) {
            struct can_ctrlmode *cm = nla_data(data[IFLA_CAN_CTRLMODE]);

            is_can_fd = cm->flags & cm->mask & CAN_CTRLMODE_FD;
        }

        if (is_can_fd) {
            if (!data[IFLA_CAN_BITTIMING] || !data[IFLA_CAN_DATA_BITTIMING])
                return -EOPNOTSUPP;
        }

        if (data[IFLA_CAN_DATA_BITTIMING]) {
            if (!is_can_fd || !data[IFLA_CAN_BITTIMING])
                return -EOPNOTSUPP;
        }

        return 0;
    }

    return -ENODATA;
    /* end: issue #: prevent  crash */
}

0 项奖励