Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 May 2010 10:54:42 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 177550 for review
Message-ID:  <201005011054.o41Asgrh082944@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@177550?ac=10

Change 177550 by mav@mav_mavtest on 2010/05/01 10:54:04

	IFC

Affected files ...

.. //depot/projects/scottl-camlock/src/contrib/telnet/telnet/commands.c#2 integrate
.. //depot/projects/scottl-camlock/src/contrib/telnet/telnet/externs.h#4 integrate
.. //depot/projects/scottl-camlock/src/contrib/telnet/telnet/network.c#2 integrate
.. //depot/projects/scottl-camlock/src/contrib/telnet/telnet/sys_bsd.c#2 integrate
.. //depot/projects/scottl-camlock/src/contrib/telnet/telnet/telnet.c#2 integrate
.. //depot/projects/scottl-camlock/src/contrib/telnet/telnet/terminal.c#2 integrate
.. //depot/projects/scottl-camlock/src/sbin/tunefs/tunefs.c#6 integrate
.. //depot/projects/scottl-camlock/src/share/man/man4/msk.4#8 integrate
.. //depot/projects/scottl-camlock/src/sys/compat/x86bios/x86bios.c#8 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/mii/e1000phy.c#14 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/mii/miidevs#20 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/msk/if_msk.c#22 integrate
.. //depot/projects/scottl-camlock/src/sys/dev/msk/if_mskreg.h#13 integrate
.. //depot/projects/scottl-camlock/src/sys/kern/subr_taskqueue.c#14 integrate
.. //depot/projects/scottl-camlock/src/sys/mips/mips/pmap.c#16 integrate
.. //depot/projects/scottl-camlock/src/sys/powerpc/booke/pmap.c#14 integrate
.. //depot/projects/scottl-camlock/src/sys/sys/_task.h#5 integrate
.. //depot/projects/scottl-camlock/src/sys/sys/taskqueue.h#8 integrate
.. //depot/projects/scottl-camlock/src/sys/vm/vm_contig.c#22 integrate
.. //depot/projects/scottl-camlock/src/sys/vm/vm_fault.c#33 integrate
.. //depot/projects/scottl-camlock/src/sys/vm/vm_object.c#24 integrate
.. //depot/projects/scottl-camlock/src/sys/vm/vm_page.h#16 integrate
.. //depot/projects/scottl-camlock/src/sys/vm/vm_pageout.c#22 integrate
.. //depot/projects/scottl-camlock/src/tools/tools/nanobsd/nanobsd.sh#8 integrate
.. //depot/projects/scottl-camlock/src/usr.bin/script/script.c#4 integrate
.. //depot/projects/scottl-camlock/src/usr.sbin/config/main.c#5 integrate

Differences ...

==== //depot/projects/scottl-camlock/src/contrib/telnet/telnet/commands.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
 #endif
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/contrib/telnet/telnet/commands.c,v 1.35 2005/02/28 12:46:52 tobez Exp $");
+__FBSDID("$FreeBSD: src/contrib/telnet/telnet/commands.c,v 1.36 2010/04/30 19:52:35 jilles Exp $");
 
 #include <sys/param.h>
 #include <sys/un.h>
@@ -2491,8 +2491,7 @@
 	env_export("USER");
     }
     (void) call(status, "status", "notmuch", 0);
-    if (setjmp(peerdied) == 0)
-	telnet(user);
+    telnet(user); 
     (void) NetClose(net);
     ExitString("Connection closed by foreign host.\n",1);
     /*NOTREACHED*/

==== //depot/projects/scottl-camlock/src/contrib/telnet/telnet/externs.h#4 (text+ko) ====

@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)externs.h	8.3 (Berkeley) 5/30/95
- *	$FreeBSD: src/contrib/telnet/telnet/externs.h,v 1.12 2009/11/28 11:57:25 ed Exp $
+ *	$FreeBSD: src/contrib/telnet/telnet/externs.h,v 1.13 2010/04/30 19:52:35 jilles Exp $
  */
 
 #ifndef	BSD
@@ -233,7 +233,6 @@
     SetNetTrace(char *);	/* Function to change where debugging goes */
 
 extern jmp_buf
-    peerdied,
     toplevel;		/* For error conditions. */
 
 extern void

==== //depot/projects/scottl-camlock/src/contrib/telnet/telnet/network.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
 #endif
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/contrib/telnet/telnet/network.c,v 1.7 2003/05/04 02:54:48 obrien Exp $");
+__FBSDID("$FreeBSD: src/contrib/telnet/telnet/network.c,v 1.8 2010/04/30 19:52:35 jilles Exp $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -158,7 +158,7 @@
 	    perror(hostname);
 	    (void)NetClose(net);
 	    ring_clear_mark(&netoring);
-	    longjmp(peerdied, -1);
+	    ExitString("Connection closed by foreign host.\n", 1);
 	    /*NOTREACHED*/
 	}
 	n = 0;

