libnl 3.5.0

can.h
1 /*
2 * netlink/route/link/can.h CAN interface
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
7 * of the License.
8 *
9 * Copyright (c) 2012 Benedikt Spranger <b.spranger@linutronix.de>
10 */
11
12 #ifndef NETLINK_LINK_CAN_H_
13 #define NETLINK_LINK_CAN_H_
14
15 #include <netlink/netlink.h>
16 #include <netlink/route/link.h>
17 #include <linux/can/netlink.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 struct can_bittiming_const;
24 struct can_bittiming;
25 struct can_berr_counter;
26
27 extern int rtnl_link_is_can(struct rtnl_link *link);
28
29 extern char *rtnl_link_can_ctrlmode2str(int, char *, size_t);
30 extern int rtnl_link_can_str2ctrlmode(const char *);
31
32 extern int rtnl_link_can_restart(struct rtnl_link *);
33 extern int rtnl_link_can_freq(struct rtnl_link *, uint32_t *);
34 extern int rtnl_link_can_state(struct rtnl_link *, uint32_t *);
35
36 extern int rtnl_link_can_berr_rx(struct rtnl_link *);
37 extern int rtnl_link_can_berr_tx(struct rtnl_link *);
38 extern int rtnl_link_can_berr(struct rtnl_link *, struct can_berr_counter *);
39
40 extern int rtnl_link_can_get_bt_const(struct rtnl_link *,
41 struct can_bittiming_const *);
42 extern int rtnl_link_can_get_bittiming(struct rtnl_link *,
43 struct can_bittiming *);
44 extern int rtnl_link_can_set_bittiming(struct rtnl_link *,
45 struct can_bittiming *);
46
47 extern int rtnl_link_can_get_bitrate(struct rtnl_link *, uint32_t *);
48 extern int rtnl_link_can_set_bitrate(struct rtnl_link *, uint32_t);
49
50 extern int rtnl_link_can_get_sample_point(struct rtnl_link *, uint32_t *);
51 extern int rtnl_link_can_set_sample_point(struct rtnl_link *, uint32_t);
52
53 extern int rtnl_link_can_get_restart_ms(struct rtnl_link *, uint32_t *);
54 extern int rtnl_link_can_set_restart_ms(struct rtnl_link *, uint32_t);
55
56 extern int rtnl_link_can_get_ctrlmode(struct rtnl_link *, uint32_t *);
57 extern int rtnl_link_can_set_ctrlmode(struct rtnl_link *, uint32_t);
58 extern int rtnl_link_can_unset_ctrlmode(struct rtnl_link *, uint32_t);
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64 #endif
rtnl_link_can_restart
int rtnl_link_can_restart(struct rtnl_link *)
Restart CAN device.
Definition: can.c:378
rtnl_link_can_berr_rx
int rtnl_link_can_berr_rx(struct rtnl_link *)
Get CAN RX bus error count.
Definition: can.c:438
rtnl_link_can_set_ctrlmode
int rtnl_link_can_set_ctrlmode(struct rtnl_link *, uint32_t)
Set a CAN Control Mode.
Definition: can.c:717
rtnl_link_can_set_restart_ms
int rtnl_link_can_set_restart_ms(struct rtnl_link *, uint32_t)
Set CAN device restart intervall.
Definition: can.c:675
rtnl_link_is_can
int rtnl_link_is_can(struct rtnl_link *link)
Check if link is a CAN link.
Definition: can.c:367
rtnl_link_can_unset_ctrlmode
int rtnl_link_can_unset_ctrlmode(struct rtnl_link *, uint32_t)
Unset a CAN Control Mode.
Definition: can.c:737
rtnl_link_can_berr
int rtnl_link_can_berr(struct rtnl_link *, struct can_berr_counter *)
Get CAN bus error count.
Definition: can.c:475
rtnl_link
Link object.
rtnl_link_can_get_bitrate
int rtnl_link_can_get_bitrate(struct rtnl_link *, uint32_t *)
Get CAN device bit-timing.
Definition: can.c:568
rtnl_link_can_state
int rtnl_link_can_state(struct rtnl_link *, uint32_t *)
Get CAN state.
Definition: can.c:419
rtnl_link_can_get_bt_const
int rtnl_link_can_get_bt_const(struct rtnl_link *, struct can_bittiming_const *)
Get CAN harware-dependent bit-timing constant.
Definition: can.c:498
rtnl_link_can_get_restart_ms
int rtnl_link_can_get_restart_ms(struct rtnl_link *, uint32_t *)
Get CAN device restart intervall.
Definition: can.c:652
rtnl_link_can_set_bitrate
int rtnl_link_can_set_bitrate(struct rtnl_link *, uint32_t)
Set CAN device bit-rate.
Definition: can.c:591
rtnl_link_can_get_sample_point
int rtnl_link_can_get_sample_point(struct rtnl_link *, uint32_t *)
Get CAN device sample point.
Definition: can.c:610
rtnl_link_can_get_ctrlmode
int rtnl_link_can_get_ctrlmode(struct rtnl_link *, uint32_t *)
Get CAN control mode.
Definition: can.c:694
rtnl_link_can_set_bittiming
int rtnl_link_can_set_bittiming(struct rtnl_link *, struct can_bittiming *)
Set CAN device bit-timing.
Definition: can.c:546
rtnl_link_can_set_sample_point
int rtnl_link_can_set_sample_point(struct rtnl_link *, uint32_t)
Set CAN device sample point.
Definition: can.c:633
rtnl_link_can_freq
int rtnl_link_can_freq(struct rtnl_link *, uint32_t *)
Get CAN base frequency.
Definition: can.c:397
rtnl_link_can_berr_tx
int rtnl_link_can_berr_tx(struct rtnl_link *)
Get CAN TX bus error count.
Definition: can.c:456
rtnl_link_can_get_bittiming
int rtnl_link_can_get_bittiming(struct rtnl_link *, struct can_bittiming *)
Get CAN device bit-timing.
Definition: can.c:522