All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Riesch <michael@riesch.at>
To: netdev@vger.kernel.org
Cc: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
Subject: RE: SMSC 8720a/MDIO/PHY help.
Date: Thu, 14 Apr 2011 23:39:21 +0200	[thread overview]
Message-ID: <1302817161.2742.42.camel@malcolm> (raw)
In-Reply-To: <9AC3F0E75060224C8BBC5BA2DDC8853A1FA8E8FD@EXV1.corp.adtran.com>


> 
> Along this line of though:  phy_connect requires struct net_device, which has a struct net_device_ops within it.  When I do a phy_connect am I supposed to provide the minimal functions for netdev_ops (correct this list if I am mistaken):
> ndo_open
> ndo_stop
> ndo_start_xmit
> ndo_get_stats
> ndo_set_multicast_list
> As well as populate the dev->dev_addr within the struct net_device.
> 
> The part that confuses me is that the smsc.c ??driver?? under drivers/net/phy/smsc.c doesn’t do any of this.  This is a phy supported by this file, so should I have to do all this to get the device up?

The smsc.c is a PHY driver, so it is probed when the specified PHY
appears on the MDIO bus. It is responsible for the proper PHY settings
like auto-negotiation etc.

If I understood you correctly, you are writing a MDIO bus driver, the
opposite part. It provides access to the MDIO bus, the net_device
structure with its ops (and, of course, implements them as well).

With a call of PHY_connect you can stick the both of them together. And
the nice trick: Maybe your PHY is supported by the generic PHY driver
and you just need your MDIO bus driver, which provides the net_device
ops, registers the MDIO bus and calls phy_connect. (and maybe
phy_start(), I am not sure about that one).

HTH


  reply	other threads:[~2011-04-14 21:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 21:46 SMSC 8720a/MDIO/PHY help ANDY KENNEDY
2011-04-13 21:19 ` Michael Riesch
2011-04-13 21:38   ` ANDY KENNEDY
2011-04-14  4:08     ` ANDY KENNEDY
2011-04-14 21:39       ` Michael Riesch [this message]
2011-04-15 20:36       ` Andy Fleming
2011-04-15 20:29     ` Andy Fleming
2011-04-15 20:53       ` ANDY KENNEDY
2011-04-15 21:02         ` Andy Fleming
2011-04-15 21:17           ` ANDY KENNEDY

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=1302817161.2742.42.camel@malcolm \
    --to=michael@riesch.at \
    --cc=ANDY.KENNEDY@adtran.com \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.