svn commit: r220650 - head/sys/cam/ata

2011-04-15 Thread Alexander Motin
Author: mav
Date: Fri Apr 15 07:07:29 2011
New Revision: 220650
URL: http://svn.freebsd.org/changeset/base/220650

Log:
  Make ada(4) driver put ATA disks into sleep state on suspend.
  
  Submitted by: jkim (original version)

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Fri Apr 15 03:09:27 2011(r220649)
+++ head/sys/cam/ata/ata_da.c   Fri Apr 15 07:07:29 2011(r220650)
@@ -180,6 +180,8 @@ static void adagetparams(struct cam_per
struct ccb_getdev *cgd);
 static timeout_t   adasendorderedtag;
 static voidadashutdown(void *arg, int howto);
+static voidadasuspend(void *arg);
+static voidadaresume(void *arg);
 
 #ifndef ADA_DEFAULT_TIMEOUT
 #define ADA_DEFAULT_TIMEOUT 30 /* Timeout in seconds */
@@ -197,6 +199,10 @@ static voidadashutdown(void *arg, int 
 #defineADA_DEFAULT_SPINDOWN_SHUTDOWN   1
 #endif
 
+#ifndefADA_DEFAULT_SPINDOWN_SUSPEND
+#defineADA_DEFAULT_SPINDOWN_SUSPEND1
+#endif
+
 #ifndefADA_DEFAULT_WRITE_CACHE
 #defineADA_DEFAULT_WRITE_CACHE 1
 #endif
@@ -213,6 +219,7 @@ static int ada_retry_count = ADA_DEFAULT
 static int ada_default_timeout = ADA_DEFAULT_TIMEOUT;
 static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED;
 static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOWN_SHUTDOWN;
+static int ada_spindown_suspend = ADA_DEFAULT_SPINDOWN_SUSPEND;
 static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE;
 
 SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0,
@@ -229,6 +236,9 @@ TUNABLE_INT(kern.cam.ada.ada_send_order
 SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW,
ada_spindown_shutdown, 0, Spin down upon shutdown);
 TUNABLE_INT(kern.cam.ada.spindown_shutdown, ada_spindown_shutdown);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RW,
+   ada_spindown_suspend, 0, Spin down upon suspend);
+TUNABLE_INT(kern.cam.ada.spindown_suspend, ada_spindown_suspend);
 SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW,
ada_write_cache, 0, Enable disk write cache);
 TUNABLE_INT(kern.cam.ada.write_cache, ada_write_cache);
