[eepro100] automatic detection of media

Deepak Chawla chawla_deepak@hotmail.com
Mon Jan 28 17:54:02 2002


Thanks Don,
The script on RedHat 7.1 is mii-tool, and works almost as you said it would. 
With just about 2 lines of script, I got it to work just the way I wanted.

deepak.


>From: Donald Becker <becker@scyld.com>
>To: Deepak Chawla <chawla_deepak@hotmail.com>
>CC: eepro100@scyld.com
>Subject: Re: [eepro100] automatic detection of media
>Date: Sun, 27 Jan 2002 15:30:16 -0500 (EST)
>MIME-Version: 1.0
>Received: from [216.254.93.178] by hotmail.com (3.2) with ESMTP id 
>MHotMailBE1DACFF00984004389AD8FE5DB2F8D60; Sun, 27 Jan 2002 12:24:32 -0800
>Received: from localhost (becker@localhost)by vaio.greennet (8.9.3/8.8.7) 
>with ESMTP id PAA03533;Sun, 27 Jan 2002 15:30:17 -0500
>From becker@scyld.com Sun, 27 Jan 2002 12:24:52 -0800
>X-Sender: becker@vaio.greennet
>In-Reply-To: <F128uem3fF2mICQ5Xxc000185d3@hotmail.com>
>Message-ID: <Pine.LNX.4.10.10201271523430.771-100000@vaio.greennet>
>
>On Sun, 27 Jan 2002, Deepak Chawla wrote:
>
> > I'm using eepro100.o for my ethernet card (on Toshiba 2805 S202).
> > While trying to initialize eth0 on bootup, it takes quite a while before 
>the
> > driver gives up on initialization if it is not connected to the LAN.
>
>Presumably DHCP...
>
> > I'm currently handling this by forcing the rc.sysinit to confirm
> > initialization of eth0 during bootup, and then pressing Y/N as the case 
>may
> > be.
>
>You can use the exit status from mii-diag:
>    mii-diag --status eth0
>
>Look for exit status '2', which means no link beat.
>
> > I was wondering if there is a more elegant way of doing this, like
> > decreasing the timeout, or better still a way for automatic detection of
> > media so that as soon as the computer is "wired", it brings up the
> > interface, and brings it down again when the media is no longer present.
>
>There is no elegant way.  You will have to poll the interface with
>'mii-diag'.  You might think that this is wasteful, but the system would
>end up polling anyway, and by transferring the polling policy to the
>user code we don't pretend that the operation is free.
>
>Note that there will always be a race between briefly seeing link beat
>and sending out the DHCP request.
>You'll want to change the DHCP timeout to a much shorter value.  If you
>don't get a response in two seconds, you won't be getting one.
>
>Donald Becker				becker@scyld.com
>Scyld Computing Corporation		http://www.scyld.com
>410 Severn Ave. Suite 210		Second Generation Beowulf Clusters
>Annapolis MD 21403			410-990-9993
>


-deepak

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com