svn commit: r240594 - head/sys/boot/fdt/dts

2012-09-17 Thread Andrew Turner
Author: andrew
Date: Mon Sep 17 07:14:07 2012
New Revision: 240594
URL: http://svn.freebsd.org/changeset/base/240594

Log:
  Add the Tegra2 DTS files. Now our dtc supports including other files use
  this support to pull out the SoC specific parts of the dts file.

Added:
  head/sys/boot/fdt/dts/tegra20-paz00.dts   (contents, props changed)
  head/sys/boot/fdt/dts/tegra20.dtsi   (contents, props changed)

Added: head/sys/boot/fdt/dts/tegra20-paz00.dts
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/fdt/dts/tegra20-paz00.dts Mon Sep 17 07:14:07 2012
(r240594)
@@ -0,0 +1,58 @@
+/*-
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * Copyright (c) 2012 Andrew Turner
+ * All rights reserved.
+ *
+ * Developed by Damjan Marion 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * $FreeBSD$
+ */
+/dts-v1/;
+
+/include/ "tegra20.dtsi"
+
+/ {
+   model = "Toshiba AC100 / Dynabook AZ";
+
+   aliases {
+   serial0 = &serial0;
+   soc = &SOC;
+   };
+
+   memory {
+   device_type = "memory";
+   reg = < 0x 0x2000 >;/* 512MB RAM at 0x0 */
+   };
+
+   chosen {
+   stdin = "serial0";
+   stdout = "serial0";
+   };
+
+   SOC: tegra20@0 {
+   serial0: serial@70006000 {
+   };
+   };
+};
+

