On Thu, Jul 03, 2008 at 01:25:29AM +0200, Krzysztof J?druczyk wrote:
 > Pyun YongHyeon pisze:
 >  > Would you try attached patch?
 > >The patch is just for checking code path of fiber media.
 > 
 > It's slightly better - some media gets detected, but looks weird to me 
 > (and doesn't communicate with other machines on the switch):
 > 
 > # ifconfig
 > msk0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
 >         options=11a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4>
 >         ether 00:10:f3:0d:d6:45
 >         media: Ethernet autoselect (autoselect <full-duplex>)
 >         status: active
 > msk1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
 >         options=11a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4>
 >         ether 00:10:f3:0d:d6:46
 >         media: Ethernet autoselect (autoselect <full-duplex>)
 >         status: active
 > 
 > 'autoselect (autoselect <full-duplex>)' doesn't seem right to me...
 > 

I guess I've clobbered extended address register. How about
attached one?

 > I couldn't see any signs of interface being functional with neither ping 
 > nor tcpdump...
 > 

There could be other issues in msk(4) for dual port controllers but
let's focus on PHY issue first.

 > I tried the patch with 7.0-RELEASE-p2, -STABLE and -CURRENT kernels.
 > 
 > I'm not sure how important is that, but I still can't force it to 
 > 1000baseSX:
 > 
 > # ifconfig msk0 media 1000baseSX
 > ifconfig: SIOCSIFMEDIA (media): Device not configured
 > 

I guess you may have to specify "mediaopt full-duplex" in the
command. But I believe you should not manually set media type
on gigabit environments.

 > >
 > >Btw, it looks like you have dual port controller, right?
 > >
 > Yes, this machine has dual gigabit ports:
 > http://www.nexcom.com/ProductModel.aspx?id=7541ac3e-ecfd-4008-83cd-52e1ababe6a8
 > 
 > Let me know if there is any info I could provide that would help making 
 > this interface functional.
 > 

There are a copule of code path that applys to dual port
controllers. For example MSI is not supported even though hardware 
actually support that feature. That would be next item to try.

-- 
Regards,
Pyun YongHyeon
--- sys/dev/mii/e1000phy.c.orig 2007-11-21 14:51:55.000000000 +0900
+++ sys/dev/mii/e1000phy.c      2008-07-03 10:46:06.000000000 +0900
@@ -148,10 +148,13 @@
        esc->mii_model = MII_MODEL(ma->mii_id2);
        switch (esc->mii_model) {
        case MII_MODEL_MARVELL_E1011:
-       case MII_MODEL_MARVELL_E1112:
                if (PHY_READ(sc, E1000_ESSR) & E1000_ESSR_FIBER_LINK)
                        sc->mii_flags |= MIIF_HAVEFIBER;
                break;
+       case MII_MODEL_MARVELL_E1112:
+               /* XXX Should have a way to get instance info. */
+               sc->mii_flags |= MIIF_HAVEFIBER;
+               break;
        case MII_MODEL_MARVELL_E3082:
                /* 88E3082 10/100 Fast Ethernet PHY. */
                sc->mii_anegticks = MII_ANEGTICKS;
@@ -209,7 +212,7 @@
 e1000phy_reset(struct mii_softc *sc)
 {
        struct e1000phy_softc *esc;
-       uint16_t reg;
+       uint16_t page, reg;
 
        esc = (struct e1000phy_softc *)sc;
        reg = PHY_READ(sc, E1000_SCR);
@@ -217,13 +220,14 @@
                reg &= ~E1000_SCR_AUTO_X_MODE;
                PHY_WRITE(sc, E1000_SCR, reg);
                if (esc->mii_model == MII_MODEL_MARVELL_E1112) {
+                       page = PHY_READ(sc, E1000_EADR);
                        /* Select 1000BASE-X only mode. */
                        PHY_WRITE(sc, E1000_EADR, 2);
                        reg = PHY_READ(sc, E1000_SCR);
                        reg &= ~E1000_SCR_MODE_MASK;
                        reg |= E1000_SCR_MODE_1000BX;
                        PHY_WRITE(sc, E1000_SCR, reg);
-                       PHY_WRITE(sc, E1000_EADR, 1);
+                       PHY_WRITE(sc, E1000_EADR, page);
                }
        } else {
                switch (esc->mii_model) {
@@ -472,8 +476,8 @@
                else
                        mii->mii_media_active |= IFM_10_T;
        } else {
-               if (ssr & E1000_SSR_1000MBS)
-                       mii->mii_media_active |= IFM_1000_SX;
+               /* XXX Should have a way to tell IFM_1000_SX/IFM_1000_LX. */
+               mii->mii_media_active |= IFM_1000_SX;
        }
 
        if (ssr & E1000_SSR_DUPLEX)
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to