From: Andy Fleming <afleming@freescale.com>
To: James Chapman <jchapman@katalix.com>
Cc: netdev@oss.sgi.com, "David S. Miller" <davem@davemloft.net>,
linuxppc-embedded@ozlabs.org
Subject: Re: RFC: PHY Abstraction Layer II
Date: Mon, 14 Mar 2005 18:41:10 -0600 [thread overview]
Message-ID: <ba5d844255b5ba76b2685f9397faf689@freescale.com> (raw)
In-Reply-To: <4230D1AC.5070506@katalix.com>
On Mar 10, 2005, at 17:01, James Chapman wrote:
> Hi Andy,
>
> Can you elaborate on why this phy abstraction is needed?
>
> In your original post, you mentioned that you were going to post a
> patch to show how your code would be hooked up in an existing net
> driver. Did I miss it? It would help in understanding the pros and cons
> of using genphy over using plain old mii.c.
Hi James,
I haven't posted it yet, since it's a large patch (it deletes a lot of
code from my driver), but I can give a basic overview of how my driver
hooks into this code:
1) The driver connects to the PHY when opened, calling phy_connect, and
then clears some bits to declare functionality it doesn't support (my
driver, for instance, does not support gigabit in half-duplex mode).
2) The driver implements a function which reads the speed/duplex
settings, and modifies the controller registers as appropriate (also
bringing the carrier up and down depending on link state). My driver
needs to note whether it's gigabit or not (for GMII vs MII mode), and
the duplex (to set the MAC full or half).
Both of those steps are very straightforward. The PHY layer will
invoke the callback whenever the link state changes, so the controller
will always be up-to-date.
3) The third step is the part that can make things a little messier.
My driver implements a second driver for the MDIO bus, which is
connected through its registers. This bus needs to be registered, and
the driver also needs to register. Then some code needs to be written
to deal with initialization, and takedown. I can send out that patch
anytime, if there's demand.
>
> btw, I recently posted a patch to add GigE support to mii.c which is
> in Jeff's netdev-2.6 queue. Some register definitions were added in
> mii.h that will collide with yours.
Yeah, I ran in to some of those. I can't remember whether they're in
the patch or not, I suspect not. I will have to submit a new patch to
cover those (I just changed my code to use your definitions).
Andy
next prev parent reply other threads:[~2005-03-15 0:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-09 1:47 RFC: PHY Abstraction Layer II Andy Fleming
2005-03-09 2:14 ` Benjamin Herrenschmidt
2005-03-09 3:42 ` David S. Miller
2005-03-09 3:50 ` Benjamin Herrenschmidt
2005-03-09 17:24 ` Andy Fleming
2005-03-10 23:01 ` James Chapman
2005-03-10 23:06 ` Benjamin Herrenschmidt
2005-03-10 23:27 ` Jeff Garzik
2005-03-10 23:27 ` Benjamin Herrenschmidt
2005-03-15 0:41 ` Andy Fleming [this message]
2005-03-15 19:18 ` James Chapman
2005-03-18 23:14 ` Andy Fleming
2005-03-24 21:48 ` Andy Fleming
2005-03-25 22:56 ` Andy Fleming
2005-03-28 23:45 ` Kumar Gala
2005-03-29 4:11 ` Problem when accessing variables Hiep Tran
[not found] ` <42625DDB.4090600@katalix.com>
2005-05-10 17:04 ` RFC: PHY Abstraction Layer II Andy Fleming
2005-05-12 6:08 ` Pantelis Antoniou
2005-05-25 23:00 ` Kumar Gala
2005-03-09 17:17 ` Andy Fleming
2005-05-26 18:32 ` Stephen Hemminger
2005-05-26 18:45 ` Andy Fleming
2005-05-31 17:59 ` Stephen Hemminger
2005-06-01 20:45 ` Andy Fleming
2005-06-01 21:19 ` Stephen Hemminger
2005-06-01 22:42 ` Andy Fleming
2005-06-01 21:41 ` Stephen Hemminger
2005-06-01 22:36 ` Andy Fleming
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=ba5d844255b5ba76b2685f9397faf689@freescale.com \
--to=afleming@freescale.com \
--cc=davem@davemloft.net \
--cc=jchapman@katalix.com \
--cc=linuxppc-embedded@ozlabs.org \
--cc=netdev@oss.sgi.com \
/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).