==== //depot/projects/scottl-camlock/src/contrib/telnet/telnet/sys_bsd.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
 #endif
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/contrib/telnet/telnet/sys_bsd.c,v 1.12 2003/05/04 02:54:48 obrien Exp $");
+__FBSDID("$FreeBSD: src/contrib/telnet/telnet/sys_bsd.c,v 1.13 2010/04/30 19:52:35 jilles Exp $");
 
 /*
  * The following routines try to encapsulate what is system dependent
@@ -809,14 +809,6 @@
  */
 
 /* ARGSUSED */
-static SIG_FUNC_RET
-deadpeer(int sig __unused)
-{
-	setcommandmode();
-	longjmp(peerdied, -1);
-}
-
-/* ARGSUSED */
 SIG_FUNC_RET
 intr(int sig __unused)
 {
@@ -884,7 +876,7 @@
 {
     (void) signal(SIGINT, intr);
     (void) signal(SIGQUIT, intr2);
-    (void) signal(SIGPIPE, deadpeer);
+    (void) signal(SIGPIPE, SIG_IGN);
 #ifdef	SIGWINCH
     (void) signal(SIGWINCH, sendwin);
 #endif

==== //depot/projects/scottl-camlock/src/contrib/telnet/telnet/telnet.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
 #endif
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/contrib/telnet/telnet/telnet.c,v 1.16 2005/03/28 14:45:12 nectar Exp $");
+__FBSDID("$FreeBSD: src/contrib/telnet/telnet/telnet.c,v 1.17 2010/04/30 19:52:35 jilles Exp $");
 
 #include <sys/types.h>
 
@@ -146,7 +146,6 @@
 #endif
 
 jmp_buf	toplevel;
-jmp_buf	peerdied;
 
 int	flushline;
 int	linemode;

==== //depot/projects/scottl-camlock/src/contrib/telnet/telnet/terminal.c#2 (text+ko) ====

@@ -37,7 +37,7 @@
 #endif
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/contrib/telnet/telnet/terminal.c,v 1.7 2003/05/04 02:54:48 obrien Exp $");
+__FBSDID("$FreeBSD: src/contrib/telnet/telnet/terminal.c,v 1.8 2010/04/30 19:52:35 jilles Exp $");
 
 #include <arpa/telnet.h>
 #include <sys/types.h>
@@ -111,7 +111,8 @@
 }
 
 /*
- *		Send as much data as possible to the terminal.
+ *		Send as much data as possible to the terminal, else exits if
+ *		it encounters a permanent failure when writing to the tty.
  *
  *		Return value:
  *			-1: No useful work done, data waiting to go out.
@@ -152,8 +153,19 @@
 	}
 	ring_consumed(&ttyoring, n);
     }
-    if (n < 0)
+    if (n < 0) {
+	if (errno == EAGAIN || errno == EINTR) {
+	    return -1;
+	} else {
+	    ring_consumed(&ttyoring, ring_full_count(&ttyoring));
+	    setconnmode(0);
+	    setcommandmode();
+	    NetClose(net);
+	    fprintf(stderr, "Write error on local output.\n");
+	    exit(1);
+	}
 	return -1;
+    }
     if (n == n0) {
 	if (n0)
 	    return -1;

==== //depot/projects/scottl-camlock/src/sbin/tunefs/tunefs.c#6 (text+ko) ====

@@ -39,7 +39,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sbin/tunefs/tunefs.c,v 1.47 2010/04/30 04:21:22 jeff Exp $");
+__FBSDID("$FreeBSD: src/sbin/tunefs/tunefs.c,v 1.48 2010/05/01 09:05:06 edwin Exp $");
 
 /*
  * tunefs: change layout parameters to an existing file system.
@@ -1007,10 +1007,11 @@
 void
 usage(void)
 {
-	fprintf(stderr, "%s\n%s\n%s\n%s\n",
+	fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
 "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]",
-"              [-J enable | disable ] [-L volname] [-l enable | disable]",
-"              [-m minfree] [-N enable | disable] [-n enable | disable]",
+"              [-J enable | disable] [-j enable | disable]", 
+"              [-L volname] [-l enable | disable] [-m minfree]",
+"              [-N enable | disable] [-n enable | disable]",
 "              [-o space | time] [-p] [-s avgfpdir] special | filesystem");
 	exit(2);
 }

==== //depot/projects/scottl-camlock/src/share/man/man4/msk.4#8 (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/man4/msk.4,v 1.13 2010/03/01 23:56:51 yongari Exp $
+.\" $FreeBSD: src/share/man/man4/msk.4,v 1.14 2010/04/30 19:05:01 yongari Exp $
 .\"
-.Dd March 1, 2010
+.Dd April 30, 2010
 .Dt MSK 4
 .Os
 .Sh NAME
@@ -208,6 +208,8 @@
 .It
 Marvell Yukon 88E8058 Gigabit Ethernet
 .It
+Marvell Yukon 88E8059 Gigabit Ethernet
+.It
 Marvell Yukon 88E8070 Gigabit Ethernet
 .It
 Marvell Yukon 88E8071 Gigabit Ethernet

==== //depot/projects/scottl-camlock/src/sys/compat/x86bios/x86bios.c#8 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/x86bios/x86bios.c,v 1.15 2010/03/25 17:14:47 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/x86bios/x86bios.c,v 1.17 2010/05/01 01:05:07 jkim Exp $");
 
 #include "opt_x86bios.h"
 
@@ -47,11 +47,15 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-#include <machine/cpufunc.h>
+#include <machine/iodev.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
 
+#if defined(__amd64__) || defined(__i386__)
+#define	X86BIOS_NATIVE_ARCH
+#endif
+
 #define	X86BIOS_PAGE_SIZE	0x00001000	/* 4K */
 
 #define	X86BIOS_IVT_SIZE	0x00000500	/* 1K + 256 (BDA) */
@@ -236,27 +240,49 @@
 	if (port >= 0x80 && port < 0x88) /* POST status register */
 		return (0);
 
-	return (inb(port));
+	return (iodev_read_1(port));
 }
 
 static uint16_t
 x86bios_emu_inw(struct x86emu *emu, uint16_t port)
 {
+	uint16_t val;
 
 	if (port >= 0x80 && port < 0x88) /* POST status register */
 		return (0);
 
-	return (inw(port));
+#ifndef X86BIOS_NATIVE_ARCH
+	if ((port & 1) != 0) {
+		val = iodev_read_1(port);
+		val |= iodev_read_1(port + 1) << 8;
+	} else
+#endif
+	val = iodev_read_2(port);
+
+	return (val);
 }
 
 static uint32_t
 x86bios_emu_inl(struct x86emu *emu, uint16_t port)
 {
+	uint32_t val;
 
 	if (port >= 0x80 && port < 0x88) /* POST status register */
 		return (0);
 
-	return (inl(port));
+#ifndef X86BIOS_NATIVE_ARCH
+	if ((port & 1) != 0) {
+		val = iodev_read_1(port);
+		val |= iodev_read_2(port + 1) << 8;
+		val |= iodev_read_1(port + 3) << 24;
+	} else if ((port & 2) != 0) {
+		val = iodev_read_2(port);
+		val |= iodev_read_2(port + 2) << 16;
+	} else
+#endif
+	val = iodev_read_4(port);
+
+	return (val);
 }
 
 static void
