Hi to all,
How can i get PHY link status from user space for plug/unplug the network cable in QorIQ SDK1.9 with p1010 board?
Thanks.
Look at the following page in NXP community:
https://community.nxp.com/thread/332932
By the way, this works exactly the same on my host Linux PC:
With Ethernet cable connected:
cat /sys/class/net/<iface>/carrier
1
With Ethernet cable disconnected:
cat /sys/class/net/<iface>/carrier
0
See also the following:
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you very much.
I have tried as following:
I tried "ifconfig" ,but always log running both plug into and plug out the network cable!
I tried "cat /sys/class/net/carrier" ,the log is no change when plug into and plug out the network cable!
I tested use ioctl(fd,SIOCGIFFLAGS,&ifreq) , it 's right only exec command "ifconfig eth0 down /up", but always "RUNNING" both plug into/out the network cable!
I checked my board's schematic diagram, maybe reason is not connect INT pin of phy to IRQ pin of p1010 ?