Added: head/sys/boot/fdt/dts/tegra20.dtsi
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/fdt/dts/tegra20.dtsi  Mon Sep 17 07:14:07 2012
(r240594)
@@ -0,0 +1,74 @@
+/*-
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * Copyright (c) 2012 Andrew Turner
+ * All rights reserved.
+ *
+ * Developed by Damjan Marion 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * $FreeBSD$
+ */
+
+/ {
+   compatible = "compal,paz00", "nvidia,tegra20";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   interrupt-parent = <&GIC>;
+
+   SOC: tegra20@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "simple-bus";
+   ranges;
+   bus-frequency = <0>;
+
+   GIC: interrupt-controller@50041000 {
+   compatible = "arm,gic";
+   reg =  

svn commit: r240595 - head/usr.sbin/bsnmpd/modules/snmp_hostres

2012-09-17 Thread Mikolaj Golub
Author: trociny
Date: Mon Sep 17 07:32:53 2012
New Revision: 240595
URL: http://svn.freebsd.org/changeset/base/240595

Log:
  In snmp_hostres, device_map table is used for consistent device table
  indexing. When a device has gone it is not removed from device_map
  table but just its entry_p field is set to NULL.
  
  So when traversing device_map in disk_OS_get_ATA_disks() and
  disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the
  bsnmpd crash is possible when a removed map entry is dereferenced.
  
  Before the fix, for disk_OS_get_ATA_disks() the crash could be easily
  reproduced running:
  
atacontrol detach ata1
  
  The crash was not observed in disk_OS_get_MD_disks() because currently
  snmp_hostres does no see md(4) disks: to get the device list it uses
  devinfo(3), which does not return md devices.
  
  Reported by:  Miroslav Lachman 000.fbsd quip.cz
  MFC after:1 week

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
==
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon Sep 
17 07:14:07 2012(r240594)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon Sep 
17 07:32:53 2012(r240595)
@@ -287,6 +287,9 @@ disk_OS_get_ATA_disks(void)
 
/* Walk over the device table looking for ata disks */
STAILQ_FOREACH(map, &device_map, link) {
+   /* Skip deleted entries. */
+   if (map->entry_p == NULL)
+   continue;
for (found = lookup; found->media != DSM_UNKNOWN; found++) {
if (strncmp(map->name_key, found->dev_name,
strlen(found->dev_name)) != 0)
@@ -345,6 +348,9 @@ disk_OS_get_MD_disks(void)
 
/* Look for md devices */
STAILQ_FOREACH(map, &device_map, link) {
+   /* Skip deleted entries. */
+   if (map->entry_p == NULL)
+   continue;
if (sscanf(map->name_key, "md%d", &unit) != 1)
continue;
 
___
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: r240484 - head/sys/dev/fdt

2012-09-17 Thread Grzegorz Bernacki

On 09/16/12 01:27, Aleksandr Rybalko wrote:

On Fri, 14 Sep 2012 18:41:13 +0200
Grzegorz Bernacki  wrote:


On 09/14/12 16:16, Aleksandr Rybalko wrote:

On Fri, 14 Sep 2012 09:33:35 + (UTC)
Grzegorz Bernacki   wrote:


Author: gber
Date: Fri Sep 14 09:33:35 2012
New Revision: 240484
URL: http://svn.freebsd.org/changeset/base/240484

Log:
Set busaddr and bussize to 0 when fdt_get_range() fails.


Why bussize is 0?


I though that setting it to 0 makes sense, since we do not use
this variable in this function and setting it to some value could be
confused. I could skip setting it, but I also thought it could cause
confusion :). If you think that setting it to other value or remove
it will be better please let me know and I will change it.

thanks
grzesiek


Yeah, indeed, false alarm. Sorry for noise.

But it will be very nice to hear developers opinion about ePAPR1.1 row
(about "range" property):
"If the property is not present in a bus node, it is assumed that no
mapping exists between children of the node and the parent address
space."

Assuming since in most cases root node have no "ranges" property, but
his child "SOC" have that property with defaults (0x0 x 0x).
So nodes which have property "ranges" or not, must be processed same
way. Right?

WBW


Hi,

I am not quite sure that I understand your question. What nodes are you 
referring to and what to you mean by processing them the same way?


regards,
grzesiek
___
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: r240595 - head/usr.sbin/bsnmpd/modules/snmp_hostres

2012-09-17 Thread John Rumbaugh






http://www.chumleaf.com

On Monday, September 17, 2012 12:34:10 AM UTC-7, Mikolaj Golub wrote:
>
> Author: trociny 
> Date: Mon Sep 17 07:32:53 2012 
> New Revision: 240595 
> URL: http://svn.freebsd.org/changeset/base/240595 
>
> Log: 
>   In snmp_hostres, device_map table is used for consistent device table 
>   indexing. When a device has gone it is not removed from device_map 
>   table but just its entry_p field is set to NULL. 
>   
>   So when traversing device_map in disk_OS_get_ATA_disks() and 
>   disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the 
>   bsnmpd crash is possible when a removed map entry is dereferenced. 
>   
>   Before the fix, for disk_OS_get_ATA_disks() the crash could be easily 
>   reproduced running: 
>   
> atacontrol detach ata1 
>   
>   The crash was not observed in disk_OS_get_MD_disks() because currently 
>   snmp_hostres does no see md(4) disks: to get the device list it uses 
>   devinfo(3), which does not return md devices. 
>   
>   Reported by:Miroslav Lachman 000.fbsd quip.cz 
>   MFC after:1 week 
>
> Modified: 
>   head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c 
>
> Modified: 
> head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c 
> ==
>  
>
> --- 
> head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
> Mon 
> Sep 17 07:14:07 2012(r240594) 
> +++ 
> head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
> Mon 
> Sep 17 07:32:53 2012(r240595) 
> @@ -287,6 +287,9 @@ disk_OS_get_ATA_disks(void) 
>   
>  /* Walk over the device table looking for ata disks */ 
>  STAILQ_FOREACH(map, &device_map, link) { 
> +/* Skip deleted entries. */ 
> +if (map->entry_p == NULL) 
> +continue; 
>  for (found = lookup; found->media != DSM_UNKNOWN; 
> found++) { 
>  if (strncmp(map->name_key, found->dev_name, 
>  strlen(found->dev_name)) != 0) 
> @@ -345,6 +348,9 @@ disk_OS_get_MD_disks(void) 
>   
>  /* Look for md devices */ 
>  STAILQ_FOREACH(map, &device_map, link) { 
> +/* Skip deleted entries. */ 
> +if (map->entry_p == NULL) 
> +continue; 
>  if (sscanf(map->name_key, "md%d", &unit) != 1) 
>  continue; 
>   
> ___ 
> svn-s...@freebsd.org  mailing list 
> http://lists.freebsd.org/mailman/listinfo/svn-src-all 
> To unsubscribe, send any mail to "svn-src-all...@freebsd.org " 
>
>
___
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: r240596 - head/sys/arm/conf

2012-09-17 Thread Andrew Turner
Author: andrew
Date: Mon Sep 17 09:22:59 2012
New Revision: 240596
URL: http://svn.freebsd.org/changeset/base/240596

Log:
  Add a kernel config for the Toshiba AC100. The AC100 is an ARM laptop with
  an NVidia Tegra 2 CPU.
  
  Tegra 2 needs an external patch to pmap for atomic operations to work. Even
  with this the Kernel only gets to the mount root prompt. As such Tegra
  support is considered experimental, however adding the kernel config will
  help ensure the Tegra code builds.

Added:
  head/sys/arm/conf/AC100   (contents, props changed)

Added: head/sys/arm/conf/AC100
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/conf/AC100 Mon Sep 17 09:22:59 2012(r240596)
@@ -0,0 +1,96 @@
+#
+# Custom kernel for Toshiba AC100
+#
+# $FreeBSD$
+#
+
+ident  AC100
+include"../tegra/std.tegra2"
+
+makeoptionsMODULES_OVERRIDE=""
+
+makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
+makeoptionsWERROR="-Werror"
+
+#options   SCHED_ULE   #ULE scheduler
+optionsSCHED_4BSD  #4BSD scheduler
+optionsINET#InterNETworking
+#options   INET6   #IPv6 communications protocols
+optionsFFS #Berkeley Fast Filesystem
+#options   NFSCL   #Network Filesystem Client
+#options   NFSLOCKD#Network Lock Manager
+#options   NFS_ROOT#NFS usable as /, requires NFSCLIENT
+#options   BOOTP
+#options   BOOTP_NFSROOT
+#options   BOOTP_NFSV3
+#options   BOOTP_WIRED_TO=mge0
+
+optionsGEOM_PART_GPT
+optionsROOTDEVNAME=\"ufs:/dev/da0p1\"
+
+optionsSYSVSHM #SYSV-style shared memory
+optionsSYSVMSG #SYSV-style message queues
+optionsSYSVSEM #SYSV-style semaphores
+options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+optionsMUTEX_NOINLINE
+optionsRWLOCK_NOINLINE
+optionsNO_FFS_SNAPSHOT
+optionsNO_SWAPPING
+
+#options   SMP
+
+# Debugging
+optionsVERBOSE_SYSINIT
+#options   ALT_BREAK_TO_DEBUGGER
+optionsDDB
+optionsGDB
+optionsDIAGNOSTIC
+optionsINVARIANTS  #Enable calls of extra sanity checking
+optionsINVARIANT_SUPPORT   #Extra sanity checks of internal 
structures, required by INVARIANTS
+optionsKDB
+optionsKDB_TRACE
+#options   KTR
+#options   KTR_VERBOSE=0
+#options   KTR_ENTRIES=16384
+#options   KTR_MASK=(KTR_SPARE2)
+#options   KTR_COMPILE=KTR_ALL
+optionsWITNESS #Enable checks to detect deadlocks and 
cycles
+optionsWITNESS_SKIPSPIN#Don't run witness on spinlocks for 
speed
+#options   WITNESS_KDB
+optionsMUTEX_DEBUG
+
+# Pseudo devices
+device random
+device pty
+device loop
+device md
+
+# USB
+#options   USB_DEBUG   # enable debug msgs
+#deviceusb
+#deviceehci
+#deviceumass
+#devicescbus
+#devicepass
+#deviceda
+
+# SATA
+#deviceata
+#deviceatadisk
+#devicemvs
+
+# Serial ports
+device uart
+
+# I2C (TWSI)
+#deviceiic
+#deviceiicbus
+
+#Network
+device ether
+
+#FDT
+optionsFDT
+optionsFDT_DTB_STATIC
+makeoptionsFDT_DTS_FILE=tegra20-paz00.dts
+
___
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: r240597 - head/sys/dev/usb/net

2012-09-17 Thread Kevin Lo
Author: kevlo
Date: Mon Sep 17 09:32:11 2012
New Revision: 240597
URL: http://svn.freebsd.org/changeset/base/240597

Log:
  Remove unused variable cd.
  This variable is initialized but not used.

Modified:
  head/sys/dev/usb/net/uhso.c

Modified: head/sys/dev/usb/net/uhso.c
==
--- head/sys/dev/usb/net/uhso.c Mon Sep 17 09:22:59 2012(r240596)
+++ head/sys/dev/usb/net/uhso.c Mon Sep 17 09:32:11 2012(r240597)
@@ -540,7 +540,6 @@ uhso_attach(device_t self)
 {
struct uhso_softc *sc = device_get_softc(self);
struct usb_attach_arg *uaa = device_get_ivars(self);
-   struct usb_config_descriptor *cd;
struct usb_interface_descriptor *id;
struct sysctl_ctx_list *sctx;
struct sysctl_oid *soid;
@@ -561,7 +560,6 @@ uhso_attach(device_t self)
sc->sc_ttys = 0;
sc->sc_radio = 1;
 
-   cd = usbd_get_config_descriptor(uaa->device);
id = usbd_get_interface_descriptor(uaa->iface);
sc->sc_ctrl_iface_no = id->bInterfaceNumber;
 
___
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: r240598 - stable/9/bin/setfacl

2012-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 17 11:21:57 2012
New Revision: 240598
URL: http://svn.freebsd.org/changeset/base/240598

Log:
  MFC r240076:
  
  Fix compact form of "synchronize" permission in setfacl(1) manual page - it
  should be "s", not "S".
  
  PR:   docs/162380

Modified:
  stable/9/bin/setfacl/setfacl.1
Directory Properties:
  stable/9/bin/setfacl/   (props changed)

Modified: stable/9/bin/setfacl/setfacl.1
==
--- stable/9/bin/setfacl/setfacl.1  Mon Sep 17 09:32:11 2012
(r240597)
+++ stable/9/bin/setfacl/setfacl.1  Mon Sep 17 11:21:57 2012
(r240598)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 9, 2011
+.Dd September 2, 2012
 .Dt SETFACL 1
 .Os
 .Sh NAME
@@ -337,7 +337,7 @@ read_acl
 write_acl
 .It o
 write_owner
-.It S
+.It s
 synchronize
 .El
 .Pp
___
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: r240599 - stable/9/usr.bin/rctl

2012-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 17 11:27:56 2012
New Revision: 240599
URL: http://svn.freebsd.org/changeset/base/240599

Log:
  MFC r232329:
  
  Use proper "maxproc" name, not "nproc".
  
  PR:   docs/162172

Modified:
  stable/9/usr.bin/rctl/rctl.8
Directory Properties:
  stable/9/usr.bin/rctl/   (props changed)

Modified: stable/9/usr.bin/rctl/rctl.8
==
--- stable/9/usr.bin/rctl/rctl.8Mon Sep 17 11:21:57 2012
(r240598)
+++ stable/9/usr.bin/rctl/rctl.8Mon Sep 17 11:27:56 2012
(r240599)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 22, 2011
+.Dd March 1, 2012
 .Dt RCTL 8
 .Os
 .Sh NAME
@@ -117,8 +117,8 @@ A filter is a rule for which one of more
 For example, a filter that matches every rule could be written as ":::=/",
 or, in short, ":".
 A filter that matches all the login classes would be "loginclass:".
-A filter that matches all defined rules for nproc resource would be
-"::nproc".
+A filter that matches all defined rules for maxproc resource would be
+"::maxproc".
 .Pp
 .Sh RESOURCES
 .Bl -column -offset 3n "pseudoterminals"
___
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: r240600 - stable/9/usr.bin/rctl

2012-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 17 11:35:38 2012
New Revision: 240600
URL: http://svn.freebsd.org/changeset/base/240600

Log:
  MFC r233456 by joel@:
  
  Remove superfluous paragraph macro.
  
  MFC r233665 by joel@:
  
  mandoc complains loudly when s are misused in columnated lists. Fix
  this syntax violation and while I'm here also convert  to Ta and adjust
  quotation marks in order to prevent this problem in the future.
  
  MFC r233667 by joel@:
  
  Remove superfluous paragraph macro.
  
  MFC r234568 by delphij@:
  
  The .Fx macro needs the version number be in its own word separated by
  a space.  This change have no visible effect for rendering.

Modified:
  stable/9/usr.bin/rctl/rctl.8
Directory Properties:
  stable/9/usr.bin/rctl/   (props changed)

Modified: stable/9/usr.bin/rctl/rctl.8
==
--- stable/9/usr.bin/rctl/rctl.8Mon Sep 17 11:27:56 2012
(r240599)
+++ stable/9/usr.bin/rctl/rctl.8Mon Sep 17 11:35:38 2012
(r240600)
@@ -119,36 +119,34 @@ or, in short, ":".
 A filter that matches all the login classes would be "loginclass:".
 A filter that matches all defined rules for maxproc resource would be
 "::maxproc".
-.Pp
 .Sh RESOURCES
 .Bl -column -offset 3n "pseudoterminals"
-.It "cputime   CPU time, in seconds"
-.It "datasize  data size, in bytes"
-.It "stacksize stack size, in bytes"
-.It "coredumpsize  core dump size, in bytes"
-.It "memoryuse resident set size, in bytes"
-.It "memorylocked  locked memory, in bytes"
-.It "maxproc   number of processes"
-.It "openfiles file descriptor table size"
-.It "vmemoryuseaddress space limit, in bytes"
-.It "pseudoterminals   number of PTYs"
-.It "swapuse   swap usage, in bytes"
-.It "nthr  number of threads"
-.It "msgqqueuednumber of queued SysV messages"
-.It "msgqsize  SysV message queue size, in bytes"
-.It "nmsgq number of SysV message queues"
-.It "nsem  number of SysV semaphores"
-.It "nsemopnumber of SysV semaphores modified in a single semop(2) 
call"
-.It "nshm  number of SysV shared memory segments"
-.It "shmsize   SysV shared memory size, in bytes"
-.It "wallclock wallclock time, in seconds"
+.It cputime Ta "CPU time, in seconds"
+.It datasize Ta "data size, in bytes"
+.It stacksize Ta "stack size, in bytes"
+.It coredumpsize Ta "core dump size, in bytes"
+.It memoryuse Ta "resident set size, in bytes"
+.It memorylocked Ta "locked memory, in bytes"
+.It maxproc Ta "number of processes"
+.It openfiles Ta "file descriptor table size"
+.It vmemoryuse Ta "address space limit, in bytes"
+.It pseudoterminals Ta "number of PTYs"
+.It swapuse Ta "swap usage, in bytes"
+.It nthr Ta "number of threads"
+.It msgqqueued Ta "number of queued SysV messages"
+.It msgqsize Ta "SysV message queue size, in bytes"
+.It nmsgq Ta "number of SysV message queues"
+.It nsem Ta "number of SysV semaphores"
+.It nsemop Ta "number of SysV semaphores modified in a single semop(2) call"
+.It nshm Ta "number of SysV shared memory segments"
+.It shmsize Ta "SysV shared memory size, in bytes"
+.It wallclock Ta "wallclock time, in seconds"
 .El
-.Pp
 .Sh ACTIONS
 .Bl -column -offset 3n "pseudoterminals"
-.It "deny  deny the allocation; not supported for cpu and wallclock"
-.It "log   log a warning to the console"
-.It "devctlsend notification to"
+.It deny Ta "deny the allocation; not supported for cpu and wallclock"
+.It log Ta "log a warning to the console"
+.It devctl Ta "send notification to"
 .Xr devd 8
 .It "sig*  e.g. sigterm; send a signal to the offending process"
 .El
@@ -162,7 +160,6 @@ Attempt to add rule with action not supp
 in error.
 .Pp
 Note that limiting RSS may kill the machine due to thrashing.
-.Pp
 .Sh EXIT STATUS
 .Ex -std
 .Sh EXAMPLES
@@ -189,7 +186,7 @@ Display all the rules applicable to proc
 The
 .Nm
 command appeared in
-.Fx 9.0.
+.Fx 9.0 .
 .Sh AUTHORS
 .An -nosplit
 The
___
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: r240601 - stable/9/usr.bin/rctl

2012-09-17 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Sep 17 11:39:28 2012
New Revision: 240601
URL: http://svn.freebsd.org/changeset/base/240601

Log:
  MFC r239990:
  
  Improve description for "rctl -l".

Modified:
  stable/9/usr.bin/rctl/rctl.8
Directory Properties:
  stable/9/usr.bin/rctl/   (props changed)

Modified: stable/9/usr.bin/rctl/rctl.8
==
--- stable/9/usr.bin/rctl/rctl.8Mon Sep 17 11:35:38 2012
(r240600)
+++ stable/9/usr.bin/rctl/rctl.8Mon Sep 17 11:39:28 2012
(r240601)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 1, 2012
+.Dd September 1, 2012
 .Dt RCTL 8
 .Os
 .Sh NAME
@@ -68,6 +68,10 @@ to the RCTL database.
 .It Fl l Ar filter
 Display rules applicable to the process defined by
 .Ar filter .
+Note that this is different from showing the rules when called without
+any options, as it shows not just the rules with subject equal to that
+of process, but also rules for the user, jail, and login class applicable
+to the process.
 .It Fl r Ar filter
 Remove rules matching
 .Ar filter
@@ -90,7 +94,8 @@ Subject defines the kind of entity the r
 It can be either process, user, login class, or jail.
 .Pp
 Subject ID identifies the subject.
-It can be user name, numerical user ID, login class name, or jail name.
+It can be a process ID, user name, numerical user ID, login class name,
+or jail name.
 .Pp
 Resource identifies the resource the rule controls.
 .Pp
___
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: r240602 - head/sys/dev/pci

2012-09-17 Thread Gavin Atkinson
Author: gavin
Date: Mon Sep 17 12:51:48 2012
New Revision: 240602
URL: http://svn.freebsd.org/changeset/base/240602

Log:
  - Add #defines for the bits within the iPCI Express PCIR_EXPRESS_LINK_CTL
register
  - Add missing register PCIR_EXPRESS_ROOT_CAP
  - Correct a spelling mistake (SLAT -> SLOT) [1]
  
  Reviewed by:  jhb [1]

Modified:
  head/sys/dev/pci/pcireg.h

Modified: head/sys/dev/pci/pcireg.h
==
--- head/sys/dev/pci/pcireg.h   Mon Sep 17 11:39:28 2012(r240601)
+++ head/sys/dev/pci/pcireg.h   Mon Sep 17 12:51:48 2012(r240602)
@@ -687,6 +687,19 @@
 #definePCIM_LINK_CAP_ASPM_COMPLIANCE   0x0040
 #definePCIM_LINK_CAP_PORT  0xff00
 #definePCIR_EXPRESS_LINK_CTL   0x10
+#definePCIM_EXP_LINK_CTL_ASPMC_DIS 0x
+#definePCIM_EXP_LINK_CTL_ASPMC_L0S 0x0001
+#definePCIM_EXP_LINK_CTL_ASPMC_L1  0x0002
+#definePCIM_EXP_LINK_CTL_ASPMC 0x0003
+#definePCIM_EXP_LINK_CTL_RCB   0x0008
+#definePCIM_EXP_LINK_CTL_LINK_DIS  0x0010
+#definePCIM_EXP_LINK_CTL_RETRAIN_LINK  0x0020
+#definePCIM_EXP_LINK_CTL_COMMON_CLOCK  0x0040
+#definePCIM_EXP_LINK_CTL_EXTENDED_SYNC 0x0080
+#definePCIM_EXP_LINK_CTL_ECPM  0x0100
+#definePCIM_EXP_LINK_CTL_HAWD  0x0200
+#definePCIM_EXP_LINK_CTL_LBMIE 0x0400
+#definePCIM_EXP_LINK_CTL_LABIE 0x0800
 #definePCIR_EXPRESS_LINK_STA   0x12
 #definePCIM_LINK_STA_SPEED 0x000f
 #definePCIM_LINK_STA_WIDTH 0x03f0
@@ -732,6 +745,7 @@
 #definePCIM_EXP_SLOT_STA_EIS   0x0080
 #definePCIM_EXP_SLOT_STA_DLLSC 0x0100
 #definePCIR_EXPRESS_ROOT_CTL   0x1c
+#definePCIR_EXPRESS_ROOT_CAP   0x1e
 #definePCIR_EXPRESS_ROOT_STA   0x20
 #definePCIR_EXPRESS_DEVICE_CAP20x24
 #definePCIR_EXPRESS_DEVICE_CTL20x28
@@ -753,7 +767,7 @@
 #definePCIR_EXPRESS_LINK_CAP2  0x2c
 #definePCIR_EXPRESS_LINK_CTL2  0x30
 #definePCIR_EXPRESS_LINK_STA2  0x32
-#definePCIR_EXPRESS_SLAT_CAP2  0x34
+#definePCIR_EXPRESS_SLOT_CAP2  0x34
 #definePCIR_EXPRESS_SLOT_CTL2  0x38
 #definePCIR_EXPRESS_SLOT_STA2  0x3a
 
___
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: r240603 - stable/9/lib/libc/locale

2012-09-17 Thread Gleb Smirnoff
Author: glebius
Date: Mon Sep 17 13:05:39 2012
New Revision: 240603
URL: http://svn.freebsd.org/changeset/base/240603

Log:
  Merge r238182 by theraven@:
Restore the __collate_load_error global that was accidentally removed in the
xlocale refactoring.

Modified:
  stable/9/lib/libc/locale/collate.c
  stable/9/lib/libc/locale/setrunelocale.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/locale/collate.c
==
--- stable/9/lib/libc/locale/collate.c  Mon Sep 17 12:51:48 2012
(r240602)
+++ stable/9/lib/libc/locale/collate.c  Mon Sep 17 13:05:39 2012
(r240603)
@@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$");
  * We also modify the collation table test functions to search the thread-local
  * table first and the global table second.  
  */
-#define __collate_load_error (table->__collate_load_error)
 #define __collate_substitute_nontrivial 
(table->__collate_substitute_nontrivial)
 #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr)
 #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr)
 #define __collate_chain_pri_table (table->__collate_chain_pri_table)
+int __collate_load_error;
 
 
 struct xlocale_collate __xlocale_global_collate = {
@@ -109,7 +109,9 @@ __collate_load(const char *encoding, loc
 int
 __collate_load_tables(const char *encoding)
 {
-   return __collate_load_tables_l(encoding, &__xlocale_global_collate);
+   int ret = __collate_load_tables_l(encoding, &__xlocale_global_collate);
+   __collate_load_error = __xlocale_global_collate.__collate_load_error;
+   return ret;
 }
 
 int
@@ -123,7 +125,7 @@ __collate_load_tables_l(const char *enco
 
/* 'encoding' must be already checked. */
if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) {
-   __collate_load_error = 1;
+   table->__collate_load_error = 1;
return (_LDP_CACHE);
}
 
@@ -240,7 +242,7 @@ __collate_load_tables_l(const char *enco
break;
}
}
-   __collate_load_error = 0;
+   table->__collate_load_error = 0;
 
return (_LDP_LOADED);
 }

Modified: stable/9/lib/libc/locale/setrunelocale.c
==
--- stable/9/lib/libc/locale/setrunelocale.cMon Sep 17 12:51:48 2012
(r240602)
+++ stable/9/lib/libc/locale/setrunelocale.cMon Sep 17 13:05:39 2012
(r240603)
@@ -67,7 +67,6 @@ extern _RuneLocale*_Read_RuneMagi(FILE 
 
 static int __setrunelocale(struct xlocale_ctype *l, const char *);
 
-#define __collate_load_error (table->__collate_load_error)
 #define __collate_substitute_nontrivial 
(table->__collate_substitute_nontrivial)
 #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr)
 #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr)
___
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: r240604 - in stable/9/sys/geom: mirror raid3

2012-09-17 Thread Gleb Smirnoff
Author: glebius
Date: Mon Sep 17 13:06:47 2012
New Revision: 240604
URL: http://svn.freebsd.org/changeset/base/240604

Log:
  Merge r240371:
  When synchronizing, include in the config dump amount of
bytes syncronized.
  The rationale behind this is the following: for large disks the
percent synchronisation counter ticks too seldom, and monitoring
software (as well as human operator) can't tell whether
synchronisation goes on or one of disks got stuck. On an idle
server one can look into gstat and see whether synchronisation goes
on or not, but on a busy server that won't work. Also, new value
monitored can be differentiated obtaining the synchronisation speed
quite precisely.
  
Submitted by: Konstantin Kukushkin 
Reviewed by:  pjd

Modified:
  stable/9/sys/geom/mirror/g_mirror.c
  stable/9/sys/geom/raid3/g_raid3.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/mirror/g_mirror.c
==
--- stable/9/sys/geom/mirror/g_mirror.c Mon Sep 17 13:05:39 2012
(r240603)
+++ stable/9/sys/geom/mirror/g_mirror.c Mon Sep 17 13:06:47 2012
(r240604)
@@ -3143,6 +3143,11 @@ g_mirror_dumpconf(struct sbuf *sb, const
sc->sc_provider->mediasize));
}
sbuf_printf(sb, "\n");
+   if (disk->d_sync.ds_offset > 0) {
+   sbuf_printf(sb, "%s%jd"
+   "\n", indent,
+   (intmax_t)disk->d_sync.ds_offset);
+   }
}
sbuf_printf(sb, "%s%u\n", indent,
disk->d_sync.ds_syncid);

Modified: stable/9/sys/geom/raid3/g_raid3.c
==
--- stable/9/sys/geom/raid3/g_raid3.c   Mon Sep 17 13:05:39 2012
(r240603)
+++ stable/9/sys/geom/raid3/g_raid3.c   Mon Sep 17 13:06:47 2012
(r240604)
@@ -3447,6 +3447,11 @@ g_raid3_dumpconf(struct sbuf *sb, const 
(sc->sc_mediasize / (sc->sc_ndisks - 1;
}
sbuf_printf(sb, "\n");
+   if (disk->d_sync.ds_offset > 0) {
+   sbuf_printf(sb, "%s%jd"
+   "\n", indent,
+   (intmax_t)disk->d_sync.ds_offset);
+   }
}
sbuf_printf(sb, "%s%u\n", indent,
disk->d_sync.ds_syncid);
___
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: r240605 - head/usr.bin/systat

2012-09-17 Thread Alexander V. Chernikov
Author: melifaro
Date: Mon Sep 17 13:36:47 2012
New Revision: 240605
URL: http://svn.freebsd.org/changeset/base/240605

Log:
  Make systat(1) accept fractional number of seconds.
  Make old alarm(3)-based code use select(2).
  
  MFC after:2 weeks

Modified:
  head/usr.bin/systat/cmds.c
  head/usr.bin/systat/extern.h
  head/usr.bin/systat/icmp.c
  head/usr.bin/systat/icmp6.c
  head/usr.bin/systat/ip.c
  head/usr.bin/systat/ip6.c
  head/usr.bin/systat/keyboard.c
  head/usr.bin/systat/main.c
  head/usr.bin/systat/systat.1
  head/usr.bin/systat/tcp.c

Modified: head/usr.bin/systat/cmds.c
==
--- head/usr.bin/systat/cmds.c  Mon Sep 17 13:06:47 2012(r240604)
+++ head/usr.bin/systat/cmds.c  Mon Sep 17 13:36:47 2012(r240605)
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
 static const char sccsid[] = "@(#)cmds.c   8.2 (Berkeley) 4/29/95";
 #endif
 
+#include 
+
 #include 
 #include 
 #include 
@@ -49,10 +51,9 @@ command(const char *cmd)
 {
struct cmdtab *p;
char *cp, *tmpstr, *tmpstr1;
-   int interval, omask;
+   double t;
 
tmpstr = tmpstr1 = strdup(cmd);
-   omask = sigblock(sigmask(SIGALRM));
for (cp = tmpstr1; *cp && !isspace(*cp); cp++)
;
if (*cp)
@@ -68,7 +69,7 @@ command(const char *cmd)
goto done;
}
if (strcmp(tmpstr1, "stop") == 0) {
-   alarm(0);
+   delay = 0;
mvaddstr(CMDLINE, 0, "Refresh disabled.");
clrtoeol();
goto done;
@@ -88,19 +89,23 @@ command(const char *cmd)
clrtoeol();
goto done;
}
-   interval = atoi(tmpstr1);
-   if (interval <= 0 &&
-   (strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 
0)) {
-   interval = *cp ? atoi(cp) : naptime;
-   if (interval <= 0) {
-   error("%d: bad interval.", interval);
-   goto done;
+   t = strtod(tmpstr1, NULL) * 100.0;
+   if (t > 0 && t < (double)UINT_MAX)
+   delay = (unsigned int)t;
+   if ((t <= 0 || t > (double)UINT_MAX) &&
+   (strcmp(tmpstr1, "start") == 0 ||
+   strcmp(tmpstr1, "interval") == 0)) {
+   if (*cp != '\0') {
+   t = strtod(cp, NULL) * 100.0;
+   if (t <= 0 || t >= (double)UINT_MAX) {
+   error("%d: bad interval.", (int)t);
+   goto done;
+   }
}
}
-   if (interval > 0) {
-   alarm(0);
-   naptime = interval;
-   display(0);
+   if (t > 0) {
+   delay = (unsigned int)t;
+   display();
status();
goto done;
}
@@ -112,7 +117,6 @@ command(const char *cmd)
if (p) {
if (curcmd == p)
goto done;
-   alarm(0);
(*curcmd->c_close)(wnd);
curcmd->c_flags &= ~CF_INIT;
wnd = (*p->c_open)();
@@ -133,14 +137,13 @@ command(const char *cmd)
}
curcmd = p;
labels();
-   display(0);
+   display();
status();
goto done;
}
if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp))
error("%s: Unknown command.", tmpstr1);
 done:
-   sigsetmask(omask);
free(tmpstr);
 }
 
@@ -177,7 +180,7 @@ status(void)
 {
 
error("Showing %s, refresh every %d seconds.",
- curcmd->c_name, naptime);
+ curcmd->c_name, delay / 100);
 }
 
 int

Modified: head/usr.bin/systat/extern.h
==
--- head/usr.bin/systat/extern.hMon Sep 17 13:06:47 2012
(r240604)
+++ head/usr.bin/systat/extern.hMon Sep 17 13:36:47 2012
(r240605)
@@ -49,11 +49,12 @@ extern int  CMDLINE;
 extern int dk_ndrive;
 extern int hz, stathz;
 extern double  hertz;  /* sampling frequency for cp_time and dk_time */
-extern int naptime, col;
+extern int col;
 extern int nhosts;
 extern int nports;
 extern int protos;
 extern int verbose;
+extern unsigned intdelay;
 
 struct inpcb;
 
@@ -87,7 +88,7 @@ intcmdnetstat(const char *, const char
 struct  cmdtab *lookup(const char *);
 voidcommand(const char *);
 voiddie(int);
-voiddisplay(int);
+voiddisplay(void);
 int dkinit(void);
 int dkcmd(char *, char *);
 voiderror(const char *fmt, ...) __printflike(1, 2);

Modified: head/usr.bin/systat/icmp.c
==
--- head/usr.bin/systat/icmp.c  Mon Sep 17 13:06:47 2012(r240604)
+++ head/usr.bin/systat/icmp.

Re: svn commit: r240605 - head/usr.bin/systat

2012-09-17 Thread Alexander V. Chernikov

On 17.09.2012 17:36, Alexander V. Chernikov wrote:

Author: melifaro
Date: Mon Sep 17 13:36:47 2012
New Revision: 240605
URL: http://svn.freebsd.org/changeset/base/240605

Log:
   Make systat(1) accept fractional number of seconds.
   Make old alarm(3)-based code use select(2).


Ability to specify small intervals can be very handy while
debugging traffic microbursts.

Note that locale-aware strtod(3) is used to parse delay which
is slightly different from ping.



   MFC after:   2 weeks

___
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: r240606 - stable/9/sys/kern

2012-09-17 Thread Mikolaj Golub
Author: trociny
Date: Mon Sep 17 14:53:33 2012
New Revision: 240606
URL: http://svn.freebsd.org/changeset/base/240606

Log:
  MFC r240003, r240004:
  
  r240003:
  
  In soreceive_generic() when checking if the type of mbuf has changed
  check it for MT_CONTROL type too, otherwise the assertion
  "m->m_type == MT_DATA" below may be triggered by the following scenario:
  
  - the sender sends some data (MT_DATA) and then a file descriptor
(MT_CONTROL);
  - the receiver calls recv(2) with a MSG_WAITALL asking for data larger
than the receive buffer (uio_resid > hiwat).
  
  r240004:
  
  In soreceive_generic() remove the optimization for the case when
  MSG_WAITALL is set, and it is possible to do the entire receive
  operation at once if we block (resid <= hiwat). Actually it might make
  the recv(2) with MSG_WAITALL flag get stuck when there is enough space
  in the receiver buffer to satisfy the request but not enough to open
  the window closed previously due to the buffer being full.
  
  The issue can be reproduced using the following scenario:
  
  On the sender side do 2 send(2) requests:
  
  1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10);
  2) data of size equal to SOBUF_SIZE.
  
  On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set:
  
  1) recv() data of SOBUF_SIZE / 10 size;
  2) recv() data of SOBUF_SIZE size;
  
  We totally fill the receiver buffer with one SOBUF_SIZE/10 size request
  and partial SOBUF_SIZE request. When the first request is processed we
  get SOBUF_SIZE/10 free space. It is just enough to receive the rest of
  bytes for the second request, and soreceive_generic() blocks in the
  part that is a subject of this change waiting for the rest. But the
  window was closed when the buffer was filled and to avoid silly window
  syndrome it opens only when available space is larger than sb_hiwat/4
  or maxseg. So it is stuck and pending data is only sent via TCP window
  probes.
  
  Discussed with:   kib (long ago)

Modified:
  stable/9/sys/kern/uipc_socket.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/uipc_socket.c
==
--- stable/9/sys/kern/uipc_socket.c Mon Sep 17 13:36:47 2012
(r240605)
+++ stable/9/sys/kern/uipc_socket.c Mon Sep 17 14:53:33 2012
(r240606)
@@ -1496,17 +1496,11 @@ restart:
 * If we have less data than requested, block awaiting more (subject
 * to any timeout) if:
 *   1. the current count is less than the low water mark, or
-*   2. MSG_WAITALL is set, and it is possible to do the entire
-*  receive operation at once if we block (resid <= hiwat).
-*   3. MSG_DONTWAIT is not set
-* If MSG_WAITALL is set but resid is larger than the receive buffer,
-* we have to do the receive in sections, and thus risk returning a
-* short count if a timeout or signal occurs after we start.
+*   2. MSG_DONTWAIT is not set
 */
if (m == NULL || (((flags & MSG_DONTWAIT) == 0 &&
so->so_rcv.sb_cc < uio->uio_resid) &&
-   (so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
-   ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
+   so->so_rcv.sb_cc < so->so_rcv.sb_lowat &&
m->m_nextpkt == NULL && (pr->pr_flags & PR_ATOMIC) == 0)) {
KASSERT(m != NULL || !so->so_rcv.sb_cc,
("receive: m == %p so->so_rcv.sb_cc == %u",
@@ -1695,8 +1689,8 @@ dontblock:
 * examined ('type'), end the receive operation.
 */
SOCKBUF_LOCK_ASSERT(&so->so_rcv);
-   if (m->m_type == MT_OOBDATA) {
-   if (type != MT_OOBDATA)
+   if (m->m_type == MT_OOBDATA || m->m_type == MT_CONTROL) {
+   if (type != m->m_type)
break;
} else if (type == MT_OOBDATA)
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: r240607 - stable/8/sys/kern

2012-09-17 Thread Mikolaj Golub
Author: trociny
Date: Mon Sep 17 14:54:58 2012
New Revision: 240607
URL: http://svn.freebsd.org/changeset/base/240607

Log:
  MFC r240003, r240004:
  
  r240003:
  
  In soreceive_generic() when checking if the type of mbuf has changed
  check it for MT_CONTROL type too, otherwise the assertion
  "m->m_type == MT_DATA" below may be triggered by the following scenario:
  
  - the sender sends some data (MT_DATA) and then a file descriptor
(MT_CONTROL);
  - the receiver calls recv(2) with a MSG_WAITALL asking for data larger
than the receive buffer (uio_resid > hiwat).
  
  r240004:
  
  In soreceive_generic() remove the optimization for the case when
  MSG_WAITALL is set, and it is possible to do the entire receive
  operation at once if we block (resid <= hiwat). Actually it might make
  the recv(2) with MSG_WAITALL flag get stuck when there is enough space
  in the receiver buffer to satisfy the request but not enough to open
  the window closed previously due to the buffer being full.
  
  The issue can be reproduced using the following scenario:
  
  On the sender side do 2 send(2) requests:
  
  1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10);
  2) data of size equal to SOBUF_SIZE.
  
  On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set:
  
  1) recv() data of SOBUF_SIZE / 10 size;
  2) recv() data of SOBUF_SIZE size;
  
  We totally fill the receiver buffer with one SOBUF_SIZE/10 size request
  and partial SOBUF_SIZE request. When the first request is processed we
  get SOBUF_SIZE/10 free space. It is just enough to receive the rest of
  bytes for the second request, and soreceive_generic() blocks in the
  part that is a subject of this change waiting for the rest. But the
  window was closed when the buffer was filled and to avoid silly window
  syndrome it opens only when available space is larger than sb_hiwat/4
  or maxseg. So it is stuck and pending data is only sent via TCP window
  probes.
  
  Discussed with:   kib (long ago)

Modified:
  stable/8/sys/kern/uipc_socket.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/uipc_socket.c
==
--- stable/8/sys/kern/uipc_socket.c Mon Sep 17 14:53:33 2012
(r240606)
+++ stable/8/sys/kern/uipc_socket.c Mon Sep 17 14:54:58 2012
(r240607)
@@ -1483,17 +1483,11 @@ restart:
 * If we have less data than requested, block awaiting more (subject
 * to any timeout) if:
 *   1. the current count is less than the low water mark, or
-*   2. MSG_WAITALL is set, and it is possible to do the entire
-*  receive operation at once if we block (resid <= hiwat).
-*   3. MSG_DONTWAIT is not set
-* If MSG_WAITALL is set but resid is larger than the receive buffer,
-* we have to do the receive in sections, and thus risk returning a
-* short count if a timeout or signal occurs after we start.
+*   2. MSG_DONTWAIT is not set
 */
if (m == NULL || (((flags & MSG_DONTWAIT) == 0 &&
so->so_rcv.sb_cc < uio->uio_resid) &&
-   (so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
-   ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) &&
+   so->so_rcv.sb_cc < so->so_rcv.sb_lowat &&
m->m_nextpkt == NULL && (pr->pr_flags & PR_ATOMIC) == 0)) {
KASSERT(m != NULL || !so->so_rcv.sb_cc,
("receive: m == %p so->so_rcv.sb_cc == %u",
@@ -1682,8 +1676,8 @@ dontblock:
 * examined ('type'), end the receive operation.
 */
SOCKBUF_LOCK_ASSERT(&so->so_rcv);
-   if (m->m_type == MT_OOBDATA) {
-   if (type != MT_OOBDATA)
+   if (m->m_type == MT_OOBDATA || m->m_type == MT_CONTROL) {
+   if (type != m->m_type)
break;
} else if (type == MT_OOBDATA)
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: r240608 - head/sys/dev/mlx

2012-09-17 Thread John Baldwin
Author: jhb
Date: Mon Sep 17 15:27:30 2012
New Revision: 240608
URL: http://svn.freebsd.org/changeset/base/240608

Log:
  Add locking to mlx(4) to make it MPSAFE along with some other fixes:
  - Use callout(9) rather than timeout(9).
  - Add a mutex as an I/O lock that protects the adapter and is used
for the I/O path.
  - Add an sx lock as a configuration lock that protects the relationship
of configured volumes.
  - Freeze the request queue when a DMA load is deferred with EINPROGRESS
and unfreeze the queue when the DMA callback is invoked.
  - Explicitly poll the hardware while waiting to submit a command to
allow completed commands to free up slots in the command ring.
  - Remove driver-wide 'initted' variable from mlx_*_fw_handshake() routines.
That state should be per-controller instead.  Add it as an argument
since the first caller knows when it is the first caller.
  - Remove explicit bus_space tag/handle and use bus_*() rather than
bus_space_*().
  - Move duplicated PCI device ID probing into a  mlx_pci_match() routine.
  - Don't check for PCIM_CMD_MEMEN (the PCI bus will enable that when
allocating the resource) and use pci_enable_busmaster() rather than
manipulating the register directly.
  
  Tested by:no one despite multiple requests (hope it works)

Modified:
  head/sys/dev/mlx/mlx.c
  head/sys/dev/mlx/mlx_disk.c
  head/sys/dev/mlx/mlx_pci.c
  head/sys/dev/mlx/mlxreg.h
  head/sys/dev/mlx/mlxvar.h

Modified: head/sys/dev/mlx/mlx.c
==
--- head/sys/dev/mlx/mlx.c  Mon Sep 17 14:54:58 2012(r240607)
+++ head/sys/dev/mlx/mlx.c  Mon Sep 17 15:27:30 2012(r240608)
@@ -32,8 +32,11 @@
 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -53,7 +56,6 @@
 
 static struct cdevsw mlx_cdevsw = {
.d_version =D_VERSION,
-   .d_flags =  D_NEEDGIANT,
.d_open =   mlx_open,
.d_close =  mlx_close,
.d_ioctl =  mlx_ioctl,
@@ -68,17 +70,17 @@ devclass_t  mlx_devclass;
 static int mlx_v3_tryqueue(struct mlx_softc *sc, struct 
mlx_command *mc);
 static int mlx_v3_findcomplete(struct mlx_softc *sc, 
u_int8_t *slot, u_int16_t *status);
 static voidmlx_v3_intaction(struct mlx_softc *sc, int 
action);
-static int mlx_v3_fw_handshake(struct mlx_softc *sc, int 
*error, int *param1, int *param2);
+static int mlx_v3_fw_handshake(struct mlx_softc *sc, int 
*error, int *param1, int *param2, int first);
 
 static int mlx_v4_tryqueue(struct mlx_softc *sc, struct 
mlx_command *mc);
 static int mlx_v4_findcomplete(struct mlx_softc *sc, 
u_int8_t *slot, u_int16_t *status);
 static voidmlx_v4_intaction(struct mlx_softc *sc, int 
action);
-static int mlx_v4_fw_handshake(struct mlx_softc *sc, int 
*error, int *param1, int *param2);
+static int mlx_v4_fw_handshake(struct mlx_softc *sc, int 
*error, int *param1, int *param2, int first);
 
 static int mlx_v5_tryqueue(struct mlx_softc *sc, struct 
mlx_command *mc);
 static int mlx_v5_findcomplete(struct mlx_softc *sc, 
u_int8_t *slot, u_int16_t *status);
 static voidmlx_v5_intaction(struct mlx_softc *sc, int 
action);
-static int mlx_v5_fw_handshake(struct mlx_softc *sc, int 
*error, int *param1, int *param2);
+static int mlx_v5_fw_handshake(struct mlx_softc *sc, int 
*error, int *param1, int *param2, int first);
 
 /*
  * Status monitoring
@@ -130,8 +132,9 @@ static void mlx_setup_dmamap(struct ml
 bus_dma_segment_t *segs,
 int nsegments, int error);
 static voidmlx_unmapcmd(struct mlx_command *mc);
+static int mlx_shutdown_locked(struct mlx_softc *sc);
 static int mlx_start(struct mlx_command *mc);
-static int mlx_done(struct mlx_softc *sc);
+static int mlx_done(struct mlx_softc *sc, int startio);
 static voidmlx_complete(struct mlx_softc *sc);
 
 /*
@@ -164,14 +167,24 @@ mlx_free(struct mlx_softc *sc)
 
 debug_called(1);
 
+/* destroy control device */
+if (sc->mlx_dev_t != NULL)
+   destroy_dev(sc->mlx_dev_t);
+
+if (sc->mlx_intr)
+   bus_teardown_intr(sc->mlx_dev, sc->mlx_irq, sc->mlx_intr);
+
 /* cancel status timeout */
-untimeout(mlx_periodic, sc, sc->mlx_timeout);
+MLX_IO_LOCK(sc);
+callout_stop(&sc->mlx_timeout);
 
 /* throw away any command buffers */
 while ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) {
TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link);
m

svn commit: r240609 - head/sys/dev/sound/usb

2012-09-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 17 15:43:57 2012
New Revision: 240609
URL: http://svn.freebsd.org/changeset/base/240609

Log:
  Implement support for USB Audio v2.0. Remove some redundant
  USB audio v1.0 debug data, hence userspace tools like lsusb
  exist to show this information properly.

Modified:
  head/sys/dev/sound/usb/uaudio.c
  head/sys/dev/sound/usb/uaudioreg.h

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Mon Sep 17 15:27:30 2012
(r240608)
+++ head/sys/dev/sound/usb/uaudio.c Mon Sep 17 15:43:57 2012
(r240609)
@@ -115,13 +115,28 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def
 #endif
 
 #defineUAUDIO_NFRAMES  64  /* must be factor of 8 due 
HS-USB */
-#defineUAUDIO_NCHANBUFS2   /* number of outstanding 
request */
-#defineUAUDIO_RECURSE_LIMIT   24   /* rounds */
+#defineUAUDIO_NCHANBUFS2   /* number of outstanding 
request */
+#defineUAUDIO_RECURSE_LIMIT255 /* rounds */
 
 #defineMAKE_WORD(h,l) (((h) << 8) | (l))
 #defineBIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1)
 #defineUAUDIO_MAX_CHAN(x) (x)
 
+union uaudio_asid {
+   const struct usb_audio_streaming_interface_descriptor *v1;
+   const struct usb_audio20_streaming_interface_descriptor *v2;
+};
+
+union uaudio_asf1d {
+   const struct usb_audio_streaming_type1_descriptor *v1;
+   const struct usb_audio20_streaming_type1_descriptor *v2;
+};
+
+union uaudio_sed {
+   const struct usb_audio_streaming_endpoint_descriptor *v1;
+   const struct usb_audio20_streaming_endpoint_descriptor *v2;
+};
+
 struct uaudio_mixer_node {
int32_t minval;
int32_t maxval;
@@ -162,11 +177,9 @@ struct uaudio_chan {
struct uaudio_softc *priv_sc;
struct pcm_channel *pcm_ch;
struct usb_xfer *xfer[UAUDIO_NCHANBUFS];
-   const struct usb_audio_streaming_interface_descriptor *p_asid;
-   const struct usb_audio_streaming_type1_descriptor *p_asf1d;
-   const struct usb_audio_streaming_endpoint_descriptor *p_sed;
+   union uaudio_asf1d p_asf1d;
+   union uaudio_sed p_sed;
const usb_endpoint_descriptor_audio_t *p_ed1;
-   const usb_endpoint_descriptor_audio_t *p_ed2;
const struct uaudio_format *p_fmt;
 
uint8_t *buf;   /* pointer to buffer */
@@ -192,6 +205,7 @@ struct uaudio_chan {
uint8_t valid;
uint8_t iface_index;
uint8_t iface_alt_index;
+   uint8_t channels;
 };
 
 #defineUMIDI_CABLES_MAX   16   /* units */
@@ -242,12 +256,21 @@ struct umidi_chan {
uint8_t single_command;
 };
 
+struct uaudio_search_result {
+   uint8_t bit_input[(256 + 7) / 8];
+   uint8_t bit_output[(256 + 7) / 8];
+   uint8_t recurse_level;
+   uint8_t id_max;
+   uint8_t is_input;
+};
+
 struct uaudio_softc {
struct sbuf sc_sndstat;
struct sndcard_func sc_sndcard_func;
struct uaudio_chan sc_rec_chan;
struct uaudio_chan sc_play_chan;
struct umidi_chan sc_midi_chan;
+   struct uaudio_search_result sc_mixer_clocks;
 
struct usb_device *sc_udev;
struct usb_xfer *sc_mixer_xfer[1];
@@ -273,24 +296,28 @@ struct uaudio_softc {
uint8_t sc_uq_au_vendor_class:1;
 };
 
-struct uaudio_search_result {
-   uint8_t bit_input[(256 + 7) / 8];
-   uint8_t bit_output[(256 + 7) / 8];
-   uint8_t bit_visited[(256 + 7) / 8];
-   uint8_t recurse_level;
-   uint8_t id_max;
-};
-
 struct uaudio_terminal_node {
union {
const struct usb_descriptor *desc;
-   const struct usb_audio_input_terminal *it;
-   const struct usb_audio_output_terminal *ot;
-   const struct usb_audio_mixer_unit_0 *mu;
-   const struct usb_audio_selector_unit *su;
-   const struct usb_audio_feature_unit *fu;
-   const struct usb_audio_processing_unit_0 *pu;
-   const struct usb_audio_extension_unit_0 *eu;
+   const struct usb_audio_input_terminal *it_v1;
+   const struct usb_audio_output_terminal *ot_v1;
+   const struct usb_audio_mixer_unit_0 *mu_v1;
+   const struct usb_audio_selector_unit *su_v1;
+   const struct usb_audio_feature_unit *fu_v1;
+   const struct usb_audio_processing_unit_0 *pu_v1;
+   const struct usb_audio_extension_unit_0 *eu_v1;
+   const struct usb_audio20_clock_source_unit *csrc_v2;
+   const struct usb_audio20_clock_selector_unit_0 *csel_v2;
+   const struct usb_audio20_clock_multiplier_unit *cmul_v2;
+   const struct usb_audio20_input_terminal *it_v2;
+   const struct usb_audio20_output_terminal *ot_v2;
+   const struct usb_audio20_mi

svn commit: r240610 - stable/9/release

2012-09-17 Thread Glen Barber
Author: gjb (doc,ports committer)
Date: Mon Sep 17 15:45:27 2012
New Revision: 240610
URL: http://svn.freebsd.org/changeset/base/240610

Log:
  MFC r232714 (nwhitehorn):
  
  Make sure not to tar up CVS directories if this ports tree is a CVS
  checkout.
  
  PR:   bin/165868

Modified:
  stable/9/release/Makefile
Directory Properties:
  stable/9/release/   (props changed)

Modified: stable/9/release/Makefile
==
--- stable/9/release/Makefile   Mon Sep 17 15:43:57 2012(r240609)
+++ stable/9/release/Makefile   Mon Sep 17 15:45:27 2012(r240610)
@@ -87,6 +87,7 @@ ports.txz:
-mkdir -p ${DISTDIR}/usr
ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \
+   --exclude CVS --exclude .svn \
--exclude usr/ports/distfiles --exclude usr/ports/packages \
--exclude 'usr/ports/INDEX*' --exclude work usr/ports
 
___
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: r240610 - stable/9/release

2012-09-17 Thread Glen Barber
On Mon, Sep 17, 2012 at 03:45:28PM +, Glen Barber wrote:
> Author: gjb (doc,ports committer)
> Date: Mon Sep 17 15:45:27 2012
> New Revision: 240610
> URL: http://svn.freebsd.org/changeset/base/240610
> 
> Log:
>   MFC r232714 (nwhitehorn):
>   
>   Make sure not to tar up CVS directories if this ports tree is a CVS
>   checkout.
>   
>   PR: bin/165868
> 

Forgot to add:

Approved by:nwhitehorn

Glen



pgpQIX03Zvas6.pgp
Description: PGP signature


svn commit: r240611 - stable/9/sys/dev/isci/scil

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 16:05:03 2012
New Revision: 240611
URL: http://svn.freebsd.org/changeset/base/240611

Log:
  MFC r240514:
  
  isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7
  (download microcode with offsets, save, and activate).
  
  SATI translation layer was incorrectly using allocation length instead
  of blocks, and was constructing the ATA command incorrectly.
  
  Also change #define to specify that the 512 block size here is
  specific for DOWNLOAD_MICROCODE, and does not relate to the device's
  logical block size.

Modified:
  stable/9/sys/dev/isci/scil/sati_util.c
  stable/9/sys/dev/isci/scil/sati_write_buffer.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/isci/scil/sati_util.c
==
--- stable/9/sys/dev/isci/scil/sati_util.c  Mon Sep 17 15:45:27 2012
(r240610)
+++ stable/9/sys/dev/isci/scil/sati_util.c  Mon Sep 17 16:05:03 2012
(r240611)
@@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru
 )
 {
U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io);
+   U32 allocation_blocks = allocation_length >> 9;
+   U32 buffer_blkoffset = buffer_offset >> 9;
 
sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE);
sati_set_ata_features(register_fis, mode);
@@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru
}
else //mode == 0x03
{
-  sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9));
-  sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17));
-  sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9));
+  sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff));
+  sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 
0xff));
+  sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff));
+  sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 
0xff));
}
 