@@ -268,7 +294,7 @@
 	if (port >= 0x80 && port < 0x88) /* POST status register */
 		return;
 
-	outb(port, val);
+	iodev_write_1(port, val);
 }
 
 static void
@@ -278,7 +304,13 @@
 	if (port >= 0x80 && port < 0x88) /* POST status register */
 		return;
 
-	outw(port, val);
+#ifndef X86BIOS_NATIVE_ARCH
+	if ((port & 1) != 0) {
+		iodev_write_1(port, val);
+		iodev_write_1(port + 1, val >> 8);
+	} else
+#endif
+	iodev_write_2(port, val);
 }
 
 static void
@@ -288,7 +320,17 @@
 	if (port >= 0x80 && port < 0x88) /* POST status register */
 		return;
 
-	outl(port, val);
+#ifndef X86BIOS_NATIVE_ARCH
+	if ((port & 1) != 0) {
+		iodev_write_1(port, val);
+		iodev_write_2(port + 1, val >> 8);
+		iodev_write_1(port + 3, val >> 24);
+	} else if ((port & 2) != 0) {
+		iodev_write_2(port, val);
+		iodev_write_2(port + 2, val >> 16);
+	} else
+#endif
+	iodev_write_4(port, val);
 }
 
 static void
@@ -484,45 +526,53 @@
 	return (1);
 }
 
-#if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
-#define	PROBE_EBDA	1
+static __inline void
+x86bios_unmap_mem(void)
+{
+
+	if (x86bios_ivt != NULL)
+#ifdef X86BIOS_NATIVE_ARCH
+		pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE);
 #else
-#define	PROBE_EBDA	0
+		free(x86bios_ivt, M_DEVBUF);
 #endif
