Linux系统读写网卡PHY寄存器工具

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define reteck(ret)     \
        if(ret < 0){    \
            printf("%m! \"%s\" : line: %d\n", __func__, __LINE__);   \
            goto lab;   \
        }

#define help() \
    printf("mdio test:\n");                  \
    printf("read operation:mdio devname phyaddr reg_addr\n");          \
    printf("write operation:mdio devname phyaddr reg_addr value\n");    \
    printf("For example:\n");            \
    printf("read:mdio eth0 0x1e 0x0\n");             \
    printf("write:mdio eth0 0x1e 0x0 0x8489\n\n");      \
    exit(0);

 

int main(int arg

你可能感兴趣的:(Linux系统读写网卡PHY寄存器工具)