From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] net: introduce phylib
Date: Sun, 16 Sep 2012 11:13:02 +0200 [thread overview]
Message-ID: <20120916091302.GH6180@pengutronix.de> (raw)
In-Reply-To: <20120916090224.GG25990@game.jcrosoft.org>
On Sun, Sep 16, 2012 at 11:02:24AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 10:34 Sun 16 Sep , Sascha Hauer wrote:
> > On Sun, Sep 16, 2012 at 10:28:13AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 10:11 Sun 16 Sep , Sascha Hauer wrote:
> > > > On Fri, Sep 14, 2012 at 09:57:04AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > >
> > > > > Adapt phylib from linux
> > > > >
> > > > > switch all the driver to it
> > > > >
> > > > > This will allow to have
> > > > > - phy drivers
> > > > > - to only connect the phy at then opening of the device
> > > > > - if the phy is not ready fail on open
> > > > >
> > > > > Same behaviour as in linux and will allow to share code and simplify porting.
> > > > >
> > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > > > ---
> > > >
> > > > [...]
> > > >
> > > > +
> > > > > +/* Automatically gets and returns the PHY device */
> > > > > +int phy_device_connect(struct mii_device *bus, int addr,
> > > > > + void (*adjust_link) (struct mii_device *miidev))
> > > >
> > > > The prototype of adjust_link seems wrong. A mii_device is a mii bus with
> > > > potentially multiple phys. adjust_link should work on the phy_device. With
> > > > the above, when a mii_device has multiple phys, a network driver has no
> > > > way to figure out which phy has an updated link.
> > > >
> > > > This probably bites Renaud who has a single mii bus for multiple network
> > > > devices.
> > > not really as the phydev have a bus field so will be the same
> >
> > Renaud has two phys on the same mii bus, so when he is passed a struct
> > mii_device, how can he get a pointer to his network device? He can't.
> as I said just after we should attached the phy to eth_device not mii_device
Once again:
from fec_imx.c:
static void fec_update_linkspeed(struct mii_device *mdev)
{
struct eth_device *edev = mdev->edev;
...
}
How will you get a pointer to edev once a mii_device has multiple phys,
potentially connected to different network devices?
>
> so he will have one phy per eth_device
Yes, but multiple eth_devices per mii_device.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-09-16 9:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-14 7:37 [PATCH 0/3 v3] net: check error and " Jean-Christophe PLAGNIOL-VILLARD
2012-09-14 7:57 ` [PATCH 1/3] net: " Jean-Christophe PLAGNIOL-VILLARD
2012-09-14 7:57 ` [PATCH 2/3] net: catch error on eth_send Jean-Christophe PLAGNIOL-VILLARD
2012-09-16 9:57 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-14 7:57 ` [PATCH 3/3] net: move the eth_dev status detection at driver level Jean-Christophe PLAGNIOL-VILLARD
2012-09-16 8:12 ` Sascha Hauer
2012-09-15 12:24 ` [PATCH 1/3] net: introduce phylib Sascha Hauer
2012-09-16 8:11 ` Sascha Hauer
2012-09-16 8:28 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-16 8:34 ` Sascha Hauer
2012-09-16 9:02 ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-16 9:13 ` Sascha Hauer [this message]
2012-09-16 9:41 ` Jean-Christophe PLAGNIOL-VILLARD
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=20120916091302.GH6180@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=plagnioj@jcrosoft.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