/*
* linux/can/netlink.h
*
* Definitions for the CAN netlink interface
*
* Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the version 2 of the GNU General Public License
* as published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _UAPI_CAN_NETLINK_H
#define _UAPI_CAN_NETLINK_H
#include <linux/types.h>
/*
* CAN bit-timing parameters
*
* For further information, please read chapter "8 BIT TIMING
* REQUIREMENTS" of the "Bosch CAN Specification version 2.0"
* at http://www.semiconductors.bosch.de/pdf/can2spec.pdf.
*/
struct can_bittiming {
__u32 bitrate; /* Bit-rate in bits/second */
__u32 sample_point; /* Sample point in one-tenth of a percent */
__u32 tq; /* Time quanta (TQ) in nanoseconds */
__u32 prop_seg; /* Propagation segment in TQs */
__u32 phase_seg1; /* Phase buffer segment 1 in TQs */
__u32 phase_seg2; /* Phase buffer segment 2 in TQs */
__u32 sjw; /* Synchronisation jump width in TQs */
__u32 brp; /* Bit-rate prescaler */
};
/*
* CAN harware-dependent bit-timing constant
*
* Used for calculating and checking bit-timing parameters
*/
struct can_bittiming_const {
char name[16]; /* Name of the CAN controller hardware */
__u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */
__u32 tseg1_max;
__u32 tseg2_min; /* Time segement 2 = phase_seg2 */
__u32 tseg2_max;
__u32 sjw_max; /* Synchronisation jump width */
__u32 brp_min; /* Bit-rate prescaler */
__u32 brp_max;
__u32 brp_inc;
};
/*
* CAN clock parameters
*/
struct can_clock {
__u32 freq; /* CAN system clock frequency in Hz */
};
/*
* CAN operational and error states
*/
enum can_state {
CAN_STATE_ERROR_ACTIVE = 0, /* RX/TX error count < 96 */
CAN_STATE_ERROR_WARNING, /* RX/TX error count < 128 */
CAN_STATE_ERROR_PASSIVE, /* RX/TX error count < 256 */
CAN_STATE_BUS_OFF, /* RX/TX error count >= 256 */
CAN_STATE_STOPPED, /* Device is stopped */
CAN_STATE_SLEEPING, /* Device is sleeping */
CAN_STATE_MAX
};
/*
* CAN bus error counters
*/
struct can_berr_counter {
__u16 txerr;
__u16 rxerr;
};
/*
* CAN controller mode
*/
struct can_ctrlmode {
__u32 mask;
__u32 flags;
};
#define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */
#define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */
#define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */
#define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
#define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
#define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */
#define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */
/*
* CAN device statistics
*/
struct can_device_stats {
__u32 bus_error; /* Bus errors */
__u32 error_warning; /* Changes to error warning state */
__u32 error_passive; /* Changes to error passive state */
__u32 bus_off; /* Changes to bus off state */
__u32 arbitration_lost; /* Arbitration lost errors */
__u32 restarts; /* CAN controller re-starts */
};
/*
* CAN netlink interface
*/
enum {
IFLA_CAN_UNSPEC,
IFLA_CAN_BITTIMING,
IFLA_CAN_BITTIMING_CONST,
IFLA_CAN_CLOCK,
IFLA_CAN_STATE,
IFLA_CAN_CTRLMODE,
IFLA_CAN_RESTART_MS,
IFLA_CAN_RESTART,
IFLA_CAN_BERR_COUNTER,
IFLA_CAN_DATA_BITTIMING,
IFLA_CAN_DATA_BITTIMING_CONST,
__IFLA_CAN_MAX
};
#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
#endif /* !_UAPI_CAN_NETLINK_H */
程序_人生
- 粉丝: 56
- 资源: 4
最新资源
- cim-websocket
- TouchSocket-websocket
- ubuntu-ubuntu
- ABAQUS UMAT&VUMAT子程序二次开发实例源码Fortran DISP 材料损伤断裂弹塑性
- comsol介质阻挡放电DBD模型,可以得到电子数目密度和电子密度等分布
- 声子晶体声表面波光学特性
- 西门子1200博图程序冷却油泵PID控制系统,和多台油泵及水泵G120西门子变频器Modbud RTU通讯,画面采用西门子KTP700触摸屏,内有变频器参数 Modbus通讯报文详细讲解,PID带手动
- STM32F405_RAW-stm32cubemx
- 西门子1200 1500博途单部电梯程序,文件包含一个四层电梯程序,三个六层电梯程序,版本TIA16 仅一个六层电梯有触摸屏画面,程序仅限于用于参考对比 博图版本V15.1及以上
- Javascript-javascript
- 西门子1200PLC加KTP触摸屏画面博途程序案例,博图版本V16,程序具体为电池涂布机浆料输送系统新能源项目 程序结构分: 1.配料系统物料分配输送 2.模拟量转,监测
- 西门子S7-1500暖通空调冷水机组PLC程序案例, 硬件采用西门子1500CPU+ET200SP接口IO模块,HMI采用西门子触摸屏 程序采用SCL控制程序编程,系统水泵采用一用一备,通过程序实现
- 西门子200Smart加维纶触摸屏程序画面程序案例,项目内容为某制造企业疫苗车间控制系统,报告配液工艺,发酵工艺,纯化工艺及CIP清洗工艺控制 程序结构清晰,控制功能较多,包含模拟量,泵,PID,U
- stm32CubeMx_F429-stm32cubemx
- 51单片机8路抢答器(二)C程序、proteus仿真、报告 支持按键设置、LED数码管显示 支持按键设置开始、加分、减分、准备 1.八个按键分别表示1至8号选手 2当按下开始键后,从10秒开始倒计
- ModBus-stm32cubemx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