How to detect network cable plug/unplug on p1010 board with QorIQ SDK1.9

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to detect network cable plug/unplug on p1010 board with QorIQ SDK1.9

1,150件の閲覧回数
jungong
Contributor II

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.

0 件の賞賛
返信
2 返答(返信)

952件の閲覧回数
Pavel
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

952件の閲覧回数
jungong
Contributor II

Thank you very much.

Maybe our board not connect PHY INT pin to p1010's external IRQ pin.

0 件の賞賛
返信