Hi Andrew,

I added the following line to genphy_read_status to print out the value of BMCR:

 phydev->lp_advertising = 0;

+printk(KERN_DEBUG "MII_BMCR: 0x%04X\n", phy_read(phydev, MII_BMCR));

 if (AUTONEG_ENABLE == phydev->autoneg) {

After booting up the kernel and running ifconfig eth0 up, I get the
following in kernel log:

[   83.890625] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   85.328125] MII_BMCR: 0x1000
[   86.328125] MII_BMCR: 0x1000
[   87.328125] MII_BMCR: 0x3100
[   87.328125] macb f802c000.ethernet eth0: link up (100/Full)
[   87.328125] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   88.328125] MII_BMCR: 0x3100
[   89.328125] MII_BMCR: 0x3100
[   90.328125] MII_BMCR: 0x3100

So it appears that after bringing the interface up, the PHY is
configured for 100Mbps, autoneg enabled and duplex mode. The PHY is
not isolated or powered down.

On 24 May 2016 at 17:30, Andrew Lunn <and...@lunn.ch> wrote:
> On Tue, May 24, 2016 at 05:09:35PM +0100, Amr Bekhit wrote:
>> Hi Andrew,
>>
>> > How about adding a printk() in genphy_read_status().
>>
>> Would you be able to point me to some more information about these
>> status bits, please?
>
> You can get the datasheet from here:
>
> http://www.davicom.com.tw/userfile/24247/DM9162_DM9162I-12-MCO-DS-F01_08062014.pdf
>
> I would start by looking at the BMCR register. The
> genphy_read_status() function should get called about once per second,
> so that is an O.K. place to add debug prints, and there is example
> code for reading MII_BMCR.
>
>      Andrew

Reply via email to