I.MX6 ethtool 移植

/*************************************************************************
 *              I.MX6 ethtool 移植
 * 说明:
 *     本来想用ethtool来直接读取、写入PHY中的寄存器,结果不支持。
 *
 *                              2017-4-12 深圳 龙华民治樟坑村 曾剑锋
 ************************************************************************/

一、参考文档:
    1. Android使用ethtool工具查询/设置以太网网卡状态
        http://blog.csdn.net/u013686019/article/details/51491364
    2. rxwen/ethtool
        https://github.com/rxwen/ethtool

二、操作步骤:
    1. 下载 rxwen/ethtool:https://github.com/rxwen/ethtool
    2. source build/envsetup.sh
    3. lunch sabresd_6dq-eng
    4. mmm /home/zengjf/myandroid/external/ethtool-master
    5. 测试移植效果:
        root@sabresd_6dq:/ # ethtool eth0                                              
        Settings for eth0:
                Supported ports: [ TP MII ]
                Supported link modes:   10baseT/Half 10baseT/Full 
                                        100baseT/Half 100baseT/Full 
                                        1000baseT/Full 
                Supported pause frame use: Symmetric
                Supports auto-negotiation: Yes
                Advertised link modes:  10baseT/Half 10baseT/Full 
                                        100baseT/Half 100baseT/Full 
                                        1000baseT/Full 
                Advertised pause frame use: Symmetric
                Advertised auto-negotiation: Yes
                Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                                     100baseT/Half 100baseT/Full 
                                                     1000baseT/Full 
                Link partner advertised pause frame use: Symmetric Receive-only
                Link partner advertised auto-negotiation: Yes
                Speed: 1000Mb/s
                Duplex: Full
                Port: MII
                PHYAD: 1
                Transceiver: external
                Auto-negotiation: on
                Supports Wake-on: g
                Wake-on: d
                Link detected: yes
        root@sabresd_6dq:/ # 
原文地址:https://www.cnblogs.com/zengjfgit/p/6701160.html