From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 15 15:26:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB091065782; Fri, 15 Jan 2010 15:26:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0ECC8FC14; Fri, 15 Jan 2010 15:26:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0FFQ32O011481; Fri, 15 Jan 2010 15:26:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFQ3ig011479; Fri, 15 Jan 2010 15:26:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001151526.o0FFQ3ig011479@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Jan 2010 15:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202369 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:26:04 -0000 Author: marius Date: Fri Jan 15 15:26:03 2010 New Revision: 202369 URL: http://svn.freebsd.org/changeset/base/202369 Log: MFC: r200945 - Consistently wrap debugging in NETIF_DEBUG. This basically merges NetBSD rev 1.19. - Make the functions match their prototypes regarding static. Modified: stable/7/sys/boot/common/dev_net.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/dev_net.c ============================================================================== --- stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:23:38 2010 (r202368) +++ stable/7/sys/boot/common/dev_net.c Fri Jan 15 15:26:03 2010 (r202369) @@ -76,7 +76,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #include "bootstrap.h" +#ifdef NETIF_DEBUG int debug = 0; +#endif static int netdev_sock = -1; static int netdev_opens; @@ -100,7 +102,7 @@ struct devsw netdev = { net_print }; -int +static int net_init(void) { @@ -112,7 +114,7 @@ net_init(void) * This opens the low-level device and sets f->f_devdata. * This is declared with variable arguments... */ -int +static int net_open(struct open_file *f, ...) { va_list args; @@ -132,8 +134,10 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } +#ifdef NETIF_DEBUG if (debug) - printf("net_open: netif_open() succeeded\n"); + printf("net_open: netif_open() succeeded\n"); +#endif } if (rootip.s_addr == 0) { /* Get root IP address, and path, etc. */ @@ -152,7 +156,7 @@ net_open(struct open_file *f, ...) return (error); } -int +static int net_close(struct open_file *f) { #ifdef NETIF_DEBUG @@ -171,15 +175,17 @@ net_close(struct open_file *f) return(0); rootip.s_addr = 0; if (netdev_sock >= 0) { +#ifdef NETIF_DEBUG if (debug) printf("net_close: calling netif_close()\n"); +#endif netif_close(netdev_sock); netdev_sock = -1; } return (0); } -int +static int net_strategy() { @@ -225,9 +231,11 @@ net_getparams(int sock) bootp(sock, BOOTP_NONE); if (myip.s_addr != 0) goto exit; +#ifdef NETIF_DEBUG if (debug) printf("net_open: BOOTP failed, trying RARP/RPC...\n"); #endif +#endif /* * Use RARP to get our IP address. This also sets our @@ -244,8 +252,10 @@ net_getparams(int sock) printf("net_open: bootparam/whoami RPC failed\n"); return (EIO); } +#ifdef NETIF_DEBUG if (debug) printf("net_open: client name: %s\n", hostname); +#endif /* * Ignore the gateway from whoami (unreliable). @@ -259,11 +269,15 @@ net_getparams(int sock) } if (smask) { netmask = smask; +#ifdef NETIF_DEBUG if (debug) - printf("net_open: subnet mask: %s\n", intoa(netmask)); + printf("net_open: subnet mask: %s\n", intoa(netmask)); +#endif } +#ifdef NETIF_DEBUG if (gateip.s_addr && debug) printf("net_open: net gateway: %s\n", inet_ntoa(gateip)); +#endif /* Get the root server and pathname. */ if (bp_getfile(sock, "root", &rootip, rootpath)) { @@ -286,10 +300,12 @@ exit: bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); } +#ifdef NETIF_DEBUG if (debug) { printf("net_open: server addr: %s\n", inet_ntoa(rootip)); printf("net_open: server path: %s\n", rootpath); } +#endif d = socktodesc(sock); sprintf(temp, "%6D", d->myea, ":");