rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Rust ENC28J60 ethernet driver working on Raspberry Pi
@ 2023-04-29 13:02 Ryo Munakata
  2023-05-12 17:28 ` Andreas Hindborg
  0 siblings, 1 reply; 2+ messages in thread
From: Ryo Munakata @ 2023-04-29 13:02 UTC (permalink / raw)
  To: rust-for-linux; +Cc: linux-kernel, FUJITA Tomonori

Hi all,

I've written an ethernet driver for ENC28J60, a stand-alone ethernet 
controller with a SPI interface, in Rust.
It works fine on Raspberry Pi 4B with Raspbian AArch64.
You can connect to the internet and play some videos on YouTube with it 
(10BASE-T though).
I hope it will be an example of real-world drivers in Rust.

* ENC28J60 ethernet driver in Rust
enc28j60rs: https://github.com/pfpacket/enc28j60rs
`impl Sync/Send`, mostly because of raw pointers, and the initialization 
of `workqueue::Work` and `sync::Spinlock`
require a tiny bit of "unsafe" code, but otherwise no unsafe code used.

* The forked kernel with Rust support for SPI and netdev
https://github.com/pfpacket/linux-rpi-rust/tree/rust-netdev
Forked from the Raspberry Pi tree and merged Rust-for-Linux `rust` 
branch into it.
(BTW are there any easier way to get Rust-for-Linux work on Raspberry 
Pi? If so please let me know.)
Then I added the SPI support referencing rust/kernel/platform.rs and 
netdev support.
The netdev support is based on the following GitHub PR from Fujita-san:
https://github.com/Rust-for-Linux/linux/pull/908

Regards,
Ryo Munakata

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Rust ENC28J60 ethernet driver working on Raspberry Pi
  2023-04-29 13:02 Rust ENC28J60 ethernet driver working on Raspberry Pi Ryo Munakata
@ 2023-05-12 17:28 ` Andreas Hindborg
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Hindborg @ 2023-05-12 17:28 UTC (permalink / raw)
  To: Ryo Munakata; +Cc: rust-for-linux, linux-kernel, FUJITA Tomonori


Ryo Munakata <ryomnktml@gmail.com> writes:

> Hi all,
>
> I've written an ethernet driver for ENC28J60, a stand-alone ethernet controller
> with a SPI interface, in Rust.
> It works fine on Raspberry Pi 4B with Raspbian AArch64.
> You can connect to the internet and play some videos on YouTube with it
> (10BASE-T though).
> I hope it will be an example of real-world drivers in Rust.
>
> * ENC28J60 ethernet driver in Rust
> enc28j60rs: https://github.com/pfpacket/enc28j60rs
> `impl Sync/Send`, mostly because of raw pointers, and the initialization of
> `workqueue::Work` and `sync::Spinlock`
> require a tiny bit of "unsafe" code, but otherwise no unsafe code used.
>
> * The forked kernel with Rust support for SPI and netdev
> https://github.com/pfpacket/linux-rpi-rust/tree/rust-netdev
> Forked from the Raspberry Pi tree and merged Rust-for-Linux `rust` branch into
> it.
> (BTW are there any easier way to get Rust-for-Linux work on Raspberry Pi? If so
> please let me know.)
> Then I added the SPI support referencing rust/kernel/platform.rs and netdev
> support.
> The netdev support is based on the following GitHub PR from Fujita-san:
> https://github.com/Rust-for-Linux/linux/pull/908

This is cool, thanks! I will check it out at some point.

Best regards
Andreas Hindborg

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-12 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-29 13:02 Rust ENC28J60 ethernet driver working on Raspberry Pi Ryo Munakata
2023-05-12 17:28 ` Andreas Hindborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).