* [PATCH] natsemi update 4/4 External Fibre phy
@ 2004-06-04 19:56 Gary N Spiess
2004-06-06 16:01 ` Manfred Spraul
0 siblings, 1 reply; 2+ messages in thread
From: Gary N Spiess @ 2004-06-04 19:56 UTC (permalink / raw)
To: netdev; +Cc: manfred
[-- Attachment #1.1: Type: text/plain, Size: 459 bytes --]
Jeff,
This is the fourth of a series of patches needed to support our product using the DP83815.
This patch adds support for our Fibre phy. Sorry, I don't know anything about the phy hardware. I know the couple of phy bits that need to be twiddled.
Gary
oooooooooooooooooooooooooooooooooooooooooooooooooo
Gary Spiess (Gary.Spiess@Intermec.com)
MobileLan Wireless Products Group, Intermec Technology Corp
voice: 319 369-3580 fax: 319 369-3804
[-- Attachment #1.2: Type: text/html, Size: 798 bytes --]
[-- Attachment #2: natsemi-2.6.6-4.patch --]
[-- Type: application/octet-stream, Size: 1744 bytes --]
--- linux-2.6.6/drivers/net/natsemi.c 2004-06-03 15:10:00.000000000 -0500
+++ linux/drivers/net/natsemi.c 2004-06-03 15:10:16.000000000 -0500
@@ -351,6 +351,10 @@
None characterised.
*/
+/* add a couple of MII definitions specific to a PORT_FIBRE implementation */
+#define MII_MCTRL 0x15 /* mode control register */
+#define MII_IN_FX_MODE 0x0001 /* full duplex */
+#define MII_DIS_SCRM 0x0004 /* disable scrambler */
enum pcistuff {
@@ -2403,7 +2407,7 @@
ecmd->supported =
(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
- SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII);
+ SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_FIBRE);
/* Return the transceiver type */
ecmd->port = dev->if_port;
@@ -2417,6 +2421,10 @@
ecmd->advertising = ADVERTISED_MII;
ecmd->transceiver = XCVR_EXTERNAL;
break;
+ case PORT_FIBRE:
+ ecmd->advertising = ADVERTISED_FIBRE;
+ ecmd->transceiver = XCVR_EXTERNAL;
+ break;
}
ecmd->port = dev->if_port;
ecmd->phy_address = np->phy_addr_external;
@@ -2473,6 +2481,7 @@
else if (ecmd->transceiver == XCVR_EXTERNAL)
ecmd->port = PORT_TP;
break;
+ case PORT_FIBRE:
case PORT_MII:
if (dev->if_port == PORT_TP)
ecmd->transceiver = XCVR_EXTERNAL;
@@ -2503,6 +2512,15 @@
np->phy_addr_external = ecmd->phy_address & PhyAddrMask;
dev->if_port = ecmd->port;
+ /* fibre mode? */
+ tmp = 0;
+ if (dev->if_port == PORT_FIBRE) {
+ tmp |= MII_DIS_SCRM;
+ if (ecmd->duplex == DUPLEX_FULL)
+ tmp |= MII_IN_FX_MODE;
+ }
+ mdio_write(dev, 1, MII_MCTRL, tmp);
+
tmp = mdio_read(dev, 1, MII_BMCR);
if (ecmd->autoneg == AUTONEG_ENABLE) {
/* turn on autonegotiation, and force a renegotiate */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] natsemi update 4/4 External Fibre phy
2004-06-04 19:56 [PATCH] natsemi update 4/4 External Fibre phy Gary N Spiess
@ 2004-06-06 16:01 ` Manfred Spraul
0 siblings, 0 replies; 2+ messages in thread
From: Manfred Spraul @ 2004-06-06 16:01 UTC (permalink / raw)
To: Gary N Spiess; +Cc: netdev, jgarzik
Gary N Spiess wrote:
>
> +/* add a couple of MII definitions specific to a PORT_FIBRE
> implementation */
> +#define MII_MCTRL 0x15 /* mode control register */
> +#define MII_IN_FX_MODE 0x0001 /* full duplex */
> +#define MII_DIS_SCRM 0x0004 /* disable scrambler */
>
Specific to a PORT_FIBRE implementation or specific to the PHY you are
using? I think register 0x15 is implementation specific.
Why do you actually want to handle the fibre phy as a new port? I'd
handle phy specific code by reading the MII_PHYSID{1,2} register and
then adding a special case if your phy is detected. The port can remain
at PORT_MII.
--
Manfred
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-06 16:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-04 19:56 [PATCH] natsemi update 4/4 External Fibre phy Gary N Spiess
2004-06-06 16:01 ` Manfred Spraul
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).