Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3740,6 +3740,7 @@ fn test_linux(target: &str) {
headers! { cfg:
[gnu]: "linux/aio_abi.h",
"linux/can.h",
"linux/can/bcm.h",
"linux/can/raw.h",
"linux/can/j1939.h",
"linux/cn_proc.h",
Expand Down Expand Up @@ -4804,7 +4805,7 @@ fn test_linux(target: &str) {
(musl && struct_ == "tcp_info" && field == "tcpi_delivery_fastopen_bitfields") ||
// either fsid_t or int[2] type
(struct_ == "fanotify_event_info_fid" && field == "fsid") ||
// `handle` is a VLA
// `handle` is a flexible array member
(struct_ == "fanotify_event_info_fid" && field == "handle") ||
// `anonymous_1` is an anonymous union
(struct_ == "ptp_perout_request" && field == "anonymous_1") ||
Expand All @@ -4822,7 +4823,9 @@ fn test_linux(target: &str) {
// the `xsk_tx_metadata_union` field is an anonymous union
(struct_ == "xsk_tx_metadata" && field == "xsk_tx_metadata_union") ||
// After musl 1.2.0, the type becomes `int` instead of `long`.
(old_musl && struct_ == "utmpx" && field == "ut_session")
(old_musl && struct_ == "utmpx" && field == "ut_session") ||
// `frames` is a flexible array member
(struct_ == "bcm_msg_head" && field == "frames")
});

cfg.skip_roundtrip(move |s| match s {
Expand Down Expand Up @@ -4859,6 +4862,7 @@ fn test_linux(target: &str) {
"inotify_event" => true,
"fanotify_event_info_fid" => true,
"cmsghdr" => true,
"bcm_msg_head" => true,

// FIXME(linux): the call ABI of max_align_t is incorrect on these platforms:
"max_align_t" if i686 || ppc64 => true,
Expand Down
26 changes: 26 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ CAN_EFF_ID_BITS
CAN_EFF_MASK
CAN_ERR_FLAG
CAN_ERR_MASK
CAN_FD_FRAME
CAN_INV_FILTER
CAN_ISOTP
CAN_J1939
Expand Down Expand Up @@ -2714,6 +2715,17 @@ RT_TOS
RUSAGE_CHILDREN
RUSAGE_SELF
RUSAGE_THREAD
RX_ANNOUNCE_RESUME
RX_CHANGED
RX_CHECK_DLC
RX_DELETE
RX_FILTER_ID
RX_NO_AUTOTIMER
RX_READ
RX_RTR_FRAME
RX_SETUP
RX_STATUS
RX_TIMEOUT
SCHED_BATCH
SCHED_FIFO
SCHED_IDLE
Expand Down Expand Up @@ -2847,6 +2859,7 @@ SEM_STAT
SEM_STAT_ANY
SEM_UNDO
SETALL
SETTIMER
SETVAL
SFD_CLOEXEC
SFD_NONBLOCK
Expand Down Expand Up @@ -3091,6 +3104,7 @@ SPLICE_F_MOVE
SPLICE_F_NONBLOCK
SS_DISABLE
SS_ONSTACK
STARTTIMER
STICKY_TIMEOUTS
ST_APPEND
ST_IMMUTABLE
Expand Down Expand Up @@ -3578,6 +3592,16 @@ TUN_TAP_DEV
TUN_TUN_DEV
TUN_TX_TIMESTAMP
TUN_TYPE_MASK
TX_ANNOUNCE
TX_COUNTEVT
TX_CP_CAN_ID
TX_DELETE
TX_EXPIRED
TX_READ
TX_RESET_MULTI_IDX
TX_SEND
TX_SETUP
TX_STATUS
T_FMT
T_FMT_AMPM
UDP_CORK
Expand Down Expand Up @@ -3861,6 +3885,8 @@ arpd_request
arphdr
arpreq
arpreq_old
bcm_msg_head
bcm_timeval
blkcnt64_t
brk
bsearch
Expand Down
2 changes: 2 additions & 0 deletions src/new/linux_uapi/linux/can.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! Header: `uapi/linux/can.h`

pub(crate) mod bcm;
pub(crate) mod j1939;
pub(crate) mod raw;

pub use bcm::*;
pub use j1939::*;
pub use raw::*;

Expand Down
52 changes: 52 additions & 0 deletions src/new/linux_uapi/linux/can/bcm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//! `linux/can/bcm.h`

pub use crate::linux::can::*;

s! {
pub struct bcm_timeval {
pub tv_sec: c_long,
pub tv_usec: c_long,
}

pub struct bcm_msg_head {
pub opcode: u32,
pub flags: u32,
pub count: u32,
pub ival1: bcm_timeval,
pub ival2: bcm_timeval,
pub can_id: canid_t,
pub nframes: u32,
pub frames: [can_frame; 0],
}
}

c_enum! {
#[repr(u32)]
pub enum #anon {
TX_SETUP = 1,
TX_DELETE,
TX_READ,
TX_SEND,
RX_SETUP,
RX_DELETE,
RX_READ,
TX_STATUS,
TX_EXPIRED,
RX_STATUS,
RX_TIMEOUT,
RX_CHANGED,
}
}

pub const SETTIMER: u32 = 0x0001;
pub const STARTTIMER: u32 = 0x0002;
pub const TX_COUNTEVT: u32 = 0x0004;
pub const TX_ANNOUNCE: u32 = 0x0008;
pub const TX_CP_CAN_ID: u32 = 0x0010;
pub const RX_FILTER_ID: u32 = 0x0020;
pub const RX_CHECK_DLC: u32 = 0x0040;
pub const RX_NO_AUTOTIMER: u32 = 0x0080;
pub const RX_ANNOUNCE_RESUME: u32 = 0x0100;
pub const TX_RESET_MULTI_IDX: u32 = 0x0200;
pub const RX_RTR_FRAME: u32 = 0x0400;
pub const CAN_FD_FRAME: u32 = 0x0800;