+	if (x86bios_rom != NULL)
+		pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE);
+	if (x86bios_seg != NULL)
+		contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF);
+}
 
 static __inline int
 x86bios_map_mem(void)
 {
 
+#ifdef X86BIOS_NATIVE_ARCH
 	x86bios_ivt = pmap_mapbios(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE);
-	if (x86bios_ivt == NULL)
-		return (1);
 
-#if PROBE_EBDA
+#ifndef PC98
 	/* Probe EBDA via BDA. */
-	x86bios_rom_phys = *(uint16_t *)((vm_offset_t)x86bios_ivt + 0x40e);
-	x86bios_rom_phys = le16toh(x86bios_rom_phys) << 4;
+	x86bios_rom_phys = *(uint16_t *)((caddr_t)x86bios_ivt + 0x40e);
+	x86bios_rom_phys = x86bios_rom_phys << 4;
 	if (x86bios_rom_phys != 0 && x86bios_rom_phys < X86BIOS_ROM_BASE &&
 	    X86BIOS_ROM_BASE - x86bios_rom_phys <= 128 * 1024)
 		x86bios_rom_phys =
 		    rounddown(x86bios_rom_phys, X86BIOS_PAGE_SIZE);
 	else
 #endif
+#else
+	x86bios_ivt = malloc(X86BIOS_IVT_SIZE, M_DEVBUF, M_ZERO | M_WAITOK);
+#endif
+
 	x86bios_rom_phys = X86BIOS_ROM_BASE;
 	x86bios_rom = pmap_mapdev(x86bios_rom_phys, X86BIOS_ROM_SIZE);
-	if (x86bios_rom == NULL) {
-		pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE);
-		return (1);
-	}
-#if PROBE_EBDA
+	if (x86bios_rom == NULL)
+		goto fail;
+#if defined(X86BIOS_NATIVE_ARCH) && !defined(PC98)
 	/* Change attribute for EBDA. */
 	if (x86bios_rom_phys < X86BIOS_ROM_BASE &&
 	    pmap_change_attr((vm_offset_t)x86bios_rom,
-	    X86BIOS_ROM_BASE - x86bios_rom_phys, PAT_WRITE_BACK) != 0) {
-		pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE);
-		pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE);
-		return (1);
-	}
+	    X86BIOS_ROM_BASE - x86bios_rom_phys, PAT_WRITE_BACK) != 0)
+		goto fail;
 #endif
 
 	x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK,
@@ -537,12 +587,10 @@
 		    (uint32_t)x86bios_seg_phys,
 		    X86BIOS_SEG_SIZE + (uint32_t)x86bios_seg_phys - 1,
 		    x86bios_seg);
-#if PROBE_EBDA
 		if (x86bios_rom_phys < X86BIOS_ROM_BASE)
 			printf("x86bios:  EBDA 0x%06x-0x%06x at %p\n",
 			    (uint32_t)x86bios_rom_phys, X86BIOS_ROM_BASE - 1,
 			    x86bios_rom);
-#endif
 		printf("x86bios:   ROM 0x%06x-0x%06x at %p\n",
 		    X86BIOS_ROM_BASE, X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE - 1,
 		    (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_BASE -
@@ -550,29 +598,23 @@
 	}
 
 	return (0);
-}
 
-#undef PROBE_EBDA
+fail:
+	x86bios_unmap_mem();
 
-static __inline void
-x86bios_unmap_mem(void)
-{
-
-	pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE);
-	pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE);
-	contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF);
+	return (1);
 }
 
