Re: svn commit: r290812 - head

2015-11-17 Thread Konstantin Belousov
On Sat, Nov 14, 2015 at 01:45:37AM +, Bryan Drewery wrote:
> Author: bdrewery
> Date: Sat Nov 14 01:45:37 2015
> New Revision: 290812
> URL: https://svnweb.freebsd.org/changeset/base/290812
> 
> Log:
>   Avoid setting schg in the objtree for lib32 build.
>   
>   Reported by:kib
>   Sponsored by:   EMC / Isilon Storage Division
>   MFC after:  1 week
> 
> Modified:
>   head/Makefile.inc1
> 
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Sat Nov 14 01:40:12 2015(r290811)
> +++ head/Makefile.inc1Sat Nov 14 01:45:37 2015(r290812)
> @@ -716,10 +716,10 @@ build32: .PHONY
>   build-tools
>  .endfor
>   ${_+_}cd ${.CURDIR}; \
> - ${LIB32WMAKE} -f Makefile.inc1 libraries
> + ${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
>  .for _t in obj depend all
>   ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
> - DIRPRFX=libexec/rtld-elf/ ${_t}
> + -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
>   ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
>   DIRPRFX=usr.bin/ldd ${_t}
>  .endfor
Thank you.

I remember, the previous attempts to fix this broke setting the noschg flag
on the compat32 install.  This one seems to be correct, am I right ?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290974 - in head/sys/arm: arm include

2015-11-17 Thread Andrew Turner
Author: andrew
Date: Tue Nov 17 11:26:35 2015
New Revision: 290974
URL: https://svnweb.freebsd.org/changeset/base/290974

Log:
  Make pl310_print_config static, it's not called out of pl310.c
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/arm/pl310.c
  head/sys/arm/include/pl310.h

Modified: head/sys/arm/arm/pl310.c
==
--- head/sys/arm/arm/pl310.cTue Nov 17 05:41:47 2015(r290973)
+++ head/sys/arm/arm/pl310.cTue Nov 17 11:26:35 2015(r290974)
@@ -90,7 +90,7 @@ static struct ofw_compat_data compat_dat
{NULL,  false}
 };
 
-void
+static void
 pl310_print_config(struct pl310_softc *sc)
 {
uint32_t aux, prefetch;

Modified: head/sys/arm/include/pl310.h
==
--- head/sys/arm/include/pl310.hTue Nov 17 05:41:47 2015
(r290973)
+++ head/sys/arm/include/pl310.hTue Nov 17 11:26:35 2015
(r290974)
@@ -177,7 +177,6 @@ pl310_write4(struct pl310_softc *sc, bus
bus_write_4(sc->sc_mem_res, off, val);
 }
 
-void pl310_print_config(struct pl310_softc *sc);
 void pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg,
 uint32_t read, uint32_t write, uint32_t setup);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290975 - head/usr.bin/netstat

2015-11-17 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Nov 17 12:09:57 2015
New Revision: 290975
URL: https://svnweb.freebsd.org/changeset/base/290975

Log:
  JSON doesn't permit a hexadecimal notation of an integer.

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

Modified: head/usr.bin/netstat/if.c
==
--- head/usr.bin/netstat/if.c   Tue Nov 17 11:26:35 2015(r290974)
+++ head/usr.bin/netstat/if.c   Tue Nov 17 12:09:57 2015(r290975)
@@ -358,7 +358,7 @@ intpr(void (*pfunc)(char *), int af)
} else
xname = name;
 
-   xo_emit("{etk:name/%s}{e:flags/0x%x}{d:/%-*.*s}",
+   xo_emit("{etk:name/%s}{eq:flags/0x%x}{d:/%-*.*s}",
name, ifa->ifa_flags, ifn_len_max, ifn_len_max, xname);
 
 #define IFA_MTU(ifa)   (((struct if_data *)(ifa)->ifa_data)->ifi_mtu)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290976 - head

2015-11-17 Thread Baptiste Daroussin
Author: bapt
Date: Tue Nov 17 12:18:57 2015
New Revision: 290976
URL: https://svnweb.freebsd.org/changeset/base/290976

Log:
  install(1) is following symlinks when installing a files, which result in
  inconsistency when installing new locales and may also result in failures
  when reinstalling after having run make delete-old (due to previous
  inconsistencies) for now recommand removing all locales until install(1) is
  fixed

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Nov 17 12:09:57 2015(r290975)
+++ head/UPDATING   Tue Nov 17 12:18:57 2015(r290976)
@@ -39,6 +39,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
Databases administrators will need to reindex their databases given
collation results will be different.
 
+   Due to a bug in install(1) it is recommanded to remove the ancient
+   locales before running make installworld
+
+   rm -rf /usr/share/locale
+
 20151030:
The OpenSSL has been upgraded to 1.0.2d.  Any binaries requiring
libcrypto.so.7 or libssl.so.7 must be recompiled.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290977 - head/sys/arm/samsung/exynos

2015-11-17 Thread Zbigniew Bodek
Author: zbb
Date: Tue Nov 17 12:50:45 2015
New Revision: 290977
URL: https://svnweb.freebsd.org/changeset/base/290977

Log:
  Fix buffer overflow in exynos5_ehci
  
  Use proper size of exynos_ehci_softc, not the generic one.
  
  Reviewed by:   andrew
  Submitted by:  Wojciech Macek 
  Obtained from: Semihalf
  Sponsored by:  Juniper Networks Inc.
  Differential Revision: https://reviews.freebsd.org/D4189

Modified:
  head/sys/arm/samsung/exynos/exynos5_ehci.c

Modified: head/sys/arm/samsung/exynos/exynos5_ehci.c
==
--- head/sys/arm/samsung/exynos/exynos5_ehci.c  Tue Nov 17 12:18:57 2015
(r290976)
+++ head/sys/arm/samsung/exynos/exynos5_ehci.c  Tue Nov 17 12:50:45 2015
(r290977)
@@ -122,7 +122,7 @@ static device_method_t ehci_methods[] = 
 static driver_t ehci_driver = {
"ehci",
ehci_methods,
-   sizeof(ehci_softc_t)
+   sizeof(struct exynos_ehci_softc)
 };
 
 static devclass_t ehci_devclass;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290978 - head/sys/dev/isp

2015-11-17 Thread Alexander Motin
Author: mav
Date: Tue Nov 17 13:02:44 2015
New Revision: 290978
URL: https://svnweb.freebsd.org/changeset/base/290978

Log:
  Add real initial support for RQSTYPE_RPT_ID_ACQ.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/ispmbox.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Nov 17 12:50:45 2015(r290977)
+++ head/sys/dev/isp/isp.c  Tue Nov 17 13:02:44 2015(r290978)
@@ -6192,6 +6192,9 @@ isp_parse_async_fc(ispsoftc_t *isp, uint
 static int
 isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t 
*optrp)
 {
+   isp_ridacq_t rid;
+   int chan, c;
+
switch (type) {
case RQSTYPE_STATUS_CONT:
isp_prt(isp, ISP_LOG_WARN1, "Ignored Continuation Response");
@@ -6199,6 +6202,23 @@ isp_handle_other_response(ispsoftc_t *is
case RQSTYPE_MARKER:
isp_prt(isp, ISP_LOG_WARN1, "Marker Response");
return (1);
+   case RQSTYPE_RPT_ID_ACQ:
+   isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid);
+   if (rid.ridacq_format == 0) {
+   for (chan = 0; chan < isp->isp_nchan; chan++) {
+   fcparam *fcp = FCPARAM(isp, chan);
+   if (fcp->role == ISP_ROLE_NONE)
+   continue;
+   c = (chan == 0) ? 127 : (chan - 1);
+   if (rid.ridacq_map[c / 16] & (1 << (c % 16)))
+   isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
+   chan, ISPASYNC_CHANGE_OTHER);
+   }
+   } else {
+   isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
+   rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER);
+   }
+   return (1);
case RQSTYPE_ATIO:
case RQSTYPE_CTIO:
case RQSTYPE_ENABLE_LUN:
@@ -6219,15 +6239,6 @@ isp_handle_other_response(ispsoftc_t *is
}
 #endif
/* FALLTHROUGH */
-   case RQSTYPE_RPT_ID_ACQ:
-   if (IS_24XX(isp)) {
-   isp_ridacq_t rid;
-   isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid);
-   if (rid.ridacq_format == 0) {
-   }
-   return (1);
-   }
-   /* FALLTHROUGH */
case RQSTYPE_REQUEST:
default:
ISP_DELAY(100);

