svn commit: r186275 - head/sys/net

2008-12-18 Thread Kip Macy
Author: kmacy
Date: Thu Dec 18 09:59:24 2008
New Revision: 186275
URL: http://svn.freebsd.org/changeset/base/186275

Log:
  if_rtdel is always called with the RADIX_NODE_HEAD lock held

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Thu Dec 18 06:38:11 2008(r186274)
+++ head/sys/net/if.c   Thu Dec 18 09:59:24 2008(r186275)
@@ -1120,7 +1120,7 @@ if_rtdel(struct radix_node *rn, void *ar
return (0);
 
err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt-rt_gateway,
-   rt_mask(rt), rt-rt_flags,
+   rt_mask(rt), rt-rt_flags|RTF_RNH_LOCKED,
(struct rtentry **) NULL, rt-rt_fibnum);
if (err) {
log(LOG_WARNING, if_rtdel: error %d\n, err);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186276 - head/sys/kern

2008-12-18 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 18 11:58:12 2008
New Revision: 186276
URL: http://svn.freebsd.org/changeset/base/186276

Log:
  Do not return success and doomed vnode from lookup. LK_UPGRADE allows
  the vnode to be reclaimed.
  
  Tested by:pho
  MFC after:1 month

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Thu Dec 18 09:59:24 2008(r186275)
+++ head/sys/kern/vfs_lookup.c  Thu Dec 18 11:58:12 2008(r186276)
@@ -814,6 +814,10 @@ success:
if ((cnp-cn_flags  (ISLASTCN | LOCKSHARED | LOCKLEAF)) ==
(ISLASTCN | LOCKLEAF)  VOP_ISLOCKED(dp) != LK_EXCLUSIVE) {
vn_lock(dp, LK_UPGRADE | LK_RETRY);
+   if (dp-v_iflag  VI_DOOMED) {
+   error = ENOENT;
+   goto bad2;
+   }
}
if (vfslocked  dvfslocked)
VFS_UNLOCK_GIANT(dvfslocked);   /* Only need one */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186277 - head/sys/kern

2008-12-18 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 18 12:01:19 2008
New Revision: 186277
URL: http://svn.freebsd.org/changeset/base/186277

Log:
  The quotactl, statfs and fstatfs syscall implementations may dereference
  NULL pointer to struct mount if the looked up vnode is reclaimed. Also,
  these syscalls only mnt_ref() the mp, still allowing it to be unmounted;
  only struct mount memory is kept from being reused.
  
  Lock the vnode when doing name lookup, then reference its mount point,
  unlock the vnode and vfs_busy the mountpoint. This sequence shall take
  care of both races.
  
  Reported and tested by:   pho
  Discussed with:   attilio
  MFC after:1 month

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cThu Dec 18 11:58:12 2008
(r186276)
+++ head/sys/kern/vfs_syscalls.cThu Dec 18 12:01:19 2008
(r186277)
@@ -200,19 +200,21 @@ quotactl(td, uap)
AUDIT_ARG(uid, uap-uid);
if (jailed(td-td_ucred)  !prison_quotas)
return (EPERM);
-   NDINIT(nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1,
+   NDINIT(nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,
   UIO_USERSPACE, uap-path, td);
if ((error = namei(nd)) != 0)
return (error);
vfslocked = NDHASGIANT(nd);
NDFREE(nd, NDF_ONLY_PNBUF);
mp = nd.ni_vp-v_mount;
-   if ((error = vfs_busy(mp, 0))) {
-   vrele(nd.ni_vp);
+   vfs_ref(mp);
+   vput(nd.ni_vp);
+   error = vfs_busy(mp, 0);
+   vfs_rel(mp);
+   if (error) {
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
-   vrele(nd.ni_vp);
error = VFS_QUOTACTL(mp, uap-cmd, uap-uid, uap-arg, td);
vfs_unbusy(mp);
VFS_UNLOCK_GIANT(vfslocked);
@@ -306,6 +308,12 @@ kern_statfs(struct thread *td, char *pat
vfs_ref(mp);
NDFREE(nd, NDF_ONLY_PNBUF);
vput(nd.ni_vp);
+   error = vfs_busy(mp, 0);
+   vfs_rel(mp);
+   if (error) {
+   VFS_UNLOCK_GIANT(vfslocked);
+   return (error);
+   }
 #ifdef MAC
error = mac_mount_check_stat(td-td_ucred, mp);
if (error)
@@ -329,7 +337,7 @@ kern_statfs(struct thread *td, char *pat
}
*buf = *sp;
 out:
-   vfs_rel(mp);
+   vfs_unbusy(mp);
VFS_UNLOCK_GIANT(vfslocked);
if (mtx_owned(Giant))
printf(statfs(%d): %s: %d\n, vfslocked, path, error);
@@ -391,6 +399,10 @@ kern_fstatfs(struct thread *td, int fd, 
error = EBADF;
goto out;
}
+   error = vfs_busy(mp, 0);
+   vfs_rel(mp);
+   if (error)
+   goto out;
 #ifdef MAC
error = mac_mount_check_stat(td-td_ucred, mp);
if (error)
@@ -415,7 +427,7 @@ kern_fstatfs(struct thread *td, int fd, 
*buf = *sp;
 out:
if (mp)
-   vfs_rel(mp);
+   vfs_unbusy(mp);
VFS_UNLOCK_GIANT(vfslocked);
return (error);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2008-12-18 Thread Konstantin Belousov
Author: kib
Date: Thu Dec 18 12:01:53 2008
New Revision: 186278
URL: http://svn.freebsd.org/changeset/base/186278

Log:
  Do not busy twice the mount point where a quota operation is performed.
  
  Tested by:pho
  MFC after:1 month

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

Modified: head/sys/ufs/ufs/ufs_vfsops.c
==
--- head/sys/ufs/ufs/ufs_vfsops.c   Thu Dec 18 12:01:19 2008
(r186277)
+++ head/sys/ufs/ufs/ufs_vfsops.c   Thu Dec 18 12:01:53 2008
(r186278)
@@ -118,9 +118,6 @@ ufs_quotactl(mp, cmds, id, arg, td)
if ((u_int)type = MAXQUOTAS)
return (EINVAL);
 
-   if (vfs_busy(mp, MBF_NOWAIT))
-   return (0);
-
switch (cmd) {
case Q_QUOTAON:
error = quotaon(td, mp, type, arg);
@@ -150,7 +147,6 @@ ufs_quotactl(mp, cmds, id, arg, td)
error = EINVAL;
break;
}
-   vfs_unbusy(mp);
return (error);
 #endif
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186279 - head/usr.bin/make

2008-12-18 Thread Max Khon
Author: fjoe
Date: Thu Dec 18 12:16:51 2008
New Revision: 186279
URL: http://svn.freebsd.org/changeset/base/186279

Log:
  Exit with error code 2 when run with -k (continue if errors) and build failed.

Modified:
  head/usr.bin/make/globals.h
  head/usr.bin/make/job.c
  head/usr.bin/make/job.h
  head/usr.bin/make/main.c
  head/usr.bin/make/make.c

Modified: head/usr.bin/make/globals.h
==
--- head/usr.bin/make/globals.h Thu Dec 18 12:01:53 2008(r186278)
+++ head/usr.bin/make/globals.h Thu Dec 18 12:16:51 2008(r186279)
@@ -70,6 +70,7 @@ extern struct Path parseIncPath;
 extern struct Path sysIncPath;
 
 extern int jobLimit;   /* -j argument: maximum number of jobs */
+extern int makeErrors; /* Number of targets not remade due to errors */
 extern Boolean jobsRunning;/* True if jobs are running */
 extern Boolean compatMake; /* True if we are make compatible */
 extern Boolean ignoreErrors;   /* True if should ignore all errors */

Modified: head/usr.bin/make/job.c
==
--- head/usr.bin/make/job.c Thu Dec 18 12:01:53 2008(r186278)
+++ head/usr.bin/make/job.c Thu Dec 18 12:16:51 2008(r186279)
@@ -263,7 +263,6 @@ TAILQ_HEAD(JobList, Job);
 /*
  * error handling variables
  */
-static int errors = 0; /* number of errors reported */
 static int aborting = 0;   /* why is the make aborting? */
 #defineABORT_ERROR 1   /* Because of an error */
 #defineABORT_INTERRUPT 2   /* Because it was interrupted */
@@ -849,7 +848,7 @@ JobClose(Job *job)
  *
  * If we got an error and are aborting (aborting == ABORT_ERROR) and
  * the job list is now empty, we are done for the day.
- * If we recognized an error (errors !=0), we set the aborting flag
+ * If we recognized an error (makeErrors !=0), we set the aborting flag
  * to ABORT_ERROR so no more jobs will be started.
  */
 static void
@@ -1124,7 +1123,7 @@ JobFinish(Job *job, int *status)
free(job);
 
} else if (*status != 0) {
-   errors += 1;
+   makeErrors++;
free(job);
}
 
@@ -1133,7 +1132,7 @@ JobFinish(Job *job, int *status)
/*
 * Set aborting if any error.
 */
-   if (errors  !keepgoing  aborting != ABORT_INTERRUPT) {
+   if (makeErrors  !keepgoing  aborting != ABORT_INTERRUPT) {
/*
 * If we found any errors in this batch of children and the -k
 * flag wasn't given, we set the aborting flag so no more jobs
@@ -1146,7 +1145,7 @@ JobFinish(Job *job, int *status)
/*
 * If we are aborting and the job table is now empty, we finish.
 */
-   Finish(errors);
+   Finish(makeErrors);
}
 }
 
@@ -2347,7 +2346,7 @@ Job_Init(int maxproc)
nJobs = 0;
 
aborting = 0;
-   errors = 0;
+   makeErrors = 0;
 
lastNode = NULL;
 
@@ -2539,14 +2538,14 @@ JobInterrupt(int runINTERRUPT, int signo
  * attached to the .END target.
  *
  * Results:
- * Number of errors reported.
+ * None.
  */
-int
+void
 Job_Finish(void)
 {
 
if (postCommands != NULL  !Lst_IsEmpty(postCommands-commands)) {
-   if (errors) {
+   if (makeErrors) {
Error(Errors reported so .END ignored);
} else {
JobStart(postCommands, JOB_SPECIAL | JOB_IGNDOTS, NULL);
@@ -2563,7 +2562,6 @@ Job_Finish(void)
if (fifoMaster)
unlink(fifoName);
}
-   return (errors);
 }
 
 /**
@@ -3327,7 +3325,6 @@ void
 Compat_Run(Lst *targs)
 {
GNode   *gn = NULL; /* Current root target */
-   int error_cnt;  /* Number of targets not remade due to 
errors */
LstNode *ln;
 
Compat_InstallSignalHandlers();
@@ -3360,7 +3357,7 @@ Compat_Run(Lst *targs)
 *  ABORTED   gn was not remade because one of its inferiors
 *could not be made due to errors.
 */
-   error_cnt = 0;
+   makeErrors = 0;
while (!Lst_IsEmpty(targs)) {
gn = Lst_DeQueue(targs);
Compat_Make(gn, gn);
@@ -3370,18 +3367,17 @@ Compat_Run(Lst *targs)
} else if (gn-made == ABORTED) {
printf(`%s' not remade because of errors.\n,
gn-name);
-   error_cnt += 1;
+   makeErrors++;
}
}
 
/*
 * If the user has defined a .END target, run its commands.
 */
-   if (error_cnt == 0) {
+   if (makeErrors == 0) {
LST_FOREACH(ln, ENDNode-commands) {
if (Compat_RunCommand(Lst_Datum(ln), 

svn commit: r186280 - svnadmin/conf

2008-12-18 Thread Takahashi Yoshihiro
Author: nyan
Date: Thu Dec 18 14:19:54 2008
New Revision: 186280
URL: http://svn.freebsd.org/changeset/base/186280

Log:
  Increase my limit temporarily.

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confThu Dec 18 12:16:51 2008
(r186279)
+++ svnadmin/conf/sizelimit.confThu Dec 18 14:19:54 2008
(r186280)
@@ -18,3 +18,4 @@
 #grog
 #kan
 des
+nyan
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186282 - in head/sys/dev/cxgb: . common

2008-12-18 Thread George V. Neville-Neil
Author: gnn
Date: Thu Dec 18 14:21:35 2008
New Revision: 186282
URL: http://svn.freebsd.org/changeset/base/186282

Log:
  Check in the actual module recognition code for the Chelsio
  driver.
  
  Obtained from:Chelsio Inc.

Modified:
  head/sys/dev/cxgb/common/cxgb_ael1002.c
  head/sys/dev/cxgb/cxgb_main.c

Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c
==
--- head/sys/dev/cxgb/common/cxgb_ael1002.c Thu Dec 18 14:21:06 2008
(r186281)
+++ head/sys/dev/cxgb/common/cxgb_ael1002.c Thu Dec 18 14:21:35 2008
(r186282)
@@ -71,6 +71,74 @@ struct reg_val {
unsigned short set_bits;
 };
 
+static int ael2005_i2c_rd(struct cphy *phy, int dev_addr, int word_addr);
+
+static int get_module_type (struct cphy *phy, int hint)
+{
+   int v;
+
+   v = hint ? hint : ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0);
+   if (v  0)
+   return v;
+
+   if (v == 0x3) {
+   /* SFP: see SFF-8472 for below */
+   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3);
+   if (v  0)
+   return v;
+
+   if (v == 0x1)
+   return phy_modtype_twinax;
+   if (v == 0x10)
+   return phy_modtype_sr;
+   if (v == 0x20)
+   return phy_modtype_lr;
+   if (v == 0x40)
+   return phy_modtype_lrm;
+
+   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 6);
+   if (v  0)
+   return v;
+   if (v != 4)
+   return phy_modtype_unknown;
+
+   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 10);
+   if (v  0)
+   return v;
+
+   if (v  0x80) {
+   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0x12);
+   if (v  0)
+   return v;
+   return v  10 ? phy_modtype_twinax_long :
+   phy_modtype_twinax;
+   }
+   } else if (v == 0x6) {
+   /* XFP: See INF-8077i for details. */
+
+   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 127);
+   if (v  0)
+   return v;
+
+   if (v != 1) {
+   /* XXX: set page select to table 1 yourself */
+   return phy_modtype_unknown;
+   }
+
+   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 131);
+   if (v  0)
+   return v;
+   if (v == 0x10)
+   return phy_modtype_lrm;
+   if (v == 0x40)
+   return phy_modtype_lr;
+   if (v == 0x80)
+   return phy_modtype_sr;
+   }
+
+   return phy_modtype_unknown;
+}
+
 static int set_phy_regs(struct cphy *phy, const struct reg_val *rv)
 {
int err;
@@ -107,6 +175,18 @@ static int ael1002_power_down(struct cph
return err;
 }
 
+static int ael1002_get_module_type(struct cphy *phy, int delay_ms)
+{
+   int v;
+
+   if (delay_ms)
+   msleep(delay_ms);
+
+   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0);
+
+   return v == -ETIMEDOUT ? phy_modtype_none : get_module_type(phy, v);
+}
+
 static int ael1002_reset(struct cphy *phy, int wait)
 {
int err;
@@ -119,6 +199,11 @@ static int ael1002_reset(struct cphy *ph
(err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, AEL1002_LB_EN,
   0, 1  5)))
return err;
+
+   err = ael1002_get_module_type(phy, 300);
+   if (err = 0)
+   phy-modtype = err;
+
return 0;
 }
 
@@ -182,10 +267,17 @@ static struct cphy_ops ael1002_ops = {
 int t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
const struct mdio_ops *mdio_ops)
 {
+   int err;
+
cphy_init(phy, adapter, phy_addr, ael1002_ops, mdio_ops,
  SUPPORTED_1baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE,
  10GBASE-R);
ael100x_txon(phy);
+
+   err = ael1002_get_module_type(phy, 0);
+   if (err = 0)
+   phy-modtype = err;
+
return 0;
 }
 
@@ -983,7 +1075,7 @@ static int ael2005_i2c_rd(struct cphy *p
return -ETIMEDOUT;
 }
 
-static int get_module_type(struct cphy *phy, int delay_ms)
+static int ael2005_get_module_type(struct cphy *phy, int delay_ms)
 {
int v;
unsigned int stat;
@@ -998,36 +1090,8 @@ static int get_module_type(struct cphy *
if (delay_ms)
msleep(delay_ms);
 
-   /* see SFF-8472 for below */
-   v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3);
-   if (v  0)
-   return v;
-
-   if (v == 0x10)
-   return phy_modtype_sr;
-   if (v == 0x20)
-   return phy_modtype_lr;
- 

svn commit: r186283 - svnadmin/conf

2008-12-18 Thread Takahashi Yoshihiro
Author: nyan
Date: Thu Dec 18 14:23:25 2008
New Revision: 186283
URL: http://svn.freebsd.org/changeset/base/186283

Log:
  done.

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confThu Dec 18 14:21:35 2008
(r186282)
+++ svnadmin/conf/sizelimit.confThu Dec 18 14:23:25 2008
(r186283)
@@ -18,4 +18,3 @@
 #grog
 #kan
 des
-nyan
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186284 - head/tools/tools/tionxcl

2008-12-18 Thread Bruce M Simpson
Author: bms
Date: Thu Dec 18 15:12:04 2008
New Revision: 186284
URL: http://svn.freebsd.org/changeset/base/186284

Log:
  Add new tool tionxcl to bring ttys out of exclusive mode when
  left by e.g. legacy uucp or tip.

Added:
  head/tools/tools/tionxcl/
  head/tools/tools/tionxcl/Makefile   (contents, props changed)
  head/tools/tools/tionxcl/tionxcl.c   (contents, props changed)

Added: head/tools/tools/tionxcl/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/tionxcl/Makefile   Thu Dec 18 15:12:04 2008
(r186284)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+PROG=  tionxcl
+NO_MAN=defined
+
+.include bsd.prog.mk

Added: head/tools/tools/tionxcl/tionxcl.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/tionxcl/tionxcl.c  Thu Dec 18 15:12:04 2008
(r186284)
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 2008 Bruce Simpson.
+ * 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$
+ */
+
+#include sys/param.h
+#include sys/types.h
+#include sys/ioctl.h
+
+#include stdlib.h
+#include stdio.h
+#include string.h
+#include errno.h
+#include err.h
+#include fcntl.h
+#include unistd.h
+
+#include libgen.h
+#include sysexits.h
+
+#define DEVPATHNAME /dev
+
+int
+main(int argc, char *argv[])
+{
+   char *progname;
+   char *ttyname;
+   int fd;
+   int dofree;
+
+   dofree = 0;
+
+   progname = basename(argv[0]);
+   if (argc != 2)
+   errx(EX_USAGE, usage: %s ttyname\n, progname);
+   if (geteuid() != 0)
+   errx(EX_NOPERM, Sorry\n);
+
+   if (argv[1][0] == '/') {
+   ttyname = argv[1];
+   } else {
+   size_t len, maxpath, result;
+
+   len = strlen(argv[1]) + sizeof(DEVPATHNAME) + 1;
+
+   maxpath = pathconf(DEVPATHNAME, _PC_PATH_MAX);
+   if (len  maxpath) {
+   warnc(ENAMETOOLONG, ttyname);
+   exit(EX_DATAERR);
+   }
+
+   ttyname = malloc(len);
+   if (ttyname == NULL) {
+   warnc(ENOMEM, malloc);
+   exit(EX_OSERR);
+   }
+   dofree = 1;
+
+   result = snprintf(ttyname, len, %s/%s, DEVPATHNAME, argv[1]);
+   if (result = len)
+   warnc(ENOMEM, snprintf);
+   }
+
+   fd = open(ttyname, O_RDWR);
+   if (fd == -1) {
+   warnc(errno, open %s, ttyname);
+   if (dofree)
+   free(ttyname);
+   exit(EX_OSERR);
+   }
+
+   if (0 != ioctl(fd, TIOCNXCL, 0))
+   warnc(errno, ioctl TIOCNXCL %s, ttyname);
+
+   if (dofree)
+   free(ttyname);
+   exit(0);
+}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186285 - head/sys/kern

2008-12-18 Thread Ivan Voras
Author: ivoras
Date: Thu Dec 18 15:25:33 2008
New Revision: 186285
URL: http://svn.freebsd.org/changeset/base/186285

Log:
  Remove spaces in wait object names to make top (1) output prettier and
  unbreak scripts that examine ps (1) output.
  
  Reviewed by:  ed
  Approved by:  gnn (mentor)

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==
--- head/sys/kern/tty.c Thu Dec 18 15:12:04 2008(r186284)
+++ head/sys/kern/tty.c Thu Dec 18 15:25:33 2008(r186285)
@@ -871,10 +871,10 @@ tty_alloc(struct ttydevsw *tsw, void *sc
 
tty_init_termios(tp);
 
-   cv_init(tp-t_inwait, tty input);
-   cv_init(tp-t_outwait, tty output);
-   cv_init(tp-t_bgwait, tty background);
-   cv_init(tp-t_dcdwait, tty dcd);
+   cv_init(tp-t_inwait, ttyinput);
+   cv_init(tp-t_outwait, ttyoutput);
+   cv_init(tp-t_bgwait, ttybackground);
+   cv_init(tp-t_dcdwait, ttydcd);
 
ttyinq_init(tp-t_inq);
ttyoutq_init(tp-t_outq);
@@ -884,7 +884,7 @@ tty_alloc(struct ttydevsw *tsw, void *sc
tp-t_mtx = mutex;
} else {
tp-t_mtx = tp-t_mtxobj;
-   mtx_init(tp-t_mtxobj, tty lock, NULL, MTX_DEF);
+   mtx_init(tp-t_mtxobj, ttylock, NULL, MTX_DEF);
}
 
knlist_init(tp-t_inpoll.si_note, tp-t_mtx, NULL, NULL, NULL);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186286 - head/sys/kern

2008-12-18 Thread Ivan Voras
Author: ivoras
Date: Thu Dec 18 15:34:38 2008
New Revision: 186286
URL: http://svn.freebsd.org/changeset/base/186286

Log:
  By popular request, stringify kern.vm_guest sysctl. Now it returns a
  short, self-documenting string describing the detected virtual
  environment.
  
  Approved by:  gnn (mentor) (earlier version)

Modified:
  head/sys/kern/subr_param.c

Modified: head/sys/kern/subr_param.c
==
--- head/sys/kern/subr_param.c  Thu Dec 18 15:25:33 2008(r186285)
+++ head/sys/kern/subr_param.c  Thu Dec 18 15:34:38 2008(r186286)
@@ -75,6 +75,8 @@ __FBSDID($FreeBSD$);
 
 enum VM_GUEST { VM_GUEST_NO, VM_GUEST_VM, VM_GUEST_XEN };
 
+static int sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS);
+
 inthz;
 inttick;
 intmaxusers;   /* base tunable */
@@ -88,7 +90,7 @@ int   nswbuf;
 intmaxswzone;  /* max swmeta KVA storage */
 intmaxbcache;  /* max buffer cache KVA storage */
 intmaxpipekva; /* Limit on pipe KVA */
-intvm_guest;   /* Running as virtual machine guest? */
+intvm_guest;   /* Running as virtual machine guest? */
 u_long maxtsiz;/* max text size */
 u_long dfldsiz;/* initial data size limit */
 u_long maxdsiz;/* max data size */
@@ -113,8 +115,9 @@ SYSCTL_ULONG(_kern, OID_AUTO, maxssiz, C
 max stack size);
 SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RDTUN, sgrowsiz, 0,
 amount to grow stack);
-SYSCTL_INT(_kern, OID_AUTO, vm_guest, CTLFLAG_RD, vm_guest, 0,
-Running under a virtual machine?);
+SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING,
+NULL, 0, sysctl_kern_vm_guest, A,
+Virtual machine detected? (none|generic|xen));
 
 /*
  * These have to be allocated somewhere; allocating
@@ -138,6 +141,17 @@ static const char *const vm_pnames[] = {
NULL
 };
 
+static const char *const vm_guest_sysctl_names[] = {
+   none,
+   generic,
+   xen,
+   NULL
+};
+
+
+/*
+ * Detect known Virtual Machine hosts by inspecting the emulated BIOS.
+ */
 static enum VM_GUEST
 detect_virtual(void)
 {
@@ -266,3 +280,13 @@ init_param3(long kmempages)
maxpipekva = 512 * 1024;
TUNABLE_INT_FETCH(kern.ipc.maxpipekva, maxpipekva);
 }
+
+/*
+ * Sysctl stringiying handler for kern.vm_guest.
+ */
+static int
+sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS)
+{
+   return (SYSCTL_OUT(req, vm_guest_sysctl_names[vm_guest], 
+   strlen(vm_guest_sysctl_names[vm_guest])));
+}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186287 - head/sys/kern

2008-12-18 Thread Ruslan Ermilov
Author: ru
Date: Thu Dec 18 15:56:12 2008
New Revision: 186287
URL: http://svn.freebsd.org/changeset/base/186287

Log:
  Removed a comment made obsolete by revisions 157927 and 174292.

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==
--- head/sys/kern/kern_mbuf.c   Thu Dec 18 15:34:38 2008(r186286)
+++ head/sys/kern/kern_mbuf.c   Thu Dec 18 15:56:12 2008(r186287)
@@ -120,7 +120,6 @@ tunable_mbinit(void *dummy)
 }
 SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, 
NULL);
 
-/* XXX: These should be tuneables. Can't change UMA limits on the fly. */
 static int
 sysctl_nmbclusters(SYSCTL_HANDLER_ARGS)
 {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186288 - head/sys/powerpc/mpc85xx

2008-12-18 Thread Rafal Jaworowski
Author: raj
Date: Thu Dec 18 18:27:12 2008
New Revision: 186288
URL: http://svn.freebsd.org/changeset/base/186288

Log:
  Extend and improve MPC85XX Local Bus management.
  
  - Make LBC resources management self-contained: introduce explicit LBC
resources definition (much like the OCP), provide dedicated rman for LB mem
space.
  
  - Full configuration of an LB chip select device: program LAW and BR/OR, map
into KVA, handle all LB attributes (bus width, machine select, ecc,
write protect etc).
  
  - Factor out LAW manipulation routines into shared code, adjust OCP area
accordingly.
  
  - Other LBC fixes and clean-ups.
  
  Obtained from:Semihalf

Modified:
  head/sys/powerpc/mpc85xx/lbc.c
  head/sys/powerpc/mpc85xx/lbc.h
  head/sys/powerpc/mpc85xx/mpc85xx.c
  head/sys/powerpc/mpc85xx/mpc85xx.h
  head/sys/powerpc/mpc85xx/ocpbus.c

Modified: head/sys/powerpc/mpc85xx/lbc.c
==
--- head/sys/powerpc/mpc85xx/lbc.c  Thu Dec 18 15:56:12 2008
(r186287)
+++ head/sys/powerpc/mpc85xx/lbc.c  Thu Dec 18 18:27:12 2008
(r186288)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2006-2008, Juniper Networks, Inc.
+ * Copyright (c) 2008 Semihalf, Rafal Czubak
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,6 +45,8 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 
 #include powerpc/mpc85xx/lbc.h
+#include powerpc/mpc85xx/mpc85xx.h
+#include powerpc/mpc85xx/ocpbus.h
 
 struct lbc_softc {
device_tsc_dev;
@@ -54,16 +57,41 @@ struct lbc_softc {
int sc_rid;
 
struct rman sc_rman;
-   uintptr_t   sc_kva;
+   vm_offset_t sc_kva[LBC_DEV_MAX];
 };
 
 struct lbc_devinfo {
int lbc_devtype;
-   int lbc_memtype;
-   /* Also the BAR number */
+   /* LBC child unit. It also represents resource table entry number */
int lbc_unit;
 };
 
+/* Resources for MPC8555CDS system */
+const struct lbc_resource mpc85xx_lbc_resources[] = {
+   /* Boot flash bank */
+   {
+   LBC_DEVTYPE_CFI, 0, 0xff80, 0x0080, 16,
+   LBCRES_MSEL_GPCM, LBCRES_DECC_DISABLED,
+   LBCRES_ATOM_DISABLED, 0
+   },
+
+   /* Second flash bank */
+   {
+   LBC_DEVTYPE_CFI, 1, 0xff00, 0x0080, 16,
+   LBCRES_MSEL_GPCM, LBCRES_DECC_DISABLED,
+   LBCRES_ATOM_DISABLED, 0
+   },
+
+   /* DS1553 RTC/NVRAM */
+   {
+   LBC_DEVTYPE_RTC, 2, 0xf800, 0x8000, 8,
+   LBCRES_MSEL_GPCM, LBCRES_DECC_DISABLED,
+   LBCRES_ATOM_DISABLED, 0
+   },
+
+   {0}
+};
+
 static int lbc_probe(device_t);
 static int lbc_attach(device_t);
 static int lbc_shutdown(device_t);
@@ -108,26 +136,170 @@ static driver_t lbc_driver = {
 devclass_t lbc_devclass;
 DRIVER_MODULE(lbc, ocpbus, lbc_driver, lbc_devclass, 0, 0);
 
+static __inline void
+lbc_write_reg(struct lbc_softc *sc, bus_size_t off, uint32_t val)
+{
+
+   bus_space_write_4(sc-sc_bst, sc-sc_bsh, off, val);
+}
+
+static __inline uint32_t
+lbc_read_reg(struct lbc_softc *sc, bus_size_t off)
+{
+
+   return (bus_space_read_4(sc-sc_bst, sc-sc_bsh, off));
+}
+
+/*
+ * Calculate address mask used by OR(n) registers. Use memory region size to
+ * determine mask value. The size must be a power of two and within the range
+ * of 32KB - 4GB. Otherwise error code is returned. Value representing
+ * 4GB size can be passed as 0x.
+ */
+static uint32_t
+lbc_address_mask(uint32_t size)
+{
+   int n = 15;
+
+   if (size == ~0UL)
+   return (0);
+
+   while (n  32) {
+   if (size == (1UL  n))
+   break;
+   n++;
+   }
+
+   if (n == 32)
+   return (EINVAL);
+
+   return (0x8000  (n - 15));
+}
+
 static device_t
-lbc_mk_child(device_t dev, int type, int mtype, int unit)
+lbc_mk_child(device_t dev, const struct lbc_resource *lbcres)
 {
struct lbc_devinfo *dinfo;
device_t child;
 
+   if (lbcres-lbr_unit  LBC_DEV_MAX - 1)
+   return (NULL);
+
child = device_add_child(dev, NULL, -1);
if (child == NULL) {
-   device_printf(dev, could not add child device\n);
+   device_printf(dev, could not add LBC child device\n);
return (NULL);
}
dinfo = malloc(sizeof(struct lbc_devinfo), M_DEVBUF, M_WAITOK | M_ZERO);
-   dinfo-lbc_devtype = type;
-   dinfo-lbc_memtype = mtype;
-   dinfo-lbc_unit = unit;
+   dinfo-lbc_devtype = lbcres-lbr_devtype;
+   dinfo-lbc_unit = lbcres-lbr_unit;
device_set_ivars(child, dinfo);
return (child);
 }
 
 static int
+lbc_init_child(device_t dev, device_t child)
+{
+   struct lbc_softc *sc;
+   struct 

svn commit: r186292 - head/sys/dev/usb

2008-12-18 Thread Andrew Thompson
Author: thompsa
Date: Thu Dec 18 19:08:19 2008
New Revision: 186292
URL: http://svn.freebsd.org/changeset/base/186292

Log:
  Attempt to handoff the entire buffer with ttydisc_rint_bypass() before banging
  each char separately.

Modified:
  head/sys/dev/usb/ucom.c

Modified: head/sys/dev/usb/ucom.c
==
--- head/sys/dev/usb/ucom.c Thu Dec 18 18:44:46 2008(r186291)
+++ head/sys/dev/usb/ucom.c Thu Dec 18 19:08:19 2008(r186292)
@@ -706,17 +706,20 @@ ucomrxchars(struct ucom_softc *sc, u_cha
struct tty *tp = sc-sc_tty;
 
/* Give characters to tty layer. */
-   while (cc  0) {
-   DPRINTFN(7, (ucomreadcb: char = 0x%02x\n, *cp));
-   if (ttydisc_rint(tp, *cp, 0) == -1) {
-   /* XXX what should we do? */
-   printf(%s: lost %d chars\n,
-  device_get_nameunit(sc-sc_dev), cc);
-   break;
+   if (ttydisc_can_bypass(tp)) {
+   DPRINTFN(7, (ucomreadcb: buf = %*D\n, cc, cp, ));
+   cc = ttydisc_rint_bypass(tp, cp, cc);
+   } else {
+   while (cc  0) {
+   DPRINTFN(7, (ucomreadcb: char = 0x%02x\n, *cp));
+   if (ttydisc_rint(tp, *cp, 0) == -1)
+   break;
+   cc--;
+   cp++;
}
-   cc--;
-   cp++;
}
+   if (cc  0)
+   device_printf(sc-sc_dev, lost %d chars\n, cc);
ttydisc_rint_done(tp);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186294 - head/sys/dev/usb

2008-12-18 Thread Andrew Thompson
Author: thompsa
Date: Thu Dec 18 19:15:25 2008
New Revision: 186294
URL: http://svn.freebsd.org/changeset/base/186294

Log:
  Fix last commit, ttydisc_rint_bypass returns the total, not remainder.

Modified:
  head/sys/dev/usb/ucom.c

Modified: head/sys/dev/usb/ucom.c
==
--- head/sys/dev/usb/ucom.c Thu Dec 18 19:09:14 2008(r186293)
+++ head/sys/dev/usb/ucom.c Thu Dec 18 19:15:25 2008(r186294)
@@ -708,7 +708,7 @@ ucomrxchars(struct ucom_softc *sc, u_cha
/* Give characters to tty layer. */
if (ttydisc_can_bypass(tp)) {
DPRINTFN(7, (ucomreadcb: buf = %*D\n, cc, cp, ));
-   cc = ttydisc_rint_bypass(tp, cp, cc);
+   cc -= ttydisc_rint_bypass(tp, cp, cc);
} else {
while (cc  0) {
DPRINTFN(7, (ucomreadcb: char = 0x%02x\n, *cp));
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186295 - head/sys/dev/drm

2008-12-18 Thread Robert Noland
Author: rnoland
Date: Thu Dec 18 21:04:50 2008
New Revision: 186295
URL: http://svn.freebsd.org/changeset/base/186295

Log:
  rework drm_scatter.c which allocates scatter / gather pages for use by
  ati pci gart to use bus_dma to handle the allocations.  This fixes
  a garbled screen issue on at least some radeons (X1400 tested).  It is
  also likely that this is the correct fix for PR# 119324, though that
  is not confirmed yet.
  
  Reviewed by:  jhb@ (mentor, prior version)
  Approved by:  kib@
  MFC after:2 weeks

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_scatter.c

Modified: head/sys/dev/drm/drmP.h
==
--- head/sys/dev/drm/drmP.h Thu Dec 18 19:15:25 2008(r186294)
+++ head/sys/dev/drm/drmP.h Thu Dec 18 21:04:50 2008(r186295)
@@ -473,11 +473,13 @@ typedef struct drm_agp_head {
 } drm_agp_head_t;
 
 typedef struct drm_sg_mem {
-   unsigned long   handle;
-   void*virtual;
-   int pages;
-   dma_addr_t  *busaddr;
-   drm_dma_handle_t *dmah; /* Handle to PCI memory for ATI PCIGART table */
+   unsigned long handle;
+   void *virtual;
+   int   pages;
+   dma_addr_t   *busaddr;
+   struct drm_dma_handle*sg_dmah;  /* Handle for sg_pages   */
+   struct drm_dma_handle*dmah; /* Handle to PCI memory  */
+   /* for ATI PCIGART table */
 } drm_sg_mem_t;
 
 typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;

Modified: head/sys/dev/drm/drm_scatter.c
==
--- head/sys/dev/drm/drm_scatter.c  Thu Dec 18 19:15:25 2008
(r186294)
+++ head/sys/dev/drm/drm_scatter.c  Thu Dec 18 21:04:50 2008
(r186295)
@@ -39,20 +39,16 @@ __FBSDID($FreeBSD$);
 
 #include dev/drm/drmP.h
 
-#define DEBUG_SCATTER 0
+static void drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs,
+   int nsegs, int error);
 
-void drm_sg_cleanup(drm_sg_mem_t *entry)
+int
+drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request)
 {
-   free((void *)entry-handle, DRM_MEM_PAGES);
-   free(entry-busaddr, DRM_MEM_PAGES);
-   free(entry, DRM_MEM_SGLISTS);
-}
-
-int drm_sg_alloc(struct drm_device * dev, struct drm_scatter_gather * request)
-{
-   drm_sg_mem_t *entry;
+   struct drm_sg_mem *entry;
+   struct drm_dma_handle *dmah;
unsigned long pages;
-   int i;
+   int ret;
 
if (dev-sg)
return EINVAL;
@@ -69,21 +65,56 @@ int drm_sg_alloc(struct drm_device * dev
entry-busaddr = malloc(pages * sizeof(*entry-busaddr), DRM_MEM_PAGES,
M_WAITOK | M_ZERO);
if (!entry-busaddr) {
-   drm_sg_cleanup(entry);
+   free(entry, DRM_MEM_SGLISTS);
return ENOMEM;
}
 
-   entry-handle = (long)malloc(pages  PAGE_SHIFT, DRM_MEM_PAGES,
-   M_WAITOK | M_ZERO);
-   if (entry-handle == 0) {
-   drm_sg_cleanup(entry);
+   dmah = malloc(sizeof(struct drm_dma_handle), DRM_MEM_DMA,
+   M_ZERO | M_NOWAIT);
+   if (dmah == NULL) {
+   free(entry-busaddr, DRM_MEM_PAGES);
+   free(entry, DRM_MEM_SGLISTS);
+   return ENOMEM;
+   }
+
+   ret = bus_dma_tag_create(NULL, PAGE_SIZE, 0, /* tag, align, boundary */
+   BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
+   NULL, NULL, /* filtfunc, filtfuncargs */
+   request-size, pages, /* maxsize, nsegs */
+   PAGE_SIZE, 0, /* maxsegsize, flags */
+   NULL, NULL, /* lockfunc, lockfuncargs */
+   dmah-tag);
+   if (ret != 0) {
+   free(dmah, DRM_MEM_DMA);
+   free(entry-busaddr, DRM_MEM_PAGES);
+   free(entry, DRM_MEM_SGLISTS);
return ENOMEM;
}
 
-   for (i = 0; i  pages; i++) {
-   entry-busaddr[i] = vtophys(entry-handle + i * PAGE_SIZE);
+   ret = bus_dmamem_alloc(dmah-tag, dmah-vaddr,
+   BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_NOCACHE, dmah-map);
+   if (ret != 0) {
+   bus_dma_tag_destroy(dmah-tag);
+   free(dmah, DRM_MEM_DMA);
+   free(entry-busaddr, DRM_MEM_PAGES);
+   free(entry, DRM_MEM_SGLISTS);
+   return ENOMEM;
}
 
+   ret = bus_dmamap_load(dmah-tag, dmah-map, dmah-vaddr,
+   request-size, drm_sg_alloc_cb, entry, 0);
+   if (ret != 0) {
+   bus_dmamem_free(dmah-tag, dmah-vaddr, dmah-map);
+   bus_dma_tag_destroy(dmah-tag);
+   free(dmah, DRM_MEM_DMA);
+   free(entry-busaddr, DRM_MEM_PAGES);
+   free(entry, DRM_MEM_SGLISTS);
+   return ENOMEM;
+ 

svn commit: r186296 - head/sys/dev/ata/chipsets

2008-12-18 Thread Alexander Motin
Author: mav
Date: Thu Dec 18 21:13:46 2008
New Revision: 186296
URL: http://svn.freebsd.org/changeset/base/186296

Log:
  Before modularization commit, atapci driver was attaching only to devices of
  storage class. This check was lost. It is not important for the most cases,
  but as it was reported on current@, it does important for sis driver and
  surely inportant for AHCI driver. So restore it there.
  
  Submitted by:   Toshikazu ICHINOSEKI, Andrey V. Elsukov
  Discussed on:   current@

Modified:
  head/sys/dev/ata/chipsets/ata-ahci.c
  head/sys/dev/ata/chipsets/ata-sis.c

Modified: head/sys/dev/ata/chipsets/ata-ahci.c
==
--- head/sys/dev/ata/chipsets/ata-ahci.cThu Dec 18 21:04:50 2008
(r186295)
+++ head/sys/dev/ata/chipsets/ata-ahci.cThu Dec 18 21:13:46 2008
(r186296)
@@ -73,8 +73,9 @@ ata_ahci_probe(device_t dev)
 char buffer[64];
 
 /* is this a possible AHCI candidate ? */
-if (pci_get_subclass(dev) != PCIS_STORAGE_SATA)
-   return ENXIO;
+if (pci_get_class(dev) != PCIC_STORAGE ||
+   pci_get_subclass(dev) != PCIS_STORAGE_SATA)
+   return (ENXIO);
 
 /* is this PCI device flagged as an AHCI compliant chip ? */
 if (pci_read_config(dev, PCIR_PROGIF, 1) != PCIP_STORAGE_SATA_AHCI_1_0)

Modified: head/sys/dev/ata/chipsets/ata-sis.c
==
--- head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:04:50 2008
(r186295)
+++ head/sys/dev/ata/chipsets/ata-sis.c Thu Dec 18 21:13:46 2008
(r186296)
@@ -105,6 +105,9 @@ ata_sis_probe(device_t dev)
 char buffer[64];
 int found = 0;
 
+if (pci_get_class(dev) != PCIC_STORAGE)
+   return (ENXIO);
+
 if (pci_get_vendor(dev) != ATA_SIS_ID)
return ENXIO;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186298 - head/sbin/ipfw

2008-12-18 Thread Paolo Pisati
Author: piso
Date: Thu Dec 18 21:46:18 2008
New Revision: 186298
URL: http://svn.freebsd.org/changeset/base/186298

Log:
  Update the ipfw man page to reflect last change (-q option with nat option).
  
  MFC after:3 days

Modified:
  head/sbin/ipfw/ipfw.8

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Thu Dec 18 21:37:31 2008(r186297)
+++ head/sbin/ipfw/ipfw.8   Thu Dec 18 21:46:18 2008(r186298)
@@ -69,6 +69,7 @@
 .Op Ar number ...
 .Pp
 .Nm
+.Op Fl q
 .Cm nat
 .Ar number
 .Cm config
@@ -235,6 +236,7 @@ Try to resolve addresses and service nam
 .It Fl q
 While
 .Cm add Ns ing ,
+.Cm nat Ns ing ,
 .Cm zero Ns ing ,
 .Cm resetlog Ns ging
 or
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r186296 - head/sys/dev/ata/chipsets

2008-12-18 Thread Alexander Motin

Niclas Zeising wrote:

Alexander Motin wrote:

Author: mav
Date: Thu Dec 18 21:13:46 2008
New Revision: 186296
URL: http://svn.freebsd.org/changeset/base/186296

Log:
  Before modularization commit, atapci driver was attaching only to 
devices of
  storage class. This check was lost. It is not important for the most 
cases,
  but as it was reported on current@, it does important for sis driver 
and

  surely inportant for AHCI driver. So restore it there.
Submitted by:   Toshikazu ICHINOSEKI, Andrey V. Elsukov
  Discussed on:   current@

--- head/sys/dev/ata/chipsets/ata-sis.cThu Dec 18 21:04:50 2008
(r186295)
+++ head/sys/dev/ata/chipsets/ata-sis.cThu Dec 18 21:13:46 2008
(r186296)

@@ -105,6 +105,9 @@ ata_sis_probe(device_t dev)
 char buffer[64];
 int found = 0;
 
+if (pci_get_class(dev) != PCIC_STORAGE)

+return (ENXIO);
+
 if (pci_get_vendor(dev) != ATA_SIS_ID)
 return ENXIO;


With this change, am I able to boot from a harddrive located on a 
SiS-controller again? Or is that more likely a different issue?
I have't investigated my issue properly due to lack of time, so I don't 
know exactly what's wrong, only that it can't find the hard drive properly.


I have no idea what your problem is, I am just a man. :) But if your 
problem appeared on 8-CURRENT about two months ago, then it may be it 
and so may be solved.


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


svn commit: r186299 - head/sys/dev/drm

2008-12-18 Thread Robert Noland
Author: rnoland
Date: Thu Dec 18 21:58:57 2008
New Revision: 186299
URL: http://svn.freebsd.org/changeset/base/186299

Log:
  We only want drm to ever attach to the primary pci device.
  Intel 855 chips present the same pci id for both heads.  This prevents
  us from attaching to the dummy second head.  All other chips that I
  am aware of either only present a single pci id, or different ids
  for each head so that we only match on the correct head.
  
  Approved by:  kib@
  MFC after:2 weeks

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_drv.c

Modified: head/sys/dev/drm/drmP.h
==
--- head/sys/dev/drm/drmP.h Thu Dec 18 21:46:18 2008(r186298)
+++ head/sys/dev/drm/drmP.h Thu Dec 18 21:58:57 2008(r186299)
@@ -87,6 +87,7 @@ struct drm_file;
 #include sys/agpio.h
 #include sys/mutex.h
 #include dev/pci/pcivar.h
+#include dev/pci/pcireg.h
 #include sys/selinfo.h
 #include sys/bus.h
 

Modified: head/sys/dev/drm/drm_drv.c
==
--- head/sys/dev/drm/drm_drv.c  Thu Dec 18 21:46:18 2008(r186298)
+++ head/sys/dev/drm/drm_drv.c  Thu Dec 18 21:58:57 2008(r186299)
@@ -152,6 +152,10 @@ int drm_probe(device_t dev, drm_pci_id_l
device = pci_get_device(dev);
 #endif
 
+   if (pci_get_class(dev) != PCIC_DISPLAY
+   || pci_get_subclass(dev) != PCIS_DISPLAY_VGA)
+   return ENXIO;
+
id_entry = drm_find_description(vendor, device, idlist);
if (id_entry != NULL) {
device_set_desc(dev, id_entry-name);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r186296 - head/sys/dev/ata/chipsets

2008-12-18 Thread Niclas Zeising

Alexander Motin wrote:

Niclas Zeising wrote:

Alexander Motin wrote:

Author: mav
Date: Thu Dec 18 21:13:46 2008
New Revision: 186296
URL: http://svn.freebsd.org/changeset/base/186296

Log:
  Before modularization commit, atapci driver was attaching only to 
devices of
  storage class. This check was lost. It is not important for the 
most cases,
  but as it was reported on current@, it does important for sis 
driver and

  surely inportant for AHCI driver. So restore it there.
Submitted by:   Toshikazu ICHINOSEKI, Andrey V. Elsukov
  Discussed on:   current@

--- head/sys/dev/ata/chipsets/ata-sis.cThu Dec 18 21:04:50 
2008(r186295)
+++ head/sys/dev/ata/chipsets/ata-sis.cThu Dec 18 21:13:46 
2008(r186296)

@@ -105,6 +105,9 @@ ata_sis_probe(device_t dev)
 char buffer[64];
 int found = 0;
 
+if (pci_get_class(dev) != PCIC_STORAGE)

+return (ENXIO);
+
 if (pci_get_vendor(dev) != ATA_SIS_ID)
 return ENXIO;


With this change, am I able to boot from a harddrive located on a 
SiS-controller again? Or is that more likely a different issue?
I have't investigated my issue properly due to lack of time, so I 
don't know exactly what's wrong, only that it can't find the hard 
drive properly.


I have no idea what your problem is, I am just a man. :) But if your 
problem appeared on 8-CURRENT about two months ago, then it may be it 
and so may be solved.


 The dates seems approximately correct... I'm about to do a little 
magic (i.e. shuffeling harddrives around and whatnot) to compile a new 
kernel with the change, hopefully it works :)

//Niclas

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


svn commit: r186300 - head/sys/dev/drm

2008-12-18 Thread Robert Noland
Author: rnoland
Date: Thu Dec 18 22:01:46 2008
New Revision: 186300
URL: http://svn.freebsd.org/changeset/base/186300

Log:
  Garbage collect entries from pcireg.h since we now include it.
  
  Approved by:  kib@
  MFC after:2 weeks

Modified:
  head/sys/dev/drm/drmP.h

Modified: head/sys/dev/drm/drmP.h
==
--- head/sys/dev/drm/drmP.h Thu Dec 18 21:58:57 2008(r186299)
+++ head/sys/dev/drm/drmP.h Thu Dec 18 22:01:46 2008(r186300)
@@ -212,15 +212,6 @@ enum {
 #define DRM_MTRR_WCMDF_WRITECOMBINE
 #define jiffiesticks
 
-/* Capabilities taken from src/sys/dev/pci/pcireg.h. */
-#ifndef PCIY_AGP
-#define PCIY_AGP   0x02
-#endif
-
-#ifndef PCIY_EXPRESS
-#define PCIY_EXPRESS   0x10
-#endif
-
 typedef unsigned long dma_addr_t;
 typedef u_int64_t u64;
 typedef u_int32_t u32;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r186296 - head/sys/dev/ata/chipsets

2008-12-18 Thread Niclas Zeising

Jens Schweikhardt wrote:

On Thu, Dec 18, 2008 at 10:45:25PM +0100, Niclas Zeising wrote:
...
# With this change, am I able to boot from a harddrive located on a 
# SiS-controller again? Or is that more likely a different issue?
# I have't investigated my issue properly due to lack of time, so I don't 
# know exactly what's wrong, only that it can't find the hard drive properly.

# Regards!
# //Niclas

Is your error message by chance something like this:

Can't work out which disk we are booting from. Guessed BIOS device
0x not found by probes, defaulting to disk0?

This is what I get since about December 5th on 8-CURRENT. I'm in
the process of nailing it down to a single commit.

Regards,

Jens


Nope, That's not it. I get errors when trying to mount root, after 
booting kernel. It can't find the harddrive...

//Niclas

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


Re: svn commit: r186296 - head/sys/dev/ata/chipsets

2008-12-18 Thread Jens Schweikhardt
On Thu, Dec 18, 2008 at 10:45:25PM +0100, Niclas Zeising wrote:
...
# With this change, am I able to boot from a harddrive located on a 
# SiS-controller again? Or is that more likely a different issue?
# I have't investigated my issue properly due to lack of time, so I don't 
# know exactly what's wrong, only that it can't find the hard drive properly.
# Regards!
# //Niclas

Is your error message by chance something like this:

Can't work out which disk we are booting from. Guessed BIOS device
0x not found by probes, defaulting to disk0?

This is what I get since about December 5th on 8-CURRENT. I'm in
the process of nailing it down to a single commit.

Regards,

Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186303 - in stable/7/sys: . contrib/pf dev/bce dev/cxgb

2008-12-18 Thread Xin LI
Author: delphij
Date: Fri Dec 19 00:14:45 2008
New Revision: 186303
URL: http://svn.freebsd.org/changeset/base/186303

Log:
  MFC r186168:
  
  Test whether sc-tx_mbuf_map[i], not whether sc-tx_mbuf_map is NULL before
  doing bus_dmamap_sync() since it operates on the former, not the latter.
  
  Approved by:  re (kensmith)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/bce/if_bce.c
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bce/if_bce.c
==
--- stable/7/sys/dev/bce/if_bce.c   Thu Dec 18 23:00:09 2008
(r186302)
+++ stable/7/sys/dev/bce/if_bce.c   Fri Dec 19 00:14:45 2008
(r186303)
@@ -5114,7 +5114,7 @@ bce_free_tx_chain(struct bce_softc *sc)
/* Unmap, unload, and free any mbufs still in the TX mbuf chain. */
for (i = 0; i  TOTAL_TX_BD; i++) {
if (sc-tx_mbuf_ptr[i] != NULL) {
-   if (sc-tx_mbuf_map != NULL)
+   if (sc-tx_mbuf_map[i] != NULL)
bus_dmamap_sync(sc-tx_mbuf_tag, 
sc-tx_mbuf_map[i],
BUS_DMASYNC_POSTWRITE);
m_freem(sc-tx_mbuf_ptr[i]);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186304 - in stable/7/sys: . contrib/pf dev/bce dev/cxgb

2008-12-18 Thread Xin LI
Author: delphij
Date: Fri Dec 19 00:17:09 2008
New Revision: 186304
URL: http://svn.freebsd.org/changeset/base/186304

Log:
  MFC r186169:
  
  Don't count InFramesL2FilterDiscards into Ierr.  This value does not represent
  a real packet error but simply indicate that an unexpected unicast or 
multicast
  error was received by the NIC, which was not counted in the past as well.
  
  Reported by:  many (on -stable@)
  Reviewed by:  davidch
  Approved by:  re (kensmith)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/bce/if_bce.c
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bce/if_bce.c
==
--- stable/7/sys/dev/bce/if_bce.c   Fri Dec 19 00:14:45 2008
(r186303)
+++ stable/7/sys/dev/bce/if_bce.c   Fri Dec 19 00:17:09 2008
(r186304)
@@ -7408,7 +7408,6 @@ bce_stats_update(struct bce_softc *sc)
(u_long) sc-stat_IfInMBUFDiscards +
(u_long) sc-stat_Dot3StatsAlignmentErrors +
(u_long) sc-stat_Dot3StatsFCSErrors +
-   (u_long) sc-stat_IfInFramesL2FilterDiscards +
(u_long) sc-stat_IfInRuleCheckerDiscards +
(u_long) sc-stat_IfInFTQDiscards +
(u_long) sc-com_no_buffers;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186305 - in releng/7.1/sys: . contrib/pf dev/bce dev/cxgb

2008-12-18 Thread Xin LI
Author: delphij
Date: Fri Dec 19 00:19:46 2008
New Revision: 186305
URL: http://svn.freebsd.org/changeset/base/186305

Log:
  MFC r186168:
  
  Test whether sc-tx_mbuf_map[i], not whether sc-tx_mbuf_map is NULL before
  doing bus_dmamap_sync() since it operates on the former, not the latter.
  
  Reviewed by:  davidch
  Approved by:  re (kensmith)

Modified:
  releng/7.1/sys/   (props changed)
  releng/7.1/sys/contrib/pf/   (props changed)
  releng/7.1/sys/dev/bce/if_bce.c
  releng/7.1/sys/dev/cxgb/   (props changed)

Modified: releng/7.1/sys/dev/bce/if_bce.c
==
--- releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:17:09 2008
(r186304)
+++ releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:19:46 2008
(r186305)
@@ -5114,7 +5114,7 @@ bce_free_tx_chain(struct bce_softc *sc)
/* Unmap, unload, and free any mbufs still in the TX mbuf chain. */
for (i = 0; i  TOTAL_TX_BD; i++) {
if (sc-tx_mbuf_ptr[i] != NULL) {
-   if (sc-tx_mbuf_map != NULL)
+   if (sc-tx_mbuf_map[i] != NULL)
bus_dmamap_sync(sc-tx_mbuf_tag, 
sc-tx_mbuf_map[i],
BUS_DMASYNC_POSTWRITE);
m_freem(sc-tx_mbuf_ptr[i]);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186306 - in releng/7.1/sys: . contrib/pf dev/bce dev/cxgb

2008-12-18 Thread Xin LI
Author: delphij
Date: Fri Dec 19 00:20:48 2008
New Revision: 186306
URL: http://svn.freebsd.org/changeset/base/186306

Log:
  MFC r186169:
  
  Don't count InFramesL2FilterDiscards into Ierr.  This value does not represent
  a real packet error but simply indicate that an unexpected unicast or 
multicast
  error was received by the NIC, which was not counted in the past as well.
  
  Reported by:  many (on -stable@)
  Reviewed by:  davidch
  Approved by:  re (kensmith)

Modified:
  releng/7.1/sys/   (props changed)
  releng/7.1/sys/contrib/pf/   (props changed)
  releng/7.1/sys/dev/bce/if_bce.c
  releng/7.1/sys/dev/cxgb/   (props changed)

Modified: releng/7.1/sys/dev/bce/if_bce.c
==
--- releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:19:46 2008
(r186305)
+++ releng/7.1/sys/dev/bce/if_bce.c Fri Dec 19 00:20:48 2008
(r186306)
@@ -7408,7 +7408,6 @@ bce_stats_update(struct bce_softc *sc)
(u_long) sc-stat_IfInMBUFDiscards +
(u_long) sc-stat_Dot3StatsAlignmentErrors +
(u_long) sc-stat_Dot3StatsFCSErrors +
-   (u_long) sc-stat_IfInFramesL2FilterDiscards +
(u_long) sc-stat_IfInRuleCheckerDiscards +
(u_long) sc-stat_IfInFTQDiscards +
(u_long) sc-com_no_buffers;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186308 - head/usr.sbin/ppp

2008-12-18 Thread Qing Li
Author: qingli
Date: Fri Dec 19 01:37:20 2008
New Revision: 186308
URL: http://svn.freebsd.org/changeset/base/186308

Log:
  The ppp application relies on the if_tun interface to properly
  install a p2p host route between the end points. The ppp module
  upates this router based on user configuration later on. The
  rt_Update() seems to always set the RTF_GATEWAY flag, which is
  broken.

Modified:
  head/usr.sbin/ppp/route.c

Modified: head/usr.sbin/ppp/route.c
==
--- head/usr.sbin/ppp/route.c   Fri Dec 19 00:56:47 2008(r186307)
+++ head/usr.sbin/ppp/route.c   Fri Dec 19 01:37:20 2008(r186308)
@@ -910,8 +910,10 @@ rt_Update(struct bundle *bundle, const s
 p += memcpy_roundup(p, dst, dst-sa_len);
   }
 
-  rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
+  if (gw != NULL  (gw-sa_family != AF_LINK))
+rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
   p += memcpy_roundup(p, gw, gw-sa_len);
+
   if (mask) {
 rtmes.m_rtm.rtm_addrs |= RTA_NETMASK;
 p += memcpy_roundup(p, mask, mask-sa_len);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186309 - in stable/7/sys: . contrib/pf dev/cxgb nfsserver

2008-12-18 Thread Ken Smith
Author: kensmith
Date: Fri Dec 19 03:59:20 2008
New Revision: 186309
URL: http://svn.freebsd.org/changeset/base/186309

Log:
  MFC r186165:
   Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition
   to failing with that error.
  
   PR:   125149
   Submitted by: Jaakko Heinonen (jh at saunalahti dot fi)
   Reviewed by:  mohans, kan
  
  Approved by:  re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/nfsserver/nfs_serv.c

Modified: stable/7/sys/nfsserver/nfs_serv.c
==
--- stable/7/sys/nfsserver/nfs_serv.c   Fri Dec 19 01:37:20 2008
(r186308)
+++ stable/7/sys/nfsserver/nfs_serv.c   Fri Dec 19 03:59:20 2008
(r186309)
@@ -3600,9 +3600,12 @@ again:
 * Probe one of the directory entries to see if the filesystem
 * supports VGET.
 */
-   if (VFS_VGET(vp-v_mount, dp-d_fileno, LK_EXCLUSIVE, nvp) ==
-   EOPNOTSUPP) {
-   error = NFSERR_NOTSUPP;
+   error = VFS_VGET(vp-v_mount, dp-d_fileno, LK_EXCLUSIVE, nvp);
+   if (error) {
+   if (error == EOPNOTSUPP)
+   error = NFSERR_NOTSUPP;
+   else
+   error = NFSERR_SERVERFAULT;
vrele(vp);
vp = NULL;
free((caddr_t)cookies, M_TEMP);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186310 - releng/7.1/sys/nfsserver

2008-12-18 Thread Ken Smith
Author: kensmith
Date: Fri Dec 19 04:02:16 2008
New Revision: 186310
URL: http://svn.freebsd.org/changeset/base/186310

Log:
  MFC r186165:
   Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition
   to failing with that error.
  
   PR:   125149
   Submitted by: Jaakko Heinonen (jh at saunalahti dot fi)
   Reviewed by:  mohans, kan
  
  Approved by:re (kib)

Modified:
  releng/7.1/sys/nfsserver/nfs_serv.c

Modified: releng/7.1/sys/nfsserver/nfs_serv.c
==
--- releng/7.1/sys/nfsserver/nfs_serv.c Fri Dec 19 03:59:20 2008
(r186309)
+++ releng/7.1/sys/nfsserver/nfs_serv.c Fri Dec 19 04:02:16 2008
(r186310)
@@ -3600,9 +3600,12 @@ again:
 * Probe one of the directory entries to see if the filesystem
 * supports VGET.
 */
-   if (VFS_VGET(vp-v_mount, dp-d_fileno, LK_EXCLUSIVE, nvp) ==
-   EOPNOTSUPP) {
-   error = NFSERR_NOTSUPP;
+   error = VFS_VGET(vp-v_mount, dp-d_fileno, LK_EXCLUSIVE, nvp);
+   if (error) {
+   if (error == EOPNOTSUPP)
+   error = NFSERR_NOTSUPP;
+   else
+   error = NFSERR_SERVERFAULT;
vrele(vp);
vp = NULL;
free((caddr_t)cookies, M_TEMP);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186311 - in releng/7.1/sys/dev/cxgb: . common ulp/tom

2008-12-18 Thread Kip Macy
Author: kmacy
Date: Fri Dec 19 05:05:35 2008
New Revision: 186311
URL: http://svn.freebsd.org/changeset/base/186311

Log:
  Log:
   MFC 183967, 184861, 185157
  
   183967:
   Track number of packets transmitted and number of packets received
   PR:   125806
  
   184861:
   Update firmware version check
make ddp a tunable
  
Obtained from:Chelsio Inc.
  
   185157:
Several small additions to the Chelsio 10G driver.
  
1) Fix a bug in dealing with the Alerus 1006 PHY which prevented the
device from ever coming back up once it had been set to down.
  
2) Add a kernel tunable (hw.cxgb.snd_queue_len) which makes it possible
to give the device more than IFQ_MAXLEN entries in its send queue.  The
default remains 50.
  
3) Add code to place the card'd identification and serial number into
its description (%desc) so that users can tell which card they have
installed.
  
  Approved by:  re

Modified:
  releng/7.1/sys/dev/cxgb/common/cxgb_common.h
  releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h
  releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c
  releng/7.1/sys/dev/cxgb/cxgb_main.c
  releng/7.1/sys/dev/cxgb/cxgb_sge.c
  releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
  releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom.c
  releng/7.1/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c

Modified: releng/7.1/sys/dev/cxgb/common/cxgb_common.h
==
--- releng/7.1/sys/dev/cxgb/common/cxgb_common.hFri Dec 19 04:02:16 
2008(r186310)
+++ releng/7.1/sys/dev/cxgb/common/cxgb_common.hFri Dec 19 05:05:35 
2008(r186311)
@@ -41,6 +41,7 @@ enum {
MAX_FRAME_SIZE = 10240, /* max MAC frame size, includes header + FCS */
EEPROMSIZE = 8192,  /* Serial EEPROM size */
SERNUM_LEN = 16,/* Serial # length */
+   ECNUM_LEN  = 16,/* EC # length */
RSS_TABLE_SIZE = 64,/* size of RSS lookup and mapping tables */
TCB_SIZE   = 128,   /* TCB size */
NMTUS  = 16,/* size of MTU table */
@@ -342,6 +343,7 @@ struct vpd_params {
unsigned int mdc;
unsigned int mem_timing;
u8 sn[SERNUM_LEN + 1];
+   u8 ec[ECNUM_LEN + 1];
u8 eth_base[6];
u8 port_type[MAX_NPORTS];
unsigned short xauicfg[2];

Modified: releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h
==
--- releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h  Fri Dec 19 04:02:16 
2008(r186310)
+++ releng/7.1/sys/dev/cxgb/common/cxgb_ctl_defs.h  Fri Dec 19 05:05:35 
2008(r186311)
@@ -85,7 +85,7 @@ struct ddp_params {
 
 struct adap_ports {
unsigned int nports; /* number of ports on this adapter */
-   struct net_device *lldevs[2];
+   struct net_device *lldevs[MAX_NPORTS];
 };
 
 /*

Modified: releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c
==
--- releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Dec 19 04:02:16 2008
(r186310)
+++ releng/7.1/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Dec 19 05:05:35 2008
(r186311)
@@ -560,7 +560,7 @@ struct t3_vpd {
u8  vpdr_tag;
u8  vpdr_len[2];
VPD_ENTRY(pn, 16); /* part number */
-   VPD_ENTRY(ec, 16); /* EC level */
+   VPD_ENTRY(ec, ECNUM_LEN);  /* EC level */
VPD_ENTRY(sn, SERNUM_LEN); /* serial number */
VPD_ENTRY(na, 12); /* MAC address base */
VPD_ENTRY(cclk, 6);/* core clock */
@@ -705,6 +705,7 @@ static int get_vpd_params(adapter_t *ada
p-mdc = simple_strtoul(vpd.mdc_data, NULL, 10);
p-mem_timing = simple_strtoul(vpd.mt_data, NULL, 10);
memcpy(p-sn, vpd.sn_data, SERNUM_LEN);
+   memcpy(p-ec, vpd.ec_data, ECNUM_LEN);
 
/* Old eeproms didn't have port information */
if (adapter-params.rev == 0  !vpd.port0_data[0]) {
@@ -749,7 +750,8 @@ enum {
SF_ERASE_SECTOR = 0xd8,/* erase sector */
 
FW_FLASH_BOOT_ADDR = 0x7, /* start address of FW in flash */
-   FW_VERS_ADDR = 0x77ffc,/* flash address holding FW version */
+   OLD_FW_VERS_ADDR = 0x77ffc,   /* flash address holding FW version */
+   FW_VERS_ADDR = 0x7fffc,/* flash address holding FW version */
FW_MIN_SIZE = 8,   /* at least version and csum */
FW_MAX_SIZE = FW_VERS_ADDR - FW_FLASH_BOOT_ADDR,
 
@@ -1036,7 +1038,12 @@ enum fw_version_type {
  */
 int t3_get_fw_version(adapter_t *adapter, u32 *vers)
 {
-   return t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0);
+   int ret = t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0);
+
+   if (!ret  *vers != 0x)
+   return 0;
+   else
+   return t3_read_flash(adapter, OLD_FW_VERS_ADDR, 1, vers, 0);
 }
 

Re: svn commit: r186296 - head/sys/dev/ata/chipsets

2008-12-18 Thread Niclas Zeising

Alexander Motin wrote:

Niclas Zeising wrote:

Alexander Motin wrote:

Author: mav
Date: Thu Dec 18 21:13:46 2008
New Revision: 186296
URL: http://svn.freebsd.org/changeset/base/186296

Log:
  Before modularization commit, atapci driver was attaching only to 
devices of
  storage class. This check was lost. It is not important for the 
most cases,
  but as it was reported on current@, it does important for sis 
driver and

  surely inportant for AHCI driver. So restore it there.
Submitted by:   Toshikazu ICHINOSEKI, Andrey V. Elsukov
  Discussed on:   current@

--- head/sys/dev/ata/chipsets/ata-sis.cThu Dec 18 21:04:50 
2008(r186295)
+++ head/sys/dev/ata/chipsets/ata-sis.cThu Dec 18 21:13:46 
2008(r186296)

@@ -105,6 +105,9 @@ ata_sis_probe(device_t dev)
 char buffer[64];
 int found = 0;
 
+if (pci_get_class(dev) != PCIC_STORAGE)

+return (ENXIO);
+
 if (pci_get_vendor(dev) != ATA_SIS_ID)
 return ENXIO;


With this change, am I able to boot from a harddrive located on a 
SiS-controller again? Or is that more likely a different issue?
I have't investigated my issue properly due to lack of time, so I 
don't know exactly what's wrong, only that it can't find the hard 
drive properly.


I have no idea what your problem is, I am just a man. :) But if your 
problem appeared on 8-CURRENT about two months ago, then it may be it 
and so may be solved.




Apparently you're more than a man :). I just wanted you to know that the 
fix worked, my harddrives located on the SiS controller are detected 
again, thanks a lot for the catch!

Regards!
//Niclas

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


svn commit: r186313 - releng/7.1/share/man/man4

2008-12-18 Thread Kip Macy
Author: kmacy
Date: Fri Dec 19 06:34:57 2008
New Revision: 186313
URL: http://svn.freebsd.org/changeset/base/186313

Log:
  MFC 185970
  
  fix support and capabilities
  
  Approved by:  re

Modified:
  releng/7.1/share/man/man4/cxgb.4

Modified: releng/7.1/share/man/man4/cxgb.4
==
--- releng/7.1/share/man/man4/cxgb.4Fri Dec 19 06:33:18 2008
(r186312)
+++ releng/7.1/share/man/man4/cxgb.4Fri Dec 19 06:34:57 2008
(r186313)
@@ -1,4 +1,4 @@
-.\ Copyright (c) 2007, Chelsio Inc
+.\ Copyright (c) 2007-2008, Chelsio Inc
 .\ All rights reserved.
 .\
 .\ Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,8 @@ if_cxgb_load=YES
 The
 .Nm
 driver supports Transmit/Receive checksum offload,
-Jumbo Frames as well as TCP segmentation offload (TSO).
+Jumbo Frames, TCP segmentation offload (TSO), Large Receive Offload (LRO),
+VLAN hardware insertion / extraction, and VLAN checksum offload.
 For further hardware information, see
 .Pa http://www.chelsio.com/ .
 .Pp
@@ -76,7 +77,7 @@ For more information on configuring this
 .Sh HARDWARE
 The
 .Nm
-driver supports 10 Gigabit Ethernet adapters based on the T3 and T3B chipset:
+driver supports 10 Gigabit and 1 Gigabit Ethernet adapters based on the T3 and 
T3B chipset:
 .Pp
 .Bl -bullet -compact
 .It
@@ -111,7 +112,7 @@ go to the Chelsio support website at:
 If an issue is identified with the released source code on the supported kernel
 with a supported adapter, email the specific information related to the
 issue to
-.Aq h...@chelsio.com .
+.Aq supp...@chelsio.com .
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186314 - head/lib/libutil

2008-12-18 Thread Joe Marcus Clarke
Author: marcus (doc,ports committer)
Date: Fri Dec 19 06:47:59 2008
New Revision: 186314
URL: http://svn.freebsd.org/changeset/base/186314

Log:
  Initialize the cntp pointer to 0 prior to doing any work so that callers
  don't try to iterate through garbage or NULL memory.  Additionally, return
  NULL instead of 0 on error.
  
  Reviewed by:  peter
  Approved by:  peter

Modified:
  head/lib/libutil/kinfo_getfile.c
  head/lib/libutil/kinfo_getvmmap.c

Modified: head/lib/libutil/kinfo_getfile.c
==
--- head/lib/libutil/kinfo_getfile.cFri Dec 19 06:34:57 2008
(r186313)
+++ head/lib/libutil/kinfo_getfile.cFri Dec 19 06:47:59 2008
(r186314)
@@ -19,6 +19,7 @@ kinfo_getfile(pid_t pid, int *cntp)
char *buf, *bp, *eb;
struct kinfo_file *kif, *kp, *kf;
 
+   *cntp = 0;
len = 0;
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
@@ -27,15 +28,15 @@ kinfo_getfile(pid_t pid, int *cntp)
 
error = sysctl(mib, 4, NULL, len, NULL, 0);
if (error)
-   return (0);
+   return (NULL);
len = len * 4 / 3;
buf = malloc(len);
if (buf == NULL)
-   return (0);
+   return (NULL);
error = sysctl(mib, 4, buf, len, NULL, 0);
if (error) {
free(buf);
-   return (0);
+   return (NULL);
}
/* Pass 1: count items */
cnt = 0;
@@ -50,7 +51,7 @@ kinfo_getfile(pid_t pid, int *cntp)
kif = calloc(cnt, sizeof(*kif));
if (kif == NULL) {
free(buf);
-   return (0);
+   return (NULL);
}
bp = buf;
eb = buf + len;

Modified: head/lib/libutil/kinfo_getvmmap.c
==
--- head/lib/libutil/kinfo_getvmmap.c   Fri Dec 19 06:34:57 2008
(r186313)
+++ head/lib/libutil/kinfo_getvmmap.c   Fri Dec 19 06:47:59 2008
(r186314)
@@ -19,6 +19,7 @@ kinfo_getvmmap(pid_t pid, int *cntp)
char *buf, *bp, *eb;
struct kinfo_vmentry *kiv, *kp, *kv;
 
+   *cntp = 0;
len = 0;
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
@@ -27,15 +28,15 @@ kinfo_getvmmap(pid_t pid, int *cntp)
 
error = sysctl(mib, 4, NULL, len, NULL, 0);
if (error)
-   return (0);
+   return (NULL);
len = len * 4 / 3;
buf = malloc(len);
if (buf == NULL)
-   return (0);
+   return (NULL);
error = sysctl(mib, 4, buf, len, NULL, 0);
if (error) {
free(buf);
-   return (0);
+   return (NULL);
}
/* Pass 1: count items */
cnt = 0;
@@ -50,7 +51,7 @@ kinfo_getvmmap(pid_t pid, int *cntp)
kiv = calloc(cnt, sizeof(*kiv));
if (kiv == NULL) {
free(buf);
-   return (0);
+   return (NULL);
}
bp = buf;
eb = buf + len;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r186315 - head/usr.bin/procstat

2008-12-18 Thread Joe Marcus Clarke
Author: marcus (doc,ports committer)
Date: Fri Dec 19 06:50:15 2008
New Revision: 186315
URL: http://svn.freebsd.org/changeset/base/186315

Log:
  Do not segfault when procstat -f or procstat -v is called on a process not
  owned by the current user.  If kinfo_getfile() or kinfo_getvmmap() return
  NULL, simply exit, and do not try and derefernce the memory.
  
  Reviewed by:  peter
  Approved by:  peter

Modified:
  head/usr.bin/procstat/procstat_files.c
  head/usr.bin/procstat/procstat_vm.c

Modified: head/usr.bin/procstat/procstat_files.c
==
--- head/usr.bin/procstat/procstat_files.c  Fri Dec 19 06:47:59 2008
(r186314)
+++ head/usr.bin/procstat/procstat_files.c  Fri Dec 19 06:50:15 2008
(r186315)
@@ -144,6 +144,8 @@ procstat_files(pid_t pid, struct kinfo_p
PRO, NAME);
 
freep = kinfo_getfile(pid, cnt);
+   if (freep == NULL)
+   return;
for (i = 0; i  cnt; i++) {
kif = freep[i];


Modified: head/usr.bin/procstat/procstat_vm.c
==
--- head/usr.bin/procstat/procstat_vm.c Fri Dec 19 06:47:59 2008
(r186314)
+++ head/usr.bin/procstat/procstat_vm.c Fri Dec 19 06:50:15 2008
(r186315)
@@ -54,6 +54,8 @@ procstat_vm(pid_t pid, struct kinfo_proc
PRES, REF, SHD, FL, TP, PATH);
 
freep = kinfo_getvmmap(pid, cnt);
+   if (freep == NULL)
+   return;
for (i = 0; i  cnt; i++) {
kve = freep[i];
printf(%5d , pid);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org