@@ -525,8 +535,14 @@ adainit(void)
   due to status 0x%x!\n, status);
} else if (ada_send_ordered) {
 
-   /* Register our shutdown event handler */
-   if ((EVENTHANDLER_REGISTER(shutdown_post_sync, adashutdown, 
+   /* Register our event handlers */
+   if ((EVENTHANDLER_REGISTER(power_suspend, adasuspend,
+  NULL, EVENTHANDLER_PRI_LAST)) == 
NULL)
+   printf(adainit: power event registration failed!\n);
+   if ((EVENTHANDLER_REGISTER(power_resume, adaresume,
+  NULL, EVENTHANDLER_PRI_LAST)) == 
NULL)
+   printf(adainit: power event registration failed!\n);
+   if ((EVENTHANDLER_REGISTER(shutdown_post_sync, adashutdown,
   NULL, SHUTDOWN_PRI_DEFAULT)) == NULL)
printf(adainit: shutdown event registration failed!\n);
}
@@ -1372,7 +1388,7 @@ adasendorderedtag(void *arg)
  * sync the disk cache to physical media.
  */
 static void
-adashutdown(void * arg, int howto)
+adaflush(void)
 {
struct cam_periph *periph;
struct ada_softc *softc;
@@ -1424,10 +1440,13 @@ adashutdown(void * arg, int howto)
 /*getcount_only*/0);
cam_periph_unlock(periph);
}
+}
 
-   if (ada_spindown_shutdown == 0 ||
-   (howto  (RB_HALT | RB_POWEROFF)) == 0)
-   return;
+static void
+adaspindown(uint8_t cmd, int flags)
+{
+   struct cam_periph *periph;
+   struct ada_softc *softc;
 
TAILQ_FOREACH(periph, adadriver.units, unit_links) {
union ccb ccb;
@@ -1454,13 +1473,13 @@ adashutdown(void * arg, int howto)
cam_fill_ataio(ccb.ataio,
1,
adadone,
-   CAM_DIR_NONE,
+   CAM_DIR_NONE | flags,
0,
NULL,
0,
ada_default_timeout*1000);
 
-   ata_28bit_cmd(ccb.ataio, ATA_STANDBY_IMMEDIATE, 0, 0, 0);
+   ata_28bit_cmd(ccb.ataio, cmd, 0, 0, 0);
xpt_polled_action(ccb);
 
if ((ccb.ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)
@@ -1476,4 +1495,60 @@ adashutdown(void * arg, int howto)
}
 }
 
+static void
+adashutdown(void *arg, int howto)
+{
+
+   adaflush();
+   if (ada_spindown_shutdown != 0 
+   

Re: svn commit: r220526 - head/sys/kern

2011-04-15 Thread Kostik Belousov
On Thu, Apr 14, 2011 at 05:13:28PM -0400, John Baldwin wrote:
 On Sunday, April 10, 2011 1:07:03 pm Konstantin Belousov wrote:
  Author: kib
  Date: Sun Apr 10 17:07:02 2011
  New Revision: 220526
  URL: http://svn.freebsd.org/changeset/base/220526
  
  Log:
Some callers of proc_reparent() already have the parent process locked.
Detect the situation and avoid process lock recursion.

Reported by:  Fabian Keil freebsd-listen fabiankeil de
  
  Modified:
head/sys/kern/kern_exit.c
 
 Can we instead assert it is always held and fix callers that don't?  Using 
 locked variables is messy and I'd rather avoid it when possible.  We already 
 require the caller to hold other locks for this operation.
 
I agree that this is ugly, and proper fix probably would be something else.
E.g. struct proc could grow another field that holds a pointer to the ucred
it is accounted for, and locked with some global lock.


pgp2mHLtz2SNv.pgp
Description: PGP signature


svn commit: r220651 - stable/8/sys/amd64/amd64

2011-04-15 Thread Konstantin Belousov
Author: kib
Date: Fri Apr 15 10:33:20 2011
New Revision: 220651
URL: http://svn.freebsd.org/changeset/base/220651

Log:
  MFC r220461:
  Remove setting of PCB_FULL_IRET at the places where we are going to call
  update_gdt_{f,g}sbase. The functions set the flag when td == curthread,
  and sysarch is always called with curthread.

Modified:
  stable/8/sys/amd64/amd64/sys_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/sys_machdep.c
==
--- stable/8/sys/amd64/amd64/sys_machdep.c  Fri Apr 15 07:07:29 2011
(r220650)
+++ stable/8/sys/amd64/amd64/sys_machdep.c  Fri Apr 15 10:33:20 2011
(r220651)
@@ -214,7 +214,6 @@ sysarch(td, uap)
if (!error) {
pcb-pcb_fsbase = i386base;
td-td_frame-tf_fs = _ufssel;
-   set_pcb_flags(pcb, PCB_FULL_IRET);
update_gdt_fsbase(td, i386base);
}
break;
@@ -226,7 +225,6 @@ sysarch(td, uap)
error = copyin(uap-parms, i386base, sizeof(i386base));
if (!error) {
pcb-pcb_gsbase = i386base;
-   set_pcb_flags(pcb, PCB_FULL_IRET);
td-td_frame-tf_gs = _ugssel;
update_gdt_gsbase(td, i386base);
}
___
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: r220652 - head/sys/geom/part

2011-04-15 Thread Gavin Atkinson
Author: gavin
Date: Fri Apr 15 12:32:52 2011
New Revision: 220652
URL: http://svn.freebsd.org/changeset/base/220652

Log:
  Remove an incorrect be16toh() that prevented geom_part_apm from working on
  little-endian machines.
  
  Reviewed by:  marcel
  MFC after:2 weeks

Modified:
  head/sys/geom/part/g_part_apm.c

Modified: head/sys/geom/part/g_part_apm.c
==
--- head/sys/geom/part/g_part_apm.c Fri Apr 15 10:33:20 2011
(r220651)
+++ head/sys/geom/part/g_part_apm.c Fri Apr 15 12:32:52 2011
(r220652)
@@ -390,7 +390,7 @@ g_part_apm_probe(struct g_part_table *ba
buf = g_read_data(cp, 0L, pp-sectorsize, error);
if (buf == NULL)
return (error);
-   if (be16dec(buf) == be16toh(APM_DDR_SIG)) {
+   if (be16dec(buf) == APM_DDR_SIG) {
/* Normal Apple DDR */
table-ddr.ddr_sig = be16dec(buf);
table-ddr.ddr_blksize = be16dec(buf + 2);
___
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: r220653 - in head/sys: . arm/mv/orion boot/fdt/dts

2011-04-15 Thread Philip Paeps
Author: philip
Date: Fri Apr 15 13:37:43 2011
New Revision: 220653
URL: http://svn.freebsd.org/changeset/base/220653

Log:
  Add basic support for the Marvell Orion TS-7800.
  
  Submitted by: Kristof Provost kristof -at- freebsd.org

Added:
  head/sys/arm/mv/orion/files.ts7800   (contents, props changed)
  head/sys/arm/mv/orion/std.ts7800   (contents, props changed)
  head/sys/boot/fdt/dts/ts7800.dts   (contents, props changed)
  head/sys/files.ts7800   (contents, props changed)

Added: head/sys/arm/mv/orion/files.ts7800
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/mv/orion/files.ts7800  Fri Apr 15 13:37:43 2011
(r220653)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+arm/mv/orion/orion.c   standard
+

Added: head/sys/arm/mv/orion/std.ts7800
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/mv/orion/std.ts7800Fri Apr 15 13:37:43 2011
(r220653)
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+include../mv/std.mv
+files  ../mv/orion/files.ts7800
+
+makeoptionsKERNPHYSADDR=0x0090
+makeoptionsKERNVIRTADDR=0xc090
+
+optionsKERNPHYSADDR=0x0090
+optionsKERNVIRTADDR=0xc090
+optionsPHYSADDR=0x
+optionsSTARTUP_PAGETABLE_ADDR=0x0010
+options   LOADERRAMADDR=0x
+options   FLASHADDR=0x8000
+

Added: head/sys/boot/fdt/dts/ts7800.dts
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/fdt/dts/ts7800.dtsFri Apr 15 13:37:43 2011
(r220653)
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2010 The FreeBSD Foundation
+ * 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.
+ *
+ * Technologic Systems TS-7800 Device Tree Source.
+ *
+ * $FreeBSD$
+ */
+
+/dts-v1/;
+
+/ {
+   model = mrvl,TS-7800;
+   compatible = DB-88F5182-BP, DB-88F5182-BP-A;
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   ethernet0 = mge0;
+   serial0 = serial0;
+   serial1 = serial1;
+   mpp = MPP;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   cpu@0 {
+   device_type = cpu;
+   compatible = ARM,88FR531;
+   reg = 0x0;
+   d-cache-line-size = 32;   // 32 bytes
+   i-cache-line-size = 32;   // 32 bytes
+   d-cache-size = 0x8000;// L1, 32K
+   i-cache-size = 0x8000;// L1, 32K
+   timebase-frequency = 0;
+   bus-frequency = 0;
+   clock-frequency = 0;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x0 0x0800; // 128M at 0x0
+   };
+
+   localbus@f100 {
+   #address-cells = 2;
+   #size-cells = 1;
+   compatible = mrvl,lbc;
+
+   /* This reflects CPU decode windows setup. */
+   ranges = 0x0 0x0f 0xf930 0x0010
+ 0x1 0x1e 0xfa00 0x0010
+ 0x2 0x1d 0xfa10 0x0200;
+   };
+
+   soc88f5182@f100 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = simple-bus;
+   ranges = 0x0 0xf100 0x0010;
+   

Re: svn commit: r218277 - in stable/7/sys: kern sys

2011-04-15 Thread Andre Albsmeier
On Fri, 04-Feb-2011 at 14:44:59 +, John Baldwin wrote:
 Author: jhb
 Date: Fri Feb  4 14:44:59 2011
 New Revision: 218277
 URL: http://svn.freebsd.org/changeset/base/218277
 
 Log:
   MFC 217075:
   Retire PCONFIG and leave the priority of thread0 alone when waiting for
   interrupt config hooks to execute.
   
   To preserve the KBI, I did not renumber priorities but simply removed
   PCONFIG.
 
 Modified:
   stable/7/sys/kern/subr_autoconf.c
   stable/7/sys/sys/priority.h
 Directory Properties:
   stable/7/sys/   (props changed)
   stable/7/sys/cddl/contrib/opensolaris/   (props changed)
   stable/7/sys/contrib/dev/acpica/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
 
 Modified: stable/7/sys/kern/subr_autoconf.c
 ==
 --- stable/7/sys/kern/subr_autoconf.c Fri Feb  4 14:44:42 2011
 (r218276)
 +++ stable/7/sys/kern/subr_autoconf.c Fri Feb  4 14:44:59 2011
 (r218277)
 @@ -108,7 +108,7 @@ run_interrupt_driven_config_hooks(dummy)
   warned = 0;
   while (!TAILQ_EMPTY(intr_config_hook_list)) {
   if (msleep(intr_config_hook_list, intr_config_hook_lock,
 - PCONFIG, conifhk, WARNING_INTERVAL_SECS * hz) ==
 + 0, conifhk, WARNING_INTERVAL_SECS * hz) ==
   EWOULDBLOCK) {
   mtx_unlock(intr_config_hook_lock);
   warned++;


This broke several of my machines in a somewhat strange way:

After upgrading them (17) to a recent 7-STABLE (as of 2011-04-12)
I noticed that some (4) of them didn't start. All 4 didn't find
their boot device anymore. What they all got in common is:

- an Adaptec 2940 Ultra SCSI adapter
- two SCSI harddisks (da0 and da1) of various brands
- one SCSI CDROM drive (cd0)

To be exact, none of the three devices (da0, da1, cd0) were
detected at all. Other machines with a similar configuration
(2940 and da0/da1) but _without_ the CDROM drive didn't have
any problems. So I simply removed the CDROM drives on the 4
machines in question and they all booted again.

Today I decided to dig into this and after reverting(*) the
above change, they worked with the CDROM again. I have cross-
checked it 3 times. No idea what's happening here...

-Andre

(*) To be honest, I use this patch so I had to modify only one file:

--- sys/kern/subr_autoconf.c.ORI2011-02-05 13:14:11.0 +0100
+++ sys/kern/subr_autoconf.c2011-04-15 14:34:31.0 +0200
@@ -108,7 +108,7 @@
warned = 0;
while (!TAILQ_EMPTY(intr_config_hook_list)) {
if (msleep(intr_config_hook_list, intr_config_hook_lock,
-   0, conifhk, WARNING_INTERVAL_SECS * hz) ==
+   PRI_MIN_KERN + 32, conifhk, WARNING_INTERVAL_SECS * hz) ==
EWOULDBLOCK) {
mtx_unlock(intr_config_hook_lock);
warned++;
___
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: r220654 - head/tools/regression/bin/sh/builtins

2011-04-15 Thread Jilles Tjoelker
Author: jilles
Date: Fri Apr 15 15:14:58 2011
New Revision: 220654
URL: http://svn.freebsd.org/changeset/base/220654

Log:
  sh: Add test for bin/56147.

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

Added: head/tools/regression/bin/sh/builtins/case4.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/case4.0   Fri Apr 15 15:14:58 
2011(r220654)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+set -- *
+case x in
+$1) echo failed ;;
+esac
___
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: r220655 - head/tools/regression/bin/sh/expansion

2011-04-15 Thread Jilles Tjoelker
Author: jilles
Date: Fri Apr 15 15:26:05 2011
New Revision: 220655
URL: http://svn.freebsd.org/changeset/base/220655

Log:
  sh: Add test for obscure and ambiguous ${#?}.

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

Added: head/tools/regression/bin/sh/expansion/length4.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/length4.0Fri Apr 15 15:26:05 
2011(r220655)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+# The construct ${#?} is ambiguous in POSIX.1-2008: it could be the length
+# of $? or it could be $# giving an error in the (impossible) case that it
+# is not set.
+# We use the former interpretation; it seems more useful.
+
+:
+[ ${#?} = 1 ] || echo '${#?} wrong'
+(exit 42)
+[ ${#?} = 2 ] || echo '${#?} wrong'
___
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: r220656 - head/tools/regression/bin/sh/expansion

2011-04-15 Thread Jilles Tjoelker
Author: jilles
Date: Fri Apr 15 15:33:24 2011
New Revision: 220656
URL: http://svn.freebsd.org/changeset/base/220656

Log:
  sh: Add test for bin/12137.

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

Added: head/tools/regression/bin/sh/expansion/length5.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/expansion/length5.0Fri Apr 15 15:33:24 
2011(r220656)
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+unset LC_ALL
+LC_CTYPE=en_US.ISO8859-1
+export LC_CTYPE
+
+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) continue ;;
+   esac
+   e=$e\\$i$j$k
+   done
+   done
+done
+ee=`printf $e`
+[ ${#ee} = 255 ] || echo bad 1
+[ ${#ee} = 255 ] || echo bad 2
+[ $((${#ee})) = 255 ] || echo bad 3
+[ $((${#ee})) = 255 ] || echo bad 4
+set -- $ee
+[ ${#1} = 255 ] || echo bad 5
+[ ${#1} = 255 ] || echo bad 6
+[ $((${#1})) = 255 ] || echo bad 7
+[ $((${#1})) = 255 ] || echo bad 8
___
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: r220657 - head/sys/dev/ahci

2011-04-15 Thread Alexander Motin
Author: mav
Date: Fri Apr 15 16:40:31 2011
New Revision: 220657
URL: http://svn.freebsd.org/changeset/base/220657

Log:
  Some changes around hot-plug and interface power-management:
   - use ATA_SE_EXCHANGED (SError.DIAG.X) bit to detect hot-plug events when
  power-management enabled and ATA_SE_PHY_CHANGED (SError.DIAG.N) can't be
  trusted;
   - on controllers supporting staggered spin-up (SS) put unused channels
  into Listen state instead of Off. It should still save some power, but
  allow plug-in events to be detected;
   - on controllers supporting cold presence detection (CPD), when power
  management enabled, use CPD events to detect hot-plug in addition to PHY
  events.

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci.h

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cFri Apr 15 15:33:24 2011(r220656)
+++ head/sys/dev/ahci/ahci.cFri Apr 15 16:40:31 2011(r220657)
@@ -1272,34 +1272,66 @@ ahci_slotsfree(device_t dev)
}
 }
 
-static void
+static int
 ahci_phy_check_events(device_t dev, u_int32_t serr)
 {
struct ahci_channel *ch = device_get_softc(dev);
 
-   if ((serr  ATA_SE_PHY_CHANGED)  (ch-pm_level == 0)) {
+   if (((ch-pm_level == 0)  (serr  ATA_SE_PHY_CHANGED)) ||
+   ((ch-pm_level != 0 || ch-listening)  (serr  
ATA_SE_EXCHANGED))) {
u_int32_t status = ATA_INL(ch-r_mem, AHCI_P_SSTS);
union ccb *ccb;
 
if (bootverbose) {
-   if (((status  ATA_SS_DET_MASK) == 
ATA_SS_DET_PHY_ONLINE) 
-   ((status  ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) 

-   ((status  ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) {
+   if ((status  ATA_SS_DET_MASK) != ATA_SS_DET_NO_DEVICE)
device_printf(dev, CONNECT requested\n);
-   } else
+   else
device_printf(dev, DISCONNECT requested\n);
}
ahci_reset(dev);
if ((ccb = xpt_alloc_ccb_nowait()) == NULL)
-   return;
+   return (0);
if (xpt_create_path(ccb-ccb_h.path, NULL,
cam_sim_path(ch-sim),
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
xpt_free_ccb(ccb);
-   return;
+   return (0);
}
xpt_rescan(ccb);
+   return (1);
}
+   return (0);
+}
+
+static void
+ahci_cpd_check_events(device_t dev)
+{
+   struct ahci_channel *ch = device_get_softc(dev);
+   u_int32_t status;
+   union ccb *ccb;
+
+   if (ch-pm_level == 0)
+   return;
+
+   status = ATA_INL(ch-r_mem, AHCI_P_CMD);
+   if ((status  AHCI_P_CMD_CPD) == 0)
+   return;
+
+   if (bootverbose) {
+   if (status  AHCI_P_CMD_CPS) {
+   device_printf(dev, COLD CONNECT requested\n);
+   } else
+   device_printf(dev, COLD DISCONNECT requested\n);
+   }
+   ahci_reset(dev);
+   if ((ccb = xpt_alloc_ccb_nowait()) == NULL)
+   return;
+   if (xpt_create_path(ccb-ccb_h.path, NULL, cam_sim_path(ch-sim),
+   CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+   xpt_free_ccb(ccb);
+   return;
+   }
+   xpt_rescan(ccb);
 }
 
 static void
@@ -1359,7 +1391,7 @@ ahci_ch_intr(void *data)
struct ahci_channel *ch = device_get_softc(dev);
uint32_t istatus, sstatus, cstatus, serr = 0, sntf = 0, ok, err;
enum ahci_err_type et;
-   int i, ccs, port;
+   int i, ccs, port, reset = 0;
 
/* Read and clear interrupt statuses. */
istatus = ATA_INL(ch-r_mem, AHCI_P_IS);
@@ -1395,9 +1427,12 @@ ahci_ch_intr(void *data)
serr = ATA_INL(ch-r_mem, AHCI_P_SERR);
if (serr) {
ATA_OUTL(ch-r_mem, AHCI_P_SERR, serr);
-   ahci_phy_check_events(dev, serr);
+   reset = ahci_phy_check_events(dev, serr);
}
}
+   /* Process cold presence detection events */
+   if ((istatus  AHCI_P_IX_CPD)  !reset)
+   ahci_cpd_check_events(dev);
/* Process command errors */
if (istatus  (AHCI_P_IX_OF | AHCI_P_IX_IF |
AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) {
@@ -2446,7 +2481,8 @@ ahci_reset(device_t dev)
ch-devices = 0;
/* Enable wanted port interrupts */
ATA_OUTL(ch-r_mem, AHCI_P_IE,
-   (AHCI_P_IX_CPD | AHCI_P_IX_PRC | AHCI_P_IX_PC));
+   (((ch-pm_level != 0) ? AHCI_P_IX_CPD | AHCI_P_IX_MP : 0) |
+AHCI_P_IX_PRC | 

Re: svn commit: r218277 - in stable/7/sys: kern sys

2011-04-15 Thread John Baldwin
On Friday, April 15, 2011 9:25:25 am Andre Albsmeier wrote:
 On Fri, 04-Feb-2011 at 14:44:59 +, John Baldwin wrote:
  Author: jhb
  Date: Fri Feb  4 14:44:59 2011
  New Revision: 218277
  URL: http://svn.freebsd.org/changeset/base/218277
  
  Log:
MFC 217075:
Retire PCONFIG and leave the priority of thread0 alone when waiting for
interrupt config hooks to execute.

To preserve the KBI, I did not renumber priorities but simply removed
PCONFIG.
  
  Modified:
stable/7/sys/kern/subr_autoconf.c
stable/7/sys/sys/priority.h
  Directory Properties:
stable/7/sys/   (props changed)
stable/7/sys/cddl/contrib/opensolaris/   (props changed)
stable/7/sys/contrib/dev/acpica/   (props changed)
stable/7/sys/contrib/pf/   (props changed)
  
  Modified: stable/7/sys/kern/subr_autoconf.c
  
==
  --- stable/7/sys/kern/subr_autoconf.c   Fri Feb  4 14:44:42 2011
(r218276)
  +++ stable/7/sys/kern/subr_autoconf.c   Fri Feb  4 14:44:59 2011
(r218277)
  @@ -108,7 +108,7 @@ run_interrupt_driven_config_hooks(dummy)
  warned = 0;
  while (!TAILQ_EMPTY(intr_config_hook_list)) {
  if (msleep(intr_config_hook_list, intr_config_hook_lock,
  -   PCONFIG, conifhk, WARNING_INTERVAL_SECS * hz) ==
  +   0, conifhk, WARNING_INTERVAL_SECS * hz) ==
  EWOULDBLOCK) {
  mtx_unlock(intr_config_hook_lock);
  warned++;
 
 
 This broke several of my machines in a somewhat strange way:
 
 After upgrading them (17) to a recent 7-STABLE (as of 2011-04-12)
 I noticed that some (4) of them didn't start. All 4 didn't find
 their boot device anymore. What they all got in common is:
 
 - an Adaptec 2940 Ultra SCSI adapter
 - two SCSI harddisks (da0 and da1) of various brands
 - one SCSI CDROM drive (cd0)
 
 To be exact, none of the three devices (da0, da1, cd0) were
 detected at all. Other machines with a similar configuration
 (2940 and da0/da1) but _without_ the CDROM drive didn't have
 any problems. So I simply removed the CDROM drives on the 4
 machines in question and they all booted again.
 
 Today I decided to dig into this and after reverting(*) the
 above change, they worked with the CDROM again. I have cross-
 checked it 3 times. No idea what's happening here...
 
   -Andre
 
 (*) To be honest, I use this patch so I had to modify only one file:
 
 --- sys/kern/subr_autoconf.c.ORI  2011-02-05 13:14:11.0 +0100
 +++ sys/kern/subr_autoconf.c  2011-04-15 14:34:31.0 +0200
 @@ -108,7 +108,7 @@
   warned = 0;
   while (!TAILQ_EMPTY(intr_config_hook_list)) {
   if (msleep(intr_config_hook_list, intr_config_hook_lock,
 - 0, conifhk, WARNING_INTERVAL_SECS * hz) ==
 + PRI_MIN_KERN + 32, conifhk, WARNING_INTERVAL_SECS * hz) ==
   EWOULDBLOCK) {
   mtx_unlock(intr_config_hook_lock);
   warned++;

Do you get any warnings about CAM timeouts, etc. when these probe?  A verbose 
dmesg might be nice to look at if possible.

-- 
John Baldwin
___
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: r220658 - vendor-sys/acpica/dist/compiler

2011-04-15 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr 15 16:44:04 2011
New Revision: 220658
URL: http://svn.freebsd.org/changeset/base/220658

Log:
  Fix build on FreeBSD.  This patch was submitted upstream:
  
  http://lists.acpica.org/pipermail/devel/2011-April/000253.html
  
  Similar fixes will show up in the next ACPICA release.

Modified:
  vendor-sys/acpica/dist/compiler/dtparser.l
  vendor-sys/acpica/dist/compiler/dtparser.y

Modified: vendor-sys/acpica/dist/compiler/dtparser.l
==
--- vendor-sys/acpica/dist/compiler/dtparser.l  Fri Apr 15 16:40:31 2011
(r220657)
+++ vendor-sys/acpica/dist/compiler/dtparser.l  Fri Apr 15 16:44:04 2011
(r220658)
@@ -130,4 +130,4 @@ DtTerminateLexer (
 {
 
 yy_delete_buffer (LexBuffer);
-}
\ No newline at end of file
+}

Modified: vendor-sys/acpica/dist/compiler/dtparser.y
==
--- vendor-sys/acpica/dist/compiler/dtparser.y  Fri Apr 15 16:40:31 2011
(r220657)
+++ vendor-sys/acpica/dist/compiler/dtparser.y  Fri Apr 15 16:44:04 2011
(r220658)
@@ -53,7 +53,8 @@
 
 UINT64  DtParserResult;/* Global for expression return 
value */
 
-int DtParserlex (void); /* TBD: not sure why this is needed */
+int DtParserlex (void);
+int DtParserparse (void);
 extern char*DtParsertext;
 extern void DtParsererror (char const * msg);
 #define YYFLAG  -32768
@@ -171,7 +172,7 @@ extern DT_FIELD *Gbl_Cur
 #define PR_YYTNAME_START3
 
 #ifdef _USE_BERKELEY_YACC
-#define yytname DtParsername[];
+#define yytname DtParsername
 #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: r220660 - head/sys/dev/iwn

2011-04-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Apr 15 16:55:45 2011
New Revision: 220660
URL: http://svn.freebsd.org/changeset/base/220660

Log:
  Only handle beacon misses while in RUN state and not scanning.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Apr 15 16:50:37 2011(r220659)
+++ head/sys/dev/iwn/if_iwn.c   Fri Apr 15 16:55:45 2011(r220660)
@@ -2463,23 +2463,22 @@ iwn_notif_intr(struct iwn_softc *sc)
BUS_DMASYNC_POSTREAD);
misses = le32toh(miss-consecutive);
 
-   /* XXX not sure why we're notified w/ zero */
-   if (misses == 0)
-   break;
DPRINTF(sc, IWN_DEBUG_STATE,
%s: beacons missed %d/%d\n, __func__,
misses, le32toh(miss-total));
-
/*
 * If more than 5 consecutive beacons are missed,
 * reinitialize the sensitivity state machine.
 */
-   if (vap-iv_state == IEEE80211_S_RUN  misses  5)
-   (void) iwn_init_sensitivity(sc);
-   if (misses = vap-iv_bmissthreshold) {
-   IWN_UNLOCK(sc);
-   ieee80211_beacon_miss(ic);
-   IWN_LOCK(sc);
+   if (vap-iv_state == IEEE80211_S_RUN 
+   (ic-ic_flags  IEEE80211_F_SCAN) != 0) {
+   if (misses  5)
+   (void)iwn_init_sensitivity(sc);
+   if (misses = vap-iv_bmissthreshold) {
+   IWN_UNLOCK(sc);
+   ieee80211_beacon_miss(ic);
+   IWN_LOCK(sc);
+   }
}
break;
}
___
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: r220661 - head/sys/dev/iwn

2011-04-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Apr 15 16:59:56 2011
New Revision: 220661
URL: http://svn.freebsd.org/changeset/base/220661

Log:
  Fixes for firmware handling:
  - there is a local variable for sc-fw_dma, use that instead
  - OpenBSD uses 5*hz to wait for firmware to be loaded
  - in case the firmware module contains invalid data, actually release it

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Apr 15 16:55:45 2011(r220660)
+++ head/sys/dev/iwn/if_iwn.c   Fri Apr 15 16:59:56 2011(r220661)
@@ -5629,10 +5629,10 @@ iwn4965_load_firmware(struct iwn_softc *
 
/* Copy initialization sections into pre-allocated DMA-safe memory. */
memcpy(dma-vaddr, fw-init.data, fw-init.datasz);
-   bus_dmamap_sync(sc-fw_dma.tag, dma-map, BUS_DMASYNC_PREWRITE);
+   bus_dmamap_sync(dma-tag, dma-map, BUS_DMASYNC_PREWRITE);
memcpy(dma-vaddr + IWN4965_FW_DATA_MAXSZ,
fw-init.text, fw-init.textsz);
-   bus_dmamap_sync(sc-fw_dma.tag, dma-map, BUS_DMASYNC_PREWRITE);
+   bus_dmamap_sync(dma-tag, dma-map, BUS_DMASYNC_PREWRITE);
 
/* Tell adapter where to find initialization sections. */
error = iwn_nic_lock(sc);
@@ -5670,10 +5670,10 @@ iwn4965_load_firmware(struct iwn_softc *
 
/* Copy runtime sections into pre-allocated DMA-safe memory. */
memcpy(dma-vaddr, fw-main.data, fw-main.datasz);
-   bus_dmamap_sync(sc-fw_dma.tag, dma-map, BUS_DMASYNC_PREWRITE);
+   bus_dmamap_sync(dma-tag, dma-map, BUS_DMASYNC_PREWRITE);
memcpy(dma-vaddr + IWN4965_FW_DATA_MAXSZ,
fw-main.text, fw-main.textsz);
-   bus_dmamap_sync(sc-fw_dma.tag, dma-map, BUS_DMASYNC_PREWRITE);
+   bus_dmamap_sync(dma-tag, dma-map, BUS_DMASYNC_PREWRITE);
 
/* Tell adapter where to find runtime sections. */
error = iwn_nic_lock(sc);
@@ -5700,7 +5700,7 @@ iwn5000_load_firmware_section(struct iwn
 
/* Copy firmware section into pre-allocated DMA-safe memory. */
memcpy(dma-vaddr, section, size);
-   bus_dmamap_sync(sc-fw_dma.tag, dma-map, BUS_DMASYNC_PREWRITE);
+   bus_dmamap_sync(dma-tag, dma-map, BUS_DMASYNC_PREWRITE);
 
error = iwn_nic_lock(sc);
if (error != 0)
@@ -5726,7 +5726,7 @@ iwn5000_load_firmware_section(struct iwn
iwn_nic_unlock(sc);
 
/* Wait at most five seconds for FH DMA transfer to complete. */
-   return msleep(sc, sc-sc_mtx, PCATCH, iwninit, hz);
+   return msleep(sc, sc-sc_mtx, PCATCH, iwninit, 5 * hz);
 }
 
 static int
@@ -5771,7 +5771,7 @@ iwn_read_firmware_leg(struct iwn_softc *
size_t hdrlen = 24;
uint32_t rev;
 
-   ptr = (const uint32_t *)sc-fw_fp-data;
+   ptr = (const uint32_t *)fw-data;
rev = le32toh(*ptr++);
 
/* Check firmware API version. */
@@ -5819,7 +5819,7 @@ iwn_read_firmware_leg(struct iwn_softc *
 /*
  * Extract text and data sections from a TLV firmware image.
  */
-int
+static int
 iwn_read_firmware_tlv(struct iwn_softc *sc, struct iwn_fw_info *fw,
 uint16_t alt)
 {
@@ -5931,6 +5931,8 @@ iwn_read_firmware(struct iwn_softc *sc)
device_printf(sc-sc_dev,
%s: firmware file too short: %zu bytes\n,
__func__, fw-size);
+   firmware_put(sc-fw_fp, FIRMWARE_UNLOAD);
+   sc-fw_fp = NULL;
return EINVAL;
}
 
@@ -5942,6 +5944,8 @@ iwn_read_firmware(struct iwn_softc *sc)
if (error != 0) {
device_printf(sc-sc_dev,
%s: could not read firmware sections\n, __func__);
+   firmware_put(sc-fw_fp, FIRMWARE_UNLOAD);
+   sc-fw_fp = NULL;
return error;
}
 
@@ -5954,6 +5958,8 @@ iwn_read_firmware(struct iwn_softc *sc)
(fw-boot.textsz  3) != 0) {
device_printf(sc-sc_dev,
%s: firmware sections too large\n, __func__);
+   firmware_put(sc-fw_fp, FIRMWARE_UNLOAD);
+   sc-fw_fp = NULL;
return EINVAL;
}
 
___
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: r220526 - head/sys/kern

2011-04-15 Thread Kostik Belousov
On Fri, Apr 15, 2011 at 12:46:18PM -0400, Attilio Rao wrote:
 2011/4/15 Kostik Belousov kostik...@gmail.com:
  On Thu, Apr 14, 2011 at 05:13:28PM -0400, John Baldwin wrote:
  On Sunday, April 10, 2011 1:07:03 pm Konstantin Belousov wrote:
   Author: kib
   Date: Sun Apr 10 17:07:02 2011
   New Revision: 220526
   URL: http://svn.freebsd.org/changeset/base/220526
  
   Log:
     Some callers of proc_reparent() already have the parent process locked.
     Detect the situation and avoid process lock recursion.
  
     Reported by:      Fabian Keil freebsd-listen fabiankeil de
  
   Modified:
     head/sys/kern/kern_exit.c
 
  Can we instead assert it is always held and fix callers that don't?  Using
  locked variables is messy and I'd rather avoid it when possible.  We 
  already
  require the caller to hold other locks for this operation.
 
  I agree that this is ugly, and proper fix probably would be something else.
  E.g. struct proc could grow another field that holds a pointer to the ucred
  it is accounted for, and locked with some global lock.
 
 As you already hold allproc_lock the process can't be distructed, then
 as I already pointed out to Tomasz, it should alright to just bump the
 refcount for cred and pass down, I guess.
I do not see how allproc_lock is useful there, unless setuid(2) and
other syscalls, which change the process credentials, are protected by
the same lock. The issue there is in accounting for wrong container.
You want to avoid a race between dereferencing stale p_ucred and the
process moving to another container.


pgpEYstB29LCc.pgp
Description: PGP signature


Re: svn commit: r220526 - head/sys/kern

2011-04-15 Thread Attilio Rao
2011/4/15 Kostik Belousov kostik...@gmail.com:
 On Fri, Apr 15, 2011 at 12:46:18PM -0400, Attilio Rao wrote:
 2011/4/15 Kostik Belousov kostik...@gmail.com:
  On Thu, Apr 14, 2011 at 05:13:28PM -0400, John Baldwin wrote:
  On Sunday, April 10, 2011 1:07:03 pm Konstantin Belousov wrote:
   Author: kib
   Date: Sun Apr 10 17:07:02 2011
   New Revision: 220526
   URL: http://svn.freebsd.org/changeset/base/220526
  
   Log:
     Some callers of proc_reparent() already have the parent process 
   locked.
     Detect the situation and avoid process lock recursion.
  
     Reported by:      Fabian Keil freebsd-listen fabiankeil de
  
   Modified:
     head/sys/kern/kern_exit.c
 
  Can we instead assert it is always held and fix callers that don't?  Using
  locked variables is messy and I'd rather avoid it when possible.  We 
  already
  require the caller to hold other locks for this operation.
 
  I agree that this is ugly, and proper fix probably would be something else.
  E.g. struct proc could grow another field that holds a pointer to the ucred
  it is accounted for, and locked with some global lock.

 As you already hold allproc_lock the process can't be distructed, then
 as I already pointed out to Tomasz, it should alright to just bump the
 refcount for cred and pass down, I guess.
 I do not see how allproc_lock is useful there, unless setuid(2) and
 other syscalls, which change the process credentials, are protected by
 the same lock. The issue there is in accounting for wrong container.
 You want to avoid a race between dereferencing stale p_ucred and the
 process moving to another container.

I thought the issue was just prevent destroying of process/ucred I may
need to better look at callers then if you also want to avoid
credentials changes. BTW, a global lock for that is not what I really
hope to see.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
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: r220662 - head/sys/dev/iwn

2011-04-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Apr 15 17:10:52 2011
New Revision: 220662
URL: http://svn.freebsd.org/changeset/base/220662

Log:
  Split out bluetooth coexistence setup.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Apr 15 16:59:56 2011(r220661)
+++ head/sys/dev/iwn/if_iwn.c   Fri Apr 15 17:10:52 2011(r220662)
@@ -196,6 +196,7 @@ static void iwn_tune_sensitivity(struct 
const struct iwn_rx_stats *);
 static int iwn_send_sensitivity(struct iwn_softc *);
 static int iwn_set_pslevel(struct iwn_softc *, int, int, int);
+static int iwn_send_btcoex(struct iwn_softc *);
 static int iwn_config(struct iwn_softc *);
 static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int);
 static int iwn_scan(struct iwn_softc *);
@@ -4464,12 +4465,25 @@ iwn_set_pslevel(struct iwn_softc *sc, in
 }
 
 static int
+iwn_send_btcoex(struct iwn_softc *sc)
+{
+   struct iwn_bluetooth cmd;
+
+   memset(cmd, 0, sizeof cmd);
+   cmd.flags = IWN_BT_COEX_CHAN_ANN | IWN_BT_COEX_BT_PRIO;
+   cmd.lead_time = IWN_BT_LEAD_TIME_DEF;
+   cmd.max_kill = IWN_BT_MAX_KILL_DEF;
+   DPRINTF(sc, IWN_DEBUG_RESET, %s: configuring bluetooth coexistence\n,
+   __func__);
+   return iwn_cmd(sc, IWN_CMD_BT_COEX, cmd, sizeof(cmd), 0);
+}
+
+static int
 iwn_config(struct iwn_softc *sc)
 {
const struct iwn_hal *hal = sc-sc_hal;
struct ifnet *ifp = sc-sc_ifp;
struct ieee80211com *ic = ifp-if_l2com;
-   struct iwn_bluetooth bluetooth;
uint32_t txmask;
int error;
uint16_t rxchain;
@@ -4490,13 +4504,7 @@ iwn_config(struct iwn_softc *sc)
}
 
/* Configure bluetooth coexistence. */
-   memset(bluetooth, 0, sizeof bluetooth);
-   bluetooth.flags = IWN_BT_COEX_CHAN_ANN | IWN_BT_COEX_BT_PRIO;
-   bluetooth.lead_time = IWN_BT_LEAD_TIME_DEF;
-   bluetooth.max_kill = IWN_BT_MAX_KILL_DEF;
-   DPRINTF(sc, IWN_DEBUG_RESET, %s: config bluetooth coexistence\n,
-   __func__);
-   error = iwn_cmd(sc, IWN_CMD_BT_COEX, bluetooth, sizeof bluetooth, 0);
+   error = iwn_send_btcoex(sc);
if (error != 0) {
device_printf(sc-sc_dev,
%s: could not configure bluetooth coexistence, error %d\n,
___
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: r220663 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/dispatcher sys/co...

2011-04-15 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr 15 18:34:27 2011
New Revision: 220663
URL: http://svn.freebsd.org/changeset/base/220663

Log:
  Merge ACPICA 20110413.

Added:
  head/sys/contrib/dev/acpica/compiler/dtparser.l
 - copied, changed from r220658, vendor-sys/acpica/dist/compiler/dtparser.l
  head/sys/contrib/dev/acpica/compiler/dtparser.y
 - copied, changed from r220658, vendor-sys/acpica/dist/compiler/dtparser.y
  head/sys/contrib/dev/acpica/events/evglock.c
 - copied, changed from r220658, vendor-sys/acpica/dist/events/evglock.c
Modified:
  head/sys/conf/files
  head/sys/contrib/dev/acpica/acpica_prep.sh
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/dmtable.c
  head/sys/contrib/dev/acpica/common/dmtbdump.c
  head/sys/contrib/dev/acpica/compiler/aslanalyze.c
  head/sys/contrib/dev/acpica/compiler/aslcompiler.h
  head/sys/contrib/dev/acpica/compiler/aslcompiler.y
  head/sys/contrib/dev/acpica/compiler/asldefine.h
  head/sys/contrib/dev/acpica/compiler/aslglobal.h
  head/sys/contrib/dev/acpica/compiler/asllookup.c
  head/sys/contrib/dev/acpica/compiler/aslmain.c
  head/sys/contrib/dev/acpica/compiler/aslmap.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslpredef.c
  head/sys/contrib/dev/acpica/compiler/asltypes.h
  head/sys/contrib/dev/acpica/compiler/aslutils.c
  head/sys/contrib/dev/acpica/compiler/aslwalks.c
  head/sys/contrib/dev/acpica/compiler/dtcompile.c
  head/sys/contrib/dev/acpica/compiler/dtcompiler.h
  head/sys/contrib/dev/acpica/compiler/dtexpress.c
  head/sys/contrib/dev/acpica/compiler/dtfield.c
  head/sys/contrib/dev/acpica/compiler/dtio.c
  head/sys/contrib/dev/acpica/compiler/dtsubtable.c
  head/sys/contrib/dev/acpica/compiler/dttable.c
  head/sys/contrib/dev/acpica/compiler/dttemplate.c
  head/sys/contrib/dev/acpica/compiler/dttemplate.h
  head/sys/contrib/dev/acpica/compiler/dtutils.c
  head/sys/contrib/dev/acpica/debugger/dbdisply.c
  head/sys/contrib/dev/acpica/dispatcher/dswload.c
  head/sys/contrib/dev/acpica/dispatcher/dswload2.c
  head/sys/contrib/dev/acpica/events/evmisc.c
  head/sys/contrib/dev/acpica/events/evregion.c
  head/sys/contrib/dev/acpica/events/evrgnini.c
  head/sys/contrib/dev/acpica/events/evxfregn.c
  head/sys/contrib/dev/acpica/executer/excreate.c
  head/sys/contrib/dev/acpica/include/acconfig.h
  head/sys/contrib/dev/acpica/include/acevents.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actypes.h
  head/sys/contrib/dev/acpica/include/amlcode.h
  head/sys/contrib/dev/acpica/namespace/nsrepair.c
  head/sys/contrib/dev/acpica/utilities/utdecode.c
  head/sys/modules/acpi/acpi/Makefile
  head/usr.sbin/acpi/acpidb/Makefile
  head/usr.sbin/acpi/iasl/Makefile
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Apr 15 17:10:52 2011(r220662)
+++ head/sys/conf/files Fri Apr 15 18:34:27 2011(r220663)
@@ -190,6 +190,7 @@ contrib/dev/acpica/dispatcher/dswload2.c
 contrib/dev/acpica/dispatcher/dswscope.c   optional acpi
 contrib/dev/acpica/dispatcher/dswstate.c   optional acpi
 contrib/dev/acpica/events/evevent.coptional acpi
+contrib/dev/acpica/events/evglock.coptional acpi
 contrib/dev/acpica/events/evgpe.c  optional acpi
 contrib/dev/acpica/events/evgpeblk.c   optional acpi
 contrib/dev/acpica/events/evgpeinit.c  optional acpi

Modified: head/sys/contrib/dev/acpica/acpica_prep.sh
==
--- head/sys/contrib/dev/acpica/acpica_prep.sh  Fri Apr 15 17:10:52 2011
(r220662)
+++ head/sys/contrib/dev/acpica/acpica_prep.sh  Fri Apr 15 18:34:27 2011
(r220663)
@@ -67,7 +67,7 @@ find ${wrk} -type f -print | xargs -J % 
 
 # canonify include paths
 for H in ${src_headers}; do
-   find ${dst} -name *.[chy] -type f -print |\
+   find ${dst} -name *.[chly] -type f -print |   \
xargs sed -i  -e s|[\]$H[\]|\contrib/dev/acpica/include/$H\|g
 done
 for H in ${comp_headers}; do

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Fri Apr 15 17:10:52 2011
(r220662)
+++ head/sys/contrib/dev/acpica/changes.txt Fri Apr 15 18:34:27 2011
(r220663)
@@ -1,7 +1,83 @@
 
+13 April 2011. Summary of changes for version 20110413:
+
+1) ACPI CA Core Subsystem:
+
+Implemented support to execute a so-called orphan _REG method under the EC 
+device. This change will force the execution of a _REG method underneath the 
EC 
+device even if there is no corresponding operation region of type 
+EmbeddedControl. Fixes a problem seen on some machines and apparently is 
+compatible 

svn commit: r220664 - in stable/8: lib/libc/gen lib/libc/string tools/regression/lib/libc/string

2011-04-15 Thread Jilles Tjoelker
Author: jilles
Date: Fri Apr 15 19:46:25 2011
New Revision: 220664
URL: http://svn.freebsd.org/changeset/base/220664

Log:
  MFC r220376: Allow strerror(0) and strerror_r(0, ...).
  
  Of course, strerror_r() may still fail with ERANGE.
  
  Although the POSIX specification said this could fail with EINVAL and
  doing this likely indicates invalid use of errno, most other
  implementations permitted it, various POSIX testsuites require it to
  work (matching the older sys_errlist array) and apparently some
  applications depend on it.
  
  PR:   standards/151316

Modified:
  stable/8/lib/libc/gen/errlst.c
  stable/8/lib/libc/string/strerror.3
  stable/8/lib/libc/string/strerror.c
  stable/8/tools/regression/lib/libc/string/test-strerror.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/tools/regression/lib/libc/   (props changed)

Modified: stable/8/lib/libc/gen/errlst.c
==
--- stable/8/lib/libc/gen/errlst.c  Fri Apr 15 18:34:27 2011
(r220663)
+++ stable/8/lib/libc/gen/errlst.c  Fri Apr 15 19:46:25 2011
(r220664)
@@ -36,7 +36,7 @@ __FBSDID($FreeBSD$);
 #include stdio.h
 
 const char *const sys_errlist[] = {
-   Undefined error: 0,   /*  0 - ENOERROR */
+   No error: 0,  /*  0 - ENOERROR */
Operation not permitted,  /*  1 - EPERM */
No such file or directory,/*  2 - ENOENT */
No such process,  /*  3 - ESRCH */

Modified: stable/8/lib/libc/string/strerror.3
==
--- stable/8/lib/libc/string/strerror.3 Fri Apr 15 18:34:27 2011
(r220663)
+++ stable/8/lib/libc/string/strerror.3 Fri Apr 15 19:46:25 2011
(r220664)
@@ -32,7 +32,7 @@
 .\ @(#)strerror.3 8.1 (Berkeley) 6/9/93
 .\ $FreeBSD$
 .\
-.Dd October 12, 2004
+.Dd April 5, 2011
 .Dt STRERROR 3
 .Os
 .Sh NAME
@@ -114,6 +114,9 @@ the range 0 
 .Fa errnum
 
 .Fa sys_nerr .
+The number 0 is also recognized, although applications that take advantage of
+this are likely to use unspecified values of
+.Va errno .
 .Pp
 If insufficient storage is provided in
 .Fa strerrbuf

Modified: stable/8/lib/libc/string/strerror.c
==
--- stable/8/lib/libc/string/strerror.c Fri Apr 15 18:34:27 2011
(r220663)
+++ stable/8/lib/libc/string/strerror.c Fri Apr 15 19:46:25 2011
(r220664)
@@ -87,7 +87,7 @@ strerror_r(int errnum, char *strerrbuf, 
catd = catopen(libc, NL_CAT_LOCALE);
 #endif
 
-   if (errnum  1 || errnum = sys_nerr) {
+   if (errnum  0 || errnum = sys_nerr) {
errstr(errnum,
 #if defined(NLS)
catgets(catd, 1, 0x, UPREFIX),

Modified: stable/8/tools/regression/lib/libc/string/test-strerror.c
==
--- stable/8/tools/regression/lib/libc/string/test-strerror.c   Fri Apr 15 
18:34:27 2011(r220663)
+++ stable/8/tools/regression/lib/libc/string/test-strerror.c   Fri Apr 15 
19:46:25 2011(r220664)
@@ -42,17 +42,12 @@ main(void)
char *sret;
int iret;
 
-   plan_tests(25);
+   plan_tests(27);
 
/*
 * strerror() failure tests.
 */
errno = 0;
-   sret = strerror(0);
-   ok1(strcmp(sret, Unknown error: 0) == 0);
-   ok1(errno == EINVAL);
-
-   errno = 0;
sret = strerror(INT_MAX);
snprintf(buf, sizeof(buf), Unknown error: %d, INT_MAX);
ok1(strcmp(sret, buf) == 0);
@@ -62,6 +57,11 @@ main(void)
 * strerror() success tests.
 */
errno = 0;
+   sret = strerror(0);
+   ok1(strcmp(sret, No error: 0) == 0);
+   ok1(errno == 0);
+
+   errno = 0;
sret = strerror(EPERM);
ok1(strcmp(sret, Operation not permitted) == 0);
ok1(errno == 0);
@@ -79,8 +79,8 @@ main(void)
 * strerror_r() failure tests.
 */
memset(buf, '*', sizeof(buf));
-   iret = strerror_r(0, buf, sizeof(buf));
-   ok1(strcmp(buf, Unknown error: 0) == 0);
+   iret = strerror_r(-1, buf, sizeof(buf));
+   ok1(strcmp(buf, Unknown error: -1) == 0);
ok1(iret == EINVAL);
 
memset(buf, '*', sizeof(buf));
@@ -117,6 +117,11 @@ main(void)
 * strerror_r() success tests.
 */
memset(buf, '*', sizeof(buf));
+   iret = strerror_r(0, buf, sizeof(buf));
+   ok1(strcmp(buf, No error: 0) == 0);
+   ok1(iret == 0);
+
+   memset(buf, '*', sizeof(buf));
iret = strerror_r(EDEADLK, buf, sizeof(buf));
ok1(strcmp(buf, Resource deadlock avoided) == 0);
ok1(iret == 0);
___
svn-src-all@freebsd.org mailing list

svn commit: r220665 - stable/8/usr.sbin/mfiutil

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 19:50:25 2011
New Revision: 220665
URL: http://svn.freebsd.org/changeset/base/220665

Log:
  MFC 219717,220363:
  - Add more details to the 'show battery' command including more raw
capacity values, charge cycle count, temperature, and more detailed
status.
  - Add the ability to manage the state of write caching when the battery
back-up is missing or dead.  The current state of this field is reported
in 'mfiutil cache volume' and can be adjusted via
'mfiutil cache volume bad-bbu-write-cache enable|disable'.  This
setting should generally be disabled to avoid data loss.

Modified:
  stable/8/usr.sbin/mfiutil/mfi_show.c
  stable/8/usr.sbin/mfiutil/mfi_volume.c
  stable/8/usr.sbin/mfiutil/mfiutil.8
Directory Properties:
  stable/8/usr.sbin/mfiutil/   (props changed)

Modified: stable/8/usr.sbin/mfiutil/mfi_show.c
==
--- stable/8/usr.sbin/mfiutil/mfi_show.cFri Apr 15 19:46:25 2011
(r220664)
+++ stable/8/usr.sbin/mfiutil/mfi_show.cFri Apr 15 19:50:25 2011
(r220665)
@@ -138,8 +138,9 @@ show_battery(int ac, char **av)
 {
struct mfi_bbu_capacity_info cap;
struct mfi_bbu_design_info design;
+   struct mfi_bbu_status stat;
uint8_t status;
-   int error, fd;
+   int comma, error, fd;
 
if (ac != 1) {
warnx(show battery: extra arguments);
@@ -171,16 +172,57 @@ show_battery(int ac, char **av)
return (error);
}
 
+   if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, stat, sizeof(stat),
+   NULL, 0, NULL)  0) {
+   warn(Failed to get status);
+   return (errno);
+   }
+
printf(mfi%d: Battery State:\n, mfi_unit);
-   printf( Manufacture Date: %d/%d/%d\n, design.mfg_date  5  0x0f,
+   printf( Manufacture Date: %d/%d/%d\n, design.mfg_date  5  0x0f,
design.mfg_date  0x1f, design.mfg_date  9  0x);
-   printf(Serial Number: %d\n, design.serial_number);
-   printf( Manufacturer: %s\n, design.mfg_name);
-   printf(Model: %s\n, design.device_name);
-   printf(Chemistry: %s\n, design.device_chemistry);
-   printf(  Design Capacity: %d mAh\n, design.design_capacity);
-   printf(   Design Voltage: %d mV\n, design.design_voltage);
-   printf(   Current Charge: %d%%\n, cap.relative_charge);
+   printf(Serial Number: %d\n, design.serial_number);
+   printf( Manufacturer: %s\n, design.mfg_name);
+   printf(Model: %s\n, design.device_name);
+   printf(Chemistry: %s\n, design.device_chemistry);
+   printf(  Design Capacity: %d mAh\n, design.design_capacity);
+   printf( Full Charge Capacity: %d mAh\n, cap.full_charge_capacity);
+   printf( Current Capacity: %d mAh\n, cap.remaining_capacity);
+   printf(Charge Cycles: %d\n, cap.cycle_count);
+   printf(   Current Charge: %d%%\n, cap.relative_charge);
+   printf(   Design Voltage: %d mV\n, design.design_voltage);
+   printf(  Current Voltage: %d mV\n, stat.voltage);
+   printf(  Temperature: %d C\n, stat.temperature);
+   printf(   Status:);
+   comma = 0;
+   if (stat.fw_status  MFI_BBU_STATE_PACK_MISSING) {
+   printf( PACK_MISSING);
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_VOLTAGE_LOW) {
+   printf(%s VOLTAGE_LOW, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_TEMPERATURE_HIGH) {
+   printf(%s TEMPERATURE_HIGH, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_CHARGE_ACTIVE) {
+   printf(%s CHARGING, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_DISCHARGE_ACTIVE) {
+   printf(%s DISCHARGING, comma ? , : );
+   }
+   if (!comma)
+   printf( normal);
+   printf(\n);
+   switch (stat.battery_type) {
+   case MFI_BBU_TYPE_BBU:
+   printf(  State of Health: %s\n,
+   stat.detail.bbu.is_SOH_good ? good : bad);
+   break;
+   }
 
close(fd);
 

Modified: stable/8/usr.sbin/mfiutil/mfi_volume.c
==
--- stable/8/usr.sbin/mfiutil/mfi_volume.c  Fri Apr 15 19:46:25 2011
(r220664)
+++ stable/8/usr.sbin/mfiutil/mfi_volume.c  Fri Apr 15 19:50:25 2011
(r220665)
@@ -138,6 +138,10 @@ update_cache_policy(int fd, struct mfi_l
policy  MR_LD_CACHE_READ_AHEAD ?
(policy  MR_LD_CACHE_READ_ADAPTIVE ?
adaptive : always) : none);
+   if (changes  MR_LD_CACHE_WRITE_CACHE_BAD_BBU)
+   printf(%s write caching 

svn commit: r220666 - stable/7/usr.sbin/mfiutil

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 19:50:38 2011
New Revision: 220666
URL: http://svn.freebsd.org/changeset/base/220666

Log:
  MFC 219717,220363:
  - Add more details to the 'show battery' command including more raw
capacity values, charge cycle count, temperature, and more detailed
status.
  - Add the ability to manage the state of write caching when the battery
back-up is missing or dead.  The current state of this field is reported
in 'mfiutil cache volume' and can be adjusted via
'mfiutil cache volume bad-bbu-write-cache enable|disable'.  This
setting should generally be disabled to avoid data loss.

Modified:
  stable/7/usr.sbin/mfiutil/mfi_show.c
  stable/7/usr.sbin/mfiutil/mfi_volume.c
  stable/7/usr.sbin/mfiutil/mfiutil.8
Directory Properties:
  stable/7/usr.sbin/mfiutil/   (props changed)

Modified: stable/7/usr.sbin/mfiutil/mfi_show.c
==
--- stable/7/usr.sbin/mfiutil/mfi_show.cFri Apr 15 19:50:25 2011
(r220665)
+++ stable/7/usr.sbin/mfiutil/mfi_show.cFri Apr 15 19:50:38 2011
(r220666)
@@ -138,8 +138,9 @@ show_battery(int ac, char **av)
 {
struct mfi_bbu_capacity_info cap;
struct mfi_bbu_design_info design;
+   struct mfi_bbu_status stat;
uint8_t status;
-   int error, fd;
+   int comma, error, fd;
 
if (ac != 1) {
warnx(show battery: extra arguments);
@@ -171,16 +172,57 @@ show_battery(int ac, char **av)
return (error);
}
 
+   if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, stat, sizeof(stat),
+   NULL, 0, NULL)  0) {
+   warn(Failed to get status);
+   return (errno);
+   }
+
printf(mfi%d: Battery State:\n, mfi_unit);
-   printf( Manufacture Date: %d/%d/%d\n, design.mfg_date  5  0x0f,
+   printf( Manufacture Date: %d/%d/%d\n, design.mfg_date  5  0x0f,
design.mfg_date  0x1f, design.mfg_date  9  0x);
-   printf(Serial Number: %d\n, design.serial_number);
-   printf( Manufacturer: %s\n, design.mfg_name);
-   printf(Model: %s\n, design.device_name);
-   printf(Chemistry: %s\n, design.device_chemistry);
-   printf(  Design Capacity: %d mAh\n, design.design_capacity);
-   printf(   Design Voltage: %d mV\n, design.design_voltage);
-   printf(   Current Charge: %d%%\n, cap.relative_charge);
+   printf(Serial Number: %d\n, design.serial_number);
+   printf( Manufacturer: %s\n, design.mfg_name);
+   printf(Model: %s\n, design.device_name);
+   printf(Chemistry: %s\n, design.device_chemistry);
+   printf(  Design Capacity: %d mAh\n, design.design_capacity);
+   printf( Full Charge Capacity: %d mAh\n, cap.full_charge_capacity);
+   printf( Current Capacity: %d mAh\n, cap.remaining_capacity);
+   printf(Charge Cycles: %d\n, cap.cycle_count);
+   printf(   Current Charge: %d%%\n, cap.relative_charge);
+   printf(   Design Voltage: %d mV\n, design.design_voltage);
+   printf(  Current Voltage: %d mV\n, stat.voltage);
+   printf(  Temperature: %d C\n, stat.temperature);
+   printf(   Status:);
+   comma = 0;
+   if (stat.fw_status  MFI_BBU_STATE_PACK_MISSING) {
+   printf( PACK_MISSING);
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_VOLTAGE_LOW) {
+   printf(%s VOLTAGE_LOW, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_TEMPERATURE_HIGH) {
+   printf(%s TEMPERATURE_HIGH, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_CHARGE_ACTIVE) {
+   printf(%s CHARGING, comma ? , : );
+   comma = 1;
+   }
+   if (stat.fw_status  MFI_BBU_STATE_DISCHARGE_ACTIVE) {
+   printf(%s DISCHARGING, comma ? , : );
+   }
+   if (!comma)
+   printf( normal);
+   printf(\n);
+   switch (stat.battery_type) {
+   case MFI_BBU_TYPE_BBU:
+   printf(  State of Health: %s\n,
+   stat.detail.bbu.is_SOH_good ? good : bad);
+   break;
+   }
 
close(fd);
 

Modified: stable/7/usr.sbin/mfiutil/mfi_volume.c
==
--- stable/7/usr.sbin/mfiutil/mfi_volume.c  Fri Apr 15 19:50:25 2011
(r220665)
+++ stable/7/usr.sbin/mfiutil/mfi_volume.c  Fri Apr 15 19:50:38 2011
(r220666)
@@ -138,6 +138,10 @@ update_cache_policy(int fd, struct mfi_l
policy  MR_LD_CACHE_READ_AHEAD ?
(policy  MR_LD_CACHE_READ_ADAPTIVE ?
adaptive : always) : none);
+   if (changes  MR_LD_CACHE_WRITE_CACHE_BAD_BBU)
+   printf(%s write caching 

svn commit: r220667 - head/sys/dev/iwn

2011-04-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Apr 15 20:17:52 2011
New Revision: 220667
URL: http://svn.freebsd.org/changeset/base/220667

Log:
  Split up watchdog and calibration callout. This allows us to use different
  timing on both and to remove some monitor mode specific hacks (which has
  no calibration).

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnvar.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Apr 15 19:50:38 2011(r220666)
+++ head/sys/dev/iwn/if_iwn.c   Fri Apr 15 20:17:52 2011(r220667)
@@ -123,10 +123,9 @@ static struct ieee80211_node *iwn_node_a
const uint8_t mac[IEEE80211_ADDR_LEN]);
 static int iwn_media_change(struct ifnet *);
 static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int);
+static voidiwn_calib_timeout(void *);
 static voidiwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *,
struct iwn_rx_data *);
-static voidiwn_timer_timeout(void *);
-static voidiwn_calib_reset(struct iwn_softc *);
 static voidiwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *,
struct iwn_rx_data *);
 #if 0  /* HT */
@@ -161,7 +160,7 @@ static int  iwn_raw_xmit(struct ieee80211
const struct ieee80211_bpf_params *);
 static voidiwn_start(struct ifnet *);
 static voidiwn_start_locked(struct ifnet *);
-static voidiwn_watchdog(struct iwn_softc *sc);
+static voidiwn_watchdog(void *);
 static int iwn_ioctl(struct ifnet *, u_long, caddr_t);
 static int iwn_cmd(struct iwn_softc *, int, const void *, int, int);
 static int iwn4965_add_node(struct iwn_softc *, struct iwn_node_info *,
@@ -475,7 +474,6 @@ iwn_attach(device_t dev)
}
 
IWN_LOCK_INIT(sc);
-   callout_init_mtx(sc-sc_timer_to, sc-sc_mtx, 0);
TASK_INIT(sc-sc_reinit_task, 0, iwn_hw_reset, sc );
TASK_INIT(sc-sc_radioon_task, 0, iwn_radio_on, sc );
TASK_INIT(sc-sc_radiooff_task, 0, iwn_radio_off, sc );
@@ -668,6 +666,10 @@ iwn_attach(device_t dev)
 #endif
 
iwn_radiotap_attach(sc);
+
+   callout_init_mtx(sc-calib_to, sc-sc_mtx, 0);
+   callout_init_mtx(sc-watchdog_to, sc-sc_mtx, 0);
+
iwn_sysctlattach(sc);
 
/*
@@ -860,7 +862,8 @@ iwn_detach(device_t dev)
ieee80211_draintask(ic, sc-sc_radiooff_task);
 
iwn_stop(sc);
-   callout_drain(sc-sc_timer_to);
+   callout_drain(sc-watchdog_to);
+   callout_drain(sc-calib_to);
ieee80211_ifdetach(ic);
}
 
@@ -1942,7 +1945,7 @@ iwn_newstate(struct ieee80211vap *vap, e
 
IEEE80211_UNLOCK(ic);
IWN_LOCK(sc);
-   callout_stop(sc-sc_timer_to);
+   callout_stop(sc-calib_to);
 
switch (nstate) {
case IEEE80211_S_ASSOC:
@@ -1959,7 +1962,8 @@ iwn_newstate(struct ieee80211vap *vap, e
 */
sc-rxon.associd = 0;
sc-rxon.filter = ~htole32(IWN_FILTER_BSS);
-   iwn_calib_reset(sc);
+   sc-calib.state = IWN_CALIB_STATE_INIT;
+
error = iwn_auth(sc, vap);
break;
 
@@ -1967,9 +1971,8 @@ iwn_newstate(struct ieee80211vap *vap, e
/*
 * RUN - RUN transition; Just restart the timers.
 */
-   if (vap-iv_state == IEEE80211_S_RUN 
-   vap-iv_opmode != IEEE80211_M_MONITOR) {
-   iwn_calib_reset(sc);
+   if (vap-iv_state == IEEE80211_S_RUN) {
+   sc-calib_cnt = 0;
break;
}
 
@@ -1981,6 +1984,10 @@ iwn_newstate(struct ieee80211vap *vap, e
error = iwn_run(sc, vap);
break;
 
+   case IEEE80211_S_INIT:
+   sc-calib.state = IWN_CALIB_STATE_INIT;
+   break;
+
default:
break;
}
@@ -1989,6 +1996,27 @@ iwn_newstate(struct ieee80211vap *vap, e
return ivp-iv_newstate(vap, nstate, arg);
 }
 
+static void
+iwn_calib_timeout(void *arg)
+{
+   struct iwn_softc *sc = arg;
+
+   IWN_LOCK_ASSERT(sc);
+
+   /* Force automatic TX power calibration every 60 secs. */
+   if (++sc-calib_cnt = 120) {
+   uint32_t flags = 0;
+
+   DPRINTF(sc, IWN_DEBUG_CALIBRATE, %s\n,
+   sending request for statistics);
+   (void)iwn_cmd(sc, IWN_CMD_GET_STATISTICS, flags,
+   sizeof flags, 1);
+   sc-calib_cnt = 0;
+   }
+   callout_reset(sc-calib_to, msecs_to_ticks(500), iwn_calib_timeout,
+   sc);
+}
+
 /*
  * Process an RX_PHY firmware notification.  This is usually immediately
  * followed by an MPDU_RX_DONE notification.
@@ -2007,32 +2035,6 @@ iwn_rx_phy(struct iwn_softc *sc, struct 
sc-last_rx_valid = 1;
 }
 
-static void

svn commit: r220668 - head/sys/dev/iwn

2011-04-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Apr 15 20:19:18 2011
New Revision: 220668
URL: http://svn.freebsd.org/changeset/base/220668

Log:
  remove debug left-overs

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Apr 15 20:17:52 2011(r220667)
+++ head/sys/dev/iwn/if_iwn.c   Fri Apr 15 20:19:18 2011(r220668)
@@ -3366,8 +3366,8 @@ iwn_watchdog(void *arg)
 
KASSERT(ifp-if_drv_flags  IFF_DRV_RUNNING, (not running));
 
-   if (sc-sc_tx_timer  0 || counter == 50) {
-   if (--sc-sc_tx_timer == 0 || counter == 50) {
+   if (sc-sc_tx_timer  0) {
+   if (--sc-sc_tx_timer == 0) {
if_printf(ifp, device timeout\n);
ieee80211_runtask(ic, sc-sc_reinit_task);
return;
___
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: r220669 - stable/8/sys/dev/pci

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:19:50 2011
New Revision: 220669
URL: http://svn.freebsd.org/changeset/base/220669

Log:
  MFC 219865:
  Add pci_find_cap() as an alias for pci_find_extcap() to ease driver
  portability with 9+ where pci_find_extcap() has been renamed to
  pci_find_cap().

Modified:
  stable/8/sys/dev/pci/pci.c
  stable/8/sys/dev/pci/pcivar.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/pci/pci.c
==
--- stable/8/sys/dev/pci/pci.c  Fri Apr 15 20:19:18 2011(r220668)
+++ stable/8/sys/dev/pci/pci.c  Fri Apr 15 20:19:50 2011(r220669)
@@ -98,7 +98,7 @@ static char   *pci_describe_device(device
 static int pci_modevent(module_t mod, int what, void *arg);
 static voidpci_hdrtypedata(device_t pcib, int b, int s, int f,
pcicfgregs *cfg);
-static voidpci_read_extcap(device_t pcib, pcicfgregs *cfg);
+static voidpci_read_cap(device_t pcib, pcicfgregs *cfg);
 static int pci_read_vpd_reg(device_t pcib, pcicfgregs *cfg,
int reg, uint32_t *data);
 #if 0
@@ -507,7 +507,7 @@ pci_read_device(device_t pcib, int d, in
pci_hdrtypedata(pcib, b, s, f, cfg);
 
if (REG(PCIR_STATUS, 2)  PCIM_STATUS_CAPPRESENT)
-   pci_read_extcap(pcib, cfg);
+   pci_read_cap(pcib, cfg);
 
STAILQ_INSERT_TAIL(devlist_head, devlist_entry, pci_links);
 
@@ -535,7 +535,7 @@ pci_read_device(device_t pcib, int d, in
 }
 
 static void
-pci_read_extcap(device_t pcib, pcicfgregs *cfg)
+pci_read_cap(device_t pcib, pcicfgregs *cfg)
 {
 #defineREG(n, w)   PCIB_READ_CONFIG(pcib, cfg-bus, cfg-slot, 
cfg-func, n, w)
 #defineWREG(n, v, w)   PCIB_WRITE_CONFIG(pcib, cfg-bus, cfg-slot, 
cfg-func, n, v, w)
@@ -1612,7 +1612,7 @@ pci_get_max_read_req(device_t dev)
int cap;
uint16_t val;
 
-   if (pci_find_extcap(dev, PCIY_EXPRESS, cap) != 0)
+   if (pci_find_cap(dev, PCIY_EXPRESS, cap) != 0)
return (0);
val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2);
val = PCIM_EXP_CTL_MAX_READ_REQUEST;
@@ -1626,7 +1626,7 @@ pci_set_max_read_req(device_t dev, int s
int cap;
uint16_t val;
 
-   if (pci_find_extcap(dev, PCIY_EXPRESS, cap) != 0)
+   if (pci_find_cap(dev, PCIY_EXPRESS, cap) != 0)
return (0);
if (size  128)
size = 128;

Modified: stable/8/sys/dev/pci/pcivar.h
==
--- stable/8/sys/dev/pci/pcivar.h   Fri Apr 15 20:19:18 2011
(r220668)
+++ stable/8/sys/dev/pci/pcivar.h   Fri Apr 15 20:19:50 2011
(r220669)
@@ -400,9 +400,15 @@ pci_get_powerstate(device_t dev)
 }
 
 static __inline int
+pci_find_cap(device_t dev, int capability, int *capreg)
+{
+return (PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg));
+}
+
+static __inline int
 pci_find_extcap(device_t dev, int capability, int *capreg)
 {
-return PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg);
+return (PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg));
 }
 
 static __inline int
___
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: r220670 - stable/7/sys/dev/pci

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:20:11 2011
New Revision: 220670
URL: http://svn.freebsd.org/changeset/base/220670

Log:
  MFC 219865:
  Add pci_find_cap() as an alias for pci_find_extcap() to ease driver
  portability with 9+ where pci_find_extcap() has been renamed to
  pci_find_cap().

Modified:
  stable/7/sys/dev/pci/pci.c
  stable/7/sys/dev/pci/pcivar.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/pci/pci.c
==
--- stable/7/sys/dev/pci/pci.c  Fri Apr 15 20:19:50 2011(r220669)
+++ stable/7/sys/dev/pci/pci.c  Fri Apr 15 20:20:11 2011(r220670)
@@ -92,7 +92,7 @@ static char   *pci_describe_device(device
 static int pci_modevent(module_t mod, int what, void *arg);
 static voidpci_hdrtypedata(device_t pcib, int b, int s, int f,
pcicfgregs *cfg);
-static voidpci_read_extcap(device_t pcib, pcicfgregs *cfg);
+static voidpci_read_cap(device_t pcib, pcicfgregs *cfg);
 static int pci_read_vpd_reg(device_t pcib, pcicfgregs *cfg,
int reg, uint32_t *data);
 #if 0
@@ -473,7 +473,7 @@ pci_read_device(device_t pcib, int d, in
pci_hdrtypedata(pcib, b, s, f, cfg);
 
if (REG(PCIR_STATUS, 2)  PCIM_STATUS_CAPPRESENT)
-   pci_read_extcap(pcib, cfg);
+   pci_read_cap(pcib, cfg);
 
STAILQ_INSERT_TAIL(devlist_head, devlist_entry, pci_links);
 
@@ -501,7 +501,7 @@ pci_read_device(device_t pcib, int d, in
 }
 
 static void
-pci_read_extcap(device_t pcib, pcicfgregs *cfg)
+pci_read_cap(device_t pcib, pcicfgregs *cfg)
 {
 #defineREG(n, w)   PCIB_READ_CONFIG(pcib, cfg-bus, cfg-slot, 
cfg-func, n, w)
 #defineWREG(n, v, w)   PCIB_WRITE_CONFIG(pcib, cfg-bus, cfg-slot, 
cfg-func, n, v, w)
@@ -1577,7 +1577,7 @@ pci_get_max_read_req(device_t dev)
int cap;
uint16_t val;
 
-   if (pci_find_extcap(dev, PCIY_EXPRESS, cap) != 0)
+   if (pci_find_cap(dev, PCIY_EXPRESS, cap) != 0)
return (0);
val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2);
val = PCIM_EXP_CTL_MAX_READ_REQUEST;
@@ -1591,7 +1591,7 @@ pci_set_max_read_req(device_t dev, int s
int cap;
uint16_t val;
 
-   if (pci_find_extcap(dev, PCIY_EXPRESS, cap) != 0)
+   if (pci_find_cap(dev, PCIY_EXPRESS, cap) != 0)
return (0);
if (size  128)
size = 128;

Modified: stable/7/sys/dev/pci/pcivar.h
==
--- stable/7/sys/dev/pci/pcivar.h   Fri Apr 15 20:19:50 2011
(r220669)
+++ stable/7/sys/dev/pci/pcivar.h   Fri Apr 15 20:20:11 2011
(r220670)
@@ -407,9 +407,15 @@ pci_get_powerstate(device_t dev)
 }
 
 static __inline int
+pci_find_cap(device_t dev, int capability, int *capreg)
+{
+return (PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg));
+}
+
+static __inline int
 pci_find_extcap(device_t dev, int capability, int *capreg)
 {
-return PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg);
+return (PCI_FIND_EXTCAP(device_get_parent(dev), dev, capability, capreg));
 }
 
 static __inline int
___
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: r220671 - stable/8/sys/ufs/ffs

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:26:24 2011
New Revision: 220671
URL: http://svn.freebsd.org/changeset/base/220671

Log:
  MFC 219276:
  Use ffs() to locate free bits in the inode bitmap rather than a loop with
  bit shifts.

Modified:
  stable/8/sys/ufs/ffs/ffs_alloc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/ufs/ffs/ffs_alloc.c
==
--- stable/8/sys/ufs/ffs/ffs_alloc.cFri Apr 15 20:20:11 2011
(r220670)
+++ stable/8/sys/ufs/ffs/ffs_alloc.cFri Apr 15 20:26:24 2011
(r220671)
@@ -1770,17 +1770,13 @@ ffs_nodealloccg(ip, cg, ipref, mode)
}
}
i = start + len - loc;
-   map = inosused[i];
-   ipref = i * NBBY;
-   for (i = 1; i  (1  NBBY); i = 1, ipref++) {
-   if ((map  i) == 0) {
-   cgp-cg_irotor = ipref;
-   goto gotit;
-   }
+   map = inosused[i] ^ 0xff;
+   if (map == 0) {
+   printf(fs = %s\n, fs-fs_fsmnt);
+   panic(ffs_nodealloccg: block not in map);
}
-   printf(fs = %s\n, fs-fs_fsmnt);
-   panic(ffs_nodealloccg: block not in map);
-   /* NOTREACHED */
+   ipref = i * NBBY + ffs(map) - 1;
+   cgp-cg_irotor = ipref;
 gotit:
/*
 * Check to see if we need to initialize more inodes.
___
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: r220672 - stable/7/sys/ufs/ffs

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:26:36 2011
New Revision: 220672
URL: http://svn.freebsd.org/changeset/base/220672

Log:
  MFC 219276:
  Use ffs() to locate free bits in the inode bitmap rather than a loop with
  bit shifts.

Modified:
  stable/7/sys/ufs/ffs/ffs_alloc.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/ufs/ffs/ffs_alloc.c
==
--- stable/7/sys/ufs/ffs/ffs_alloc.cFri Apr 15 20:26:24 2011
(r220671)
+++ stable/7/sys/ufs/ffs/ffs_alloc.cFri Apr 15 20:26:36 2011
(r220672)
@@ -1765,17 +1765,13 @@ ffs_nodealloccg(ip, cg, ipref, mode)
}
}
i = start + len - loc;
-   map = inosused[i];
-   ipref = i * NBBY;
-   for (i = 1; i  (1  NBBY); i = 1, ipref++) {
-   if ((map  i) == 0) {
-   cgp-cg_irotor = ipref;
-   goto gotit;
-   }
+   map = inosused[i] ^ 0xff;
+   if (map == 0) {
+   printf(fs = %s\n, fs-fs_fsmnt);
+   panic(ffs_nodealloccg: block not in map);
}
-   printf(fs = %s\n, fs-fs_fsmnt);
-   panic(ffs_nodealloccg: block not in map);
-   /* NOTREACHED */
+   ipref = i * NBBY + ffs(map) - 1;
+   cgp-cg_irotor = ipref;
 gotit:
/*
 * Check to see if we need to initialize more inodes.
___
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: r220673 - stable/8/sys/isa

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:28:38 2011
New Revision: 220673
URL: http://svn.freebsd.org/changeset/base/220673

Log:
  MFC 220126:
  - Enable an extra debugging bootverbose printf when probing ISA PNP cards
listing   each card as it is found on non-PC98 (PC98 already had this).
  - Increase the length of the DELAY() used before timing out while reading
PNP resource data.

Modified:
  stable/8/sys/isa/pnp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/isa/pnp.c
==
--- stable/8/sys/isa/pnp.c  Fri Apr 15 20:26:36 2011(r220672)
+++ stable/8/sys/isa/pnp.c  Fri Apr 15 20:28:38 2011(r220673)
@@ -209,7 +209,7 @@ pnp_get_resource_info(u_char *buffer, in
for (j = 0; j  100; j++) {
if ((inb((pnp_rd_port  2) | 0x3))  0x1)
break;
-   DELAY(1);
+   DELAY(10);
}
if (j == 100) {
printf(PnP device failed to report resource data\n);
@@ -743,10 +743,10 @@ pnp_isolation_protocol(device_t parent)
printf(A Normal-ISA-PnP card (%s).\n,
pnp_eisaformat(id.vendor_id));
}
+#endif
if (bootverbose)
printf(Reading PnP configuration for %s.\n,
pnp_eisaformat(id.vendor_id));
-#endif
error = pnp_read_resources(resources, space, len);
if (error)
break;
___
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: r220675 - stable/8/sys/amd64/ia32

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:32:17 2011
New Revision: 220675
URL: http://svn.freebsd.org/changeset/base/220675

Log:
  MFC 220451:
  Catch up to PCB_FULL_IRET becoming a pcb flag rather than a full field.

Modified:
  stable/8/sys/amd64/ia32/ia32_exception.S
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/ia32/ia32_exception.S
==
--- stable/8/sys/amd64/ia32/ia32_exception.SFri Apr 15 20:31:02 2011
(r220674)
+++ stable/8/sys/amd64/ia32/ia32_exception.SFri Apr 15 20:32:17 2011
(r220675)
@@ -46,7 +46,7 @@ IDTVEC(int0x80_syscall)
subq$TF_ERR,%rsp/* skip over tf_trapno */
movq%rdi,TF_RDI(%rsp)
movqPCPU(CURPCB),%rdi
-   movb$0,PCB_FULL_IRET(%rdi)
+   andl$~PCB_FULL_IRET,PCB_FLAGS(%rdi)
movw%fs,TF_FS(%rsp)
movw%gs,TF_GS(%rsp)
movw%es,TF_ES(%rsp)
___
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: r220676 - head/sys/dev/iwn

2011-04-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Apr 15 20:35:15 2011
New Revision: 220676
URL: http://svn.freebsd.org/changeset/base/220676

Log:
  The 6005 series devices need additional temperature offset calibration
  as well as the IWN_GP_DRIVER_CALIB_VER6 bit set.
  
  Obtained from:OpenBSD

Modified:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnreg.h

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Apr 15 20:32:17 2011(r220675)
+++ head/sys/dev/iwn/if_iwn.c   Fri Apr 15 20:35:15 2011(r220676)
@@ -222,6 +222,7 @@ static void iwn5000_ampdu_tx_stop(struct
 static int iwn5000_query_calibration(struct iwn_softc *);
 static int iwn5000_send_calibration(struct iwn_softc *);
 static int iwn5000_send_wimax_coex(struct iwn_softc *);
+static int iwn5000_temp_offset_calib(struct iwn_softc *);
 static int iwn5000_crystal_calib(struct iwn_softc *);
 static int iwn4965_post_alive(struct iwn_softc *);
 static int iwn5000_post_alive(struct iwn_softc *);
@@ -4539,6 +4540,16 @@ iwn_config(struct iwn_softc *sc)
int error;
uint16_t rxchain;
 
+   if (sc-hw_type == IWN_HW_REV_TYPE_6005) {
+   /* Set radio temperature sensor offset. */
+   error = iwn5000_temp_offset_calib(sc);
+   if (error != 0) {
+   device_printf(sc-sc_dev,
+   %s: could not set temperature offset\n, __func__);
+   return error;
+   }
+   }
+
/* Configure valid TX chains for 5000 Series. */
if (sc-hw_type != IWN_HW_REV_TYPE_4965) {
txmask = htole32(sc-txchainmask);
@@ -5326,6 +5337,24 @@ iwn5000_crystal_calib(struct iwn_softc *
return iwn_cmd(sc, IWN_CMD_PHY_CALIB, cmd, sizeof cmd, 0);
 }
 
+static int
+iwn5000_temp_offset_calib(struct iwn_softc *sc)
+{
+   struct iwn5000_phy_calib_temp_offset cmd;
+
+   memset(cmd, 0, sizeof cmd);
+   cmd.code = IWN5000_PHY_CALIB_TEMP_OFFSET;
+   cmd.ngroups = 1;
+   cmd.isvalid = 1;
+   if (sc-eeprom_temp != 0)
+   cmd.offset = htole16(sc-eeprom_temp);
+   else
+   cmd.offset = htole16(IWN_DEFAULT_TEMP_OFFSET);
+   DPRINTF(sc, IWN_DEBUG_CALIBRATE, setting radio sensor offset to %d\n,
+   le16toh(cmd.offset));
+   return iwn_cmd(sc, IWN_CMD_PHY_CALIB, cmd, sizeof cmd, 0);
+}
+
 /*
  * This function is called after the runtime firmware notifies us of its
  * readiness (called in a process context.)
@@ -6028,7 +6057,8 @@ iwn5000_nic_config(struct iwn_softc *sc)
/* Use internal power amplifier only. */
IWN_WRITE(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_RADIO_2X2_IPA);
}
-   if (sc-hw_type == IWN_HW_REV_TYPE_6050  sc-calib_ver = 6) {
+   if ((sc-hw_type == IWN_HW_REV_TYPE_6050 ||
+sc-hw_type == IWN_HW_REV_TYPE_6005)  sc-calib_ver = 6) {
/* Indicate that ROM calibration version is =6. */
IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_CALIB_VER6);
}

Modified: head/sys/dev/iwn/if_iwnreg.h
==
--- head/sys/dev/iwn/if_iwnreg.hFri Apr 15 20:32:17 2011
(r220675)
+++ head/sys/dev/iwn/if_iwnreg.hFri Apr 15 20:35:15 2011
(r220676)
@@ -885,6 +885,8 @@ struct iwn_phy_calib {
 #define IWN5000_PHY_CALIB_CRYSTAL  15
 #define IWN5000_PHY_CALIB_BASE_BAND16
 #define IWN5000_PHY_CALIB_TX_IQ_PERIODIC   17
+#define IWN5000_PHY_CALIB_TEMP_OFFSET  18
+
 #define IWN5000_PHY_CALIB_RESET_NOISE_GAIN 18
 #define IWN5000_PHY_CALIB_NOISE_GAIN   19
 
@@ -903,6 +905,17 @@ struct iwn5000_phy_calib_crystal {
uint8_t reserved[2];
 } __packed;
 
+struct iwn5000_phy_calib_temp_offset {
+   uint8_t code;
+   uint8_t group;
+   uint8_t ngroups;
+   uint8_t isvalid;
+   int16_t offset;
+#define IWN_DEFAULT_TEMP_OFFSET2700
+
+   uint16_treserved;
+} __packed;
+
 struct iwn_phy_calib_gain {
uint8_t code;
uint8_t group;
___
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: r218277 - in stable/7/sys: kern sys

2011-04-15 Thread Andre Albsmeier
On Fri, 15-Apr-2011 at 18:35:05 +0200, John Baldwin wrote:
 On Friday, April 15, 2011 9:25:25 am Andre Albsmeier wrote:
  On Fri, 04-Feb-2011 at 14:44:59 +, John Baldwin wrote:
   Author: jhb
   Date: Fri Feb  4 14:44:59 2011
   New Revision: 218277
   URL: http://svn.freebsd.org/changeset/base/218277
   
   Log:
 MFC 217075:
 Retire PCONFIG and leave the priority of thread0 alone when waiting for
 interrupt config hooks to execute.
 
 To preserve the KBI, I did not renumber priorities but simply removed
 PCONFIG.
   
   Modified:
 stable/7/sys/kern/subr_autoconf.c
 stable/7/sys/sys/priority.h
   Directory Properties:
 stable/7/sys/   (props changed)
 stable/7/sys/cddl/contrib/opensolaris/   (props changed)
 stable/7/sys/contrib/dev/acpica/   (props changed)
 stable/7/sys/contrib/pf/   (props changed)
   
   Modified: stable/7/sys/kern/subr_autoconf.c
   
 ==
   --- stable/7/sys/kern/subr_autoconf.c Fri Feb  4 14:44:42 2011
 (r218276)
   +++ stable/7/sys/kern/subr_autoconf.c Fri Feb  4 14:44:59 2011
 (r218277)
   @@ -108,7 +108,7 @@ run_interrupt_driven_config_hooks(dummy)
 warned = 0;
 while (!TAILQ_EMPTY(intr_config_hook_list)) {
 if (msleep(intr_config_hook_list, intr_config_hook_lock,
   - PCONFIG, conifhk, WARNING_INTERVAL_SECS * hz) ==
   + 0, conifhk, WARNING_INTERVAL_SECS * hz) ==
 EWOULDBLOCK) {
 mtx_unlock(intr_config_hook_lock);
 warned++;
  
  
  This broke several of my machines in a somewhat strange way:
  
  After upgrading them (17) to a recent 7-STABLE (as of 2011-04-12)
  I noticed that some (4) of them didn't start. All 4 didn't find
  their boot device anymore. What they all got in common is:
  
  - an Adaptec 2940 Ultra SCSI adapter
  - two SCSI harddisks (da0 and da1) of various brands
  - one SCSI CDROM drive (cd0)
  
  To be exact, none of the three devices (da0, da1, cd0) were
  detected at all. Other machines with a similar configuration
  (2940 and da0/da1) but _without_ the CDROM drive didn't have
  any problems. So I simply removed the CDROM drives on the 4
  machines in question and they all booted again.
  
  Today I decided to dig into this and after reverting(*) the
  above change, they worked with the CDROM again. I have cross-
  checked it 3 times. No idea what's happening here...
  
  -Andre
  
  (*) To be honest, I use this patch so I had to modify only one file:
  
  --- sys/kern/subr_autoconf.c.ORI2011-02-05 13:14:11.0 +0100
  +++ sys/kern/subr_autoconf.c2011-04-15 14:34:31.0 +0200
  @@ -108,7 +108,7 @@
  warned = 0;
  while (!TAILQ_EMPTY(intr_config_hook_list)) {
  if (msleep(intr_config_hook_list, intr_config_hook_lock,
  -   0, conifhk, WARNING_INTERVAL_SECS * hz) ==
  +   PRI_MIN_KERN + 32, conifhk, WARNING_INTERVAL_SECS * hz) ==
  EWOULDBLOCK) {
  mtx_unlock(intr_config_hook_lock);
  warned++;
 
 Do you get any warnings about CAM timeouts, etc. when these probe?  A verbose 

This is a part of a verbose dmesg with a working(!) kernel:

Apr 15 12:44:33 kern.crit inside kernel: splash: image decoder found: 
snake_saver
Apr 15 12:44:33 kern.crit inside kernel: lo0: bpf attached
Apr 15 12:44:33 kern.crit inside kernel: (noperiph:ahc0:0:-1:-1): SCSI bus 
reset delivered. 0 SCBs aborted.
Apr 15 12:44:33 kern.crit inside kernel: ahc0: Selection Timeout on A:5. 0 
SCBs aborted
Apr 15 12:44:33 kern.crit inside kernel: ahc0: Selection Timeout on A:2. 0 
SCBs aborted
Apr 15 12:44:33 kern.crit inside kernel: ahc0: Selection Timeout on A:3. 0 
SCBs aborted
Apr 15 12:44:33 kern.crit inside kernel: ahc0: Selection Timeout on A:4. 0 
SCBs aborted
Apr 15 12:44:33 kern.crit inside kernel: (probe0:ahc0:0:0:0): Retrying Command
Apr 15 12:44:33 kern.crit inside kernel: (probe1:ahc0:0:1:0): Retrying Command
Apr 15 12:44:33 kern.crit inside kernel: (probe6:ahc0:0:6:0): Retrying Command
Apr 15 12:44:33 kern.crit inside kernel: (probe6:ahc0:0:6:0): error 22
Apr 15 12:44:33 kern.crit inside kernel: (probe6:ahc0:0:6:0): Unretryable 
Error
Apr 15 12:44:33 kern.crit inside kernel: (probe6:ahc0:0:6:0): Down reving 
Protocol Version from 4 to 2?
Apr 15 12:44:33 kern.crit inside kernel: (probe0:ahc0:0:0:0): Down reving 
Protocol Version from 4 to 2?
Apr 15 12:44:33 kern.crit inside kernel: (probe1:ahc0:0:1:0): Down reving 
Protocol Version from 4 to 2?
Apr 15 12:44:33 kern.crit inside kernel: (ahc0:A:6:0): Sending SDTR period c, 
offset f
Apr 15 12:44:33 kern.crit inside kernel: (ahc0:A:6:0): Received SDTR period 
19, offset f
Apr 15 12:44:33 kern.crit inside kernel: Filtered to period 19, offset f
Apr 15 12:44:33 kern.crit inside kernel: ahc0: target 6 synchronous at 
10.0MHz, offset = 0xf
Apr 15 12:44:33 kern.crit 

svn commit: r220677 - head/sys/dev/iwn

2011-04-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Fri Apr 15 20:40:49 2011
New Revision: 220677
URL: http://svn.freebsd.org/changeset/base/220677

Log:
  fix the order of the prototypes from the previosu commit

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Fri Apr 15 20:35:15 2011(r220676)
+++ head/sys/dev/iwn/if_iwn.c   Fri Apr 15 20:40:49 2011(r220677)
@@ -222,8 +222,8 @@ static void iwn5000_ampdu_tx_stop(struct
 static int iwn5000_query_calibration(struct iwn_softc *);
 static int iwn5000_send_calibration(struct iwn_softc *);
 static int iwn5000_send_wimax_coex(struct iwn_softc *);
-static int iwn5000_temp_offset_calib(struct iwn_softc *);
 static int iwn5000_crystal_calib(struct iwn_softc *);
+static int iwn5000_temp_offset_calib(struct iwn_softc *);
 static int iwn4965_post_alive(struct iwn_softc *);
 static int iwn5000_post_alive(struct iwn_softc *);
 static int iwn4965_load_bootcode(struct iwn_softc *, const uint8_t *,
___
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: r220678 - stable/7/sys/netinet

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:42:14 2011
New Revision: 220678
URL: http://svn.freebsd.org/changeset/base/220678

Log:
  MFC 220156:
  Clamp the initial advertised receive window when responding to a SYN/ACK
  to the maximum allowed window.  Growing the window too large would cause
  an underflow in the calculations in tcp_output() to decide if a window
  update should be sent which would prevent the persist timer from being
  started if data was pending and the other end of the connection advertised
  an initial window size of 0.

Modified:
  stable/7/sys/netinet/tcp_input.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/netinet/tcp_input.c
==
--- stable/7/sys/netinet/tcp_input.cFri Apr 15 20:40:49 2011
(r220677)
+++ stable/7/sys/netinet/tcp_input.cFri Apr 15 20:42:14 2011
(r220678)
@@ -1296,7 +1296,8 @@ tcp_do_segment(struct mbuf *m, struct tc
(TF_RCVD_SCALE|TF_REQ_SCALE)) {
tp-rcv_scale = tp-request_r_scale;
}
-   tp-rcv_adv += tp-rcv_wnd;
+   tp-rcv_adv += imin(tp-rcv_wnd,
+   TCP_MAXWIN  tp-rcv_scale);
tp-snd_una++;  /* SYN is acked */
/*
 * If there's data, delay ACK; if there's also a FIN
___
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: r220679 - stable/8/sys/netinet

2011-04-15 Thread John Baldwin
Author: jhb
Date: Fri Apr 15 20:42:27 2011
New Revision: 220679
URL: http://svn.freebsd.org/changeset/base/220679

Log:
  MFC 220156:
  Clamp the initial advertised receive window when responding to a SYN/ACK
  to the maximum allowed window.  Growing the window too large would cause
  an underflow in the calculations in tcp_output() to decide if a window
  update should be sent which would prevent the persist timer from being
  started if data was pending and the other end of the connection advertised
  an initial window size of 0.

Modified:
  stable/8/sys/netinet/tcp_input.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/netinet/tcp_input.c
==
--- stable/8/sys/netinet/tcp_input.cFri Apr 15 20:42:14 2011
(r220678)
+++ stable/8/sys/netinet/tcp_input.cFri Apr 15 20:42:27 2011
(r220679)
@@ -1558,7 +1558,8 @@ tcp_do_segment(struct mbuf *m, struct tc
(TF_RCVD_SCALE|TF_REQ_SCALE)) {
tp-rcv_scale = tp-request_r_scale;
}
-   tp-rcv_adv += tp-rcv_wnd;
+   tp-rcv_adv += imin(tp-rcv_wnd,
+   TCP_MAXWIN  tp-rcv_scale);
tp-snd_una++;  /* SYN is acked */
/*
 * If there's data, delay ACK; if there's also a FIN
___
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: r220680 - in vendor-sys/acpica/dist: compiler generate/unix

2011-04-15 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr 15 21:33:45 2011
New Revision: 220680
URL: http://svn.freebsd.org/changeset/base/220680

Log:
  Redo r220658.  More extensive patch was committed by Intel:
  
  
http://git.moblin.org/cgit.cgi/acpica/commit/?id=16c9bbd6a3d8da88664d769ceec2f1757964fc7a
  
  Obtained from:ACPICA

Modified:
  vendor-sys/acpica/dist/compiler/Makefile
  vendor-sys/acpica/dist/compiler/aslcompiler.y
  vendor-sys/acpica/dist/compiler/asldefine.h
  vendor-sys/acpica/dist/compiler/aslutils.c
  vendor-sys/acpica/dist/compiler/dtparser.y
  vendor-sys/acpica/dist/generate/unix/Makefile.config

Modified: vendor-sys/acpica/dist/compiler/Makefile
==
--- vendor-sys/acpica/dist/compiler/MakefileFri Apr 15 20:42:27 2011
(r220679)
+++ vendor-sys/acpica/dist/compiler/MakefileFri Apr 15 21:33:45 2011
(r220680)
@@ -166,11 +166,15 @@ OBJS = \
 
 INTERMEDIATES = \
aslcompilerlex.c \
-   aslcompilerparse.c
+   aslcompilerparse.c \
+   dtparserlex.c \
+   dtparserparse.c
 
 MISC = \
aslcompiler.y.h \
-   aslcompilerparse.output
+   aslcompilerparse.output \
+   dtparser.y.h \
+   dtparserparse.output
 
 
 #

Modified: vendor-sys/acpica/dist/compiler/aslcompiler.y
==
--- vendor-sys/acpica/dist/compiler/aslcompiler.y   Fri Apr 15 20:42:27 
2011(r220679)
+++ vendor-sys/acpica/dist/compiler/aslcompiler.y   Fri Apr 15 21:33:45 
2011(r220680)
@@ -43,14 +43,6 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#define YYDEBUG 1
-#define YYERROR_VERBOSE 1
-
-/*
- * State stack - compiler will fault if it overflows.   (Default was 200)
- */
-#define YYINITDEPTH 600
-
 #include aslcompiler.h
 #include stdio.h
 #include stdlib.h
@@ -74,45 +66,40 @@
  *  ResourceMacroList, and FieldUnitList
  */
 
+void *  AslLocalAllocate (unsigned int Size);
+
+/* Bison/yacc configuration */
 
-/*
- * Next statement is important - this makes everything public so that
- * we can access some of the parser tables from other modules
- */
 #define static
 #undef alloca
-#define alloca  AslLocalAllocate
-#define YYERROR_VERBOSE 1
+#define alloca  AslLocalAllocate
+#define yytname AslCompilername
 
-void *
-AslLocalAllocate (unsigned int Size);
+#define YYINITDEPTH 600 /* State stack depth */
+#define YYDEBUG 1   /* Enable debug output */
+#define YYERROR_VERBOSE 1   /* Verbose error messages */
 
 /*
  * The windows version of bison defines this incorrectly as 32768 (Not 
negative).
- * Using a custom (edited binary) version of bison that defines YYFLAG as 
YYFBAD
- * instead (#define YYFBAD  32768), so we can define it correctly here.
+ * We use a custom (edited binary) version of bison that defines YYFLAG as 
YYFBAD
+ * instead (#define YYFBAD 32768), so we can define it correctly here.
  *
  * The problem is that if YYFLAG is positive, the extended syntax error 
messages
  * are disabled.
  */
-
 #define YYFLAG  -32768
 
-
 %}
 
-
 /*
  * Declare the type of values in the grammar
  */
-
 %union {
 UINT64  i;
 char*s;
 ACPI_PARSE_OBJECT   *n;
 }
 
-
 /*! [Begin] no source code translation */
 
 /*
@@ -121,14 +108,12 @@ AslLocalAllocate (unsigned int Size);
  */
 %expect 60
 
-
 /*
  * Token types: These are returned by the lexer
  *
  * NOTE: This list MUST match the AslKeywordMapping table found
  *   in aslmap.c EXACTLY!  Double check any changes!
  */
-
 %token i PARSEOP_ACCESSAS
 %token i PARSEOP_ACCESSATTRIB_BLOCK
 %token i PARSEOP_ACCESSATTRIB_BLOCK_CALL
@@ -3138,3 +3123,32 @@ AslDoError (void)
 return (TrCreateLeafNode (PARSEOP_ERRORNODE));
 
 }
+
+
+/***
+ *
+ * FUNCTION:UtGetOpName
+ *
+ * PARAMETERS:  ParseOpcode - Parser keyword ID
+ *
+ * RETURN:  Pointer to the opcode name
+ *
+ * DESCRIPTION: Get the ascii name of the parse opcode
+ *
+ 
**/
+
+char *
+UtGetOpName (
+UINT32  ParseOpcode)
+{
+#ifdef ASL_YYTNAME_START
+/*
+ * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
+ * Ignore first 8 characters of the name
+ */
+return ((char *) yytname
+[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
+#else
+return ([Unknown parser generator]);
+#endif
+}

Modified: vendor-sys/acpica/dist/compiler/asldefine.h
==
--- vendor-sys/acpica/dist/compiler/asldefine.h Fri Apr 15 20:42:27 2011
(r220679)
+++ vendor-sys/acpica/dist/compiler/asldefine.h Fri Apr 15 21:33:45 2011
(r220680)
@@ 

svn commit: r220681 - head/sys/contrib/dev/acpica/compiler

2011-04-15 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr 15 21:38:24 2011
New Revision: 220681
URL: http://svn.freebsd.org/changeset/base/220681

Log:
  Re-merge with ACPICA vendor source.

Modified:
  head/sys/contrib/dev/acpica/compiler/aslcompiler.y
  head/sys/contrib/dev/acpica/compiler/asldefine.h
  head/sys/contrib/dev/acpica/compiler/aslutils.c
  head/sys/contrib/dev/acpica/compiler/dtparser.y
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y
==
--- head/sys/contrib/dev/acpica/compiler/aslcompiler.y  Fri Apr 15 21:33:45 
2011(r220680)
+++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y  Fri Apr 15 21:38:24 
2011(r220681)
@@ -43,14 +43,6 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#define YYDEBUG 1
-#define YYERROR_VERBOSE 1
-
-/*
- * State stack - compiler will fault if it overflows.   (Default was 200)
- */
-#define YYINITDEPTH 600
-
 #include contrib/dev/acpica/compiler/aslcompiler.h
 #include stdio.h
 #include stdlib.h
@@ -74,45 +66,40 @@
  *  ResourceMacroList, and FieldUnitList
  */
 
+void *  AslLocalAllocate (unsigned int Size);
+
+/* Bison/yacc configuration */
 
-/*
- * Next statement is important - this makes everything public so that
- * we can access some of the parser tables from other modules
- */
 #define static
 #undef alloca
-#define alloca  AslLocalAllocate
-#define YYERROR_VERBOSE 1
+#define alloca  AslLocalAllocate
+#define yytname AslCompilername
 
-void *
-AslLocalAllocate (unsigned int Size);
+#define YYINITDEPTH 600 /* State stack depth */
+#define YYDEBUG 1   /* Enable debug output */
+#define YYERROR_VERBOSE 1   /* Verbose error messages */
 
 /*
  * The windows version of bison defines this incorrectly as 32768 (Not 
negative).
- * Using a custom (edited binary) version of bison that defines YYFLAG as 
YYFBAD
- * instead (#define YYFBAD  32768), so we can define it correctly here.
+ * We use a custom (edited binary) version of bison that defines YYFLAG as 
YYFBAD
+ * instead (#define YYFBAD 32768), so we can define it correctly here.
  *
  * The problem is that if YYFLAG is positive, the extended syntax error 
messages
  * are disabled.
  */
-
 #define YYFLAG  -32768
 
-
 %}
 
-
 /*
  * Declare the type of values in the grammar
  */
-
 %union {
 UINT64  i;
 char*s;
 ACPI_PARSE_OBJECT   *n;
 }
 
-
 /*! [Begin] no source code translation */
 
 /*
@@ -121,14 +108,12 @@ AslLocalAllocate (unsigned int Size);
  */
 %expect 60
 
-
 /*
  * Token types: These are returned by the lexer
  *
  * NOTE: This list MUST match the AslKeywordMapping table found
  *   in aslmap.c EXACTLY!  Double check any changes!
  */
-
 %token i PARSEOP_ACCESSAS
 %token i PARSEOP_ACCESSATTRIB_BLOCK
 %token i PARSEOP_ACCESSATTRIB_BLOCK_CALL
@@ -3138,3 +3123,32 @@ AslDoError (void)
 return (TrCreateLeafNode (PARSEOP_ERRORNODE));
 
 }
+
+
+/***
+ *
+ * FUNCTION:UtGetOpName
+ *
+ * PARAMETERS:  ParseOpcode - Parser keyword ID
+ *
+ * RETURN:  Pointer to the opcode name
+ *
+ * DESCRIPTION: Get the ascii name of the parse opcode
+ *
+ 
**/
+
+char *
+UtGetOpName (
+UINT32  ParseOpcode)
+{
+#ifdef ASL_YYTNAME_START
+/*
+ * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
+ * Ignore first 8 characters of the name
+ */
+return ((char *) yytname
+[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
+#else
+return ([Unknown parser generator]);
+#endif
+}

Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h
==
--- head/sys/contrib/dev/acpica/compiler/asldefine.hFri Apr 15 21:33:45 
2011(r220680)
+++ head/sys/contrib/dev/acpica/compiler/asldefine.hFri Apr 15 21:38:24 
2011(r220681)
@@ -66,12 +66,23 @@
 #define ASL_STRING_CACHE_SIZE   32768
 
 #define ASL_FIRST_PARSE_OPCODE  PARSEOP_ACCESSAS
-#define ASL_YYTNAME_START   3
-
 #define ASL_PARSE_OPCODE_BASE   PARSEOP_ACCESSAS/* First Lex type 
*/
 
 
 /*
+ * Per-parser-generator configuration. These values are used to cheat and
+ * directly access the bison/yacc token name table (yyname or yytname).
+ * Note: These values are the index in yyname for the first lex token
+ * (PARSEOP_ACCCESSAS).
+ */
+#if defined (YYBISON)
+#define ASL_YYTNAME_START   3   /* Bison */
+#elif defined (YYBYACC)
+#define ASL_YYTNAME_START   257 /* Berkeley yacc */
+#endif
+
+
+/*
  * Macros
  */
 #define ASL_RESDESC_OFFSET(m)   ACPI_OFFSET (AML_RESOURCE, m)
@@ -97,6 

svn commit: r220682 - head/usr.sbin/acpi/iasl

2011-04-15 Thread Jung-uk Kim
Author: jkim
Date: Fri Apr 15 21:47:10 2011
New Revision: 220682
URL: http://svn.freebsd.org/changeset/base/220682

Log:
  Purge _USE_BERKELEY_YACC definition from Makefile.  This ugly hack is no
  long necessary for us since r220680.

Modified:
  head/usr.sbin/acpi/iasl/Makefile

Modified: head/usr.sbin/acpi/iasl/Makefile
==
--- head/usr.sbin/acpi/iasl/MakefileFri Apr 15 21:38:24 2011
(r220681)
+++ head/usr.sbin/acpi/iasl/MakefileFri Apr 15 21:47:10 2011
(r220682)
@@ -62,7 +62,6 @@ WARNS?=   2
 MAN=   iasl.8
 
 CFLAGS+= -DACPI_ASL_COMPILER -I.
-CFLAGS+= -D_USE_BERKELEY_YACC
 LFLAGS= -i -s
 YFLAGS= -d
 DPADD= ${LIBPTHREAD}
___
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: r220683 - in head/sys/fs: nfs nfsclient

2011-04-15 Thread Rick Macklem
Author: rmacklem
Date: Fri Apr 15 23:07:48 2011
New Revision: 220683
URL: http://svn.freebsd.org/changeset/base/220683

Log:
  Change the experimental NFS client so that it creates nfsiod
  threads in the same manner as the regular NFS client after
  r214026 was committed. This resolves the lors fixed by r214026
  and its predecessors for the regular client.
  
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfsclient/nfs.h
  head/sys/fs/nfsclient/nfs_clbio.c
  head/sys/fs/nfsclient/nfs_clnfsiod.c
  head/sys/fs/nfsclient/nfs_clsubs.c

Modified: head/sys/fs/nfs/nfs.h
==
--- head/sys/fs/nfs/nfs.h   Fri Apr 15 21:47:10 2011(r220682)
+++ head/sys/fs/nfs/nfs.h   Fri Apr 15 23:07:48 2011(r220683)
@@ -70,8 +70,9 @@
 #defineNFS_WSIZE   8192/* Def. write data size = 8192 
*/
 #defineNFS_RSIZE   8192/* Def. read data size = 8192 
*/
 #defineNFS_READDIRSIZE 8192/* Def. readdir size */
-#defineNFS_DEFRAHEAD   0   /* Def. read ahead # blocks */
-#defineNFS_MAXRAHEAD   32  /* Max. read ahead # blocks */
+#defineNFS_DEFRAHEAD   1   /* Def. read ahead # blocks */
+#defineNFS_MAXRAHEAD   16  /* Max. read ahead # blocks */
+#defineNFS_MAXASYNCDAEMON  64  /* Max. number async_daemons 
runnable */
 #defineNFS_MAXUIDHASH  64  /* Max. # of hashed uid 
entries/mp */
 #ifndefNFSRV_LEASE
 #defineNFSRV_LEASE 120 /* Lease time in seconds for V4 
*/

Modified: head/sys/fs/nfsclient/nfs.h
==
--- head/sys/fs/nfsclient/nfs.h Fri Apr 15 21:47:10 2011(r220682)
+++ head/sys/fs/nfsclient/nfs.h Fri Apr 15 23:07:48 2011(r220683)
@@ -102,7 +102,8 @@ int ncl_fsinfo(struct nfsmount *, struct
 int ncl_init(struct vfsconf *);
 int ncl_uninit(struct vfsconf *);
 int ncl_mountroot(struct mount *);
-int ncl_nfsiodnew(int);
+void   ncl_nfsiodnew(void);
+void   ncl_nfsiodnew_tq(__unused void *, int);
 
 #endif /* _KERNEL */
 

Modified: head/sys/fs/nfsclient/nfs_clbio.c
==
--- head/sys/fs/nfsclient/nfs_clbio.c   Fri Apr 15 21:47:10 2011
(r220682)
+++ head/sys/fs/nfsclient/nfs_clbio.c   Fri Apr 15 23:07:48 2011
(r220683)
@@ -60,8 +60,8 @@ extern int newnfs_directio_allow_mmap;
 extern struct nfsstats newnfsstats;
 extern struct mtx ncl_iod_mutex;
 extern int ncl_numasync;
-extern enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD];
-extern struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD];
+extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
+extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON];
 extern int newnfs_directio_enable;
 
 int ncl_pbuf_freecnt = -1; /* start out unlimited */
@@ -1354,15 +1354,6 @@ ncl_asyncio(struct nfsmount *nmp, struct
int error, error2;
 
/*
-* Unless iothreadcnt is set  0, don't bother with async I/O
-* threads. For LAN environments, they don't buy any significant
-* performance improvement that you can't get with large block
-* sizes.
-*/
-   if (nmp-nm_readahead == 0)
-   return (EPERM);
-
-   /*
 * Commits are usually short and sweet so lets save some cpu and
 * leave the async daemons for more important rpc's (such as reads
 * and writes).
@@ -1390,13 +1381,9 @@ again:
/*
 * Try to create one if none are free.
 */
-   if (!gotiod) {
-   iod = ncl_nfsiodnew(1);
-   if (iod != -1)
-   gotiod = TRUE;
-   }
-
-   if (gotiod) {
+   if (!gotiod)
+   ncl_nfsiodnew();
+   else {
/*
 * Found one, so wake it up and tell it which
 * mount to process.
@@ -1453,11 +1440,7 @@ again:
 * We might have lost our iod while sleeping,
 * so check and loop if nescessary.
 */
-   if (nmp-nm_bufqiods == 0) {
-   NFS_DPF(ASYNCIO,
-   (ncl_asyncio: no iods after mount %p 
queue was drained, looping\n, nmp));
-   goto again;
-   }
+   goto again;
}
 
/* We might have lost our nfsiod */

Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c
==
--- head/sys/fs/nfsclient/nfs_clnfsiod.cFri Apr 15 21:47:10 2011
(r220682)
+++ head/sys/fs/nfsclient/nfs_clnfsiod.cFri Apr 15 23:07:48 2011
(r220683)
@@ -59,6 +59,7 @@ 

svn commit: r220684 - in stable/8/sys: amd64/amd64 i386/i386

2011-04-15 Thread Ryan Stone
Author: rstone
Date: Sat Apr 16 00:10:55 2011
New Revision: 220684
URL: http://svn.freebsd.org/changeset/base/220684

Log:
  MFC r220453:
   Add tunables that mirror the functionality of sysctls machdep.panic_on_nmi
   and machdep.kdb_on_nmi.
  
  Approved by:  emaste (mentor)

Modified:
  stable/8/sys/amd64/amd64/trap.c
  stable/8/sys/i386/i386/trap.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/trap.c
==
--- stable/8/sys/amd64/amd64/trap.c Fri Apr 15 23:07:48 2011
(r220683)
+++ stable/8/sys/amd64/amd64/trap.c Sat Apr 16 00:10:55 2011
(r220684)
@@ -168,10 +168,12 @@ static char *trap_msg[] = {
 static int kdb_on_nmi = 1;
 SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW,
kdb_on_nmi, 0, Go to KDB on NMI);
+TUNABLE_INT(machdep.kdb_on_nmi, kdb_on_nmi);
 #endif
 static int panic_on_nmi = 1;
 SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW,
panic_on_nmi, 0, Panic on NMI);
+TUNABLE_INT(machdep.panic_on_nmi, panic_on_nmi);
 static int prot_fault_translation = 0;
 SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
prot_fault_translation, 0, Select signal to deliver on protection 
fault);

Modified: stable/8/sys/i386/i386/trap.c
==
--- stable/8/sys/i386/i386/trap.c   Fri Apr 15 23:07:48 2011
(r220683)
+++ stable/8/sys/i386/i386/trap.c   Sat Apr 16 00:10:55 2011
(r220684)
@@ -183,10 +183,12 @@ extern int has_f00f_bug;
 static int kdb_on_nmi = 1;
 SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW,
kdb_on_nmi, 0, Go to KDB on NMI);
+TUNABLE_INT(machdep.kdb_on_nmi, kdb_on_nmi);
 #endif
 static int panic_on_nmi = 1;
 SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW,
panic_on_nmi, 0, Panic on NMI);
+TUNABLE_INT(machdep.panic_on_nmi, panic_on_nmi);
 static int prot_fault_translation = 0;
 SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
prot_fault_translation, 0, Select signal to deliver on protection 
fault);
___
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