Subject: Re: Kernel for eh-card
To: None <jan-uwe.finck@kommsrv.rz.unibw-muenchen.de>
From: Ale Terlevich <A.I.Terlevich@durham.ac.uk>
List: port-arm32
Date: 09/25/1996 12:21:49
> But as far as I remember there was a warning of special new kernels if
> you want to use the eh-network-card...?


  I have an EtherH card, and after a similar occurence I've done the same 
thing. I've only had the whole machine hang on me once in the last 2(or 
3?) weeks of intensive use.

  Onle little problem I've had is with timeouts after a Transmit error, 
these happened with the old kernels too, but I recompiled if_eh.c to 
automatically reset the card straight away. As we don't have the source 
for these new kernels, I wrote a little perl script to reset the card 
when it finds a Transmit error in /var/log/messages instead.

I'm not very good at perl, but it works!
I'll tag it onto the end of this mail if you want to use it (Just run it 
as root).

  Ale.

#!/usr/bin/perl 

$msgfile="/var/log/messages";

open ( msg , $msgfile );
while ( $line=<msg> ) {
}
@a = stat $msgfile;
print "At end of mess...\n";

loop1:

$prev_size=$a[7];
@a = stat $msgfile;
if ($line=<msg>) {
  if ( $line =~ /Transmit/ ) {
    system("ifconfig eh0 down");
    system("ifconfig eh0 up");
    print "Cycled eh0\n";
  }
}
else {
  sleep 1;
}

if ( $a[7] < $prev_size ) {
  reopen:
  print "logfile turned, attaching to new logfile\n";
  close (msg);
  sleep 1;
  open (msg, $msgfile) || goto reopen;
}

goto loop1;