-static void
-x86bios_init(void *arg __unused)
+static int
+x86bios_init(void)
 {
 	int i;
 
+	if (x86bios_map_mem() != 0)
+		return (ENOMEM);
+
 	mtx_init(&x86bios_lock, "x86bios lock", NULL, MTX_SPIN);
 
-	if (x86bios_map_mem() != 0)
-		return;
-
 	x86bios_map = malloc(sizeof(*x86bios_map) * X86BIOS_PAGES, M_DEVBUF,
 	    M_WAITOK | M_ZERO);
 	x86bios_set_pages((vm_offset_t)x86bios_ivt, X86BIOS_IVT_BASE,
@@ -600,10 +642,12 @@
 
 	for (i = 0; i < 256; i++)
 		x86bios_emu._x86emu_intrTab[i] = x86bios_emu_get_intr;
+
+	return (0);
 }
 
-static void
-x86bios_uninit(void *arg __unused)
+static int
+x86bios_uninit(void)
 {
 	vm_offset_t *map = x86bios_map;
 
@@ -618,6 +662,8 @@
 		x86bios_unmap_mem();
 
 	mtx_destroy(&x86bios_lock);
+
+	return (0);
 }
 
 static int
@@ -626,16 +672,12 @@
 
 	switch (type) {
 	case MOD_LOAD:
-		x86bios_init(NULL);
-		break;
+		return (x86bios_init());
 	case MOD_UNLOAD:
-		x86bios_uninit(NULL);
-		break;
+		return (x86bios_uninit());
 	default:
 		return (ENOTSUP);
 	}
-
-	return (0);
 }
 
 static moduledata_t x86bios_mod = {

==== //depot/projects/scottl-camlock/src/sys/dev/mii/e1000phy.c#14 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mii/e1000phy.c,v 1.35 2010/03/03 17:56:52 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mii/e1000phy.c,v 1.36 2010/04/30 19:01:55 yongari Exp $");
 
 /*
  * driver for the Marvell 88E1000 series external 1000/100/10-BT PHY.
@@ -112,6 +112,7 @@
 	MII_PHY_DESC(MARVELL, E1116R),
 	MII_PHY_DESC(MARVELL, E1118),
 	MII_PHY_DESC(MARVELL, E3016),
+	MII_PHY_DESC(MARVELL, PHYG65G),
 	MII_PHY_DESC(xxMARVELL, E1000),
 	MII_PHY_DESC(xxMARVELL, E1011),
 	MII_PHY_DESC(xxMARVELL, E1000_3),
@@ -230,6 +231,7 @@
 		case MII_MODEL_MARVELL_E1116:
 		case MII_MODEL_MARVELL_E1118:
 		case MII_MODEL_MARVELL_E1149:
+		case MII_MODEL_MARVELL_PHYG65G:
 			/* Disable energy detect mode. */
 			reg &= ~E1000_SCR_EN_DETECT_MASK;
 			reg |= E1000_SCR_AUTO_X_MODE;

==== //depot/projects/scottl-camlock/src/sys/dev/mii/miidevs#20 (text+ko) ====

@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/dev/mii/miidevs,v 1.71 2010/04/13 20:07:52 yongari Exp $
+$FreeBSD: src/sys/dev/mii/miidevs,v 1.72 2010/04/30 19:01:55 yongari Exp $
 /*$NetBSD: miidevs,v 1.6 1999/05/14 11:37:30 drochner Exp $*/
 
 /*-
@@ -247,6 +247,7 @@
 model MARVELL E1116R		0x0024 Marvell 88E1116R Gigabit PHY
 model MARVELL E1118		0x0022 Marvell 88E1118 Gigabit PHY
 model MARVELL E3016		0x0026 Marvell 88E3016 10/100 Fast Ethernet PHY
+model MARVELL PHYG65G		0x0027 Marvell PHYG65G Gigabit PHY
 model xxMARVELL E1000		0x0005 Marvell 88E1000 Gigabit PHY
 model xxMARVELL E1011		0x0002 Marvell 88E1011 Gigabit PHY
 model xxMARVELL E1000_3		0x0003 Marvell 88E1000 Gigabit PHY

==== //depot/projects/scottl-camlock/src/sys/dev/msk/if_msk.c#22 (text+ko) ====

@@ -99,7 +99,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/msk/if_msk.c,v 1.94 2010/04/30 00:34:00 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/msk/if_msk.c,v 1.96 2010/04/30 18:58:55 yongari Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -223,6 +223,8 @@
 	    "Marvell Yukon 88E8072 Gigabit Ethernet" },
 	{ VENDORID_MARVELL, DEVICEID_MRVL_4380,
 	    "Marvell Yukon 88E8057 Gigabit Ethernet" },
+	{ VENDORID_MARVELL, DEVICEID_MRVL_4381,
+	    "Marvell Yukon 88E8059 Gigabit Ethernet" },
 	{ VENDORID_DLINK, DEVICEID_DLINK_DGE550SX,
 	    "D-Link 550SX Gigabit Ethernet" },
 	{ VENDORID_DLINK, DEVICEID_DLINK_DGE560SX,
@@ -239,7 +241,9 @@
         "Yukon FE",
         "Yukon FE+",
         "Yukon Supreme",
-        "Yukon Ultra 2"
+        "Yukon Ultra 2",
+        "Yukon Unknown",
+        "Yukon Optima",
 };
 
 static int mskc_probe(device_t);
@@ -1229,6 +1233,7 @@
 		case CHIP_ID_YUKON_EX:
 		case CHIP_ID_YUKON_FE_P:
 		case CHIP_ID_YUKON_UL_2:
+		case CHIP_ID_YUKON_OPT:
 			CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF);
 
 			/* Enable all clocks. */
@@ -1372,6 +1377,10 @@
 			    GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON |
 			    GMC_BYP_RETR_ON);
 	}
+	if (sc->msk_hw_id == CHIP_ID_YUKON_OPT && sc->msk_hw_rev == 0) {
+		/* Disable PCIe PHY powerdown(reg 0x80, bit7). */
+		CSR_WRITE_4(sc, Y2_PEX_PHY_DATA, (0x0080 << 16) | 0x0080);
+	}
 	CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
 
 	/* LED On. */
@@ -1705,8 +1714,9 @@
 	sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f;
 	/* Bail out if chip is not recognized. */
 	if (sc->msk_hw_id < CHIP_ID_YUKON_XL ||
-	    sc->msk_hw_id > CHIP_ID_YUKON_UL_2 ||
-	    sc->msk_hw_id == CHIP_ID_YUKON_SUPR) {
+	    sc->msk_hw_id > CHIP_ID_YUKON_OPT ||
+	    sc->msk_hw_id == CHIP_ID_YUKON_SUPR ||
+	    sc->msk_hw_id == CHIP_ID_YUKON_UNKNOWN) {
 		device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n",
 		    sc->msk_hw_id, sc->msk_hw_rev);
 		mtx_destroy(&sc->msk_mtx);
