From: Manfred Spraul <manfred@colorfullife.com>
To: Gary N Spiess <Gary.Spiess@Intermec.com>
Cc: netdev@oss.sgi.com, jgarzik@pobox.com
Subject: Re: [PATCH] natsemi update 3/4 External PHY operation
Date: Sun, 06 Jun 2004 17:50:16 +0200 [thread overview]
Message-ID: <40C33D38.1060102@colorfullife.com> (raw)
In-Reply-To: <200406041455290031.0BC56C76@136.179.85.112>
Gary N Spiess wrote:
>Relocate the internal phy to phy_address=1, and add find_mii() to locate the address of the external mii phy.
>
What if phy_address 1 is already in use?
> }
> + if (phy_id == PHY_ADDR_INTERNAL)
> + phy_id = np->phy_addr_external;
> +
Hmm. If the phy_id is internal then it's external.
What do you actually try to do? If I understand the hardware correctly,
it supports
- an internal PHY. Accessed through mapped registers. Used if
dev->if_port == PORT_TP.
- an external MII bus. Accessed by bit banging. Used if dev->if_port ==
PORT_MII.
- most users of mdio_{read,write} want to access the currently selected
PHY, but they call mdio_read(,1,). The "if (phy_id ==INTERNAL)
phy_id=external" line is a hack to handle that.
What about defining a PHY_ADDR_CUR (32, whatever). Everyone except the
probe code uses that value and mdio_read selects the correct port/phy
value from the dev structure. Or create a mdio_read_cur() function.
> + /* if external phy, then DSPCFG register isn't functional.
> + Fix the value here so the "nasty random phy-reset" code doesn't
> + think it needs to reinitialize the chip.
> + */
> + if (dev->if_port != PORT_TP)
> + np->dspcfg = 0;
> +
What about making the phy reset itself dependant on if->if_port? This
approach just asks for bugs - switch with ethtool from PORT_TP to
PORT_MII and suddenly short cables stop working.
--
Manfred
next prev parent reply other threads:[~2004-06-06 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-04 19:55 [PATCH] natsemi update 3/4 External PHY operation Gary N Spiess
2004-06-06 15:50 ` Manfred Spraul [this message]
2004-06-07 21:08 ` Gary N Spiess
2004-06-08 5:30 ` Manfred Spraul
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=40C33D38.1060102@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=Gary.Spiess@Intermec.com \
--cc=jgarzik@pobox.com \
--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).