device connected

May 21, 2004 1 Replies

Is there a way in say the /proc filesystem to tell if the ethernet media is actually connected or not? I understand how to tell if the device is there or no.


Hi Michael,

Whether or not a cable is connected is information available from the ethernet card's MII PHY. Depending on the card, this info is available to the linux driver, and you can usually see it reported in the kernel logs. I have never seen any ethernet driver implement it under a /proc entry, although it's not impossible. There are also some user-space tools you may find of interest: mii-diag, mii-tool and eth-tool, which talk to the mii via ioctls to the ethernet driver.

regards,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Damion de Soto - Software Engineer email: damion@snapgear.com SnapGear - A CyberGuard Company --- ph: +61 7 3435 2809 | Custom Embedded Solutions fax: +61 7 3891 3630 | and Security Appliances web: http://www.snapgear.com~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Free Embedded Linux Distro at http://www.snapgear.org ---

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required