Patch for annoying logging behavior.

William M. Shubert wms@hevanet.com
Sun Feb 7 18:17:30 1999


This is a multi-part message in MIME format.
--------------419372F5DBC6B94873C2C215
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello. I have a tulip network card in my Linux box, and it works 99%
great. :-) The 1% problem is that I frequently leave the ethernet cable
unplugged (I use my ethernet card to communicate with my laptop, which
is usually off having fun somewhere instead of sitting next to my desk.)
The driver notices that there is no carrier, and every minute emits a
message like:

Feb  7 15:09:22 elysium kernel: eth0: No link beat on the MII interface,
status then 7809 now 7809.

As you can imagine, my log file fills up with these messages to the
extent that other messages get very hard to find. I modified my tulip
driver to only spit out this message when the state changes, so I get
this message once every time I unplug the cable, then never get it again
until I reconnect the cable then unplug it again. Here's the context
diffs for my fix, made to the v0.88 (4/7/88) release of tulip.c (I
noticed that tulip.c is now up to v0.90 so the line numbers may be
wrong, but this chunk of code hasn't changed since v0.88):

[root@elysium net]# diff -c tulip.c tulip.c~
*** tulip.c     Sun Feb  7 15:04:55 1999
--- tulip.c~    Fri May  8 13:05:24 1998
***************
*** 1670,1677 ****
                                           tp->full_duplex ? 'F' : 'H');

                        if (mii_reg1 != 0xffff  &&  (mii_reg1 & 0x0004)
== 0) {
                                int new_reg1 = mdio_read(ioaddr,
tp->phys[0], 1);
!                               if (((new_reg1 & 0x0004) == 0) &&
!                                       (new_reg1 != mii_reg1))
                                        printk(KERN_INFO "%s: No link
beat on the MII interface,"
                                                   " status then %4.4x
now %4.4x.\n",
                                                   dev->name, mii_reg1,
new_reg1);
--- 1670,1676 ----
                                           tp->full_duplex ? 'F' : 'H');

                        if (mii_reg1 != 0xffff  &&  (mii_reg1 & 0x0004)
== 0) {
                                int new_reg1 = mdio_read(ioaddr,
tp->phys[0], 1);
!                               if ((new_reg1 & 0x0004) == 0)
                                        printk(KERN_INFO "%s: No link
beat on the MII interface,"
                                                   " status then %4.4x
now %4.4x.\n",
                                                   dev->name, mii_reg1,
new_reg1);
[root@elysium net]#

If somebody in charge likes this patch, I'd appreciate it if it found
its way into the standard driver so that next time I upgrade my kernel I
won't have to re-patch the driver.
--
                                    Bill Shubert (wms@hevanet.com)
                                    http://www.hevanet.com/wms/



--------------419372F5DBC6B94873C2C215
Content-Type: text/x-vcard; charset=us-ascii;
 name="wms.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for William M. Shubert
Content-Disposition: attachment;
 filename="wms.vcf"

begin:vcard 
n:Shubert;William
x-mozilla-html:TRUE
adr:;;1975 NW Everett St. #301;Portland;OR;97209;USA
version:2.1
email;internet:wms@hevanet.com
note;quoted-printable:URL: http://www.hevanet.com/wms/=0D=0A
x-mozilla-cpt:;0
tel;home:(503)223-2285
fn:William Shubert
end:vcard

--------------419372F5DBC6B94873C2C215--