@@ -1819,6 +1829,10 @@
 		sc->msk_clock = 125;	/* 125 MHz */
 		sc->msk_pflags |= MSK_FLAG_JUMBO;
 		break;
+	case CHIP_ID_YUKON_OPT:
+		sc->msk_clock = 125;	/* 125 MHz */
+		sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2;
+		break;
 	default:
 		sc->msk_clock = 156;	/* 156 MHz */
 		break;
@@ -3917,6 +3931,11 @@
 		msk_stop(sc_if);
 		return;
 	}
+	if (sc->msk_hw_id == CHIP_ID_YUKON_EX) {
+		/* Disable flushing of non-ASF packets. */
+		CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T),
+		    GMF_RX_MACSEC_FLUSH_OFF);
+	}
 
 	/* Configure interrupt handling. */
 	if (sc_if->msk_port == MSK_PORT_A) {

==== //depot/projects/scottl-camlock/src/sys/dev/msk/if_mskreg.h#13 (text+ko) ====

@@ -93,7 +93,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/*$FreeBSD: src/sys/dev/msk/if_mskreg.h,v 1.38 2010/04/30 00:34:00 yongari Exp $*/
+/*$FreeBSD: src/sys/dev/msk/if_mskreg.h,v 1.40 2010/04/30 18:58:55 yongari Exp $*/
 
 /*
  * SysKonnect PCI vendor ID
@@ -145,6 +145,7 @@
 #define DEVICEID_MRVL_436B	0x436B
 #define DEVICEID_MRVL_436C	0x436C
 #define DEVICEID_MRVL_4380	0x4380
+#define DEVICEID_MRVL_4381	0x4381
 
 /*
  * D-Link gigabit ethernet device ID
@@ -828,6 +829,9 @@
 #define Y2_IS_CHK_RX2	BIT_10	/* Descriptor error Rx 2 */
 #define Y2_IS_CHK_TXS2	BIT_9	/* Descriptor error TXS 2 */
 #define Y2_IS_CHK_TXA2	BIT_8	/* Descriptor error TXA 2 */
+#define Y2_IS_PSM_ACK	BIT_7	/* PSM Ack (Yukon Optima) */
+#define Y2_IS_PTP_TIST	BIT_6	/* PTP TIme Stamp (Yukon Optima) */
+#define Y2_IS_PHY_QLNK	BIT_5	/* PHY Quick Link (Yukon Optima) */
 #define Y2_IS_IRQ_PHY1	BIT_4	/* Interrupt from PHY 1 */
 #define Y2_IS_IRQ_MAC1	BIT_3	/* Interrupt from MAC 1 */
 #define Y2_IS_CHK_RX1	BIT_2	/* Descriptor error Rx 1 */
@@ -894,6 +898,8 @@
 #define CHIP_ID_YUKON_FE_P	0xb8 /* Chip ID for YUKON-2 FE+ */
 #define CHIP_ID_YUKON_SUPR	0xb9 /* Chip ID for YUKON-2 Supreme */
 #define CHIP_ID_YUKON_UL_2	0xba /* Chip ID for YUKON-2 Ultra 2 */
+#define CHIP_ID_YUKON_UNKNOWN	0xbb
+#define CHIP_ID_YUKON_OPT	0xbc /* Chip ID for YUKON-2 Optima */
 
 #define	CHIP_REV_YU_XL_A0	0 /* Chip Rev. for Yukon-2 A0 */
 #define	CHIP_REV_YU_XL_A1	1 /* Chip Rev. for Yukon-2 A1 */
@@ -1941,6 +1947,8 @@
 #define RX_TRUNC_OFF		BIT_26	/* disable packet truncation */
 #define RX_VLAN_STRIP_ON	BIT_25	/* enable  VLAN stripping */
 #define RX_VLAN_STRIP_OFF	BIT_24	/* disable VLAN stripping */
+#define GMF_RX_MACSEC_FLUSH_ON	BIT_23
+#define GMF_RX_MACSEC_FLUSH_OFF	BIT_22
 #define GMF_RX_OVER_ON		BIT_19	/* enable flushing on receive overrun */
 #define GMF_RX_OVER_OFF		BIT_18	/* disable flushing on receive overrun */
 #define GMF_ASF_RX_OVER_ON	BIT_17	/* enable flushing of ASF when overrun */

==== //depot/projects/scottl-camlock/src/sys/kern/subr_taskqueue.c#14 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.52 2009/10/23 15:14:54 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/subr_taskqueue.c,v 1.53 2010/04/30 16:29:05 zml Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -51,7 +51,6 @@
 	const char		*tq_name;
 	taskqueue_enqueue_fn	tq_enqueue;
 	void			*tq_context;
-	struct task		*tq_running;
 	struct mtx		tq_mutex;
 	struct thread		**tq_threads;
 	int			tq_tcount;
@@ -233,13 +232,13 @@
 		STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link);
 		pending = task->ta_pending;
 		task->ta_pending = 0;