if((allocation_length == 0) && (buffer_offset == 0))

Modified: stable/9/sys/dev/isci/scil/sati_write_buffer.c
==
--- stable/9/sys/dev/isci/scil/sati_write_buffer.c  Mon Sep 17 15:45:27 
2012(r240610)
+++ stable/9/sys/dev/isci/scil/sati_write_buffer.c  Mon Sep 17 16:05:03 
2012(r240611)
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
 #define WRITE_BUFFER_WRITE_DATA  0x02
 #define WRITE_BUFFER_DOWNLOAD_SAVE   0x05
 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE0x07
-#define BLOCK_SIZE   512
+#define DOWNLOAD_MICROCODE_BLOCK_SIZE512
 
 /**
 * @brief This method will translate the SCSI Write Buffer command
@@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_
U8 * cdb = sati_cb_get_cdb_address(scsi_io);
SATI_STATUS status = SATI_FAILURE;
U32 allocation_length;
+   U32 allocation_blocks;
U32 buffer_offset;
 
allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) |
@@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_
 (sati_get_cdb_byte(cdb, 5)));
 
sequence->allocation_length = allocation_length;
+   allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE;
 
switch(sati_get_cdb_byte(cdb, 1))
{
   case WRITE_BUFFER_WRITE_DATA:
- if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) &&
+ if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && 
+(buffer_offset == 0) &&
 (sati_get_cdb_byte(cdb, 2) == 0))
  {
 sati_ata_write_buffer_construct(ata_io, sequence);
@@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_
   case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE:
  if(((allocation_length & 0x01FF) == 0) && //Bits 08:00 need to be 
zero per SAT2v7
 ((buffer_offset & 0x01FF) == 0) &&
-(allocation_length <= 
sequence->device->max_blocks_per_microcode_command) &&
-(allocation_length >= 
sequence->device->min_blocks_per_microcode_command))
+(allocation_blocks <= 
sequence->device->max_blocks_per_microcode_command) &&
+((allocation_blocks >= 
sequence->device->min_blocks_per_microcode_command) ||
+(allocation_length == 0)))
  {
 sati_ata_download_microcode_construct(
ata_io,
___
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: r240612 - stable/8/sys/dev/isci/scil

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 16:11:22 2012
New Revision: 240612
URL: http://svn.freebsd.org/changeset/base/240612

Log:
  MFC r240514:
  
  isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7
  (download microcode with offsets, save, and activate).
  
  SATI translation layer was incorrectly using allocation length instead
  of blocks, and was constructing the ATA command incorrectly.
  
  Also change #define to specify that the 512 block size here is
  specific for DOWNLOAD_MICROCODE, and does not relate to the device's
  logical block size.

Modified:
  stable/8/sys/dev/isci/scil/sati_util.c
  stable/8/sys/dev/isci/scil/sati_write_buffer.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/isci/   (props changed)

Modified: stable/8/sys/dev/isci/scil/sati_util.c
==
--- stable/8/sys/dev/isci/scil/sati_util.c  Mon Sep 17 16:05:03 2012
(r240611)
+++ stable/8/sys/dev/isci/scil/sati_util.c  Mon Sep 17 16:11:22 2012
(r240612)
@@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru
 )
 {
U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io);
+   U32 allocation_blocks = allocation_length >> 9;
+   U32 buffer_blkoffset = buffer_offset >> 9;
 
sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE);
sati_set_ata_features(register_fis, mode);
@@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru
}
else //mode == 0x03
{
-  sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9));
-  sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17));
-  sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9));
+  sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff));
+  sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 
0xff));
+  sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff));
+  sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 
0xff));
}
 
if((allocation_length == 0) && (buffer_offset == 0))

Modified: stable/8/sys/dev/isci/scil/sati_write_buffer.c
==
--- stable/8/sys/dev/isci/scil/sati_write_buffer.c  Mon Sep 17 16:05:03 
2012(r240611)
+++ stable/8/sys/dev/isci/scil/sati_write_buffer.c  Mon Sep 17 16:11:22 
2012(r240612)
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
 #define WRITE_BUFFER_WRITE_DATA  0x02
 #define WRITE_BUFFER_DOWNLOAD_SAVE   0x05
 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE0x07
-#define BLOCK_SIZE   512
+#define DOWNLOAD_MICROCODE_BLOCK_SIZE512
 
 /**
 * @brief This method will translate the SCSI Write Buffer command
@@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_
U8 * cdb = sati_cb_get_cdb_address(scsi_io);
SATI_STATUS status = SATI_FAILURE;
U32 allocation_length;
+   U32 allocation_blocks;
U32 buffer_offset;
 
allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) |
@@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_
 (sati_get_cdb_byte(cdb, 5)));
 
sequence->allocation_length = allocation_length;
+   allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE;
 
switch(sati_get_cdb_byte(cdb, 1))
{
   case WRITE_BUFFER_WRITE_DATA:
- if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) &&
+ if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && 
+(buffer_offset == 0) &&
 (sati_get_cdb_byte(cdb, 2) == 0))
  {
 sati_ata_write_buffer_construct(ata_io, sequence);
@@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_
   case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE:
  if(((allocation_length & 0x01FF) == 0) && //Bits 08:00 need to be 
zero per SAT2v7
 ((buffer_offset & 0x01FF) == 0) &&
-(allocation_length <= 
sequence->device->max_blocks_per_microcode_command) &&
-(allocation_length >= 
sequence->device->min_blocks_per_microcode_command))
+(allocation_blocks <= 
sequence->device->max_blocks_per_microcode_command) &&
+((allocation_blocks >= 
sequence->device->min_blocks_per_microcode_command) ||
+(allocation_length == 0)))
  {
 sati_ata_download_microcode_construct(
ata_io,
___
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: r240613 - stable/7/sys/dev/isci/scil

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 16:12:53 2012
New Revision: 240613
URL: http://svn.freebsd.org/changeset/base/240613

Log:
  MFC r240514:
  
  isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7
  (download microcode with offsets, save, and activate).
  
  SATI translation layer was incorrectly using allocation length instead
  of blocks, and was constructing the ATA command incorrectly.
  
  Also change #define to specify that the 512 block size here is
  specific for DOWNLOAD_MICROCODE, and does not relate to the device's
  logical block size.

Modified:
  stable/7/sys/dev/isci/scil/sati_util.c
  stable/7/sys/dev/isci/scil/sati_write_buffer.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/dev/isci/scil/sati_util.c
==
--- stable/7/sys/dev/isci/scil/sati_util.c  Mon Sep 17 16:11:22 2012
(r240612)
+++ stable/7/sys/dev/isci/scil/sati_util.c  Mon Sep 17 16:12:53 2012
(r240613)
@@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru
 )
 {
U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io);
+   U32 allocation_blocks = allocation_length >> 9;
+   U32 buffer_blkoffset = buffer_offset >> 9;
 
sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE);
sati_set_ata_features(register_fis, mode);
@@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru
}
else //mode == 0x03
{
-  sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9));
-  sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17));
-  sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9));
+  sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff));
+  sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 
0xff));
+  sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff));
+  sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 
0xff));
}
 
if((allocation_length == 0) && (buffer_offset == 0))

Modified: stable/7/sys/dev/isci/scil/sati_write_buffer.c
==
--- stable/7/sys/dev/isci/scil/sati_write_buffer.c  Mon Sep 17 16:11:22 
2012(r240612)
+++ stable/7/sys/dev/isci/scil/sati_write_buffer.c  Mon Sep 17 16:12:53 
2012(r240613)
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
 #define WRITE_BUFFER_WRITE_DATA  0x02
 #define WRITE_BUFFER_DOWNLOAD_SAVE   0x05
 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE0x07
-#define BLOCK_SIZE   512
+#define DOWNLOAD_MICROCODE_BLOCK_SIZE512
 
 /**
 * @brief This method will translate the SCSI Write Buffer command
@@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_
U8 * cdb = sati_cb_get_cdb_address(scsi_io);
SATI_STATUS status = SATI_FAILURE;
U32 allocation_length;
+   U32 allocation_blocks;
U32 buffer_offset;
 
allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) |
@@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_
 (sati_get_cdb_byte(cdb, 5)));
 
sequence->allocation_length = allocation_length;
+   allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE;
 
switch(sati_get_cdb_byte(cdb, 1))
{
   case WRITE_BUFFER_WRITE_DATA:
- if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) &&
+ if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && 
+(buffer_offset == 0) &&
 (sati_get_cdb_byte(cdb, 2) == 0))
  {
 sati_ata_write_buffer_construct(ata_io, sequence);
@@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_
   case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE:
  if(((allocation_length & 0x01FF) == 0) && //Bits 08:00 need to be 
zero per SAT2v7
 ((buffer_offset & 0x01FF) == 0) &&
-(allocation_length <= 
sequence->device->max_blocks_per_microcode_command) &&
-(allocation_length >= 
sequence->device->min_blocks_per_microcode_command))
+(allocation_blocks <= 
sequence->device->max_blocks_per_microcode_command) &&
+((allocation_blocks >= 
sequence->device->min_blocks_per_microcode_command) ||
+(allocation_length == 0)))
  {
 sati_ata_download_microcode_construct(
ata_io,
___
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: r240614 - releng/9.1/sys/dev/isci/scil

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 16:39:32 2012
New Revision: 240614
URL: http://svn.freebsd.org/changeset/base/240614

Log:
  MFC r240514:
  
  isci(4): Fix SCSI/ATA translation for SCSI_WRITE_BUFFER w/ mode==0x7
  (download microcode with offsets, save, and activate).
  
  SATI translation layer was incorrectly using allocation length instead
  of blocks, and was constructing the ATA command incorrectly.
  
  Also change #define to specify that the 512 block size here is
  specific for DOWNLOAD_MICROCODE, and does not relate to the device's
  logical block size.
  
  Approved by:   re (kib)

Modified:
  releng/9.1/sys/dev/isci/scil/sati_util.c
  releng/9.1/sys/dev/isci/scil/sati_write_buffer.c
Directory Properties:
  releng/9.1/sys/   (props changed)
  releng/9.1/sys/dev/   (props changed)

Modified: releng/9.1/sys/dev/isci/scil/sati_util.c
==
--- releng/9.1/sys/dev/isci/scil/sati_util.cMon Sep 17 16:12:53 2012
(r240613)
+++ releng/9.1/sys/dev/isci/scil/sati_util.cMon Sep 17 16:39:32 2012
(r240614)
@@ -1976,6 +1976,8 @@ void sati_ata_download_microcode_constru
 )
 {
U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io);
+   U32 allocation_blocks = allocation_length >> 9;
+   U32 buffer_blkoffset = buffer_offset >> 9;
 
sati_set_ata_command(register_fis, ATA_DOWNLOAD_MICROCODE);
sati_set_ata_features(register_fis, mode);
@@ -1987,9 +1989,10 @@ void sati_ata_download_microcode_constru
}
else //mode == 0x03
{
-  sati_set_ata_sector_count(register_fis, (U8) (allocation_length >> 9));
-  sati_set_ata_lba_low(register_fis, (U8) (allocation_length >> 17));
-  sati_set_ata_lba_high(register_fis, (U8) (buffer_offset >> 9));
+  sati_set_ata_sector_count(register_fis, (U8) (allocation_blocks & 0xff));
+  sati_set_ata_lba_low(register_fis, (U8) ((allocation_blocks >> 8) & 
0xff));
+  sati_set_ata_lba_mid(register_fis, (U8) (buffer_blkoffset & 0xff));
+  sati_set_ata_lba_high(register_fis, (U8) ((buffer_blkoffset >> 8) & 
0xff));
}
 
if((allocation_length == 0) && (buffer_offset == 0))

Modified: releng/9.1/sys/dev/isci/scil/sati_write_buffer.c
==
--- releng/9.1/sys/dev/isci/scil/sati_write_buffer.cMon Sep 17 16:12:53 
2012(r240613)
+++ releng/9.1/sys/dev/isci/scil/sati_write_buffer.cMon Sep 17 16:39:32 
2012(r240614)
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
 #define WRITE_BUFFER_WRITE_DATA  0x02
 #define WRITE_BUFFER_DOWNLOAD_SAVE   0x05
 #define WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE0x07
-#define BLOCK_SIZE   512
+#define DOWNLOAD_MICROCODE_BLOCK_SIZE512
 
 /**
 * @brief This method will translate the SCSI Write Buffer command
@@ -89,6 +89,7 @@ SATI_STATUS sati_write_buffer_translate_
U8 * cdb = sati_cb_get_cdb_address(scsi_io);
SATI_STATUS status = SATI_FAILURE;
U32 allocation_length;
+   U32 allocation_blocks;
U32 buffer_offset;
 
allocation_length = ((sati_get_cdb_byte(cdb, 6) << 16) |
@@ -100,11 +101,13 @@ SATI_STATUS sati_write_buffer_translate_
 (sati_get_cdb_byte(cdb, 5)));
 
sequence->allocation_length = allocation_length;
+   allocation_blocks = allocation_length / DOWNLOAD_MICROCODE_BLOCK_SIZE;
 
switch(sati_get_cdb_byte(cdb, 1))
{
   case WRITE_BUFFER_WRITE_DATA:
- if((allocation_length == BLOCK_SIZE) && (buffer_offset == 0) &&
+ if((allocation_length == DOWNLOAD_MICROCODE_BLOCK_SIZE) && 
+(buffer_offset == 0) &&
 (sati_get_cdb_byte(cdb, 2) == 0))
  {
 sati_ata_write_buffer_construct(ata_io, sequence);
@@ -146,8 +149,9 @@ SATI_STATUS sati_write_buffer_translate_
   case WRITE_BUFFER_OFFSET_DOWNLOAD_SAVE:
  if(((allocation_length & 0x01FF) == 0) && //Bits 08:00 need to be 
zero per SAT2v7
 ((buffer_offset & 0x01FF) == 0) &&
-(allocation_length <= 
sequence->device->max_blocks_per_microcode_command) &&
-(allocation_length >= 
sequence->device->min_blocks_per_microcode_command))
+(allocation_blocks <= 
sequence->device->max_blocks_per_microcode_command) &&
+((allocation_blocks >= 
sequence->device->min_blocks_per_microcode_command) ||
+(allocation_length == 0)))
  {
 sati_ata_download_microcode_construct(
ata_io,
___
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: r240615 - in head: share/man/man4 sys/dev/usb/input sys/dev/usb/quirk

2012-09-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Sep 17 19:06:35 2012
New Revision: 240615
URL: http://svn.freebsd.org/changeset/base/240615

Log:
  Add UQ_UMS_IGNORE quirk.
  Wrap two long lines.
  Some minor spelling correction.
  
  PR:   usb/171721

Modified:
  head/share/man/man4/usb_quirk.4
  head/sys/dev/usb/input/ums.c
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/quirk/usb_quirk.h

Modified: head/share/man/man4/usb_quirk.4
==
--- head/share/man/man4/usb_quirk.4 Mon Sep 17 16:39:32 2012
(r240614)
+++ head/share/man/man4/usb_quirk.4 Mon Sep 17 19:06:35 2012
(r240615)
@@ -66,6 +66,8 @@ device should be ignored by hid class
 device should be ignored by kbd class
 .It UQ_KBD_BOOTPROTO
 device should set the boot protocol
+.It UQ_UMS_IGNORE
+device should be ignored by ums class
 .It UQ_MS_BAD_CLASS
 doesn't identify properly
 .It UQ_MS_LEADING_BYTE

Modified: head/sys/dev/usb/input/ums.c
==
--- head/sys/dev/usb/input/ums.cMon Sep 17 16:39:32 2012
(r240614)
+++ head/sys/dev/usb/input/ums.cMon Sep 17 19:06:35 2012
(r240615)
@@ -381,6 +381,9 @@ ums_probe(device_t dev)
if (uaa->info.bInterfaceClass != UICLASS_HID)
return (ENXIO);
 
+   if (usb_test_quirk(uaa, UQ_UMS_IGNORE))
+   return (ENXIO);
+
if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
(uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))
return (BUS_PROBE_DEFAULT);

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Mon Sep 17 16:39:32 2012
(r240614)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Mon Sep 17 19:06:35 2012
(r240615)
@@ -494,6 +494,7 @@ static const char *usb_quirk_str[USB_QUI
[UQ_HID_IGNORE] = "UQ_HID_IGNORE",
[UQ_KBD_IGNORE] = "UQ_KBD_IGNORE",
[UQ_KBD_BOOTPROTO]  = "UQ_KBD_BOOTPROTO",
+   [UQ_UMS_IGNORE] = "UQ_UMS_IGNORE",
[UQ_MS_BAD_CLASS]   = "UQ_MS_BAD_CLASS",
[UQ_MS_LEADING_BYTE]= "UQ_MS_LEADING_BYTE",
[UQ_MS_REVZ]= "UQ_MS_REVZ",

Modified: head/sys/dev/usb/quirk/usb_quirk.h
==
--- head/sys/dev/usb/quirk/usb_quirk.h  Mon Sep 17 16:39:32 2012
(r240614)
+++ head/sys/dev/usb/quirk/usb_quirk.h  Mon Sep 17 19:06:35 2012
(r240615)
@@ -29,7 +29,7 @@
 
 enum {
/*
-* Keep in sync with theusb_quirk_str usb_quirk.c, and with the
+* Keep in sync with usb_quirk_str in usb_quirk.c, and with
 * share/man/man4/usb_quirk.4
 */
