netlink.h
001:
002:
003:
004:
005:
006: <wg@grandegger.com>
007:
008:
009:
010: #ifndef CAN_NETLINK_H
011: #define CAN_NETLINK_H
012:
013: #include <linux/types.h>
014:
015:
016:
017:
018:
019:
020: http://www.semiconductors.bosch.de/pdf/can2spec.pdf.
021:
022: struct can_bittiming {
023: __u32 bitrate;
024: __u32 sample_point;
025: __u32 tq;
026: __u32 prop_seg;
027: __u32 phase_seg1;
028: __u32 phase_seg2;
029: __u32 sjw;
030: __u32 brp;
031: };
032:
033:
034:
035:
036:
037:
038: struct can_bittiming_const {
039: char name[16];
040: __u32 tseg1_min;
041: __u32 tseg1_max;
042: __u32 tseg2_min;
043: __u32 tseg2_max;
044: __u32 sjw_max;
045: __u32 brp_min;
046: __u32 brp_max;
047: __u32 brp_inc;
048: };
049:
050:
051:
052:
053: struct can_clock {
054: __u32 freq;
055: };
056:
057:
058:
059:
060: enum can_state {
061: CAN_STATE_ERROR_ACTIVE = 0,
062: CAN_STATE_ERROR_WARNING,
063: CAN_STATE_ERROR_PASSIVE,
064: CAN_STATE_BUS_OFF,
065: CAN_STATE_STOPPED,
066: CAN_STATE_SLEEPING,
067: CAN_STATE_MAX
068: };
069:
070:
071:
072:
073: struct can_berr_counter {
074: __u16 txerr;
075: __u16 rxerr;
076: };
077:
078:
079:
080:
081: struct can_ctrlmode {
082: __u32 mask;
083: __u32 flags;
084: };
085:
086: #define CAN_CTRLMODE_LOOPBACK 0x01
087: #define CAN_CTRLMODE_LISTENONLY 0x02
088: #define CAN_CTRLMODE_3_SAMPLES 0x04
089: #define CAN_CTRLMODE_ONE_SHOT 0x08
090: #define CAN_CTRLMODE_BERR_REPORTING 0x10
091:
092:
093:
094:
095: struct can_device_stats {
096: __u32 bus_error;
097: __u32 error_warning;
098: __u32 error_passive;
099: __u32 bus_off;
100: __u32 arbitration_lost;
101: __u32 restarts;
102: };
103:
104:
105:
106:
107: enum {
108: IFLA_CAN_UNSPEC,
109: IFLA_CAN_BITTIMING,
110: IFLA_CAN_BITTIMING_CONST,
111: IFLA_CAN_CLOCK,
112: IFLA_CAN_STATE,
113: IFLA_CAN_CTRLMODE,
114: IFLA_CAN_RESTART_MS,
115: IFLA_CAN_RESTART,
116: IFLA_CAN_BERR_COUNTER,
117: __IFLA_CAN_MAX
118: };
119:
120: #define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
121:
122: #endif
123:
© Andrew Scott 2006 -
2025,
All Rights Reserved