* [PATCH] net, fixed phy: make BUSID configurable
@ 2011-12-04 9:37 Heiko Schocher
2011-12-04 18:23 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Heiko Schocher @ 2011-12-04 9:37 UTC (permalink / raw)
Cc: Heiko Schocher, netdev, Vitaly Bordug, Andrew Morton, Jeff Garzik,
Wolfgang Denk
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: netdev@vger.kernel.org
Cc: Vitaly Bordug <vbordug@ru.mvista.com>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Wolfgang Denk <wd@denx.de>
---
drivers/net/phy/Kconfig | 5 +++++
drivers/net/phy/fixed.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index bb88e12..bed4bdd 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -101,6 +101,11 @@ config FIXED_PHY
Currently tested with mpc866ads and mpc8349e-mitx.
+config FIXED_PHY_ID
+ int "BUS ID for fixed Bus/PHY emulation"
+ depends on FIXED_PHY
+ default "0"
+
config MDIO_BITBANG
tristate "Support for bitbanged MDIO buses"
help
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 1fa4d73..5c77478 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -220,7 +220,7 @@ static int __init fixed_mdio_bus_init(void)
goto err_mdiobus_reg;
}
- snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "0");
+ snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "%d", CONFIG_FIXED_PHY_ID);
fmb->mii_bus->name = "Fixed MDIO Bus";
fmb->mii_bus->priv = fmb;
fmb->mii_bus->parent = &pdev->dev;
--
1.7.6.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net, fixed phy: make BUSID configurable
2011-12-04 9:37 [PATCH] net, fixed phy: make BUSID configurable Heiko Schocher
@ 2011-12-04 18:23 ` David Miller
2011-12-05 10:21 ` Heiko Schocher
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2011-12-04 18:23 UTC (permalink / raw)
To: hs; +Cc: netdev, vbordug, akpm, jeff, wd
From: Heiko Schocher <hs@denx.de>
Date: Sun, 4 Dec 2011 10:37:24 +0100
> Signed-off-by: Heiko Schocher <hs@denx.de>
Give me a break.
You can't submit a change like this with essentially an
empty commit message.
Why in the world does this ever need to be configurable?
Are there alternative (and much better) ways to deal with
whatever problem this patch solves?
You've presented no information about why you need to make this
change, and more importantly why no viable alternatives exist
to solve your problem.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net, fixed phy: make BUSID configurable
2011-12-04 18:23 ` David Miller
@ 2011-12-05 10:21 ` Heiko Schocher
0 siblings, 0 replies; 3+ messages in thread
From: Heiko Schocher @ 2011-12-05 10:21 UTC (permalink / raw)
To: David Miller; +Cc: netdev, vbordug, akpm, jeff, wd
Hello David,
David Miller wrote:
> From: Heiko Schocher <hs@denx.de>
> Date: Sun, 4 Dec 2011 10:37:24 +0100
>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>
> Give me a break.
>
> You can't submit a change like this with essentially an
> empty commit message.
Uh, yes, sorry!
> Why in the world does this ever need to be configurable?
> Are there alternative (and much better) ways to deal with
> whatever problem this patch solves?
>
> You've presented no information about why you need to make this
> change, and more importantly why no viable alternatives exist
> to solve your problem.
On a am1808 based board porting to current kernel, I have connected
a KSZ8864RMN switch and using the drivers/net/ethernet/ti/davinci_emac.c
driver. To the switch I have always 100/FULL connection and so
I decided to use the fixed PHY driver. But the busid 0 is used
from the drivers/net/ethernet/ti/davinci_emac.c driver, and the
fixed PHY driver is fix at busid 0 ...
Looking in the drivers/net/ethernet/ti/davinci_emac.c in emac_dev_open()
there is the possibility if no priv->phy_id is defined through
plattform code, to use a fixed 100/FULL speed and duplex settings ...
which would fix my needs ...
But code did not reach this, because first a:
if (!priv->phy_id) {
struct device *phy;
phy = bus_find_device(&mdio_bus_type, NULL, NULL,
match_first_device);
if (phy)
priv->phy_id = dev_name(phy);
}
is checked ... maybe it is better to fix this here by removing this
"if (!priv->phy_id) {" and do not use the fixed PHY driver?
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-05 10:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-04 9:37 [PATCH] net, fixed phy: make BUSID configurable Heiko Schocher
2011-12-04 18:23 ` David Miller
2011-12-05 10:21 ` Heiko Schocher
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).