Modified: head/sys/dev/isp/isp_library.c
==
--- head/sys/dev/isp/isp_library.c  Tue Nov 17 12:50:45 2015
(r290977)
+++ head/sys/dev/isp/isp_library.c  Tue Nov 17 13:02:44 2015
(r290978)
@@ -1733,6 +1733,10 @@ isp_get_ridacq(ispsoftc_t *isp, isp_rida
int i;
isp_get_hdr(isp, &src->ridacq_hdr, &dst->ridacq_hdr);
ISP_IOXGET_32(isp, &src->ridacq_handle, dst->ridacq_handle);
+   ISP_IOXGET_8(isp, &src->ridacq_vp_acquired, dst->ridacq_vp_acquired);
+   ISP_IOXGET_8(isp, &src->ridacq_vp_setup, dst->ridacq_vp_setup);
+   ISP_IOXGET_8(isp, &src->ridacq_vp_index, dst->ridacq_vp_index);
+   ISP_IOXGET_8(isp, &src->ridacq_vp_status, dst->ridacq_vp_status);
ISP_IOXGET_16(isp, &src->ridacq_vp_port_lo, dst->ridacq_vp_port_lo);
ISP_IOXGET_8(isp, &src->ridacq_vp_port_hi, dst->ridacq_vp_port_hi);
ISP_IOXGET_8(isp, &src->ridacq_format, dst->ridacq_format);
@@ -1742,17 +1746,6 @@ isp_get_ridacq(ispsoftc_t *isp, isp_rida
for (i = 0; i < sizeof (src->ridacq_reserved1) / sizeof 
(src->ridacq_reserved1[0]); i++) {
ISP_IOXGET_16(isp, &src->ridacq_reserved1[i], 
dst->ridacq_reserved1[i]);
}
-   if (dst->ridacq_format == 0) {
-   ISP_IOXGET_8(isp, &src->un.type0.ridacq_vp_acquired, 
dst->un.type0.ridacq_vp_acquired);
-   ISP_IOXGET_8(isp, &src->un.type0.ridacq_vp_setup, 
dst->un.type0.ridacq_vp_setup);
-   ISP_IOXGET_16(isp, &src->un.type0.ridacq_reserved0, 
dst->un.type0.ridacq_reserved0);
-   } else if (dst->ridacq_format == 1) {
-   ISP_IOXGET_16(isp, &src->un.type1.ridacq_vp_count, 
dst->un.type1.ridacq_vp_count);
-   ISP_IOXGET_8(isp, &src->un.type1.ridacq_vp_index, 
dst->un.type1.ridacq_vp_index);
-   ISP_IOXGET_8(isp, &src->un.type1.ridacq_vp_status, 
dst->un.type1.ridacq_vp_status);
-   } else {
-   ISP_MEMZERO(&dst->un, sizeof (dst->un));
-   }
 }
 
 

Modified: head/sys/dev/isp/ispmbox.h
==
--- head/sys/dev/isp/ispmbox.h  Tue Nov 17 12:50:45 2015(r290977)
+++ head/sys/dev/isp/ispmbox.h  Tue Nov 17 13:02:44 2015(r290978)
@@ -1485,18 +1485,10 @@ typedef struct 

svn commit: r290979 - head/sys/arm/include

2015-11-17 Thread Zbigniew Bodek
Author: zbb
Date: Tue Nov 17 13:09:51 2015
New Revision: 290979
URL: https://svnweb.freebsd.org/changeset/base/290979

Log:
  Make PCB structure binary compatible for old and new PMAP on ARM
  
  This structure must be binary compatible regardless of PMAP
  version being used. Create reserved section for NEW_PMAP to
  make other variables be placed exactly in the same memory
  addresses. This fixes kgdb/gdb behavoiur, which uses pcb.h stuctures.
  The NEW_PMAP is kernel flag, so it does not propagate to the buildworld,
  what makes the tools using pcb.h unable to parse PCB data.
  
  Reviewed by:   mmel, kib
  Submitted by:  Wojciech Macek 
  Obtained from: Semihalf
  Sponsored by:  Juniper Networks Inc.
  Differential Revision: https://reviews.freebsd.org/D4011

Modified:
  head/sys/arm/include/pcb.h

Modified: head/sys/arm/include/pcb.h
==
--- head/sys/arm/include/pcb.h  Tue Nov 17 13:02:44 2015(r290978)
+++ head/sys/arm/include/pcb.h  Tue Nov 17 13:09:51 2015(r290979)
@@ -52,14 +52,17 @@ struct pcb {
 #definePCB_OWNFPU  0x0001
 #define PCB_NOALIGNFLT 0x0002
caddr_t pcb_onfault;/* On fault handler */
-#ifdef  ARM_NEW_PMAP
-   uint32_tpcb_pagedir;/* TTB0 value */
-#else
-   vm_offset_t pcb_pagedir;/* PT hooks */
+   vm_offset_t pcb_pagedir;/* TTB0 value */
+   /*
+* XXX:
+* Variables pcb_pl1vec, pcb_l1vec, pcb_dacr are used solely
+* by old PMAP. Keep them here for PCB binary compatibility
+* between old and new PMAP.
+*/
uint32_t *pcb_pl1vec;   /* PTR to vector_base L1 entry*/
uint32_t pcb_l1vec; /* Value to stuff on ctx sw */
u_int   pcb_dacr;   /* Domain Access Control Reg */
-#endif
+
struct vfp_state pcb_vfpstate;  /* VP/NEON state */
u_int pcb_vfpcpu;   /* VP/NEON last cpu */
 } __aligned(8); /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290980 - head/sys/dev/isp

2015-11-17 Thread Alexander Motin
Author: mav
Date: Tue Nov 17 14:13:55 2015
New Revision: 290980
URL: https://svnweb.freebsd.org/changeset/base/290980

Log:
  Make firmware handle virtual ports SNS logins for us.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_library.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Nov 17 13:09:51 2015(r290979)
+++ head/sys/dev/isp/isp.c  Tue Nov 17 14:13:55 2015(r290980)
@@ -2187,7 +2187,7 @@ isp_fibre_init_2400(ispsoftc_t *isp)
size_t amt = 0;
uint8_t *off;
 
-   vpinfo.vp_global_options = 0;
+   vpinfo.vp_global_options = ICB2400_VPGOPT_GEN_RIDA;
if (ISP_CAP_VP0(isp)) {
vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE;
vpinfo.vp_count = isp->isp_nchan;
@@ -2207,7 +2207,8 @@ isp_fibre_init_2400(ispsoftc_t *isp)
ISP_MEMZERO(&pi, sizeof (pi));
fcp2 = FCPARAM(isp, chan);
if (fcp2->role != ISP_ROLE_NONE) {
-   pi.vp_port_options = ICB2400_VPOPT_ENABLED;
+   pi.vp_port_options = ICB2400_VPOPT_ENABLED |
+   ICB2400_VPOPT_ENA_SNSLOGIN;
if (fcp2->role & ISP_ROLE_INITIATOR)
pi.vp_port_options |= 
ICB2400_VPOPT_INI_ENABLE;
if ((fcp2->role & ISP_ROLE_TARGET) == 0)
@@ -2914,16 +2915,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha
} else {
fcp->isp_fabric_params = 0;
}
-   if (chan) {
-   fcp->isp_sns_hdl = NPH_RESERVED - chan;
-   r = isp_plogx(isp, chan, fcp->isp_sns_hdl, 
SNS_PORT_ID, PLOGX_FLG_CMD_PLOGI | PLOGX_FLG_COND_PLOGI | PLOGX_FLG_SKIP_PRLI, 
0);
-   if (r) {
-   isp_prt(isp, ISP_LOGWARN, "%s: Chan %d 
cannot log into SNS", __func__, chan);
-   return (-1);
-   }
-   } else {
-   fcp->isp_sns_hdl = NPH_SNS_ID;
-   }
+   fcp->isp_sns_hdl = NPH_SNS_ID;
r = isp_register_fc4_type_24xx(isp, chan);
} else {
fcp->isp_sns_hdl = SNS_ID;
@@ -3167,7 +3159,7 @@ fail:
 * Don't scan "special" ids.
 */
if (ISP_CAP_2KLOGIN(isp)) {
-   if (handle >= NPH_RESERVED - isp->isp_nchan)
+   if (handle >= NPH_RESERVED)
continue;
} else {
if (handle >= FL_ID && handle <= SNS_ID)
@@ -4276,7 +4268,7 @@ isp_next_handle(ispsoftc_t *isp, uint16_
handle = *ohp;
if (ISP_CAP_2KLOGIN(isp)) {
minh = 0;
-   maxh = NPH_RESERVED - isp->isp_nchan; /* Reserve for SNS */
+   maxh = NPH_RESERVED;
} else {
minh = SNS_ID + 1;
maxh = NPH_MAX - 1;

Modified: head/sys/dev/isp/isp_library.c
==
--- head/sys/dev/isp/isp_library.c  Tue Nov 17 13:09:51 2015
(r290979)
+++ head/sys/dev/isp/isp_library.c  Tue Nov 17 14:13:55 2015
(r290980)
@@ -604,7 +604,8 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch
vp->vp_mod_cnt = 1;
vp->vp_mod_idx0 = chan;
vp->vp_mod_cmd = VP_MODIFY_ENA;
-   vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED;
+   vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED |
+   ICB2400_VPOPT_ENA_SNSLOGIN;
if (fcp->role & ISP_ROLE_INITIATOR) {
vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290981 - head/sys/dev/isp

2015-11-17 Thread Alexander Motin
Author: mav
Date: Tue Nov 17 14:22:56 2015
New Revision: 290981
URL: https://svnweb.freebsd.org/changeset/base/290981

Log:
  Off-by-one correctiont to r290980.

Modified:
  head/sys/dev/isp/isp.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Nov 17 14:13:55 2015(r290980)
+++ head/sys/dev/isp/isp.c  Tue Nov 17 14:22:56 2015(r290981)
@@ -4268,7 +4268,7 @@ isp_next_handle(ispsoftc_t *isp, uint16_
handle = *ohp;
if (ISP_CAP_2KLOGIN(isp)) {
minh = 0;
-   maxh = NPH_RESERVED;
+   maxh = NPH_RESERVED - 1;
} else {
minh = SNS_ID + 1;
maxh = NPH_MAX - 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290982 - in head/sys: net netipsec

2015-11-17 Thread Fabien Thomas
Author: fabient
Date: Tue Nov 17 14:39:33 2015
New Revision: 290982
URL: https://svnweb.freebsd.org/changeset/base/290982

Log:
  Implement the sadb_x_policy_priority field as it is done in Linux:
  lower priority policies are inserted first.
  
  Submitted by: Emeric Poupon 
  Reviewed by:  ae
  Sponsored by: Stormshield

Modified:
  head/sys/net/pfkeyv2.h
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/key.c

Modified: head/sys/net/pfkeyv2.h
==
--- head/sys/net/pfkeyv2.h  Tue Nov 17 14:22:56 2015(r290981)
+++ head/sys/net/pfkeyv2.h  Tue Nov 17 14:39:33 2015(r290982)
@@ -225,7 +225,7 @@ struct sadb_x_policy {
   u_int8_t sadb_x_policy_dir;  /* direction, see ipsec.h */
   u_int8_t sadb_x_policy_reserved;
   u_int32_t sadb_x_policy_id;
-  u_int32_t sadb_x_policy_reserved2;
+  u_int32_t sadb_x_policy_priority;
 };
 _Static_assert(sizeof(struct sadb_x_policy) == 16, "struct size mismatch");
 

Modified: head/sys/netipsec/ipsec.h
==
--- head/sys/netipsec/ipsec.h   Tue Nov 17 14:22:56 2015(r290981)
+++ head/sys/netipsec/ipsec.h   Tue Nov 17 14:39:33 2015(r290982)
@@ -92,6 +92,7 @@ struct secpolicy {
u_int state;
 #defineIPSEC_SPSTATE_DEAD  0
 #defineIPSEC_SPSTATE_ALIVE 1
+   u_int32_t priority; /* priority of this policy */
u_int32_t id;   /* It's unique number on the system. */
/*
 * lifetime handler.

Modified: head/sys/netipsec/key.c
==
--- head/sys/netipsec/key.c Tue Nov 17 14:22:56 2015(r290981)
+++ head/sys/netipsec/key.c Tue Nov 17 14:39:33 2015(r290982)
@@ -473,7 +473,7 @@ static void key_porttosaddr(struct socka
key_porttosaddr((struct sockaddr *)(saddr), (port))
 static struct mbuf *key_setsadbxsa2(u_int8_t, u_int32_t, u_int32_t);
 static struct mbuf *key_setsadbxpolicy(u_int16_t, u_int8_t,
-   u_int32_t);
+   u_int32_t, u_int32_t);
 static struct seckey *key_dup_keymsg(const struct sadb_key *, u_int, 
 struct malloc_type *);
 static struct seclifetime *key_dup_lifemsg(const struct sadb_lifetime *src,
@@ -1209,6 +1209,29 @@ key_unlink(struct secpolicy *sp)
 }
 
 /*
+ * insert a secpolicy into the SP database. Lower priorities first
+ */
+static void
+key_insertsp(struct secpolicy *newsp)
+{
+   struct secpolicy *sp;
+
+   SPTREE_WLOCK();
+   TAILQ_FOREACH(sp, &V_sptree[newsp->spidx.dir], chain) {
+   if (newsp->priority < sp->priority) {
+   TAILQ_INSERT_BEFORE(sp, newsp, chain);
+   goto done;
+   }
+   }
+
+   TAILQ_INSERT_TAIL(&V_sptree[newsp->spidx.dir], newsp, chain);
+
+done:
+   newsp->state = IPSEC_SPSTATE_ALIVE;
+   SPTREE_WUNLOCK();
+}
+
+/*
  * Must be called after calling key_allocsp().
  * For the packet with socket.
  */
@@ -1391,6 +1414,7 @@ key_msg2sp(struct sadb_x_policy *xpl0, s
 
newsp->spidx.dir = xpl0->sadb_x_policy_dir;
newsp->policy = xpl0->sadb_x_policy_type;
+   newsp->priority = xpl0->sadb_x_policy_priority;
 
/* check policy */
switch (xpl0->sadb_x_policy_type) {
@@ -1627,6 +1651,7 @@ key_sp2msg(struct secpolicy *sp)
xpl->sadb_x_policy_type = sp->policy;
xpl->sadb_x_policy_dir = sp->spidx.dir;
xpl->sadb_x_policy_id = sp->id;
+   xpl->sadb_x_policy_priority = sp->priority;
p = (caddr_t)xpl + sizeof(*xpl);
 
/* if is the policy for ipsec ? */
@@ -1904,10 +1929,7 @@ key_spdadd(struct socket *so, struct mbu
newsp->lifetime = lft ? lft->sadb_lifetime_addtime : 0;
newsp->validtime = lft ? lft->sadb_lifetime_usetime : 0;
 
-   SPTREE_WLOCK();
-   TAILQ_INSERT_TAIL(&V_sptree[newsp->spidx.dir], newsp, chain);
-   newsp->state = IPSEC_SPSTATE_ALIVE;
-   SPTREE_WUNLOCK();
+   key_insertsp(newsp);
 
/* delete the entry in spacqtree */
if (mhp->msg->sadb_msg_type == SADB_X_SPDUPDATE) {
@@ -3744,7 +3766,7 @@ key_porttosaddr(struct sockaddr *sa, u_i
  * set data into sadb_x_policy
  */
 static struct mbuf *
-key_setsadbxpolicy(u_int16_t type, u_int8_t dir, u_int32_t id)
+key_setsadbxpolicy(u_int16_t type, u_int8_t dir, u_int32_t id, u_int32_t 
priority)
 {
struct mbuf *m;
struct sadb_x_policy *p;
@@ -3764,6 +3786,7 @@ key_setsadbxpolicy(u_int16_t type, u_int
p->sadb_x_policy_type = type;
p->sadb_x_policy_dir = dir;
p->sadb_x_policy_id = id;
+   p->sadb_x_policy_priority = priority;
 
return m;
 }
@@ -6205,7 +6228,7 @@ key_acquire(const struct secasindex *sai
 
/* set sadb_x_policy */
if (sp) {
-   m = key_setsadbxpolicy(sp->policy, sp->spidx.dir, sp->id);
+  

svn commit: r290989 - in head/sys/powerpc: aim ofw powermac pseries

2015-11-17 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Nov 17 16:07:43 2015
New Revision: 290989
URL: https://svnweb.freebsd.org/changeset/base/290989

Log:
  Where appropriate, use the endian-flipping OF_getencprop() instead of
  OF_getprop() to get encode-int encoded values from the OF tree. This is
  a no-op at present, since all existing PowerPC ports are big-endian, but
  it is a correctness improvement and will be required if we have a
  little-endian kernel at some future point.
  
  Where it is totally impossible for the code ever to be used on a
  little-endian system (much of powerpc/powermac, for instance), I have not
  necessarily made the appropriate changes.
  
  MFC after:1 month

Modified:
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/ofw/ofw_machdep.c
  head/sys/powerpc/ofw/ofw_pci.c
  head/sys/powerpc/ofw/ofw_pcibus.c
  head/sys/powerpc/ofw/openpic_ofw.c
  head/sys/powerpc/powermac/cpcht.c
  head/sys/powerpc/powermac/kiic.c
  head/sys/powerpc/powermac/macgpio.c
  head/sys/powerpc/pseries/mmu_phyp.c
  head/sys/powerpc/pseries/phyp_console.c
  head/sys/powerpc/pseries/phyp_llan.c
  head/sys/powerpc/pseries/phyp_vscsi.c
  head/sys/powerpc/pseries/platform_chrp.c
  head/sys/powerpc/pseries/plpar_iommu.c
  head/sys/powerpc/pseries/rtas_pci.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cTue Nov 17 15:20:12 2015
(r290988)
+++ head/sys/powerpc/aim/mmu_oea64.cTue Nov 17 16:07:43 2015
(r290989)
@@ -493,9 +493,9 @@ moea64_add_ofw_mappings(mmu_t mmup, phan
int i, j;
 
bzero(translations, sz);
-   OF_getprop(OF_finddevice("/"), "#address-cells", &acells,
+   OF_getencprop(OF_finddevice("/"), "#address-cells", &acells,
sizeof(acells));
-   if (OF_getprop(mmu, "translations", trans_cells, sz) == -1)
+   if (OF_getencprop(mmu, "translations", trans_cells, sz) == -1)
panic("moea64_bootstrap: can't get ofw translations");
 
CTR0(KTR_PMAP, "moea64_add_ofw_mappings: translations");
@@ -856,7 +856,7 @@ moea64_late_bootstrap(mmu_t mmup, vm_off
 */
 
chosen = OF_finddevice("/chosen");
-   if (chosen != -1 && OF_getprop(chosen, "mmu", &mmui, 4) != -1) {
+   if (chosen != -1 && OF_getencprop(chosen, "mmu", &mmui, 4) != -1) {
mmu = OF_instance_to_package(mmui);
if (mmu == -1 ||
(sz = OF_getproplen(mmu, "translations")) == -1)

Modified: head/sys/powerpc/ofw/ofw_machdep.c
==
--- head/sys/powerpc/ofw/ofw_machdep.c  Tue Nov 17 15:20:12 2015
(r290988)
+++ head/sys/powerpc/ofw/ofw_machdep.c  Tue Nov 17 16:07:43 2015
(r290989)
@@ -154,17 +154,17 @@ parse_ofw_memory(phandle_t node, const c
 * be found.
 */
phandle = OF_finddevice("/");
-   if (OF_getprop(phandle, "#address-cells", &address_cells, 
+   if (OF_getencprop(phandle, "#address-cells", &address_cells, 
sizeof(address_cells)) < (ssize_t)sizeof(address_cells))
address_cells = 1;
-   if (OF_getprop(phandle, "#size-cells", &size_cells, 
+   if (OF_getencprop(phandle, "#size-cells", &size_cells, 
sizeof(size_cells)) < (ssize_t)sizeof(size_cells))
size_cells = 1;
 
/*
 * Get memory.
 */
-   if (node == -1 || (sz = OF_getprop(node, prop,
+   if (node == -1 || (sz = OF_getencprop(node, prop,
OFmem, sizeof(OFmem))) <= 0)
panic("Physical memory map not found");
 
@@ -572,10 +572,10 @@ OF_get_addr_props(phandle_t node, uint32
uint32_t addr, size;
int pci, res;
 
-   res = OF_getprop(node, "#address-cells", &addr, sizeof(addr));
+   res = OF_getencprop(node, "#address-cells", &addr, sizeof(addr));
if (res == -1)
addr = 2;
-   res = OF_getprop(node, "#size-cells", &size, sizeof(size));
+   res = OF_getencprop(node, "#size-cells", &size, sizeof(size));
if (res == -1)
size = 1;
pci = 0;
@@ -624,7 +624,7 @@ OF_decode_addr(phandle_t dev, int regno,
OF_get_addr_props(bridge, &naddr, &nsize, &pci);
if (pci)
*tag = &bs_le_tag;
-   res = OF_getprop(dev, (pci) ? "assigned-addresses" : "reg",
+   res = OF_getencprop(dev, (pci) ? "assigned-addresses" : "reg",
cell, sizeof(cell));
if (res == -1)
return (ENXIO);
@@ -653,7 +653,7 @@ OF_decode_addr(phandle_t dev, int regno,
OF_get_addr_props(parent, &nbridge, NULL, &pcib);
if (pcib)
*tag = &bs_le_tag;
-   res = OF_getprop(bridge, "ranges", cell, sizeof(cell));
+   res = OF_getencprop(bridge, "ranges", cell, sizeof(cell));
if (res == -1)
goto 

svn commit: r290990 - head/sys/powerpc/aim

2015-11-17 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Nov 17 16:09:26 2015
New Revision: 290990
URL: https://svnweb.freebsd.org/changeset/base/290990

Log:
  Make native page table access endian-safe. Even on CPUs running in
  little-endian mode, the hardware page table is big-endian. This is a
  no-op on all currently supported systems.
  
  MFC after:1 month

Modified:
  head/sys/powerpc/aim/moea64_native.c

Modified: head/sys/powerpc/aim/moea64_native.c
==
--- head/sys/powerpc/aim/moea64_native.cTue Nov 17 16:07:43 2015
(r290989)
+++ head/sys/powerpc/aim/moea64_native.cTue Nov 17 16:09:26 2015
(r290990)
@@ -230,7 +230,7 @@ moea64_pte_synch_native(mmu_t mmu, struc
moea64_pte_from_pvo(pvo, &properpt);
 
rw_rlock(&moea64_eviction_lock);
-   if ((pt->pte_hi & LPTE_AVPN_MASK) !=
+   if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) !=
(properpt.pte_hi & LPTE_AVPN_MASK)) {
/* Evicted */
rw_runlock(&moea64_eviction_lock);
@@ -257,7 +257,7 @@ moea64_pte_clear_native(mmu_t mmu, struc
moea64_pte_from_pvo(pvo, &properpt);
 
rw_rlock(&moea64_eviction_lock);
-   if ((pt->pte_hi & LPTE_AVPN_MASK) !=
+   if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) !=
(properpt.pte_hi & LPTE_AVPN_MASK)) {
/* Evicted */
rw_runlock(&moea64_eviction_lock);
@@ -268,11 +268,15 @@ moea64_pte_clear_native(mmu_t mmu, struc
/* See "Resetting the Reference Bit" in arch manual */
PTESYNC();
/* 2-step here safe: precision is not guaranteed */
-   ptelo = pt->pte_lo;
+   ptelo = be64toh(pt->pte_lo);
 
/* One-byte store to avoid touching the C bit */
((volatile uint8_t *)(&pt->pte_lo))[6] =
+#if BYTE_ORDER == BIG_ENDIAN
((uint8_t *)(&properpt.pte_lo))[6];
+#else
+   ((uint8_t *)(&properpt.pte_lo))[1];
+#endif
rw_runlock(&moea64_eviction_lock);
 
critical_enter();
@@ -297,7 +301,7 @@ moea64_pte_unset_native(mmu_t mmu, struc
moea64_pte_from_pvo(pvo, &properpt);
 
rw_rlock(&moea64_eviction_lock);
-   if ((pt->pte_hi & LPTE_AVPN_MASK) !=
+   if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) !=
(properpt.pte_hi & LPTE_AVPN_MASK)) {
/* Evicted */
moea64_pte_overflow--;
@@ -311,7 +315,7 @@ moea64_pte_unset_native(mmu_t mmu, struc
 */
isync();
critical_enter();
-   pt->pte_hi = (pt->pte_hi & ~LPTE_VALID) | LPTE_LOCKED;
+   pt->pte_hi = be64toh((pt->pte_hi & ~LPTE_VALID) | LPTE_LOCKED);
PTESYNC();
TLBIE(pvo->pvo_vpn);
ptelo = be64toh(pt->pte_lo);
@@ -337,13 +341,13 @@ moea64_pte_replace_native(mmu_t mmu, str
moea64_pte_from_pvo(pvo, &properpt);
 
rw_rlock(&moea64_eviction_lock);
-   if ((pt->pte_hi & LPTE_AVPN_MASK) !=
+   if ((be64toh(pt->pte_hi) & LPTE_AVPN_MASK) !=
(properpt.pte_hi & LPTE_AVPN_MASK)) {
rw_runlock(&moea64_eviction_lock);
return (-1);
}
-   pt->pte_hi = properpt.pte_hi;
-   ptelo = pt->pte_lo;
+   pt->pte_hi = htobe64(properpt.pte_hi);
+   ptelo = be64toh(pt->pte_lo);
rw_runlock(&moea64_eviction_lock);
} else {
/* Otherwise, need reinsertion and deletion */
@@ -571,9 +575,9 @@ moea64_insert_to_pteg_native(struct lpte
 * Update the PTE as per "Adding a Page Table Entry". Lock is released
 * by setting the high doubleworld.
 */
-   pt->pte_lo = pvo_pt->pte_lo;
+   pt->pte_lo = htobe64(pvo_pt->pte_lo);
EIEIO();
-   pt->pte_hi = pvo_pt->pte_hi;
+   pt->pte_hi = htobe64(pvo_pt->pte_hi);
PTESYNC();
 
/* Keep statistics */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290993 - head/sys/dev/isp

2015-11-17 Thread Alexander Motin
Author: mav
Date: Tue Nov 17 16:33:46 2015
New Revision: 290993
URL: https://svnweb.freebsd.org/changeset/base/290993

Log:
  Unify and cleanup FC ports scan.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Nov 17 16:18:44 2015(r290992)
+++ head/sys/dev/isp/isp.c  Tue Nov 17 16:33:46 2015(r290993)
@@ -64,12 +64,6 @@ __FBSDID("$FreeBSD$");
  * General defines
  */
 #defineMBOX_DELAY_COUNT100 / 100
-#defineISP_MARK_PORTDB(a, b, c)\
-   do {\
-   isp_prt(isp, ISP_LOG_SANCFG,\
-   "Chan %d ISP_MARK_PORTDB@LINE %d", (b), __LINE__);  \
-   isp_mark_portdb((a), (b), (c)); \
-   } while (0)
 
 /*
  * Local static data
@@ -132,7 +126,7 @@ static int isp_login_device(ispsoftc_t *
 static int isp_register_fc4_type(ispsoftc_t *, int);
 static int isp_register_fc4_type_24xx(ispsoftc_t *, int);
 static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *);
-static void isp_fw_state(ispsoftc_t *, int);
+static int isp_fw_state(ispsoftc_t *, int);
 static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int);
 static void isp_mboxcmd(ispsoftc_t *, mbreg_t *);
 
@@ -149,6 +143,19 @@ static void isp_parse_nvram_12160(ispsof
 static void isp_parse_nvram_2100(ispsoftc_t *, uint8_t *);
 static void isp_parse_nvram_2400(ispsoftc_t *, uint8_t *);
 
+static void
+isp_change_fw_state(ispsoftc_t *isp, int chan, int state)
+{
+   fcparam *fcp = FCPARAM(isp, chan);
+
+   if (fcp->isp_fwstate == state)
+   return;
+   isp_prt(isp, ISP_LOGCONFIG|ISP_LOG_SANCFG,
+   "Chan %d Firmware state <%s->%s>", chan,
+   isp_fc_fw_statename(fcp->isp_fwstate), isp_fc_fw_statename(state));
+   fcp->isp_fwstate = state;
+}
+
 /*
  * Reset Hardware.
  *
@@ -1267,8 +1274,9 @@ isp_reset(ispsoftc_t *isp, int do_load_d
isp->isp_nchan = 1;
}
}
-   for (i = 0; i < isp->isp_nchan; i++) {
-   isp_fw_state(isp, i);
+   if (IS_FC(isp)) {
+   for (i = 0; i < isp->isp_nchan; i++)
+   isp_change_fw_state(isp, i, FW_CONFIG_WAIT);
}
if (isp->isp_dead) {
isp_shutdown(isp);
@@ -2577,7 +2585,10 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui
pdb->portid = BITS2WORD_24XX(un.bill.pdb_portid_bits);
ISP_MEMCPY(pdb->portname, un.bill.pdb_portname, 8);
ISP_MEMCPY(pdb->nodename, un.bill.pdb_nodename, 8);
-   isp_prt(isp, ISP_LOG_SANCFG, "Chan %d handle 0x%x Port 0x%06x 
flags 0x%x curstate %x", chan, id, pdb->portid, un.bill.pdb_flags, 
un.bill.pdb_curstate);
+   isp_prt(isp, ISP_LOGDEBUG1,
+   "Chan %d handle 0x%x Port 0x%06x flags 0x%x curstate %x",
+   chan, id, pdb->portid, un.bill.pdb_flags,
+   un.bill.pdb_curstate);
if (un.bill.pdb_curstate < PDB2400_STATE_PLOGI_DONE || 
un.bill.pdb_curstate > PDB2400_STATE_LOGGED_IN) {
mbs.param[0] = MBOX_NOT_LOGGED_IN;
if (dolock) {
@@ -2592,6 +2603,8 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui
pdb->portid = BITS2WORD(un.fred.pdb_portid_bits);
ISP_MEMCPY(pdb->portname, un.fred.pdb_portname, 8);
ISP_MEMCPY(pdb->nodename, un.fred.pdb_nodename, 8);
+   isp_prt(isp, ISP_LOGDEBUG1,
+   "Chan %d handle 0x%x Port 0x%06x", chan, id, pdb->portid);
}
if (dolock) {
FC_SCRATCH_RELEASE(isp, chan);
@@ -2699,13 +2712,8 @@ static uint64_t
 isp_get_wwn(ispsoftc_t *isp, int chan, int loopid, int nodename)
 {
uint64_t wwn = INI_NONE;
-   fcparam *fcp = FCPARAM(isp, chan);
mbreg_t mbs;
 
-   if (fcp->isp_fwstate < FW_READY ||
-   fcp->isp_loopstate < LOOP_PDB_RCVD) {
-   return (wwn);
-   }
MBSINIT(&mbs, MBOX_GET_PORT_NAME,
MBLOGALL & ~MBLOGMASK(MBOX_COMMAND_PARAM_ERROR), 50);
if (ISP_CAP_2KLOGIN(isp)) {
@@ -2758,7 +2766,6 @@ isp_fclink_test(ispsoftc_t *isp, int cha
 {
mbreg_t mbs;
int check_for_fabric, r;
-   uint8_t lwfs;
int loopid;
fcparam *fcp;
fcportdb_t *lp;
@@ -2767,20 +2774,21 @@ isp_fclink_test(ispsoftc_t *isp, int cha
 
fcp = FCPARAM(isp, chan);
 
-   isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC Link Test Entry", chan);
-   ISP_MARK_PORTDB(isp, chan, 1);
+   /* Mark port database entries for following scan. */
+   isp_mark_portdb(isp, chan, 1);
+
+   if (fcp->isp_loopstate >= LOOP_LTEST_DONE)
+   return (0)

Re: svn commit: r290976 - head

2015-11-17 Thread Garrett Cooper

> On Nov 17, 2015, at 04:18, Baptiste Daroussin  wrote:
> 
> Author: bapt
> Date: Tue Nov 17 12:18:57 2015
> New Revision: 290976
> URL: https://svnweb.freebsd.org/changeset/base/290976
> 
> Log:
>  install(1) is following symlinks when installing a files, which result in
>  inconsistency when installing new locales and may also result in failures
>  when reinstalling after having run make delete-old (due to previous
>  inconsistencies) for now recommand removing all locales until install(1) is
>  fixed
> 
> Modified:
>  head/UPDATING
> 
> Modified: head/UPDATING
> ==
> --- head/UPDATINGTue Nov 17 12:09:57 2015(r290975)
> +++ head/UPDATINGTue Nov 17 12:18:57 2015(r290976)
> @@ -39,6 +39,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
>Databases administrators will need to reindex their databases given
>collation results will be different.
> 
> +Due to a bug in install(1) it is recommanded to remove the ancient
> +locales before running make installworld

*recommended
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290994 - head/sys/dev/isp

2015-11-17 Thread Alexander Motin
Author: mav
Date: Tue Nov 17 16:46:05 2015
New Revision: 290994
URL: https://svnweb.freebsd.org/changeset/base/290994

Log:
  Cosmetic addition to r290993.

Modified:
  head/sys/dev/isp/isp.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Nov 17 16:33:46 2015(r290993)
+++ head/sys/dev/isp/isp.c  Tue Nov 17 16:46:05 2015(r290994)
@@ -2802,7 +2802,9 @@ isp_fclink_test(ispsoftc_t *isp, int cha
 * If we haven't gone to 'ready' state, return.
 */
if (fcp->isp_fwstate != FW_READY) {
-   isp_prt(isp, ISP_LOG_SANCFG, "%s: chan %d not at FW_READY 
state", __func__, chan);
+   isp_prt(isp, ISP_LOG_SANCFG,
+   "Chan %d Firmware is not ready (%s)",
+   chan, isp_fc_fw_statename(fcp->isp_fwstate));
return (-1);
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290996 - head/sys/modules/tests/framework

2015-11-17 Thread Ulrich Spoerlein
Author: uqs
Date: Tue Nov 17 18:28:56 2015
New Revision: 290996
URL: https://svnweb.freebsd.org/changeset/base/290996

Log:
  Fix 'make depend'

Modified:
  head/sys/modules/tests/framework/Makefile

Modified: head/sys/modules/tests/framework/Makefile
==
--- head/sys/modules/tests/framework/Makefile   Tue Nov 17 18:22:56 2015
(r290995)
+++ head/sys/modules/tests/framework/Makefile   Tue Nov 17 18:28:56 2015
(r290996)
@@ -6,6 +6,7 @@
 
 KMOD=  kern_testfrwk
 SRCS=  kern_testfrwk.c
+SRCS+= bus_if.h device_if.h
 
 #
 # Enable full debugging
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r290812 - head

2015-11-17 Thread Bryan Drewery
On 11/17/15 12:55 AM, Konstantin Belousov wrote:
> On Sat, Nov 14, 2015 at 01:45:37AM +, Bryan Drewery wrote:
>> Author: bdrewery
>> Date: Sat Nov 14 01:45:37 2015
>> New Revision: 290812
>> URL: https://svnweb.freebsd.org/changeset/base/290812
>>
>> Log:
>>   Avoid setting schg in the objtree for lib32 build.
>>   
>>   Reported by:   kib
>>   Sponsored by:  EMC / Isilon Storage Division
>>   MFC after: 1 week
>>
>> Modified:
>>   head/Makefile.inc1
>>
>> Modified: head/Makefile.inc1
>> ==
>> --- head/Makefile.inc1   Sat Nov 14 01:40:12 2015(r290811)
>> +++ head/Makefile.inc1   Sat Nov 14 01:45:37 2015(r290812)
>> @@ -716,10 +716,10 @@ build32: .PHONY
>>  build-tools
>>  .endfor
>>  ${_+_}cd ${.CURDIR}; \
>> -${LIB32WMAKE} -f Makefile.inc1 libraries
>> +${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
>>  .for _t in obj depend all
>>  ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
>> -DIRPRFX=libexec/rtld-elf/ ${_t}
>> +-DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
>>  ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
>>  DIRPRFX=usr.bin/ldd ${_t}
>>  .endfor
> Thank you.
> 
> I remember, the previous attempts to fix this broke setting the noschg flag
> on the compat32 install.  This one seems to be correct, am I right ?
> 

Yes, the actual install is still safely setting schg.

I am curious about your make.conf and src.conf though as I was unable to
reproduce the problem, but see evidence that this would fix it.

-- 
Regards,
Bryan Drewery
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290997 - head

2015-11-17 Thread John Baldwin
Author: jhb
Date: Tue Nov 17 19:03:55 2015
New Revision: 290997
URL: https://svnweb.freebsd.org/changeset/base/290997

Log:
  Move recently added entry above the "old" line.

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSTue Nov 17 18:28:56 2015(r290996)
+++ head/MAINTAINERSTue Nov 17 19:03:55 2015(r290997)
@@ -73,6 +73,7 @@ sys/netpfil/pfkp,glebius  Pre-commit rev
 usr.sbin/pkg   pkg@Please coordinate behavior or flag changes with pkg 
team.
 lprgad Pre-commit review requested, particularly for
lpd/recvjob.c and lpd/printjob.c.
+nis(8), yp(8)  araujo  Pre-commit review requested.
  OLD 
 libc/posix1e   rwatson Pre-commit review requested.
 POSIX.1e ACLs  rwatson Pre-commit review requested.
@@ -153,4 +154,3 @@ filemon obrien  Pre-commit review prefe
 sysdoc trhodes Pre-commit review preferred.
 nanobsdimp Pre-commit review requested for coordination.
 vmm(4) neel,grehan Pre-commit review requested.
-nis(8), yp(8)  araujo  Pre-commit review requested.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r290812 - head

2015-11-17 Thread Konstantin Belousov
On Tue, Nov 17, 2015 at 11:01:28AM -0800, Bryan Drewery wrote:
> On 11/17/15 12:55 AM, Konstantin Belousov wrote:
> > On Sat, Nov 14, 2015 at 01:45:37AM +, Bryan Drewery wrote:
> >> Author: bdrewery
> >> Date: Sat Nov 14 01:45:37 2015
> >> New Revision: 290812
> >> URL: https://svnweb.freebsd.org/changeset/base/290812
> >>
> >> Log:
> >>   Avoid setting schg in the objtree for lib32 build.
> >>   
> >>   Reported by: kib
> >>   Sponsored by:EMC / Isilon Storage Division
> >>   MFC after:   1 week
> >>
> >> Modified:
> >>   head/Makefile.inc1
> >>
> >> Modified: head/Makefile.inc1
> >> ==
> >> --- head/Makefile.inc1 Sat Nov 14 01:40:12 2015(r290811)
> >> +++ head/Makefile.inc1 Sat Nov 14 01:45:37 2015(r290812)
> >> @@ -716,10 +716,10 @@ build32: .PHONY
> >>build-tools
> >>  .endfor
> >>${_+_}cd ${.CURDIR}; \
> >> -  ${LIB32WMAKE} -f Makefile.inc1 libraries
> >> +  ${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
> >>  .for _t in obj depend all
> >>${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
> >> -  DIRPRFX=libexec/rtld-elf/ ${_t}
> >> +  -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
> >>${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
> >>DIRPRFX=usr.bin/ldd ${_t}
> >>  .endfor
> > Thank you.
> > 
> > I remember, the previous attempts to fix this broke setting the noschg flag
> > on the compat32 install.  This one seems to be correct, am I right ?
> > 
> 
> Yes, the actual install is still safely setting schg.
> 
> I am curious about your make.conf and src.conf though as I was unable to
> reproduce the problem, but see evidence that this would fix it.

I have
INSTALL?= install
INSTALL+=-CS
in make.conf.

src.conf is
WITHOUT_PROFILE=yes
but this should be not relevant.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r290812 - head

2015-11-17 Thread Bryan Drewery
On 11/17/15 11:06 AM, Konstantin Belousov wrote:
> On Tue, Nov 17, 2015 at 11:01:28AM -0800, Bryan Drewery wrote:
>> On 11/17/15 12:55 AM, Konstantin Belousov wrote:
>>> On Sat, Nov 14, 2015 at 01:45:37AM +, Bryan Drewery wrote:
 Author: bdrewery
 Date: Sat Nov 14 01:45:37 2015
 New Revision: 290812
 URL: https://svnweb.freebsd.org/changeset/base/290812

 Log:
   Avoid setting schg in the objtree for lib32 build.
   
   Reported by: kib
   Sponsored by:EMC / Isilon Storage Division
   MFC after:   1 week

 Modified:
   head/Makefile.inc1

 Modified: head/Makefile.inc1
 ==
 --- head/Makefile.inc1 Sat Nov 14 01:40:12 2015(r290811)
 +++ head/Makefile.inc1 Sat Nov 14 01:45:37 2015(r290812)
 @@ -716,10 +716,10 @@ build32: .PHONY
build-tools
  .endfor
${_+_}cd ${.CURDIR}; \
 -  ${LIB32WMAKE} -f Makefile.inc1 libraries
 +  ${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
  .for _t in obj depend all
${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
 -  DIRPRFX=libexec/rtld-elf/ ${_t}
 +  -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
DIRPRFX=usr.bin/ldd ${_t}
  .endfor
>>> Thank you.
>>>
>>> I remember, the previous attempts to fix this broke setting the noschg flag
>>> on the compat32 install.  This one seems to be correct, am I right ?
>>>
>>
>> Yes, the actual install is still safely setting schg.
>>
>> I am curious about your make.conf and src.conf though as I was unable to
>> reproduce the problem, but see evidence that this would fix it.
> 
> I have
> INSTALL?= install

Yup, this is why. The normal install into WORLDTMP uses
INSTALL=tools/install.sh which eats the fschg flag so it is never used.

Setting INSTALL in your make.conf seems OK to me, so I'll look at how to
fix the build to override INSTALL for WORLDTMP purposes.

> INSTALL+=-CS
> in make.conf.
> 
> src.conf is
> WITHOUT_PROFILE=yes
> but this should be not relevant.
> 


-- 
Regards,
Bryan Drewery
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r290812 - head

2015-11-17 Thread Konstantin Belousov
On Tue, Nov 17, 2015 at 11:08:32AM -0800, Bryan Drewery wrote:
> On 11/17/15 11:06 AM, Konstantin Belousov wrote:
> > On Tue, Nov 17, 2015 at 11:01:28AM -0800, Bryan Drewery wrote:
> >> On 11/17/15 12:55 AM, Konstantin Belousov wrote:
> >>> On Sat, Nov 14, 2015 at 01:45:37AM +, Bryan Drewery wrote:
>  Author: bdrewery
>  Date: Sat Nov 14 01:45:37 2015
>  New Revision: 290812
>  URL: https://svnweb.freebsd.org/changeset/base/290812
> 
>  Log:
>    Avoid setting schg in the objtree for lib32 build.
>    
>    Reported by:   kib
>    Sponsored by:  EMC / Isilon Storage Division
>    MFC after: 1 week
> 
>  Modified:
>    head/Makefile.inc1
> 
>  Modified: head/Makefile.inc1
>  ==
>  --- head/Makefile.inc1   Sat Nov 14 01:40:12 2015(r290811)
>  +++ head/Makefile.inc1   Sat Nov 14 01:45:37 2015(r290812)
>  @@ -716,10 +716,10 @@ build32: .PHONY
>   build-tools
>   .endfor
>   ${_+_}cd ${.CURDIR}; \
>  -${LIB32WMAKE} -f Makefile.inc1 libraries
>  +${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
>   .for _t in obj depend all
>   ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 
>  ${LIB32WMAKE} \
>  -DIRPRFX=libexec/rtld-elf/ ${_t}
>  +-DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
>   ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
>   DIRPRFX=usr.bin/ldd ${_t}
>   .endfor
> >>> Thank you.
> >>>
> >>> I remember, the previous attempts to fix this broke setting the noschg 
> >>> flag
> >>> on the compat32 install.  This one seems to be correct, am I right ?
> >>>
> >>
> >> Yes, the actual install is still safely setting schg.
> >>
> >> I am curious about your make.conf and src.conf though as I was unable to
> >> reproduce the problem, but see evidence that this would fix it.
> > 
> > I have
> > INSTALL?= install
> 
> Yup, this is why. The normal install into WORLDTMP uses
> INSTALL=tools/install.sh which eats the fschg flag so it is never used.
> 
> Setting INSTALL in your make.conf seems OK to me, so I'll look at how to
> fix the build to override INSTALL for WORLDTMP purposes.
I do not remember details, but, unless I am mistaken, it was some port
which required the INSTALL?= install, otherwise it tried to use "-CS"
command for installation.

> 
> > INSTALL+=-CS
> > in make.conf.
> > 
> > src.conf is
> > WITHOUT_PROFILE=yes
> > but this should be not relevant.
> > 
> 
> 
> -- 
> Regards,
> Bryan Drewery
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290998 - head

2015-11-17 Thread Baptiste Daroussin
Author: bapt
Date: Tue Nov 17 19:40:48 2015
New Revision: 290998
URL: https://svnweb.freebsd.org/changeset/base/290998

Log:
  Fix typo
  
  Submitted by: ngie

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Nov 17 19:03:55 2015(r290997)
+++ head/UPDATING   Tue Nov 17 19:40:48 2015(r290998)
@@ -39,7 +39,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
Databases administrators will need to reindex their databases given
collation results will be different.
 
-   Due to a bug in install(1) it is recommanded to remove the ancient
+   Due to a bug in install(1) it is recommended to remove the ancient
locales before running make installworld
 
rm -rf /usr/share/locale
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r290999 - head

2015-11-17 Thread Eitan Adler
Author: eadler
Date: Tue Nov 17 19:43:40 2015
New Revision: 290999
URL: https://svnweb.freebsd.org/changeset/base/290999

Log:
  Fix two spelling errors

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Nov 17 19:40:48 2015(r290998)
+++ head/UPDATING   Tue Nov 17 19:43:40 2015(r290999)
@@ -196,12 +196,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
like it always used to, and the difference will be irrelevant.
 
If you remove 'device random', you get *NO* kernel-processed
-   entopy at all. This may be acceptable to folks building
+   entropy at all. This may be acceptable to folks building
embedded systems, but has complications. Carry on reading,
and it is assumed you know what you need.
 
*PLEASE* read random(4) and random(9) if you are in the
-   habit of tweeking kernel configs, and/or if you are a member
+   habit of tweaking kernel configs, and/or if you are a member
of the embedded community, wanting specific and not-usual
behaviour from your security subsystems.
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r291000 - head/sys/dev/isp

2015-11-17 Thread Alexander Motin
Author: mav
Date: Tue Nov 17 19:57:49 2015
New Revision: 291000
URL: https://svnweb.freebsd.org/changeset/base/291000

Log:
  Register our FC4 Features in SNS.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/isp_library.h
  head/sys/dev/isp/isp_stds.h
  head/sys/dev/isp/ispmbox.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Tue Nov 17 19:43:40 2015(r290999)
+++ head/sys/dev/isp/isp.c  Tue Nov 17 19:57:49 2015(r291000)
@@ -125,6 +125,7 @@ static int isp_scan_fabric(ispsoftc_t *,
 static int isp_login_device(ispsoftc_t *, int, uint32_t, isp_pdb_t *, uint16_t 
*);
 static int isp_register_fc4_type(ispsoftc_t *, int);
 static int isp_register_fc4_type_24xx(ispsoftc_t *, int);
+static int isp_register_fc4_features_24xx(ispsoftc_t *, int);
 static uint16_t isp_next_handle(ispsoftc_t *, uint16_t *);
 static int isp_fw_state(ispsoftc_t *, int);
 static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int);
@@ -2927,6 +2928,8 @@ isp_fclink_test(ispsoftc_t *isp, int cha
}
fcp->isp_sns_hdl = NPH_SNS_ID;
r = isp_register_fc4_type_24xx(isp, chan);
+   if (r == 0)
+   isp_register_fc4_features_24xx(isp, chan);
} else {
fcp->isp_sns_hdl = SNS_ID;
r = isp_register_fc4_type(isp, chan);
@@ -4217,6 +4220,125 @@ isp_register_fc4_type_24xx(ispsoftc_t *i
}
 }
 
+static int
+isp_register_fc4_features_24xx(ispsoftc_t *isp, int chan)
+{
+   mbreg_t mbs;
+   fcparam *fcp = FCPARAM(isp, chan);
+   union {
+   isp_ct_pt_t plocal;
+   rff_id_t clocal;
+   uint8_t q[QENTRY_LEN];
+   } un;
+   isp_ct_pt_t *pt;
+   ct_hdr_t *ct;
+   rff_id_t *rp;
+   uint8_t *scp = fcp->isp_scratch;
+
+   if (FC_SCRATCH_ACQUIRE(isp, chan)) {
+   isp_prt(isp, ISP_LOGERR, sacq);
+   return (-1);
+   }
+
+   /*
+* Build a Passthrough IOCB in memory.
+*/
+   ISP_MEMZERO(un.q, QENTRY_LEN);
+   pt = &un.plocal;
+   pt->ctp_header.rqs_entry_count = 1;
+   pt->ctp_header.rqs_entry_type = RQSTYPE_CT_PASSTHRU;
+   pt->ctp_handle = 0x;
+   pt->ctp_nphdl = fcp->isp_sns_hdl;
+   pt->ctp_cmd_cnt = 1;
+   pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan);
+   pt->ctp_time = 1;
+   pt->ctp_rsp_cnt = 1;
+   pt->ctp_rsp_bcnt = sizeof (ct_hdr_t);
+   pt->ctp_cmd_bcnt = sizeof (rff_id_t);
+   pt->ctp_dataseg[0].ds_base = DMA_LO32(fcp->isp_scdma+XTXOFF);
+   pt->ctp_dataseg[0].ds_basehi = DMA_HI32(fcp->isp_scdma+XTXOFF);
+   pt->ctp_dataseg[0].ds_count = sizeof (rff_id_t);
+   pt->ctp_dataseg[1].ds_base = DMA_LO32(fcp->isp_scdma+IGPOFF);
+   pt->ctp_dataseg[1].ds_basehi = DMA_HI32(fcp->isp_scdma+IGPOFF);
+   pt->ctp_dataseg[1].ds_count = sizeof (ct_hdr_t);
+   isp_put_ct_pt(isp, pt, (isp_ct_pt_t *) &scp[CTXOFF]);
+   if (isp->isp_dblev & ISP_LOGDEBUG1) {
+   isp_print_bytes(isp, "IOCB CT Request", QENTRY_LEN, pt);
+   }
+
+   /*
+* Build the CT header and command in memory.
+*
+* Note that the CT header has to end up as Big Endian format in memory.
+*/
+   ISP_MEMZERO(&un.clocal, sizeof (un.clocal));
+   ct = &un.clocal.rffid_hdr;
+   ct->ct_revision = CT_REVISION;
+   ct->ct_fcs_type = CT_FC_TYPE_FC;
+   ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS;
+   ct->ct_cmd_resp = SNS_RFF_ID;
+   ct->ct_bcnt_resid = (sizeof (rff_id_t) - sizeof (ct_hdr_t)) >> 2;
+   rp = &un.clocal;
+   rp->rffid_portid[0] = fcp->isp_portid >> 16;
+   rp->rffid_portid[1] = fcp->isp_portid >> 8;
+   rp->rffid_portid[2] = fcp->isp_portid;
+   rp->rffid_fc4features = 0;
+   if (fcp->role & ISP_ROLE_TARGET)
+   rp->rffid_fc4features |= 1;
+   if (fcp->role & ISP_ROLE_INITIATOR)
+   rp->rffid_fc4features |= 2;
+   rp->rffid_fc4type = FC4_SCSI;
+   isp_put_rff_id(isp, rp, (rff_id_t *) &scp[XTXOFF]);
+   if (isp->isp_dblev & ISP_LOGDEBUG1) {
+   isp_print_bytes(isp, "CT Header", QENTRY_LEN, &scp[XTXOFF]);
+   }
+
+   ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t));
+
+   MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 100);
+   mbs.param[1] = QENTRY_LEN;
+   mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF);
+   mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF);
+   mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF);
+   mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF);
+   MEMORYBARRIER(isp, SYNC_SFORDEV, XTXOFF, 2 * QENTRY_LEN, chan);
+   isp_mboxcmd(isp, &mbs);
+   if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
+   FC_SCRATCH_RELEASE(isp, chan);
+   return (-1

svn commit: r291001 - head/sys/netpfil/ipfw

2015-11-17 Thread Bryan Drewery
Author: bdrewery
Date: Tue Nov 17 20:42:08 2015
New Revision: 291001
URL: https://svnweb.freebsd.org/changeset/base/291001

Log:
  Fix dynamic IPv6 rules showing junk for non-specified address masks.
  
  For example:
2  0 0 (19s) PARENT 1 tcp 10.10.0.5 0 <-> 0.0.0.0 0
2  4   412 (1s) LIMIT tcp 10.10.0.5 25848 <-> 10.10.0.7 22
2 10   777 (1s) LIMIT tcp 2001:894:5a24:653::503:1 52023 <-> 
2001:894:5a24:653:ca0a:a9ff:fe04:3978 22
2  0 0 (17s) PARENT 1 tcp 2001:894:5a24:653::503:1 0 <-> 
80f3:70d:23fe::1005:: 0
  
  Fix this by zeroing the unused address, as is done for IPv4:
2 0 0 (18s) PARENT 1 tcp 10.10.0.5 0 <-> 0.0.0.0 0
236 14952 (1s) LIMIT tcp 10.10.0.5 25848 <-> 10.10.0.7 22
2 0 0 (0s) PARENT 1 tcp 2001:894:5a24:653::503:1 0 <-> :: 0
2 4   345 (274s) LIMIT tcp 2001:894:5a24:653::503:1 34131 <-> 
2001:470:1f11:262:ca0a:a9ff:fe04:3978 22
  
  MFC after:2 weeks

Modified:
  head/sys/netpfil/ipfw/ip_fw_dynamic.c

Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c
==
--- head/sys/netpfil/ipfw/ip_fw_dynamic.c   Tue Nov 17 19:57:49 2015
(r291000)
+++ head/sys/netpfil/ipfw/ip_fw_dynamic.c   Tue Nov 17 20:42:08 2015
(r291001)
@@ -735,6 +735,9 @@ ipfw_install_state(struct ip_fw_chain *c
id.fib = M_GETFIB(args->m);
 
if (IS_IP6_FLOW_ID (&(args->f_id))) {
+   bzero(&id.src_ip6, sizeof(id.src_ip6));
+   bzero(&id.dst_ip6, sizeof(id.dst_ip6));
+
if (limit_mask & DYN_SRC_ADDR)
id.src_ip6 = args->f_id.src_ip6;
if (limit_mask & DYN_DST_ADDR)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r291002 - head/usr.sbin/mpsutil

2015-11-17 Thread Baptiste Daroussin
Author: bapt
Date: Tue Nov 17 20:42:59 2015
New Revision: 291002
URL: https://svnweb.freebsd.org/changeset/base/291002

Log:
  mpsutil/mprutil: add flash subcommand
  
  the flash subcommand allows to save/update firmware and bios for LSI 
Fusion-MPT
  2/3 controllers (mps(4) and mpr(4))
  
  Tested by:allanjude
  Reviewed by:  wblock (manpage)
  Relnotes: yes
  Sponsored by: Gandi.net
  Differential Revision:https://reviews.freebsd.org/D4026

Added:
  head/usr.sbin/mpsutil/mps_flash.c   (contents, props changed)
Modified:
  head/usr.sbin/mpsutil/Makefile
  head/usr.sbin/mpsutil/mps_cmd.c
  head/usr.sbin/mpsutil/mpsutil.8
  head/usr.sbin/mpsutil/mpsutil.h

Modified: head/usr.sbin/mpsutil/Makefile
==
--- head/usr.sbin/mpsutil/Makefile  Tue Nov 17 20:42:08 2015
(r291001)
+++ head/usr.sbin/mpsutil/Makefile  Tue Nov 17 20:42:59 2015
(r291002)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PROG=  mpsutil
-SRCS=  mpsutil.c mps_cmd.c mps_show.c
+SRCS=  mps_cmd.c mps_flash.c mps_show.c mpsutil.c
 MAN=   mpsutil.8
 
 WARNS?= 3

Modified: head/usr.sbin/mpsutil/mps_cmd.c
==
--- head/usr.sbin/mpsutil/mps_cmd.c Tue Nov 17 20:42:08 2015
(r291001)
+++ head/usr.sbin/mpsutil/mps_cmd.c Tue Nov 17 20:42:59 2015
(r291002)
@@ -1,4 +1,6 @@
 /*-
+ * Copyright (c) 2015 Baptiste Daroussin 
+ *
  * Copyright (c) 2015 Netflix, Inc.
  * All rights reserved.
  * Written by: Scott Long 
@@ -442,6 +444,62 @@ mps_read_extended_config_page(int fd, U8
return (buf);
 }
 
+int
+mps_firmware_send(int fd, unsigned char *fw, uint32_t len, bool bios)
+{
+   MPI2_FW_DOWNLOAD_REQUEST req;
+   MPI2_FW_DOWNLOAD_REPLY reply;
+
+   bzero(&req, sizeof(req));
+   bzero(&reply, sizeof(reply));
+   req.Function = MPI2_FUNCTION_FW_DOWNLOAD;
+   req.ImageType = bios ? MPI2_FW_DOWNLOAD_ITYPE_BIOS : 
MPI2_FW_DOWNLOAD_ITYPE_FW;
+   req.TotalImageSize = len;
+   req.MsgFlags = MPI2_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT;
+
+   if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply),
+   fw, len, 0)) {
+   return (-1);
+   }
+   return (0);
+}
+
+int
+mps_firmware_get(int fd, unsigned char **firmware, bool bios)
+{
+   MPI2_FW_UPLOAD_REQUEST req;
+   MPI2_FW_UPLOAD_REPLY reply;
+   int size;
+
+   *firmware = NULL;
+   bzero(&req, sizeof(req));
+   bzero(&reply, sizeof(reply));
+   req.Function = MPI2_FUNCTION_FW_UPLOAD;
+   req.ImageType = bios ? MPI2_FW_DOWNLOAD_ITYPE_BIOS : 
MPI2_FW_DOWNLOAD_ITYPE_FW;
+
+   if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply),
+   NULL, 0, 0)) {
+   return (-1);
+   }
+   if (reply.ActualImageSize == 0) {
+   return (-1);
+   }
+
+   size = reply.ActualImageSize;
+   *firmware = calloc(1, sizeof(char) * size);
+   if (*firmware == NULL) {
+   warn("calloc");
+   return (-1);
+   }
+   if (mps_user_command(fd, &req, sizeof(req), &reply, sizeof(reply),
+   *firmware, size, 0)) {
+   free(*firmware);
+   return (-1);
+   }
+
+   return (size);
+}
+
 #else
 
 int

Added: head/usr.sbin/mpsutil/mps_flash.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/mpsutil/mps_flash.c   Tue Nov 17 20:42:59 2015
(r291002)
@@ -0,0 +1,237 @@
+/*-
+ * Copyright (c) 2015 Baptiste Daroussin 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */

svn commit: r291003 - head/secure/lib/libcrypto

2015-11-17 Thread Jung-uk Kim
Author: jkim
Date: Tue Nov 17 20:47:16 2015
New Revision: 291003
URL: https://svnweb.freebsd.org/changeset/base/291003

Log:
  Simplify man-makefile-update target.

Modified:
  head/secure/lib/libcrypto/Makefile.inc

Modified: head/secure/lib/libcrypto/Makefile.inc
==
--- head/secure/lib/libcrypto/Makefile.inc  Tue Nov 17 20:42:59 2015
(r291002)
+++ head/secure/lib/libcrypto/Makefile.inc  Tue Nov 17 20:47:16 2015
(r291003)
@@ -72,13 +72,13 @@ man-makefile-update:
${.CURDIR}/Makefile.man
for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
fn=`basename $$i .pod`; \
-   if ! echo ' ${_skip} ' | grep -q " $$fn "; then \
+   if ! echo '${_skip}' | grep -qw "$$fn"; then \
${ECHO} "MAN+= $$fn.${_sec}" >> ${.CURDIR}/Makefile.man; \
fi; \
done
for i in ${LCRYPTO_DOC}/${_docs}/*.pod; do \
fn=`basename $$i .pod`; \
-   if ! echo ' ${_skip} ' | grep -q " $$fn "; then \
+   if ! echo '${_skip}' | grep -qw "$$fn"; then \
perl ${LCRYPTO_SRC}/util/extract-names.pl < $$i | \
  awk "/^$$fn\$$/ { next; } \
  { print \"MLINKS+= $$fn.${_sec} \" \$$1 \".${_sec}\" }" >> \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r291004 - head/sys/geom

2015-11-17 Thread Steven Hartland
Author: smh
Date: Tue Nov 17 20:55:50 2015
New Revision: 291004
URL: https://svnweb.freebsd.org/changeset/base/291004

Log:
  Fix early kernel dump via dumpdev env
  
  Setting the dumpdev via env e.g. loader.conf provides the ability to
  configure the kernel dump device during early boot. When using this
  g_io_getattr was returning EPERM due to cp->acr == 0.
  
  Fix this by calling g_access to ensure we're a read consumer prior
  to calling g_dev_setdumpdev.
  
  MFC after:2 weeks
  Sponsored by: Multiplay

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==
--- head/sys/geom/geom_dev.cTue Nov 17 20:47:16 2015(r291003)
+++ head/sys/geom/geom_dev.cTue Nov 17 20:55:50 2015(r291004)
@@ -150,24 +150,38 @@ g_dev_setdumpdev(struct cdev *dev, struc
return (error);
 }
 
-static void
+static int
 init_dumpdev(struct cdev *dev)
 {
+   struct g_consumer *cp;
const char *devprefix = "/dev/", *devname;
+   int error;
size_t len;
 
if (dumpdev == NULL)
-   return;
+   return (0);
+
len = strlen(devprefix);
devname = devtoname(dev);
if (strcmp(devname, dumpdev) != 0 &&
   (strncmp(dumpdev, devprefix, len) != 0 ||
strcmp(devname, dumpdev + len) != 0))
-   return;
-   if (g_dev_setdumpdev(dev, curthread) == 0) {
+   return (0);
+
+   cp = (struct g_consumer *)dev->si_drv2;
+   error = g_access(cp, 1, 0, 0);
+   if (error != 0)
+   return (error);
+
+   error = g_dev_setdumpdev(dev, curthread);
+   if (error == 0) {
freeenv(dumpdev);
dumpdev = NULL;
}
+
+   (void)g_access(cp, -1, 0, 0);
+
+   return (error);
 }
 
 static void
@@ -312,7 +326,10 @@ g_dev_taste(struct g_class *mp, struct g
 
dev->si_iosize_max = MAXPHYS;
dev->si_drv2 = cp;
-   init_dumpdev(dev);
+   error = init_dumpdev(dev);
+   if (error != 0)
+   printf("%s: init_dumpdev() failed (gp->name=%s, error=%d)\n",
+   __func__, gp->name, error);
 
g_dev_attrchanged(cp, "GEOM::physpath");
snprintf(buf, sizeof(buf), "cdev=%s", gp->name);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-11-17 Thread Allan Jude
Author: allanjude
Date: Tue Nov 17 21:02:27 2015
New Revision: 291005
URL: https://svnweb.freebsd.org/changeset/base/291005

Log:
  Add a kernel config for the Onion Omega
  
  Small $25 IoT device, 400mhz Atheros cpu, Atheros WiFi and Ethernet
  18 GPIOs, and support for Relay, Servo, and OLED expansion
  https://onion.io/omega/
  
  Reviewed by:  adrian
  Approved by:  bapt (mentor)
  Relnotes: yes
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D4188

Added:
  head/sys/mips/conf/ONIONOMEGA   (contents, props changed)
  head/sys/mips/conf/ONIONOMEGA.hints   (contents, props changed)

Added: head/sys/mips/conf/ONIONOMEGA
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/ONIONOMEGA   Tue Nov 17 21:02:27 2015
(r291005)
@@ -0,0 +1,53 @@
+#
+# Onion Omega - an AR9330 based SoC
+#
+# https://onion.io/omega/
+#
+# * AR9330 SoC
+# * 64MB RAM
+# * 16MB flash
+# * Integrated 1x1 2GHz wifi and optional 10/100 ethernet
+#
+# $FreeBSD$
+#
+
+# Include the default AR933x parameters
+include "AR933X_BASE"
+
+ident   ONIONOMEGA
+
+# Override hints with board values
+hints   "ONIONOMEGA.hints"
+
+# Board memory - 64MB
+options AR71XX_REALMEM=(64*1024*1024)
+
+# i2c GPIO bus
+#devicegpioiic
+#deviceiicbb
+#deviceiicbus
+#deviceiic
+
+# Options required for miiproxy and mdiobus
+optionsARGE_MDIO   # Export an MDIO bus separate from arge
+device miiproxy# MDIO bus <-> MII PHY rendezvous
+
+device etherswitch
+device arswitch
+
+# read MSDOS formatted disks - USB
+#options   MSDOSFS
+
+# Enable the uboot environment stuff rather then the
+# redboot stuff.
+optionsAR71XX_ENV_UBOOT
+
+# uzip - to boot natively from flash
+device geom_uncompress
+optionsGEOM_UNCOMPRESS
+
+# Used for the static uboot partition map
+device  geom_map
+
+# Boot off of the rootfs, as defined in the geom_map setup.
+optionsROOTDEVNAME=\"ufs:map/rootfs.uncompress\"

Added: head/sys/mips/conf/ONIONOMEGA.hints
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/ONIONOMEGA.hints Tue Nov 17 21:02:27 2015
(r291005)
@@ -0,0 +1,94 @@
+#
+# This file adds to the values in AR933X_BASE.hints.
+#
+# $FreeBSD$
+
+# mdiobus on arge1
+hint.argemdio.0.at="nexus0"
+hint.argemdio.0.maddr=0x1a00
+hint.argemdio.0.msize=0x1000
+hint.argemdio.0.order=0
+
+# Embedded Atheros Switch
+hint.arswitch.0.at="mdio0"
+
+# XXX this should really say it's an AR933x switch, as there
+# are some vlan specific differences here!
+hint.arswitch.0.is_7240=1
+hint.arswitch.0.numphys=4
+hint.arswitch.0.phy4cpu=1  # phy 4 is a "CPU" separate PHY
+hint.arswitch.0.is_rgmii=0
+hint.arswitch.0.is_gmii=1  # arge1 <-> switch PHY is GMII
+
+# arge0 - MII, autoneg, phy(4)
+hint.arge.0.phymask=0x10   # PHY4
+hint.arge.0.mdio=mdioproxy1# .. off of the switch mdiobus
+hint.arge.0.eeprommac=0x1fff
+
+# arge1 - GMII, 1000/full
+hint.arge.1.phymask=0x0# No directly mapped PHYs
+hint.arge.1.media=1000
+hint.arge.1.fduplex=1
+hint.arge.1.eeprommac=0x1fff0006
+
+# 16MB flash layout:
+# [0.51] 5 tp-link partitions found on MTD device spi0.0
+# [0.51] Creating 5 MTD partitions on "spi0.0":
+# [0.52] 0x-0x0002 : "u-boot"
+# [0.52] 0x0002-0x00136468 : "kernel"
+# [0.53] 0x00136468-0x00ff : "rootfs"
+# [0.53] mtd: device 2 (rootfs) set to be root filesystem
+# [0.54] 1 squashfs-split partitions found on MTD device rootfs
+# [0.54] 0x0073-0x00fe : "rootfs_data"
+# [0.54] 0x00fe-0x00ff : "nvram"
+# [0.55] 0x00ff-0x0100 : "art"
+# [0.56] 0x0002-0x00fe : "firmware"
+
+# 64KiB uboot
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x
+hint.map.0.end=0x0001
+hint.map.0.name="u-boot"
+hint.map.0.readonly=1
+
+# 64KiB uboot
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x0001
+hint.map.1.end=0x0002
+hint.map.1.name="uboot-env"
+hint.map.1.readonly=1
+
+# kernel
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x0002
+hint.map.2.end="search:0x0002:0x1:.!/bin/sh"
+hint.map.2.name="kernel"
+hint.map.2.readonly=1
+
+# rootfs ulzma
+hint.map.3.at="flash/spi0"
+hint.map.3.start="search:0x0002:0x1:.!/bin/sh"
+hint.map.3.end=0x00fe
+hint.map.3.name="rootfs"
+hint.map.3.readonly=1
+
+# 64KiB cfg
+hint.map.4.at="flash/spi0"
+hint.map.4.start=0x00fe
+hint.map.4.end=0x00ff
+hint.map.4.name="cfg"
+hint.map.4.readonly=0
+
+# all firmware 16000KiB
+hint.map.5.at="flash/spi0"

svn commit: r291008 - in head/sys: conf powerpc/mpc85xx

2015-11-17 Thread Justin Hibbits
Author: jhibbits
Date: Wed Nov 18 01:54:19 2015
New Revision: 291008
URL: https://svnweb.freebsd.org/changeset/base/291008

Log:
  Add support for new LAW registers in QorIQ SoCs.
  
  QorIQ SoCs (e5500 core, P5 family) have 2 BARs for local access windows, while
  MPC85XX, and P1/P2 families use only a single BAR register.
  
  This also adds the QORIQ_DPAA option, mutually exclusive to MPC85XX, to handle
  this difference.
  
  Obtained from:Semihalf
  Sponsored by: Alex Perez/Inertial Computing

Modified:
  head/sys/conf/files.powerpc
  head/sys/conf/options.powerpc
  head/sys/powerpc/mpc85xx/mpc85xx.c
  head/sys/powerpc/mpc85xx/mpc85xx.h

Modified: head/sys/conf/files.powerpc
==
--- head/sys/conf/files.powerpc Tue Nov 17 21:29:26 2015(r291007)
+++ head/sys/conf/files.powerpc Wed Nov 18 01:54:19 2015(r291008)
@@ -74,7 +74,7 @@ dev/syscons/scvtb.c   optionalsc
 dev/tsec/if_tsec.c optionaltsec
 dev/tsec/if_tsec_fdt.c optionaltsec fdt
 dev/uart/uart_cpu_powerpc.coptionaluart
-dev/usb/controller/ehci_fsl.c  optionalehci mpc85xx
+dev/usb/controller/ehci_fsl.c  optionalehci mpc85xx | ehci qoriq_dpaa
 dev/vt/hw/ofwfb/ofwfb.coptionalvt aim
 kern/kern_clocksource.cstandard
 kern/subr_dummy_vdso_tc.c  standard
@@ -133,15 +133,15 @@ powerpc/mikrotik/platform_rb.coptional
 powerpc/mpc85xx/atpic.coptionalmpc85xx isa
 powerpc/mpc85xx/ds1553_bus_fdt.c   optionalds1553 fdt
 powerpc/mpc85xx/ds1553_core.c  optionalds1553
-powerpc/mpc85xx/fsl_sdhc.c optionalmpc85xx sdhc
+powerpc/mpc85xx/fsl_sdhc.c optionalmpc85xx sdhc | qoriq_dpaa sdhc
 powerpc/mpc85xx/i2c.c  optionaliicbus fdt
 powerpc/mpc85xx/isa.c  optionalmpc85xx isa
-powerpc/mpc85xx/lbc.c  optionalmpc85xx
-powerpc/mpc85xx/mpc85xx.c  optionalmpc85xx
+powerpc/mpc85xx/lbc.c  optionalmpc85xx | qoriq_dpaa
+powerpc/mpc85xx/mpc85xx.c  optionalmpc85xx | qoriq_dpaa
 powerpc/mpc85xx/mpc85xx_gpio.c optionalmpc85xx gpio
-powerpc/mpc85xx/platform_mpc85xx.c optionalmpc85xx
-powerpc/mpc85xx/pci_mpc85xx.c  optionalpci mpc85xx
-powerpc/mpc85xx/pci_mpc85xx_pcib.c optionalpci mpc85xx
+powerpc/mpc85xx/platform_mpc85xx.c optionalmpc85xx | qoriq_dpaa
+powerpc/mpc85xx/pci_mpc85xx.c  optionalpci mpc85xx | pci qoriq_dpaa
+powerpc/mpc85xx/pci_mpc85xx_pcib.c optionalpci mpc85xx | pci 
qoriq_dpaa
 powerpc/ofw/ofw_machdep.c  standard
 powerpc/ofw/ofw_pci.c  optionalpci
 powerpc/ofw/ofw_pcibus.c   optionalpci

Modified: head/sys/conf/options.powerpc
==
--- head/sys/conf/options.powerpc   Tue Nov 17 21:29:26 2015
(r291007)
+++ head/sys/conf/options.powerpc   Wed Nov 18 01:54:19 2015
(r291008)
@@ -21,6 +21,7 @@ GFB_NO_MODE_CHANGEopt_gfb.h
 MPC85XXopt_platform.h
 POWERMAC   opt_platform.h
 PS3opt_platform.h
+QORIQ_DPAA opt_platform.h
 MAMBO
 PSERIES
 PSIM

Modified: head/sys/powerpc/mpc85xx/mpc85xx.c
==
--- head/sys/powerpc/mpc85xx/mpc85xx.c  Tue Nov 17 21:29:26 2015
(r291007)
+++ head/sys/powerpc/mpc85xx/mpc85xx.c  Wed Nov 18 01:54:19 2015
(r291008)
@@ -27,6 +27,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_platform.h"
 #include 
 #include 
 #include 
@@ -45,6 +46,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+
 /*
  * MPC85xx system specific routines
  */
@@ -70,70 +72,133 @@ int
 law_getmax(void)
 {
uint32_t ver;
+   int law_max;
 
ver = SVR_VER(mfspr(SPR_SVR));
-   if (ver == SVR_MPC8555E || ver == SVR_MPC8555)
-   return (8);
-   if (ver == SVR_MPC8548E || ver == SVR_MPC8548 ||
-   ver == SVR_MPC8533E || ver == SVR_MPC8533)
-   return (10);
+   switch (ver) {
+   case SVR_MPC8555:
+   case SVR_MPC8555E:
+   law_max = 8;
+   break;
+   case SVR_MPC8533:
+   case SVR_MPC8533E:
+   case SVR_MPC8548:
+   case SVR_MPC8548E:
+   law_max = 10;
+   break;
+   case SVR_P5020:
+   case SVR_P5020E:
+   law_max = 32;
+   break;
+   default:
+   law_max = 8;
+   }
 
-   return (12);
+   return (law_max);
+}
+
+static inline void
+law_write(uint32_t n, uint64_t bar, uint32_t sr)
+{
+#if defined(QORIQ_DPAA)
+   ccsr_write4(OCP85XX_LAWBARH(n), bar >> 32);
+   ccsr_write4(OCP85XX_LAWBARL(n), bar);
+#else
+   ccsr_write4(OCP85XX_LAWBAR(n), bar >> 12);
+#e

svn commit: r291009 - head/sys/powerpc/include

2015-11-17 Thread Justin Hibbits
Author: jhibbits
Date: Wed Nov 18 02:18:14 2015
New Revision: 291009
URL: https://svnweb.freebsd.org/changeset/base/291009

Log:
  Physical addresses for e500mc/e5500 are 36-bits, e6500 is 40-bits.
  
  Increase BUS_SPACE_MAXADDR to allow for this.
  
  Sponsored by: Alex Perez/Inertial Computing

Modified:
  head/sys/powerpc/include/bus.h

Modified: head/sys/powerpc/include/bus.h
==
--- head/sys/powerpc/include/bus.h  Wed Nov 18 01:54:19 2015
(r291008)
+++ head/sys/powerpc/include/bus.h  Wed Nov 18 02:18:14 2015
(r291009)
@@ -79,9 +79,14 @@
 #define BUS_SPACE_MAXADDR  0xUL
 #define BUS_SPACE_MAXSIZE  0xUL
 #else
+#ifdef BOOKE
+#define BUS_SPACE_MAXADDR  0xFFULL
+#define BUS_SPACE_MAXSIZE  0xUL
+#else
 #define BUS_SPACE_MAXADDR  0xUL
 #define BUS_SPACE_MAXSIZE  0xUL
 #endif
+#endif
 
 #defineBUS_SPACE_MAP_CACHEABLE 0x01
 #defineBUS_SPACE_MAP_LINEAR0x02
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r290976 - head

2015-11-17 Thread Alexey Dokuchaev
On Tue, Nov 17, 2015 at 08:43:26AM -0800, Garrett Cooper wrote:
> > On Nov 17, 2015, at 04:18, Baptiste Daroussin  wrote:
> > New Revision: 290976
> > URL: https://svnweb.freebsd.org/changeset/base/290976
> > 
> > +Due to a bug in install(1) it is recommanded to remove the ancient
> > +locales before running make installworld
> 
> *recommended

*sigh* and missing full stop.  Guys, please, when hunting for typos and
grammar mistakes try to cover them all.

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


svn commit: r291010 - in head/sys: conf dev/uart

2015-11-17 Thread Adrian Chadd
Author: adrian
Date: Wed Nov 18 06:24:21 2015
New Revision: 291010
URL: https://svnweb.freebsd.org/changeset/base/291010

Log:
  uart(4) - make the 8250 uart baudrate tolerance build time tweakable.
  
  It turns out on a 16550 w/ a 25MHz SoC reference clock you get a little
  over 3% error at 115200 baud, which causes this to fail.
  
  Just .. cope. Things cope these days.
  
  Default to 30 (3.0%) as before, but allow UART_DEV_TOLERANCE_PCT to be
  set at build time to change that.

Modified:
  head/sys/conf/options
  head/sys/dev/uart/uart_dev_ns8250.c

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Wed Nov 18 02:18:14 2015(r291009)
+++ head/sys/conf/options   Wed Nov 18 06:24:21 2015(r291010)
@@ -650,6 +650,7 @@ BKTR_NEW_MSP34XX_DRIVER opt_bktr.h
 # Options for uart(4)
 UART_PPS_ON_CTSopt_uart.h
 UART_POLL_FREQ opt_uart.h
+UART_DEV_TOLERANCE_PCT opt_uart.h
 
 # options for bus/device framework
 BUS_DEBUG  opt_bus.h

Modified: head/sys/dev/uart/uart_dev_ns8250.c
==
--- head/sys/dev/uart/uart_dev_ns8250.c Wed Nov 18 02:18:14 2015
(r291009)
+++ head/sys/dev/uart/uart_dev_ns8250.c Wed Nov 18 06:24:21 2015
(r291010)
@@ -25,6 +25,7 @@
  */
 
 #include "opt_platform.h"
+#include "opt_uart.h"
 
 #include 
 __FBSDID("$FreeBSD$");
@@ -57,6 +58,16 @@ __FBSDID("$FreeBSD$");
 
 #defineDEFAULT_RCLK1843200
 
+/*
+ * Set the default baudrate tolerance to 3.0%.
+ *
+ * Some embedded boards have odd reference clocks (eg 25MHz)
+ * and we need to handle higher variances in the target baud rate.
+ */
+#ifndefUART_DEV_TOLERANCE_PCT
+#defineUART_DEV_TOLERANCE_PCT  30
+#endif /* UART_DEV_TOLERANCE_PCT */
+
 static int broken_txfifo = 0;
 SYSCTL_INT(_hw, OID_AUTO, broken_txfifo, CTLFLAG_RWTUN,
&broken_txfifo, 0, "UART FIFO has QEMU emulation bug");
@@ -123,8 +134,8 @@ ns8250_divisor(int rclk, int baudrate)
/* 10 times error in percent: */
error = ((actual_baud - baudrate) * 2000 / baudrate + 1) >> 1;
 
-   /* 3.0% maximum error tolerance: */
-   if (error < -30 || error > 30)
+   /* enforce maximum error tolerance: */
+   if (error < -UART_DEV_TOLERANCE_PCT || error > UART_DEV_TOLERANCE_PCT)
return (0);
 
return (divisor);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-11-17 Thread Adrian Chadd
Author: adrian
Date: Wed Nov 18 06:25:25 2015
New Revision: 291011
URL: https://svnweb.freebsd.org/changeset/base/291011

Log:
  Add the QCA9533 base configuration file and an example configuration
  for the AP143.
  
  Wifi doesn't work on the QCA9533 board, but basic ethernet/ethernet
  and ethernet switch support does work.
  
  The AP143 has 32MB RAM and 4MB flash, so this was tested with a USB
  rootfs.
  
  Tested:
  
  * QCA9533v2, AP143 reference design board.

Added:
  head/sys/mips/conf/AP143   (contents, props changed)
  head/sys/mips/conf/AP143.hints   (contents, props changed)
  head/sys/mips/conf/QCA953X_BASE   (contents, props changed)
  head/sys/mips/conf/QCA953X_BASE.hints   (contents, props changed)

Added: head/sys/mips/conf/AP143
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/AP143Wed Nov 18 06:25:25 2015(r291011)
@@ -0,0 +1,51 @@
+#
+# AP143 - the AP143 reference board from Qualcomm Atheros includes:
+#
+# * AR9330 SoC
+# * 32MB RAM
+# * 4MB flash
+# * Integrated 1x1 2GHz wifi and 10/100 bridge
+#
+# $FreeBSD$
+#
+
+# Include the default QCA953x parameters
+include "QCA953X_BASE"
+
+ident   AP143
+
+# Override hints with board values
+hints   "AP143.hints"
+
+# Force the board memory - the base AP121 only has 16MB RAM
+options AR71XX_REALMEM=(32*1024*1024)
+
+# i2c GPIO bus
+#devicegpioiic
+#deviceiicbb
+#deviceiicbus
+#deviceiic
+
+# Options required for miiproxy and mdiobus
+optionsARGE_MDIO   # Export an MDIO bus separate from arge
+device miiproxy# MDIO bus <-> MII PHY rendezvous
+
+device etherswitch
+device arswitch
+
+# read MSDOS formatted disks - USB
+#options   MSDOSFS
+
+# Enable the uboot environment stuff rather then the
+# redboot stuff.
+optionsAR71XX_ENV_UBOOT
+
+# uzip - to boot natively from flash
+device geom_uncompress
+optionsGEOM_UNCOMPRESS
+
+# Used for the static uboot partition map
+device  geom_map
+
+# Boot off of the rootfs, as defined in the geom_map setup.
+optionsROOTDEVNAME=\"ufs:map/rootfs.uncompress\"

Added: head/sys/mips/conf/AP143.hints
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/AP143.hints  Wed Nov 18 06:25:25 2015
(r291011)
@@ -0,0 +1,105 @@
+#
+# This file adds to the values in QCA953X_BASE.hints.
+#
+# $FreeBSD$
+
+# Embedded Atheros Switch
+hint.arswitch.0.at="mdio1"
+hint.arswitch.0.is_7240=0
+hint.arswitch.0.is_9340=1
+hint.arswitch.0.numphys=4
+hint.arswitch.0.phy4cpu=1  # phy 4 is a "CPU" separate PHY
+hint.arswitch.0.is_rgmii=0
+hint.arswitch.0.is_gmii=1  # arge1 <-> switch PHY is GMII
+
+# arge0 - MII, autoneg, phy(4)
+# MAC for arge0 is the first 6 bytes of the ART
+hint.arge.0.eeprommac=0x1fff
+hint.arge.0.phymask=0x10   # PHY4
+hint.arge.0.mdio=mdioproxy2# .. off of the switch mdiobus
+
+# arge1 - GMII, 1000/full
+hint.arge.1.eeprommac=0x1fff0006
+hint.arge.1.phymask=0x0# No directly mapped PHYs
+hint.arge.1.media=1000
+hint.arge.1.fduplex=1
+
+# The AP121 4MB flash layout:
+#
+# bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs
+#init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),
+#2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
+#
+# So:
+# 256k: uboot
+# 64: uboot-env
+# 2752k: rootfs
+# 896k: kernel
+# 64k: config
+# 64k: ART
+
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x
+hint.map.0.end=0x4
+hint.map.0.name="uboot"
+hint.map.0.readonly=1
+
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x0004
+hint.map.1.end=0x0005
+hint.map.1.name="uboot-env"
+hint.map.1.readonly=0
+
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x0005
+hint.map.2.end=0x0030
+hint.map.2.name="rootfs"
+hint.map.2.readonly=0
+
+hint.map.3.at="flash/spi0"
+hint.map.3.start=0x0030
+hint.map.3.end=0x003e
+hint.map.3.name="kernel"
+hint.map.3.readonly=0
+
+hint.map.4.at="flash/spi0"
+hint.map.4.start=0x003e
+hint.map.4.end=0x003f
+hint.map.4.name="cfg"
+hint.map.4.readonly=0
+
+# This is radio calibration section.  It is (or should be!) unique
+# for each board, to take into account thermal and electrical differences
+# as well as the regulatory compliance data.
+#
+hint.map.5.at="flash/spi0"
+hint.map.5.start=0x003f
+hint.map.5.end=0x0040
+hint.map.5.name="art"
+hint.map.5.readonly=1
+
+# GPIO specific configuration block
+
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x
+hint.gpio.0.function_clear=0x
+
+# These are the GPIO LEDs and buttons which can be