Tue May 5 18:08:29 2009 UTC ()
Doesn't print error message only when the register is BGE_SRS_MODE.
It occurs on some environment (and once after boot?). Other *BSDs and
Linux don't print the error message for all registers.


(msaitoh)
diff -r1.164 -r1.165 src/sys/dev/pci/if_bge.c

cvs diff -r1.164 -r1.165 src/sys/dev/pci/if_bge.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_bge.c 2009/04/23 10:47:44 1.164
+++ src/sys/dev/pci/if_bge.c 2009/05/05 18:08:28 1.165
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_bge.c,v 1.164 2009/04/23 10:47:44 msaitoh Exp $ */ 1/* $NetBSD: if_bge.c,v 1.165 2009/05/05 18:08:28 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Wind River Systems 4 * Copyright (c) 2001 Wind River Systems
5 * Copyright (c) 1997, 1998, 1999, 2001 5 * Copyright (c) 1997, 1998, 1999, 2001
6 * Bill Paul <wpaul@windriver.com>. All rights reserved. 6 * Bill Paul <wpaul@windriver.com>. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -69,27 +69,27 @@ @@ -69,27 +69,27 @@
69 * does not support external SSRAM. 69 * does not support external SSRAM.
70 * 70 *
71 * Broadcom also produces a variation of the BCM5700 under the "Altima" 71 * Broadcom also produces a variation of the BCM5700 under the "Altima"
72 * brand name, which is functionally similar but lacks PCI-X support. 72 * brand name, which is functionally similar but lacks PCI-X support.
73 * 73 *
74 * Without external SSRAM, you can only have at most 4 TX rings, 74 * Without external SSRAM, you can only have at most 4 TX rings,
75 * and the use of the mini RX ring is disabled. This seems to imply 75 * and the use of the mini RX ring is disabled. This seems to imply
76 * that these features are simply not available on the BCM5701. As a 76 * that these features are simply not available on the BCM5701. As a
77 * result, this driver does not implement any support for the mini RX 77 * result, this driver does not implement any support for the mini RX
78 * ring. 78 * ring.
79 */ 79 */
80 80
81#include <sys/cdefs.h> 81#include <sys/cdefs.h>
82__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.164 2009/04/23 10:47:44 msaitoh Exp $"); 82__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.165 2009/05/05 18:08:28 msaitoh Exp $");
83 83
84#include "bpfilter.h" 84#include "bpfilter.h"
85#include "vlan.h" 85#include "vlan.h"
86#include "rnd.h" 86#include "rnd.h"
87 87
88#include <sys/param.h> 88#include <sys/param.h>
89#include <sys/systm.h> 89#include <sys/systm.h>
90#include <sys/callout.h> 90#include <sys/callout.h>
91#include <sys/sockio.h> 91#include <sys/sockio.h>
92#include <sys/mbuf.h> 92#include <sys/mbuf.h>
93#include <sys/malloc.h> 93#include <sys/malloc.h>
94#include <sys/kernel.h> 94#include <sys/kernel.h>
95#include <sys/device.h> 95#include <sys/device.h>
@@ -4182,28 +4182,34 @@ bge_stop_block(struct bge_softc *sc, bus @@ -4182,28 +4182,34 @@ bge_stop_block(struct bge_softc *sc, bus
4182{ 4182{
4183 int i; 4183 int i;
4184 4184
4185 BGE_CLRBIT(sc, reg, bit); 4185 BGE_CLRBIT(sc, reg, bit);
4186 4186
4187 for (i = 0; i < BGE_TIMEOUT; i++) { 4187 for (i = 0; i < BGE_TIMEOUT; i++) {
4188 if ((CSR_READ_4(sc, reg) & bit) == 0) 4188 if ((CSR_READ_4(sc, reg) & bit) == 0)
4189 return; 4189 return;
4190 delay(100); 4190 delay(100);
4191 if (sc->bge_flags & BGE_PCIE) 4191 if (sc->bge_flags & BGE_PCIE)
4192 DELAY(1000); 4192 DELAY(1000);
4193 } 4193 }
4194 4194
4195 aprint_error_dev(sc->bge_dev, 4195 /*
4196 "block failed to stop: reg 0x%lx, bit 0x%08x\n", (u_long)reg, bit); 4196 * Doesn't print only when the register is BGE_SRS_MODE. It occurs
 4197 * on some environment (and once after boot?)
 4198 */
 4199 if (reg != BGE_SRS_MODE)
 4200 aprint_error_dev(sc->bge_dev,
 4201 "block failed to stop: reg 0x%lx, bit 0x%08x\n",
 4202 (u_long)reg, bit);
4197} 4203}
4198 4204
4199/* 4205/*
4200 * Stop the adapter and free any mbufs allocated to the 4206 * Stop the adapter and free any mbufs allocated to the
4201 * RX and TX lists. 4207 * RX and TX lists.
4202 */ 4208 */
4203static void 4209static void
4204bge_stop(struct ifnet *ifp, int disable) 4210bge_stop(struct ifnet *ifp, int disable)
4205{ 4211{
4206 struct bge_softc *sc = ifp->if_softc; 4212 struct bge_softc *sc = ifp->if_softc;
4207 4213
4208 callout_stop(&sc->bge_timeout); 4214 callout_stop(&sc->bge_timeout);
4209 4215