Skip to contentSkip to conversation

Question: Etherenet Link Detection

DISCUSSION Robert Cantu 7 participants 8 messages Sep 26, 2001 – Sep 27, 2001

lore
Share & tools
lore
#0 lore raw

Is there a method of detecting the link status of an ethernet NIC? If not, is it feasible? And if it is, then would it be something in each driver, or on a level above the driver, thereby available to all drivers? I figure the list is the best place to ask this, although it might be a moot point.

Example: Have a cable modem hooked into a computer's NIC. Cable service goes out, link light on back of NIC goes out. A hypothetical program says that the link is gone via some hook in /proc somewhere.

Is this a worthwhile endeavor, if possible?

Thanks in advance,
Robert

#1 lore raw

I know for sure that the Intel 82559 Fast Ethernet embedded controller has a register where it's possible to read out if the link led is active or not. It seems quite likely that this would be available on other controllers as well.

Is there any functionality in the current kernel that enables a userland program to read this? I mostly turn my machines on and and let them do their thing until the hardware fails :)

/Peter

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Robert Cantu
Sent: den 26 september 2001 23:41
To: [email protected]
Subject: Question: Etherenet Link Detection

Is there a method of detecting the link status of an ethernet NIC? If not, is it feasible? And if it is, then would it be something in each driver, or on a level above the driver, thereby available to all drivers? I figure the list is the best place to ask this, although it might be a moot point.

Example: Have a cable modem hooked into a computer's NIC. Cable service goes out, link light on back of NIC goes out. A hypothetical program says that the link is gone via some hook in /proc somewhere.

Is this a worthwhile endeavor, if possible?

Thanks in advance,
Robert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 11 lines · Peter Sandstrom

I know for sure that the Intel 82559 Fast Ethernet embedded controller has a register where it's possible to read out if the link led is active or not. It seems quite likely that this would be available on other controllers as well.

Is there any functionality in the current kernel that enables a userland program to read this? I mostly turn my machines on and and let them do their thing until the hardware fails :)

/Peter

You can get this information out of any NIC that supports the mii-diag protocols. The two I've used are the eepro100 and tulip drivers...

You can read Becker's mii-diag source for the gory details!

Ben

Signature · 3 lines
Ben Greear <[email protected]>          <[email protected]>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#3 lore raw
In reply to Peter Sandstrom
Quoted 14 lines · Ben Greear
Quoted 11 lines · Peter Sandstrom

I know for sure that the Intel 82559 Fast Ethernet embedded controller has a register where it's possible to read out if the link led is active or not. It seems quite likely that this would be available on other controllers as well.

Is there any functionality in the current kernel that enables a userland program to read this? I mostly turn my machines on and and let them do their thing until the hardware fails :)

/Peter

Quoted 9 lines

You can get this information out of any NIC that supports the mii-diag protocols. The two I've used are the eepro100 and tulip drivers...

You can read Becker's mii-diag source for the gory details!

Ben

Thaniks, all who replied.

A little clarification on my project:

I'm going to try to build a userland app that manages several different network profiles and watches the ethernet port and notifies the user of a disconnect. If the user wishes, it will be configured to unload the network profile upon disconnect (to avoid long timeouts) and upon reconnction, reload that profile. A few simple subnet detection algorithms would try to intelligently load the correct profile. This is mainly a useful solution for mobile users who have to have different set-ups for networking. It looks like the mii-diag from Becker is going to work great (thanks, all who pointed me there), and is the last component I needed to get started. I may put the project up on sourceforge as my coding skills are new and weak. Thanks for the info.

As a side note, any chance such monitoring tools/interfaces might go into a later 2.4 or 2.5 kernel and be available in the /proc fs? That would be a much more elegant solution, from a user's standpoint. Again, thanks, all!

Cheers,
Robert Cantu
[email protected]

#4 lore raw
In reply to Robert Cantu

You can get that information from the PHY too, so if you can get to the MII control registers, you can query the phy for link status.

Again, tho, the problem is getting that data to userland.

Matt

Quoted 45 lines · Peter Sandstrom

I know for sure that the Intel 82559 Fast Ethernet embedded controller has a register where it's possible to read out if the link led is active or not. It seems quite likely that this would be available on other controllers as well.

Is there any functionality in the current kernel that enables a userland program to read this? I mostly turn my machines on and and let them do their thing until the hardware fails :)

/Peter

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Robert Cantu
Sent: den 26 september 2001 23:41
To: [email protected]
Subject: Question: Etherenet Link Detection

Is there a method of detecting the link status of an ethernet NIC? If not, is it feasible? And if it is, then would it be something in each driver, or on a level above the driver, thereby available to all drivers? I figure the list is the best place to ask this, although it might be a moot point.

Example: Have a cable modem hooked into a computer's NIC. Cable service goes out, link light on back of NIC goes out. A hypothetical program says that the link is gone via some hook in /proc somewhere.

Is this a worthwhile endeavor, if possible?

Thanks in advance,
Robert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 6 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

Type "format c:"  That should fix everything.
					-- Greg
User Friendly, 12/18/1997
#5 lore raw
In reply to Robert Cantu

Hi-

It's traditionally been defined as MII information, but that's awfully slow, so some Ethernet controllers make it available in a quicker manner.

ethtool might do this (http://sourceforge.net/projects/gkernel/);
I don't know for sure.

or mii-diag (http://www.scyld.com/diag/).

~Randy

Quoted 38 lines · Matthew Dharm

You can get that information from the PHY too, so if you can get to the MII control registers, you can query the phy for link status.

Again, tho, the problem is getting that data to userland.

Matt

Quoted 29 lines · Peter Sandstrom

I know for sure that the Intel 82559 Fast Ethernet embedded controller has a register where it's possible to read out if the link led is active or not. It seems quite likely that this would be available on other controllers as well.

Is there any functionality in the current kernel that enables a userland program to read this? I mostly turn my machines on and and let them do their thing until the hardware fails :)

/Peter

-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Robert Cantu
Sent: den 26 september 2001 23:41
To: [email protected]
Subject: Question: Etherenet Link Detection

Is there a method of detecting the link status of an ethernet NIC? If not, is it feasible? And if it is, then would it be something in each driver, or on a level above the driver, thereby available to all drivers? I figure the list is the best place to ask this, although it might be a moot point.

Example: Have a cable modem hooked into a computer's NIC. Cable service goes out, link light on back of NIC goes out. A hypothetical program says that the link is gone via some hook in /proc somewhere.

Is this a worthwhile endeavor, if possible?

#6 lore raw
Quoted 6 lines

It's traditionally been defined as MII information, but that's awfully slow, so some Ethernet controllers make it available in a quicker manner.

ethtool might do this (http://sourceforge.net/projects/gkernel/);
I don't know for sure.

The only interface to this is through MII, unless we want to add an ETHTOOL style ioctl to get the link status. This means, however, that every driver that wants to report this needs to support at least a subset of ethtool ioctls, which VERY FEW do.

#7 lore raw
Quoted 5 lines · Tim Hockin
Quoted 5 lines

It's traditionally been defined as MII information, but that's awfully slow, so some Ethernet controllers make it available in a quicker manner.

Quoted 7 lines
Quoted 2 lines

ethtool might do this (http://sourceforge.net/projects/gkernel/);
I don't know for sure.

The only interface to this is through MII, unless we want to add an ETHTOOL style ioctl to get the link status. This means, however, that every driver that wants to report this needs to support at least a subset of ethtool ioctls, which VERY FEW do.

Right. I think that Jeff was thinking about this for 2.5 (what's that?),
but I'm not trying to speak for Jeff.

Or maybe this has already been discussed on these mailing lists:
[email protected] or [email protected]

~Randy