svn commit: r218792 - in head: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/modules sys/modules/cxgbe usr.sbin/sysinstall

2011-02-18 Thread Navdeep Parhar
Author: np
Date: Fri Feb 18 08:00:26 2011
New Revision: 218792
URL: http://svn.freebsd.org/changeset/base/218792

Log:
  cxgbe(4) - NIC driver for Chelsio T4 (Terminator 4) based 10Gb/1Gb adapters.
  
  MFC after:3 weeks

Added:
  head/share/man/man4/cxgbe.4   (contents, props changed)
  head/sys/dev/cxgbe/
  head/sys/dev/cxgbe/adapter.h   (contents, props changed)
  head/sys/dev/cxgbe/common/
  head/sys/dev/cxgbe/common/common.h   (contents, props changed)
  head/sys/dev/cxgbe/common/t4_hw.c   (contents, props changed)
  head/sys/dev/cxgbe/common/t4_hw.h   (contents, props changed)
  head/sys/dev/cxgbe/common/t4_msg.h   (contents, props changed)
  head/sys/dev/cxgbe/common/t4_regs.h   (contents, props changed)
  head/sys/dev/cxgbe/common/t4_regs_values.h   (contents, props changed)
  head/sys/dev/cxgbe/common/t4_tcb.h   (contents, props changed)
  head/sys/dev/cxgbe/common/t4fw_interface.h   (contents, props changed)
  head/sys/dev/cxgbe/offload.h   (contents, props changed)
  head/sys/dev/cxgbe/osdep.h   (contents, props changed)
  head/sys/dev/cxgbe/t4_ioctl.h   (contents, props changed)
  head/sys/dev/cxgbe/t4_main.c   (contents, props changed)
  head/sys/dev/cxgbe/t4_sge.c   (contents, props changed)
  head/sys/modules/cxgbe/
  head/sys/modules/cxgbe/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/altq.4
  head/share/man/man4/vlan.4
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/kern.pre.mk
  head/sys/modules/Makefile
  head/usr.sbin/sysinstall/devices.c

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileFri Feb 18 07:37:30 2011
(r218791)
+++ head/share/man/man4/MakefileFri Feb 18 08:00:26 2011
(r218792)
@@ -83,6 +83,7 @@ MAN=  aac.4 \
crypto.4 \
cue.4 \
cxgb.4 \
+   cxgbe.4 \
cy.4 \
da.4 \
dc.4 \

Modified: head/share/man/man4/altq.4
==
--- head/share/man/man4/altq.4  Fri Feb 18 07:37:30 2011(r218791)
+++ head/share/man/man4/altq.4  Fri Feb 18 08:00:26 2011(r218792)
@@ -127,6 +127,7 @@ They have been applied to the following 
 .Xr bfe 4 ,
 .Xr bge 4 ,
 .Xr cas 4 ,
+.Xr cxgbe 4 ,
 .Xr dc 4 ,
 .Xr de 4 ,
 .Xr ed 4 ,

Added: head/share/man/man4/cxgbe.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/cxgbe.4 Fri Feb 18 08:00:26 2011(r218792)
@@ -0,0 +1,167 @@
+.\ Copyright (c) 2011, Chelsio Inc
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions are met:
+.\
+.\ 1. Redistributions of source code must retain the above copyright notice,
+.\this list of conditions and the following disclaimer.
+.\
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ 3. Neither the name of the Chelsio Inc nor the names of its
+.\contributors may be used to endorse or promote products derived from
+.\this software without specific prior written permission.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
+.\ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+.\ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
+.\ * Other names and brands may be claimed as the property of others.
+.\
+.\ $FreeBSD$
+.\
+.Dd February 14, 2011
+.Dt CXGBE 4
+.Os
+.Sh NAME
+.Nm cxgbe
+.Nd Chelsio T4 10Gb and 1Gb Ethernet adapter driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd device cxgbe
+.Ed
+.Pp
+To load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_cxgbe_load=YES
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for PCI Express Ethernet adapters based on
+the Chelsio Terminator 4 (T4) ASIC.
+The driver supprts Jumbo Frames, Transmit/Receive 

svn commit: r218794 - in head: . sys/netipsec

2011-02-18 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Fri Feb 18 09:40:13 2011
New Revision: 218794
URL: http://svn.freebsd.org/changeset/base/218794

Log:
  Fixed IPsec's HMAC_SHA256-512 support to be RFC4868 compliant.
  This will break interoperability with all older versions of
  FreeBSD for those algorithms.
  
  Reviewed by:  bz, gnn
  Obtained from:NETASQ
  MFC after:1w

Modified:
  head/UPDATING
  head/sys/netipsec/key.c
  head/sys/netipsec/xform.h
  head/sys/netipsec/xform_ah.c
  head/sys/netipsec/xform_esp.c

Modified: head/UPDATING
==
--- head/UPDATING   Fri Feb 18 08:38:24 2011(r218793)
+++ head/UPDATING   Fri Feb 18 09:40:13 2011(r218794)
@@ -9,6 +9,16 @@ handbook.
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running portupgrade.
 
+20110218:
+   IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868
+   compliant, and will now use half of hash for authentication.
+   This will break interoperability with all stacks (including all
+   actual FreeBSD versions) who implement
+   draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for
+   authentication).
+   The only workaround with such peers is to use another HMAC
+   algorithm for IPsec (phase 2) authentication.
+
 NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
FreeBSD 9.x has many debugging features turned on, in both the kernel
and userland.  These features attempt to detect incorrect use of

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Fri Feb 18 08:38:24 2011(r218793)
+++ head/sys/netipsec/key.c Fri Feb 18 09:40:13 2011(r218794)
@@ -6095,6 +6095,9 @@ key_getsizes_ah(
case SADB_X_AALG_MD5:   *min = *max = 16; break;
case SADB_X_AALG_SHA:   *min = *max = 20; break;
case SADB_X_AALG_NULL:  *min = 1; *max = 256; break;
+   case SADB_X_AALG_SHA2_256: *min = *max = 32; break;
+   case SADB_X_AALG_SHA2_384: *min = *max = 48; break;
+   case SADB_X_AALG_SHA2_512: *min = *max = 64; break;
default:
DPRINTF((%s: unknown AH algorithm %u\n,
__func__, alg));
@@ -6120,7 +6123,11 @@ key_getcomb_ah()
for (i = 1; i = SADB_AALG_MAX; i++) {
 #if 1
/* we prefer HMAC algorithms, not old algorithms */
-   if (i != SADB_AALG_SHA1HMAC  i != SADB_AALG_MD5HMAC)
+   if (i != SADB_AALG_SHA1HMAC 
+   i != SADB_AALG_MD5HMAC  
+   i != SADB_X_AALG_SHA2_256 
+   i != SADB_X_AALG_SHA2_384 
+   i != SADB_X_AALG_SHA2_512)
continue;
 #endif
algo = ah_algorithm_lookup(i);

Modified: head/sys/netipsec/xform.h
==
--- head/sys/netipsec/xform.h   Fri Feb 18 08:38:24 2011(r218793)
+++ head/sys/netipsec/xform.h   Fri Feb 18 09:40:13 2011(r218794)
@@ -46,6 +46,7 @@
 #include opencrypto/xform.h
 
 #defineAH_HMAC_HASHLEN 12  /* 96 bits of authenticator */
+#defineAH_HMAC_MAXHASHLEN  (SHA2_512_HASH_LEN/2)   /* Keep this 
updated */
 #defineAH_HMAC_INITIAL_RPL 1   /* replay counter initial value 
*/
 
 /*

Modified: head/sys/netipsec/xform_ah.c
==
--- head/sys/netipsec/xform_ah.cFri Feb 18 08:38:24 2011
(r218793)
+++ head/sys/netipsec/xform_ah.cFri Feb 18 09:40:13 2011
(r218794)
@@ -85,8 +85,7 @@
  * to use a fixed 16-byte authenticator.  The new algorithm use 12-byte
  * authenticator.
  */
-#defineAUTHSIZE(sav) \
-   ((sav-flags  SADB_X_EXT_OLD) ? 16 : AH_HMAC_HASHLEN)
+#defineAUTHSIZE(sav)   ah_authsize(sav)
 
 VNET_DEFINE(int, ah_enable) = 1;   /* control flow of packets with AH */
 VNET_DEFINE(int, ah_cleartos) = 1; /* clear ip_tos when doing AH calc */
@@ -105,6 +104,27 @@ static unsigned char ipseczeroes[256]; /
 static int ah_input_cb(struct cryptop*);
 static int ah_output_cb(struct cryptop*);
 
+static int
+ah_authsize(struct secasvar *sav)
+{
+
+   IPSEC_ASSERT(sav != NULL, (%s: sav == NULL, __func__));
+
+   if (sav-flags  SADB_X_EXT_OLD)
+   return 16;
+
+   switch (sav-alg_auth) {
+   case SADB_X_AALG_SHA2_256:
+   return 16;
+   case SADB_X_AALG_SHA2_384:
+   return 24;
+   case SADB_X_AALG_SHA2_512:
+   return 32;
+   default:
+   return AH_HMAC_HASHLEN;
+   }
+   /* NOTREACHED */
+}
 /*
  * NB: this is public for use by the PF_KEY support.
  */

Modified: head/sys

svn commit: r218796 - head

2011-02-18 Thread VANHULLEBUS Yvan
Author: vanhu
Date: Fri Feb 18 13:21:30 2011
New Revision: 218796
URL: http://svn.freebsd.org/changeset/base/218796

Log:
  Moved the general note about FreeBSD 9.x at the beginning of the list.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Fri Feb 18 09:47:58 2011(r218795)
+++ head/UPDATING   Fri Feb 18 13:21:30 2011(r218796)
@@ -9,16 +9,6 @@ handbook.
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running portupgrade.
 
-20110218:
-   IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868
-   compliant, and will now use half of hash for authentication.
-   This will break interoperability with all stacks (including all
-   actual FreeBSD versions) who implement
-   draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for
-   authentication).
-   The only workaround with such peers is to use another HMAC
-   algorithm for IPsec (phase 2) authentication.
-
 NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
FreeBSD 9.x has many debugging features turned on, in both the kernel
and userland.  These features attempt to detect incorrect use of
@@ -32,6 +22,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
machines to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20110218:
+   IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868
+   compliant, and will now use half of hash for authentication.
+   This will break interoperability with all stacks (including all
+   actual FreeBSD versions) who implement
+   draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for
+   authentication).
+   The only workaround with such peers is to use another HMAC
+   algorithm for IPsec (phase 2) authentication.
+
 20110207:
Remove the uio_yield prototype and symbol.  This function has
been misnamed since it was introduced and should not be
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218797 - head/usr.bin/calendar

2011-02-18 Thread Sergey A. Osokin
Author: osa (ports committer)
Date: Fri Feb 18 13:41:45 2011
New Revision: 218797
URL: http://svn.freebsd.org/changeset/base/218797

Log:
  Replace hard-coded value by Julian2Gregorian converter function.

