device connected

This is a discussion on device connected within the Linux Networking forums, part of the Linux Forums category; Is there a way in say the /proc filesystem to tell if the ethernet media is actually connected or not? ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-21-2004
Michael Lodman
 
Posts: n/a
Default device connected

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.
Reply With Quote
  #2 (permalink)  
Old 05-21-2004
Cameron Kerr
 
Posts: n/a
Default Re: device connected

In comp.os.linux.networking Michael Lodman
<jlodman@rainbow-networks.com> wrote:
> 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.


You can use mii-tool and grep to prevent network services starting (dhcp
on a laptop is a pain on boot otherwise).

mii-tool eth0 | grep -q 'link ok' && dhclient

--
Cameron Kerr
cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/
Empowered by Perl!
Reply With Quote
  #3 (permalink)  
Old 05-21-2004
Damion de Soto
 
Posts: n/a
Default Re: device connected

Hi Michael,
> 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.

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 ---
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:50 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0