PERFORCE change 171875 for review
Rafal Jaworowski
raj at FreeBSD.org
Thu Dec 17 14:10:12 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=171875
Change 171875 by raj at raj_fdt on 2009/12/17 14:09:54
IFC @171874
Affected files ...
.. //depot/projects/fdt/Makefile.inc1#5 integrate
.. //depot/projects/fdt/lib/libc/stdio/getline.3#2 integrate
.. //depot/projects/fdt/lib/libjail/jail.c#2 integrate
.. //depot/projects/fdt/share/man/man5/make.conf.5#3 integrate
.. //depot/projects/fdt/share/man/man7/build.7#2 integrate
.. //depot/projects/fdt/share/man/man9/LOCK_PROFILING.9#2 integrate
.. //depot/projects/fdt/sys/amd64/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/arm/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/boot/i386/libi386/biosdisk.c#2 integrate
.. //depot/projects/fdt/sys/boot/pc98/libpc98/biosdisk.c#2 integrate
.. //depot/projects/fdt/sys/compat/freebsd32/freebsd32_proto.h#3 integrate
.. //depot/projects/fdt/sys/conf/NOTES#5 integrate
.. //depot/projects/fdt/sys/dev/ata/chipsets/ata-promise.c#4 integrate
.. //depot/projects/fdt/sys/dev/ichsmb/ichsmb_pci.c#4 integrate
.. //depot/projects/fdt/sys/dev/ips/ips_pci.c#2 integrate
.. //depot/projects/fdt/sys/dev/vge/if_vge.c#6 integrate
.. //depot/projects/fdt/sys/dev/vge/if_vgereg.h#3 integrate
.. //depot/projects/fdt/sys/dev/vge/if_vgevar.h#6 integrate
.. //depot/projects/fdt/sys/i386/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/ia64/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/kern/uipc_syscalls.c#3 integrate
.. //depot/projects/fdt/sys/mips/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_dummynet.c#5 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw2.c#4 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw_dynamic.c#2 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw_log.c#2 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw_nat.c#3 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw_pfil.c#3 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw_private.h#2 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw_sockopt.c#2 integrate
.. //depot/projects/fdt/sys/netinet/ipfw/ip_fw_table.c#2 integrate
.. //depot/projects/fdt/sys/pc98/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/powerpc/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/sparc64/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/sun4v/conf/DEFAULTS#2 integrate
.. //depot/projects/fdt/sys/sys/sysproto.h#2 integrate
.. //depot/projects/fdt/usr.bin/calendar/calendars/calendar.all#2 integrate
.. //depot/projects/fdt/usr.bin/calendar/io.c#2 integrate
.. //depot/projects/fdt/usr.bin/calendar/ostern.c#3 integrate
.. //depot/projects/fdt/usr.bin/comm/comm.c#3 integrate
.. //depot/projects/fdt/usr.bin/make/arch.c#4 integrate
.. //depot/projects/fdt/usr.bin/make/make.c#3 integrate
.. //depot/projects/fdt/usr.bin/yacc/defs.h#2 integrate
Differences ...
==== //depot/projects/fdt/Makefile.inc1#5 (text+ko) ====
@@ -1,14 +1,15 @@
#
-# $FreeBSD: src/Makefile.inc1,v 1.634 2009/12/11 14:15:55 ed Exp $
+# $FreeBSD: src/Makefile.inc1,v 1.635 2009/12/16 02:54:34 imp Exp $
#
# Make command line options:
# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
# -DNO_CLEAN do not clean at all
# -DNO_SHARE do not go into share subdir
-# -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELDEPEND
+# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ}
# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
+# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects
@@ -694,6 +695,7 @@
NO_KERNELCLEAN= t
NO_KERNELCONFIG= t
NO_KERNELDEPEND= t
+NO_KERNELOBJ= t
# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
.if !defined(KERNCONF) && ${KERNFAST} != "1"
KERNCONF=${KERNFAST}
@@ -763,11 +765,13 @@
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
.endif
+.if !defined(NO_KERNELOBJ)
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.2: rebuilding the object tree"
@echo "--------------------------------------------------------------"
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
+.endif
@echo
@echo "--------------------------------------------------------------"
@echo ">>> stage 2.3: build tools"
==== //depot/projects/fdt/lib/libc/stdio/getline.3#2 (text+ko) ====
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libc/stdio/getline.3,v 1.2 2009/04/06 13:50:04 das Exp $
+.\" $FreeBSD: src/lib/libc/stdio/getline.3,v 1.3 2009/12/16 04:19:23 matteo Exp $
.\"
.Dd March 29, 2009
.Dt GETLINE 3
@@ -78,7 +78,8 @@
.Fn getline
functions return the number of characters written, excluding the
terminating
-.Dv NUL .
+.Dv NUL
+character.
The value \-1 is returned if an error occurs, or if end-of-file is reached.
.Sh EXAMPLES
The following code fragment reads lines from a file and
==== //depot/projects/fdt/lib/libjail/jail.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libjail/jail.c,v 1.3 2009/07/25 14:48:57 jamie Exp $");
+__FBSDID("$FreeBSD: src/lib/libjail/jail.c,v 1.4 2009/12/17 05:06:56 jamie Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -532,7 +532,7 @@
}
jp_key = jp_lastjid ? jp_lastjid :
jp_jid && jp_jid->jp_valuelen == sizeof(int) &&
- *(int *)jp_jid->jp_value ? jp_jid : jp_name;
+ jp_jid->jp_value && *(int *)jp_jid->jp_value ? jp_jid : jp_name;
if (jp_key == NULL || jp_key->jp_value == NULL) {
strlcpy(jail_errmsg, "no jail specified", JAIL_ERRMSGLEN);
errno = ENOENT;
==== //depot/projects/fdt/share/man/man5/make.conf.5#3 (text+ko) ====
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man5/make.conf.5,v 1.142 2009/11/02 12:03:04 remko Exp $
+.\" $FreeBSD: src/share/man/man5/make.conf.5,v 1.144 2009/12/16 03:29:00 imp Exp $
.\"
-.Dd September 1, 2009
+.Dd December 15, 2009
.Dt MAKE.CONF 5
.Os
.Sh NAME
@@ -369,6 +369,12 @@
.It Va MODULES_OVERRIDE
.Pq Vt str
Set to a list of modules to build instead of all of them.
+.It Va NO_KERNELCLEAN
+.Pq Vt bool
+Set this to skip running
+.Dq Li "${MAKE} clean"
+during
+.Dq Li "${MAKE} buildkernel" .
.It Va NO_KERNELCONFIG
.Pq Vt bool
Set this to skip running
@@ -381,6 +387,12 @@
.Dq Li "${MAKE} depend"
during
.Dq Li "${MAKE} buildkernel" .
+.It Va NO_KERNELOBJ
+.Pq Vt bool
+Set this to skip running
+.Dq Li "${MAKE} obj"
+during
+.Dq Li "${MAKE} buildkernel" .
.It Va NO_MODULES
.Pq Vt bool
Set to not build modules with the kernel.
==== //depot/projects/fdt/share/man/man7/build.7#2 (text+ko) ====
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man7/build.7,v 1.51 2009/01/23 18:35:09 imp Exp $
+.\" $FreeBSD: src/share/man/man7/build.7,v 1.53 2009/12/16 03:29:00 imp Exp $
.\"
-.Dd January 23, 2009
+.Dd December 15, 2009
.Dt BUILD 7
.Os
.Sh NAME
@@ -345,9 +345,10 @@
.Cm buildkernel
defaults to setting
.Va NO_KERNELCLEAN ,
-.Va NO_KERNELCONFIG
+.Va NO_KERNELCONFIG ,
+.Va NO_KERNELDEPEND
and
-.Va NO_KERNELDEPEND .
+.Va NO_KERNELOBJ .
When set to a value other than
.Cm 1
then
@@ -444,6 +445,12 @@
as part of the
.Cm buildkernel
target.
+.It Va NO_KERNELOBJ
+If set, the build process does not run
+.Dq make obj
+as part of the
+.Cm buildkernel
+target.
.It Va NO_DOCUPDATE
If set, the update process does not update the source of the
.Fx
==== //depot/projects/fdt/share/man/man9/LOCK_PROFILING.9#2 (text+ko) ====
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man9/LOCK_PROFILING.9,v 1.2 2006/12/01 17:46:25 ru Exp $
+.\" $FreeBSD: src/share/man/man9/LOCK_PROFILING.9,v 1.3 2009/12/16 19:37:38 julian Exp $
.\"
.Dd November 11, 2006
.Dt LOCK_PROFILING 9
@@ -114,6 +114,8 @@
.Bl -tag -width ".Va cnt_hold"
.It Va max
The longest continuous hold time in microseconds.
+.It Va wait_max
+The longest continuous wait time in microseconds.
.It Va total
The total (accumulated) hold time in microseconds.
.It Va wait_total
==== //depot/projects/fdt/sys/amd64/conf/DEFAULTS#2 (text+ko) ====
@@ -1,7 +1,7 @@
#
# DEFAULTS -- Default kernel configuration file for FreeBSD/amd64
#
-# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.19 2009/06/09 20:26:52 kmacy Exp $
+# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.20 2009/12/16 02:17:43 dougb Exp $
machine amd64
@@ -21,3 +21,9 @@
options GEOM_PART_EBR_COMPAT
options GEOM_PART_MBR
+# Store the plain version of the configuration file in the kernel itself.
+# To store the entire file, including comments, put this in /etc/src.conf:
+# CONFIGARGS= -C
+# See config(8) for more details.
+#
+options INCLUDE_CONFIG_FILE # Include this file in kernel
==== //depot/projects/fdt/sys/arm/conf/DEFAULTS#2 (text+ko) ====
@@ -1,7 +1,7 @@
#
# DEFAULTS -- Default kernel configuration file for FreeBSD/arm
#
-# $FreeBSD: src/sys/arm/conf/DEFAULTS,v 1.2 2008/12/17 17:43:22 marcel Exp $
+# $FreeBSD: src/sys/arm/conf/DEFAULTS,v 1.3 2009/12/16 02:17:43 dougb Exp $
machine arm
@@ -9,3 +9,10 @@
options GEOM_PART_BSD
options GEOM_PART_MBR
+
+# Store the plain version of the configuration file in the kernel itself.
+# To store the entire file, including comments, put this in /etc/src.conf:
+# CONFIGARGS= -C
+# See config(8) for more details.
+#
+options INCLUDE_CONFIG_FILE # Include this file in kernel
==== //depot/projects/fdt/sys/boot/i386/libi386/biosdisk.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.62 2009/06/26 09:32:31 rpaulo Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.63 2009/12/17 13:14:11 nyan Exp $");
/*
* BIOS disk device handling.
@@ -1266,11 +1266,11 @@
}
if (write)
- DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p),
- result ? "failed" : "ok");
+ DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x,
+ p, VTOP(p), dblk, result ? "failed" : "ok");
else
- DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk,
- result ? "failed" : "ok");
+ DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x,
+ dblk, p, VTOP(p), result ? "failed" : "ok");
if (result) {
return(-1);
}
==== //depot/projects/fdt/sys/boot/pc98/libpc98/biosdisk.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/biosdisk.c,v 1.41 2009/03/20 05:33:58 nyan Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/biosdisk.c,v 1.42 2009/12/17 13:14:11 nyan Exp $");
/*
* BIOS disk device handling.
@@ -906,11 +906,11 @@
}
if (write)
- DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p),
- result ? "failed" : "ok");
+ DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x,
+ p, VTOP(p), dblk, result ? "failed" : "ok");
else
- DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk,
- result ? "failed" : "ok");
+ DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x,
+ dblk, p, VTOP(p), result ? "failed" : "ok");
if (result) {
return(-1);
}
==== //depot/projects/fdt/sys/compat/freebsd32/freebsd32_proto.h#3 (text+ko) ====
@@ -2,7 +2,7 @@
* System call prototypes.
*
* DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.110 2009/12/04 21:53:20 kib Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.112 2009/12/16 21:53:56 imp Exp $
* created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 2009-12-04 21:52:31Z kib
*/
==== //depot/projects/fdt/sys/conf/NOTES#5 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1566 2009/12/06 00:10:13 mav Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1567 2009/12/16 16:24:32 jhb Exp $
#
# NOTES -- Lines that can be cut/pasted into kernel and hints configs.
#
@@ -1812,14 +1812,47 @@
#
# Network interfaces:
#
-# MII bus support is required for some PCI 10/100 ethernet NICs,
+# MII bus support is required for many PCI Ethernet NICs,
# namely those which use MII-compliant transceivers or implement
-# transceiver control interfaces that operate like an MII. Adding
+# transceiver control interfaces that operate like an MII. Adding
# "device miibus" to the kernel config pulls in support for
# the generic miibus API and all of the PHY drivers, including a
# generic one for PHYs that aren't specifically handled by an
-# individual driver.
-device miibus
+# individual driver. Support for specific PHYs may be built by adding
+# "device mii" then adding the appropriate PHY driver.
+device miibus # MII support including all PHYs
+device mii # Minimal MII support
+
+device acphy # Altima Communications AC101
+device amphy # AMD AM79c873 / Davicom DM910{1,2}
+device atphy # Attansic/Atheros F1
+device axphy # Asix Semiconductor AX88x9x
+device bmtphy # Broadcom BCM5201/BCM5202 and 3Com 3c905C
+device brgphy # Broadcom BCM54xx/57xx 1000baseTX
+device ciphy # Cicada/Vitesse CS/VSC8xxx
+device e1000phy # Marvell 88E1000 1000/100/10-BT
+device exphy # 3Com internal PHY
+device gentbi # Generic 10-bit 1000BASE-{LX,SX} fiber ifaces
+device icsphy # ICS ICS1889-1893
+device inphy # Intel 82553/82555
+device ip1000phy # IC Plus IP1000A/IP1001
+device jmphy # JMicron JMP211/JMP202
+device lxtphy # Level One LXT-970
+device mlphy # Micro Linear 6692
+device nsgphy # NatSemi DP8361/DP83865/DP83891
+device nsphy # NatSemi DP83840A
+device nsphyter # NatSemi DP83843/DP83815
+device pnaphy # HomePNA
+device qsphy # Quality Semiconductor QS6612
+device rgephy # RealTek 8169S/8110S/8211B/8211C
+device rlphy # RealTek 8139
+device rlswitch # RealTek 8305
+device ruephy # RealTek RTL8150
+device smcphy # SMSC LAN91C111
+device tdkphy # TDK 89Q2120
+device tlphy # Texas Instruments ThunderLAN
+device truephy # LSI TruePHY
+device xmphy # XaQti XMAC II
# an: Aironet 4500/4800 802.11 wireless adapters. Supports the PCMCIA,
# PCI and ISA varieties.
==== //depot/projects/fdt/sys/dev/ata/chipsets/ata-promise.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-promise.c,v 1.13 2009/12/06 00:10:13 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/chipsets/ata-promise.c,v 1.14 2009/12/16 17:42:02 mav Exp $");
#include "opt_ata.h"
#include <sys/param.h>
@@ -957,6 +957,7 @@
ata_dmainit(dev);
/* note start and stop are not used here */
ch->dma.setprd = ata_promise_mio_setprd;
+ ch->dma.max_iosize = 65536;
}
==== //depot/projects/fdt/sys/dev/ichsmb/ichsmb_pci.c#4 (text+ko) ====
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ichsmb/ichsmb_pci.c,v 1.24 2009/12/04 05:45:46 avg Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ichsmb/ichsmb_pci.c,v 1.25 2009/12/16 12:25:27 avg Exp $");
/*
* Support for the SMBus controller logical device which is part of the
@@ -78,6 +78,7 @@
#define ID_82801H 0x283e8086
#define ID_82801I 0x29308086
#define ID_82801JI 0x3a308086
+#define ID_PCH 0x3b308086
#define ID_6300ESB 0x25a48086
#define ID_631xESB 0x269b8086
@@ -164,6 +165,9 @@
case ID_82801JI:
device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller");
break;
+ case ID_PCH:
+ device_set_desc(dev, "Intel PCH SMBus controller");
+ break;
case ID_6300ESB:
device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller");
break;
==== //depot/projects/fdt/sys/dev/ips/ips_pci.c#2 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ips/ips_pci.c,v 1.17 2009/08/20 19:17:53 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ips/ips_pci.c,v 1.18 2009/12/17 00:21:12 mjacob Exp $");
#include <dev/ips/ipsreg.h>
#include <dev/ips/ips.h>
@@ -154,7 +154,7 @@
}
sc->ips_ich.ich_func = ips_intrhook;
sc->ips_ich.ich_arg = sc;
- mtx_init(&sc->queue_mtx, "IPS bioqueue lock", MTX_DEF, 0);
+ mtx_init(&sc->queue_mtx, "IPS bioqueue lock", NULL, MTX_DEF);
sema_init(&sc->cmd_sema, 0, "IPS Command Semaphore");
bioq_init(&sc->queue);
if (config_intrhook_establish(&sc->ips_ich) != 0) {
==== //depot/projects/fdt/sys/dev/vge/if_vge.c#6 (text+ko) ====
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/vge/if_vge.c,v 1.62 2009/12/14 22:55:20 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/vge/if_vge.c,v 1.67 2009/12/16 20:03:43 yongari Exp $");
/*
* VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -93,6 +93,7 @@
#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/socket.h>
+#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_arp.h>
@@ -132,11 +133,18 @@
TUNABLE_INT("hw.vge.msi_disable", &msi_disable);
/*
+ * The SQE error counter of MIB seems to report bogus value.
+ * Vendor's workaround does not seem to work on PCIe based
+ * controllers. Disable it until we find better workaround.
+ */
+#undef VGE_ENABLE_SQEERR
+
+/*
* Various supported device vendors/types and their names.
*/
static struct vge_type vge_devs[] = {
{ VIA_VENDORID, VIA_DEVICEID_61XX,
- "VIA Networking Gigabit Ethernet" },
+ "VIA Networking Velocity Gigabit Ethernet" },
{ 0, 0, NULL }
};
@@ -179,10 +187,14 @@
static void vge_reset(struct vge_softc *);
static int vge_rx_list_init(struct vge_softc *);
static int vge_rxeof(struct vge_softc *, int);
-static void vge_setmulti(struct vge_softc *);
+static void vge_rxfilter(struct vge_softc *);
+static void vge_setvlan(struct vge_softc *);
static void vge_start(struct ifnet *);
static void vge_start_locked(struct ifnet *);
+static void vge_stats_clear(struct vge_softc *);
+static void vge_stats_update(struct vge_softc *);
static void vge_stop(struct vge_softc *);
+static void vge_sysctl_node(struct vge_softc *);
static int vge_tx_list_init(struct vge_softc *);
static void vge_txeof(struct vge_softc *);
static void vge_watchdog(void *);
@@ -504,38 +516,66 @@
return (error);
}
+static void
+vge_setvlan(struct vge_softc *sc)
+{
+ struct ifnet *ifp;
+ uint8_t cfg;
+
+ VGE_LOCK_ASSERT(sc);
+
+ ifp = sc->vge_ifp;
+ cfg = CSR_READ_1(sc, VGE_RXCFG);
+ if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
+ cfg |= VGE_VTAG_OPT2;
+ else
+ cfg &= ~VGE_VTAG_OPT2;
+ CSR_WRITE_1(sc, VGE_RXCFG, cfg);
+}
+
/*
* Program the multicast filter. We use the 64-entry CAM filter
* for perfect filtering. If there's more than 64 multicast addresses,
* we use the hash filter instead.
*/
static void
-vge_setmulti(struct vge_softc *sc)
+vge_rxfilter(struct vge_softc *sc)
{
struct ifnet *ifp;
- int error = 0/*, h = 0*/;
struct ifmultiaddr *ifma;
- uint32_t h, hashes[2] = { 0, 0 };
+ uint32_t h, hashes[2];
+ uint8_t rxcfg;
+ int error = 0;
VGE_LOCK_ASSERT(sc);
- ifp = sc->vge_ifp;
-
/* First, zot all the multicast entries. */
- vge_cam_clear(sc);
- CSR_WRITE_4(sc, VGE_MAR0, 0);
- CSR_WRITE_4(sc, VGE_MAR1, 0);
+ hashes[0] = 0;
+ hashes[1] = 0;
+ rxcfg = CSR_READ_1(sc, VGE_RXCTL);
+ rxcfg &= ~(VGE_RXCTL_RX_MCAST | VGE_RXCTL_RX_BCAST |
+ VGE_RXCTL_RX_PROMISC);
/*
- * If the user wants allmulti or promisc mode, enable reception
- * of all multicast frames.
+ * Always allow VLAN oversized frames and frames for
+ * this host.
*/
- if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
- CSR_WRITE_4(sc, VGE_MAR0, 0xFFFFFFFF);
- CSR_WRITE_4(sc, VGE_MAR1, 0xFFFFFFFF);
- return;
+ rxcfg |= VGE_RXCTL_RX_GIANT | VGE_RXCTL_RX_UCAST;
+
+ ifp = sc->vge_ifp;
+ if ((ifp->if_flags & IFF_BROADCAST) != 0)
+ rxcfg |= VGE_RXCTL_RX_BCAST;
+ if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
+ if ((ifp->if_flags & IFF_PROMISC) != 0)
+ rxcfg |= VGE_RXCTL_RX_PROMISC;
+ if ((ifp->if_flags & IFF_ALLMULTI) != 0) {
+ hashes[0] = 0xFFFFFFFF;
+ hashes[1] = 0xFFFFFFFF;
+ }
+ goto done;
}
+ vge_cam_clear(sc);
/* Now program new ones */
if_maddr_rlock(ifp);
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
@@ -561,11 +601,15 @@
else
hashes[1] |= (1 << (h - 32));
}
-
- CSR_WRITE_4(sc, VGE_MAR0, hashes[0]);
- CSR_WRITE_4(sc, VGE_MAR1, hashes[1]);
}
if_maddr_runlock(ifp);
+
+done:
+ if (hashes[0] != 0 || hashes[1] != 0)
+ rxcfg |= VGE_RXCTL_RX_MCAST;
+ CSR_WRITE_4(sc, VGE_MAR0, hashes[0]);
+ CSR_WRITE_4(sc, VGE_MAR1, hashes[1]);
+ CSR_WRITE_1(sc, VGE_RXCTL, rxcfg);
}
static void
@@ -1024,6 +1068,7 @@
else
sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) &
VGE_MIICFG_PHYADDR;
+ vge_sysctl_node(sc);
error = vge_dma_alloc(sc);
if (error)
goto fail;
@@ -1050,7 +1095,8 @@
ifp->if_capabilities = IFCAP_VLAN_MTU;
ifp->if_start = vge_start;
ifp->if_hwassist = VGE_CSUM_FEATURES;
- ifp->if_capabilities |= IFCAP_HWCSUM|IFCAP_VLAN_HWTAGGING;
+ ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM |
+ IFCAP_VLAN_HWTAGGING;
ifp->if_capenable = ifp->if_capabilities;
#ifdef DEVICE_POLLING
ifp->if_capabilities |= IFCAP_POLLING;
@@ -1664,7 +1710,6 @@
if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) {
vge_rxeof(sc, count);
- ifp->if_ierrors++;
CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN);
CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK);
}
@@ -1683,15 +1728,11 @@
uint32_t status;
sc = arg;
-
- if (sc->suspended) {
- return;
- }
+ VGE_LOCK(sc);
- VGE_LOCK(sc);
ifp = sc->vge_ifp;
-
- if (!(ifp->if_flags & IFF_UP)) {
+ if ((sc->vge_flags & VGE_FLAG_SUSPENDED) != 0 ||
+ (ifp->if_flags & IFF_UP) == 0) {
VGE_UNLOCK(sc);
return;
}
@@ -2000,7 +2041,8 @@
return;
}
vge_tx_list_init(sc);
-
+ /* Clear MAC statistics. */
+ vge_stats_clear(sc);
/* Set our station address */
for (i = 0; i < ETHER_ADDR_LEN; i++)
CSR_WRITE_1(sc, VGE_PAR0 + i, IF_LLADDR(sc->vge_ifp)[i]);
@@ -2010,7 +2052,7 @@
* reception of VLAN tagged frames.
*/
CSR_CLRBIT_1(sc, VGE_RXCFG, VGE_RXCFG_FIFO_THR|VGE_RXCFG_VTAGOPT);
- CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES|VGE_VTAG_OPT2);
+ CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES);
/* Set DMA burst length */
CSR_CLRBIT_1(sc, VGE_DMACFG0, VGE_DMACFG0_BURSTLEN);
@@ -2049,29 +2091,12 @@
/* Enable the TX descriptor queue */
CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_RUN0);
- /* Set up the receive filter -- allow large frames for VLANs. */
- CSR_WRITE_1(sc, VGE_RXCTL, VGE_RXCTL_RX_UCAST|VGE_RXCTL_RX_GIANT);
-
- /* If we want promiscuous mode, set the allframes bit. */
- if (ifp->if_flags & IFF_PROMISC) {
- CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC);
- }
-
- /* Set capture broadcast bit to capture broadcast frames. */
- if (ifp->if_flags & IFF_BROADCAST) {
- CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_BCAST);
- }
-
- /* Set multicast bit to capture multicast frames. */
- if (ifp->if_flags & IFF_MULTICAST) {
- CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_MCAST);
- }
-
/* Init the cam filter. */
vge_cam_clear(sc);
- /* Init the multicast filter. */
- vge_setmulti(sc);
+ /* Set up receiver filter. */
+ vge_rxfilter(sc);
+ vge_setvlan(sc);
/* Enable flow control */
@@ -2242,7 +2267,7 @@
struct vge_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *) data;
struct mii_data *mii;
- int error = 0;
+ int error = 0, mask;
switch (command) {
case SIOCSIFMTU:
@@ -2252,25 +2277,15 @@
break;
case SIOCSIFFLAGS:
VGE_LOCK(sc);
- if (ifp->if_flags & IFF_UP) {
- if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
- ifp->if_flags & IFF_PROMISC &&
- !(sc->vge_if_flags & IFF_PROMISC)) {
- CSR_SETBIT_1(sc, VGE_RXCTL,
- VGE_RXCTL_RX_PROMISC);
- vge_setmulti(sc);
- } else if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
- !(ifp->if_flags & IFF_PROMISC) &&
- sc->vge_if_flags & IFF_PROMISC) {
- CSR_CLRBIT_1(sc, VGE_RXCTL,
- VGE_RXCTL_RX_PROMISC);
- vge_setmulti(sc);
- } else
+ if ((ifp->if_flags & IFF_UP) != 0) {
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
+ ((ifp->if_flags ^ sc->vge_if_flags) &
+ (IFF_PROMISC | IFF_ALLMULTI)) != 0)
+ vge_rxfilter(sc);
+ else
vge_init_locked(sc);
- } else {
- if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- vge_stop(sc);
- }
+ } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ vge_stop(sc);
sc->vge_if_flags = ifp->if_flags;
VGE_UNLOCK(sc);
break;
@@ -2278,7 +2293,7 @@
case SIOCDELMULTI:
VGE_LOCK(sc);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- vge_setmulti(sc);
+ vge_rxfilter(sc);
VGE_UNLOCK(sc);
break;
case SIOCGIFMEDIA:
@@ -2287,8 +2302,7 @@
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
break;
case SIOCSIFCAP:
- {
- int mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+ mask = ifr->ifr_reqcap ^ ifp->if_capenable;
#ifdef DEVICE_POLLING
if (mask & IFCAP_POLLING) {
if (ifr->ifr_reqcap & IFCAP_POLLING) {
@@ -2325,8 +2339,16 @@
if ((mask & IFCAP_RXCSUM) != 0 &&
(ifp->if_capabilities & IFCAP_RXCSUM) != 0)
ifp->if_capenable ^= IFCAP_RXCSUM;
+ if ((mask & IFCAP_VLAN_HWCSUM) != 0 &&
+ (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0)
+ ifp->if_capenable ^= IFCAP_VLAN_HWCSUM;
+ if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
+ (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) {
+ ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
+ vge_setvlan(sc);
+ }
VGE_UNLOCK(sc);
- }
+ VLAN_CAPABILITIES(ifp);
break;
default:
error = ether_ioctl(ifp, command, data);
@@ -2344,6 +2366,7 @@
sc = arg;
VGE_LOCK_ASSERT(sc);
+ vge_stats_update(sc);
callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc);
if (sc->vge_timer == 0 || --sc->vge_timer > 0)
return;
@@ -2382,6 +2405,7 @@
CSR_WRITE_1(sc, VGE_RXQCSRC, 0xFF);
CSR_WRITE_4(sc, VGE_RXDESC_ADDR_LO, 0);
+ vge_stats_update(sc);
VGE_CHAIN_RESET(sc);
vge_txeof(sc);
vge_freebufs(sc);
@@ -2402,7 +2426,7 @@
VGE_LOCK(sc);
vge_stop(sc);
- sc->suspended = 1;
+ sc->vge_flags |= VGE_FLAG_SUSPENDED;
VGE_UNLOCK(sc);
return (0);
@@ -2432,7 +2456,7 @@
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
vge_init_locked(sc);
}
- sc->suspended = 0;
+ sc->vge_flags &= ~VGE_FLAG_SUSPENDED;
VGE_UNLOCK(sc);
return (0);
@@ -2455,3 +2479,223 @@
return (0);
}
+
+#define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \
+ SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d)
+
+static void
+vge_sysctl_node(struct vge_softc *sc)
+{
+ struct sysctl_ctx_list *ctx;
+ struct sysctl_oid_list *child, *parent;
+ struct sysctl_oid *tree;
+ struct vge_hw_stats *stats;
+
+ stats = &sc->vge_stats;
+ ctx = device_get_sysctl_ctx(sc->vge_dev);
+ child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev));
+ tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD,
+ NULL, "VGE statistics");
+ parent = SYSCTL_CHILDREN(tree);
+
+ /* Rx statistics. */
+ tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD,
+ NULL, "RX MAC statistics");
+ child = SYSCTL_CHILDREN(tree);
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames",
+ &stats->rx_frames, "frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames",
+ &stats->rx_good_frames, "Good frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows",
+ &stats->rx_fifo_oflows, "FIFO overflows");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "runts",
+ &stats->rx_runts, "Too short frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "runts_errs",
+ &stats->rx_runts_errs, "Too short frames with errors");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64",
+ &stats->rx_pkts_64, "64 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127",
+ &stats->rx_pkts_65_127, "65 to 127 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255",
+ &stats->rx_pkts_128_255, "128 to 255 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511",
+ &stats->rx_pkts_256_511, "256 to 511 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023",
+ &stats->rx_pkts_512_1023, "512 to 1023 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518",
+ &stats->rx_pkts_1024_1518, "1024 to 1518 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max",
+ &stats->rx_pkts_1519_max, "1519 to max frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max_errs",
+ &stats->rx_pkts_1519_max_errs, "1519 to max frames with error");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo",
+ &stats->rx_jumbos, "Jumbo frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "crcerrs",
+ &stats->rx_crcerrs, "CRC errors");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames",
+ &stats->rx_pause_frames, "CRC errors");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "align_errs",
+ &stats->rx_alignerrs, "Alignment errors");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "nobufs",
+ &stats->rx_nobufs, "Frames with no buffer event");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "sym_errs",
+ &stats->rx_symerrs, "Frames with symbol errors");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "len_errs",
+ &stats->rx_lenerrs, "Frames with length mismatched");
+
+ /* Tx statistics. */
+ tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD,
+ NULL, "TX MAC statistics");
+ child = SYSCTL_CHILDREN(tree);
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames",
+ &stats->tx_good_frames, "Good frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64",
+ &stats->tx_pkts_64, "64 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127",
+ &stats->tx_pkts_65_127, "65 to 127 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255",
+ &stats->tx_pkts_128_255, "128 to 255 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511",
+ &stats->tx_pkts_256_511, "256 to 511 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023",
+ &stats->tx_pkts_512_1023, "512 to 1023 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518",
+ &stats->tx_pkts_1024_1518, "1024 to 1518 bytes frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo",
+ &stats->tx_jumbos, "Jumbo frames");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "colls",
+ &stats->tx_colls, "Collisions");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "late_colls",
+ &stats->tx_latecolls, "Late collisions");
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames",
+ &stats->tx_pause, "Pause frames");
+#ifdef VGE_ENABLE_SQEERR
+ VGE_SYSCTL_STAT_ADD32(ctx, child, "sqeerrs",
+ &stats->tx_sqeerrs, "SQE errors");
+#endif
+ /* Clear MAC statistics. */
+ vge_stats_clear(sc);
+}
+
+#undef VGE_SYSCTL_STAT_ADD32
+
+static void
+vge_stats_clear(struct vge_softc *sc)
+{
+ int i;
+
+ VGE_LOCK_ASSERT(sc);
+
+ CSR_WRITE_1(sc, VGE_MIBCSR,
+ CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FREEZE);
+ CSR_WRITE_1(sc, VGE_MIBCSR,
+ CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_CLR);
+ for (i = VGE_TIMEOUT; i > 0; i--) {
+ DELAY(1);
+ if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_CLR) == 0)
+ break;
+ }
+ if (i == 0)
+ device_printf(sc->vge_dev, "MIB clear timed out!\n");
+ CSR_WRITE_1(sc, VGE_MIBCSR, CSR_READ_1(sc, VGE_MIBCSR) &
+ ~VGE_MIBCSR_FREEZE);
+}
+
+static void
+vge_stats_update(struct vge_softc *sc)
+{
+ struct vge_hw_stats *stats;
+ struct ifnet *ifp;
+ uint32_t mib[VGE_MIB_CNT], val;
+ int i;
+
+ VGE_LOCK_ASSERT(sc);
+
+ stats = &sc->vge_stats;
+ ifp = sc->vge_ifp;
+
+ CSR_WRITE_1(sc, VGE_MIBCSR,
+ CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FLUSH);
+ for (i = VGE_TIMEOUT; i > 0; i--) {
+ DELAY(1);
+ if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_FLUSH) == 0)
+ break;
+ }
+ if (i == 0) {
+ device_printf(sc->vge_dev, "MIB counter dump timed out!\n");
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list