Modified:
  head/usr.bin/calendar/calendar.h
  head/usr.bin/calendar/paskha.c

Modified: head/usr.bin/calendar/calendar.h
==
--- head/usr.bin/calendar/calendar.hFri Feb 18 13:21:30 2011
(r218796)
+++ head/usr.bin/calendar/calendar.hFri Feb 18 13:41:45 2011
(r218797)
@@ -170,6 +170,7 @@ FILE*opencal(void);
 /* ostern.c / paskha.c */
 intpaskha(int);
 inteaster(int);
+intj2g(int);
 
 /* dates.c */
 extern int cumdaytab[][14];

Modified: head/usr.bin/calendar/paskha.c
==
--- head/usr.bin/calendar/paskha.c  Fri Feb 18 13:21:30 2011
(r218796)
+++ head/usr.bin/calendar/paskha.c  Fri Feb 18 13:41:45 2011
(r218797)
@@ -36,6 +36,15 @@ __FBSDID($FreeBSD$);
 #definePASKHA  paskha
 #definePASKHALEN   (sizeof(PASKHA) - 1)
 
+/* return difference in days between Julian and Gregorian calendars */
+int
+j2g(int year)
+{
+   return (year  1500) ?
+   0 :
+   10 + (year/100 - 16) - ((year/100 - 16) / 4);
+}
+
 /* return year day for Orthodox Easter using Gauss formula */
 /* (new style result) */
 
@@ -53,5 +62,5 @@ paskha(int R) /*year*/
d = (19 * a + x) % 30;
e = (2 * b + 4 * c + 6 * d + y) % 7;
cumday = cumdaytab[isleap(R)];
-   return (((cumday[3] + 1) + 22) + (d + e) + 13);
+   return (((cumday[3] + 1) + 22) + (d + e) + j2g(R));
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218799 - in head: etc/mtree usr.sbin usr.sbin/bsdinstall usr.sbin/bsdinstall/distextract usr.sbin/bsdinstall/distfetch usr.sbin/bsdinstall/partedit usr.sbin/bsdinstall/scripts

2011-02-18 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Feb 18 14:54:34 2011
New Revision: 218799
URL: http://svn.freebsd.org/changeset/base/218799

Log:
  Import bsdinstall. This is meant to be (eventually in conjunction with
  pc-sysinstall) a replacement for sysinstall in the 9.0 release and beyond.
  Currently supported platforms are sparc64, pc98, i386, amd64, powerpc, and
  powerpc64. Integration into the build system will occur in the coming
  weeks.
  
  Merging with pc-sysinstall will use this code as a frontend, while
  temporarily retaining the interactive partition editor here. This work
  will be done in parallel with improvements on this code and release
  integration.
  
  Thanks to all who have provided testing and comments!

Added:
  head/usr.sbin/bsdinstall/
  head/usr.sbin/bsdinstall/Makefile   (contents, props changed)
  head/usr.sbin/bsdinstall/bsdinstall   (contents, props changed)
  head/usr.sbin/bsdinstall/distextract/
  head/usr.sbin/bsdinstall/distextract/Makefile   (contents, props changed)
  head/usr.sbin/bsdinstall/distextract/distextract.c   (contents, props changed)
  head/usr.sbin/bsdinstall/distfetch/
  head/usr.sbin/bsdinstall/distfetch/Makefile   (contents, props changed)
  head/usr.sbin/bsdinstall/distfetch/distfetch.c   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/
  head/usr.sbin/bsdinstall/partedit/Makefile   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/diskeditor.c   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/diskeditor.h   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/gpart_ops.c   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/part_wizard.c   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/partedit.c   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/partedit.h   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/partedit_generic.c   (contents, props 
changed)
  head/usr.sbin/bsdinstall/partedit/partedit_pc98.c   (contents, props changed)
  head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c   (contents, props 
changed)
  head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c   (contents, props 
changed)
  head/usr.sbin/bsdinstall/partedit/partedit_x86.c   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/
  head/usr.sbin/bsdinstall/scripts/Makefile   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/adduser   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/auto   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/config   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/hostname   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/jail   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/keymap   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/mount   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/netconfig   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/rootpass   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/services   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/time   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/umount   (contents, props changed)
  head/usr.sbin/bsdinstall/scripts/wlanconfig   (contents, props changed)
Modified:
  head/etc/mtree/BSD.usr.dist
  head/usr.sbin/Makefile

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Fri Feb 18 14:34:33 2011(r218798)
+++ head/etc/mtree/BSD.usr.dist Fri Feb 18 14:54:34 2011(r218799)
@@ -32,6 +32,8 @@
 ..
 ..
 libexec
+   bsdinstall
+   ..
 lpr
 ru
 ..

Modified: head/usr.sbin/Makefile
==
--- head/usr.sbin/Makefile  Fri Feb 18 14:34:33 2011(r218798)
+++ head/usr.sbin/Makefile  Fri Feb 18 14:54:34 2011(r218799)
@@ -7,6 +7,7 @@ SUBDIR= adduser \
arp \
bootparamd \
burncd \
+   bsdinstall \
cdcontrol \
chkgrp \
chown \

Added: head/usr.sbin/bsdinstall/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/bsdinstall/Makefile   Fri Feb 18 14:54:34 2011
(r218799)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+SUBDIR= distextract distfetch partedit scripts
+SCRIPTS= bsdinstall
+
+.include bsd.prog.mk

Added: head/usr.sbin/bsdinstall/bsdinstall
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/bsdinstall/bsdinstall Fri Feb 18 14:54:34 2011
(r218799)
@@ -0,0 +1,43 @@
+#!/bin/sh
+#-
+# Copyright (c) 2011 Nathan Whitehorn
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without

svn commit: r218800 - in head/usr.sbin/pc-sysinstall: backend-partmanager pc-sysinstall

2011-02-18 Thread Josh Paetzel
Author: jpaetzel
Date: Fri Feb 18 15:00:25 2011
New Revision: 218800
URL: http://svn.freebsd.org/changeset/base/218800

Log:
  Add support to pc-sysinstall's create-part feature, to create non MBR type 
partitions,
  such as GPT and others.
  
  PR:   bin/154684
  Submitted by: kmoore
  Approved by:  kib (mentor, implicit)

Modified:
  head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh
  head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh

Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh
==
--- head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh  Fri Feb 
18 14:54:34 2011(r218799)
+++ head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh  Fri Feb 
18 15:00:25 2011(r218800)
@@ -25,7 +25,7 @@
 #
 # $FreeBSD$
 
-# Query a disk for partitions and display them
+# Create partitions on a target disk
 #
 
 . ${PROGDIR}/backend/functions.sh
@@ -47,46 +47,52 @@ fi
 
 DISK=${1}
 MB=${2}
+TYPE=${3}
+STARTBLOCK=${4}
 
 TOTALBLOCKS=`expr $MB \* 2048`
 
+# If no TYPE specified, default to MBR
+if [ -z $TYPE ] ; then TYPE=mbr ; fi
 
-# Lets figure out what number this slice will be
-LASTSLICE=`fdisk -s /dev/${DISK} 2/dev/null | grep -v ${DISK} | grep ':' | 
tail -n 1 | cut -d ':' -f 1 | tr -s '\t' ' ' | tr -d ' '`
+# Sanity check the gpart type
+case $TYPE in
+   apm|APM) ;;
+   bsd|BSD) ;;
+   ebr|EBR) ;;
+  pc98|pc98) ;;
+   gpt|GPT) ;;
+   mbr|MBR) ;;
+vtoc8|VTOC8) ;;
+   *) echo Error: Unknown gpart type: $TYPE ; exit 1 ;;
+esac
+
+# Lets figure out what number this partition will be
+LASTSLICE=`gpart show $DISK | grep -v -e $DISK -e '\- free \-' -e '^$' | awk 
'END {print $3}'`
 if [ -z ${LASTSLICE} ] ; then
   LASTSLICE=1
 else
   LASTSLICE=`expr $LASTSLICE + 1`
 fi
 
-if [ ${LASTSLICE} -gt 4 ] ; then
-  echo Error: FreeBSD MBR setups can only have a max of 4 slices
-  exit 1
-fi
-
-
 SLICENUM=${LASTSLICE}
 
-# Lets get the starting block
-if [ ${SLICENUM} = 1 ] ; then
-  STARTBLOCK=63
-else
-  # Lets figure out where the prior slice ends
-  checkslice=`expr ${SLICENUM} - 1`
-
-  # Get starting block of this slice
-  fdisk -s /dev/${DISK} | grep -v ${DISK}: | grep ${checkslice}: | tr -s  
 ${TMPDIR}/pfdisk
-  pstartblock=`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 3`
-  psize=`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 4`
-  STARTBLOCK=`expr ${pstartblock} + ${psize}`
+# Set a 4k Aligned start block if none specified
+if [ ${SLICENUM} = 1 -a -z $STARTBLOCK ] ; then
+  STARTBLOCK=2016
 fi
 
 
-# If this is an empty disk, see if we need to create a new MBR scheme for it
+# If this is an empty disk, see if we need to create a new scheme for it
 gpart show ${DISK} /dev/null 2/dev/null
 if [ $? != 0 -a ${SLICENUM} = 1 ] ; then
- gpart create -s mbr ${DISK}
+ gpart create -s ${TYPE} ${DISK}
+fi
+
+# If we have a starting block, use it
+if [ -z $STARTBLOCK ] ; then
+  sBLOCK=-b $STARTBLOCK
 fi
 
-gpart add -b ${STARTBLOCK} -s ${TOTALBLOCKS} -t freebsd -i ${SLICENUM} ${DISK}
+gpart add ${sBLOCK} -s ${TOTALBLOCKS} -t freebsd -i ${SLICENUM} ${DISK}
 exit $?

Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
==
--- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh  Fri Feb 18 
14:54:34 2011(r218799)
+++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh  Fri Feb 18 
15:00:25 2011(r218800)
@@ -125,7 +125,7 @@ case $1 in
   ;;
 
   # The user is wanting to create a new partition
-  create-part) ${PARTMANAGERDIR}/create-part.sh ${2} ${3}
+  create-part) ${PARTMANAGERDIR}/create-part.sh ${2} ${3} ${4} ${5}
   ;;
 
   # The user is wanting to delete an existing partition
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218801 - head/usr.sbin/pc-sysinstall/backend

2011-02-18 Thread Josh Paetzel
Author: jpaetzel
Date: Fri Feb 18 15:06:35 2011
New Revision: 218801
URL: http://svn.freebsd.org/changeset/base/218801

Log:
  Improve pc-sysinstall's localization options to include support for GDM  KDM
  desktop login managers.
  
  PR:   bin/154686
  Submitted by: kmoore
  Approved by:  kib (mentor, implicit)

Modified:
  head/usr.sbin/pc-sysinstall/backend/functions-localize.sh

