Skip to content

Commit f2fe0f0

Browse files
committed
Add contents of linux/can/bcm.h
1 parent 61b722e commit f2fe0f0

File tree

4 files changed

+80
-1
lines changed

4 files changed

+80
-1
lines changed

libc-test/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3736,6 +3736,7 @@ fn test_linux(target: &str) {
37363736
headers! { cfg:
37373737
[gnu]: "linux/aio_abi.h",
37383738
"linux/can.h",
3739+
"linux/can/bcm.h",
37393740
"linux/can/raw.h",
37403741
"linux/can/j1939.h",
37413742
"linux/cn_proc.h",
@@ -4815,7 +4816,9 @@ fn test_linux(target: &str) {
48154816
// the `xsk_tx_metadata_union` field is an anonymous union
48164817
(struct_ == "xsk_tx_metadata" && field == "xsk_tx_metadata_union") ||
48174818
// After musl 1.2.0, the type becomes `int` instead of `long`.
4818-
(old_musl && struct_ == "utmpx" && field == "ut_session")
4819+
(old_musl && struct_ == "utmpx" && field == "ut_session") ||
4820+
// `frames` is a VLA
4821+
(struct_ == "bcm_msg_head" && field == "frames")
48194822
});
48204823

48214824
cfg.skip_roundtrip(move |s| match s {
@@ -4852,6 +4855,7 @@ fn test_linux(target: &str) {
48524855
"inotify_event" => true,
48534856
"fanotify_event_info_fid" => true,
48544857
"cmsghdr" => true,
4858+
"bcm_msg_head" => true,
48554859

48564860
// FIXME(linux): the call ABI of max_align_t is incorrect on these platforms:
48574861
"max_align_t" if i686 || ppc64 => true,

libc-test/semver/linux.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ CAN_EFF_ID_BITS
232232
CAN_EFF_MASK
233233
CAN_ERR_FLAG
234234
CAN_ERR_MASK
235+
CAN_FD_FRAME
235236
CAN_INV_FILTER
236237
CAN_ISOTP
237238
CAN_J1939
@@ -2712,6 +2713,17 @@ RT_TOS
27122713
RUSAGE_CHILDREN
27132714
RUSAGE_SELF
27142715
RUSAGE_THREAD
2716+
RX_ANNOUNCE_RESUME
2717+
RX_CHANGED
2718+
RX_CHECK_DLC
2719+
RX_DELETE
2720+
RX_FILTER_ID
2721+
RX_NO_AUTOTIMER
2722+
RX_READ
2723+
RX_RTR_FRAME
2724+
RX_SETUP
2725+
RX_STATUS
2726+
RX_TIMEOUT
27152727
SCHED_BATCH
27162728
SCHED_FIFO
27172729
SCHED_IDLE
@@ -2845,6 +2857,7 @@ SEM_STAT
28452857
SEM_STAT_ANY
28462858
SEM_UNDO
28472859
SETALL
2860+
SETTIMER
28482861
SETVAL
28492862
SFD_CLOEXEC
28502863
SFD_NONBLOCK
@@ -3089,6 +3102,7 @@ SPLICE_F_MOVE
30893102
SPLICE_F_NONBLOCK
30903103
SS_DISABLE
30913104
SS_ONSTACK
3105+
STARTTIMER
30923106
STICKY_TIMEOUTS
30933107
ST_APPEND
30943108
ST_IMMUTABLE
@@ -3576,6 +3590,16 @@ TUN_TAP_DEV
35763590
TUN_TUN_DEV
35773591
TUN_TX_TIMESTAMP
35783592
TUN_TYPE_MASK
3593+
TX_ANNOUNCE
3594+
TX_COUNTEVT
3595+
TX_CP_CAN_ID
3596+
TX_DELETE
3597+
TX_EXPIRED
3598+
TX_READ
3599+
TX_RESET_MULTI_IDX
3600+
TX_SEND
3601+
TX_SETUP
3602+
TX_STATUS
35793603
T_FMT
35803604
T_FMT_AMPM
35813605
UDP_CORK
@@ -3859,6 +3883,8 @@ arpd_request
38593883
arphdr
38603884
arpreq
38613885
arpreq_old
3886+
bcm_msg_head
3887+
bcm_timeval
38623888
blkcnt64_t
38633889
brk
38643890
bsearch

src/new/linux_uapi/linux/can.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
//! Header: `uapi/linux/can.h`
22
3+
pub(crate) mod bcm;
34
pub(crate) mod j1939;
45
pub(crate) mod raw;
56

7+
pub use bcm::*;
68
pub use j1939::*;
79
pub use raw::*;
810

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//! `linux/can/bcm.h`
2+
3+
pub use crate::linux::can::*;
4+
5+
s! {
6+
pub struct bcm_timeval {
7+
pub tv_sec: c_long,
8+
pub tv_usec: c_long,
9+
}
10+
11+
pub struct bcm_msg_head {
12+
pub opcode: crate::__u32,
13+
pub flags: crate::__u32,
14+
pub count: crate::__u32,
15+
pub ival1: bcm_timeval,
16+
pub ival2: bcm_timeval,
17+
pub can_id: canid_t,
18+
pub nframes: crate::__u32,
19+
pub frames: [can_frame; 0],
20+
}
21+
}
22+
23+
pub const TX_SETUP: crate::__u32 = 1;
24+
pub const TX_DELETE: crate::__u32 = 2;
25+
pub const TX_READ: crate::__u32 = 3;
26+
pub const TX_SEND: crate::__u32 = 4;
27+
pub const RX_SETUP: crate::__u32 = 5;
28+
pub const RX_DELETE: crate::__u32 = 6;
29+
pub const RX_READ: crate::__u32 = 7;
30+
pub const TX_STATUS: crate::__u32 = 8;
31+
pub const TX_EXPIRED: crate::__u32 = 9;
32+
pub const RX_STATUS: crate::__u32 = 10;
33+
pub const RX_TIMEOUT: crate::__u32 = 11;
34+
pub const RX_CHANGED: crate::__u32 = 12;
35+
36+
pub const SETTIMER: crate::__u32 = 0x0001;
37+
pub const STARTTIMER: crate::__u32 = 0x0002;
38+
pub const TX_COUNTEVT: crate::__u32 = 0x0004;
39+
pub const TX_ANNOUNCE: crate::__u32 = 0x0008;
40+
pub const TX_CP_CAN_ID: crate::__u32 = 0x0010;
41+
pub const RX_FILTER_ID: crate::__u32 = 0x0020;
42+
pub const RX_CHECK_DLC: crate::__u32 = 0x0040;
43+
pub const RX_NO_AUTOTIMER: crate::__u32 = 0x0080;
44+
pub const RX_ANNOUNCE_RESUME: crate::__u32 = 0x0100;
45+
pub const TX_RESET_MULTI_IDX: crate::__u32 = 0x0200;
46+
pub const RX_RTR_FRAME: crate::__u32 = 0x0400;
47+
pub const CAN_FD_FRAME: crate::__u32 = 0x0800;

0 commit comments

Comments
 (0)