Skip to content

Commit fed547f

Browse files
committed
Add contents of linux/can/bcm.h
1 parent ea7fc0f commit fed547f

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

libc-test/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3752,6 +3752,7 @@ fn test_linux(target: &str) {
37523752
headers! { cfg:
37533753
[gnu]: "linux/aio_abi.h",
37543754
"linux/can.h",
3755+
"linux/can/bcm.h",
37553756
"linux/can/raw.h",
37563757
"linux/can/j1939.h",
37573758
"linux/cn_proc.h",
@@ -4804,7 +4805,9 @@ fn test_linux(target: &str) {
48044805
// the `xsk_tx_metadata_union` field is an anonymous union
48054806
(struct_ == "xsk_tx_metadata" && field == "xsk_tx_metadata_union") ||
48064807
// After musl 1.2.0, the type becomes `int` instead of `long`.
4807-
(old_musl && struct_ == "utmpx" && field == "ut_session")
4808+
(old_musl && struct_ == "utmpx" && field == "ut_session") ||
4809+
// `frames` is a VLA
4810+
(struct_ == "bcm_msg_head" && field == "frames")
48084811
});
48094812

48104813
cfg.skip_roundtrip(move |s| match s {
@@ -4841,6 +4844,7 @@ fn test_linux(target: &str) {
48414844
"inotify_event" => true,
48424845
"fanotify_event_info_fid" => true,
48434846
"cmsghdr" => true,
4847+
"bcm_msg_head" => true,
48444848

48454849
// FIXME(linux): the call ABI of max_align_t is incorrect on these platforms:
48464850
"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
@@ -2697,6 +2698,17 @@ RT_TOS
26972698
RUSAGE_CHILDREN
26982699
RUSAGE_SELF
26992700
RUSAGE_THREAD
2701+
RX_ANNOUNCE_RESUME
2702+
RX_CHANGED
2703+
RX_CHECK_DLC
2704+
RX_DELETE
2705+
RX_FILTER_ID
2706+
RX_NO_AUTOTIMER
2707+
RX_READ
2708+
RX_RTR_FRAME
2709+
RX_SETUP
2710+
RX_STATUS
2711+
RX_TIMEOUT
27002712
SCHED_BATCH
27012713
SCHED_FIFO
27022714
SCHED_IDLE
@@ -2830,6 +2842,7 @@ SEM_STAT
28302842
SEM_STAT_ANY
28312843
SEM_UNDO
28322844
SETALL
2845+
SETTIMER
28332846
SETVAL
28342847
SFD_CLOEXEC
28352848
SFD_NONBLOCK
@@ -3074,6 +3087,7 @@ SPLICE_F_MOVE
30743087
SPLICE_F_NONBLOCK
30753088
SS_DISABLE
30763089
SS_ONSTACK
3090+
STARTTIMER
30773091
STICKY_TIMEOUTS
30783092
ST_APPEND
30793093
ST_IMMUTABLE
@@ -3561,6 +3575,16 @@ TUN_TAP_DEV
35613575
TUN_TUN_DEV
35623576
TUN_TX_TIMESTAMP
35633577
TUN_TYPE_MASK
3578+
TX_ANNOUNCE
3579+
TX_COUNTEVT
3580+
TX_CP_CAN_ID
3581+
TX_DELETE
3582+
TX_EXPIRED
3583+
TX_READ
3584+
TX_RESET_MULTI_IDX
3585+
TX_SEND
3586+
TX_SETUP
3587+
TX_STATUS
35643588
T_FMT
35653589
T_FMT_AMPM
35663590
UDP_CORK
@@ -3844,6 +3868,8 @@ arpd_request
38443868
arphdr
38453869
arpreq
38463870
arpreq_old
3871+
bcm_msg_head
3872+
bcm_timeval
38473873
blkcnt64_t
38483874
brk
38493875
bsearch

src/new/linux_uapi/linux/can.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
//! Header: `uapi/linux/can.h`
22
33
// FIXME(ctest): we shouldn't have to specify the path but garando doesn't find modules otherwise
4+
#[path = "can/bcm.rs"]
5+
pub(crate) mod bcm;
46
#[path = "can/j1939.rs"]
57
pub(crate) mod j1939;
68
#[path = "can/raw.rs"]
79
pub(crate) mod raw;
810

11+
pub use bcm::*;
912
pub use j1939::*;
1013
pub use raw::*;
1114

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)