[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTi=rzTCTackMiKRW=vciN=+ThiCGJg@mail.gmail.com>
Date: Fri, 15 Apr 2011 16:02:21 -0500
From: Andy Fleming <afleming@...il.com>
To: ANDY KENNEDY <ANDY.KENNEDY@...ran.com>
Cc: michael@...sch.at, netdev@...r.kernel.org
Subject: Re: SMSC 8720a/MDIO/PHY help.
On Fri, Apr 15, 2011 at 3:53 PM, ANDY KENNEDY <ANDY.KENNEDY@...ran.com> wrote:
>> -----Original Message-----
>> From: netdev-owner@...r.kernel.org [mailto:netdev-
>> owner@...r.kernel.org] On Behalf Of Andy Fleming
>> Sent: Friday, April 15, 2011 3:30 PM
>> To: ANDY KENNEDY
>> Cc: michael@...sch.at; netdev@...r.kernel.org
>> Subject: Re: SMSC 8720a/MDIO/PHY help.
>>
>> On Wed, Apr 13, 2011 at 4:38 PM, ANDY KENNEDY
>> <ANDY.KENNEDY@...ran.com> wrote:
>> >> -----Original Message-----
>> >> From: Michael Riesch [mailto:michael@...sch.at]
>> >> Sent: Wednesday, April 13, 2011 4:19 PM
>> >> To: netdev@...r.kernel.org
>> >> Cc: ANDY KENNEDY
>> >> Subject: Re: SMSC 8720a/MDIO/PHY help.
>> >>
>> >>
>> >> > If you have an idea of something for me to try, I'd love to
>> >> entertain
>> >> > it.
>> >>
>> >> I am rather new to PHYLIB, but these are my ideas:
>> >>
>> >> 1) make sure phy_connect is executed (AFIAK called by MDIO bus
>> >> driver)
>> >
>> > Going through the phy.txt doc under Documentation/networking:
>> > PHY Abstraction Layer
>> > (Updated 2008-04-08)
>> > though it may be a bit out-of-date, I did see what you are
>> talking about. What I'm hung up on at the moment is the behavior
>> of adjust_link(). It appears that I only need to start the queues,
>> though I don't know.
>> >
>> >>
>> >> 2) maybe you need to call phy_start / phy_stop (AFAIK from the
>> PHY
>> >> driver's open / close function)
>> >
>> > Currently, when I do this I only get the call to adjust_link()
>> over and over again.
>>
>>
>> ...this means that the state machine is running. The PHY is
>> polling
>> every couple seconds to report the current state. It calls
>> adjust_link() to keep the net_device up-to-date on that state. What
>> other behavior are you expecting to see?
>
> Well, you see I was expecting it to be up and running at that point (to be able to assign an IP, pass traffic, etc) -- but that is due to ignorance of (1) network device drivers, (2) PHY device drivers, (3) MDIO bus drivers, (4) General level 2 networking, (5) ;) get the point?
>
> See, I'm totally new to networking (at this level). Device drivers, yes, but not networking.
>
> Though, after Michael's e-mails, I have discovered that I have to
> 1) Make the MDIO bus work
> 2) Establish communications with the MDIO driver (in this case smsc.c under net/phy)
> 3) Make all my NDO required functions for controlling the "real" network device -- I was unaware that the PHY _WASN'T_ the network device.
> 4) Call phy_connect_direct (so I don't trash the already existent smsc.c as before stated)
> 5) Finally, after the NDO functions are written, register the NDO with the networking layer of the Kernel.
>
> One thing I have done wrong (realized AFTER depending upon the work I've done) is that I should have split out the MDIO and the network device.
>
> Now, where is the document that explains all this. The PHY document is very informative, however, if you don't know that a PHY is NOT a network device, you're kinda outta luck. Even Wiki reports a PHY as the Physical Link layer of the OSI model. Which, again, doesn't tell the ignorant much.
Take a look at Documentation/networking/netdevices.txt
Also grep around in drivers/net to see networking drivers that have
been ported to use phylib (look for phy_connect or phy_attach).
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists