From owner-freebsd-bugs Sun Jul 25 2:20: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 18BED15111 for ; Sun, 25 Jul 1999 02:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA06562; Sun, 25 Jul 1999 02:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from thoth.mch.sni.de (thoth.mch.sni.de [192.35.17.2]) by hub.freebsd.org (Postfix) with ESMTP id 696C615134 for ; Sun, 25 Jul 1999 02:14:09 -0700 (PDT) (envelope-from andre.albsmeier@mchp.siemens.de) Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.mch.sni.de (8.9.3/8.9.3) with ESMTP id LAA20884 for ; Sun, 25 Jul 1999 11:13:16 +0200 (MET DST) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mail1.siemens.de (8.9.3/8.9.3) with ESMTP id LAA27598 for ; Sun, 25 Jul 1999 11:13:15 +0200 (MET DST) Received: (from daemon@localhost) by curry.mchp.siemens.de (8.9.3/8.9.3) id LAA03822 for ; Sun, 25 Jul 1999 11:13:16 +0200 (CEST) Message-Id: <199907250913.LAA12864@internal> Date: Sun, 25 Jul 1999 11:13:15 +0200 (CEST) From: Andre Albsmeier To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/12803: patch to make xe driver's noise configurable in kernel config Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12803 >Category: kern >Synopsis: patch to make xe driver's noise configurable in kernel config >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 25 02:20:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 3.2-STABLE i386 >Organization: >Environment: FreeBSD 3.2-STABLE using xe driver >Description: The xe driver is rather noisy. While it already contains a XE_DEBUG definition, this is not adjustible without directly editing the source. >How-To-Repeat: Boot with a card which is supported by the xe driver. >Fix: This is my first try with kernel options. I hope, it is not to wrong what I have done :-). Since I think it is impossible to produce an #undef line with kernel options, I had to change all "#ifdef XE_DEBUG" lines to "#if XE_DEBUG > 0". --- sys/i386/conf/LINT.ORI Sun Jul 4 13:08:18 1999 +++ sys/i386/conf/LINT Mon Jul 26 10:51:46 1999 @@ -1217,6 +1217,7 @@ options WLDEBUG # enables verbose debugging output device wl0 at isa? port 0x300 net irq ? device xe0 at isa? port? irq ? +options XE_DEBUG=3 # We can (bogusly) include both the dedicated PCCARD drivers and the generic # support when COMPILING_LINT. device ze0 at isa? port 0x300 net irq 5 iomem 0xd8000 --- sys/conf/options.ORI Mon Jul 26 10:51:02 1999 +++ sys/conf/options Mon Jul 26 10:50:47 1999 @@ -373,3 +373,6 @@ # Embedded system options INIT_PATH opt_init_path.h + +# options for xe driver +XE_DEBUG opt_xe.h --- sys/dev/pccard/if_xe.c.ORI Mon Jul 26 10:37:44 1999 +++ sys/dev/pccard/if_xe.c Mon Jul 26 10:45:29 1999 @@ -99,6 +99,8 @@ */ +#include "opt_xe.h" + #ifndef XE_DEBUG #define XE_DEBUG 1 /* Increase for more voluminous output! */ #endif @@ -268,7 +270,7 @@ /* * Debug functions */ -#ifdef XE_DEBUG +#if XE_DEBUG > 0 #define XE_REG_DUMP(scp) xe_reg_dump((scp)) #define XE_MII_DUMP(scp) xe_mii_dump((scp)) static void xe_reg_dump (struct xe_softc *scp); @@ -325,7 +327,7 @@ */ static int xe_probe (struct isa_device *dev) { -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: probe\n", dev->id_unit); #endif bzero(sca, MAXSLOT * sizeof(sca[0])); @@ -480,7 +482,7 @@ dev = &devi->isahd; success = 0; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe: Probing for unit %d\n", unit); #endif @@ -722,7 +724,7 @@ struct xe_softc *scp = sca[dev->id_unit]; int i; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: attach\n", scp->unit); #endif @@ -823,7 +825,7 @@ struct xe_softc *scp = xscp; int s; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: init\n", scp->unit); #endif @@ -1351,7 +1353,7 @@ xe_media_change(struct ifnet *ifp) { struct xe_softc *scp = ifp->if_softc; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: media_change\n", ifp->if_unit); #endif @@ -1377,7 +1379,7 @@ static void xe_media_status(struct ifnet *ifp, struct ifmediareq *mrp) { -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: media_status\n", ifp->if_unit); #endif @@ -1394,7 +1396,7 @@ struct xe_softc *scp = xscp; u_int16_t bmcr, bmsr, anar, lpar; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: setmedia\n", scp->unit); #endif @@ -1671,7 +1673,7 @@ xe_hard_reset(struct xe_softc *scp) { int s; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: hard_reset\n", scp->unit); #endif @@ -1708,7 +1710,7 @@ xe_soft_reset(struct xe_softc *scp) { int s; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: soft_reset\n", scp->unit); #endif @@ -1748,7 +1750,7 @@ scp->srev = (XE_INB(XE_BOV) & 0x70) >> 4; else scp->srev = (XE_INB(XE_BOV) & 0x30) >> 4; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: silicon revision = %d\n", scp->unit, scp->srev); #endif @@ -1779,7 +1781,7 @@ xe_stop(struct xe_softc *scp) { int s; -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: stop\n", scp->unit); #endif @@ -1815,7 +1817,7 @@ */ static void xe_enable_intr(struct xe_softc *scp) { -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: enable_intr\n", scp->unit); #endif @@ -1839,7 +1841,7 @@ */ static void xe_disable_intr(struct xe_softc *scp) { -#ifdef XE_DEBUG +#if XE_DEBUG > 0 printf("xe%d: disable_intr\n", scp->unit); #endif @@ -2392,7 +2394,7 @@ } -#ifdef XE_DEBUG +#if XE_DEBUG > 0 /* * A bit of debugging code. */ @@ -2468,7 +2470,7 @@ static int xe_suspend(void *xunit) { -#ifdef XE_DEBUG +#if XE_DEBUG > 0 struct xe_softc *scp = sca[(int)xunit]; printf("xe%d: APM suspend\n", scp->unit); @@ -2483,7 +2485,7 @@ static int xe_resume(void *xunit) { -#ifdef XE_DEBUG +#if XE_DEBUG > 0 struct xe_softc *scp = sca[(int)xunit]; printf("xe%d: APM resume\n", scp->unit); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message