Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define basic Linux SocketCAN constants and types #2006

Merged
merged 4 commits into from Jan 7, 2021

Conversation

djarek
Copy link
Contributor

@djarek djarek commented Dec 22, 2020

Add definitions from linux/can.h, which is a "base" header for remainder of SocketCAN functionality.

CAN bus (ISO-11898) is a communication standard used in automotive, automation and industrial solutions. Linux provides a socket-like interface to access raw CAN and protocols based on CAN, such as ISO-TP(ISO-15765) or SAE-J1939.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, left some comments.

src/unix/linux_like/linux/mod.rs Outdated Show resolved Hide resolved
src/unix/linux_like/linux/mod.rs Outdated Show resolved Hide resolved
src/unix/linux_like/linux/mod.rs Outdated Show resolved Hide resolved
@JohnTitor
Copy link
Member

Also, it'd be great if you could squash commits into one.

@djarek
Copy link
Contributor Author

djarek commented Jan 2, 2021

Squashed the commits.

@JohnTitor
Copy link
Member

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jan 5, 2021

📌 Commit 5449cae has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Jan 5, 2021

⌛ Testing commit 5449cae with merge f8fb8cd...

bors added a commit that referenced this pull request Jan 5, 2021
Define basic Linux SocketCAN constants and types

Add definitions from `linux/can.h`, which is a "base" header for remainder of SocketCAN functionality.

CAN bus (ISO-11898) is a communication standard used in automotive, automation and industrial solutions. Linux provides a socket-like interface to access raw CAN and protocols based on CAN, such as ISO-TP(ISO-15765) or SAE-J1939.
@bors
Copy link
Contributor

bors commented Jan 5, 2021

💔 Test failed - checks-actions

@JohnTitor
Copy link
Member

CI failed:

   cargo:warning=/checkout/target/mips64el-unknown-linux-gnuabi64/debug/build/libc-test-7d5e3789cf3be7ba/out/main.c:31010:59: error: 'CAN_J1939' undeclared here (not in a function)
  cargo:warning=31010 |             static const int __test_const_CAN_J1939_val = CAN_J1939;
  cargo:warning=      |                                                           ^~~~~~~~~
  cargo:warning=cc1: error: unrecognized command line option '-Wno-unknown-warning-option' [-Werror]
  cargo:warning=cc1: all warnings being treated as errors
  exit code: 1

That target's CI stuff is old (since CAN_J1939 is a new constant) or doesn't have it actually?

@djarek
Copy link
Contributor Author

djarek commented Jan 5, 2021

Looks like J1939 was added in Linux 5.4, not sure what version of kernel headers that target has.

@JohnTitor
Copy link
Member

Let's skip the tests for now, we could tweak here:

cfg.skip_const(move |name| {

Add this with FIXME comment:

"CAN_J1939" if mips => true,

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 5, 2021

📌 Commit 86eb6c1 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Jan 5, 2021

⌛ Testing commit 86eb6c1 with merge 8603b5f...

bors added a commit that referenced this pull request Jan 5, 2021
Define basic Linux SocketCAN constants and types

Add definitions from `linux/can.h`, which is a "base" header for remainder of SocketCAN functionality.

CAN bus (ISO-11898) is a communication standard used in automotive, automation and industrial solutions. Linux provides a socket-like interface to access raw CAN and protocols based on CAN, such as ISO-TP(ISO-15765) or SAE-J1939.
@bors
Copy link
Contributor

bors commented Jan 5, 2021

💔 Test failed - checks-actions

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 7, 2021

📌 Commit e18dc03 has been approved by JohnTitor

bors added a commit that referenced this pull request Jan 7, 2021
Define basic Linux SocketCAN constants and types

Add definitions from `linux/can.h`, which is a "base" header for remainder of SocketCAN functionality.

CAN bus (ISO-11898) is a communication standard used in automotive, automation and industrial solutions. Linux provides a socket-like interface to access raw CAN and protocols based on CAN, such as ISO-TP(ISO-15765) or SAE-J1939.
@bors
Copy link
Contributor

bors commented Jan 7, 2021

⌛ Testing commit e18dc03 with merge b5eeb45...

@bors
Copy link
Contributor

bors commented Jan 7, 2021

💔 Test failed - checks-actions

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 7, 2021

📌 Commit a39cf0d has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Jan 7, 2021

⌛ Testing commit a39cf0d with merge 62883d0...

bors added a commit that referenced this pull request Jan 7, 2021
Define basic Linux SocketCAN constants and types

Add definitions from `linux/can.h`, which is a "base" header for remainder of SocketCAN functionality.

CAN bus (ISO-11898) is a communication standard used in automotive, automation and industrial solutions. Linux provides a socket-like interface to access raw CAN and protocols based on CAN, such as ISO-TP(ISO-15765) or SAE-J1939.
@bors
Copy link
Contributor

bors commented Jan 7, 2021

💔 Test failed - checks-actions

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 7, 2021

📌 Commit 66500ee has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Jan 7, 2021

⌛ Testing commit 66500ee with merge f00b9a1...

@bors
Copy link
Contributor

bors commented Jan 7, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: JohnTitor
Pushing f00b9a1 to master...

@bors bors merged commit f00b9a1 into rust-lang:master Jan 7, 2021
@djarek djarek deleted the linux-can.h branch January 7, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants