Hi to all,please help me.
How to detect network cable plug/unplug on p1010 board with QorIQ SDK1.9?
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!
Thanks.
I have tested P1010RDB board. See below. The P1010 eth0 was used for link detection.
root@p1010rdb:~# libphy: mdio@ffe24000:01 - Link is Up - 1000/Full
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
root@p1010rdb:~# cat /sys/class/net/eth0/carrier
1
root@p1010rdb:~# libphy: mdio@ffe24000:01 - Link is Down
root@p1010rdb:~# cat /sys/class/net/eth0/carrier
0
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.
Maybe our board not connect PHY INT pin to p1010's external IRQ pin.