Re: svn commit: r261875 - head/usr.bin/netstat

2014-02-13 Thread Gleb Smirnoff
On Fri, Feb 14, 2014 at 07:43:40AM +, Adrian Chadd wrote:
A> Author: adrian
A> Date: Fri Feb 14 07:43:39 2014
A> New Revision: 261875
A> URL: http://svnweb.freebsd.org/changeset/base/261875
A> 
A> Log:
A>   Reword.
A>   
A>   Suggestion:glebius
A> 
A> Modified:
A>   head/usr.bin/netstat/flowtable.c
A> 
A> Modified: head/usr.bin/netstat/flowtable.c
A> 
==
A> --- head/usr.bin/netstat/flowtable.c Fri Feb 14 07:36:04 2014
(r261874)
A> +++ head/usr.bin/netstat/flowtable.c Fri Feb 14 07:43:39 2014
(r261875)
A> @@ -55,7 +55,7 @@ print_stats(struct flowtable_stat *stat)
A>  p(ft_collisions, "\t%ju collision%s\n");
A>  p(ft_free_checks, "\t%ju free check%s\n");
A>  p(ft_frees, "\t%ju free%s\n");
A> -p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved ARP%s\n");
A> +p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved Layer 2 
address%s\n");
A>  
A>  #undef  p2
A>  #undef  p

Oh, sorry this is not correct. We need the plural() output after "lookup",
not after "address".

We need:

1 lookup w/ no resolved Layer 2 address
2 lookups w/ no resolved Layer 2 address

We don't want:

1 lookups w/ no resolved Layer 2 address
2 lookups w/ no resolved Layer 2 addresss

-- 
Totus tuus, Glebius.
___
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: r261875 - head/usr.bin/netstat

2014-02-13 Thread Adrian Chadd
Author: adrian
Date: Fri Feb 14 07:43:39 2014
New Revision: 261875
URL: http://svnweb.freebsd.org/changeset/base/261875

Log:
  Reword.
  
  Suggestion:   glebius

Modified:
  head/usr.bin/netstat/flowtable.c

Modified: head/usr.bin/netstat/flowtable.c
==
--- head/usr.bin/netstat/flowtable.cFri Feb 14 07:36:04 2014
(r261874)
+++ head/usr.bin/netstat/flowtable.cFri Feb 14 07:43:39 2014
(r261875)
@@ -55,7 +55,7 @@ print_stats(struct flowtable_stat *stat)
p(ft_collisions, "\t%ju collision%s\n");
p(ft_free_checks, "\t%ju free check%s\n");
p(ft_frees, "\t%ju free%s\n");
-   p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved ARP%s\n");
+   p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved Layer 2 
address%s\n");
 
 #undef p2
 #undef p
___
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: r261874 - stable/9/share/man/man4

2014-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Feb 14 07:36:04 2014
New Revision: 261874
URL: http://svnweb.freebsd.org/changeset/base/261874

Log:
  MFC r261597, r261598 and r261599:
  
  Apple touchpad manual page fixes:
  - Add manual page for wsp driver
  - Update atp driver manual page
  - Install atp manual page for all platforms

Added:
  stable/9/share/man/man4/wsp.4
 - copied unchanged from r261597, head/share/man/man4/wsp.4
Modified:
  stable/9/share/man/man4/Makefile
  stable/9/share/man/man4/atp.4
Directory Properties:
  stable/9/share/   (props changed)
  stable/9/share/man/   (props changed)
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/Makefile
==
--- stable/9/share/man/man4/MakefileFri Feb 14 07:30:59 2014
(r261873)
+++ stable/9/share/man/man4/MakefileFri Feb 14 07:36:04 2014
(r261874)
@@ -55,7 +55,7 @@ MAN=  aac.4 \
ath_pci.4 \
atkbd.4 \
atkbdc.4 \
-   ${_atp.4} \
+   atp.4 \
${_atrtc.4} \
${_attimer.4} \
audit.4 \
@@ -539,6 +539,7 @@ MAN=aac.4 \
wlan_wep.4 \
wlan_xauth.4 \
${_wpi.4} \
+   wsp.4 \
xe.4 \
${_xen.4} \
xhci.4 \
@@ -720,7 +721,6 @@ _amdsbwd.4= amdsbwd.4
 _amdsmb.4= amdsmb.4
 _amdtemp.4=amdtemp.4
 _asmc.4=   asmc.4
-_atp.4=atp.4
 _bxe.4=bxe.4
 _coretemp.4=   coretemp.4
 _cpuctl.4= cpuctl.4
@@ -785,9 +785,6 @@ MLINKS+=qlxgbe.4 if_qlxgbe.4
 MLINKS+=sfxge.4 if_sfxge.4
 .endif
 
-.if ${MACHINE_CPUARCH} == "powerpc"
-_atp.4=atp.4
-.endif
 .if ${MACHINE_CPUARCH} == "mips"
 _nvram2env.4=  nvram2env.4
 .endif

Modified: stable/9/share/man/man4/atp.4
==
--- stable/9/share/man/man4/atp.4   Fri Feb 14 07:30:59 2014
(r261873)
+++ stable/9/share/man/man4/atp.4   Fri Feb 14 07:36:04 2014
(r261874)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2009
+.Dd February 7, 2014
 .Dt ATP 4
 .Os
 .Sh NAME