-		queue->tq_running = task;
+		task->ta_flags |= TA_FLAGS_RUNNING;
 		TQ_UNLOCK(queue);
 
 		task->ta_func(task->ta_context, pending);
 
 		TQ_LOCK(queue);
-		queue->tq_running = NULL;
+		task->ta_flags &= ~TA_FLAGS_RUNNING;
 		wakeup(task);
 	}
 
@@ -256,14 +255,16 @@
 {
 	if (queue->tq_spin) {		/* XXX */
 		mtx_lock_spin(&queue->tq_mutex);
-		while (task->ta_pending != 0 || task == queue->tq_running)
+		while (task->ta_pending != 0 ||
+		    (task->ta_flags & TA_FLAGS_RUNNING) != 0)
 			msleep_spin(task, &queue->tq_mutex, "-", 0);
 		mtx_unlock_spin(&queue->tq_mutex);
 	} else {
 		WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);
 
 		mtx_lock(&queue->tq_mutex);
-		while (task->ta_pending != 0 || task == queue->tq_running)
+		while (task->ta_pending != 0 ||
+		    (task->ta_flags & TA_FLAGS_RUNNING) != 0)
 			msleep(task, &queue->tq_mutex, PWAIT, "-", 0);
 		mtx_unlock(&queue->tq_mutex);
 	}

==== //depot/projects/scottl-camlock/src/sys/mips/mips/pmap.c#16 (text+ko) ====

@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/mips/mips/pmap.c,v 1.43 2010/04/30 00:46:43 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/mips/mips/pmap.c,v 1.44 2010/04/30 17:12:20 rrs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_msgbuf.h"
@@ -236,7 +236,7 @@
 	sched_pin();							\
 	va1 = sysm->base;						\
 	va2 = sysm->base + PAGE_SIZE;					\
-	npte = mips_paddr_to_tlbpfn(phys2) |				\
+	npte = mips_paddr_to_tlbpfn(phys1) |				\
 	    PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE;			\
 	pte = pmap_pte(kernel_pmap, va1);				\
 	*pte = npte;							\

==== //depot/projects/scottl-camlock/src/sys/powerpc/booke/pmap.c#14 (text+ko) ====

@@ -49,7 +49,7 @@
   */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/powerpc/booke/pmap.c,v 1.24 2010/04/30 00:46:43 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/powerpc/booke/pmap.c,v 1.25 2010/04/30 15:22:52 alc Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1915,16 +1915,11 @@
 				tlb_miss_lock();
 
 				/* Handle modified pages. */
-				if (PTE_ISMODIFIED(pte))
+				if (PTE_ISMODIFIED(pte) && PTE_ISMANAGED(pte))
 					vm_page_dirty(m);
 
-				/* Referenced pages. */
-				if (PTE_ISREFERENCED(pte))
-					vm_page_flag_set(m, PG_REFERENCED);
-
 				tlb0_flush_entry(va);
-				pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED |
-				    PTE_REFERENCED);
+				pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED);
 
 				tlb_miss_unlock();
 				mtx_unlock_spin(&tlbivax_mutex);
@@ -1962,13 +1957,8 @@
 				if (PTE_ISMODIFIED(pte))
 					vm_page_dirty(m);
 
-				/* Referenced pages. */
-				if (PTE_ISREFERENCED(pte))
-					vm_page_flag_set(m, PG_REFERENCED);
-
 				/* Flush mapping from TLB0. */
-				pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED |
-				    PTE_REFERENCED);
+				pte->flags &= ~(PTE_UW | PTE_SW | PTE_MODIFIED);
 
 				tlb_miss_unlock();
 				mtx_unlock_spin(&tlbivax_mutex);

==== //depot/projects/scottl-camlock/src/sys/sys/_task.h#5 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/_task.h,v 1.6 2008/07/18 06:22:57 kmacy Exp $
+ * $FreeBSD: src/sys/sys/_task.h,v 1.7 2010/04/30 16:29:05 zml Exp $
  */
 
 #ifndef _SYS__TASK_H_
@@ -36,15 +36,21 @@
  * taskqueue_run().  The first argument is taken from the 'ta_context'
  * field of struct task and the second argument is a count of how many
  * times the task was enqueued before the call to taskqueue_run().
