Re: [PATCH] usbnet_link_change() fails to call netif_carrier_on()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm still trying to understand how is it all (phy + phylink) supposed to
work. My adapter uses fixed PHY mode (uses a special SFP module and the
ASIX AX88772B internal PHY, configured by internal SROM memory).

This is not a fixed *MII connection, though. This is a regular clause 22
transceiver, a part of the ASIX MAC IC.

The MDIO registers are initialized (on power-up) to (BMCR) 0x2100 and
(BMSR) 0x780D, meaning autonegotiation is supported but disabled,
100 Mbps FD is selected. Link is established.

Ethtool shows the following:
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
the above is generally true, but:
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: on <<<<<<<<<<<<<<<<
        Port: Twisted Pair
        PHYAD: 10
        Transceiver: internal
        MDI-X: Unknown
        Link detected: no <<<<<<<<<<<<<<<<

Autonegotiation is definitely off.

Perhaps this code is responsible (in phy_probe()):

	if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
			       phydev->supported))
		phydev->autoneg = 0;

Shouldn't it check if the actual PHY BMCR autoneg bit (aka 0.12) isn't
zero, and if it is, set autoneg = 0?


The other part which may be contributing (in genphy_update_link()):

	/* Consider the case that autoneg was started and "aneg complete"
	 * bit has been reset, but "link up" bit not yet.
	 */
	if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete)
		phydev->link = 0;

Since phydev->autoneg apparently means "autoneg is supported", the above
doesn't seem very right.

But I guess phydev->autoneg is supposed to mean "autoneg is actually
enabled".

What do you think?
-- 
Krzysztof "Chris" Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux