[eepro100] problem with ethtool API

Konstantinos Koukopoulos kouk at noc.uoa.gr
Mon Jan 24 01:57:37 PST 2005

I'm running kernel 2.6.8 from Debian on a thinkpad R40. I'm sorry if this 
problem has been officialy fixed in a later kernel version.

I first noticed this problem when I tried to run ifplugd [1] in a mode where 
it uses the ethtool api to monitor the link status of the eepro100
card without bringing the interface up (-a). 

The daemon would detect the link going up fine. When I would remove the cable  
it would momentarily say that the link went down and then immediately say 
that the link went up again. Of course the cable was still unplugged but 
ifplugd would try, unsuccesfully, to bring the network up and then remain in 
the "link up" state.

By explicitly telling ifplugd to use the mii api the problem would go away.
I next used ethtool [2] and discovered that it too would report the link 
status as still being up after I had unplugged the cable. Mii-tool (from 
net-tools package) on the other hand would correctly report the link status 
as down. Interestingly, after running mii-tool, ethtool would report the 
correct link status. 

To summarize, after unplugging the network cable, programs that use 
SIOCETHTOOL falsely report the link status as up, while programs that use the 
SIOCGMIIREG  api report it correctly, causing subsequent ETHTOOL_GLINK 
ethtool ioctls to work from then on.

Although I doubt I have found the correct solution, I have attached a patch 
that fixes the problem for me. I would be interested in an expanation of the 
problem and what a better solution might be.

Thank you for your time,
Kostas Koukopoulos

P.S. please CC me in your response as I am not subscribed to the list

1.  http://www.stud.uni-hamburg.de/users/lennart/projects/ifplugd/
2.  http://sourceforge.net/projects/gkernel/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eepro100.c.diff
Type: text/x-diff
Size: 744 bytes
Desc: not available
Url : http://www.scyld.com/pipermail/eepro100/attachments/20050124/b46033d0/eepro100.c.bin

More information about the eepro100 mailing list