UQ_NONE,/* not a valid quirk */
@@ -49,6 +49,7 @@ enum {
UQ_HID_IGNORE,  /* device should be ignored by hid class */
UQ_KBD_IGNORE,  /* device should be ignored by kbd class */
UQ_KBD_BOOTPROTO,   /* device should set the boot protocol */
+   UQ_UMS_IGNORE,  /* device should be ignored by ums class */
UQ_MS_BAD_CLASS,/* doesn't identify properly */
UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */
UQ_MS_REVZ, /* mouse has Z-axis reversed */
@@ -64,7 +65,10 @@ enum {
UQ_CFG_INDEX_0, /* select configuration index 0 by default */
UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */
 
-   /* USB Mass Storage Quirks. See "storage/umass.c" for a detailed 
description. */
+   /*
+* USB Mass Storage Quirks. See "storage/umass.c" for a
+* detailed description.
+*/
UQ_MSC_NO_TEST_UNIT_READY,  /* send start/stop instead of TUR */
UQ_MSC_NO_RS_CLEAR_UA,  /* does not reset Unit Att. */
UQ_MSC_NO_START_STOP,   /* does not support start/stop */
___
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: r240616 - in head/sys/dev: nvd nvme

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 19:23:01 2012
New Revision: 240616
URL: http://svn.freebsd.org/changeset/base/240616

Log:
  This is the first of several commits which will add NVM Express (NVMe)
  support to FreeBSD.  A full description of the overall functionality
  being added is below.  nvmexpress.org defines NVM Express as "an optimized
  register interface, command set and feature set fo PCI Express (PCIe)-based
  Solid-State Drives (SSDs)."
  
  This commit adds nvme(4) and nvd(4) driver source code and Makefiles
  to the tree.
  
  Full NVMe functionality description:
  Add nvme(4) and nvd(4) drivers and nvmecontrol(8) for NVM Express (NVMe)
  device support.
  
  There will continue to be ongoing work on NVM Express support, but there
  is more than enough to allow for evaluation of pre-production NVM Express
  devices as well as soliciting feedback.  Questions and feedback are welcome.
  
  nvme(4) implements NVMe hardware abstraction and is a provider of NVMe
  namespaces.  The closest equivalent of an NVMe namespace is a SCSI LUN.
  nvd(4) is an NVMe consumer, surfacing NVMe namespaces as GEOM disks.
  nvmecontrol(8) is used for NVMe configuration and management.
  
  The following are currently supported:
  nvme(4)
  - full mandatory NVM command set support
  - per-CPU IO queues (enabled by default but configurable)
  - per-queue sysctls for statistics and full command/completion queue
   dumps for debugging
  - registration API for NVMe namespace consumers
  - I/O error handling (except for timeoutsee below)
  - compilation switches for support back to stable-7
  
  nvd(4)
  - BIO_DELETE and BIO_FLUSH (if supported by controller)
  - proper BIO_ORDERED handling
  
  nvmecontrol(8)
  - devlist: list NVMe controllers and their namespaces
  - identify: display controller or namespace identify data in
human-readable or hex format
  - perftest: quick and dirty performance test to measure raw
performance of NVMe device without userspace/physio/GEOM
overhead
  
  The following are still work in progress and will be completed over the
  next 3-6 months in rough priority order:
  - complete man pages
  - firmware download and activation
  - asynchronous error requests
  - command timeout error handling
  - controller resets
  - nvmecontrol(8) log page retrieval
  
  This has been primarily tested on amd64, with light testing on i386.  I
  would be happy to provide assistance to anyone interested in porting
  this to other architectures, but am not currently planning to do this
  work myself.  Big-endian and dmamap sync for command/completion queues
  are the main areas that would need to be addressed.
  
  The nvme(4) driver currently has references to Chatham, which is an
  Intel-developed prototype board which is not fully spec compliant.
  These references will all be removed over time.
  
  Sponsored by:Intel
  Contributions from:  Joe Golio/EMC 

Added:
  head/sys/dev/nvd/
  head/sys/dev/nvd/nvd.c   (contents, props changed)
  head/sys/dev/nvme/
  head/sys/dev/nvme/nvme.c   (contents, props changed)
  head/sys/dev/nvme/nvme.h   (contents, props changed)
  head/sys/dev/nvme/nvme_ctrlr.c   (contents, props changed)
  head/sys/dev/nvme/nvme_ctrlr_cmd.c   (contents, props changed)
  head/sys/dev/nvme/nvme_ns.c   (contents, props changed)
  head/sys/dev/nvme/nvme_ns_cmd.c   (contents, props changed)
  head/sys/dev/nvme/nvme_private.h   (contents, props changed)
  head/sys/dev/nvme/nvme_qpair.c   (contents, props changed)
  head/sys/dev/nvme/nvme_sysctl.c   (contents, props changed)
  head/sys/dev/nvme/nvme_test.c   (contents, props changed)
  head/sys/dev/nvme/nvme_uio.c   (contents, props changed)

Added: head/sys/dev/nvd/nvd.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/nvd/nvd.c  Mon Sep 17 19:23:01 2012(r240616)
@@ -0,0 +1,318 @@
+/*-
+ * Copyright (C) 2012 Intel Corporation
+ * 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 LIMITE

svn commit: r240617 - releng/9.1/lib/libc/locale

2012-09-17 Thread Gleb Smirnoff
Author: glebius
Date: Mon Sep 17 19:25:24 2012
New Revision: 240617
URL: http://svn.freebsd.org/changeset/base/240617

Log:
  Merge r238182 by theraven@:
Restore the __collate_load_error global that was accidentally removed in the
xlocale refactoring.
  
  Approved by:  re (kib)

Modified:
  releng/9.1/lib/libc/locale/collate.c
  releng/9.1/lib/libc/locale/setrunelocale.c
Directory Properties:
  releng/9.1/lib/libc/   (props changed)

Modified: releng/9.1/lib/libc/locale/collate.c
==
--- releng/9.1/lib/libc/locale/collate.cMon Sep 17 19:23:01 2012
(r240616)
+++ releng/9.1/lib/libc/locale/collate.cMon Sep 17 19:25:24 2012
(r240617)
@@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$");
  * We also modify the collation table test functions to search the thread-local
  * table first and the global table second.  
  */
-#define __collate_load_error (table->__collate_load_error)
 #define __collate_substitute_nontrivial 
(table->__collate_substitute_nontrivial)
 #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr)
 #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr)
 #define __collate_chain_pri_table (table->__collate_chain_pri_table)
+int __collate_load_error;
 
 
 struct xlocale_collate __xlocale_global_collate = {
@@ -109,7 +109,9 @@ __collate_load(const char *encoding, loc
 int
 __collate_load_tables(const char *encoding)
 {
-   return __collate_load_tables_l(encoding, &__xlocale_global_collate);
+   int ret = __collate_load_tables_l(encoding, &__xlocale_global_collate);
+   __collate_load_error = __xlocale_global_collate.__collate_load_error;
+   return ret;
 }
 
 int
@@ -123,7 +125,7 @@ __collate_load_tables_l(const char *enco
 
/* 'encoding' must be already checked. */
if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) {
-   __collate_load_error = 1;
+   table->__collate_load_error = 1;
return (_LDP_CACHE);
}
 
@@ -240,7 +242,7 @@ __collate_load_tables_l(const char *enco
break;
}
}
-   __collate_load_error = 0;
+   table->__collate_load_error = 0;
 
return (_LDP_LOADED);
 }

Modified: releng/9.1/lib/libc/locale/setrunelocale.c
==
--- releng/9.1/lib/libc/locale/setrunelocale.c  Mon Sep 17 19:23:01 2012
(r240616)
+++ releng/9.1/lib/libc/locale/setrunelocale.c  Mon Sep 17 19:25:24 2012
(r240617)
@@ -67,7 +67,6 @@ extern _RuneLocale*_Read_RuneMagi(FILE 
 
 static int __setrunelocale(struct xlocale_ctype *l, const char *);
 
-#define __collate_load_error (table->__collate_load_error)
 #define __collate_substitute_nontrivial 
(table->__collate_substitute_nontrivial)
 #define __collate_substitute_table_ptr (table->__collate_substitute_table_ptr)
 #define __collate_char_pri_table_ptr (table->__collate_char_pri_table_ptr)
___
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: r240618 - in head/sys: amd64/conf conf i386/conf modules

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 19:26:33 2012
New Revision: 240618
URL: http://svn.freebsd.org/changeset/base/240618

Log:
  Integrate nvme(4) and nvd(4) into the amd64 and i386 builds.
  
  Sponsored by: Intel

Modified:
  head/sys/amd64/conf/NOTES
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/i386/conf/NOTES
  head/sys/modules/Makefile

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Mon Sep 17 19:25:24 2012(r240617)
+++ head/sys/amd64/conf/NOTES   Mon Sep 17 19:26:33 2012(r240618)
@@ -428,6 +428,11 @@ device isci
 optionsISCI_LOGGING# enable debugging in isci HAL
 
 #
+# NVM Express (NVMe) support
+device nvme# base NVMe driver
+device nvd # expose NVMe namespaces as disks, depends on nvme
+
+#
 # SafeNet crypto driver: can be moved to the MI NOTES as soon as
 # it's tested on a big-endian machine
 #

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Mon Sep 17 19:25:24 2012(r240617)
+++ head/sys/conf/files.amd64   Mon Sep 17 19:26:33 2012(r240618)
@@ -212,7 +212,17 @@ dev/kbd/kbd.c  optionalatkbd | 
sc | uk
 dev/lindev/full.c  optionallindev
 dev/lindev/lindev.coptionallindev
 dev/nfe/if_nfe.c   optionalnfe pci
+dev/nvd/nvd.c  optionalnvd nvme
 dev/nve/if_nve.c   optionalnve pci
+dev/nvme/nvme.coptionalnvme
+dev/nvme/nvme_ctrlr.c  optionalnvme
+dev/nvme/nvme_ctrlr_cmd.c  optionalnvme
+dev/nvme/nvme_ns.c optionalnvme
+dev/nvme/nvme_ns_cmd.c optionalnvme
+dev/nvme/nvme_qpair.c  optionalnvme
+dev/nvme/nvme_sysctl.c optionalnvme
+dev/nvme/nvme_test.c   optionalnvme
+dev/nvme/nvme_uio.coptionalnvme
 dev/nvram/nvram.c  optionalnvram isa
 dev/random/ivy.c   optionalrandom rdrand_rng
 dev/random/nehemiah.c  optionalrandom padlock_rng

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Mon Sep 17 19:25:24 2012(r240617)
+++ head/sys/conf/files.i386Mon Sep 17 19:26:33 2012(r240618)
@@ -224,7 +224,17 @@ dev/lindev/lindev.coptional lindev
 dev/mse/mse.c  optional mse
 dev/mse/mse_isa.c  optional mse isa
 dev/nfe/if_nfe.c   optional nfe pci
+dev/nvd/nvd.c  optional nvd nvme
 dev/nve/if_nve.c   optional nve pci
+dev/nvme/nvme.coptional nvme
+dev/nvme/nvme_ctrlr.c  optional nvme
+dev/nvme/nvme_ctrlr_cmd.c  optional nvme
+dev/nvme/nvme_ns.c optional nvme
+dev/nvme/nvme_ns_cmd.c optional nvme
+dev/nvme/nvme_qpair.c  optional nvme
+dev/nvme/nvme_sysctl.c optional nvme
+dev/nvme/nvme_test.c   optional nvme
+dev/nvme/nvme_uio.coptional nvme
 dev/nvram/nvram.c  optional nvram isa
 dev/pcf/pcf_isa.c  optional pcf
 dev/random/ivy.c   optional random rdrand_rng

Modified: head/sys/i386/conf/NOTES
==
--- head/sys/i386/conf/NOTESMon Sep 17 19:25:24 2012(r240617)
+++ head/sys/i386/conf/NOTESMon Sep 17 19:26:33 2012(r240618)
@@ -747,6 +747,11 @@ device isci
 optionsISCI_LOGGING# enable debugging in isci HAL
 
 #
+# NVM Express (NVMe) support
+device nvme# base NVMe driver
+device nvd # expose NVMe namespaces as disks, depends on nvme
+
+#
 # SafeNet crypto driver: can be moved to the MI NOTES as soon as
 # it's tested on a big-endian machine
 #

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Mon Sep 17 19:25:24 2012(r240617)
+++ head/sys/modules/Makefile   Mon Sep 17 19:26:33 2012(r240618)
@@ -244,7 +244,9 @@ SUBDIR= \
ntfs \
ntfs_iconv \
nullfs \
+   ${_nvd} \
${_nve} \
+   ${_nvme} \
${_nvram} \
${_nwfs} \
${_nxge} \
@@ -586,9 +588,11 @@ _ixgb= ixgb
 _ixgbe=ixgbe
 _mly=  mly
 _nfe=  nfe
+_nvd=  nvd
 .if ${MK_SOURCELESS_HOST} != "no"
 _nve=  nve
 .endif
+_nvme= nvme
 _nvram=nvram
 _nxge= nxge
 _tpm=  tpm
@@ -695,9 +699,11 @@ _mthca=mthca
 .endif
 _ndis= ndis
 _nfe=  nfe
+_nvd=  nvd
 .if ${MK_SOUR

svn commit: r240619 - in head/sys/modules: nvd nvme

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 19:58:02 2012
New Revision: 240619
URL: http://svn.freebsd.org/changeset/base/240619

Log:
  Add nvme(4) and nvd(4) Makefiles to the tree.
  
  Noticed by:   pluknet
  Pointy-hat to:  jimharris

Added:
  head/sys/modules/nvd/
  head/sys/modules/nvd/Makefile   (contents, props changed)
  head/sys/modules/nvme/
  head/sys/modules/nvme/Makefile   (contents, props changed)

Added: head/sys/modules/nvd/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/nvd/Makefile   Mon Sep 17 19:58:02 2012
(r240619)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../dev/nvd
+
+KMOD=  nvd
+SRCS=  nvd.c opt_geom.h device_if.h bus_if.h
+
+.include 

Added: head/sys/modules/nvme/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/nvme/Makefile  Mon Sep 17 19:58:02 2012
(r240619)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../dev/nvme
+
+KMOD = nvme
+
+SRCS = nvme.c  \
+   nvme_ctrlr.c\
+   nvme_ctrlr_cmd.c\
+   nvme_ns.c   \
+   nvme_ns_cmd.c   \
+   nvme_qpair.c\
+   nvme_sysctl.c   \
+   nvme_test.c \
+   nvme_uio.c  \
+   \
+   bus_if.h\
+   device_if.h \
+   pci_if.h
+
+.include 
___
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: r240620 - head/sbin/nvmecontrol

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 21:26:55 2012
New Revision: 240620
URL: http://svn.freebsd.org/changeset/base/240620

Log:
  Add nvmecontrol(8) source code and beginnings of a man page to the tree.
  
  Sponsored by: Intel
  Contributions from:   Joe Golio/EMC 

Added:
  head/sbin/nvmecontrol/
  head/sbin/nvmecontrol/Makefile   (contents, props changed)
  head/sbin/nvmecontrol/nvmecontrol.8   (contents, props changed)
  head/sbin/nvmecontrol/nvmecontrol.c   (contents, props changed)

Added: head/sbin/nvmecontrol/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/nvmecontrol/Makefile  Mon Sep 17 21:26:55 2012
(r240620)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+PROG=  nvmecontrol
+MAN=   nvmecontrol.8
+
+.include 

Added: head/sbin/nvmecontrol/nvmecontrol.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/nvmecontrol/nvmecontrol.8 Mon Sep 17 21:26:55 2012
(r240620)
@@ -0,0 +1,87 @@
+.\"
+.\" Copyright (c) 2012 Intel Corporation
+.\" 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,
+.\"without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\"substantially similar to the "NO WARRANTY" disclaimer below
+.\"("Disclaimer") and any redistribution must be conditioned upon
+.\"including a substantially similar Disclaimer requirement for further
+.\"binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+.\"
+.\" nvmecontrol man page.
+.\"
+.\" Author: Jim Harris 
+.\"
+.\" $FreeBSD$
+.\"
+.Dd September 17, 2012
+.Dt NVMECONTROL 8
+.Os
+.Sh NAME
+.Nm nvmecontrol
+.Nd NVM Express control utility
+.Sh SYNOPSIS
+.Nm
+.Ic devlist
+.Nm
+.Ic identify
+.Op Fl v
+.Op Fl x
+.Aq device id
+.Nm
+.Ic perftest
+.Aq Fl n Ar num_threads
+.Aq Fl o Ar read|write
+.Op Fl p
+.Aq Fl s Ar size_in_bytes
+.Aq Fl t Ar time_in_sec
+.Aq device id
+.Sh DESCRIPTION
+NVM Express (NVMe) is a storage protocol standard, for SSDs and other
+high-speed storage devices over PCI Express.
+.Sh EXAMPLES
+.Dl nvmecontrol devlist
+.Pp
+Display a list of NVMe controllers and namespaces along with their device 
nodes.
+.Dl nvmecontrol identify nvme0
+.Pp
+Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data.
+.Pp
+.Dl nvmecontrol identify -x -v nvme0ns1
+.Pp
+Display a hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace
+1.
+.Pp
+.Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1
+.Pp
+Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds.  
Each
+thread will issue a single 512 byte read command.  Results are printed to
+stdout when 30 seconds expires.
+.Pp
+.Sh AUTHORS
+.An -nosplit
+.Nm
+was developed by Intel and originally written by
+.An Jim Harris Aq jimhar...@freebsd.org .
+.Pp
+This man page was written by
+.An Jim Harris Aq jimhar...@freebsd.org .

Added: head/sbin/nvmecontrol/nvmecontrol.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/nvmecontrol/nvmecontrol.c Mon Sep 17 21:26:55 2012
(r240620)
@@ -0,0 +1,600 @@
+/*-
+ * Copyright (C) 2012 Intel Corporation
+ * 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 PROVI

svn commit: r240621 - in head: etc/mtree include sbin

2012-09-17 Thread Jim Harris
Author: jimharris
Date: Mon Sep 17 21:41:38 2012
New Revision: 240621
URL: http://svn.freebsd.org/changeset/base/240621

Log:
  Integrate nvmecontrol(8) into the amd64 and i386 builds.
  
  This includes adding NVMe header files to /usr/include/dev/nvme.
  
  Sponsored by:  Intel

Modified:
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/sbin/Makefile.amd64
  head/sbin/Makefile.i386

Modified: head/etc/mtree/BSD.include.dist
==
--- head/etc/mtree/BSD.include.dist Mon Sep 17 21:26:55 2012
(r240620)
+++ head/etc/mtree/BSD.include.dist Mon Sep 17 21:41:38 2012
(r240621)
@@ -126,6 +126,8 @@
 ..
 nand
 ..
+nvme
+..
 ofw
 ..
 pbio

Modified: head/include/Makefile
==
--- head/include/Makefile   Mon Sep 17 21:26:55 2012(r240620)
+++ head/include/Makefile   Mon Sep 17 21:41:38 2012(r240621)
@@ -40,8 +40,8 @@ LDIRS=bsm cam geom net net80211 netatal
 
 LSUBDIRS=  cam/ata cam/scsi \
dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \
-   dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \
-   dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \
+   dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \
+   dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \
dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \
${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \

Modified: head/sbin/Makefile.amd64
==
--- head/sbin/Makefile.amd64Mon Sep 17 21:26:55 2012(r240620)
+++ head/sbin/Makefile.amd64Mon Sep 17 21:41:38 2012(r240621)
@@ -2,3 +2,4 @@
 
 SUBDIR += bsdlabel
 SUBDIR += fdisk
+SUBDIR += nvmecontrol

Modified: head/sbin/Makefile.i386
==
--- head/sbin/Makefile.i386 Mon Sep 17 21:26:55 2012(r240620)
+++ head/sbin/Makefile.i386 Mon Sep 17 21:41:38 2012(r240621)
@@ -2,4 +2,5 @@
 
 SUBDIR += bsdlabel
 SUBDIR += fdisk
+SUBDIR += nvmecontrol
 SUBDIR += sconfig
___
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: r240622 - head/usr.bin/yes

2012-09-17 Thread David E. O'Brien
Author: obrien
Date: Mon Sep 17 23:04:15 2012
New Revision: 240622
URL: http://svn.freebsd.org/changeset/base/240622

Log:
  yes(1) actually comes from V7.
  
  Submitted by: Simon Gerraty 

Modified:
  head/usr.bin/yes/yes.1

Modified: head/usr.bin/yes/yes.1
==
--- head/usr.bin/yes/yes.1  Mon Sep 17 21:41:38 2012(r240621)
+++ head/usr.bin/yes/yes.1  Mon Sep 17 23:04:15 2012(r240622)
@@ -49,4 +49,4 @@ forever.
 The
 .Nm
 command appeared in
-.At 32v .
+.At v7 .
___
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: r240623 - head/sys/dev/ath/ath_hal

2012-09-17 Thread Adrian Chadd
Author: adrian
Date: Mon Sep 17 23:24:45 2012
New Revision: 240623
URL: http://svn.freebsd.org/changeset/base/240623

Log:
  Rename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with
  internal atheros HAL code.

Modified:
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ah_internal.h

Modified: head/sys/dev/ath/ath_hal/ah.c
==
--- head/sys/dev/ath/ath_hal/ah.c   Mon Sep 17 23:04:15 2012
(r240622)
+++ head/sys/dev/ath/ath_hal/ah.c   Mon Sep 17 23:24:45 2012
(r240623)
@@ -1053,7 +1053,7 @@ ath_hal_getChanNoise(struct ath_hal *ah,
  * populated with values from NOISE_FLOOR[] + ath_hal_getNfAdjust().
  *
  * The caller must supply ctl/ext NF arrays which are at least
- * AH_MIMO_MAX_CHAINS entries long.
+ * AH_MAX_CHAINS entries long.
  */
 int
 ath_hal_get_mimo_chan_noise(struct ath_hal *ah,
@@ -1069,7 +1069,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h
HALDEBUG(ah, HAL_DEBUG_NFCAL,
"%s: invalid channel %u/0x%x; no mapping\n",
__func__, chan->ic_freq, chan->ic_flags);
-   for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) {
+   for (i = 0; i < AH_MAX_CHAINS; i++) {
nf_ctl[i] = nf_ext[i] = 0;
}
return 0;
@@ -1077,7 +1077,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h
 
/* Return 0 if there's no valid MIMO values (yet) */
if (! (ichan->privFlags & CHANNEL_MIMO_NF_VALID)) {
-   for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) {
+   for (i = 0; i < AH_MAX_CHAINS; i++) {
nf_ctl[i] = nf_ext[i] = 0;
}
return 0;
@@ -1090,7 +1090,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h
 * stations which have a very low RSSI, below the
 * 'normalised' NF values in NOISE_FLOOR[].
 */
-   for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) {
+   for (i = 0; i < AH_MAX_CHAINS; i++) {
nf_ctl[i] = nf_ext[i] = NOISE_FLOOR[mode] +
ath_hal_getNfAdjust(ah, ichan);
}
@@ -1109,7 +1109,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h
 * don't "wrap" when RSSI is less than the "adjusted" NF value.
 * ("Adjust" here is via ichan->noiseFloorAdjust.)
 */
-   for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) {
+   for (i = 0; i < AH_MAX_CHAINS; i++) {
nf_ctl[i] = ichan->noiseFloorCtl[i] + 
ath_hal_getNfAdjust(ah, ichan);
nf_ext[i] = ichan->noiseFloorExt[i] + 
ath_hal_getNfAdjust(ah, ichan);
}

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Mon Sep 17 23:04:15 2012
(r240622)
+++ head/sys/dev/ath/ath_hal/ah.h   Mon Sep 17 23:24:45 2012
(r240623)
@@ -35,7 +35,7 @@
  * This is intended to be used by various statistics gathering operations
  * (NF, RSSI, EVM).
  */
-#defineAH_MIMO_MAX_CHAINS  3
+#defineAH_MAX_CHAINS   3
 #defineAH_MIMO_MAX_EVM_PILOTS  6
 
 /*

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==
--- head/sys/dev/ath/ath_hal/ah_internal.h  Mon Sep 17 23:04:15 2012
(r240622)
+++ head/sys/dev/ath/ath_hal/ah_internal.h  Mon Sep 17 23:24:45 2012
(r240623)
@@ -153,8 +153,8 @@ typedef struct {
int16_t rawNoiseFloor;
int16_t noiseFloorAdjust;
 #ifdef AH_SUPPORT_AR5416
-   int16_t noiseFloorCtl[AH_MIMO_MAX_CHAINS];
-   int16_t noiseFloorExt[AH_MIMO_MAX_CHAINS];
+   int16_t noiseFloorCtl[AH_MAX_CHAINS];
+   int16_t noiseFloorExt[AH_MAX_CHAINS];
 #endif /* AH_SUPPORT_AR5416 */
uint16_tmainSpur;   /* cached spur value for this channel */
 } HAL_CHANNEL_INTERNAL;
___
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: r240624 - head/sys/sys

2012-09-17 Thread Attilio Rao
Author: attilio
Date: Tue Sep 18 00:43:15 2012
New Revision: 240624
URL: http://svn.freebsd.org/changeset/base/240624

Log:
  Remove namespace pollution in _rmlock.h by defining rm_queue structure
  directly in _rmlock.h and then including it (and its dependencies)
  in pcpu.h. This leads to few _*.h headers to be included in pcpu.h
  but this is not considered a big deal.
  
  Really pc_rm_queue should be implemented as a dynamic member with
  DPCPU interface, but we really want to keep the read acquisition as
  fast as possible, so even the further pc_dynamic indirection should be
  avoided, and the pollution is dealt like this.
  
  Discussed with:   jhb
  MFC after:1 week

Modified:
  head/sys/sys/_rmlock.h
  head/sys/sys/pcpu.h

Modified: head/sys/sys/_rmlock.h
==
--- head/sys/sys/_rmlock.h  Mon Sep 17 23:24:45 2012(r240623)
+++ head/sys/sys/_rmlock.h  Tue Sep 18 00:43:15 2012(r240624)
@@ -32,17 +32,17 @@
 #ifndef _SYS__RMLOCK_H_
 #define_SYS__RMLOCK_H_
 
-/* 
- * XXXUPS remove as soon as we have per cpu variable
- * linker sets and  can define rm_queue in _rm_lock.h
-*/
-#include 
 /*
  * Mostly reader/occasional writer lock.
  */
 
 LIST_HEAD(rmpriolist,rm_priotracker);
 
+struct rm_queue {
+   struct rm_queue *volatile rmq_next;
+   struct rm_queue *volatile rmq_prev;
+};
+
 struct rmlock {
struct lock_object lock_object; 
volatile cpuset_t rm_writecpus;

Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Mon Sep 17 23:24:45 2012(r240623)
+++ head/sys/sys/pcpu.h Tue Sep 18 00:43:15 2012(r240624)
@@ -38,7 +38,11 @@
 #endif
 
 #include 
+#include 
+#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -137,15 +141,6 @@ extern uintptr_t dpcpu_off[];
 
 #endif /* _KERNEL */
 
-/* 
- * XXXUPS remove as soon as we have per cpu variable
- * linker sets and can define rm_queue in _rm_lock.h
- */
-struct rm_queue {
-   struct rm_queue* volatile rmq_next;
-   struct rm_queue* volatile rmq_prev;
-};
-
 /*
  * This structure maps out the global data that needs to be kept on a
  * per-cpu basis.  The members are accessed via the PCPU_GET/SET/PTR
@@ -169,15 +164,7 @@ struct pcpu {
void*pc_netisr; /* netisr SWI cookie */
int pc_dnweight;/* vm_page_dontneed() */
int pc_domain;  /* Memory domain. */
-
-   /*
-* Stuff for read mostly lock
-*
-* XXXUPS remove as soon as we have per cpu variable
-* linker sets.
-*/
-   struct rm_queue pc_rm_queue;
-
+   struct rm_queue pc_rm_queue;/* rmlock list of trackers */
uintptr_t   pc_dynamic; /* Dynamic per-cpu data area */
 
/*
___
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: r240625 - head/sys/dev/ath/ath_hal

2012-09-17 Thread Adrian Chadd
Author: adrian
Date: Tue Sep 18 01:27:24 2012
New Revision: 240625
URL: http://svn.freebsd.org/changeset/base/240625

Log:
  Add a couple of accessor inline functions for state that exists in net80211.
  
  Obtained from:Qualcomm Atheros

Modified:
  head/sys/dev/ath/ath_hal/ah_internal.h

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==
--- head/sys/dev/ath/ath_hal/ah_internal.h  Tue Sep 18 00:43:15 2012
(r240624)
+++ head/sys/dev/ath/ath_hal/ah_internal.h  Tue Sep 18 01:27:24 2012
(r240625)
@@ -913,5 +913,36 @@ extern int16_t ath_ee_interpolate(uint16
 AH_PRIVATE((_ah))->ah_caps.halSupportsFastClock5GHz && \
ath_hal_eepromGetFlag((_ah), AR_EEP_FSTCLK_5G))
 
+/*
+ * Fetch the maximum regulatory domain power for the given channel
+ * in 1/2dBm steps.
+ */
+static inline int
+ath_hal_get_twice_max_regpower(struct ath_hal_private *ahp,
+const HAL_CHANNEL_INTERNAL *ichan, const struct ieee80211_channel *chan)
+{
+   struct ath_hal *ah = &ahp->h;
+
+   if (! chan) {
+   ath_hal_printf(ah, "%s: called with chan=NULL!\n", __func__);
+   return (0);
+   }
+   return (chan->ic_maxpower);
+}
+
+/*
+ * Get the maximum antenna gain allowed, in 1/2dBm steps.
+ */
+static inline int
+ath_hal_getantennaallowed(struct ath_hal *ah,
+const struct ieee80211_channel *chan)
+{
+
+   if (! chan)
+   return (0);
+
+   return (chan->ic_maxantgain);
+}
+
 
 #endif /* _ATH_AH_INTERAL_H_ */
___
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: r240626 - stable/9/usr.sbin/timed/timed

2012-09-17 Thread Kevin Lo
Author: kevlo
Date: Tue Sep 18 02:14:47 2012
New Revision: 240626
URL: http://svn.freebsd.org/changeset/base/240626

Log:
  MFC r240388:
  Add missing braces
  
  Obtained from:DragonFly

Modified:
  stable/9/usr.sbin/timed/timed/timed.c
Directory Properties:
  stable/9/usr.sbin/timed/timed/   (props changed)

Modified: stable/9/usr.sbin/timed/timed/timed.c
==
--- stable/9/usr.sbin/timed/timed/timed.c   Tue Sep 18 01:27:24 2012
(r240625)
+++ stable/9/usr.sbin/timed/timed/timed.c   Tue Sep 18 02:14:47 2012
(r240626)
@@ -419,9 +419,10 @@ main(argc, argv)
justquit = 1;
}
for (ntp = nettab; ntp != NULL; ntp = ntp->next) {
-   if (ntp->status == MASTER)
+   if (ntp->status == MASTER) {
rmnetmachs(ntp);
ntp->status = NOMASTER;
+   }
}
checkignorednets();
pickslavenet(0);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r240627 - in head/sys/dev: ata mly

2012-09-17 Thread Kevin Lo
Author: kevlo
Date: Tue Sep 18 02:19:43 2012
New Revision: 240627
URL: http://svn.freebsd.org/changeset/base/240627

Log:
  Remove bogus break statements.
  
  Obtained from:DragonFly

Modified:
  head/sys/dev/ata/ata-lowlevel.c
  head/sys/dev/mly/mly.c

Modified: head/sys/dev/ata/ata-lowlevel.c
==
--- head/sys/dev/ata/ata-lowlevel.c Tue Sep 18 02:14:47 2012
(r240626)
+++ head/sys/dev/ata/ata-lowlevel.c Tue Sep 18 02:19:43 2012
(r240627)
@@ -370,7 +370,6 @@ ata_end_transaction(struct ata_request *
  "%s trying to write on read buffer\n",
   ata_cmd2str(request));
goto end_finished;
-   break;
}
ata_pio_write(request, length);
request->donecount += length;

Modified: head/sys/dev/mly/mly.c
==
--- head/sys/dev/mly/mly.c  Tue Sep 18 02:14:47 2012(r240626)
+++ head/sys/dev/mly/mly.c  Tue Sep 18 02:19:43 2012(r240627)
@@ -1350,7 +1350,6 @@ mly_process_event(struct mly_softc *sc, 
if (action == 'r')
sc->mly_btl[bus][target].mb_flags |= MLY_BTL_RESCAN;
break;
-  break;
 case 's':  /* report of sense data */
if (((ssd->flags & SSD_KEY) == SSD_KEY_NO_SENSE) ||
(((ssd->flags & SSD_KEY) == SSD_KEY_NOT_READY) && 
___
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: r240628 - head/sbin/ipfw

2012-09-17 Thread Benjamin Kaduk
Author: bjk (doc committer)
Date: Tue Sep 18 02:33:23 2012
New Revision: 240628
URL: http://svn.freebsd.org/changeset/base/240628

Log:
  Whitespace cleanup for ipfw.8 -- start each sentence on a new line,
  and put a comma after e.g. and i.e..  While here, wrap long lines.
  
  PR:   docs/157452
  Approved by:  hrs (mentor)

Modified:
  head/sbin/ipfw/ipfw.8

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Tue Sep 18 02:19:43 2012(r240627)
+++ head/sbin/ipfw/ipfw.8   Tue Sep 18 02:33:23 2012(r240628)
@@ -141,7 +141,7 @@ the firewall will have a
 .Em stateful
 behaviour, i.e., upon a match it will create
 .Em dynamic rules ,
-i.e. rules that match packets with the same 5-tuple
+i.e., rules that match packets with the same 5-tuple
 (protocol, source and destination addresses and ports)
 as the packet which caused their creation.
 Dynamic rules, which have a limited lifetime, are checked
@@ -223,14 +223,15 @@ When listing and
 is specified, also show expired dynamic rules.
 .It Fl f
 Do not ask for confirmation for commands that can cause problems
-if misused,
-.No i.e. Cm flush .
+if misused, i.e.,
+.Cm flush .
 If there is no tty associated with the process, this is implied.
 .It Fl i
 When listing a table (see the
 .Sx LOOKUP TABLES
 section below for more information on lookup tables), format values
-as IP addresses. By default, values are shown as integers.
+as IP addresses.
+By default, values are shown as integers.
 .It Fl n
 Only check syntax of the command strings, without actually passing
 them to the kernel.
@@ -421,7 +422,7 @@ Keywords are case-sensitive, whereas arg
 or may not be case-sensitive depending on their nature
 (e.g.\& uid's are, hostnames are not).
 .Pp
-Some arguments (e.g. port or address lists) are comma-separated
+Some arguments (e.g., port or address lists) are comma-separated
 lists of values.
 In this case, spaces after commas ',' are allowed to make
 the line more readable.
@@ -873,7 +874,8 @@ Takes rule number saved to internal stac
 action and returns ruleset processing to the first rule
 with number greater than number of corresponding
 .Cm call
-rule. See description of the
+rule.
+See description of the
 .Cm call
 action for more details.
 .Pp
@@ -960,23 +962,29 @@ Initially this is limited to the values 
 Processing continues at the next rule.
 It is possible to use the
 .Cm tablearg
-keyword with a setfib. If tablearg value is not within compiled FIB range 
packet fib is set to 0.
+keyword with a setfib.
+If tablearg value is not within compiled FIB range packet fib is set to 0.
 .It Cm reass
 Queue and reassemble ip fragments.
-If the packet is not fragmented, counters are updated and processing continues 
with the next rule.
+If the packet is not fragmented, counters are updated and
+processing continues with the next rule.
 If the packet is the last logical fragment, the packet is reassembled and, if
 .Va net.inet.ip.fw.one_pass
-is set to 0, processing continues with the next rule, else packet is allowed 
to pass and search terminates.
-If the packet is a fragment in the middle, it is consumed and processing stops 
immediately.
+is set to 0, processing continues with the next rule, else packet is
+allowed to pass and search terminates.
+If the packet is a fragment in the middle, it is consumed and
+processing stops immediately.
 .Pp
 Fragments handling can be tuned via
 .Va net.inet.ip.maxfragpackets
 and
 .Va net.inet.ip.maxfragsperpacket
-which limit, respectively, the maximum number of processable fragments 
(default: 800) and
+which limit, respectively, the maximum number of processable
+fragments (default: 800) and
 the maximum number of fragments per packet (default: 16).
 .Pp
-NOTA BENE: since fragments do not contain port numbers, they should be avoided 
with the
+NOTA BENE: since fragments do not contain port numbers,
+they should be avoided with the
 .Nm reass
 rule.
 Alternatively, direction-based (like
@@ -1596,7 +1604,8 @@ This is the short form of
 .It Cm sockarg
 Matches packets that are associated to a local socket and
 for which the SO_USER_COOKIE socket option has been set
-to a non-zero value. As a side effect, the value of the
+to a non-zero value.
+As a side effect, the value of the
 option is made available as
 .Cm tablearg
 value, which in turn can be used as
@@ -1746,7 +1755,7 @@ connected networks instead of all source
 .El
 .Sh LOOKUP TABLES
 Lookup tables are useful to handle large sparse sets of
-addresses or other search keys (e.g. ports, jail IDs, interface names).
+addresses or other search keys (e.g., ports, jail IDs, interface names).
 In the rest of this section we will use the term ``address''.
 There may be up to 65535 different lookup tables, numbered 0 to 65534.
 .Pp
@@ -1784,7 +1793,8 @@ the routing table (see
 .Xr route 4 ) .
 .Pp
 Lookup tables currently support only ports, jail IDs, IPv4/IPv6  addresses

Re: svn commit: r240628 - head/sbin/ipfw

2012-09-17 Thread Doug Barton
On 09/17/2012 19:33, Benjamin Kaduk wrote:
>   Whitespace cleanup for ipfw.8 -- start each sentence on a new line,

We generally don't do this at all absent other changes.

We definitely don't make whitespace-only changes mixed in with other
changes, as it makes the diff too hard to read.

Your mentor should have caught this.

-- 

I am only one, but I am one.  I cannot do everything, but I can do
something.  And I will not let what I cannot do interfere with what
I can do.
-- Edward Everett Hale, (1822 - 1909)
___
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"