rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trevor Gross <tmgross@umich.edu>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: rust-for-linux@vger.kernel.org, andrew@lunn.ch,
	 miguel.ojeda.sandonis@gmail.com
Subject: Re: [RFC PATCH v2 3/3] net: phy: add Rust Asix PHY driver
Date: Tue, 26 Sep 2023 02:20:33 -0400	[thread overview]
Message-ID: <CALNs47tecmP6yL=ogjEDPuLBS6q-E=fyya7xKQ-c2Uc7kTsx_A@mail.gmail.com> (raw)
In-Reply-To: <20230924064902.1339662-4-fujita.tomonori@gmail.com>

On 9/24/23, FUJITA Tomonori <fujita.tomonori@gmail.com> wrote:

> +struct RustAsixPhy;
> +
> +impl RustAsixPhy {
> +    // Performs a software PHY reset using the standard
> +    // BMCR_RESET bit and poll for the reset bit to be cleared.
> +    // Toggle BMCR_RESET bit off to accommodate broken AX8796B PHY
> implementation
> +    // such as used on the Individual Computers' X-Surf 100 Zorro card.
> +    fn soft_reset(dev: &mut phy::Device) -> Result {
> +        dev.write(uapi::MII_BMCR as u16, 0)?;
> +        dev.genphy_soft_reset()
> +    }
> +}

I don't think there is any reason for this to be a type rather than
just a function?

    fn asix_soft_reset(dev: &mut phy::Device) -> Result {
        dev.write(uapi::MII_BMCR as u16, 0)?;
        dev.genphy_soft_reset()
    }

Also, we should make sure that the user-available MII_X constants are
available as a u16 rather than a c_int.

- Trevor

  parent reply	other threads:[~2023-09-26  6:20 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-24  6:48 [RFC PATCH v2 0/3] Rust abstractions for network PHY drivers FUJITA Tomonori
2023-09-24  6:49 ` [RFC PATCH v2 1/3] rust: core " FUJITA Tomonori
2023-09-24 12:56   ` Wedson Almeida Filho
2023-09-24 13:39     ` Benno Lossin
2023-09-24 13:51       ` Wedson Almeida Filho
2023-09-25 11:30       ` FUJITA Tomonori
2023-09-25 13:14         ` Andrew Lunn
2023-09-24 15:42     ` Andrew Lunn
2023-09-25  1:13       ` FUJITA Tomonori
2023-09-25 13:25         ` Andrew Lunn
2023-09-25  6:47     ` Alice Ryhl
2023-09-26  1:19     ` FUJITA Tomonori
2023-09-26  2:50       ` Andrew Lunn
2023-09-24 13:19   ` Benno Lossin
2023-09-25 10:24     ` FUJITA Tomonori
2023-09-25 15:41       ` Miguel Ojeda
2023-09-26 13:46         ` FUJITA Tomonori
2023-09-27 10:49           ` Miguel Ojeda
2023-09-27 11:19             ` FUJITA Tomonori
2023-10-09 12:28               ` Miguel Ojeda
2023-09-24 17:00   ` Andrew Lunn
2023-09-24 18:03     ` Miguel Ojeda
2023-09-25 13:28       ` Andrew Lunn
2023-09-25 13:43       ` Andrew Lunn
2023-09-25 15:42         ` Miguel Ojeda
2023-09-25 16:53           ` Andrew Lunn
2023-09-25 17:26             ` Miguel Ojeda
2023-09-25 18:32   ` Andrew Lunn
2023-09-25 19:15     ` Miguel Ojeda
2023-09-26  6:05   ` Trevor Gross
2023-09-26 12:11     ` Andrew Lunn
2023-09-27  3:26     ` FUJITA Tomonori
2023-09-26  6:54   ` Trevor Gross
2023-09-27  3:39     ` FUJITA Tomonori
2023-09-27 12:21       ` Andrew Lunn
2023-09-24  6:49 ` [RFC PATCH v2 2/3] MAINTAINERS: add Rust PHY abstractions file to the ETHERNET PHY LIBRARY FUJITA Tomonori
2023-09-24  6:49 ` [RFC PATCH v2 3/3] net: phy: add Rust Asix PHY driver FUJITA Tomonori
2023-09-24  8:05   ` Miguel Ojeda
2023-09-24  9:38     ` FUJITA Tomonori
2023-09-24 10:10       ` Miguel Ojeda
2023-09-24 11:00         ` FUJITA Tomonori
2023-09-24 13:33   ` Benno Lossin
2023-09-25  2:31     ` FUJITA Tomonori
2023-09-26  6:20   ` Trevor Gross [this message]
2023-09-26  7:07     ` FUJITA Tomonori
     [not found]       ` <CALNs47uYnQC+AXbJuk8d5506D25SDhZ-ZKuhimFkZnYOhhdfCg@mail.gmail.com>
2023-09-26 12:36         ` Andrew Lunn
2023-09-27  1:18         ` FUJITA Tomonori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALNs47tecmP6yL=ogjEDPuLBS6q-E=fyya7xKQ-c2Uc7kTsx_A@mail.gmail.com' \
    --to=tmgross@umich.edu \
    --cc=andrew@lunn.ch \
    --cc=fujita.tomonori@gmail.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=rust-for-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).