@@ -98,7 +98,7 @@ Core2 Duo MacBook3,1 (IDs: 0x0229, 0x022
 .El
 .Pp
 To discover the product\-id of a touchpad, search for 'Trackpad' in the
-output of 
+output of
 .Xr lshal 1
 and look up the property
 .Nm usb_device.product_id .
@@ -108,63 +108,12 @@ creates a blocking pseudo\-device file,
 .Pa /dev/atp0 ,
 which presents the mouse as a
 .Ar sysmouse
-or 
+or
 .Ar mousesystems
 type device\-\-see
 .Xr moused 8
 for an explanation of these mouse
 types.
-.Xr moused 8
-can be configured to read touchpad data from
-.Pa /dev/atp0
-and pass it along to the 
-.Xr sysmouse 4
-driver so that any process wanting to utilize mouse operation (such as
-an X server) may fetch it from
-.Pa /dev/sysmouse ;
-alternatively,
-.Pa /dev/atp0
-may be manipulated via
-.Xr read 2
-and
-.Xr ioctl 2
-calls to get mouse data directly.
-.Sh EXAMPLES
-To use a compatible Apple Trackpad as your console mouse:
-.Pp
-.Dl moused -p /dev/atp0 -t auto
-.Pp
-To launch
-.Xr moused 8
-automatically upon boot, add the following to
-.Pa /etc/rc.conf :
-.Pp
-.Dl moused_enable="YES"
-.Dl moused_type="auto"
-.Dl moused_port="/dev/atp0"
-.Pp
-If you want
-.Xr moused 8
-to also probe for external USB mice or other devices, then add the
-following to
-.Pa /etc/rc.conf :
-.Pp
-.Dl moused_nondefault_enable="YES"
-.Dl moused_ums0_enable="YES"
-.Dl moused_ums1_enable="YES"
-.Pp
-To be able to use the trackpad under X, change the "Pointer" section in
-.Nm xorg.conf
-to the following:
-.Pp
-.Dl Device "/dev/atp0"
-.Dl Protocol "Auto"
-.Pp
-Better still, if you want to be able to use the mouse in both virtual
-consoles as well as in X change it to:
-.Pp
-.Dl Device "/dev/sysmouse"
-.Dl Protocol "Auto"
 .Sh SEE ALSO
 .Xr sysmouse 4 ,
 .Xr usb 4 ,

Copied: stable/9/share/man/man4/wsp.4 (from r261597, head/share/man/man4/wsp.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/9/share/man/man4/wsp.4   Fri Feb 14 07:36:04 2014
(r261874, copy of r261597, head/share/man/man4/wsp.4)
@@ -0,0 +1,96 @@
+.\" Copyright (c) 2014 Hans Petter Selasky .
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the author nor the names of any co-contributors
+.\"may be used to endorse or promote products derived from this

svn commit: r261873 - stable/10/share/man/man4

2014-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Feb 14 07:30:59 2014
New Revision: 261873
URL: http://svnweb.freebsd.org/changeset/base/261873

Log:
  MFC r261597, r261598 and r261599:
  
  Apple touchpad manual page fixes:
  - Add manual page for wsp driver
  - Update atp driver manual page
  - Install atp manual page for all platforms

Added:
  stable/10/share/man/man4/wsp.4
 - copied unchanged from r261597, head/share/man/man4/wsp.4
Modified:
  stable/10/share/man/man4/Makefile
  stable/10/share/man/man4/atp.4
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/Makefile
==
--- stable/10/share/man/man4/Makefile   Fri Feb 14 07:17:36 2014
(r261872)
+++ stable/10/share/man/man4/Makefile   Fri Feb 14 07:30:59 2014
(r261873)
@@ -59,7 +59,7 @@ MAN=  aac.4 \
ath_pci.4 \
atkbd.4 \
atkbdc.4 \
-   ${_atp.4} \
+   atp.4 \
${_atf_test_case.4} \
${_atrtc.4} \
${_attimer.4} \
@@ -561,6 +561,7 @@ MAN=aac.4 \
wlan_wep.4 \
wlan_xauth.4 \
${_wpi.4} \
+   wsp.4 \
xe.4 \
${_xen.4} \
xhci.4 \
@@ -748,7 +749,6 @@ _amdsbwd.4= amdsbwd.4
 _amdsmb.4= amdsmb.4
 _amdtemp.4=amdtemp.4
 _asmc.4=   asmc.4
-_atp.4=atp.4
 _bxe.4=bxe.4
 _coretemp.4=   coretemp.4
 _cpuctl.4= cpuctl.4
@@ -820,9 +820,6 @@ MLINKS+=qlxgbe.4 if_qlxgbe.4
 MLINKS+=sfxge.4 if_sfxge.4
 .endif
 
-.if ${MACHINE_CPUARCH} == "powerpc"
-_atp.4=atp.4
-.endif
 .if ${MACHINE_CPUARCH} == "mips"
 _nvram2env.4=  nvram2env.4
 .endif

Modified: stable/10/share/man/man4/atp.4
==
--- stable/10/share/man/man4/atp.4  Fri Feb 14 07:17:36 2014
(r261872)
+++ stable/10/share/man/man4/atp.4  Fri Feb 14 07:30:59 2014
(r261873)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 12, 2009
+.Dd February 7, 2014
 .Dt ATP 4
 .Os
 .Sh NAME
@@ -114,57 +114,6 @@ type device\-\-see
 .Xr moused 8
 for an explanation of these mouse
 types.
-.Xr moused 8
-can be configured to read touchpad data from
-.Pa /dev/atp0
-and pass it along to the
-.Xr sysmouse 4
-driver so that any process wanting to utilize mouse operation (such as
-an X server) may fetch it from
-.Pa /dev/sysmouse ;
-alternatively,
-.Pa /dev/atp0
-may be manipulated via
-.Xr read 2
-and
-.Xr ioctl 2
-calls to get mouse data directly.
-.Sh EXAMPLES
-To use a compatible Apple Trackpad as your console mouse:
-.Pp
-.Dl moused -p /dev/atp0 -t auto
-.Pp
-To launch
-.Xr moused 8
-automatically upon boot, add the following to
-.Pa /etc/rc.conf :
-.Pp
-.Dl moused_enable="YES"
-.Dl moused_type="auto"
-.Dl moused_port="/dev/atp0"
-.Pp
-If you want
-.Xr moused 8
-to also probe for external USB mice or other devices, then add the
-following to
-.Pa /etc/rc.conf :
-.Pp
-.Dl moused_nondefault_enable="YES"
-.Dl moused_ums0_enable="YES"
-.Dl moused_ums1_enable="YES"
-.Pp
-To be able to use the trackpad under X, change the "Pointer" section in
-.Nm xorg.conf
-to the following:
-.Pp
-.Dl Device "/dev/atp0"
-.Dl Protocol "Auto"
-.Pp
-Better still, if you want to be able to use the mouse in both virtual
-consoles as well as in X change it to:
-.Pp
-.Dl Device "/dev/sysmouse"
-.Dl Protocol "Auto"
 .Sh SEE ALSO
 .Xr sysmouse 4 ,
 .Xr usb 4 ,

Copied: stable/10/share/man/man4/wsp.4 (from r261597, head/share/man/man4/wsp.4)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/share/man/man4/wsp.4  Fri Feb 14 07:30:59 2014
(r261873, copy of r261597, head/share/man/man4/wsp.4)
@@ -0,0 +1,96 @@
+.\" Copyright (c) 2014 Hans Petter Selasky .
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the author nor the names of any co-contributors
+.\"may be used to endorse or promote products derived from this software
+.\"   without specific prior written permission.
+.\"
+.\" 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, O

Re: svn commit: r261867 - head/sys/vm

2014-02-13 Thread Andriy Gapon
on 14/02/2014 05:34 Attilio Rao said the following:
> Author: attilio
> Date: Fri Feb 14 03:34:12 2014
> New Revision: 261867
> URL: http://svnweb.freebsd.org/changeset/base/261867
> 
> Log:
>   Fix-up r254141: in the process of making a failing vm_page_rename()
>   a call of pager_swap_freespace() was moved around, now leading to freeing
>   the incorrect page because of the pindex changes after vm_page_rename().
>   
>   Get back to use the correct pindex when destroying the swap space.
>   
>   Sponsored by:   EMC / Isilon storage division
>   Reported by:avg
>   Tested by:  pho
>   MFC after:  7 days

Thank you!
I also have not seen any of my previous problems since I started using the 
patch.

> Modified:
>   head/sys/vm/vm_object.c
> 
> Modified: head/sys/vm/vm_object.c
> ==
> --- head/sys/vm/vm_object.c   Fri Feb 14 03:30:55 2014(r261866)
> +++ head/sys/vm/vm_object.c   Fri Feb 14 03:34:12 2014(r261867)
> @@ -1627,9 +1627,11 @@ vm_object_backing_scan(vm_object_t objec
>   p = TAILQ_FIRST(&backing_object->memq);
>   continue;
>   }
> +
> + /* Use the old pindex to free the right page. */
>   if (backing_object->type == OBJT_SWAP)
> - swap_pager_freespace(backing_object, p->pindex,
> - 1);
> + swap_pager_freespace(backing_object,
> + new_pindex + backing_offset_index, 1);
>  
>  #if VM_NRESERVLEVEL > 0
>   /*
> 


-- 
Andriy Gapon
___
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: r261872 - head/sys/dev/usb/controller

2014-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Feb 14 07:17:36 2014
New Revision: 261872
URL: http://svnweb.freebsd.org/changeset/base/261872

Log:
  Fix minor logical error in the XHCI driver. Set correct SETUP packet
  direction value.
  
  MFC after:2 days
  Reported by:  Horse Ma 

Modified:
  head/sys/dev/usb/controller/xhci.c
  head/sys/dev/usb/controller/xhci.h

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Fri Feb 14 05:25:15 2014
(r261871)
+++ head/sys/dev/usb/controller/xhci.c  Fri Feb 14 07:17:36 2014
(r261872)
@@ -1759,7 +1759,8 @@ restart:
/* check wLength */
if (td->td_trb[0].qwTrb0 &
   htole64(XHCI_TRB_0_WLENGTH_MASK)) {
-   if (td->td_trb[0].qwTrb0 & htole64(1))
+   if (td->td_trb[0].qwTrb0 &
+   htole64(XHCI_TRB_0_DIR_IN_MASK))
dword |= XHCI_TRB_3_TRT_IN;
else
dword |= XHCI_TRB_3_TRT_OUT;

Modified: head/sys/dev/usb/controller/xhci.h
==
--- head/sys/dev/usb/controller/xhci.h  Fri Feb 14 05:25:15 2014
(r261871)
+++ head/sys/dev/usb/controller/xhci.h  Fri Feb 14 07:17:36 2014
(r261872)
@@ -192,6 +192,7 @@ struct xhci_stream_ctx {
 
 struct xhci_trb {
volatile uint64_t   qwTrb0;
+#defineXHCI_TRB_0_DIR_IN_MASK  (0x80ULL << 0)
 #defineXHCI_TRB_0_WLENGTH_MASK (0xULL << 48)
volatile uint32_t   dwTrb2;
 #defineXHCI_TRB_2_ERROR_GET(x) (((x) >> 24) & 0xFF)
___
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: r261859 - in head: sys/net usr.bin/netstat

2014-02-13 Thread Gleb Smirnoff
On Fri, Feb 14, 2014 at 10:21:04AM +0400, Gleb Smirnoff wrote:
T> On Fri, Feb 14, 2014 at 12:05:09AM +, Adrian Chadd wrote:
T> A> Modified: head/usr.bin/netstat/flowtable.c
T> A> 
==
T> A> --- head/usr.bin/netstat/flowtable.c  Thu Feb 13 22:24:36 2014
(r261858)
T> A> +++ head/usr.bin/netstat/flowtable.c  Fri Feb 14 00:05:09 2014
(r261859)
T> A> @@ -55,6 +55,7 @@ print_stats(struct flowtable_stat *stat)
T> A>   p(ft_collisions, "\t%ju collision%s\n");
T> A>   p(ft_free_checks, "\t%ju free check%s\n");
T> A>   p(ft_frees, "\t%ju free%s\n");
T> A> + p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved ARP%s\n");
T> 
T> Should be:   "\t%ju lookups%s w/ no resolved ARP\n"
T> Or even better:  "\t%ju lookups%s with not resolved 
Layer 2\n"

Argh, of course 's' is extra:

"\t%ju lookup%s with not resolved Layer 2\n"

-- 
Totus tuus, Glebius.
___
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: r261859 - in head: sys/net usr.bin/netstat

2014-02-13 Thread Gleb Smirnoff
On Fri, Feb 14, 2014 at 12:05:09AM +, Adrian Chadd wrote:
A> Modified: head/usr.bin/netstat/flowtable.c
A> 
==
A> --- head/usr.bin/netstat/flowtable.c Thu Feb 13 22:24:36 2014
(r261858)
A> +++ head/usr.bin/netstat/flowtable.c Fri Feb 14 00:05:09 2014
(r261859)
A> @@ -55,6 +55,7 @@ print_stats(struct flowtable_stat *stat)
A>  p(ft_collisions, "\t%ju collision%s\n");
A>  p(ft_free_checks, "\t%ju free check%s\n");
A>  p(ft_frees, "\t%ju free%s\n");
A> +p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved ARP%s\n");

Should be:  "\t%ju lookups%s w/ no resolved ARP\n"
Or even better: "\t%ju lookups%s with not resolved Layer 2\n"

Sorry for late re-review.

-- 
Totus tuus, Glebius.
___
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: r261871 - head/sys/mips/conf

2014-02-13 Thread Adrian Chadd
Author: adrian
Date: Fri Feb 14 05:25:15 2014
New Revision: 261871
URL: http://svnweb.freebsd.org/changeset/base/261871

Log:
  Enable use of the PCIe connected wifi on the DB120 (AR9344) board.
  
  The on-board NIC is an 3x3 AR9380 with 5GHz only.
  
  * enable pci code in AR9344_BASE
  * enable ath_pci and the firmware loading bits in DB120
  * add in the relevant hints in DB120.hints to inform the probe/attach
code where the PCIe fixup data is for the onboard chip.
  
  This is only relevant for a default development board.  I also have a
  DB120 with the on-board PCIe wifi NIC disabled and it's exposed as
  a real PCIe slot (to put normal PCIe NICs in); the fixup code will need
  to be disabled to make this work correctly.
  
  Tested:
  
  * DB120

Modified:
  head/sys/mips/conf/AR934X_BASE
  head/sys/mips/conf/AR934X_BASE.hints
  head/sys/mips/conf/DB120
  head/sys/mips/conf/DB120.hints

Modified: head/sys/mips/conf/AR934X_BASE
==
--- head/sys/mips/conf/AR934X_BASE  Fri Feb 14 05:22:28 2014
(r261870)
+++ head/sys/mips/conf/AR934X_BASE  Fri Feb 14 05:25:15 2014
(r261871)
@@ -102,6 +102,9 @@ options USB_DEBUG
 optionsUSB_HOST_ALIGN=32   # AR71XX (MIPS in 
general?) requires this
 device ehci
 
+device pci
+device ar724x_pci
+
 device scbus
 device umass
 device da

Modified: head/sys/mips/conf/AR934X_BASE.hints
==
--- head/sys/mips/conf/AR934X_BASE.hintsFri Feb 14 05:22:28 2014
(r261870)
+++ head/sys/mips/conf/AR934X_BASE.hintsFri Feb 14 05:25:15 2014
(r261871)
@@ -22,6 +22,10 @@ hint.ehci.0.maddr=0x1b000100
 hint.ehci.0.msize=0x1000
 hint.ehci.0.irq=1
 
+# pci
+hint.pcib.0.at="nexus0"
+hint.pcib.0.irq=0
+
 hint.arge.0.at="nexus0"
 hint.arge.0.maddr=0x1900
 hint.arge.0.msize=0x1000

Modified: head/sys/mips/conf/DB120
==
--- head/sys/mips/conf/DB120Fri Feb 14 05:22:28 2014(r261870)
+++ head/sys/mips/conf/DB120Fri Feb 14 05:25:15 2014(r261871)
@@ -42,5 +42,11 @@ options  GEOM_UNCOMPRESS
 # Used for the static uboot partition map
 device  geom_map
 
+# yes, this board has a PCI connected atheros device
+device ath_pci
+optionsAR71XX_ATH_EEPROM
+device firmware# Used by the above
+optionsATH_EEPROM_FIRMWARE
+
 # Boot off of the rootfs, as defined in the geom_map setup.
 optionsROOTDEVNAME=\"ufs:map/rootfs.uncompress\"

Modified: head/sys/mips/conf/DB120.hints
==
--- head/sys/mips/conf/DB120.hints  Fri Feb 14 05:22:28 2014
(r261870)
+++ head/sys/mips/conf/DB120.hints  Fri Feb 14 05:25:15 2014
(r261871)
@@ -60,6 +60,13 @@ hint.ath.0.eepromsize=16384
 # host registers on the NIC) and then we teach ath where
 # to find it.
 
+# ath1 hint - pcie slot 0
+hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff4000
+hint.pcib.0.bus.0.0.0.ath_fixup_size=16384
+
+# ath0 - eeprom comes from here
+hint.ath.1.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware"
+
 # flash layout:
 #
 # bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init 
mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART)
___
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: r261870 - head/sys/mips/atheros

2014-02-13 Thread Adrian Chadd
Author: adrian
Date: Fri Feb 14 05:22:28 2014
New Revision: 261870
URL: http://svnweb.freebsd.org/changeset/base/261870

Log:
  Disable this check for now; it fails on the AR9344 PCI fixup code.
  
  I'll make it conditional later.
  
  Tested:
  
  * DB120

Modified:
  head/sys/mips/atheros/ar724x_pci.c

Modified: head/sys/mips/atheros/ar724x_pci.c
==
--- head/sys/mips/atheros/ar724x_pci.c  Fri Feb 14 04:03:17 2014
(r261869)
+++ head/sys/mips/atheros/ar724x_pci.c  Fri Feb 14 05:22:28 2014
(r261870)
@@ -261,11 +261,13 @@ ar724x_pci_fixup(device_t dev, long flas
uint32_t bar0, reg, val;
uint16_t *cal_data = (uint16_t *) MIPS_PHYS_TO_KSEG1(flash_addr);
 
+#if 0
if (cal_data[0] != AR5416_EEPROM_MAGIC) {
device_printf(dev, "%s: Invalid calibration data from 0x%x\n",
__func__, (uintptr_t) flash_addr);
return;
}
+#endif
 
/* Save bar(0) address - just to flush bar(0) (SoC WAR) ? */
bar0 = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_BAR(0), 4);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r261869 - head/sys/mips/conf

2014-02-13 Thread Adrian Chadd
Author: adrian
Date: Fri Feb 14 04:03:17 2014
New Revision: 261869
URL: http://svnweb.freebsd.org/changeset/base/261869

Log:
  Add the ath0 EEPROM hints required to detect the on-chip wifi.
  
  This allows the on-chip wifi to work; however it's not yet fully
  tested.
  
  ath0: Vendor=0x168c, Device=0x0031
  ath0: Vendor=0x168c, Device=0x0031
  ath0:  at mem 0x1810-0x1811 irq 0 on nexus0
  ...
  ath0: [HT] enabling HT modes
  ath0: [HT] enabling short-GI in 20MHz mode
  ath0: [HT] 1 stream STBC receive enabled
  ath0: [HT] 1 stream STBC transmit enabled
  ath0: [HT] 2 RX streams; 2 TX streams
  
  Tested:
  
  * DB120 development board

Modified:
  head/sys/mips/conf/DB120.hints

Modified: head/sys/mips/conf/DB120.hints
==
--- head/sys/mips/conf/DB120.hints  Fri Feb 14 03:45:49 2014
(r261868)
+++ head/sys/mips/conf/DB120.hints  Fri Feb 14 04:03:17 2014
(r261869)
@@ -50,6 +50,16 @@ hint.arge.1.media=1000
 hint.arge.1.fduplex=1
 hint.arge.1.miimode=1  # GMII
 
+# ath0: Where the ART is - last 64k in the flash
+hint.ath.0.eepromaddr=0x1fff
+hint.ath.0.eepromsize=16384
+
+# ath1: it's different; it's a PCIe attached device, so
+# we instead need to teach the PCIe bridge code about it
+# (ie, the 'early pci fixup' stuff that programs the PCIe
+# host registers on the NIC) and then we teach ath where
+# to find it.
+
 # flash layout:
 #
 # bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init 
mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART)
___
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: r261868 - in stable/10: share/man/man4 sys/dev/usb sys/dev/usb/wlan

2014-02-13 Thread Kevin Lo
Author: kevlo
Date: Fri Feb 14 03:45:49 2014
New Revision: 261868
URL: http://svnweb.freebsd.org/changeset/base/261868

Log:
  MFC r259544, r259545, r259546, r259547, r259812, r259939, r260219, r260542,
  r261118, r261124, r261330:
  
  - Add support for the MediaTek/Ralink RT3593 chipset.
  - Various minor USB WLAN fixes and improvements.

Modified:
  stable/10/share/man/man4/run.4
  stable/10/sys/dev/usb/usbdevs
  stable/10/sys/dev/usb/wlan/if_run.c
  stable/10/sys/dev/usb/wlan/if_runreg.h
  stable/10/sys/dev/usb/wlan/if_runvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/run.4
==
--- stable/10/share/man/man4/run.4  Fri Feb 14 03:34:12 2014
(r261867)
+++ stable/10/share/man/man4/run.4  Fri Feb 14 03:45:49 2014
(r261868)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 11, 2013
+.Dd January 3, 2014
 .Dt RUN 4
 .Os
 .Sh NAME
@@ -64,8 +64,17 @@ The RT3000U is a single-chip solution ba
 an RT3020 (1T1R), RT3021 (1T2R) or RT3022 (2T2R) single-band radio
 transceiver.
 .Pp
-The RT3900E is a single-chip solution based on an RT5390 MAC/BBP and
-an RT5370 (1T1R) or RT5372 (2T2R) single-band radio transceiver.
+The RT3900E is a single-chip USB 2.0 802.11n solution.
+The MAC/Baseband Processor can be an RT3593, RT5390, RT5392 or an RT5592.
+The radio can be an RT3053, RT5370, RT5372 or an RT5572.
+The RT3053 chip operates in the 2GHz and 5GHz spectra and supports up to
+3 transmit paths and 3 receiver paths (3T3R).
+The RT5370 chip operates in the 2GHz spectrum and supports 1 transmit path
+and 1 receiver path (1T1R).
+The RT5372 chip operates in the 2GHz spectrum and supports up to 2 transmit
+paths and 2 receiver paths (2T2R).
+The RT5572 chip operates in the 2GHz and 5GHz spectra and supports up to
+2 transmit paths and 2 receiver paths (2T2R).
 .Pp
 These are the modes the
 .Nm
@@ -116,11 +125,13 @@ driver supports the following wireless a
 .It Airlink101 AWLL6090
 .It ASUS USB-N11
 .It ASUS USB-N13 ver. A1
+.It ASUS USB-N66
 .It ASUS WL-160N
 .It Belkin F5D8051 ver 3000
 .It Belkin F5D8053
 .It Belkin F5D8055
 .It Belkin F6D4050 ver 1
+.It Belkin F9L1103
 .It Buffalo WLI-UC-AG300N
 .It Buffalo WLI-UC-G300N
 .It Buffalo WLI-UC-G301N
@@ -132,13 +143,15 @@ driver supports the following wireless a
 .It Corega CG-WLUSB300AGN
 .It Corega CG-WLUSB300GNM
 .It D-Link DWA-130 rev B1
-.It D-Link DWA-140 rev B1, B2, B3
+.It D-Link DWA-140 rev B1, B2, B3, D1
 .It D-Link DWA-160 rev B2
+.It D-Link DWA-162
 .It DrayTek Vigor N61
 .It Edimax EW-7711UAn
 .It Edimax EW-7711UTn
 .It Edimax EW-7717Un
 .It Edimax EW-7718Un
+.It Edimax EW-7733UnD
 .It Gigabyte GN-WB30N
 .It Gigabyte GN-WB31N
 .It Gigabyte GN-WB32L
@@ -164,6 +177,7 @@ driver supports the following wireless a
 .It TP-LINK TL-WN727N v3
 .It Unex DNUR-81
 .It Unex DNUR-82
+.It ZyXEL NWD2705
 .It ZyXEL NWD210N
 .It ZyXEL NWD270N
 .El
@@ -235,4 +249,4 @@ driver was written by
 The
 .Nm
 driver does not support any of the 802.11n capabilities offered by the
-RT2800 and RT3000 chipsets.
+RT2800, RT3000 and RT3900 chipsets.

Modified: stable/10/sys/dev/usb/usbdevs
==
--- stable/10/sys/dev/usb/usbdevs   Fri Feb 14 03:34:12 2014
(r261867)
+++ stable/10/sys/dev/usb/usbdevs   Fri Feb 14 03:45:49 2014
(r261868)
@@ -1183,6 +1183,7 @@ product   ASUS USBN13 0x1784  USB-N13
 productASUS RT3070_1   0x1790  RT3070
 product ASUS USBN100x1786  USB-N10
 product ASUS RTL8192CU 0x17ab  RTL8192CU
+product ASUS USBN660x17ad  USB-N66
 product ASUS RTL8192SU 0x1791  RTL8192SU
 product ASUS A730W 0x4202  ASUS MyPal A730W
 product ASUS P535  0x420f  ASUS P535 PDA
@@ -1285,6 +1286,7 @@ product BELKIN F5U409 0x0409  F5U409 Ser
 product BELKIN F6C550AVR   0x0551  F6C550-AVR UPS
 product BELKIN F5U120  0x1203  F5U120-PC Hub
 product BELKIN RTL8188CU   0x1102  RTL8188CU Wireless Adapter
+product BELKIN F9L1103 0x1103  F9L1103 Wireless Adapter
 product BELKIN RTL8192CU   0x2102  RTL8192CU Wireless Adapter
 product BELKIN F7D2102 0x2103  F7D2102 Wireless Adapter
 product BELKIN ZD1211B 0x4050  ZD1211B
@@ -1598,6 +1600,8 @@ product DLINK RT3072  0x3c0a  RT3072
 product DLINK DWA140B3 0x3c15  DWA-140 rev B3
 product DLINK DWA160B2 0x3c1a  DWA-160 rev B2
 product DLINK DWA127   0x3c1b  DWA-127 Wireless Adapter
+product DLINK DWA162   0x3c1f  DWA-162 Wireless Adapter
+product DLINK DWA140D1 0x3c20  DWA-140 rev D1
 product DLINK DSB650C  0x4000  10Mbps Ethernet
 product DLINK DSB650TX10x4001  10/100 Ethernet
 product DLINK DSB650TX 0x4002  10/100 Ethernet
@@ -1658,6 +1662,7 @@ product EDIMAX RTL8192SU_30x7622  RTL819
 

svn commit: r261867 - head/sys/vm

2014-02-13 Thread Attilio Rao
Author: attilio
Date: Fri Feb 14 03:34:12 2014
New Revision: 261867
URL: http://svnweb.freebsd.org/changeset/base/261867

Log:
  Fix-up r254141: in the process of making a failing vm_page_rename()
  a call of pager_swap_freespace() was moved around, now leading to freeing
  the incorrect page because of the pindex changes after vm_page_rename().
  
  Get back to use the correct pindex when destroying the swap space.
  
  Sponsored by: EMC / Isilon storage division
  Reported by:  avg
  Tested by:pho
  MFC after:7 days

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==
--- head/sys/vm/vm_object.c Fri Feb 14 03:30:55 2014(r261866)
+++ head/sys/vm/vm_object.c Fri Feb 14 03:34:12 2014(r261867)
@@ -1627,9 +1627,11 @@ vm_object_backing_scan(vm_object_t objec
p = TAILQ_FIRST(&backing_object->memq);
continue;
}
+
+   /* Use the old pindex to free the right page. */
if (backing_object->type == OBJT_SWAP)
-   swap_pager_freespace(backing_object, p->pindex,
-   1);
+   swap_pager_freespace(backing_object,
+   new_pindex + backing_offset_index, 1);
 
 #if VM_NRESERVLEVEL > 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: r261866 - stable/9/share/man/man4

2014-02-13 Thread Kevin Lo
Author: kevlo
Date: Fri Feb 14 03:30:55 2014
New Revision: 261866
URL: http://svnweb.freebsd.org/changeset/base/261866

Log:
  MFC r257957:
  
  Mention the RT5370/RT5372 chipset.

Modified:
  stable/9/share/man/man4/runfw.4   (contents, props changed)

Modified: stable/9/share/man/man4/runfw.4
==
--- stable/9/share/man/man4/runfw.4 Fri Feb 14 02:53:10 2014
(r261865)
+++ stable/9/share/man/man4/runfw.4 Fri Feb 14 03:30:55 2014
(r261866)
@@ -18,7 +18,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 12, 2011
+.Dd November 11, 2013
 .Dt RUNFW 4
 .Os
 .Sh NAME
@@ -32,7 +32,7 @@ kernel configuration file:
 .Ed
 .Pp
 This will include two firmware images, RT2870 and RT3071, inside the kernel.
-.Xr run 4 
+.Xr run 4
 will load the appropriate image into the chip.
 .Pp
 Alternatively, to load the firmware images as a module at boot time, place
@@ -43,7 +43,7 @@ runfw_load="YES"
 .Ed
 .Sh DESCRIPTION
 This module provides firmware sets for the Ralink RT2700U,
-RT2800U and RT3000U chip based USB WiFi adapters.
+RT2800U, RT3000U and RT3900E chip based USB WiFi adapters.
 Please read Ralink's license, src/sys/contrib/dev/run/LICENSE.
 .Sh SEE ALSO
 .Xr run 4 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r261865 - in stable/9: share/man/man4 sys/dev/usb sys/dev/usb/wlan

2014-02-13 Thread Kevin Lo
Author: kevlo
Date: Fri Feb 14 02:53:10 2014
New Revision: 261865
URL: http://svnweb.freebsd.org/changeset/base/261865

Log:
  MFC r259544, r259545, r259546, r259547, r259812, r259939, r260219, r260542,
  r261118, r261124, r261330:
  
  - Add support for the MediaTek/Ralink RT3593 chipset.
  - Various minor USB WLAN fixes and improvements.

Modified:
  stable/9/share/man/man4/run.4   (contents, props changed)
  stable/9/sys/dev/usb/usbdevs
  stable/9/sys/dev/usb/wlan/if_run.c
  stable/9/sys/dev/usb/wlan/if_runreg.h   (contents, props changed)
  stable/9/sys/dev/usb/wlan/if_runvar.h
Directory Properties:
  stable/9/   (props changed)
  stable/9/share/   (props changed)
  stable/9/share/man/   (props changed)
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/share/man/man4/run.4
==
--- stable/9/share/man/man4/run.4   Fri Feb 14 02:48:14 2014
(r261864)
+++ stable/9/share/man/man4/run.4   Fri Feb 14 02:53:10 2014
(r261865)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 7, 2012
+.Dd January 3, 2014
 .Dt RUN 4
 .Os
 .Sh NAME
@@ -52,7 +52,7 @@ runfw_load="YES"
 The
 .Nm
 driver supports USB 2.0 wireless adapters based on the Ralink RT2700U,
-RT2800U and RT3000U chipsets.
+RT2800U, RT3000U and RT3900E chipsets.
 .Pp
 The RT2700U chipset consists of two integrated chips, an RT2770 MAC/BBP and
 an RT2720 (1T2R) or RT2750 (dual-band 1T2R) radio transceiver.
@@ -64,6 +64,18 @@ The RT3000U is a single-chip solution ba
 an RT3020 (1T1R), RT3021 (1T2R) or RT3022 (2T2R) single-band radio
 transceiver.
 .Pp
+The RT3900E is a single-chip USB 2.0 802.11n solution.
+The MAC/Baseband Processor can be an RT3593, RT5390, RT5392 or an RT5592.
+The radio can be an RT3053, RT5370, RT5372 or an RT5572.
+The RT3053 chip operates in the 2GHz and 5GHz spectra and supports up to
+3 transmit paths and 3 receiver paths (3T3R).
+The RT5370 chip operates in the 2GHz spectrum and supports 1 transmit path
+and 1 receiver path (1T1R).
+The RT5372 chip operates in the 2GHz spectrum and supports up to 2 transmit
+paths and 2 receiver paths (2T2R).
+The RT5572 chip operates in the 2GHz and 5GHz spectra and supports up to
+2 transmit paths and 2 receiver paths (2T2R).
+.Pp
 These are the modes the
 .Nm
 driver can operate in:
@@ -113,26 +125,33 @@ driver supports the following wireless a
 .It Airlink101 AWLL6090
 .It ASUS USB-N11
 .It ASUS USB-N13 ver. A1
+.It ASUS USB-N66
 .It ASUS WL-160N
 .It Belkin F5D8051 ver 3000
 .It Belkin F5D8053
 .It Belkin F5D8055
 .It Belkin F6D4050 ver 1
+.It Belkin F9L1103
 .It Buffalo WLI-UC-AG300N
 .It Buffalo WLI-UC-G300N
 .It Buffalo WLI-UC-G301N
 .It Buffalo WLI-UC-GN
+.It Buffalo WLI-UC-GNM
+.It Buffalo WLI-UC-GNM2
 .It Corega CG-WLUSB2GNL
 .It Corega CG-WLUSB2GNR
 .It Corega CG-WLUSB300AGN
 .It Corega CG-WLUSB300GNM
 .It D-Link DWA-130 rev B1
-.It D-Link DWA-140
+.It D-Link DWA-140 rev B1, B2, B3, D1
+.It D-Link DWA-160 rev B2
+.It D-Link DWA-162
 .It DrayTek Vigor N61
 .It Edimax EW-7711UAn
 .It Edimax EW-7711UTn
 .It Edimax EW-7717Un
 .It Edimax EW-7718Un
+.It Edimax EW-7733UnD
 .It Gigabyte GN-WB30N
 .It Gigabyte GN-WB31N
 .It Gigabyte GN-WB32L
@@ -142,6 +161,7 @@ driver supports the following wireless a
 .It Hercules HWNU-300
 .It Linksys WUSB54GC v3
 .It Linksys WUSB600N
+.It Logitec LAN-W150N/U2
 .It Mvix Nubbin MS-811N
 .It Planex GW-USMicroN
 .It Planex GW-US300MiniS
@@ -153,8 +173,11 @@ driver supports the following wireless a
 .It SMC SMCWUSBS-N2
 .It Sweex LW303
 .It Sweex LW313
+.It TP-LINK TL-WDN3200
+.It TP-LINK TL-WN727N v3
 .It Unex DNUR-81
 .It Unex DNUR-82
+.It ZyXEL NWD2705
 .It ZyXEL NWD210N
 .It ZyXEL NWD270N
 .El
@@ -226,4 +249,4 @@ driver was written by
 The
 .Nm
 driver does not support any of the 802.11n capabilities offered by the
-RT2800 and RT3000 chipsets.
+RT2800, RT3000 and RT3900 chipsets.

Modified: stable/9/sys/dev/usb/usbdevs
==
--- stable/9/sys/dev/usb/usbdevsFri Feb 14 02:48:14 2014
(r261864)
+++ stable/9/sys/dev/usb/usbdevsFri Feb 14 02:53:10 2014
(r261865)
@@ -1187,6 +1187,7 @@ product   ASUS USBN13 0x1784  USB-N13
 productASUS RT3070_1   0x1790  RT3070
 product ASUS USBN100x1786  USB-N10
 product ASUS RTL8192CU 0x17ab  RTL8192CU
+product ASUS USBN660x17ad  USB-N66
 product ASUS RTL8192SU 0x1791  RTL8192SU
 product ASUS A730W 0x4202  ASUS MyPal A730W
 product ASUS P535  0x420f  ASUS P535 PDA
@@ -1289,6 +1290,7 @@ product BELKIN F5U409 0x0409  F5U409 Ser
 product BELKIN F6C550AVR   0x0551  F6C550-AVR UPS
 product BELKIN F5U120  0x1203  F5U120-PC Hub
 product BELKIN RTL8188CU   0x1102  RTL8188CU Wireless Adapter
+product BELKIN F9L1103 0x1103  F9L11

svn commit: r261864 - stable/10/sys/dev/qlxgb

2014-02-13 Thread David C Somayajulu
Author: davidcs
Date: Fri Feb 14 02:48:14 2014
New Revision: 261864
URL: http://svnweb.freebsd.org/changeset/base/261864

Log:
  MFC 261861
  check for defrag only when bus_dmamap_load_mbuf_sg() returns EFBIG. Comment in
  qla_hw_send is moot.

Modified:
  stable/10/sys/dev/qlxgb/qla_hw.c
  stable/10/sys/dev/qlxgb/qla_os.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/qlxgb/qla_hw.c
==
--- stable/10/sys/dev/qlxgb/qla_hw.cFri Feb 14 01:47:12 2014
(r261863)
+++ stable/10/sys/dev/qlxgb/qla_hw.cFri Feb 14 02:48:14 2014
(r261864)
@@ -998,7 +998,6 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm
if (hdr_len == 0) {
if ((nsegs > Q8_TX_MAX_SEGMENTS) ||
(mp->m_pkthdr.len > ha->max_frame_size)){
-   /* TBD: copy into private buffer and send it */
device_printf(dev,
"%s: (nsegs[%d, %d, 0x%b] > 
Q8_TX_MAX_SEGMENTS)\n",
__func__, nsegs, mp->m_pkthdr.len,

Modified: stable/10/sys/dev/qlxgb/qla_os.c
==
--- stable/10/sys/dev/qlxgb/qla_os.cFri Feb 14 01:47:12 2014
(r261863)
+++ stable/10/sys/dev/qlxgb/qla_os.cFri Feb 14 02:48:14 2014
(r261864)
@@ -1063,10 +1063,7 @@ qla_send(qla_host_t *ha, struct mbuf **m
ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs,
BUS_DMA_NOWAIT);
 
-   if ((ret == EFBIG) ||
-   ((nsegs > Q8_TX_MAX_SEGMENTS) &&
-(((m_head->m_pkthdr.csum_flags & CSUM_TSO) == 0) ||
-   (m_head->m_pkthdr.len <= ha->max_frame_size {
+   if (ret == EFBIG) {
 
struct mbuf *m;
 
___
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: r261863 - head/sys/dev/usb/wlan

2014-02-13 Thread Rui Paulo
Author: rpaulo
Date: Fri Feb 14 01:47:12 2014
New Revision: 261863
URL: http://svnweb.freebsd.org/changeset/base/261863

Log:
  Add urtwn_start_locked() to avoid unlocking during TX.

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cFri Feb 14 01:46:33 2014
(r261862)
+++ head/sys/dev/usb/wlan/if_urtwn.cFri Feb 14 01:47:12 2014
(r261863)
@@ -211,6 +211,8 @@ static int  urtwn_tx_start(struct urtwn_
struct ieee80211_node *, struct mbuf *,
struct urtwn_data *);
 static voidurtwn_start(struct ifnet *);
+static voidurtwn_start_locked(struct ifnet *,
+   struct urtwn_softc *);
 static int urtwn_ioctl(struct ifnet *, u_long, caddr_t);
 static int urtwn_power_on(struct urtwn_softc *);
 static int urtwn_llt_init(struct urtwn_softc *);
@@ -868,13 +870,9 @@ tr_setup:
}
STAILQ_REMOVE_HEAD(&sc->sc_tx_pending, next);
STAILQ_INSERT_TAIL(&sc->sc_tx_active, data, next);
-
usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen);
usbd_transfer_submit(xfer);
-
-   URTWN_UNLOCK(sc);
-   urtwn_start(ifp);
-   URTWN_LOCK(sc);
+   urtwn_start_locked(ifp, sc);
break;
default:
data = STAILQ_FIRST(&sc->sc_tx_active);
@@ -1717,14 +1715,22 @@ static void
 urtwn_start(struct ifnet *ifp)
 {
struct urtwn_softc *sc = ifp->if_softc;
-   struct ieee80211_node *ni;
-   struct mbuf *m;
-   struct urtwn_data *bf;
 
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
-
URTWN_LOCK(sc);
+   urtwn_start_locked(ifp, sc);
+   URTWN_UNLOCK(sc);
+}
+
+static void
+urtwn_start_locked(struct ifnet *ifp, struct urtwn_softc *sc)
+{
+   struct ieee80211_node *ni;
+   struct mbuf *m;
+   struct urtwn_data *bf;
+
+   URTWN_ASSERT_LOCKED(sc);
for (;;) {
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
if (m == NULL)
@@ -1747,7 +1753,6 @@ urtwn_start(struct ifnet *ifp)
sc->sc_txtimer = 5;
callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc);
}
-   URTWN_UNLOCK(sc);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r261862 - stable/9/sys/dev/qlxgb

2014-02-13 Thread David C Somayajulu
Author: davidcs
Date: Fri Feb 14 01:46:33 2014
New Revision: 261862
URL: http://svnweb.freebsd.org/changeset/base/261862

Log:
  MFC r261861
check for defrag only when bus_dmamap_load_mbuf_sg() returns EFBIG. Comment 
in
qla_hw_send is moot.

Modified:
  stable/9/sys/dev/qlxgb/qla_hw.c
  stable/9/sys/dev/qlxgb/qla_os.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/qlxgb/qla_hw.c
==
--- stable/9/sys/dev/qlxgb/qla_hw.c Fri Feb 14 01:02:06 2014
(r261861)
+++ stable/9/sys/dev/qlxgb/qla_hw.c Fri Feb 14 01:46:33 2014
(r261862)
@@ -941,7 +941,6 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm
if (hdr_len == 0) {
if ((nsegs > Q8_TX_MAX_SEGMENTS) ||
(mp->m_pkthdr.len > ha->max_frame_size)){
-   /* TBD: copy into private buffer and send it */
device_printf(dev,
"%s: (nsegs[%d, %d, 0x%x] > 
Q8_TX_MAX_SEGMENTS)\n",
__func__, nsegs, mp->m_pkthdr.len,

Modified: stable/9/sys/dev/qlxgb/qla_os.c
==
--- stable/9/sys/dev/qlxgb/qla_os.c Fri Feb 14 01:02:06 2014
(r261861)
+++ stable/9/sys/dev/qlxgb/qla_os.c Fri Feb 14 01:46:33 2014
(r261862)
@@ -1054,10 +1054,7 @@ qla_send(qla_host_t *ha, struct mbuf **m
ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs,
BUS_DMA_NOWAIT);
 
-   if ((ret == EFBIG) ||
-   ((nsegs > Q8_TX_MAX_SEGMENTS) &&
-(((m_head->m_pkthdr.csum_flags & CSUM_TSO) == 0) ||
-   (m_head->m_pkthdr.len <= ha->max_frame_size {
+   if (ret == EFBIG) {
 
struct mbuf *m;
 
___
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: r261801 - head/contrib/libc++/include

2014-02-13 Thread Bryan Drewery
On 2/12/2014 12:14 PM, Dimitry Andric wrote:
> Author: dim
> Date: Wed Feb 12 18:14:49 2014
> New Revision: 261801
> URL: http://svnweb.freebsd.org/changeset/base/261801
> 
> Log:
>   An ABI incompatibility crept into the libc++ 3.4 import in r261283.  It
>   was caused by upstream libc++ commit r194536, which aimed to make the
>   headers more standards-compliant, by making std::pair's copy constructor
>   trivial.  Unfortunately, this could cause certain C++ applications using
>   shared libraries built against the previous version of libc++ to crash.
>   
>   Fix the ABI incompatibility by making std::pair's copy constructor
>   non-trivial again.
>   


>   Please note: Any C++ applications or shared libraries built with libc++
>   between r261283 and this revision should be recompiled.

*Please* bump __FreeBSD_version__ for ABI changes and notify portmgr@ of
such cases that clearly affect package building.

>   
>   Reported by:stefanf
>   MFC after:  3 weeks
>   X-MFC-With: r261283
> 
> Modified:
>   head/contrib/libc++/include/__config
> 
> Modified: head/contrib/libc++/include/__config
> ==
> --- head/contrib/libc++/include/__config  Wed Feb 12 16:39:56 2014
> (r261800)
> +++ head/contrib/libc++/include/__config  Wed Feb 12 18:14:49 2014
> (r261801)
> @@ -567,7 +567,7 @@ template  struct __static_asse
>  #define _LIBCPP_WCTYPE_IS_MASK
>  #endif
>  
> -#if defined(__APPLE__)
> +#if defined(__APPLE__) || defined(__FreeBSD__)
>  #ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
>  #  define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 0
>  #endif
> 


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r261861 - head/sys/dev/qlxgb

2014-02-13 Thread David C Somayajulu
Author: davidcs
Date: Fri Feb 14 01:02:06 2014
New Revision: 261861
URL: http://svnweb.freebsd.org/changeset/base/261861

Log:
  check for defrag only when bus_dmamap_load_mbuf_sg() returns EFBIG. Comment in
  qla_hw_send is moot.

Modified:
  head/sys/dev/qlxgb/qla_hw.c
  head/sys/dev/qlxgb/qla_os.c

Modified: head/sys/dev/qlxgb/qla_hw.c
==
--- head/sys/dev/qlxgb/qla_hw.c Fri Feb 14 00:26:30 2014(r261860)
+++ head/sys/dev/qlxgb/qla_hw.c Fri Feb 14 01:02:06 2014(r261861)
@@ -998,7 +998,6 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm
if (hdr_len == 0) {
if ((nsegs > Q8_TX_MAX_SEGMENTS) ||
(mp->m_pkthdr.len > ha->max_frame_size)){
-   /* TBD: copy into private buffer and send it */
device_printf(dev,
"%s: (nsegs[%d, %d, 0x%b] > 
Q8_TX_MAX_SEGMENTS)\n",
__func__, nsegs, mp->m_pkthdr.len,

Modified: head/sys/dev/qlxgb/qla_os.c
==
--- head/sys/dev/qlxgb/qla_os.c Fri Feb 14 00:26:30 2014(r261860)
+++ head/sys/dev/qlxgb/qla_os.c Fri Feb 14 01:02:06 2014(r261861)
@@ -1063,10 +1063,7 @@ qla_send(qla_host_t *ha, struct mbuf **m
ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs,
BUS_DMA_NOWAIT);
 
-   if ((ret == EFBIG) ||
-   ((nsegs > Q8_TX_MAX_SEGMENTS) &&
-(((m_head->m_pkthdr.csum_flags & CSUM_TSO) == 0) ||
-   (m_head->m_pkthdr.len <= ha->max_frame_size {
+   if (ret == EFBIG) {
 
struct mbuf *m;
 
___
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: r261860 - stable/10/sys/net

2014-02-13 Thread George V. Neville-Neil
Author: gnn
Date: Fri Feb 14 00:26:30 2014
New Revision: 261860
URL: http://svnweb.freebsd.org/changeset/base/261860

Log:
  MFC 260207
  
  Convert #defines to enums so that the values are visible in the debugger.
  
  Requested by: gibbs

Modified:
  stable/10/sys/net/sff8472.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/sff8472.h
==
--- stable/10/sys/net/sff8472.h Fri Feb 14 00:05:09 2014(r261859)
+++ stable/10/sys/net/sff8472.h Fri Feb 14 00:26:30 2014(r261860)
@@ -62,104 +62,107 @@
 
 /* Table 3.1 Two-wire interface ID: Data Fields */
 
-#define SFF_8472_BASE  0xa0   /* Base address for all our queries. */
-#define SFF_8472_ID0  /* Transceiver Type (Table 3.2) */
-#define SFF_8472_EXT_ID1  /* Extended transceiver type (Table 
3.3) */
-#define SFF_8472_CONNECTOR 2  /* Connector type (Table 3.4) */
-#define SFF_8472_TRANS_START   3  /* Elec or Optical Compatibility
+enum {
+   SFF_8472_BASE   = 0xa0,   /* Base address for all our queries. 
*/
+   SFF_8472_ID = 0,  /* Transceiver Type (Table 3.2) */
+   SFF_8472_EXT_ID = 1,  /* Extended transceiver type (Table 3.3) 
*/
+   SFF_8472_CONNECTOR  = 2,  /* Connector type (Table 3.4) */
+   SFF_8472_TRANS_START= 3,  /* Elec or Optical Compatibility
* (Table 3.5) */
-#define SFF_8472_TRANS_END 10
-#define SFF_8472_ENCODING  11 /* Encoding Code for high speed
-   * serial encoding algorithm (see
-   * Table 3.6) */
-#define SFF_8472_BITRATE   12 /* Nominal signaling rate, units
-   *  of 100MBd.  (see details for
-   *  rates > 25.0Gb/s) */
-#define SFF_8472_RATEID13 /* Type of rate select
-   * functionality (see Table
-   * 3.6a) */
-#define SFF_8472_LEN_SMF_KM14 /* Link length supported for single
+   SFF_8472_TRANS_END  = 10,
+   SFF_8472_ENCODING   = 11, /* Encoding Code for high speed
+* serial encoding algorithm (see
+* Table 3.6) */
+   SFF_8472_BITRATE= 12, /* Nominal signaling rate, units
+* of 100MBd.  (see details for
+* rates > 25.0Gb/s) */
+   SFF_8472_RATEID = 13, /* Type of rate select
+* functionality (see Table
+* 3.6a) */
+   SFF_8472_LEN_SMF_KM = 14, /* Link length supported for single
* mode fiber, units of km */
-#define SFF_8472_LEN_SMF   15 /* Link length supported for single
+   SFF_8472_LEN_SMF= 15, /* Link length supported for single
* mode fiber, units of 100 m */
-#define SFF_8472_LEN_50UM  16 /* Link length supported for 50 um
+   SFF_8472_LEN_50UM   = 16, /* Link length supported for 50 um
* OM2 fiber, units of 10 m */
-#define SFF_8472_LEN_625UM 17 /* Link length supported for 62.5
+   SFF_8472_LEN_625UM  = 17, /* Link length supported for 62.5
* um OM1 fiber, units of 10 m */
-#define SFF_8472_LEN_OM4   18 /* Link length supported for 50um
+   SFF_8472_LEN_OM4= 18, /* Link length supported for 50um
* OM4 fiber, units of 10m.
* Alternatively copper or direct
* attach cable, units of m */
-#define SFF_8472_LEN_OM3   19 /* Link length supported for 50 um OM3 
fiber, units of 10 m */
-#define SFF_8472_VENDOR_START  20 /* Vendor name [Address A0h, Bytes
+   SFF_8472_LEN_OM3= 19, /* Link length supported for 50 um OM3 
fiber, units of 10 m */
+   SFF_8472_VENDOR_START   = 20, /* Vendor name [Address A0h, Bytes
* 20-35] */
-#define SFF_8472_VENDOR_END35
-#define SFF_8472_TRANS 36 /* Transceiver Code for electronic
+   SFF_8472_VENDOR_END = 35,
+   SFF_8472_TRANS  = 36, /* Transceiver Code for electronic
* or optical compatibility (see
* Table 3.5) */
-#define SFF_8472_VENDOR_OUI_START  37 /* Vendor OUI SFP vendor IEEE
+   SFF_8472_VENDOR_OUI_START   = 37, /* Vendor OUI SFP vendor IEEE
* company ID */
-#define SFF_8472_VENDOR_OUI_END39
-#define SFF_8472_PN_START  40 /* Vendor PN */
-#define SFF_8472_PN_END55
-#define SFF_8472_REV_START 56 /* Vendor Revision */
-#define SFF

svn commit: r261859 - in head: sys/net usr.bin/netstat

2014-02-13 Thread Adrian Chadd
Author: adrian
Date: Fri Feb 14 00:05:09 2014
New Revision: 261859
URL: http://svnweb.freebsd.org/changeset/base/261859

Log:
  Don't insert a flowtable entry if the lle isn't yet valid.
  
  Some of the collisions that are occuring are due to flowtable lookups
  that succeed but have an invalid lle - typically because the L2 adjacency
  lookup hasn't completed.  This would lead to a follow-up insert which
  would then fail (ie, collision) and the code would fall through to doing
  a slow-path L2/L3 lookup in the netinet/netinet6 code.
  
  This patch simply aborts storing a new flowtable entry if the lle isn't
  yet valid.
  
  Whilst I'm here, add a new pcpu counter for the item so the number of
  failures can be tracked separately from generic "collisions."
  
  Reviewed by:  glebius
  MFC after:10 days
  Sponsored by: Netflix, Inc.

Modified:
  head/sys/net/flowtable.c
  head/sys/net/flowtable.h
  head/usr.bin/netstat/flowtable.c

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cThu Feb 13 22:24:36 2014(r261858)
+++ head/sys/net/flowtable.cFri Feb 14 00:05:09 2014(r261859)
@@ -966,6 +966,15 @@ flowtable_lookup_common(struct flowtable
RTFREE(rt);
return (NULL);
}
+
+   /* Don't insert the entry if the ARP hasn't yet finished resolving */
+   if ((lle->la_flags & LLE_VALID) == 0) {
+   RTFREE(rt);
+   LLE_FREE(lle);
+   FLOWSTAT_INC(ft, ft_fail_lle_invalid);
+   return (NULL);
+   }
+
ro->ro_lle = lle;
 
if (flowtable_insert(ft, hash, key, fibnum, ro, flags) != 0) {

Modified: head/sys/net/flowtable.h
==
--- head/sys/net/flowtable.hThu Feb 13 22:24:36 2014(r261858)
+++ head/sys/net/flowtable.hFri Feb 14 00:05:09 2014(r261859)
@@ -39,6 +39,7 @@ struct flowtable_stat {
uint64_tft_frees;
uint64_tft_hits;
uint64_tft_lookups;
+   uint64_tft_fail_lle_invalid;
 };
 
 #ifdef _KERNEL

Modified: head/usr.bin/netstat/flowtable.c
==
--- head/usr.bin/netstat/flowtable.cThu Feb 13 22:24:36 2014
(r261858)
+++ head/usr.bin/netstat/flowtable.cFri Feb 14 00:05:09 2014
(r261859)
@@ -55,6 +55,7 @@ print_stats(struct flowtable_stat *stat)
p(ft_collisions, "\t%ju collision%s\n");
p(ft_free_checks, "\t%ju free check%s\n");
p(ft_frees, "\t%ju free%s\n");
+   p(ft_fail_lle_invalid, "\t%ju lookups w/ no resolved ARP%s\n");
 
 #undef p2
 #undef p
___
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: r261858 - head/sys/kern

2014-02-13 Thread Christian Brueffer
Author: brueffer
Date: Thu Feb 13 22:24:36 2014
New Revision: 261858
URL: http://svnweb.freebsd.org/changeset/base/261858

Log:
  Fix a bug in be_uuid_dec(); it called le16dec() instead of be16dec(),
  probably due to copy+pasting le_uuid_dec().
  
  PR:   146588
  Submitted by: Erwin Rol 
  Reviewed by:  marcel
  MFC after:1 week

Modified:
  head/sys/kern/kern_uuid.c

Modified: head/sys/kern/kern_uuid.c
==
--- head/sys/kern/kern_uuid.c   Thu Feb 13 22:19:24 2014(r261857)
+++ head/sys/kern/kern_uuid.c   Thu Feb 13 22:24:36 2014(r261858)
@@ -371,7 +371,7 @@ be_uuid_dec(void const *buf, struct uuid
 
p = buf;
uuid->time_low = be32dec(p);
-   uuid->time_mid = le16dec(p + 4);
+   uuid->time_mid = be16dec(p + 4);
uuid->time_hi_and_version = be16dec(p + 6);
uuid->clock_seq_hi_and_reserved = p[8];
uuid->clock_seq_low = p[9];
___
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: r261857 - in stable/10: etc/mtree tests tests/sys tools/regression/sockets/unix_seqpacket tools/regression/sockets/unix_seqpacket_exercise

2014-02-13 Thread Alan Somers
Author: asomers
Date: Thu Feb 13 22:19:24 2014
New Revision: 261857
URL: http://svnweb.freebsd.org/changeset/base/261857

Log:
  MFC r261081, r261133, and r261615
  
  r261081
Replace the old unix_seqpacket and unix_seqpacket_exercise
tests, which were a little broken and not automatable, with
unix_seqpacket_test.  It's coverage is a superset of the old
tests and it uses ATF.  It includes test cases for bugs
kern/185813 and kern/185812.
  
  r261133
Fix the Makefiles so that the tests I submitted in r261081 will
actually get built.
  
  r261615
tests/sys/Makefile
use TESTS_SUBDIRS for kern instead of SUBDIRS.  I don't
think it makes a difference in this case, but
TESTS_SUBDIRS is generally correct for subdirectories
that contain tests.

Added:
  stable/10/tests/sys/
 - copied from r261081, head/tests/sys/
Deleted:
  stable/10/tools/regression/sockets/unix_seqpacket/
  stable/10/tools/regression/sockets/unix_seqpacket_exercise/
Modified:
  stable/10/etc/mtree/BSD.tests.dist
  stable/10/tests/Makefile
  stable/10/tests/sys/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/etc/mtree/BSD.tests.dist
==
--- stable/10/etc/mtree/BSD.tests.dist  Thu Feb 13 22:18:27 2014
(r261856)
+++ stable/10/etc/mtree/BSD.tests.dist  Thu Feb 13 22:19:24 2014
(r261857)
@@ -48,6 +48,10 @@
 ..
 ..
 ..
+sys
+kern
+..
+..
 usr.bin
 atf
 atf-sh

Modified: stable/10/tests/Makefile
==
--- stable/10/tests/MakefileThu Feb 13 22:18:27 2014(r261856)
+++ stable/10/tests/MakefileThu Feb 13 22:19:24 2014(r261857)
@@ -2,7 +2,7 @@
 
 .include 
 
-SUBDIR= # still empty
+SUBDIR= sys
 
 TESTSDIR= ${TESTSBASE}
 KYUAFILE= yes

Modified: stable/10/tests/sys/Makefile
==
--- head/tests/sys/Makefile Thu Jan 23 17:26:28 2014(r261081)
+++ stable/10/tests/sys/MakefileThu Feb 13 22:19:24 2014
(r261857)
@@ -2,12 +2,11 @@
 
 .include 
 
+.PATH: ${.CURDIR}/..
+
+TESTS_SUBDIRS+=kern
 TESTSDIR= ${TESTSBASE}/sys
 
 KYUAFILE= yes
 
-CLEANFILES+= Kyuafile
-Kyuafile: ${.CURDIR}/../Kyuafile
-   cp -f ${.CURDIR}/../Kyuafile .
-
 .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: r261855 - head/sys/arm/arm

2014-02-13 Thread Andrew Turner
Author: andrew
Date: Thu Feb 13 21:30:54 2014
New Revision: 261855
URL: http://svnweb.freebsd.org/changeset/base/261855

Log:
  Allow the kernel to be loaded at any 1MiB address. This requirement is
  because we use the 1MiB section maps as they only need a single pagetable.
  
  To allow this we only use pc relative loads to ensure we only load from
  physical addresses until we are running from a known virtual address.
  
  As a side effect any data from before or 64MiB after the kernel needs to
  be mapped in to be used. This should not be an issue for kernels loaded
  with ubldr as it places this data just after the kernel. It will be a
  problem when loading directly from anything using the Linux ABI that
  places the ATAG data outside this range, for example U-Boot.

Modified:
  head/sys/arm/arm/locore.S

Modified: head/sys/arm/arm/locore.S
==
--- head/sys/arm/arm/locore.S   Thu Feb 13 20:41:25 2014(r261854)
+++ head/sys/arm/arm/locore.S   Thu Feb 13 21:30:54 2014(r261855)
@@ -148,15 +148,31 @@ Lunmapped:
 * Build page table from scratch.
 */
 
-   /* Load the page tables physical address */
-   ldr r1, Lstartup_pagetable
-   ldr r2, =(KERNVIRTADDR - KERNPHYSADDR)
+   /* Find the delta between VA and PA */
+   adr r0, Lpagetable
+   ldr r1, [r0]
+   sub r2, r1, r0
+   /* At this point: r2 = VA - PA */
+
+   /*
+* Find the physical address of the table. After these two
+* instructions:
+* r1 = va(pagetable)
+*
+* r0 = va(pagetable) - (VA - PA)
+*= va(pagetable) - VA + PA
+*= pa(pagetable)
+*/
+   ldr r1, [r0, #4]
sub r0, r1, r2
 
/*
 * Map PA == VA
 */
-   ldr r5, =(PHYSADDR)
+   /* Find the start kernels load address */
+   adr r5, _start
+   ldr r2, =(L1_S_OFFSET)
+   bic r5, r2
mov r1, r5
mov r2, r5
/* Map 64MiB, preserved over calls to build_pagetables */
@@ -165,7 +181,7 @@ Lunmapped:
 
/* Create the kernel map to jump to */
mov r1, r5
-   ldr r2, =(KERNBASE)
+   ldr r2, =(KERNVIRTADDR)
bl  build_pagetables

 #if defined(SOCDEV_PA) && defined(SOCDEV_VA)
@@ -223,16 +239,16 @@ mmu_done:
 virt_done:
mov r1, #28 /* loader info size is 28 bytes also 
second arg */
subssp, sp, r1  /* allocate arm_boot_params struct on 
stack */
-   bic sp, sp, #7  /* align stack to 8 bytes */
mov r0, sp  /* loader info pointer is first arg */
+   bic sp, sp, #7  /* align stack to 8 bytes */
str r1, [r0]/* Store length of loader info */
str r9, [r0, #4]/* Store r0 from boot loader */
str r8, [r0, #8]/* Store r1 from boot loader */
str ip, [r0, #12]   /* store r2 from boot loader */
str fp, [r0, #16]   /* store r3 from boot loader */
-   ldr r5, =KERNPHYSADDR   /* load KERNPHYSADDR as the physical 
address */
str r5, [r0, #20]   /* store the physical address */
-   ldr r5, Lstartup_pagetable
+   adr r4, Lpagetable  /* load the pagetable address */
+   ldr r5, [r4, #4]
str r5, [r0, #24]   /* store the pagetable address */
mov fp, #0  /* trace back starts here */
bl  _C_LABEL(initarm)   /* Off we go */
@@ -279,16 +295,19 @@ build_pagetables:
 
RET
 
+Lpagetable:
+   .word   .
+   .word   pagetable
+
 Lvirtaddr:
.word   KERNVIRTADDR
 Lphysaddr:
.word   KERNPHYSADDR
 Lreal_start:
.word   _start
-Lend:  
+Lend:
.word   _edata
-Lstartup_pagetable:
-   .word   pagetable
+
 #ifdef SMP
 Lstartup_pagetable_secondary:
.word   temp_pagetable
___
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: r261842 - in head/sys: conf dev/gpio

2014-02-13 Thread Nathan Whitehorn

On 02/13/14 11:08, Luiz Otavio O Souza wrote:

Author: loos
Date: Thu Feb 13 17:08:29 2014
New Revision: 261842
URL: http://svnweb.freebsd.org/changeset/base/261842

Log:
   Add an OFW GPIO compatible bus.  This allows the use of the DTS files to
   describe GPIO bindings in the system.
   
   Move the GPIOBUS lock macros to gpiobusvar.h as they are now shared between

   the OFW and the non OFW versions of GPIO bus.
   
   Export gpiobus_print_pins() so it can also be used on the OFW GPIO bus.
   
   Approved by:	adrian (mentor, implicit)


Added:
   head/sys/dev/gpio/ofw_gpiobus.c   (contents, props changed)
Modified:
   head/sys/conf/files
   head/sys/dev/gpio/gpiobus.c
   head/sys/dev/gpio/gpiobusvar.h



Added: head/sys/dev/gpio/ofw_gpiobus.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/gpio/ofw_gpiobus.c Thu Feb 13 17:08:29 2014
(r261842)
@@ -0,0 +1,338 @@
+/*-
+ * Copyright (c) 2009, Nathan Whitehorn 
+ * Copyright (c) 2013, Luiz Otavio O Souza 
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, 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 ``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 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+



is there a reason you include fdt_common.h here? Nothing here seems to 
be FDT specific, rather than for Open Firmware generally.

-Nathan
___
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: r261843 - in head: share/man/man4 sys/dev/gpio

2014-02-13 Thread Nathan Whitehorn

On 02/13/14 11:58, Luiz Otavio O Souza wrote:

Author: loos
Date: Thu Feb 13 17:58:52 2014
New Revision: 261843
URL: http://svnweb.freebsd.org/changeset/base/261843

Log:
   Add OFW support to the in tree gpio compatible devices: gpioiic(4) and
   gpioled(4).
   
   Tested on RPi and BBB (using the hardware I2C controller and gpioiic(4) for

   the I2C tests).  It was also verified for regressions on RSPRO (MIPS/ar71xx)
   used as reference for a non OFW-based system.
   
   Update the gpioled(4) and gpioiic(4) man pages with some details and

   examples about the FDT/OFW support.
   
   Some compatibility details pointed out by imp@ will follow in subsequent

   commits.
   
   Approved by:	adrian (mentor, implicit)




Is there a reason gpioled has an identify() method? Usually enumerable 
buses like OF buses wouldn't have something like that.

-Nathan

___
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: r261849 - stable/10

2014-02-13 Thread Alan Somers
Author: asomers
Date: Thu Feb 13 19:46:48 2014
New Revision: 261849
URL: http://svnweb.freebsd.org/changeset/base/261849

Log:
  MFC r261132
  
  Fix the build so -DNO_TESTS is passed in various phases that don't require
  tests in order to build or install.  Crucially, don't try to install tests
  during the lib32 install phase.  This commit supersedes r261081, which fixed
  the lib32 install phase problem, but didn't fix other phases.
  
  Submitted by: Garrett Cooper
  Reviewed by:  sjg

Modified:
  stable/10/Makefile.inc1
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/Makefile.inc1
==
--- stable/10/Makefile.inc1 Thu Feb 13 19:14:23 2014(r261848)
+++ stable/10/Makefile.inc1 Thu Feb 13 19:46:48 2014(r261849)
@@ -246,7 +246,7 @@ BMAKE=  MAKEOBJDIRPREFIX=${WORLDTMP} \
SSP_CFLAGS= \
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
-DNO_PIC -DNO_PROFILE -DNO_SHARED \
-   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
+   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
 
 # build-tools stage
 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
@@ -256,12 +256,12 @@ TMAKE=MAKEOBJDIRPREFIX=${OBJTREE} \
BOOTSTRAPPING=${OSRELDATE} \
SSP_CFLAGS= \
-DNO_LINT \
-   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
+   -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
 
 # cross-tools stage
 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-   -DWITHOUT_GDB
+   -DWITHOUT_GDB -DNO_TESTS
 
 # world stage
 WMAKEENV=  ${CROSSENV} \
@@ -399,7 +399,8 @@ LIB32WMAKEFLAGS+=   \
-DLIBRARIES_ONLY \
-DNO_CPU_CFLAGS \
-DNO_CTF \
-   -DNO_LINT
+   -DNO_LINT \
+   -DNO_TESTS
 
 LIB32WMAKE=${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \
-DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML
@@ -553,7 +554,7 @@ _libraries:
@echo "--"
${_+_}cd ${.CURDIR}; \
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
-   -DWITHOUT_MAN -DNO_PROFILE libraries
+   -DWITHOUT_MAN -DNO_PROFILE -DNO_TESTS libraries
 _depend:
@echo
@echo "--"
@@ -1494,7 +1495,12 @@ _prebuild_libs=  ${_kerberos5_lib_libasn1
${_secure_lib_libcrypto} ${_lib_libldns} \
${_secure_lib_libssh} ${_secure_lib_libssl}
 
-.if ${MK_TESTS} != "no"
+.if defined(WITH_ATF) || ${MK_TESTS} != "no"
+.if !defined(WITH_ATF)
+# Ensure that the ATF libraries will be built during make libraries, even
+# though they will have -DNO_TESTS
+MAKE+= -DWITH_ATF
+.endif
 _lib_atf=  lib/atf
 .endif
 
@@ -1863,7 +1869,7 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE}
 
 NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
-DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE \
-   -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS \
+   -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_TESTS -DNO_WARNS \
TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
CPUTYPE=${XDEV_CPUTYPE}
 
___
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: r261848 - head/sys/arm/freescale/imx

2014-02-13 Thread Ian Lepore
Author: ian
Date: Thu Feb 13 19:14:23 2014
New Revision: 261848
URL: http://svnweb.freebsd.org/changeset/base/261848

Log:
  Remove a couple obsolete function declarations.

Modified:
  head/sys/arm/freescale/imx/imx_machdep.h

Modified: head/sys/arm/freescale/imx/imx_machdep.h
==
--- head/sys/arm/freescale/imx/imx_machdep.hThu Feb 13 19:09:04 2014
(r261847)
+++ head/sys/arm/freescale/imx/imx_machdep.hThu Feb 13 19:14:23 2014
(r261848)
@@ -33,7 +33,6 @@
 
 /* Common functions, implemented in imx_machdep.c. */
 
-void imx_devmap_addentry(vm_paddr_t _pa, vm_size_t _sz);
 void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys)  __attribute__((__noreturn__));
 
 /* From here down, routines are implemented in imxNN_machdep.c. */
@@ -57,8 +56,6 @@ void imx_wdog_cpu_reset(vm_offset_t _wdc
 u_int imx_soc_type(void);
 u_int imx_soc_family(void);
 
-void imx_devmap_init(void);
-
 /*
  * We need a clock management system that works across unrelated SoCs and
  * devices.  For now, to keep imx development moving, define some barebones
___
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: r261847 - head/sys/netinet6

2014-02-13 Thread Alexander V. Chernikov
Author: melifaro
Date: Thu Feb 13 19:09:04 2014
New Revision: 261847
URL: http://svnweb.freebsd.org/changeset/base/261847

Log:
  Further simplify nd6_output_lle.
  Currently we have 3 usage patterns:
  1) nd6_output (most traffic flow, no lle supplied, lle RLOCK sufficient)
  2) corner cases for output (no lle, STALE lle, so on). lle WLOCK needed.
  3) nd* iunternal machinery (WLOCK'ed lle provided, perform packet queing).
  
  We separate case 1 and implement it inside its only customer - nd6_output.
  This leads to some code duplication (especialy SEND stuff, which should be
  hooked to output in a different way), but simplifies locking and control
  flow logic fir nd6_output_lle.
  
  Reviewed by:  ae
  MFC after:3 weeks
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Thu Feb 13 18:51:37 2014(r261846)
+++ head/sys/netinet6/nd6.c Thu Feb 13 19:09:04 2014(r261847)
@@ -1832,34 +1832,114 @@ nd6_slowtimo(void *arg)
CURVNET_RESTORE();
 }
 
+/*
+ * IPv6 packet output - light version.
+ * Checks if destination LLE exists and is in proper state
+ * (e.g no modification required). If not true, fall back to
+ * "heavy" version.
+ */
 int
-nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
+nd6_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m,
 struct sockaddr_in6 *dst, struct rtentry *rt0)
 {
+   struct llentry *ln = NULL;
+   int error = 0;
+
+   /* discard the packet if IPv6 operation is disabled on the interface */
+   if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)) {
+   m_freem(m);
+   return (ENETDOWN); /* better error? */
+   }
+
+   if (IN6_IS_ADDR_MULTICAST(&dst->sin6_addr))
+   goto sendpkt;
+
+   if (nd6_need_cache(ifp) == 0)
+   goto sendpkt;
+
+   IF_AFDATA_RLOCK(ifp);
+   ln = nd6_lookup(&dst->sin6_addr, 0, ifp);
+   IF_AFDATA_RUNLOCK(ifp);
+
+   /*
+* Perform fast path for the following cases:
+* 1) lle state is REACHABLE
+* 2) lle state is DELAY (NS message sentNS message sent)
+*
+* Every other case involves lle modification, so we handle
+* them separately.
+*/
+   if (ln == NULL || (ln->ln_state != ND6_LLINFO_REACHABLE &&
+   ln->ln_state != ND6_LLINFO_DELAY)) {
+   /* Fall back to slow processing path */
+   if (ln != NULL)
+   LLE_RUNLOCK(ln);
+   return (nd6_output_lle(ifp, origifp, m, dst, rt0, NULL, NULL));
+   }
+
+sendpkt:
+   if (ln != NULL)
+   LLE_RUNLOCK(ln);
+
+#ifdef MAC
+   mac_netinet6_nd6_send(ifp, m);
+#endif
+
+   /*
+* If called from nd6_ns_output() (NS), nd6_na_output() (NA),
+* icmp6_redirect_output() (REDIRECT) or from rip6_output() (RS, RA
+* as handled by rtsol and rtadvd), mbufs will be tagged for SeND
+* to be diverted to user space.  When re-injected into the kernel,
+* send_output() will directly dispatch them to the outgoing interface.
+*/
+   if (send_sendso_input_hook != NULL) {
+   struct m_tag *mtag;
+   struct ip6_hdr *ip6;
+   int ip6len;
+   mtag = m_tag_find(m, PACKET_TAG_ND_OUTGOING, NULL);
+   if (mtag != NULL) {
+   ip6 = mtod(m, struct ip6_hdr *);
+   ip6len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen);
+   /* Use the SEND socket */
+   error = send_sendso_input_hook(m, ifp, SND_OUT,
+   ip6len);
+   /* -1 == no app on SEND socket */
+   if (error == 0 || error != -1)
+   return (error);
+   }
+   }
+
+   m_clrprotoflags(m); /* Avoid confusing lower layers. */
+   IP_PROBE(send, NULL, NULL, mtod(m, struct ip6_hdr *), ifp, NULL,
+   mtod(m, struct ip6_hdr *));
 
-   return (nd6_output_lle(ifp, origifp, m0, dst, rt0, NULL, NULL));
+   if ((ifp->if_flags & IFF_LOOPBACK) == 0)
+   origifp = ifp;
+   
+   error = (*ifp->if_output)(origifp, m, (struct sockaddr *)dst, NULL);
+   return (error);
 }
 
 
 /*
- * Note that I'm not enforcing any global serialization
- * lle state or asked changes here as the logic is too
- * complicated to avoid having to always acquire an exclusive
- * lock
- * KMM
+ * Output IPv6 packet - heavy version.
+ * Function assume that either
+ * 1) destination LLE does not exist, is invalid or stale, so
+ *   ND6_EXCLUSIVE lock needs to be acquired
+ * 2) destination lle is provided (with ND6_EXCLUSIVE lock),
+ *   in that case packets are queued in &chain.
  *
  */
 int
-nd6_output_lle(struct ifnet *ifp, struct ifnet *origi

svn commit: r261846 - in head/sys: arm/conf boot/fdt/dts

2014-02-13 Thread Luiz Otavio O Souza
Author: loos
Date: Thu Feb 13 18:51:37 2014
New Revision: 261846
URL: http://svnweb.freebsd.org/changeset/base/261846

Log:
  Make the gpioled(4) work out of the box on BBB.
  
  Add gpioled(4) to BEAGLEBONE kernel and add the description of the four
  on-board leds of beaglebone-black to its DTS file.
  
  Approved by:  adrian (mentor, implicit)

Modified:
  head/sys/arm/conf/BEAGLEBONE
  head/sys/boot/fdt/dts/beaglebone-black.dts

Modified: head/sys/arm/conf/BEAGLEBONE
==
--- head/sys/arm/conf/BEAGLEBONEThu Feb 13 18:42:23 2014
(r261845)
+++ head/sys/arm/conf/BEAGLEBONEThu Feb 13 18:51:37 2014
(r261846)
@@ -101,6 +101,7 @@ device  am335x_pmic # AM335x Power 
Mana
 
 # GPIO
 device gpio
+device gpioled
 
 # USB support
 device usb

Modified: head/sys/boot/fdt/dts/beaglebone-black.dts
==
--- head/sys/boot/fdt/dts/beaglebone-black.dts  Thu Feb 13 18:42:23 2014
(r261845)
+++ head/sys/boot/fdt/dts/beaglebone-black.dts  Thu Feb 13 18:51:37 2014
(r261846)
@@ -147,6 +147,30 @@
}
};
 
+   leds {
+   compatible = "gpio-leds";
+
+   led1 {
+   gpios = <&GPIO 53 2 0>;
+   name = "led1";
+   };
+
+   led2 {
+   gpios = <&GPIO 54 2 0>;
+   name = "led2";
+   };
+
+   led3 {
+   gpios = <&GPIO 55 2 0>;
+   name = "led3";
+   };
+
+   led4 {
+   gpios = <&GPIO 56 2 0>;
+   name = "led4";
+   };
+   };
+
chosen {
stdin = "uart0";
stdout = "uart0";
___
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: r261845 - in head/sys/arm: broadcom/bcm2835 ti

2014-02-13 Thread Luiz Otavio O Souza
Author: loos
Date: Thu Feb 13 18:42:23 2014
New Revision: 261845
URL: http://svnweb.freebsd.org/changeset/base/261845

Log:
  Allow the use of the OFW GPIO bus for ti_gpio and bcm2835_gpio.  With this
  change the gpio children can be described as directly connected to the GPIO
  controller without the need of describing the OFW GPIO bus itself on the
  DTS file.
  
  With this commit the OFW GPIO bus is fully functional on BBB and RPi.
  
  GPIO controllers which want to use the OFW GPIO bus will need similar
  changes.
  
  Approved by:  adrian (mentor, implicit)

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
  head/sys/arm/ti/ti_gpio.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.cThu Feb 13 18:22:49 
2014(r261844)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.cThu Feb 13 18:42:23 
2014(r261845)
@@ -766,6 +766,14 @@ bcm_gpio_detach(device_t dev)
return (EBUSY);
 }
 
+static phandle_t
+bcm_gpio_get_node(device_t bus, device_t dev)
+{
+
+   /* We only have one child, the GPIO bus, which needs our own node. */
+   return (ofw_bus_get_node(bus));
+}
+
 static device_method_t bcm_gpio_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, bcm_gpio_probe),
@@ -782,6 +790,9 @@ static device_method_t bcm_gpio_methods[
DEVMETHOD(gpio_pin_set, bcm_gpio_pin_set),
DEVMETHOD(gpio_pin_toggle,  bcm_gpio_pin_toggle),
 
+   /* ofw_bus interface */
+   DEVMETHOD(ofw_bus_get_node, bcm_gpio_get_node),
+
DEVMETHOD_END
 };
 

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Thu Feb 13 18:22:49 2014(r261844)
+++ head/sys/arm/ti/ti_gpio.c   Thu Feb 13 18:42:23 2014(r261845)
@@ -792,6 +792,14 @@ ti_gpio_detach(device_t dev)
return(0);
 }
 
+static phandle_t
+ti_gpio_get_node(device_t bus, device_t dev)
+{
+
+   /* We only have one child, the GPIO bus, which needs our own node. */
+   return (ofw_bus_get_node(bus));
+}
+
 static device_method_t ti_gpio_methods[] = {
DEVMETHOD(device_probe, ti_gpio_probe),
DEVMETHOD(device_attach, ti_gpio_attach),
@@ -806,6 +814,10 @@ static device_method_t ti_gpio_methods[]
DEVMETHOD(gpio_pin_get, ti_gpio_pin_get),
DEVMETHOD(gpio_pin_set, ti_gpio_pin_set),
DEVMETHOD(gpio_pin_toggle, ti_gpio_pin_toggle),
+
+   /* ofw_bus interface */
+   DEVMETHOD(ofw_bus_get_node, ti_gpio_get_node),
+
{0, 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: r261844 - in head/sys/dev: iicbus ofw

2014-02-13 Thread Luiz Otavio O Souza
Author: loos
Date: Thu Feb 13 18:22:49 2014
New Revision: 261844
URL: http://svnweb.freebsd.org/changeset/base/261844

Log:
  Allow the use of OFW I2C bus together with iicbb(4) on OFW-based systems.
  
  This change makes ofw_iicbus attach to iicbb(4) controllers in addition to
  the already supported i2c host bridges (iichb).
  
  On iicbb(4) allow the direct access of the OFW parent node by its children,
  so they can be directly attached to iicbb(4) node on the DTS without the
  need of describing the i2c bus.
  
  Approved by:  adrian (mentor, implicit)

Modified:
  head/sys/dev/iicbus/iicbb.c
  head/sys/dev/ofw/ofw_iicbus.c

Modified: head/sys/dev/iicbus/iicbb.c
==
--- head/sys/dev/iicbus/iicbb.c Thu Feb 13 17:58:52 2014(r261843)
+++ head/sys/dev/iicbus/iicbb.c Thu Feb 13 18:22:49 2014(r261844)
@@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$");
  *
  */
 
+#include "opt_platform.h"
+
 #include 
 #include 
 #include 
@@ -50,6 +52,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef FDT
+#include 
+#include 
+#include 
+#endif
 
 #include 
 #include 
@@ -77,6 +84,9 @@ static int iicbb_write(device_t, const c
 static int iicbb_read(device_t, char *, int, int *, int, int);
 static int iicbb_reset(device_t, u_char, u_char, u_char *);
 static int iicbb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs);
+#ifdef FDT
+static phandle_t iicbb_get_node(device_t, device_t);
+#endif
 
 static device_method_t iicbb_methods[] = {
/* device interface */
@@ -98,6 +108,11 @@ static device_method_t iicbb_methods[] =
DEVMETHOD(iicbus_reset, iicbb_reset),
DEVMETHOD(iicbus_transfer,  iicbb_transfer),
 
+#ifdef FDT
+   /* ofw_bus interface */
+   DEVMETHOD(ofw_bus_get_node, iicbb_get_node),
+#endif
+
{ 0, 0 }
 };
 
@@ -154,6 +169,16 @@ iicbb_detach(device_t dev)
return (0);
 }
 
+#ifdef FDT
+static phandle_t
+iicbb_get_node(device_t bus, device_t dev)
+{
+
+   /* We only have one child, the I2C bus, which needs our own node. */
+   return (ofw_bus_get_node(bus));
+}
+#endif
+
 static void
 iicbb_child_detached( device_t dev, device_t child )
 {

Modified: head/sys/dev/ofw/ofw_iicbus.c
==
--- head/sys/dev/ofw/ofw_iicbus.c   Thu Feb 13 17:58:52 2014
(r261843)
+++ head/sys/dev/ofw/ofw_iicbus.c   Thu Feb 13 18:22:49 2014
(r261844)
@@ -80,6 +80,7 @@ static devclass_t ofwiicbus_devclass;
 
 DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods,
 sizeof(struct iicbus_softc), iicbus_driver);
+DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0);
 DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0);
 MODULE_VERSION(ofw_iicbus, 1);
 MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1);
___
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: r261843 - in head: share/man/man4 sys/dev/gpio

2014-02-13 Thread Luiz Otavio O Souza
Author: loos
Date: Thu Feb 13 17:58:52 2014
New Revision: 261843
URL: http://svnweb.freebsd.org/changeset/base/261843

Log:
  Add OFW support to the in tree gpio compatible devices: gpioiic(4) and
  gpioled(4).
  
  Tested on RPi and BBB (using the hardware I2C controller and gpioiic(4) for
  the I2C tests).  It was also verified for regressions on RSPRO (MIPS/ar71xx)
  used as reference for a non OFW-based system.
  
  Update the gpioled(4) and gpioiic(4) man pages with some details and
  examples about the FDT/OFW support.
  
  Some compatibility details pointed out by imp@ will follow in subsequent
  commits.
  
  Approved by:  adrian (mentor, implicit)

Modified:
  head/share/man/man4/gpioiic.4
  head/share/man/man4/gpioled.4
  head/sys/dev/gpio/gpioiic.c
  head/sys/dev/gpio/gpioled.c

Modified: head/share/man/man4/gpioiic.4
==
--- head/share/man/man4/gpioiic.4   Thu Feb 13 17:08:29 2014
(r261842)
+++ head/share/man/man4/gpioiic.4   Thu Feb 13 17:58:52 2014
(r261843)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 5, 2013
+.Dd February 13, 2014
 .Dt GPIOIIC 4
 .Os
 .Sh NAME
@@ -65,7 +65,7 @@ This is a bitmask of the pins on the
 that are to be used for SCLOCK and SDATA from the GPIO IIC
 bit-banging bus.
 To configure pin 0 and 7, use the bitmask of
-1001 and convert it to a hexadecimal value of 0x0081.
+0b1001 and convert it to a hexadecimal value of 0x0081.
 Please note that this mask should only ever have two bits set
 (any others bits - i.e., pins - will be ignored).
 .It Va hint.gpioiic.%d.scl
@@ -73,13 +73,77 @@ Indicates which bit in the
 .Va hint.gpioiic.%d.pins
 should be used as the SCLOCK
 source.
+Optional, defaults to 0.
 .It Va hint.gpioiic.%d.sda
 Indicates which bit in the
 .Va hint.gpioiic.%d.pins
 should be used as the SDATA
 source.
+Optional, defaults to 1.
+.El
+.Pp
+On a
+.Xr FDT 4
+based system, like
+.Li ARM , the dts part for a
+.Nm gpioiic
+device usually looks like:
+.Bd -literal
+gpio: gpio {
+
+   gpio-controller;
+   ...
+
+   gpioiic0 {
+   compatible = "gpioiic";
+   /*
+* Attach to GPIO pins 21 and 22.  Set them
+* initially as inputs.
+*/
+   gpios = <&gpio 21 1 0
+&gpio 22 1 0>;
+   scl = <0>;  /* GPIO pin 21 - optional */
+   sda = <1>;  /* GPIO pin 22 - optional */
+
+   /* This is an example of a gpioiic child. */
+   gpioiic-child0 {
+   compatible = "lm75";
+   i2c-address = <0x4f>;
+   };
+   };
+};
+.Ed
+.Pp
+Where:
+.Bl -tag -width ".Va compatible"
+.It Va compatible
+Should always be set to "gpioiic".
+.It Va gpios
+The
+.Va gpios
+property indicates which GPIO pins should be used for SCLOCK and SDATA
+on the GPIO IIC bit-banging bus.
+For more details about the
+.Va gpios
+property, please consult
+.Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt .
+.It Va scl
+The
+.Va scl
+option indicates which bit in the
+.Va gpios
+should be used as the SCLOCK source.
+Optional, defaults to 0.
+.It Va sda
+The
+.Va sda
+option indicates which bit in the
+.Va gpios
+should be used as the SDATA source.
+Optional, defaults to 1.
 .El
 .Sh SEE ALSO
+.Xr fdt 4 ,
 .Xr gpio 4 ,
 .Xr gpioled 4 ,
 .Xr iic 4 ,

Modified: head/share/man/man4/gpioled.4
==
--- head/share/man/man4/gpioled.4   Thu Feb 13 17:08:29 2014
(r261842)
+++ head/share/man/man4/gpioled.4   Thu Feb 13 17:58:52 2014
(r261843)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 5, 2013
+.Dd February 13, 2014
 .Dt GPIOLED 4
 .Os
 .Sh NAME
@@ -68,7 +68,75 @@ Which pin on the GPIO interface to map t
 Please note that this mask should only ever have one bit set
 (any others bits - i.e., pins - will be ignored).
 .El
+.Pp
+On a
+.Xr FDT 4
+based system, like
+.Li ARM , the dts part for a
+.Nm gpioled
+device usually looks like:
+.Bd -literal
+gpio: gpio {
+
+   gpio-controller;
+   ...
+
+   led0 {
+   compatible = "gpioled";
+   gpios = <&gpio 16 2 0>; /* GPIO pin 16. */
+   name = "ok";
+   };
+
+   led1 {
+   compatible = "gpioled";
+   gpios = <&gpio 17 2 0>; /* GPIO pin 17. */
+   name = "user-led1";
+   };
+};
+.Ed
+.Pp
+And optionally, you can choose combine all the leds under a single
+.Dq gpio-leds
+compatible node:
+.Bd -literal
+simplebus0 {
+
+   ...
+
+   leds {
+   compatible = "gpio-leds";
+
+   led0 {
+   gpios = <&gpio 16 2 0>;
+   name = "ok"
+   };
+
+   led1 {
+   gpios = <&gpio 17 2 0>;
+   name

svn commit: r261842 - in head/sys: conf dev/gpio

2014-02-13 Thread Luiz Otavio O Souza
Author: loos
Date: Thu Feb 13 17:08:29 2014
New Revision: 261842
URL: http://svnweb.freebsd.org/changeset/base/261842

Log:
  Add an OFW GPIO compatible bus.  This allows the use of the DTS files to
  describe GPIO bindings in the system.
  
  Move the GPIOBUS lock macros to gpiobusvar.h as they are now shared between
  the OFW and the non OFW versions of GPIO bus.
  
  Export gpiobus_print_pins() so it can also be used on the OFW GPIO bus.
  
  Approved by:  adrian (mentor, implicit)

Added:
  head/sys/dev/gpio/ofw_gpiobus.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/gpio/gpiobus.c
  head/sys/dev/gpio/gpiobusvar.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Feb 13 16:50:08 2014(r261841)
+++ head/sys/conf/files Thu Feb 13 17:08:29 2014(r261842)
@@ -1400,6 +1400,7 @@ dev/gpio/gpioiic.coptional gpioiic
 dev/gpio/gpioled.c optional gpioled
 dev/gpio/gpio_if.m optional gpio
 dev/gpio/gpiobus_if.m  optional gpio
+dev/gpio/ofw_gpiobus.c optional fdt gpio
 dev/hatm/if_hatm.c optional hatm pci
 dev/hatm/if_hatm_intr.coptional hatm pci
 dev/hatm/if_hatm_ioctl.c   optional hatm pci

Modified: head/sys/dev/gpio/gpiobus.c
==
--- head/sys/dev/gpio/gpiobus.c Thu Feb 13 16:50:08 2014(r261841)
+++ head/sys/dev/gpio/gpiobus.c Thu Feb 13 17:08:29 2014(r261842)
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
 #include "gpio_if.h"
 #include "gpiobus_if.h"
 
-static void gpiobus_print_pins(struct gpiobus_ivar *);
 static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int);
 static int gpiobus_probe(device_t);
 static int gpiobus_attach(device_t);
@@ -73,17 +72,7 @@ static int gpiobus_pin_set(device_t, dev
 static int gpiobus_pin_get(device_t, device_t, uint32_t, unsigned int*);
 static int gpiobus_pin_toggle(device_t, device_t, uint32_t);
 
-#defineGPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
-#defineGPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
-#defineGPIOBUS_LOCK_INIT(_sc) \
-   mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \
-   "gpiobus", MTX_DEF)
-#defineGPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
-#defineGPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
-#defineGPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, 
MA_NOTOWNED);
-
-
-static void
+void
 gpiobus_print_pins(struct gpiobus_ivar *devi)
 {
int range_start, range_stop, need_coma;

Modified: head/sys/dev/gpio/gpiobusvar.h
==
--- head/sys/dev/gpio/gpiobusvar.h  Thu Feb 13 16:50:08 2014
(r261841)
+++ head/sys/dev/gpio/gpiobusvar.h  Thu Feb 13 17:08:29 2014
(r261842)
@@ -30,12 +30,25 @@
 #ifndef__GPIOBUS_H__
 #define__GPIOBUS_H__
 
+#include "opt_platform.h"
+
 #include 
 #include 
 #include 
 
-#define GPIOBUS_IVAR(d) (struct gpiobus_ivar *) device_get_ivars(d)
-#define GPIOBUS_SOFTC(d) (struct gpiobus_softc *) device_get_softc(d)
+#ifdef FDT
+#include 
+#endif
+
+#defineGPIOBUS_IVAR(d) (struct gpiobus_ivar *) device_get_ivars(d)
+#defineGPIOBUS_SOFTC(d) (struct gpiobus_softc *) device_get_softc(d)
+#defineGPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
+#defineGPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
+#defineGPIOBUS_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx,   
\
+   device_get_nameunit(_sc->sc_dev), "gpiobus", MTX_DEF)
+#defineGPIOBUS_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx)
+#defineGPIOBUS_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED)
+#defineGPIOBUS_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, 
MA_NOTOWNED)
 
 struct gpiobus_softc
 {
@@ -54,4 +67,11 @@ struct gpiobus_ivar
uint32_t*pins;  /* pins map */
 };
 
+void gpiobus_print_pins(struct gpiobus_ivar *);
+#ifdef FDT
+device_t ofw_gpiobus_add_fdt_child(device_t, phandle_t);
+#endif
+
+extern driver_t gpiobus_driver;
+
 #endif /* __GPIOBUS_H__ */

Added: head/sys/dev/gpio/ofw_gpiobus.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/gpio/ofw_gpiobus.c Thu Feb 13 17:08:29 2014
(r261842)
@@ -0,0 +1,338 @@
+/*-
+ * Copyright (c) 2009, Nathan Whitehorn 
+ * Copyright (c) 2013, Luiz Otavio O Souza 
+ * Copyright (c) 2013 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and 

svn commit: r261841 - head/sys/arm/at91

2014-02-13 Thread Warner Losh
Author: imp
Date: Thu Feb 13 16:50:08 2014
New Revision: 261841
URL: http://svnweb.freebsd.org/changeset/base/261841

Log:
  Honor the disabled status by only grabbing resources and returning
  when running under FDT.

Modified:
  head/sys/arm/at91/at91_spi.c
  head/sys/arm/at91/at91_twi.c

Modified: head/sys/arm/at91/at91_spi.c
==
--- head/sys/arm/at91/at91_spi.cThu Feb 13 16:38:00 2014
(r261840)
+++ head/sys/arm/at91/at91_spi.cThu Feb 13 16:50:08 2014
(r261841)
@@ -131,6 +131,15 @@ at91_spi_attach(device_t dev)
if (err)
goto out;
 
+#ifdef FDT
+   /*
+* Disable devices need to hold their resources, so return now and not 
attach
+* the spibus, setup interrupt handlers, etc.
+*/
+   if (!ofw_bus_status_okay(dev))
+   return 0;
+#endif
+
/*
 * Set up the hardware.
 */

Modified: head/sys/arm/at91/at91_twi.c
==
--- head/sys/arm/at91/at91_twi.cThu Feb 13 16:38:00 2014
(r261840)
+++ head/sys/arm/at91/at91_twi.cThu Feb 13 16:50:08 2014
(r261841)
@@ -134,6 +134,15 @@ at91_twi_attach(device_t dev)
 
AT91_TWI_LOCK_INIT(sc);
 
+#ifdef FDT
+   /*
+* Disable devices need to hold their resources, so return now and not 
attach
+* the iicbus, setup interrupt handlers, etc.
+*/
+   if (!ofw_bus_status_okay(dev))
+   return 0;
+#endif
+
/*
 * Activate the interrupt
 */
___
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: r261838 - head/share/man/man4

2014-02-13 Thread Christian Brueffer
Author: brueffer
Date: Thu Feb 13 16:13:31 2014
New Revision: 261838
URL: http://svnweb.freebsd.org/changeset/base/261838

Log:
  Add a deprecation notice to nve.4 and Xref nfe.4.
  
  MFC after:3 days

Modified:
  head/share/man/man4/nve.4

Modified: head/share/man/man4/nve.4
==
--- head/share/man/man4/nve.4   Thu Feb 13 15:47:41 2014(r261837)
+++ head/share/man/man4/nve.4   Thu Feb 13 16:13:31 2014(r261838)
@@ -26,13 +26,21 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 16, 2011
+.Dd February 13, 2014
 .Dt NVE 4
 .Os
 .Sh NAME
 .Nm nve
 .Nd "NVIDIA nForce MCP Networking Adapter device driver"
 .Sh SYNOPSIS
+.Sy Warning:
+This driver is deprecated and will not be available in
+.Fx 11.0
+and later.
+Please consider using the
+.Xr nfe 4
+driver instead.
+.Pp
 To compile this driver into the kernel,
 place the following lines in your
 kernel configuration file:
@@ -119,6 +127,7 @@ the network connection (cable).
 .Xr arp 4 ,
 .Xr miibus 4 ,
 .Xr netintro 4 ,
+.Xr nfe 4 ,
 .Xr ng_ether 4 ,
 .Xr rgephy 4 ,
 .Xr ifconfig 8
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r261837 - head/sys/arm/at91

2014-02-13 Thread Warner Losh
Author: imp
Date: Thu Feb 13 15:47:41 2014
New Revision: 261837
URL: http://svnweb.freebsd.org/changeset/base/261837

Log:
  Fix board ID too...

Modified:
  head/sys/arm/at91/board_eb9200.c

Modified: head/sys/arm/at91/board_eb9200.c
==
--- head/sys/arm/at91/board_eb9200.cThu Feb 13 15:46:08 2014
(r261836)
+++ head/sys/arm/at91/board_eb9200.cThu Feb 13 15:47:41 2014
(r261837)
@@ -65,4 +65,4 @@ board_init(void)
return (at91_ramsize());
 }
 
-ARM_BOARD(KB9200, "Embest ATEB9200")
+ARM_BOARD(ATEB9200, "Embest ATEB9200")
___
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: r261836 - head/sys/arm/at91

2014-02-13 Thread Warner Losh
Author: imp
Date: Thu Feb 13 15:46:08 2014
New Revision: 261836
URL: http://svnweb.freebsd.org/changeset/base/261836

Log:
  Fix board name.

Modified:
  head/sys/arm/at91/board_eb9200.c

Modified: head/sys/arm/at91/board_eb9200.c
==
--- head/sys/arm/at91/board_eb9200.cThu Feb 13 14:10:44 2014
(r261835)
+++ head/sys/arm/at91/board_eb9200.cThu Feb 13 15:46:08 2014
(r261836)
@@ -65,4 +65,4 @@ board_init(void)
return (at91_ramsize());
 }
 
-ARM_BOARD(KB9200, "Kwikbyte KB920x")
+ARM_BOARD(KB9200, "Embest ATEB9200")
___
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: r261801 - head/contrib/libc++/include

2014-02-13 Thread Alexander Kabaev
On Thu, 13 Feb 2014 10:11:27 +
David Chisnall  wrote:

> On 13 Feb 2014, at 01:04, Alexander Kabaev  wrote:
> 
> > The refusal to use tools that are there precisely to help to help
> > with the binary compatibility in favor of mindless library bumps is
> > just sad.
> 
> Perhaps you could share with the class.  What is the correct way of
> solving this problem?  
> 
> For those just joining the discussion, the issue is that std::pair
> was originally declared with an explicit constructor and should have
> an implicit constructor, which has a different calling convention.
> This means that we can't share the two std::pair implementations
> across libraries, because they will try to call the constructor with
> the wrong arguments.  Because of templates and C++ name mangling,
> this ends up being propagated into most libraries that link against
> libc++, and calling from one with the old definition to one with the
> new definition end up causing segfaults (if we're lucky - I think the
> symptom that we're seeing is actually dereferencing a junk value in a
> register, so it may cause random memory writes, but I'd have to check
> the ABI).  
> 
> Given that neither redeclaring the new std::pair in a new namespace,
> nor exporting both constructor symbols using symbol versioning (the
> two approaches that we've already discussed) will work, what are the
> tools that apparently we're refusing to use that will work?
> 
> David

OK, I think the confusion has started because reported to this as an ABI
incompatibility within libc++ itself, which is not the case here.

When calling convention of a public symbol changes, one can put the old
definition under the compatibility version that is only available for
runtime binding, this allowing old binaries to work and that is what I
was referring to. Unfortunately, that won't work in this case because
libc++ proper does NOT export any symbols with 'pair' in them, so it is
not affected by the ABI breakage itself. What libc++ developers did is
they exported ABI breakage into every binary that was compiled with
different revisions on libc++ _header_ files, not linked with the
library proper. Using the library major version as a circumstantial
evidence indicating header versions binary was compiled with might work
then, though is not 100% reliable. Theoretically one can compile the
binary that uses std::pair template but does not record libc++ as the
runtime dependency. Still, that is better than nothing.

ABI stability and C++ apparently should be mentioned in the same
sentence, unless there's also a 'pipe dream' in it. And you do deserve
an apology for my remark. 

-- 
Alexander Kabaev


signature.asc
Description: PGP signature


svn commit: r261835 - head/sys/netinet6

2014-02-13 Thread Andrey V. Elsukov
Author: ae
Date: Thu Feb 13 14:10:44 2014
New Revision: 261835
URL: http://svnweb.freebsd.org/changeset/base/261835

Log:
  Drop packets to multicast address whose scop field contains the
  reserved value 0.
  
  MFC after:1 week
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==
--- head/sys/netinet6/ip6_input.c   Thu Feb 13 13:11:34 2014
(r261834)
+++ head/sys/netinet6/ip6_input.c   Thu Feb 13 14:10:44 2014
(r261835)
@@ -547,7 +547,18 @@ ip6_input(struct mbuf *m)
in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
goto bad;
}
-
+   if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) &&
+   IPV6_ADDR_MC_SCOPE(&ip6->ip6_dst) == 0) {
+   /*
+* RFC4291 2.7:
+* Nodes must not originate a packet to a multicast address
+* whose scop field contains the reserved value 0; if such
+* a packet is received, it must be silently dropped.
+*/
+   IP6STAT_INC(ip6s_badscope);
+   in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
+   goto bad;
+   }
 #ifdef ALTQ
if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) {
/* packet is dropped by traffic conditioner */
___
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: r261834 - in head: share/man/man5 usr.sbin/jail

2014-02-13 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Thu Feb 13 13:11:34 2014
New Revision: 261834
URL: http://svnweb.freebsd.org/changeset/base/261834

Log:
  Bump .Dd forgotten in r261832.
  
  MFC after:2 weeks

Modified:
  head/share/man/man5/rc.conf.5
  head/usr.sbin/jail/jail.conf.5

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Thu Feb 13 12:53:57 2014
(r261833)
+++ head/share/man/man5/rc.conf.5   Thu Feb 13 13:11:34 2014
(r261834)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 25, 2013
+.Dd February 13, 2014
 .Dt RC.CONF 5
 .Os
 .Sh NAME

Modified: head/usr.sbin/jail/jail.conf.5
==
--- head/usr.sbin/jail/jail.conf.5  Thu Feb 13 12:53:57 2014
(r261833)
+++ head/usr.sbin/jail/jail.conf.5  Thu Feb 13 13:11:34 2014
(r261834)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 23, 2012
+.Dd February 13, 2014
 .Dt JAIL.CONF 5
 .Os
 .Sh NAME
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r261833 - head/usr.sbin/jail

2014-02-13 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Thu Feb 13 12:53:57 2014
New Revision: 261833
URL: http://svnweb.freebsd.org/changeset/base/261833

Log:
  Add commas (,) to the list in the SEE ALSO section, to match most other
  manuals.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/jail/jail.conf.5

Modified: head/usr.sbin/jail/jail.conf.5
==
--- head/usr.sbin/jail/jail.conf.5  Thu Feb 13 12:52:26 2014
(r261832)
+++ head/usr.sbin/jail/jail.conf.5  Thu Feb 13 12:53:57 2014
(r261833)
@@ -206,9 +206,9 @@ bar {
 }
 .Ed
 .Sh SEE ALSO
-.Xr jail_set 2
-.Xr rc.conf 5
-.Xr jail 8
+.Xr jail_set 2 ,
+.Xr rc.conf 5 ,
+.Xr jail 8 ,
 .Xr jls 8
 .Sh HISTORY
 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: r261832 - in head: share/man/man5 usr.sbin/jail

2014-02-13 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Thu Feb 13 12:52:26 2014
New Revision: 261832
URL: http://svnweb.freebsd.org/changeset/base/261832

Log:
  Add cross references between rc.conf(5) and jail.conf(5).
  
  MFC after:2 weeks

Modified:
  head/share/man/man5/rc.conf.5
  head/usr.sbin/jail/jail.conf.5

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Thu Feb 13 10:11:14 2014
(r261831)
+++ head/share/man/man5/rc.conf.5   Thu Feb 13 12:52:26 2014
(r261832)
@@ -4462,6 +4462,7 @@ The default is 30.
 .Xr fstab 5 ,
 .Xr ipf 5 ,
 .Xr ipnat 5 ,
+.Xr jail.conf 5 ,
 .Xr motd 5 ,
 .Xr newsyslog.conf 5 ,
 .Xr pf.conf 5 ,

Modified: head/usr.sbin/jail/jail.conf.5
==
--- head/usr.sbin/jail/jail.conf.5  Thu Feb 13 10:11:14 2014
(r261831)
+++ head/usr.sbin/jail/jail.conf.5  Thu Feb 13 12:52:26 2014
(r261832)
@@ -207,6 +207,7 @@ bar {
 .Ed
 .Sh SEE ALSO
 .Xr jail_set 2
+.Xr rc.conf 5
 .Xr jail 8
 .Xr jls 8
 .Sh HISTORY
___
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: r261801 - head/contrib/libc++/include

2014-02-13 Thread Stefan Farfeleder
On Wed, Feb 12, 2014 at 06:14:50PM +, Dimitry Andric wrote:
> Author: dim
> Date: Wed Feb 12 18:14:49 2014
> New Revision: 261801
> URL: http://svnweb.freebsd.org/changeset/base/261801
> 
> Log:
>   An ABI incompatibility crept into the libc++ 3.4 import in r261283.  It
>   was caused by upstream libc++ commit r194536, which aimed to make the
>   headers more standards-compliant, by making std::pair's copy constructor
>   trivial.  Unfortunately, this could cause certain C++ applications using
>   shared libraries built against the previous version of libc++ to crash.
>   
>   Fix the ABI incompatibility by making std::pair's copy constructor
>   non-trivial again.
>   
>   Please note: Any C++ applications or shared libraries built with libc++
>   between r261283 and this revision should be recompiled.

Thanks!
___
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: r261801 - head/contrib/libc++/include

2014-02-13 Thread David Chisnall
On 13 Feb 2014, at 01:04, Alexander Kabaev  wrote:

> The refusal to use tools that are there precisely to help to help with
> the binary compatibility in favor of mindless library bumps is just sad.

Perhaps you could share with the class.  What is the correct way of solving 
this problem?  

For those just joining the discussion, the issue is that std::pair was 
originally declared with an explicit constructor and should have an implicit 
constructor, which has a different calling convention.  This means that we 
can't share the two std::pair implementations across libraries, because they 
will try to call the constructor with the wrong arguments.  Because of 
templates and C++ name mangling, this ends up being propagated into most 
libraries that link against libc++, and calling from one with the old 
definition to one with the new definition end up causing segfaults (if we're 
lucky - I think the symptom that we're seeing is actually dereferencing a junk 
value in a register, so it may cause random memory writes, but I'd have to 
check the ABI).  

Given that neither redeclaring the new std::pair in a new namespace, nor 
exporting both constructor symbols using symbol versioning (the two approaches 
that we've already discussed) will work, what are the tools that apparently 
we're refusing to use that will work?

David

___
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: r261828 - in stable/10: sbin/dhclient tools/regression/security/cap_test

2014-02-13 Thread Christian Brueffer
Author: brueffer
Date: Thu Feb 13 09:24:46 2014
New Revision: 261828
URL: http://svnweb.freebsd.org/changeset/base/261828

Log:
  MFC: r261566
  
  Use CAP_EVENT instead of the deprecated CAP_POLL_EVENT.
  
  PR:   185382 (based on)
  Submitted by: Loganaden Velvindron
  Reviewed by:  pjd

Modified:
  stable/10/sbin/dhclient/bpf.c
  stable/10/sbin/dhclient/dhclient.c
  stable/10/tools/regression/security/cap_test/cap_test_capabilities.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/dhclient/bpf.c
==
--- stable/10/sbin/dhclient/bpf.c   Thu Feb 13 09:09:14 2014
(r261827)
+++ stable/10/sbin/dhclient/bpf.c   Thu Feb 13 09:24:46 2014
(r261828)
@@ -269,7 +269,7 @@ if_register_receive(struct interface_inf
if (ioctl(info->rfdesc, BIOCLOCK, NULL) < 0)
error("Cannot lock bpf");
 
-   cap_rights_init(&rights, CAP_IOCTL, CAP_POLL_EVENT, CAP_READ);
+   cap_rights_init(&rights, CAP_IOCTL, CAP_EVENT, CAP_READ);
if (cap_rights_limit(info->rfdesc, &rights) < 0 && errno != ENOSYS)
error("Can't limit bpf descriptor: %m");
if (cap_ioctls_limit(info->rfdesc, cmds, 2) < 0 && errno != ENOSYS)

Modified: stable/10/sbin/dhclient/dhclient.c
==
--- stable/10/sbin/dhclient/dhclient.c  Thu Feb 13 09:09:14 2014
(r261827)
+++ stable/10/sbin/dhclient/dhclient.c  Thu Feb 13 09:24:46 2014
(r261828)
@@ -494,7 +494,7 @@ main(int argc, char *argv[])
add_protocol("AF_ROUTE", routefd, routehandler, ifi);
if (shutdown(routefd, SHUT_WR) < 0)
error("can't shutdown route socket: %m");
-   cap_rights_init(&rights, CAP_POLL_EVENT, CAP_READ);
+   cap_rights_init(&rights, CAP_EVENT, CAP_READ);
if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS)
error("can't limit route socket: %m");
 

Modified: stable/10/tools/regression/security/cap_test/cap_test_capabilities.c
==
--- stable/10/tools/regression/security/cap_test/cap_test_capabilities.c
Thu Feb 13 09:09:14 2014(r261827)
+++ stable/10/tools/regression/security/cap_test/cap_test_capabilities.c
Thu Feb 13 09:24:46 2014(r261828)
@@ -396,7 +396,7 @@ try_file_ops(int filefd, int dirfd, cap_
pollfd.revents = 0;
 
ret = poll(&pollfd, 1, 0);
-   if (rights & CAP_POLL_EVENT)
+   if (rights & CAP_EVENT)
CHECK((pollfd.revents & POLLNVAL) == 0);
else
CHECK((pollfd.revents & POLLNVAL) != 0);
@@ -546,7 +546,7 @@ test_capabilities(void)
TRY(CAP_SEM_POST);
TRY(CAP_SEM_WAIT);
TRY(CAP_POST_EVENT);
-   TRY(CAP_POLL_EVENT);
+   TRY(CAP_EVENT);
TRY(CAP_IOCTL);
TRY(CAP_TTYHOOK);
TRY(CAP_PDGETPID);
___
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: r261827 - head/sys/dev/usb/input

2014-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Feb 13 09:09:14 2014
New Revision: 261827
URL: http://svnweb.freebsd.org/changeset/base/261827

Log:
  - Remove not needed definitions from driver.
  - Get USB input report length from HID descriptor.
  - Use 1 finger TAP for devices which has no integrated button.
  - Move data buffer to softc instead of allocating it.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/input/wsp.c

Modified: head/sys/dev/usb/input/wsp.c
==
--- head/sys/dev/usb/input/wsp.cThu Feb 13 06:38:01 2014
(r261826)
+++ head/sys/dev/usb/input/wsp.cThu Feb 13 09:09:14 2014
(r261827)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #defineWSP_DRIVER_NAME "wsp"
+#defineWSP_BUFFER_MAX  1024
 
 #defineWSP_CLAMP(x,low,high) do {  \
if ((x) < (low))\
@@ -124,12 +125,12 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_ho
 #defineWSP_IFACE_INDEX 1
 
 /*
- * Some tables, structures, definitions and initialisation values for
- * the touchpad protocol has been copied from Linux's
+ * Some tables, structures, definitions and constant values for the
+ * touchpad protocol has been copied from Linux's
  * "drivers/input/mouse/bcm5974.c" which has the following copyright
  * holders under GPLv2. All device specific code in this driver has
  * been written from scratch. The decoding algorithm is based on
- * output from usbdump.
+ * output from FreeBSD's usbdump.
  *
  * Copyright (C) 2008  Henrik Rydberg (rydb...@euromail.se)
  * Copyright (C) 2008  Scott Shawcroft (scott.shawcr...@gmail.com)
@@ -205,20 +206,10 @@ struct tp_finger {
 #defineMAX_FINGERS 16
 #defineSIZEOF_FINGER   sizeof(struct tp_finger)
 #defineSIZEOF_ALL_FINGERS  (MAX_FINGERS * SIZEOF_FINGER)
-#defineMAX_FINGER_ORIENTATION  16384
 
-/* logical signal quality */
-#defineSN_PRESSURE 45  /* pressure signal-to-noise 
ratio */
-#defineSN_WIDTH25  /* width signal-to-noise ratio 
*/
-#defineSN_COORD250 /* coordinate signal-to-noise 
ratio */
-#defineSN_ORIENT   10  /* orientation signal-to-noise 
ratio */
-
-/* device-specific parameters */
-struct wsp_param {
-   int snratio;/* signal-to-noise ratio */
-   int min;/* device minimum reading */
-   int max;/* device maximum reading */
-};
+#if (WSP_BUFFER_MAX < ((MAX_FINGERS * 14 * 2) + FINGER_TYPE3))
+#error "WSP_BUFFER_MAX is too small"
+#endif
 
 enum {
WSP_FLAG_WELLSPRING1,
@@ -239,282 +230,70 @@ enum {
 /* device-specific configuration */
 struct wsp_dev_params {
uint8_t caps;   /* device capability bitmask */
-   uint16_t bt_datalen;/* data length of the button interface 
*/
uint8_t tp_type;/* type of trackpad interface */
uint8_t tp_offset;  /* offset to trackpad finger data */
-   uint16_t tp_datalen;/* data length of the trackpad
-* interface */
-   struct wsp_param p; /* finger pressure limits */
-   struct wsp_param w; /* finger width limits */
-   struct wsp_param x; /* horizontal limits */
-   struct wsp_param y; /* vertical limits */
-   struct wsp_param o; /* orientation limits */
 };
 
 static const struct wsp_dev_params wsp_dev_params[WSP_FLAG_MAX] = {
[WSP_FLAG_WELLSPRING1] = {
.caps = 0,
-   .bt_datalen = sizeof(struct bt_data),
.tp_type = TYPE1,
.tp_offset = FINGER_TYPE1,
-   .tp_datalen = FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
-   .p = {
-   SN_PRESSURE, 0, 256
-   },
-   .w = {
-   SN_WIDTH, 0, 2048
-   },
-   .x = {
-   SN_COORD, -4824, 5342
-   },
-   .y = {
-   SN_COORD, -172, 5820
-   },
-   .o = {
-   SN_ORIENT, -MAX_FINGER_ORIENTATION, 
MAX_FINGER_ORIENTATION
-   },
},
[WSP_FLAG_WELLSPRING2] = {
.caps = 0,
-   .bt_datalen = sizeof(struct bt_data),
.tp_type = TYPE1,
.tp_offset = FINGER_TYPE1,
-   .tp_datalen = FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
-   .p = {
-   SN_PRESSURE, 0, 256
-   },
-   .w = {
-   SN_WIDTH, 0, 2048
-   },
-   .x = {
-   SN_COORD, -4824, 4824
-   },
-   .y = {
-   SN_COORD, -172,