#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <linux/mii.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <linux/sockios.h>
#include <linux/types.h>
#include <netinet/in.h>
#include <unistd.h>
#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寄存器工具
猜你喜欢
转载自blog.csdn.net/qq_28643619/article/details/108525587
今日推荐
周排行