+ *
+ * List of locks
+ * (c)	const after init
+ * (q)	taskqueue lock
  */
 typedef void task_fn_t(void *context, int pending);
 
 struct task {
-	STAILQ_ENTRY(task) ta_link;	/* link for queue */
-	u_short	ta_pending;		/* count times queued */
-	u_short	ta_priority;		/* Priority */
-	task_fn_t *ta_func;		/* task handler */
-	void	*ta_context;		/* argument for handler */
+	STAILQ_ENTRY(task) ta_link;	/* (q) link for queue */
+	u_int	ta_flags;		/* (q) state of this task */
+#define	TA_FLAGS_RUNNING	0x01
+	u_short	ta_pending;		/* (q) count times queued */
+	u_short	ta_priority;		/* (c) Priority */
+	task_fn_t *ta_func;		/* (c) task handler */
+	void	*ta_context;		/* (c) argument for handler */
 };
 
 #endif /* !_SYS__TASK_H_ */

==== //depot/projects/scottl-camlock/src/sys/sys/taskqueue.h#8 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/taskqueue.h,v 1.22 2009/08/18 13:55:48 pjd Exp $
+ * $FreeBSD: src/sys/sys/taskqueue.h,v 1.23 2010/04/30 16:29:05 zml Exp $
  */
 
 #ifndef _SYS_TASKQUEUE_H_
@@ -75,6 +75,7 @@
 	(task)->ta_priority = (priority);		\
 	(task)->ta_func = (func);			\
 	(task)->ta_context = (context);			\
+	(task)->ta_flags = 0;				\
 } while (0)
 
 /*

==== //depot/projects/scottl-camlock/src/sys/vm/vm_contig.c#22 (text+ko) ====

@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_contig.c,v 1.75 2010/04/30 00:46:43 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_contig.c,v 1.76 2010/04/30 21:20:14 kmacy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -96,30 +96,33 @@
 	vm_page_t m_tmp;
 	struct vnode *vp;
 	struct mount *mp;
-	int vfslocked;
+	int vfslocked, dirty;
 
-	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	vm_page_lock(m);
+	vm_page_lock_queues();
 	object = m->object;
 	if (!VM_OBJECT_TRYLOCK(object) &&
 	    !vm_pageout_fallback_object_lock(m, next)) {
 		VM_OBJECT_UNLOCK(object);
+		vm_page_unlock_queues();
+		vm_page_unlock(m);
 		return (EAGAIN);
 	}
 	if (vm_page_sleep_if_busy(m, TRUE, "vpctw0")) {
 		VM_OBJECT_UNLOCK(object);
-		vm_page_lock_queues();
 		return (EBUSY);
 	}
 	vm_page_test_dirty(m);
 	if (m->dirty == 0 && m->hold_count == 0)
 		pmap_remove_all(m);
-	if (m->dirty) {
+	if ((dirty = m->dirty) != 0) {
+		vm_page_unlock_queues();
+		vm_page_unlock(m);
 		if ((object->flags & OBJ_DEAD) != 0) {
 			VM_OBJECT_UNLOCK(object);
 			return (EAGAIN);
 		}
 		if (object->type == OBJT_VNODE) {
-			vm_page_unlock_queues();
 			vp = object->handle;
 			vm_object_reference_locked(object);
 			VM_OBJECT_UNLOCK(object);
@@ -133,7 +136,6 @@
 			VFS_UNLOCK_GIANT(vfslocked);
 			vm_object_deallocate(object);
 			vn_finished_write(mp);
-			vm_page_lock_queues();
 			return (0);
 		} else if (object->type == OBJT_SWAP ||
 			   object->type == OBJT_DEFAULT) {
@@ -144,6 +146,11 @@
 		}
 	} else if (m->hold_count == 0)
 		vm_page_cache(m);
+
+	if (dirty == 0) {
+		vm_page_unlock_queues();
+		vm_page_unlock(m);
+	}
 	VM_OBJECT_UNLOCK(object);
 	return (0);
 }
@@ -162,7 +169,9 @@
 
 		KASSERT(VM_PAGE_INQUEUE2(m, queue),
 		    ("vm_contig_launder: page %p's queue is not %d", m, queue));
+		vm_page_unlock_queues();
 		error = vm_contig_launder_page(m, &next);
+		vm_page_lock_queues();
 		if (error == 0)
 			return (TRUE);
 		if (error == EBUSY)

==== //depot/projects/scottl-camlock/src/sys/vm/vm_fault.c#33 (text+ko) ====

@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.268 2010/04/30 00:46:43 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/vm_fault.c,v 1.269 2010/04/30 16:20:14 kib Exp $");
 
 #include "opt_vm.h"
 
@@ -1284,19 +1284,19 @@
 			vm_page_lock_queues();
 			vm_page_unwire(src_m, 0);
 			vm_page_unlock_queues();
-			vm_page_lock(src_m);
+			vm_page_unlock(src_m);
 
 			vm_page_lock(dst_m);
 			vm_page_lock_queues();

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005011054.o41Asgrh082944>