Modified: head/usr.sbin/pc-sysinstall/backend/functions-localize.sh
==
--- head/usr.sbin/pc-sysinstall/backend/functions-localize.sh   Fri Feb 18 
15:00:25 2011(r218800)
+++ head/usr.sbin/pc-sysinstall/backend/functions-localize.sh   Fri Feb 18 
15:06:35 2011(r218801)
@@ -38,25 +38,46 @@ localize_freebsd()
   rm ${FSMNT}/etc/login.conf.bak
 };
 
+localize_x_desktops() {
 
-# Function which localizes a PC-BSD install
-localize_pcbsd()
-{
-  #Change the skel files
+  # Check for and customize KDE lang
   ##
-  sed -i.bak s/Country=us/Country=${COUNTRY}/g 
${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals
-  sed -i.bak s/Country=us/Country=${COUNTRY}/g 
${FSMNT}/root/.kde4/share/config/kdeglobals
-  sed -i.bak s/Language=en_US/Language=${SETLANG}:${LOCALE}/g 
${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals
-  sed -i.bak s/Language=en_US/Language=${SETLANG}:${LOCALE}/g 
${FSMNT}/root/.kde4/share/config/kdeglobals
 
-  #Change KDM Langs
+  # Check if we can localize KDE via skel
+  if [ -e ${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals ] ; then
+sed -i '' s/Country=us/Country=${COUNTRY}/g 
${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals
+sed -i '' s/Country=us/Country=${COUNTRY}/g 
${FSMNT}/root/.kde4/share/config/kdeglobals
+sed -i '' s/Language=en_US/Language=${SETLANG}:${LOCALE}/g 
${FSMNT}/usr/share/skel/.kde4/share/config/kdeglobals
+  fi
+
+  # Check if we have a KDE root config
+  if [ -e ${FSMNT}/root/.kde4/share/config/kdeglobals ] ; then
+sed -i '' s/Language=en_US/Language=${SETLANG}:${LOCALE}/g 
${FSMNT}/root/.kde4/share/config/kdeglobals
+  fi
+
+  # Check for KDM
+  if [ -e ${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc ] ; then
+sed -i '' s/Language=en_US/Language=${LOCALE}.UTF-8/g 
${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc
+  fi
+
+  # Check for and customize GNOME / GDM lang
   ##
-  sed -i.bak s/Language=en_US/Language=${LOCALE}.UTF-8/g 
${FSMNT}/usr/local/kde4/share/config/kdm/kdmrc
 
+  # See if GDM is enabled and customize its lang
+  cat ${FSMNT}/etc/rc.conf 2/dev/null | grep gdm_enable=\YES\ /dev/null 
2/dev/null
+  if [ $? = 0 ] ; then
+echo gdm_lang=\${LOCALE}.UTF-8\  ${FSMNT}/etc/rc.conf
+  fi
+
+};
+
+# Function which localizes a PC-BSD install
+localize_pcbsd()
+{
   # Check if we have a localized splash screen and copy it
-  if [ -e ${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx ]
+  if [ -e 
${FSMNT}/usr/local/share/pcbsd/splash-screens/loading-screen-${SETLANG}.pcx ]
   then
-cp ${FSMNT}/usr/PCBSD/splash-screens/loading-screen-${SETLANG}.pcx 
${FSMNT}/boot/loading-screen.pcx
+cp 
${FSMNT}/usr/local/share/pcbsd/splash-screens/loading-screen-${SETLANG}.pcx 
${FSMNT}/boot/loading-screen.pcx
   fi
 
 };
@@ -117,12 +138,14 @@ localize_x_keyboard()
 cp ${FSMNT}/usr/share/skel/.xprofile ${FSMNT}/root/.xprofile
 
 # Save it for KDM
-echo setxkbmap ${SETXKBMAP} 
${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup
+if [ -e ${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup ] ; then
+  echo setxkbmap ${SETXKBMAP} 
${FSMNT}/usr/local/kde4/share/config/kdm/Xsetup
+fi
   fi
  
-
-   # Create the kxkbrc configuration using these options
-  echo [Layout]
+  # Create the kxkbrc configuration using these options
+  if [ -d ${FSMNT}/usr/share/skel/.kde4/share/config ] ; then
+echo [Layout]
 DisplayNames=${KXLAYOUT}${COUNTRY}
 IndicatorOnly=false
 LayoutList=${KXLAYOUT}${KXVAR}${COUNTRY}
@@ -133,6 +156,7 @@ ShowFlag=true
 ShowSingle=false
 SwitchMode=WinClass
 Use=true  ${FSMNT}/usr/share/skel/.kde4/share/config/kxkbrc
+  fi
 
 };
 
@@ -454,7 +478,12 @@ run_localize()
   then
 localize_pcbsd $VAL
   fi
+
+  # Localize FreeBSD
   localize_freebsd $VAL
+
+  # Localize any X pkgs
+  localize_x_desktops $VAL
 fi
 
 # Check if we need to do any keylayouts
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218802 - head/usr.sbin/pc-sysinstall/backend-query

2011-02-18 Thread Josh Paetzel
Author: jpaetzel
Date: Fri Feb 18 15:13:07 2011
New Revision: 218802
URL: http://svn.freebsd.org/changeset/base/218802

Log:
  Sort available keyboard layouts to a more sane default.
  
  PR:   bin/154687
  Submitted by: kmoore
  Approved by:  kib (mentor, implicit)

Modified:
  head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh
==
--- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh  Fri Feb 
18 15:06:35 2011(r218801)
+++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh  Fri Feb 
18 15:13:07 2011(r218802)
@@ -26,6 +26,12 @@
 # $FreeBSD$
 
 FOUND=0
+TMPLIST=/tmp/.xkeyList.$$
+XLST=/usr/local/share/X11/xkb/rules/xorg.lst
+
+if [ ! -e ${XLST} ] ; then
+  exit 1
+fi
 
 # Lets parse the xorg.list file, and see what layouts are supported
 while read line
@@ -36,9 +42,9 @@ do
 echo $line | grep '! ' /dev/null 2/dev/null
 if [ $? = 0 ]
 then
-  exit 0
+   break
 else 
-  echo $line
+  echo $line  ${TMPLIST}
 fi 
   fi 
 
@@ -51,6 +57,13 @@ do
 fi 
   fi
 
-done  /usr/local/share/X11/xkb/rules/xorg.lst
+done  $XLST
+
+# Display the output, with us English as the first entry
+echo us   U.S. English
+sort -b -d +1 $TMPLIST
+
+# Delete the tmp file
+rm $TMPLIST
 
 exit 0
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r218802 - head/usr.sbin/pc-sysinstall/backend-query

2011-02-18 Thread Bruce Cran
On Fri, 18 Feb 2011 15:13:08 + (UTC)
Josh Paetzel jpaet...@freebsd.org wrote:

 +# Display the output, with us English as the first entry
 +echo us U.S. English

If the default has to be US English, would it be possible to select the
entry in the list instead of putting it at the top?

-- 
Bruce Cran
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r218802 - head/usr.sbin/pc-sysinstall/backend-query

2011-02-18 Thread Kris Moore
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/18/2011 10:22, Bruce Cran wrote:
 On Fri, 18 Feb 2011 15:13:08 + (UTC)
 Josh Paetzel jpaet...@freebsd.org wrote:
 
 +# Display the output, with us English as the first entry
 +echo usU.S. English
 
 If the default has to be US English, would it be possible to select the
 entry in the list instead of putting it at the top?
 

Yea, we could move that logic to the front-ends instead, not a biggie.

I'll get a patch sent over for it soon.


- -- 
Kris Moore
PC-BSD Software
iXsystems
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.16 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNXo/SAAoJEDv6T4U6J2HSlLYH/RafjeiOfiCNFuID5nkbUUyf
NTmeEPD1louhKGhb2xRp0GEJrNxm0qFNE32cFMzX/GdWwAbtLLwZqKtBKkvhqOnM
rBIAatU2+FaHpotBdd6VE2S6AYwmKcU3Ke+Fb1w7OMWv07695u6p5VbC4ddprqhn
9bX4hxvLIYP8Nl9WHXpouzfBWAFLJ1vlTZZO5jtda7LQVc+yaL46LsYCuoHwPAPZ
fqBE7Lw/833Lrxw2gXefOEyqdVOukISwYnl9Cv9ziVVd8pxrFX/Lhr8ZyC3mHi7X
pOC1l7DYf11ox6yLhh7IoPZt+2bBvLVAB0o6N4XhxrLDE8CgU6a0ZRN0jNV64dI=
=/3MS
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218803 - head/usr.sbin/pc-sysinstall/backend-query

2011-02-18 Thread Josh Paetzel
Author: jpaetzel
Date: Fri Feb 18 15:52:57 2011
New Revision: 218803
URL: http://svn.freebsd.org/changeset/base/218803

Log:
  Remove US as the default layout in backend, let front-ends decide that
  
  Submitted by: kmoore
  Approved by:  kib (mentor, implicit)

Modified:
  head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh
==
--- head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh  Fri Feb 
18 15:13:07 2011(r218802)
+++ head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh  Fri Feb 
18 15:52:57 2011(r218803)
@@ -59,8 +59,6 @@ do
 
 done  $XLST
 
-# Display the output, with us English as the first entry
-echo us   U.S. English
 sort -b -d +1 $TMPLIST
 
 # Delete the tmp file
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218811 - head/sys/dev/mps

2011-02-18 Thread Kenneth D. Merry
Author: ken
Date: Fri Feb 18 17:01:57 2011
New Revision: 218811
URL: http://svn.freebsd.org/changeset/base/218811

Log:
  In the MPS driver, during device removal processing, don't assume that
  the controller firmware will return all of our commands.  Instead, keep
  track of outstanding I/Os and return them to CAM once device removal
  processing completes.
  
  mpsvar.h: Declare the new io_list in the mps_softc.
  
  mps.c:Initialize the new io_list in the mps softc.
  
  mps_sas.c:o Track SCSI I/O requests on the io_list from the
  time of mpssas_action() through mpssas_scsiio_complete().
o Zero out the request structures used for device
  removal commands prior to filling them out.
o Once the target reset task management function completes
  during device removal processing, assume any SCSI I/O
  commands that are still oustanding will never return
  from the controller, and process them manually.
  
  Submitted by: gibbs
  MFC after:3 days

Modified:
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mpsvar.h

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Fri Feb 18 16:29:38 2011(r218810)
+++ head/sys/dev/mps/mps.c  Fri Feb 18 17:01:57 2011(r218811)
@@ -898,6 +898,7 @@ mps_attach(struct mps_softc *sc)
TAILQ_INIT(sc-req_list);
TAILQ_INIT(sc-chain_list);
TAILQ_INIT(sc-tm_list);
+   TAILQ_INIT(sc-io_list);
 
if (((error = mps_alloc_queues(sc)) != 0) ||
((error = mps_alloc_replies(sc)) != 0) ||

Modified: head/sys/dev/mps/mps_sas.c
==
--- head/sys/dev/mps/mps_sas.c  Fri Feb 18 16:29:38 2011(r218810)
+++ head/sys/dev/mps/mps_sas.c  Fri Feb 18 17:01:57 2011(r218811)
@@ -486,7 +486,10 @@ mpssas_prepare_remove(struct mpssas_soft
return;
}
 
+   mps_dprint(sc, MPS_INFO, Preparing to remove target %d\n, targ-tid);
+
req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm-cm_req;
+   memset(req, 0, sizeof(*req));
req-DevHandle = targ-handle;
req-Function = MPI2_FUNCTION_SCSI_TASK_MGMT;
req-TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET;
@@ -507,6 +510,7 @@ mpssas_remove_device(struct mps_softc *s
MPI2_SCSI_TASK_MANAGE_REPLY *reply;
MPI2_SAS_IOUNIT_CONTROL_REQUEST *req;
struct mpssas_target *targ;
+   struct mps_command *next_cm;
uint16_t handle;
 
mps_dprint(sc, MPS_TRACE, %s\n, __func__);
@@ -523,11 +527,13 @@ mpssas_remove_device(struct mps_softc *s
return;
}
 
-   mps_printf(sc, Reset aborted %d commands\n, reply-TerminationCount);
+   mps_dprint(sc, MPS_INFO, Reset aborted %u commands\n,
+   reply-TerminationCount);
mps_free_reply(sc, cm-cm_reply_data);
 
/* Reuse the existing command */
req = (MPI2_SAS_IOUNIT_CONTROL_REQUEST *)cm-cm_req;
+   memset(req, 0, sizeof(*req));
req-Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL;
req-Operation = MPI2_SAS_OP_REMOVE_DEVICE;
req-DevHandle = handle;
@@ -539,6 +545,17 @@ mpssas_remove_device(struct mps_softc *s
mps_map_command(sc, cm);
 
mps_dprint(sc, MPS_INFO, clearing target handle 0x%04x\n, handle);
+   TAILQ_FOREACH_SAFE(cm, sc-io_list, cm_link, next_cm) {
+   union ccb *ccb;
+
+   if (cm-cm_targ-handle != handle)
+   continue;
+
+   mps_dprint(sc, MPS_INFO, Completing missed command %p\n, cm);
+   ccb = cm-cm_complete_data;
+   ccb-ccb_h.status = CAM_DEV_NOT_THERE;
+   mpssas_scsiio_complete(sc, cm);
+   }
targ = mpssas_find_target(sc-sassc, 0, handle);
if (targ != NULL) {
targ-handle = 0x0;
@@ -1430,6 +1447,7 @@ mpssas_action_scsiio(struct mpssas_softc
cm-cm_complete_data = ccb;
cm-cm_targ = targ;
 
+   TAILQ_INSERT_TAIL(sc-io_list, cm, cm_link);
callout_reset(cm-cm_callout, (ccb-ccb_h.timeout * hz) / 1000,
   mpssas_scsiio_timeout, cm);
 
@@ -1449,6 +1467,7 @@ mpssas_scsiio_complete(struct mps_softc 
mps_dprint(sc, MPS_TRACE, %s\n, __func__);
 
callout_stop(cm-cm_callout);
+   TAILQ_REMOVE(sc-io_list, cm, cm_link);
 
sassc = sc-sassc;
ccb = cm-cm_complete_data;
@@ -1470,8 +1489,10 @@ mpssas_scsiio_complete(struct mps_softc 
 
/* Take the fast path to completion */
if (cm-cm_reply == NULL) {
-   ccb-ccb_h.status = CAM_REQ_CMP;
-   ccb-csio.scsi_status = SCSI_STATUS_OK;
+   if ((ccb-ccb_h.status  CAM_STATUS_MASK) == CAM_REQ_INPROG) {
+   ccb-ccb_h.status = CAM_REQ_CMP;
+  

svn commit: r218815 - head/sys/boot/forth

2011-02-18 Thread Daniel Gerzo
Author: danger (doc committer)
Date: Fri Feb 18 17:43:22 2011
New Revision: 218815
URL: http://svn.freebsd.org/changeset/base/218815

Log:
  - add missing if_ devices which were missing and are available as loadable
modules too
  
  Reviewed by:  brucec

Modified:
  head/sys/boot/forth/loader.conf

Modified: head/sys/boot/forth/loader.conf
==
--- head/sys/boot/forth/loader.conf Fri Feb 18 17:42:29 2011
(r218814)
+++ head/sys/boot/forth/loader.conf Fri Feb 18 17:43:22 2011
(r218815)
@@ -252,6 +252,7 @@ pf_load=NO# packet filter
 ###  Networking drivers  #
 ##
 
+bridgestp_load=NO# if_bridge(4) support
 miibus_load=NO   # miibus support, needed for some drivers
 if_ae_load=NO# Attansic/Atheros L2 FastEthernet
 if_age_load=NO   # Attansic/Atheros L1 Gigabit Ethernet
@@ -264,8 +265,10 @@ if_axe_load=NO   # ASIX Electronics AX8
 if_bce_load=NO   # Broadcom NetXtreme II Gigabit Ethernet
 if_bfe_load=NO   # Broadcom BCM4401
 if_bge_load=NO   # Broadcom BCM570x PCI Gigabit Ethernet
+if_bridge_load=NO# if_bridge(4) devices
 if_bwi_load=NO   # Broadcom BCM53xx IEEE 802.11b/g wireness NICs
 if_bwn_load=NO   # Broadcom BCM43xx IEEE 802.11 wireless NICs
+if_carp_load=NO  # carp(4) devices
 if_cas_load=NO   # Sun Cassini/Cassini+ and NS DP83065 Saturn
 if_cm_load=NO# SMC (90c26, 90c56, 90c66)
 if_cs_load=NO# Crystal Semiconductor CS8920
@@ -296,6 +299,7 @@ if_iwn_load=NO# Intel Wireless WiFi 
 if_ixgb_load=NO  # Intel PRO/10Gb Ethernet
 if_ixgbe_load=NO # Intel PRO/10Gb Ethernet PCI Express
 if_jme_load=NO   # JMicron JMC250 Gigabit/JMC260 Fast Ethernet
+if_lagg_load=NO  # lagg(4) devices
 if_le_load=NO# AMD Am7900 LANCE and Am79C9xx PCnet
 if_lge_load=NO   # Level 1 LXT1001 NetCellerator PCI Gigabit
# Ethernet
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218816 - head/tools/tools/nanobsd/Files/root

2011-02-18 Thread Xin LI
Author: delphij
Date: Fri Feb 18 19:07:16 2011
New Revision: 218816
URL: http://svn.freebsd.org/changeset/base/218816

Log:
  Add a helper script that detects which partition we are on and update the
  other.
  
  MFC after:1 month
  Obtained from:FreeNAS
  Sponsored by: iXsystems, Inc.

Added:
  head/tools/tools/nanobsd/Files/root/update   (contents, props changed)

Added: head/tools/tools/nanobsd/Files/root/update
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/nanobsd/Files/root/update  Fri Feb 18 19:07:16 2011
(r218816)
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# Copyright (c) 2011 iXsystems, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+# Script to update a NanoBSD system.
+#
+# usage:
+#  ssh somewhere cat image.s1 | sh update
+#
+
+set -e
+
+. /etc/nanobsd.conf
+
+if mount | grep ${NANO_DRIVE}s1  /dev/null ; then
+   exec sh /root/updatep2
+else
+   exec sh /root/updatep1
+fi
+
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218818 - head/sys/netinet

2011-02-18 Thread Michael Tuexen
Author: tuexen
Date: Fri Feb 18 20:30:58 2011
New Revision: 218818
URL: http://svn.freebsd.org/changeset/base/218818

Log:
  Bugfix: Get per vnet sysctl variables and statistics working.
  
  MFC after:3 months.

Modified:
  head/sys/netinet/sctp_sysctl.c

Modified: head/sys/netinet/sctp_sysctl.c
==
--- head/sys/netinet/sctp_sysctl.c  Fri Feb 18 20:25:30 2011
(r218817)
+++ head/sys/netinet/sctp_sysctl.c  Fri Feb 18 20:30:58 2011
(r218818)
@@ -566,7 +566,11 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS)
 {
int error;
 
+#ifdef VIMAGE
+   error = vnet_sysctl_handle_int(oidp, oidp-oid_arg1, oidp-oid_arg2, 
req);
+#else
error = sysctl_handle_int(oidp, oidp-oid_arg1, oidp-oid_arg2, req);
+#endif
if (error == 0) {
RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), 
SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX);
RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), 
SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX);
@@ -828,301 +832,298 @@ sysctl_sctp_cleartrace(SYSCTL_HANDLER_AR
  * sysctl definitions
  */
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, sendspace, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_sendspace), 0, sysctl_sctp_check, IU,
 SCTPCTL_MAXDGRAM_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, recvspace, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_recvspace), 0, sysctl_sctp_check, IU,
 SCTPCTL_RECVSPACE_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auto_asconf, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_auto_asconf), 0, sysctl_sctp_check, IU,
 SCTPCTL_AUTOASCONF_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, ecn_enable, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_ecn_enable), 0, sysctl_sctp_check, IU,
 SCTPCTL_ECN_ENABLE_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, IU,
 SCTPCTL_STRICT_SACKS_DESC);
 
 #if !defined(SCTP_WITH_NO_CSUM)
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | 
CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, IU,
 SCTPCTL_LOOPBACK_NOCSUM_DESC);
 #endif
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_init, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_strict_init), 0, sysctl_sctp_check, IU,
 SCTPCTL_STRICT_INIT_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, IU,
 SCTPCTL_PEER_CHKOH_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxburst, CTLTYPE_UINT | CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_max_burst_default), 0, sysctl_sctp_check, IU,
 SCTPCTL_MAXBURST_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, fr_maxburst, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), 0, sysctl_sctp_check, IU,
 SCTPCTL_FRMAXBURST_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, maxchunks, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue), 0, sysctl_sctp_check, IU,
 SCTPCTL_MAXCHUNKS_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, tcbhashsize, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_hashtblsize), 0, sysctl_sctp_check, IU,
 SCTPCTL_TCBHASHSIZE_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pcbhashsize, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_pcbtblsize), 0, sysctl_sctp_check, IU,
 SCTPCTL_PCBHASHSIZE_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | 
CTLFLAG_RW,
+SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, min_split_point, CTLTYPE_UINT | 
CTLFLAG_RW,
 SCTP_BASE_SYSCTL(sctp_min_split_point), 0, sysctl_sctp_check, IU,
 SCTPCTL_MIN_SPLIT_POINT_DESC);
 
-SYSCTL_PROC(_net_inet_sctp, OID_AUTO, chunkscale, CTLTYPE_UINT | 

svn commit: r218819 - in head/tools/regression/bin/sh: builtins expansion

2011-02-18 Thread Jilles Tjoelker
Author: jilles
Date: Fri Feb 18 20:37:09 2011
New Revision: 218819
URL: http://svn.freebsd.org/changeset/base/218819

Log:
  sh: Unset some more locale vars in two tests that may cause them to break.

Modified:
  head/tools/regression/bin/sh/builtins/locale1.0
  head/tools/regression/bin/sh/expansion/cmdsubst3.0

Modified: head/tools/regression/bin/sh/builtins/locale1.0
==
--- head/tools/regression/bin/sh/builtins/locale1.0 Fri Feb 18 20:30:58 
2011(r218818)
+++ head/tools/regression/bin/sh/builtins/locale1.0 Fri Feb 18 20:37:09 
2011(r218819)
@@ -11,6 +11,7 @@ check() {
 }
 
 unset LANG LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME 
LC_MESSAGES
+unset LANGUAGE
 
 msgeng=No such file or directory
 msgdut=Bestand of map niet gevonden

Modified: head/tools/regression/bin/sh/expansion/cmdsubst3.0
==
--- head/tools/regression/bin/sh/expansion/cmdsubst3.0  Fri Feb 18 20:30:58 
2011(r218818)
+++ head/tools/regression/bin/sh/expansion/cmdsubst3.0  Fri Feb 18 20:37:09 
2011(r218819)
@@ -1,5 +1,8 @@
 # $FreeBSD$
 
+unset LC_ALL
+export LC_CTYPE=en_US.ISO8859-1
+
 e=
 for i in 0 1 2 3; do
for j in 0 1 2 3 4 5 6 7; do
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218820 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Fri Feb 18 20:38:05 2011
New Revision: 218820
URL: http://svn.freebsd.org/changeset/base/218820

Log:
  For controllers that have TX interrupt moderation capability,
  request TX completion interrupt for every 8-th frames. Previously
  dc(4) requested TX completion interrupt if number of queued TX
  descriptors is greater than 64. This caused a lot of TX completion
  interrupt under high TX load once driver queued more than 64 TX
  descriptors. It's quite normal to see more than 64 queued TX
  descriptors under high TX load.
  This change reduces the number of TX completion interrupts to be
  less than 17k under high TX load. Because this change does not
  generate TX completion interrupt for each frame, add reclaiming
  transmitted buffers in dc_tick not to generate false watchdog
  timeouts.
  While I'm here add check for queued descriptors in dc_txeof() since
  there is no more work to do when there is no pending descriptors.

Modified:
  head/sys/dev/dc/if_dc.c
  head/sys/dev/dc/if_dcreg.h

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Fri Feb 18 20:37:09 2011(r218819)
+++ head/sys/dev/dc/if_dc.c Fri Feb 18 20:38:05 2011(r218820)
@@ -2473,6 +2473,7 @@ dc_list_tx_init(struct dc_softc *sc)
}
 
cd-dc_tx_prod = cd-dc_tx_cons = cd-dc_tx_cnt = 0;
+   cd-dc_tx_pkts = 0;
bus_dmamap_sync(sc-dc_ltag, sc-dc_lmap,
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
return (0);
@@ -2841,6 +2842,9 @@ dc_txeof(struct dc_softc *sc)
int idx;
u_int32_t ctl, txstat;
 
+   if (sc-dc_cdata.dc_tx_cnt == 0)
+   return;
+
ifp = sc-dc_ifp;
 
/*
@@ -2952,6 +2956,13 @@ dc_tick(void *xsc)
ifp = sc-dc_ifp;
mii = device_get_softc(sc-dc_miibus);
 
+   /*
+* Reclaim transmitted frames for controllers that do
+* not generate TX completion interrupt for every frame.
+*/
+   if (sc-dc_flags  DC_TX_USE_TX_INTR)
+   dc_txeof(sc);
+
if (sc-dc_flags  DC_REDUCED_MII_POLL) {
if (sc-dc_flags  DC_21143_NWAY) {
r = CSR_READ_4(sc, DC_10BTSTAT);
@@ -3322,8 +,11 @@ dc_encap(struct dc_softc *sc, struct mbu
htole32(DC_TXCTL_FINT);
if (sc-dc_flags  DC_TX_INTR_ALWAYS)
sc-dc_ldata-dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT);
-   if (sc-dc_flags  DC_TX_USE_TX_INTR  sc-dc_cdata.dc_tx_cnt  64)
+   if (sc-dc_flags  DC_TX_USE_TX_INTR 
+   ++sc-dc_cdata.dc_tx_pkts = 8) {
+   sc-dc_cdata.dc_tx_pkts = 0;
sc-dc_ldata-dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT);
+   }
sc-dc_ldata-dc_tx_list[first].dc_status = htole32(DC_TXSTAT_OWN);
 
bus_dmamap_sync(sc-dc_mtag, sc-dc_cdata.dc_tx_map[idx],

Modified: head/sys/dev/dc/if_dcreg.h
==
--- head/sys/dev/dc/if_dcreg.h  Fri Feb 18 20:37:09 2011(r218819)
+++ head/sys/dev/dc/if_dcreg.h  Fri Feb 18 20:38:05 2011(r218820)
@@ -495,6 +495,7 @@ struct dc_chain_data {
bus_dmamap_tdc_tx_map[DC_TX_LIST_CNT];
u_int32_t   *dc_sbuf;
u_int8_tdc_pad[DC_MIN_FRAMELEN];
+   int dc_tx_pkts;
int dc_tx_first;
int dc_tx_prod;
int dc_tx_cons;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218821 - head/tools/regression/bin/sh/builtins

2011-02-18 Thread Jilles Tjoelker
Author: jilles
Date: Fri Feb 18 20:51:13 2011
New Revision: 218821
URL: http://svn.freebsd.org/changeset/base/218821

Log:
  sh: Test that the read builtin passes through all byte values
  except NUL, newline and backslash.
  
  This also passes on stable/8.

Added:
  head/tools/regression/bin/sh/builtins/read5.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/read5.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/read5.0   Fri Feb 18 20:51:13 
2011(r218821)
@@ -0,0 +1,32 @@
+# $FreeBSD$
+
+unset LC_ALL
+LC_CTYPE=en_US.ISO8859-1
+export LC_CTYPE
+
+# Note: the first and last characters are not whitespace.
+# Exclude backslash and newline.
+bad1=`printf %03o \'`
+bad2=`printf %03o \''
+'`
+e=
+for i in 0 1 2 3; do
+   for j in 0 1 2 3 4 5 6 7; do
+   for k in 0 1 2 3 4 5 6 7; do
+   case $i$j$k in
+   000|$bad1|$bad2) continue ;;
+   esac
+   e=$e\\$i$j$k
+   done
+   done
+done
+e=`printf $e`
+[ ${#e} = 253 ] || echo length bad
+
+r1=`printf '%s\n' $e | { read -r x; printf '%s' $x; }`
+[ $r1 = $e ] || echo read with -r bad
+r2=`printf '%s\n' $e | { read x; printf '%s' $x; }`
+[ $r2 = $e ] || echo read without -r bad 1
+IFS=
+r3=`printf '%s\n' $e | { read x; printf '%s' $x; }`
+[ $r3 = $e ] || echo read without -r bad 2
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218825 - in head/sys: ddb gdb kern

2011-02-18 Thread Matthew D Fleming
Author: mdf
Date: Fri Feb 18 22:25:11 2011
New Revision: 218825
URL: http://svn.freebsd.org/changeset/base/218825

Log:
  Modify kdb_trap() so that it re-calls the dbbe_trap function as long as
  the debugger back-end has changed.  This means that switching from ddb
  to gdb no longer requires a step which can be dangerous on an
  already-crashed kernel.
  
  Also add a capability to get from the gdb back-end back to ddb, by
  typing ^C in the console window.
  
  While here, simplify kdb_sysctl_available() by using
  sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the
  strlcpy semantic is desired.
  
  MFC after:1 month

Modified:
  head/sys/ddb/db_command.c
  head/sys/gdb/gdb_main.c
  head/sys/gdb/gdb_packet.c
  head/sys/kern/subr_kdb.c

Modified: head/sys/ddb/db_command.c
==
--- head/sys/ddb/db_command.c   Fri Feb 18 21:44:53 2011(r218824)
+++ head/sys/ddb/db_command.c   Fri Feb 18 22:25:11 2011(r218825)
@@ -723,10 +723,16 @@ static void
 db_gdb(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
 {
 
-   if (kdb_dbbe_select(gdb) != 0)
+   if (kdb_dbbe_select(gdb) != 0) {
db_printf(The remote GDB backend could not be selected.\n);
-   else
-   db_printf(Step to enter the remote GDB backend.\n);
+   return;
+   }
+   /*
+* Mark that we are done in the debugger.  kdb_trap()
+* should re-enter with the new backend.
+*/
+   db_cmd_loop_done = 1;
+   db_printf((ctrl-c will return control to ddb)\n);
 }
 
 static void

Modified: head/sys/gdb/gdb_main.c
==
--- head/sys/gdb/gdb_main.c Fri Feb 18 21:44:53 2011(r218824)
+++ head/sys/gdb/gdb_main.c Fri Feb 18 22:25:11 2011(r218825)
@@ -95,7 +95,17 @@ gdb_init(void)
 static int
 gdb_trap(int type, int code)
 {
+   jmp_buf jb;
struct thread *thr_iter;
+   void *prev_jb;
+
+   prev_jb = kdb_jmpbuf(jb);
+   if (setjmp(jb) != 0) {
+   printf(%s bailing, hopefully back to ddb!\n, __func__);
+   gdb_listening = 0;
+   (void)kdb_jmpbuf(prev_jb);
+   return (1);
+   }
 
gdb_listening = 0;
/*
@@ -291,5 +301,6 @@ gdb_trap(int type, int code)
break;
}
}
+   (void)kdb_jmpbuf(prev_jb);
return (0);
 }

Modified: head/sys/gdb/gdb_packet.c
==
--- head/sys/gdb/gdb_packet.c   Fri Feb 18 21:44:53 2011(r218824)
+++ head/sys/gdb/gdb_packet.c   Fri Feb 18 22:25:11 2011(r218825)
@@ -31,6 +31,7 @@ __FBSDID($FreeBSD$);
 #include sys/systm.h
 #include sys/ctype.h
 #include sys/kdb.h
+#include sys/ttydefaults.h
 
 #include machine/gdb_machdep.h
 #include machine/kdb.h
@@ -60,6 +61,17 @@ gdb_getc(void)
do
c = gdb_cur-gdb_getc();
while (c == -1);
+
+   if (c == CTRL('C')) {
+   printf(Received ^C; trying to switch back to ddb.\n);
+
+   if (kdb_dbbe_select(ddb) != 0)
+   printf(The ddb backend could not be selected.\n);
+   else {
+   printf(using longjmp, hope it works!\n);
+   kdb_reenter();
+   }
+   }
return (c);
 }
 

Modified: head/sys/kern/subr_kdb.c
==
--- head/sys/kern/subr_kdb.cFri Feb 18 21:44:53 2011(r218824)
+++ head/sys/kern/subr_kdb.cFri Feb 18 22:25:11 2011(r218825)
@@ -37,6 +37,7 @@ __FBSDID($FreeBSD$);
 #include sys/malloc.h
 #include sys/pcpu.h
 #include sys/proc.h
+#include sys/sbuf.h
 #include sys/smp.h
 #include sys/stack.h
 #include sys/sysctl.h
@@ -108,33 +109,17 @@ const char * volatile kdb_why = KDB_WHY_
 static int
 kdb_sysctl_available(SYSCTL_HANDLER_ARGS)
 {
-   struct kdb_dbbe *be, **iter;
-   char *avail, *p;
-   ssize_t len, sz;
+   struct kdb_dbbe **iter;
+   struct sbuf sbuf;
int error;
 
-   sz = 0;
+   sbuf_new_for_sysctl(sbuf, NULL, 64, req);
SET_FOREACH(iter, kdb_dbbe_set) {
-   be = *iter;
-   if (be-dbbe_active == 0)
-   sz += strlen(be-dbbe_name) + 1;
+   if ((*iter)-dbbe_active == 0)
+   sbuf_printf(sbuf, %s , (*iter)-dbbe_name);
}
-   sz++;
-   avail = malloc(sz, M_TEMP, M_WAITOK);
-   p = avail;
-   *p = '\0';
-
-   SET_FOREACH(iter, kdb_dbbe_set) {
-   be = *iter;
-   if (be-dbbe_active == 0) {
-   len = snprintf(p, sz, %s , be-dbbe_name);
-   p += len;
-   sz -= len;
-   }
-   }
-   

svn commit: r218826 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Fri Feb 18 22:58:46 2011
New Revision: 218826
URL: http://svn.freebsd.org/changeset/base/218826

Log:
  Make sure to clear status word of TX descriptor in dc_list_tx_init().
  Do not update if_opackets if the transmission had failed.

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Fri Feb 18 22:25:11 2011(r218825)
+++ head/sys/dev/dc/if_dc.c Fri Feb 18 22:58:46 2011(r218826)
@@ -2466,10 +2466,11 @@ dc_list_tx_init(struct dc_softc *sc)
nexti = 0;
else
nexti = i + 1;
+   ld-dc_tx_list[i].dc_status = 0;
+   ld-dc_tx_list[i].dc_ctl = 0;
+   ld-dc_tx_list[i].dc_data = 0;
ld-dc_tx_list[i].dc_next = htole32(DC_TXDESC(sc, nexti));
cd-dc_tx_chain[i] = NULL;
-   ld-dc_tx_list[i].dc_data = 0;
-   ld-dc_tx_list[i].dc_ctl = 0;
}
 
cd-dc_tx_prod = cd-dc_tx_cons = cd-dc_tx_cnt = 0;
@@ -2916,11 +2917,10 @@ dc_txeof(struct dc_softc *sc)
dc_init_locked(sc);
return;
}
-   }
-
+   } else
+   ifp-if_opackets++;
ifp-if_collisions += (txstat  DC_TXSTAT_COLLCNT)  3;
 
-   ifp-if_opackets++;
if (sc-dc_cdata.dc_tx_chain[idx] != NULL) {
bus_dmamap_sync(sc-dc_mtag,
sc-dc_cdata.dc_tx_map[idx],
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218827 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Fri Feb 18 23:08:05 2011
New Revision: 218827
URL: http://svn.freebsd.org/changeset/base/218827

Log:
  There is no need to execute filter configuration when driver is not
  running. Remove wrong driver state change in dc_setfilt_xircom().
  While I'm here nuke unnecessary assignments.

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Fri Feb 18 22:58:46 2011(r218826)
+++ head/sys/dev/dc/if_dc.c Fri Feb 18 23:08:05 2011(r218827)
@@ -1334,7 +1334,6 @@ dc_setfilt_xircom(struct dc_softc *sc)
 
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON);
-   ifp-if_drv_flags |= IFF_DRV_RUNNING;
sframe-dc_status = htole32(DC_TXSTAT_OWN);
CSR_WRITE_4(sc, DC_TXSTART, 0x);
 
@@ -3696,14 +3695,13 @@ dc_ioctl(struct ifnet *ifp, u_long comma
}
sc-dc_if_flags = ifp-if_flags;
DC_UNLOCK(sc);
-   error = 0;
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
DC_LOCK(sc);
-   dc_setfilt(sc);
+   if (ifp-if_drv_flags  IFF_DRV_RUNNING)
+   dc_setfilt(sc);
DC_UNLOCK(sc);
-   error = 0;
break;
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218828 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Fri Feb 18 23:18:08 2011
New Revision: 218828
URL: http://svn.freebsd.org/changeset/base/218828

Log:
  Fix a long standing bug where driver handed over RX descriptor
  ownership to controller before completion of access to the
  descriptor. Driver is faking up status word so it should not give
  ownership to controller until it completes RX processing.

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Fri Feb 18 23:08:05 2011(r218827)
+++ head/sys/dev/dc/if_dc.c Fri Feb 18 23:18:08 2011(r218828)
@@ -2671,7 +2671,6 @@ dc_pnic_rx_bug_war(struct dc_softc *sc, 
 * the status word to make it look like a successful
 * frame reception.
 */
-   dc_newbuf(sc, i, 0);
bcopy(ptr, mtod(m, char *), total_len);
cur_rx-dc_status = htole32(rxstat | DC_RXSTAT_FIRSTFRAG);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218830 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Sat Feb 19 00:00:32 2011
New Revision: 218830
URL: http://svn.freebsd.org/changeset/base/218830

Log:
  Send frames only when there is a valid link and driver is running
  as well as controller has enough free TX descriptors.
  Remove check for number of queued frames before attempting to
  transmit. I guess it was added to allow draining queued frames
  even if there is no link. I'm under the impression this type of
  check should be done in upper layer. No other drivers in tree do
  that.

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Fri Feb 18 23:47:58 2011(r218829)
+++ head/sys/dev/dc/if_dc.c Sat Feb 19 00:00:32 2011(r218830)
@@ -3375,10 +3375,8 @@ dc_start_locked(struct ifnet *ifp)
 
DC_LOCK_ASSERT(sc);
 
-   if (!sc-dc_link  ifp-if_snd.ifq_len  10)
-   return;
-
-   if (ifp-if_drv_flags  IFF_DRV_OACTIVE)
+   if ((ifp-if_drv_flags  (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+   IFF_DRV_RUNNING || sc-dc_link == 0)
return;
 
idx = sc-dc_cdata.dc_tx_first = sc-dc_cdata.dc_tx_prod;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r218825 - in head/sys: ddb gdb kern

2011-02-18 Thread Lawrence Stewart
On 02/19/11 09:25, Matthew D Fleming wrote:
 Author: mdf
 Date: Fri Feb 18 22:25:11 2011
 New Revision: 218825
 URL: http://svn.freebsd.org/changeset/base/218825
 
 Log:
   Modify kdb_trap() so that it re-calls the dbbe_trap function as long as
   the debugger back-end has changed.  This means that switching from ddb
   to gdb no longer requires a step which can be dangerous on an
   already-crashed kernel.
   
   Also add a capability to get from the gdb back-end back to ddb, by
   typing ^C in the console window.
   
   While here, simplify kdb_sysctl_available() by using
   sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the
   strlcpy semantic is desired.
   
   MFC after:  1 month

Thanks heaps for doing this! It has annoyed me for quite some time but I
had no idea where/how to fix it.

Cheers,
Lawrence
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218831 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Sat Feb 19 01:37:28 2011
New Revision: 218831
URL: http://svn.freebsd.org/changeset/base/218831

Log:
  Rearrange interrupt handler a bit and remove forever loop.
  Previously dc(4) always checked whether there is pending interrupts
  and this consumed a lot of CPU cycles in interrupt handler. Limit
  the number of processing for TX/RX frames to 16. Also allow sending
  frames in the loop not to starve TX under high RX load.
  Reading DC_ISR register should be protected with driver lock,
  otherwise interrupt handler could be run(e.g. link state change)
  before the completion of dc_init_locked().
  
  While I'm here remove unneeded code.

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Sat Feb 19 00:00:32 2011(r218830)
+++ head/sys/dev/dc/if_dc.c Sat Feb 19 01:37:28 2011(r218831)
@@ -3135,16 +3135,19 @@ dc_intr(void *arg)
struct dc_softc *sc;
struct ifnet *ifp;
u_int32_t status;
+   int curpkts, n;
 
sc = arg;
 
if (sc-suspended)
return;
 
-   if ((CSR_READ_4(sc, DC_ISR)  DC_INTRS) == 0)
-   return;
-
DC_LOCK(sc);
+   status = CSR_READ_4(sc, DC_ISR);
+   if (status == 0x || (status  DC_INTRS) == 0) {
+   DC_UNLOCK(sc);
+   return;
+   }
ifp = sc-dc_ifp;
 #ifdef DEVICE_POLLING
if (ifp-if_capenable  IFCAP_POLLING) {
@@ -3152,26 +3155,16 @@ dc_intr(void *arg)
return;
}
 #endif
-
-   /* Suppress unwanted interrupts */
-   if (!(ifp-if_flags  IFF_UP)) {
-   if (CSR_READ_4(sc, DC_ISR)  DC_INTRS)
-   dc_stop(sc);
-   DC_UNLOCK(sc);
-   return;
-   }
-
/* Disable interrupts. */
CSR_WRITE_4(sc, DC_IMR, 0x);
 
-   while (((status = CSR_READ_4(sc, DC_ISR))  DC_INTRS) 
-   status != 0x 
-   (ifp-if_drv_flags  IFF_DRV_RUNNING)) {
-
+   for (n = 16; n  0; n--) {
+   if ((ifp-if_drv_flags  IFF_DRV_RUNNING) == 0)
+   break;
+   /* Ack interrupts. */
CSR_WRITE_4(sc, DC_ISR, status);
 
if (status  DC_ISR_RX_OK) {
-   int curpkts;
curpkts = ifp-if_ipackets;
dc_rxeof(sc);
if (curpkts == ifp-if_ipackets) {
@@ -3196,7 +3189,6 @@ dc_intr(void *arg)
 
if ((status  DC_ISR_RX_WATDOGTIMEO)
|| (status  DC_ISR_RX_NOBUF)) {
-   int curpkts;
curpkts = ifp-if_ipackets;
dc_rxeof(sc);
if (curpkts == ifp-if_ipackets) {
@@ -3205,17 +3197,23 @@ dc_intr(void *arg)
}
}
 
+   if (!IFQ_DRV_IS_EMPTY(ifp-if_snd))
+   dc_start_locked(ifp);
+
if (status  DC_ISR_BUS_ERR) {
dc_reset(sc);
dc_init_locked(sc);
+   DC_UNLOCK(sc);
+   return;
}
+   status = CSR_READ_4(sc, DC_ISR);
+   if (status == 0x || (status  DC_INTRS) == 0)
+   break;
}
 
/* Re-enable interrupts. */
-   CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
-
-   if (!IFQ_DRV_IS_EMPTY(ifp-if_snd))
-   dc_start_locked(ifp);
+   if (ifp-if_drv_flags  IFF_DRV_RUNNING)
+   CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
 
DC_UNLOCK(sc);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218832 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Sat Feb 19 02:47:10 2011
New Revision: 218832
URL: http://svn.freebsd.org/changeset/base/218832

Log:
  Split common TX/RX descriptor DMA tag to TX and RX DMA tags
  respectively and fix all bus_dma(9) issues seen when bounce buffers
  are used.
   o Setup frame handling had no bus_dmamap_sync(9) which prevented
 driver from configuring RX filter. Add missing bus_dmamap_sync(9)
 in both dc_setfilt_21143()/dc_setfilt_xircom() and dc_txeof().
   o Use bus_addr_t for DMA segment instead of using u_int32_t.
   o Introduce dc_dma_alloc()/dc_dma_free() functions to allocate/free
 DMA'able memory.
   o Create two DMA descriptor list for each TX/RX lists. This change
 will minimize the size of bounce buffers that would be used in
 each TX/RX path.  Previously driver had to copy both TX/RX lists
 when bounce buffer is active.
   o 21143 data sheet says descriptor list requires 4 bytes alignment.
 Remove PAGE_SIZE alignment restriction and use
 sizeof(struct dc_dec).
   o Setup frame requires 4 bytes alignment.  Remove PAGE_SIZE
 alignment restriction and use sizeof(struct dc_dec).
   o Add missing DMA map unload for both setup frame and TX/RX
 descriptor list.
   o Overhaul RX handling logic such that make driver always allocate
 new RX buffer with dc_newbuf(). Previously driver allowed to
 copy received frame with m_devget(9) after passing the
 descriptor ownership to controller. This can lead to passing
 wrong frame to upper stack.
   o Introduce dc_discard_rxbuf() which will discard received frame
 and reuse loaded DMA map and RX mbuf.
   o Correct several wrong bus_dmamap_sync(9) usage in dc_rxeof and
 dc_txeof. The TX/RX descriptor lists are updated by both driver
 and HW so READ/WRITE semantics should be used.
   o If driver failed to allocate new RX buffer, update if_iqdrops
 counter instead of if_ierrors since driver received the frame
 without errors.
   o Make sure to unload loaded setup frame DMA map in dc_txeof and
 clear the mark of setup frame of the TX descriptor in dc_txeof().
   o Add check for possible TX descriptor overruns in dc_encap() and
 move check for free buffer to caller, dc_start_locked().
   o Swap the loaded DMA map and the last DMA map for multi-segmented
 frames. Since dc_txeof() assumes the last descriptor of the
 frame has the DMA map, driver should swap the first and the last
 DMA map in dc_encap(). Previously driver tried to unload
 not-yet-loaded DMA map such that the loaded DMA map was not
 unloaded at all for multi-segmented frames.
   o Rewrite DC_RXDESC/DC_TXDESC macro to simpler one.
   o Remove definition of ETHER_ALIGN, it's already defined in
 ethernet.h.
  
  With this changes, dc(4) works with bounce buffers and it shall
  also fix issues which might have shown in PAE environments.
  
  Tested by:marius

Modified:
  head/sys/dev/dc/if_dc.c
  head/sys/dev/dc/if_dcreg.h

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Sat Feb 19 01:37:28 2011(r218831)
+++ head/sys/dev/dc/if_dc.c Sat Feb 19 02:47:10 2011(r218832)
@@ -233,7 +233,8 @@ static int dc_detach(device_t);
 static int dc_suspend(device_t);
 static int dc_resume(device_t);
 static const struct dc_type *dc_devtype(device_t);
-static int dc_newbuf(struct dc_softc *, int, int);
+static void dc_discard_rxbuf(struct dc_softc *, int);
+static int dc_newbuf(struct dc_softc *, int);
 static int dc_encap(struct dc_softc *, struct mbuf **);
 static void dc_pnic_rx_bug_war(struct dc_softc *, int);
 static int dc_rx_resync(struct dc_softc *);
@@ -253,6 +254,10 @@ static int dc_shutdown(device_t);
 static int dc_ifmedia_upd(struct ifnet *);
 static void dc_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 
+static int dc_dma_alloc(struct dc_softc *);
+static void dc_dma_free(struct dc_softc *);
+static void dc_dma_map_addr(void *, bus_dma_segment_t *, int, int);
+
 static void dc_delay(struct dc_softc *);
 static void dc_eeprom_idle(struct dc_softc *);
 static void dc_eeprom_putbyte(struct dc_softc *, int);
@@ -1087,11 +1092,11 @@ dc_setfilt_21143(struct dc_softc *sc)
i = sc-dc_cdata.dc_tx_prod;
DC_INC(sc-dc_cdata.dc_tx_prod, DC_TX_LIST_CNT);
sc-dc_cdata.dc_tx_cnt++;
-   sframe = sc-dc_ldata-dc_tx_list[i];
+   sframe = sc-dc_ldata.dc_tx_list[i];
sp = sc-dc_cdata.dc_sbuf;
bzero(sp, DC_SFRAME_LEN);
 
-   sframe-dc_data = htole32(sc-dc_saddr);
+   sframe-dc_data = htole32(DC_ADDR_LO(sc-dc_saddr));
sframe-dc_ctl = htole32(DC_SFRAME_LEN | DC_TXCTL_SETUP |
DC_TXCTL_TLINK | DC_FILTER_HASHPERF | DC_TXCTL_FINT);
 
@@ -1130,6 +1135,7 @@ dc_setfilt_21143(struct dc_softc *sc)
sp[41] = DC_SP_MAC(eaddr[2]);
 
sframe-dc_status = htole32(DC_TXSTAT_OWN);
+   bus_dmamap_sync(sc-dc_stag, sc-dc_smap, 

svn commit: r218833 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Sat Feb 19 03:01:24 2011
New Revision: 218833
URL: http://svn.freebsd.org/changeset/base/218833

Log:
  Count how many frames driver lost in interrupt handler. This
  register is cleared on read so make sure to clear it in driver
  initialization phase.

Modified:
  head/sys/dev/dc/if_dc.c

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Sat Feb 19 02:47:10 2011(r218832)
+++ head/sys/dev/dc/if_dc.c Sat Feb 19 03:01:24 2011(r218833)
@@ -3250,7 +3250,7 @@ dc_intr(void *arg)
 {
struct dc_softc *sc;
struct ifnet *ifp;
-   u_int32_t status;
+   u_int32_t r, status;
int curpkts, n;
 
sc = arg;
@@ -3305,6 +3305,8 @@ dc_intr(void *arg)
 
if ((status  DC_ISR_RX_WATDOGTIMEO)
|| (status  DC_ISR_RX_NOBUF)) {
+   r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
+   ifp-if_ierrors += (r  0x) + ((r  17)  0x7ff);
curpkts = ifp-if_ipackets;
dc_rxeof(sc);
if (curpkts == ifp-if_ipackets) {
@@ -3723,6 +3725,9 @@ dc_init_locked(struct dc_softc *sc)
mii_mediachg(mii);
dc_setcfg(sc, sc-dc_if_media);
 
+   /* Clear missed frames and overflow counter. */
+   CSR_READ_4(sc, DC_FRAMESDISCARDED);
+
/* Don't start the ticker if this is a homePNA link. */
if (IFM_SUBTYPE(mii-mii_media.ifm_media) == IFM_HPNA_1)
sc-dc_link = 1;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r218834 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Sat Feb 19 03:23:19 2011
New Revision: 218834
URL: http://svn.freebsd.org/changeset/base/218834

Log:
  Consistently use a tab character instead of space after #define.
  No functional changes.

Modified:
  head/sys/dev/dc/if_dc.c
  head/sys/dev/dc/if_dcreg.h

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Sat Feb 19 03:01:24 2011(r218833)
+++ head/sys/dev/dc/if_dc.c Sat Feb 19 03:23:19 2011(r218834)
@@ -127,7 +127,7 @@ __FBSDID($FreeBSD$);
 #include dev/pci/pcireg.h
 #include dev/pci/pcivar.h
 
-#define DC_USEIOSPACE
+#defineDC_USEIOSPACE
 
 #include dev/dc/if_dcreg.h
 
@@ -301,11 +301,11 @@ static void dc_apply_fixup(struct dc_sof
 static int dc_check_multiport(struct dc_softc *);
 
 #ifdef DC_USEIOSPACE
-#define DC_RES SYS_RES_IOPORT
-#define DC_RID DC_PCI_CFBIO
+#defineDC_RES  SYS_RES_IOPORT
+#defineDC_RID  DC_PCI_CFBIO
 #else
-#define DC_RES SYS_RES_MEMORY
-#define DC_RID DC_PCI_CFBMA
+#defineDC_RES  SYS_RES_MEMORY
+#defineDC_RID  DC_PCI_CFBMA
 #endif
 
 static device_method_t dc_methods[] = {
@@ -341,14 +341,14 @@ static devclass_t dc_devclass;
 DRIVER_MODULE(dc, pci, dc_driver, dc_devclass, 0, 0);
 DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, 0, 0);
 
-#define DC_SETBIT(sc, reg, x)  \
+#defineDC_SETBIT(sc, reg, x)   \
CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | (x))
 
-#define DC_CLRBIT(sc, reg, x)  \
+#defineDC_CLRBIT(sc, reg, x)   \
CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg)  ~(x))
 
-#define SIO_SET(x) DC_SETBIT(sc, DC_SIO, (x))
-#define SIO_CLR(x) DC_CLRBIT(sc, DC_SIO, (x))
+#defineSIO_SET(x)  DC_SETBIT(sc, DC_SIO, (x))
+#defineSIO_CLR(x)  DC_CLRBIT(sc, DC_SIO, (x))
 
 static void
 dc_delay(struct dc_softc *sc)
@@ -1016,9 +1016,9 @@ dc_miibus_mediainit(device_t dev)
ifmedia_add(ifm, IFM_ETHER | IFM_HPNA_1, 0, NULL);
 }
 
-#define DC_BITS_5129
-#define DC_BITS_1287
-#define DC_BITS_64 6
+#defineDC_BITS_512 9
+#defineDC_BITS_128 7
+#defineDC_BITS_64  6
 
 static uint32_t
 dc_mchash_le(struct dc_softc *sc, const uint8_t *addr)
@@ -2715,7 +2715,7 @@ dc_newbuf(struct dc_softc *sc, int i)
  * the time.
  */
 
-#define DC_WHOLEFRAME  (DC_RXSTAT_FIRSTFRAG | DC_RXSTAT_LASTFRAG)
+#defineDC_WHOLEFRAME   (DC_RXSTAT_FIRSTFRAG | DC_RXSTAT_LASTFRAG)
 static void
 dc_pnic_rx_bug_war(struct dc_softc *sc, int idx)
 {

Modified: head/sys/dev/dc/if_dcreg.h
==
--- head/sys/dev/dc/if_dcreg.h  Sat Feb 19 03:01:24 2011(r218833)
+++ head/sys/dev/dc/if_dcreg.h  Sat Feb 19 03:23:19 2011(r218834)
@@ -36,23 +36,23 @@
  * 21143 and clone common register definitions.
  */
 
-#define DC_BUSCTL  0x00/* bus control */
-#define DC_TXSTART 0x08/* tx start demand */
-#define DC_RXSTART 0x10/* rx start demand */
-#define DC_RXADDR  0x18/* rx descriptor list start addr */
-#define DC_TXADDR  0x20/* tx descriptor list start addr */
-#define DC_ISR 0x28/* interrupt status register */
-#define DC_NETCFG  0x30/* network config register */
-#define DC_IMR 0x38/* interrupt mask */
-#define DC_FRAMESDISCARDED 0x40/* # of discarded frames */
-#define DC_SIO 0x48/* MII and ROM/EEPROM access */
-#define DC_ROM 0x50/* ROM programming address */
-#define DC_TIMER   0x58/* general timer */
-#define DC_10BTSTAT0x60/* SIA status */
-#define DC_SIARESET0x68/* SIA connectivity */
-#define DC_10BTCTRL0x70/* SIA transmit and receive */
-#define DC_WATCHDOG0x78/* SIA and general purpose port */
-#define DC_SIAGP   0x78/* SIA and general purpose port (X3201) 
*/
+#defineDC_BUSCTL   0x00/* bus control */
+#defineDC_TXSTART  0x08/* tx start demand */
+#defineDC_RXSTART  0x10/* rx start demand */
+#defineDC_RXADDR   0x18/* rx descriptor list start 
addr */
+#defineDC_TXADDR   0x20/* tx descriptor list start 
addr */
+#defineDC_ISR  0x28/* interrupt status register */
+#defineDC_NETCFG   0x30/* network config register */
+#defineDC_IMR  0x38/* interrupt mask */
+#defineDC_FRAMESDISCARDED  0x40/* # of discarded frames */
+#define

svn commit: r218835 - head/sys/dev/dc

2011-02-18 Thread Pyun YongHyeon
Author: yongari
Date: Sat Feb 19 03:32:10 2011
New Revision: 218835
URL: http://svn.freebsd.org/changeset/base/218835

Log:
  s/u_intXX_t/uintXX_t/g

Modified:
  head/sys/dev/dc/if_dc.c
  head/sys/dev/dc/if_dcreg.h

Modified: head/sys/dev/dc/if_dc.c
==
--- head/sys/dev/dc/if_dc.c Sat Feb 19 03:23:19 2011(r218834)
+++ head/sys/dev/dc/if_dc.c Sat Feb 19 03:32:10 2011(r218835)
@@ -261,16 +261,16 @@ static void dc_dma_map_addr(void *, bus_
 static void dc_delay(struct dc_softc *);
 static void dc_eeprom_idle(struct dc_softc *);
 static void dc_eeprom_putbyte(struct dc_softc *, int);
-static void dc_eeprom_getword(struct dc_softc *, int, u_int16_t *);
-static void dc_eeprom_getword_pnic(struct dc_softc *, int, u_int16_t *);
-static void dc_eeprom_getword_xircom(struct dc_softc *, int, u_int16_t *);
+static void dc_eeprom_getword(struct dc_softc *, int, uint16_t *);
+static void dc_eeprom_getword_pnic(struct dc_softc *, int, uint16_t *);
+static void dc_eeprom_getword_xircom(struct dc_softc *, int, uint16_t *);
 static void dc_eeprom_width(struct dc_softc *);
 static void dc_read_eeprom(struct dc_softc *, caddr_t, int, int, int);
 
 static void dc_mii_writebit(struct dc_softc *, int);
 static int dc_mii_readbit(struct dc_softc *);
 static void dc_mii_sync(struct dc_softc *);
-static void dc_mii_send(struct dc_softc *, u_int32_t, int);
+static void dc_mii_send(struct dc_softc *, uint32_t, int);
 static int dc_mii_readreg(struct dc_softc *, struct dc_mii_frame *);
 static int dc_mii_writereg(struct dc_softc *, struct dc_mii_frame *);
 static int dc_miibus_readreg(device_t, int, int);
@@ -495,10 +495,10 @@ dc_eeprom_putbyte(struct dc_softc *sc, i
  * the EEPROM.
  */
 static void
-dc_eeprom_getword_pnic(struct dc_softc *sc, int addr, u_int16_t *dest)
+dc_eeprom_getword_pnic(struct dc_softc *sc, int addr, uint16_t *dest)
 {
int i;
-   u_int32_t r;
+   uint32_t r;
 
CSR_WRITE_4(sc, DC_PN_SIOCTL, DC_PN_EEOPCODE_READ | addr);
 
@@ -506,7 +506,7 @@ dc_eeprom_getword_pnic(struct dc_softc *
DELAY(1);
r = CSR_READ_4(sc, DC_SIO);
if (!(r  DC_PN_SIOCTL_BUSY)) {
-   *dest = (u_int16_t)(r  0x);
+   *dest = (uint16_t)(r  0x);
return;
}
}
@@ -518,17 +518,17 @@ dc_eeprom_getword_pnic(struct dc_softc *
  * the EEPROM, too.
  */
 static void
-dc_eeprom_getword_xircom(struct dc_softc *sc, int addr, u_int16_t *dest)
+dc_eeprom_getword_xircom(struct dc_softc *sc, int addr, uint16_t *dest)
 {
 
SIO_SET(DC_SIO_ROMSEL | DC_SIO_ROMCTL_READ);
 
addr *= 2;
CSR_WRITE_4(sc, DC_ROM, addr | 0x160);
-   *dest = (u_int16_t)CSR_READ_4(sc, DC_SIO)  0xff;
+   *dest = (uint16_t)CSR_READ_4(sc, DC_SIO)  0xff;
addr += 1;
CSR_WRITE_4(sc, DC_ROM, addr | 0x160);
-   *dest |= ((u_int16_t)CSR_READ_4(sc, DC_SIO)  0xff)  8;
+   *dest |= ((uint16_t)CSR_READ_4(sc, DC_SIO)  0xff)  8;
 
SIO_CLR(DC_SIO_ROMSEL | DC_SIO_ROMCTL_READ);
 }
@@ -537,10 +537,10 @@ dc_eeprom_getword_xircom(struct dc_softc
  * Read a word of data stored in the EEPROM at address 'addr.'
  */
 static void
-dc_eeprom_getword(struct dc_softc *sc, int addr, u_int16_t *dest)
+dc_eeprom_getword(struct dc_softc *sc, int addr, uint16_t *dest)
 {
int i;
-   u_int16_t word = 0;
+   uint16_t word = 0;
 
/* Force EEPROM to idle state. */
dc_eeprom_idle(sc);
@@ -586,7 +586,7 @@ static void
 dc_read_eeprom(struct dc_softc *sc, caddr_t dest, int off, int cnt, int be)
 {
int i;
-   u_int16_t word = 0, *ptr;
+   uint16_t word = 0, *ptr;
 
for (i = 0; i  cnt; i++) {
if (DC_IS_PNIC(sc))
@@ -595,7 +595,7 @@ dc_read_eeprom(struct dc_softc *sc, cadd
dc_eeprom_getword_xircom(sc, off + i, word);
else
dc_eeprom_getword(sc, off + i, word);
-   ptr = (u_int16_t *)(dest + (i * 2));
+   ptr = (uint16_t *)(dest + (i * 2));
if (be)
*ptr = be16toh(word);
else
@@ -680,7 +680,7 @@ dc_mii_sync(struct dc_softc *sc)
  * Clock a series of bits through the MII.
  */
 static void
-dc_mii_send(struct dc_softc *sc, u_int32_t bits, int cnt)
+dc_mii_send(struct dc_softc *sc, uint32_t bits, int cnt)
 {
int i;
 
@@ -1082,7 +1082,7 @@ dc_setfilt_21143(struct dc_softc *sc)
 {
uint16_t eaddr[(ETHER_ADDR_LEN+1)/2];
struct dc_desc *sframe;
-   u_int32_t h, *sp;
+   uint32_t h, *sp;
struct ifmultiaddr *ifma;
struct ifnet *ifp;
int i;
@@ -1156,7 +1156,7 @@ dc_setfilt_admtek(struct dc_softc *sc)
struct ifnet *ifp;
struct ifmultiaddr *ifma;
int h = 0;
-   u_int32_t hashes[2] = { 0, 0 };
+   uint32_t hashes[2] = { 0, 0 };
 

Re: svn commit: r218794 - in head: . sys/netipsec

2011-02-18 Thread Pawel Jakub Dawidek
On Fri, Feb 18, 2011 at 09:40:13AM +, VANHULLEBUS Yvan wrote:
 Author: vanhu
 Date: Fri Feb 18 09:40:13 2011
 New Revision: 218794
 URL: http://svn.freebsd.org/changeset/base/218794
 
 Log:
   Fixed IPsec's HMAC_SHA256-512 support to be RFC4868 compliant.
   This will break interoperability with all older versions of
   FreeBSD for those algorithms.

   Reviewed by:bz, gnn
   Obtained from:  NETASQ
   MFC after:  1w

First of all, I can't see such a change being merged to stable, where
going from 8.2 to 8.3 will break IPsec tunnels.
Second of all I really think that an UPDATING entry is not enough.
We should at least provide sysctl to change it back and if we can detect
this based on packet size, it would be best to log a warning that the
other side is using old implementation and it (the other side) should be
either upgraded or this sysctl should be changed locally to enable old
behaviour. I'm happy to remove such sysctl after one full major release,
so we won't support tunnels between FreeBSD 8 and FreeBSD 10, but we
should IMHO definitely support tunnels between both 8-9 and 9-10.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
p...@freebsd.org   http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!


pgpVb5FxhVVF7.pgp
Description: PGP signature


svn commit: r218838 - head/sys/ufs/ufs

2011-02-18 Thread Konstantin Belousov
Author: kib
Date: Sat Feb 19 07:47:25 2011
New Revision: 218838
URL: http://svn.freebsd.org/changeset/base/218838

Log:
  v_mountedhere is a member of the union. Check that the vnodes have
  proper type before using the member.
  
  Reported and tested by:   Michael Butler imb protected-networks net

Modified:
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cSat Feb 19 07:45:17 2011
(r218837)
+++ head/sys/ufs/ufs/ufs_vnops.cSat Feb 19 07:47:25 2011
(r218838)
@@ -1295,7 +1295,9 @@ relock:
newparent = tdp-i_number;
doingdirectory = 1;
}
-   if (fvp-v_mountedhere != NULL || (tvp  tvp-v_mountedhere != NULL)) {
+   if ((fvp-v_type == VDIR  fvp-v_mountedhere != NULL) ||
+   (tvp != NULL  tvp-v_type == VDIR 
+   tvp-v_mountedhere != NULL)) {
error = EXDEV;
goto unlockout;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org