How can i get PHY link status from user space for plug/unplug the network cable in QorIQ SDK1.9 with p1010 board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can i get PHY link status from user space for plug/unplug the network cable in QorIQ SDK1.9 with p1010 board

876 Views
jungong
Contributor II

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.

0 Kudos
2 Replies

639 Views
Pavel
NXP Employee
NXP Employee

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

0 Kudos

639 Views
jungong
Contributor II

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 ?

0 Kudos