svn commit: r301302 - head/sys/dev/usb/wlan

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sat Jun  4 07:18:39 2016
New Revision: 301302
URL: https://svnweb.freebsd.org/changeset/base/301302

Log:
  [run] fix TSF locking in RX radiotap.
  
  Submitted by: Imre Vadasz 

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

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Sat Jun  4 05:46:52 2016
(r301301)
+++ head/sys/dev/usb/wlan/if_run.c  Sat Jun  4 07:18:39 2016
(r301302)
@@ -2829,7 +2829,9 @@ run_rx_frame(struct run_softc *sc, struc
tap->wr_antenna = ant;
tap->wr_dbm_antsignal = run_rssi2dbm(sc, rssi, ant);
tap->wr_rate = 2;   /* in case it can't be found below */
+   RUN_LOCK(sc);
run_get_tsf(sc, &tap->wr_tsf);
+   RUN_UNLOCK(sc);
phy = le16toh(rxwi->phy);
switch (phy & RT2860_PHY_MODE) {
case RT2860_PHY_CCK:
___
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: r301303 - head/sys/dev/ath/ath_hal

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sat Jun  4 07:28:09 2016
New Revision: 301303
URL: https://svnweb.freebsd.org/changeset/base/301303

Log:
  [ath_hal] add BTCOEX_STOMP_AUDIO; delete unused methods.

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

Modified: head/sys/dev/ath/ath_hal/ah_btcoex.h
==
--- head/sys/dev/ath/ath_hal/ah_btcoex.hSat Jun  4 07:18:39 2016
(r301302)
+++ head/sys/dev/ath/ath_hal/ah_btcoex.hSat Jun  4 07:28:09 2016
(r301303)
@@ -37,9 +37,7 @@ typedef struct {
u_int8_tbt_gpio_wlan_active;
u_int8_tbt_active_polarity;
HAL_BOOLbt_single_ant;
-   u_int8_tbt_dutyCycle;
u_int8_tbt_isolation;
-   u_int8_tbt_period;
 } HAL_BT_COEX_INFO;
 
 typedef enum {
@@ -101,6 +99,7 @@ typedef enum {
HAL_BT_COEX_STOMP_NONE,
HAL_BT_COEX_STOMP_ALL_FORCE,
HAL_BT_COEX_STOMP_LOW_FORCE,
+   HAL_BT_COEX_STOMP_AUDIO,
 } HAL_BT_COEX_STOMP_TYPE;
 
 typedef struct {
___
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: r301304 - head/sys/dev/ath/ath_hal/ar5416

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sat Jun  4 07:28:36 2016
New Revision: 301304
URL: https://svnweb.freebsd.org/changeset/base/301304

Log:
  [ath_hal] add placeholders for AUDIO stomp for Kite/Kiwi.
  
  It just stomps all; which is enough for some testing.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Sat Jun  4 07:28:09 
2016(r301303)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Sat Jun  4 07:28:36 
2016(r301304)
@@ -97,6 +97,8 @@ ar5416BTCoexSetWeights(struct ath_hal *a
if (AR_SREV_KIWI_10_OR_LATER(ah)) {
/* TODO: TX RX separate is not enabled. */
switch (stompType) {
+   case HAL_BT_COEX_STOMP_AUDIO:
+   /* XXX TODO */
case HAL_BT_COEX_STOMP_ALL:
ahp->ah_btCoexBTWeight = AR5416_BT_WGHT;
ahp->ah_btCoexWLANWeight = AR5416_STOMP_ALL_WLAN_WGHT;
@@ -128,6 +130,8 @@ ar5416BTCoexSetWeights(struct ath_hal *a
}
} else {
switch (stompType) {
+   case HAL_BT_COEX_STOMP_AUDIO:
+   /* XXX TODO */
case HAL_BT_COEX_STOMP_ALL:
ahp->ah_btCoexBTWeight = AR5416_BT_WGHT;
ahp->ah_btCoexWLANWeight = AR5416_STOMP_ALL_WLAN_WGHT;
___
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: r301305 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sat Jun  4 07:29:10 2016
New Revision: 301305
URL: https://svnweb.freebsd.org/changeset/base/301305

Log:
  [ath_hal] add STOMP_AUDIO for AR9462/QCA9565.
  
  Obtained from:Linux ath9k

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cSat Jun  4 
07:28:36 2016(r301304)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cSat Jun  4 
07:29:10 2016(r301305)
@@ -1890,6 +1890,12 @@ void ar9300_mci_bt_coex_set_weights(stru
 ar9300_gpio_set(ah, 5, 0);
 }
 break;
+case HAL_BT_COEX_STOMP_AUDIO:
+ahp->ah_bt_coex_wlan_weight[0] = 0xff01;
+ahp->ah_bt_coex_wlan_weight[1] = 0x;
+ahp->ah_bt_coex_wlan_weight[2] = 0xff01;
+ahp->ah_bt_coex_wlan_weight[3] = 0x;
+break;
 default:
 /* There is a forceWeight from registry */
 ahp->ah_bt_coex_wlan_weight[0] = stomp_type;
___
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: r301306 - in head/sys/boot/efi: include libefi loader loader/arch/amd64 loader/arch/arm loader/arch/arm64 loader/arch/i386

2016-06-04 Thread Andrew Turner
Author: andrew
Date: Sat Jun  4 08:47:45 2016
New Revision: 301306
URL: https://svnweb.freebsd.org/changeset/base/301306

Log:
  Use the UEFI event timer to update the time on arm and arm64. The current
  code uses the GetTime function from the Runtime Service, however this has
  been shown to not return a useable time on many arm64 UEFI implementations.
  
  Reviewed by:  jhb, smh
  Sponsored by: ABT Systems Ltd
  Differential Revision:https://reviews.freebsd.org/D6709

Added:
  head/sys/boot/efi/libefi/time_event.c   (contents, props changed)
Modified:
  head/sys/boot/efi/include/efilib.h
  head/sys/boot/efi/libefi/Makefile
  head/sys/boot/efi/libefi/time.c
  head/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
  head/sys/boot/efi/loader/arch/arm/exec.c
  head/sys/boot/efi/loader/arch/arm64/exec.c
  head/sys/boot/efi/loader/arch/i386/elf32_freebsd.c
  head/sys/boot/efi/loader/main.c

Modified: head/sys/boot/efi/include/efilib.h
==
--- head/sys/boot/efi/include/efilib.h  Sat Jun  4 07:29:10 2016
(r301305)
+++ head/sys/boot/efi/include/efilib.h  Sat Jun  4 08:47:45 2016
(r301306)
@@ -55,6 +55,9 @@ void efi_free_devpath_name(CHAR16 *);
 
 int efi_status_to_errno(EFI_STATUS);
 
+void efi_time_init(void);
+void efi_time_fini(void);
+
 EFI_STATUS main(int argc, CHAR16 *argv[]);
 void exit(EFI_STATUS status);
 void delay(int usecs);

Modified: head/sys/boot/efi/libefi/Makefile
==
--- head/sys/boot/efi/libefi/Makefile   Sat Jun  4 07:29:10 2016
(r301305)
+++ head/sys/boot/efi/libefi/Makefile   Sat Jun  4 08:47:45 2016
(r301306)
@@ -5,7 +5,13 @@ INTERNALLIB=
 WARNS?=2
 
 SRCS=  delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \
-   handles.c libefi.c time.c
+   handles.c libefi.c
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+SRCS+= time.c
+.elif ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
+SRCS+= time_event.c
+.endif
 
 # We implement a slightly non-standard %S in that it always takes a
 # CHAR16 that's common in UEFI-land instead of a wchar_t. This only

Modified: head/sys/boot/efi/libefi/time.c
==
--- head/sys/boot/efi/libefi/time.c Sat Jun  4 07:29:10 2016
(r301305)
+++ head/sys/boot/efi/libefi/time.c Sat Jun  4 08:47:45 2016
(r301306)
@@ -58,6 +58,16 @@ __FBSDID("$FreeBSD$");
 #define SECSPERHOUR ( 60*60 )
 #define SECSPERDAY (24 * SECSPERHOUR)
 
+void
+efi_time_init(void)
+{
+}
+
+void
+efi_time_fini(void)
+{
+}
+
 static time_t
 efi_time(EFI_TIME *ETime)
 {

Added: head/sys/boot/efi/libefi/time_event.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/boot/efi/libefi/time_event.c   Sat Jun  4 08:47:45 2016
(r301306)
@@ -0,0 +1,82 @@
+/*-
+ * Copyright (c) 2016 Andrew Turner
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+#include 
+
+static EFI_EVENT time_event;
+static uint64_t curtime;
+
+static void
+time_update(EFI_EVENT event, void *context)
+{
+
+   curtime += 10;
+}
+
+void
+efi_time_init(void)
+{
+
+   /* Create a timer event */
+   BS->CreateEvent(EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
+   time_update, 0, &time_event);
+   /* Use a 10ms timer */
+   BS->SetTimer(time_event, TimerPeriodic, 10);
+}
+
+void
+efi_time_fini(void)
+{
+
+   /

svn commit: r301307 - head/sys/dev/ath

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sat Jun  4 08:56:30 2016
New Revision: 301307
URL: https://svnweb.freebsd.org/changeset/base/301307

Log:
  [ath] remove now unused parameters.
  
  These will move to being part of the driver btcoex stuff I'm working
  on, since the HAL doesn't know what to do with them.

Modified:
  head/sys/dev/ath/if_ath_btcoex.c

Modified: head/sys/dev/ath/if_ath_btcoex.c
==
--- head/sys/dev/ath/if_ath_btcoex.cSat Jun  4 08:47:45 2016
(r301306)
+++ head/sys/dev/ath/if_ath_btcoex.cSat Jun  4 08:56:30 2016
(r301307)
@@ -232,10 +232,6 @@ ath_btcoex_cfg_mci(struct ath_softc *sc,
btinfo.bt_single_ant = 0;   /* 2 antenna on WB335 */
btinfo.bt_isolation = 0;/* in dB, not used */
 
-   /* Implement a default dutycycle/period */
-   btinfo.bt_dutyCycle = 55;
-   btinfo.bt_period = 40;
-
ath_hal_btcoex_set_info(ah, &btinfo);
 
btconfig.bt_time_extend = 0;
___
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: r301308 - head/sys/dev/sfxge/common

2016-06-04 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Jun  4 09:17:45 2016
New Revision: 301308
URL: https://svnweb.freebsd.org/changeset/base/301308

Log:
  sfxge(4): add helper to compute timer quantum
  
  This also adjusts the timer values used to match the Linux net
  driver implementation:
  a) non-zero time intervals should result in at least one quantum
  b) timer load/reload values are only zero biased for Falcon/Siena
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week
  Differential Revision:  https://reviews.freebsd.org/D6704

Modified:
  head/sys/dev/sfxge/common/ef10_ev.c
  head/sys/dev/sfxge/common/efx.h
  head/sys/dev/sfxge/common/efx_ev.c

Modified: head/sys/dev/sfxge/common/ef10_ev.c
==
--- head/sys/dev/sfxge/common/ef10_ev.c Sat Jun  4 08:56:30 2016
(r301307)
+++ head/sys/dev/sfxge/common/ef10_ev.c Sat Jun  4 09:17:45 2016
(r301308)
@@ -141,7 +141,6 @@ efx_mcdi_init_evq(
__inuint32_t irq,
__inuint32_t us)
 {
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_mcdi_req_t req;
uint8_t payload[
MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
@@ -189,25 +188,22 @@ efx_mcdi_init_evq(
INIT_EVQ_IN_FLAG_RX_MERGE, 1,
INIT_EVQ_IN_FLAG_TX_MERGE, 1);
 
+   /* If the value is zero then disable the timer */
if (us == 0) {
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE,
MC_CMD_INIT_EVQ_IN_TMR_MODE_DIS);
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, 0);
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, 0);
} else {
-   uint32_t timer_val;
+   unsigned int ticks;
 
-   /* Calculate the timer value in quanta */
-   timer_val = us * 1000 / encp->enc_evq_timer_quantum_ns;
-
-   /* Moderation value is base 0 so we need to deduct 1 */
-   if (timer_val > 0)
-   timer_val--;
+   if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0)
+   goto fail2;
 
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE,
MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF);
-   MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, timer_val);
-   MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, timer_val);
+   MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_LOAD, ticks);
+   MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_RELOAD, ticks);
}
 
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_COUNT_MODE,
@@ -230,18 +226,20 @@ efx_mcdi_init_evq(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail2;
+   goto fail3;
}
 
if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) {
rc = EMSGSIZE;
-   goto fail3;
+   goto fail4;
}
 
/* NOTE: ignore the returned IRQ param as firmware does not set it. */
 
return (0);
 
+fail4:
+   EFSYS_PROBE(fail4);
 fail3:
EFSYS_PROBE(fail3);
 fail2:
@@ -483,7 +481,7 @@ ef10_ev_qmoderate(
efx_nic_t *enp = eep->ee_enp;
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_dword_t dword;
-   uint32_t timer_ns, timer_val, mode;
+   uint32_t mode;
efx_rc_t rc;
 
/* Check that hardware and MCDI use the same timer MODE values */
@@ -503,37 +501,35 @@ ef10_ev_qmoderate(
 
/* If the value is zero then disable the timer */
if (us == 0) {
-   timer_ns = 0;
mode = FFE_CZ_TIMER_MODE_DIS;
} else {
-   timer_ns = us * 1000u;
mode = FFE_CZ_TIMER_MODE_INT_HLDOFF;
}
 
if (encp->enc_bug61265_workaround) {
-   rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, timer_ns);
+   uint32_t ns = us * 1000;
+
+   rc = efx_mcdi_set_evq_tmr(enp, eep->ee_index, mode, ns);
if (rc != 0)
goto fail2;
} else {
-   /* Calculate the timer value in quanta */
-   timer_val = timer_ns / encp->enc_evq_timer_quantum_ns;
+   unsigned int ticks;
 
-   /* Moderation value is base 0 so we need to deduct 1 */
-   if (timer_val > 0)
-   timer_val--;
+   if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0)
+   goto fail3;
 
if (encp->enc_bug35388_workaround) {
EFX_POPULATE_DWORD_3(dword,
ERF_DD_EVQ_IND_TIMER_FLAGS,
EFE_DD_EVQ_IND_TIMER_FLAGS,
ERF_DD_EVQ_IND_TIMER_MODE, mode,
-   ERF_DD_EVQ_IND_TIMER_VAL, timer_val);
+   ERF_DD_EVQ_IND_TIMER_VAL, ticks);
 

svn commit: r301309 - in head/sys/dev/sfxge: . common

2016-06-04 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Jun  4 09:20:46 2016
New Revision: 301309
URL: https://svnweb.freebsd.org/changeset/base/301309

Log:
  sfxge(4): always be ready to receive batched events
  
  When the low-latency firmware variant is running, it is reported as not
  being capable of batching RX events, but it can still do so if the
  FORCE_EV_MERGING flag is set on an RXQ.  Therefore we need to handle
  batched RX events even if the capability isn't set.
  
  If this bug is fixed in the firmware such that the capability is set
  even when running the low-latency firmware variant, it will almost
  always be reported so I don't think we lose much by removing the check.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week
  Differential Revision:  https://reviews.freebsd.org/D6705

Modified:
  head/sys/dev/sfxge/common/ef10_nic.c
  head/sys/dev/sfxge/sfxge_ev.c

Modified: head/sys/dev/sfxge/common/ef10_nic.c
==
--- head/sys/dev/sfxge/common/ef10_nic.cSat Jun  4 09:17:45 2016
(r301308)
+++ head/sys/dev/sfxge/common/ef10_nic.cSat Jun  4 09:20:46 2016
(r301309)
@@ -1003,8 +1003,11 @@ ef10_get_datapath_caps(
encp->enc_rx_batching_enabled =
CAP_FLAG(flags, RX_BATCHING) ? B_TRUE : B_FALSE;
 
-   if (encp->enc_rx_batching_enabled)
-   encp->enc_rx_batch_max = 16;
+   /*
+* Even if batching isn't reported as supported, we may still get
+* batched events.
+*/
+   encp->enc_rx_batch_max = 16;
 
/* Check if the firmware supports disabling scatter on RXQs */
encp->enc_rx_disable_scatter_supported =

Modified: head/sys/dev/sfxge/sfxge_ev.c
==
--- head/sys/dev/sfxge/sfxge_ev.c   Sat Jun  4 09:17:45 2016
(r301308)
+++ head/sys/dev/sfxge/sfxge_ev.c   Sat Jun  4 09:20:46 2016
(r301309)
@@ -128,8 +128,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u
rxq->pending += delta;
 
if (delta != 1) {
-   if ((!efx_nic_cfg_get(sc->enp)->enc_rx_batching_enabled) ||
-   (delta <= 0) ||
+   if ((delta <= 0) ||
(delta > efx_nic_cfg_get(sc->enp)->enc_rx_batch_max)) {
evq->exception = B_TRUE;
 
___
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: r301339 - in head: contrib/libucl/src contrib/libucl/uthash lib/libucl

2016-06-04 Thread Baptiste Daroussin
Author: bapt
Date: Sat Jun  4 14:57:25 2016
New Revision: 301339
URL: https://svnweb.freebsd.org/changeset/base/301339

Log:
  Import libucl snapshot 20160604
  
  It replaces xxhash with mumhash
  It fixes issues with msgpack on non x86

Added:
  head/contrib/libucl/src/mum.h
 - copied unchanged from r301336, vendor/libucl/dist/src/mum.h
Deleted:
  head/contrib/libucl/src/xxhash.c
  head/contrib/libucl/src/xxhash.h
Modified:
  head/contrib/libucl/src/Makefile.am
  head/contrib/libucl/src/ucl_hash.c
  head/contrib/libucl/src/ucl_internal.h
  head/contrib/libucl/src/ucl_msgpack.c
  head/contrib/libucl/src/ucl_parser.c
  head/contrib/libucl/src/ucl_util.c
  head/contrib/libucl/uthash/uthash.h
  head/lib/libucl/Makefile
Directory Properties:
  head/contrib/libucl/   (props changed)

Modified: head/contrib/libucl/src/Makefile.am
==
--- head/contrib/libucl/src/Makefile.am Sat Jun  4 14:57:08 2016
(r301338)
+++ head/contrib/libucl/src/Makefile.am Sat Jun  4 14:57:25 2016
(r301339)
@@ -12,8 +12,7 @@ libucl_la_SOURCES=ucl_emitter.c \
ucl_schema.c \
ucl_util.c \
ucl_msgpack.c \
-   ucl_sexp.c \
-   xxhash.c
+   ucl_sexp.c
 libucl_la_CFLAGS=  $(libucl_common_cflags) \
@CURL_CFLAGS@
 libucl_la_LDFLAGS = -version-info @SO_VERSION@
@@ -25,7 +24,7 @@ libucl_la_LIBADD= @LIBFETCH_LIBS@ \
 include_HEADERS=   $(top_srcdir)/include/ucl.h \
$(top_srcdir)/include/ucl++.h
 noinst_HEADERS=ucl_internal.h \
-   xxhash.h \
+   mum.h \
ucl_hash.h \
ucl_chartable.h \
tree.h

Copied: head/contrib/libucl/src/mum.h (from r301336, 
vendor/libucl/dist/src/mum.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/libucl/src/mum.h   Sat Jun  4 14:57:25 2016
(r301339, copy of r301336, vendor/libucl/dist/src/mum.h)
@@ -0,0 +1,417 @@
+/* Copyright (c) 2016 Vladimir Makarov 
+
+   Permission is hereby granted, free of charge, to any person
+   obtaining a copy of this software and associated documentation
+   files (the "Software"), to deal in the Software without
+   restriction, including without limitation the rights to use, copy,
+   modify, merge, publish, distribute, sublicense, and/or sell copies
+   of the Software, and to permit persons to whom the Software is
+   furnished to do so, subject to the following conditions:
+
+   The above copyright notice and this permission notice shall be
+   included in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+   BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+   ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+   SOFTWARE.
+*/
+
+/* This file implements MUM (MUltiply and Mix) hashing.  We randomize
+   input data by 64x64-bit multiplication and mixing hi- and low-parts
+   of the multiplication result by using an addition and then mix it
+   into the current state.  We use prime numbers randomly generated
+   with the equal probability of their bit values for the
+   multiplication.  When all primes are used once, the state is
+   randomized and the same prime numbers are used again for data
+   randomization.
+
+   The MUM hashing passes all SMHasher tests.  Pseudo Random Number
+   Generator based on MUM also passes NIST Statistical Test Suite for
+   Random and Pseudorandom Number Generators for Cryptographic
+   Applications (version 2.2.1) with 1000 bitstreams each containing
+   1M bits.  MUM hashing is also faster Spooky64 and City64 on small
+   strings (at least upto 512-bit) on Haswell and Power7.  The MUM bulk
+   speed (speed on very long data) is bigger than Spooky and City on
+   Power7.  On Haswell the bulk speed is bigger than Spooky one and
+   close to City speed.  */
+
+#ifndef __MUM_HASH__
+#define __MUM_HASH__
+
+#include 
+#include 
+#include 
+#include 
+
+#ifdef _MSC_VER
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include 
+#endif
+
+/* Macro saying to use 128-bit integers implemented by GCC for some
+   t

svn commit: r301367 - head/usr.sbin/pw

2016-06-04 Thread Baptiste Daroussin
Author: bapt
Date: Sat Jun  4 16:31:33 2016
New Revision: 301367
URL: https://svnweb.freebsd.org/changeset/base/301367

Log:
  Fix typo preventing pw {user,group}next -C from working as expected
  
  Reported by:  Mike Selnet via forums.freebsd.org
  MFC after:3 days

Modified:
  head/usr.sbin/pw/pw_group.c
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_group.c
==
--- head/usr.sbin/pw/pw_group.c Sat Jun  4 16:31:04 2016(r301366)
+++ head/usr.sbin/pw/pw_group.c Sat Jun  4 16:31:33 2016(r301367)
@@ -261,7 +261,7 @@ pw_group_next(int argc, char **argv, cha
int ch;
bool quiet = false;
 
-   while ((ch = getopt(argc, argv, "Cq")) != -1) {
+   while ((ch = getopt(argc, argv, "C:q")) != -1) {
switch (ch) {
case 'C':
cfg = optarg;

Modified: head/usr.sbin/pw/pw_user.c
==
--- head/usr.sbin/pw/pw_user.c  Sat Jun  4 16:31:04 2016(r301366)
+++ head/usr.sbin/pw/pw_user.c  Sat Jun  4 16:31:33 2016(r301367)
@@ -742,7 +742,7 @@ pw_user_next(int argc, char **argv, char
bool quiet = false;
uid_t next;
 
-   while ((ch = getopt(argc, argv, "Cq")) != -1) {
+   while ((ch = getopt(argc, argv, "C:q")) != -1) {
switch (ch) {
case 'C':
cfg = optarg;
___
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: r301394 - head

2016-06-04 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun  4 17:17:10 2016
New Revision: 301394
URL: https://svnweb.freebsd.org/changeset/base/301394

Log:
  Follow-up r301287: Pass external compiler metadata when used.
  
  This fixes WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, external compiler, to
  pass the external compiler metadata rather than the ${CC} metadata.  On
  a build host that has clang as CC it was passing the clang metadata rather 
than
  GCC metadata during the build.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Jun  4 17:16:35 2016(r301393)
+++ head/Makefile.inc1  Sat Jun  4 17:17:10 2016(r301394)
@@ -129,9 +129,15 @@ MK_GCC_BOOTSTRAP=  no
 # passed along rather than trying to run cc from the restricted
 # STRICTTMPPATH.
 .if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no"
+.if defined(X_COMPILER_TYPE)
 CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \
COMPILER_TYPE=${COMPILER_TYPE} \
COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION}
+.else
+CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \
+   COMPILER_TYPE=${X_COMPILER_TYPE} \
+   COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION}
+.endif
 .endif
 
 # Handle external binutils.
___
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: r301402 - in head/gnu/usr.bin/cc: c++ cc cc1 cc1plus cc_tools cpp gcov

2016-06-04 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun  4 17:37:25 2016
New Revision: 301402
URL: https://svnweb.freebsd.org/changeset/base/301402

Log:
  DIRDEPS_BUILD: Update GCC dependencies.
  
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/gnu/usr.bin/cc/c++/Makefile.depend
  head/gnu/usr.bin/cc/cc/Makefile.depend
  head/gnu/usr.bin/cc/cc1/Makefile.depend
  head/gnu/usr.bin/cc/cc1plus/Makefile.depend
  head/gnu/usr.bin/cc/cc_tools/Makefile.depend
  head/gnu/usr.bin/cc/cpp/Makefile.depend
  head/gnu/usr.bin/cc/gcov/Makefile.depend

Modified: head/gnu/usr.bin/cc/c++/Makefile.depend
==
--- head/gnu/usr.bin/cc/c++/Makefile.depend Sat Jun  4 17:24:10 2016
(r301401)
+++ head/gnu/usr.bin/cc/c++/Makefile.depend Sat Jun  4 17:37:25 2016
(r301402)
@@ -11,7 +11,6 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
-   lib/libc_nonshared \
lib/libcompiler_rt \
 
 

Modified: head/gnu/usr.bin/cc/cc/Makefile.depend
==
--- head/gnu/usr.bin/cc/cc/Makefile.depend  Sat Jun  4 17:24:10 2016
(r301401)
+++ head/gnu/usr.bin/cc/cc/Makefile.depend  Sat Jun  4 17:37:25 2016
(r301402)
@@ -3,6 +3,7 @@
 
 DIRDEPS = \
gnu/lib/csu \
+   gnu/lib/libgcc \
gnu/usr.bin/cc/cc_tools \
gnu/usr.bin/cc/libcpp \
gnu/usr.bin/cc/libiberty \

Modified: head/gnu/usr.bin/cc/cc1/Makefile.depend
==
--- head/gnu/usr.bin/cc/cc1/Makefile.depend Sat Jun  4 17:24:10 2016
(r301401)
+++ head/gnu/usr.bin/cc/cc1/Makefile.depend Sat Jun  4 17:37:25 2016
(r301402)
@@ -2,6 +2,8 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
+   gnu/lib/csu \
+   gnu/lib/libgcc \
gnu/usr.bin/cc/cc_int \
gnu/usr.bin/cc/cc_tools \
gnu/usr.bin/cc/libcpp \

Modified: head/gnu/usr.bin/cc/cc1plus/Makefile.depend
==
--- head/gnu/usr.bin/cc/cc1plus/Makefile.depend Sat Jun  4 17:24:10 2016
(r301401)
+++ head/gnu/usr.bin/cc/cc1plus/Makefile.depend Sat Jun  4 17:37:25 2016
(r301402)
@@ -2,11 +2,14 @@
 # Autogenerated - do NOT edit!
 
 DIRDEPS = \
+   gnu/lib/csu \
+   gnu/lib/libgcc \
gnu/usr.bin/cc/cc_int \
gnu/usr.bin/cc/cc_tools \
gnu/usr.bin/cc/libcpp \
gnu/usr.bin/cc/libdecnumber \
gnu/usr.bin/cc/libiberty \
+   gnu/usr.bin/gperf.host \
include \
include/xlocale \
lib/${CSU_DIR} \

Modified: head/gnu/usr.bin/cc/cc_tools/Makefile.depend
==
--- head/gnu/usr.bin/cc/cc_tools/Makefile.dependSat Jun  4 17:24:10 
2016(r301401)
+++ head/gnu/usr.bin/cc/cc_tools/Makefile.dependSat Jun  4 17:37:25 
2016(r301402)
@@ -8,9 +8,9 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
-   lib/libc_nonshared \
lib/libcompiler_rt \
lib/msun \
+   usr.bin/yacc.host \
 
 
 .include 

Modified: head/gnu/usr.bin/cc/cpp/Makefile.depend
==
--- head/gnu/usr.bin/cc/cpp/Makefile.depend Sat Jun  4 17:24:10 2016
(r301401)
+++ head/gnu/usr.bin/cc/cpp/Makefile.depend Sat Jun  4 17:37:25 2016
(r301402)
@@ -11,7 +11,6 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
-   lib/libc_nonshared \
lib/libcompiler_rt \
 
 

Modified: head/gnu/usr.bin/cc/gcov/Makefile.depend
==
--- head/gnu/usr.bin/cc/gcov/Makefile.dependSat Jun  4 17:24:10 2016
(r301401)
+++ head/gnu/usr.bin/cc/gcov/Makefile.dependSat Jun  4 17:37:25 2016
(r301402)
@@ -10,7 +10,6 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
-   lib/libc_nonshared \
lib/libcompiler_rt \
 
 
___
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: r301403 - head

2016-06-04 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun  4 17:38:17 2016
New Revision: 301403
URL: https://svnweb.freebsd.org/changeset/base/301403

Log:
  Fix incorrect logic in r301394.
  
  Reported by:  Mark Millard

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Jun  4 17:37:25 2016(r301402)
+++ head/Makefile.inc1  Sat Jun  4 17:38:17 2016(r301403)
@@ -129,7 +129,7 @@ MK_GCC_BOOTSTRAP=   no
 # passed along rather than trying to run cc from the restricted
 # STRICTTMPPATH.
 .if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no"
-.if defined(X_COMPILER_TYPE)
+.if !defined(X_COMPILER_TYPE)
 CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \
COMPILER_TYPE=${COMPILER_TYPE} \
COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION}
___
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: r301404 - head/sys/dev/filemon

2016-06-04 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun  4 17:39:42 2016
New Revision: 301404
URL: https://svnweb.freebsd.org/changeset/base/301404

Log:
  Support all architectures by just using sysent.
  
  PowerPC64 has two different ABIs, neither of which is elf64_freebsd_sysvec.
  Using sysent and freebsd32_sysent achieves the same effect.
  
  X-MFC-With:   r301130
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/dev/filemon/filemon_wrapper.c

Modified: head/sys/dev/filemon/filemon_wrapper.c
==
--- head/sys/dev/filemon/filemon_wrapper.c  Sat Jun  4 17:38:17 2016
(r301403)
+++ head/sys/dev/filemon/filemon_wrapper.c  Sat Jun  4 17:39:42 2016
(r301404)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "opt_compat.h"
@@ -414,32 +415,25 @@ filemon_event_process_fork(void *arg __u
 static void
 filemon_wrapper_install(void)
 {
-#if defined(__LP64__)
-   struct sysent *sv_table = elf64_freebsd_sysvec.sv_table;
-#else
-   struct sysent *sv_table = elf32_freebsd_sysvec.sv_table;
-#endif
-
-   sv_table[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir;
-   sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open;
-   sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat;
-   sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename;
-   sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink;
-   sv_table[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link;
-   sv_table[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink;
-   sv_table[SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat;
 
-#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32)
-   sv_table = ia32_freebsd_sysvec.sv_table;
+   sysent[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir;
+   sysent[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open;
+   sysent[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat;
+   sysent[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename;
+   sysent[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink;
+   sysent[SYS_link].sy_call = (sy_call_t *) filemon_wrapper_link;
+   sysent[SYS_symlink].sy_call = (sy_call_t *) filemon_wrapper_symlink;
+   sysent[SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat;
 
-   sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) 
filemon_wrapper_chdir;
-   sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) 
filemon_wrapper_open;
-   sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) 
filemon_wrapper_openat;
-   sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) 
filemon_wrapper_rename;
-   sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) 
filemon_wrapper_unlink;
-   sv_table[FREEBSD32_SYS_link].sy_call = (sy_call_t *) 
filemon_wrapper_link;
-   sv_table[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) 
filemon_wrapper_symlink;
-   sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) 
filemon_wrapper_linkat;
+#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32)
+   freebsd32_sysent[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) 
filemon_wrapper_chdir;
+   freebsd32_sysent[FREEBSD32_SYS_open].sy_call = (sy_call_t *) 
filemon_wrapper_open;
+   freebsd32_sysent[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) 
filemon_wrapper_openat;
+   freebsd32_sysent[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) 
filemon_wrapper_rename;
+   freebsd32_sysent[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) 
filemon_wrapper_unlink;
+   freebsd32_sysent[FREEBSD32_SYS_link].sy_call = (sy_call_t *) 
filemon_wrapper_link;
+   freebsd32_sysent[FREEBSD32_SYS_symlink].sy_call = (sy_call_t *) 
filemon_wrapper_symlink;
+   freebsd32_sysent[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) 
filemon_wrapper_linkat;
 #endif /* COMPAT_ARCH32 */
 
filemon_exec_tag = EVENTHANDLER_REGISTER(process_exec,
@@ -453,32 +447,25 @@ filemon_wrapper_install(void)
 static void
 filemon_wrapper_deinstall(void)
 {
-#if defined(__LP64__)
-   struct sysent *sv_table = elf64_freebsd_sysvec.sv_table;
-#else
-   struct sysent *sv_table = elf32_freebsd_sysvec.sv_table;
-#endif
-
-   sv_table[SYS_chdir].sy_call = (sy_call_t *)sys_chdir;
-   sv_table[SYS_open].sy_call = (sy_call_t *)sys_open;
-   sv_table[SYS_openat].sy_call = (sy_call_t *)sys_openat;
-   sv_table[SYS_rename].sy_call = (sy_call_t *)sys_rename;
-   sv_table[SYS_unlink].sy_call = (sy_call_t *)sys_unlink;
-   sv_table[SYS_link].sy_call = (sy_call_t *)sys_link;
-   sv_table[SYS_symlink].sy_call = (sy_call_t *)sys_symlink;
-   sv_table[SYS_linkat].sy_call = (sy_call_t *)sys_linkat;
 
-#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_A

Re: svn commit: r301339 - in head: contrib/libucl/src contrib/libucl/uthash lib/libucl

2016-06-04 Thread Conrad Meyer
On Sat, Jun 4, 2016 at 7:57 AM, Baptiste Daroussin  wrote:
> Author: bapt
> Date: Sat Jun  4 14:57:25 2016
> New Revision: 301339
> URL: https://svnweb.freebsd.org/changeset/base/301339
>
> Log:
>   Import libucl snapshot 20160604
>
>   It replaces xxhash with mumhash

Why was xxhash replaced with mumhash?

>   It fixes issues with msgpack on non x86

What issues?

Thanks,
Conrad
___
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: r301339 - in head: contrib/libucl/src contrib/libucl/uthash lib/libucl

2016-06-04 Thread Baptiste Daroussin
On Sat, Jun 04, 2016 at 09:07:27AM -0700, Conrad Meyer wrote:
> On Sat, Jun 4, 2016 at 7:57 AM, Baptiste Daroussin  wrote:
> > Author: bapt
> > Date: Sat Jun  4 14:57:25 2016
> > New Revision: 301339
> > URL: https://svnweb.freebsd.org/changeset/base/301339
> >
> > Log:
> >   Import libucl snapshot 20160604
> >
> >   It replaces xxhash with mumhash
> 
> Why was xxhash replaced with mumhash?

Because upstream has perferred to switch to mumhash (I'm not upstream)
> 
> >   It fixes issues with msgpack on non x86
> 
The issue was problem with memory alignement in the code for the msgpack
reader/emitter leading to bus error

Best regards,
Bapt


signature.asc
Description: PGP signature


svn commit: r301406 - head/sys/sys

2016-06-04 Thread Ed Schouten
Author: ed
Date: Sat Jun  4 18:57:00 2016
New Revision: 301406
URL: https://svnweb.freebsd.org/changeset/base/301406

Log:
  Don't test for INKERNEL to check whether we're in kernel space.
  
  It turns out that  actually defines a macro under this
  name, even when we're not in kernelspace. This causes us to suppress
  some macro definitions that are used by userspace apps.
  
  PR:   210026
  Reported by:  jbeich@
  MFC after:2 weeks

Modified:
  head/sys/sys/soundcard.h

Modified: head/sys/sys/soundcard.h
==
--- head/sys/sys/soundcard.hSat Jun  4 17:40:23 2016(r301405)
+++ head/sys/sys/soundcard.hSat Jun  4 18:57:00 2016(r301406)
@@ -1261,7 +1261,7 @@ typedef struct mixer_info {
  */
 #define LOCL_STARTAUDIO1
 
-#if (!defined(_KERNEL) && !defined(INKERNEL)) || defined(USE_SEQ_MACROS)
+#if !defined(_KERNEL) || defined(USE_SEQ_MACROS)
 /*
  * Some convenience macros to simplify programming of the
  * /dev/sequencer interface
___
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: r301407 - head/share/man/man4

2016-06-04 Thread Landon J. Fuller
Author: landonf
Date: Sat Jun  4 19:00:11 2016
New Revision: 301407
URL: https://svnweb.freebsd.org/changeset/base/301407

Log:
  Update my e-mail address (and fix related typo in siba.4)
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D6714

Modified:
  head/share/man/man4/bcma.4
  head/share/man/man4/bhnd.4
  head/share/man/man4/bhndb.4
  head/share/man/man4/siba.4

Modified: head/share/man/man4/bcma.4
==
--- head/share/man/man4/bcma.4  Sat Jun  4 18:57:00 2016(r301406)
+++ head/share/man/man4/bcma.4  Sat Jun  4 19:00:11 2016(r301407)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 8, 2015
+.Dd June 3, 2016
 .Dt BCMA 4
 .Os
 .Sh NAME
@@ -75,4 +75,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Landon Fuller Aq Mt lan...@landonf.org .
+.An Landon Fuller Aq Mt land...@freebsd.org .

Modified: head/share/man/man4/bhnd.4
==
--- head/share/man/man4/bhnd.4  Sat Jun  4 18:57:00 2016(r301406)
+++ head/share/man/man4/bhnd.4  Sat Jun  4 19:00:11 2016(r301407)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 8, 2015
+.Dd June 3, 2016
 .Dt BHND 4
 .Os
 .Sh NAME
@@ -80,4 +80,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Landon Fuller Aq Mt lan...@landonf.org .
+.An Landon Fuller Aq Mt land...@freebsd.org .

Modified: head/share/man/man4/bhndb.4
==
--- head/share/man/man4/bhndb.4 Sat Jun  4 18:57:00 2016(r301406)
+++ head/share/man/man4/bhndb.4 Sat Jun  4 19:00:11 2016(r301407)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 8, 2015
+.Dd June 3, 2016
 .Dt BHNDB 4
 .Os
 .Sh NAME
@@ -65,7 +65,7 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Landon Fuller Aq Mt lan...@landonf.org .
+.An Landon Fuller Aq Mt land...@freebsd.org .
 .Sh CAVEATS
 The
 .Nm

Modified: head/share/man/man4/siba.4
==
--- head/share/man/man4/siba.4  Sat Jun  4 18:57:00 2016(r301406)
+++ head/share/man/man4/siba.4  Sat Jun  4 19:00:11 2016(r301407)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 8, 2010
+.Dd June 3, 2016
 .Dt SIBA 4
 .Os
 .Sh NAME
@@ -88,6 +88,6 @@ and
 .An Weongyo Jeong Aq Mt weon...@freebsd.org .
 
 The driver was rewritten for
-.Fx 11.0 .
+.Fx 11.0
 by
-.An Landon Fuller Aq Mt lan...@landonf.org .
+.An Landon Fuller Aq Mt land...@freebsd.org .
___
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: r301217 - in head/sys: net netinet netinet6

2016-06-04 Thread Alexander V . Chernikov
02.06.2016, 20:51, "George V. Neville-Neil" :
> Author: gnn
> Date: Thu Jun 2 17:51:29 2016
> New Revision: 301217
> URL: https://svnweb.freebsd.org/changeset/base/301217
>
> Log:
>   This change re-adds L2 caching for TCP and UDP, as originally added in D4306
>   but removed due to other changes in the system. Restore the llentry pointer
>   to the "struct route", and use it to cache the L2 lookup (ARP or ND6) as
>   appropriate.

I have several comments regarding this commit.

1 Architecturally, there was quite a lot of efforts to eliminate layering 
violation between lltable and other places in network stack.
It ended by committing D4102, which allowed both to cleanup lower level, 
provide abstract “prepend” framework which could be used to provide cached data 
to _otuput() functions.
This change brings these violations back in a really invasive way.

Additionally, implementing L2 PCB caching at the other subsystem expense is 
really a bad idea.
If one wants caching in some subsystem, it should be implemented in that 
subsystem not polluting other things.
Current implementation permits this by filling in “ro_prepend” / ro_plen fields.

In general, this change looks more like a local hack and not like the code that 
should be included in the tree.

2 There was no benchmarks proving the effectiveness of this change. (For 
example, it is not obvious if it could significantly improve TCP since we still 
have per-session TCP wlock + (typically) per-ring mutex, so removing lltable 
rock might not help things here). Given that the patch complicates existing 
code, there should be adequate benefits to consider whether this change is 
worth implementing.

3 The “network” group was not included to the review despite the fact that most 
of the changes were related to the L2 layer which is not “transport”, so some 
people might have missed this review.

4 This change DOES NOT WORK. really.
(which raises questions on both review and benchmarking process).

The reason is that “plle” argument is filled only in “heavy” lltable lookup 
functions (e.g. when we don’t have neighbour adjacency). 99.9% of the time 
arpresolve/nd6_resolve() returns the result w/o calling their heavy versions, 
and the returned “plle” is NULL.

This can be easily verified by calling something like
dtrace -n 'fbt:kernel:ether_output:entry /arg3!=NULL&&((struct route 
*)arg3)->ro_lle != NULL/ { stack(); }'

Given that, I kindly ask you to backout this change.

>
>   Submitted by: Mike Karels
>   Differential Revision: https://reviews.freebsd.org/D6262
>
> Modified:
>   head/sys/net/flowtable.c
>   head/sys/net/if_arcsubr.c
>   head/sys/net/if_ethersubr.c
>   head/sys/net/if_fddisubr.c
>   head/sys/net/if_fwsubr.c
>   head/sys/net/if_iso88025subr.c
>   head/sys/net/if_llatbl.h
>   head/sys/net/route.c
>   head/sys/net/route.h
>   head/sys/netinet/if_ether.c
>   head/sys/netinet/if_ether.h
>   head/sys/netinet/in_pcb.c
>   head/sys/netinet/ip_output.c
>   head/sys/netinet/toecore.c
>   head/sys/netinet6/in6.h
>   head/sys/netinet6/in6_pcb.c
>   head/sys/netinet6/ip6_output.c
>   head/sys/netinet6/nd6.c
>   head/sys/netinet6/nd6.h
>
> Modified: head/sys/net/flowtable.c
> ==
> --- head/sys/net/flowtable.c Thu Jun 2 17:31:37 2016 (r301216)
> +++ head/sys/net/flowtable.c Thu Jun 2 17:51:29 2016 (r301217)
> @@ -696,13 +696,8 @@ flowtable_lookup(sa_family_t sa, struct
>  ro->ro_rt = fle->f_rt;
>  ro->ro_flags |= RT_NORTREF;
>  lle = fle->f_lle;
> - if (lle != NULL && (lle->la_flags & LLE_VALID)) {
> - ro->ro_prepend = lle->r_linkdata;
> - ro->ro_plen = lle->r_hdrlen;
> - ro->ro_flags |= RT_MAY_LOOP;
> - if (lle->la_flags & LLE_IFADDR)
> - ro->ro_flags |= RT_L2_ME;
> - }
> + if (lle != NULL && (lle->la_flags & LLE_VALID))
> + ro->ro_lle = lle; /* share ref with fle->f_lle */
>
>  return (0);
>  }
>
> Modified: head/sys/net/if_arcsubr.c
> ==
> --- head/sys/net/if_arcsubr.c Thu Jun 2 17:31:37 2016 (r301216)
> +++ head/sys/net/if_arcsubr.c Thu Jun 2 17:51:29 2016 (r301217)
> @@ -129,7 +129,8 @@ arc_output(struct ifnet *ifp, struct mbu
>  else if (ifp->if_flags & IFF_NOARP)
>  adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF;
>  else {
> - error = arpresolve(ifp, is_gw, m, dst, &adst, NULL);
> + error = arpresolve(ifp, is_gw, m, dst, &adst, NULL,
> + NULL);
>  if (error)
>  return (error == EWOULDBLOCK ? 0 : error);
>  }
> @@ -170,7 +171,8 @@ arc_output(struct ifnet *ifp, struct mbu
>  if ((m->m_flags & M_MCAST) != 0)
>  adst = arcbroadcastaddr; /* ARCnet broadcast address 
> */
>  else {
> - error = nd6_resolve(ifp, is_gw, m, dst, &adst, NULL);
> + error = nd6_resolve(ifp, is_gw, m, dst, &adst, NUL

svn commit: r301408 - in head/sys/dev/bhnd: . cores/chipc

2016-06-04 Thread Landon J. Fuller
Author: landonf
Date: Sat Jun  4 19:31:06 2016
New Revision: 301408
URL: https://svnweb.freebsd.org/changeset/base/301408

Log:
  Fix several MIPS/BCM-blocking bugs in bhnd(4) chipc
  
  - Correct IRQ lines for UART (to fix IRQ lookup in future)
  - Check device unit in resource assignment during chipc_add_child
  - If chipc hint->size is RM_MAX_END, resource end should be same as window end
  - Clear reference from resource list entry to resource in case of resource 
release
  - Add CHIPC_GET_CAPS implementation
  - Correct chipc flash constants (to be unshifted)
  - Default implementation of get_attach_type should iterate over device tree
  - Add default implementation for BHND_CHIPC_GET_CAPS usable by chipc 
grandchildren
  
  Submitted by: Michael Zhilin 
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D6584

Modified:
  head/sys/dev/bhnd/bhnd.h
  head/sys/dev/bhnd/bhnd_bus_if.m
  head/sys/dev/bhnd/bhnd_subr.c
  head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m
  head/sys/dev/bhnd/cores/chipc/chipc.c
  head/sys/dev/bhnd/cores/chipc/chipcreg.h

Modified: head/sys/dev/bhnd/bhnd.h
==
--- head/sys/dev/bhnd/bhnd.hSat Jun  4 19:00:11 2016(r301407)
+++ head/sys/dev/bhnd/bhnd.hSat Jun  4 19:31:06 2016(r301408)
@@ -356,6 +356,8 @@ int  
bhnd_bus_generic_activate_resour
 int bhnd_bus_generic_deactivate_resource (device_t 
dev,
 device_t child, int type, int rid,
 struct bhnd_resource *r);
+bhnd_attach_typebhnd_bus_generic_get_attach_type(device_t dev,
+device_t child);
 
 
 

Modified: head/sys/dev/bhnd/bhnd_bus_if.m
==
--- head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun  4 19:00:11 2016
(r301407)
+++ head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun  4 19:31:06 2016
(r301408)
@@ -55,12 +55,6 @@ CODE {
panic("bhnd_bus_get_chipid unimplemented");
}
 
-   static bhnd_attach_type
-   bhnd_bus_null_get_attach_type(device_t dev, device_t child)
-   {
-   panic("bhnd_bus_get_attach_type unimplemented");
-   }
-
static int
bhnd_bus_null_read_board_info(device_t dev, device_t child,
struct bhnd_board_info *info)
@@ -203,7 +197,7 @@ METHOD const struct bhnd_chipid * get_ch
 METHOD bhnd_attach_type get_attach_type {
device_t dev;
device_t child;
-} DEFAULT bhnd_bus_null_get_attach_type;
+} DEFAULT bhnd_bus_generic_get_attach_type;
 
 /**
  * Attempt to read the BHND board identification from the parent bus.

Modified: head/sys/dev/bhnd/bhnd_subr.c
==
--- head/sys/dev/bhnd/bhnd_subr.c   Sat Jun  4 19:00:11 2016
(r301407)
+++ head/sys/dev/bhnd/bhnd_subr.c   Sat Jun  4 19:31:06 2016
(r301408)
@@ -1158,3 +1158,22 @@ bhnd_bus_generic_deactivate_resource(dev
 
return (EINVAL);
 };
+
+/**
+ * Helper function for implementing BHND_BUS_GET_ATTACH_TYPE().
+ *
+ * This implementation of BHND_BUS_GET_ATTACH_TYPE() simply calls the
+ * BHND_BUS_GET_ATTACH_TYPE() method of the parent of @p dev.
+ */
+bhnd_attach_type
+bhnd_bus_generic_get_attach_type(device_t dev, device_t child)
+{
+   /* iterate from cores via bhnd to bridge or SoC */
+   if (device_get_parent(dev) != NULL)
+   return (BHND_BUS_GET_ATTACH_TYPE(device_get_parent(dev),
+   child));
+
+   panic("bhnd_bus_get_attach_type unimplemented");
+   /* Unreachable */
+   return (BHND_ATTACH_ADAPTER);
+}

Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m
==
--- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m   Sat Jun  4 19:00:11 
2016(r301407)
+++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m   Sat Jun  4 19:31:06 
2016(r301408)
@@ -39,6 +39,29 @@ INTERFACE bhnd_chipc;
 HEADER {
/* forward declarations */
struct chipc_caps;
+   struct chipc_caps   *bhnd_chipc_generic_get_caps(device_t dev);
+}
+
+CODE {
+
+   /**
+* Helper function for implementing BHND_CHIPC_GET_CAPS().
+*
+* This implementation of BHND_CHIPC_GET_CAPS() simply calls the
+* BHND_CHIPC_GET_CAPS() method of the parent of @p dev.
+*/
+   struct chipc_caps*
+   bhnd_chipc_generic_get_caps(device_t dev)
+   {
+   
+   if (device_get_parent(dev) != NULL)
+   return (BHND_CHIPC_GET_CAPS(device_get_parent(dev)));
+   
+   panic("bhnd_chipc_generic_get_caps unimplemented");
+   /* Unreachable */
+   return (NULL);
+   }
+
 }

svn commit: r301409 - in head/sys: dev/bhnd/cores/chipc mips/broadcom

2016-06-04 Thread Landon J. Fuller
Author: landonf
Date: Sat Jun  4 19:39:05 2016
New Revision: 301409
URL: https://svnweb.freebsd.org/changeset/base/301409

Log:
  bhnd(4): Add support for chipc-attached flash
  
  This adds support for serial (via SPI) and parallel (via CFI) flash
  as found on BCM47xx/BCM53xx SoCs.
  
  Submitted by:   Michael Zhilin 
  Approved by:adrian (mentor)
  Differential Revision:  https://reviews.freebsd.org/D6250

Added:
  head/sys/dev/bhnd/cores/chipc/chipc_cfi.c   (contents, props changed)
  head/sys/dev/bhnd/cores/chipc/chipc_slicer.c   (contents, props changed)
  head/sys/dev/bhnd/cores/chipc/chipc_slicer.h   (contents, props changed)
  head/sys/dev/bhnd/cores/chipc/chipc_spi.c   (contents, props changed)
  head/sys/dev/bhnd/cores/chipc/chipc_spi.h   (contents, props changed)
Modified:
  head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m
  head/sys/dev/bhnd/cores/chipc/chipc.c
  head/sys/mips/broadcom/uart_bus_chipc.c

Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m
==
--- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m   Sat Jun  4 19:31:06 
2016(r301408)
+++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m   Sat Jun  4 19:39:05 
2016(r301409)
@@ -28,7 +28,6 @@
 #include 
 
 #include 
-#include 
 
 INTERFACE bhnd_chipc;
 
@@ -37,6 +36,7 @@ INTERFACE bhnd_chipc;
 #
 
 HEADER {
+   #include 
/* forward declarations */
struct chipc_caps;
struct chipc_caps   *bhnd_chipc_generic_get_caps(device_t dev);
@@ -123,3 +123,12 @@ METHOD int enable_sprom {
 METHOD void disable_sprom {
device_t dev;
 }
+
+/**
+ * Return the flash configuration register value
+ *
+ * @param dev A bhnd(4) ChipCommon device
+ */
+METHOD uint32_t get_flash_cfg {
+   device_t dev;
+}

Modified: head/sys/dev/bhnd/cores/chipc/chipc.c
==
--- head/sys/dev/bhnd/cores/chipc/chipc.c   Sat Jun  4 19:31:06 2016
(r301408)
+++ head/sys/dev/bhnd/cores/chipc/chipc.c   Sat Jun  4 19:39:05 2016
(r301409)
@@ -39,19 +39,36 @@ __FBSDID("$FreeBSD$");
  * and bcma(4) interconnects, providing a common interface to chipset 
  * identification, bus enumeration, UARTs, clocks, watchdog interrupts, GPIO, 
  * flash, etc.
+ *
+ * The purpose of this driver is memory resource management for ChipCommon 
drivers
+ * like UART, PMU, flash. ChipCommon core has several memory regions.
+ *
+ * ChipCommon driver has memory resource manager. Driver
+ * gets information about BHND core ports/regions and map them
+ * into drivers' resources.
+ *
+ * Here is overview of mapping:
+ *
+ * --
+ * | Port.Region| Purpose  |
+ * --
+ * |   0.0 | PMU, SPI(0x40), UART(0x300)   |
+ * |   1.0 | ? |
+ * |   1.1 | MMIO flash (SPI & CFI)|
+ * --
  */
 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
 #include 
-#include 
 #include 
 
 #include 
@@ -99,6 +116,18 @@ static struct bhnd_device_quirk chipc_qu
 };
 
 
+/*
+ * Here is resource configuration hints for child devices
+ *
+ * [Flash] There are 2 flash resources:
+ *  - resource ID (rid) = 0: memory-mapped flash memory
+ *  - resource ID (rid) = 1: memory-mapped flash registers (i.e for SPI)
+ *
+ * [UART] Uses IRQ and memory resources:
+ *  - resource ID (rid) = 0: memory-mapped registers
+ *  - IRQ resource ID (rid) = 0: shared IRQ line for Tx/Rx.
+ */
+
 static const struct chipc_hint {
const char  *name;
int  unit;
@@ -1288,6 +1317,15 @@ chipc_get_caps(device_t dev)
return (&sc->caps);
 }
 
+static uint32_t
+chipc_get_flash_cfg(device_t dev)
+{
+   struct chipc_softc  *sc;
+
+   sc = device_get_softc(dev);
+   return (bhnd_bus_read_4(sc->core, CHIPC_FLASH_CFG));
+}
+
 static device_method_t chipc_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, chipc_probe),
@@ -1330,11 +1368,13 @@ static device_method_t chipc_methods[] =
DEVMETHOD(bhnd_chipc_enable_sprom,  chipc_enable_sprom_pins),
DEVMETHOD(bhnd_chipc_disable_sprom, chipc_disable_sprom_pins),
DEVMETHOD(bhnd_chipc_get_caps,  chipc_get_caps),
+   DEVMETHOD(bhnd_chipc_get_flash_cfg, chipc_get_flash_cfg),
 
DEVMETHOD_END
 };
 
 DEFINE_CLASS_0(bhnd_chipc, chipc_driver, chipc_methods, sizeof(struct 
chipc_softc));
-DRIVER_MODULE(bhnd_chipc, bhnd, chipc_driver, bhnd_chipc_devclass, 0, 0);
+EARLY_DRIVER_MODULE(bhnd_chipc, bhnd, chipc_driver, bhnd_chipc_devclass, 0, 0,
+BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
 MODULE_DEPEND(bhnd_chipc, bhnd, 1, 1, 1);
 MODULE_VERSION(bhnd_chipc, 1);

Added

svn commit: r301410 - in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/siba dev/bhnd/soc dev/siba mips/broadcom mips/conf

2016-06-04 Thread Landon J. Fuller
Author: landonf
Date: Sat Jun  4 19:53:47 2016
New Revision: 301410
URL: https://svnweb.freebsd.org/changeset/base/301410

Log:
  Switch mips/sentry5 to bhnd(4), and unify with mips/broadcom
  
  Now that bhnd(4) provides feature parity with the previous siba/mips
  implementation, we can switch sentry5 over and begin lifting common
  support code out for use across bhnd(4) embedded targets.
  
  Changes:
  
  - Fixed enumeration of siba(4) per-core address maps, required for
discovery of memory mapped chipc flash region on siba(4) devices.
  - Simplified bhnd kernel configuration (dropped 'bhndbus' option).
  - Replaced files.broadcom's direct file references with their
corresponding standard kernel options.
  - Lifted out common bcma/siba nexus support, inheriting from the new
generic bhnd_nexus driver.
  - Dropped now-unused sentry5 siba code.
  - Re-integrated BCM into the universe build now that it actually compiles.
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D6712

Added:
  head/sys/dev/bhnd/bhnd_nexus.c   (contents, props changed)
  head/sys/dev/bhnd/bhnd_nexusvar.h
 - copied, changed from r301409, head/sys/dev/bhnd/soc/bhnd_soc.h
Deleted:
  head/sys/dev/bhnd/soc/bhnd_soc.c
  head/sys/dev/bhnd/soc/bhnd_soc.h
  head/sys/dev/siba/siba_cc.c
  head/sys/dev/siba/siba_mips.c
  head/sys/dev/siba/siba_pcib.c
  head/sys/dev/siba/siba_pcibvar.h
Modified:
  head/sys/conf/files
  head/sys/dev/bhnd/bcma/bcma.c
  head/sys/dev/bhnd/bcma/bcma_nexus.c
  head/sys/dev/bhnd/siba/siba.c
  head/sys/dev/bhnd/siba/siba_nexus.c
  head/sys/dev/bhnd/siba/siba_subr.c
  head/sys/mips/broadcom/files.broadcom
  head/sys/mips/conf/BCM
  head/sys/mips/conf/BCM.hints
  head/sys/mips/conf/SENTRY5
  head/sys/mips/conf/SENTRY5.hints

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Jun  4 19:39:05 2016(r301409)
+++ head/sys/conf/files Sat Jun  4 19:53:47 2016(r301410)
@@ -9,12 +9,12 @@ acpi_quirks.h optional acpi   
   \
compile-with"${AWK} -f $S/tools/acpi_quirks2h.awk 
$S/dev/acpica/acpi_quirks" \
no-obj no-implicit-rule before-depend  \
clean   "acpi_quirks.h"
-bhnd_nvram_map.h   optional bhndbus | bhnd\
+bhnd_nvram_map.h   optional bhnd  \
dependency  "$S/dev/bhnd/tools/nvram_map_gen.sh 
$S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \
compile-with"sh $S/dev/bhnd/tools/nvram_map_gen.sh 
$S/dev/bhnd/nvram/nvram_map -h" \
no-obj no-implicit-rule before-depend  \
clean   "bhnd_nvram_map.h"
-bhnd_nvram_map_data.h  optional bhndbus | bhnd\
+bhnd_nvram_map_data.h  optional bhnd  \
dependency  "$S/dev/bhnd/tools/nvram_map_gen.sh 
$S/dev/bhnd/tools/nvram_map_gen.awk $S/dev/bhnd/nvram/nvram_map" \
compile-with"sh $S/dev/bhnd/tools/nvram_map_gen.sh 
$S/dev/bhnd/nvram/nvram_map -d" \
no-obj no-implicit-rule before-depend  \
@@ -1127,40 +1127,46 @@ dev/ath/ath_dfs/null/dfs_null.c optional
 dev/bce/if_bce.c   optional bce
 dev/bfe/if_bfe.c   optional bfe
 dev/bge/if_bge.c   optional bge
-dev/bhnd/bhnd.coptional bhndbus | bhnd
-dev/bhnd/bhnd_subr.c   optional bhndbus | bhnd
-dev/bhnd/bhnd_bus_if.m optional bhndbus | bhnd
-dev/bhnd/bhndb/bhnd_bhndb.coptional bhndbus | bhndb
-dev/bhnd/bhndb/bhndb.c optional bhndbus | bhndb
-dev/bhnd/bhndb/bhndb_bus_if.m  optional bhndbus | bhndb
-dev/bhnd/bhndb/bhndb_hwdata.c  optional bhndbus | bhndb
-dev/bhnd/bhndb/bhndb_if.m  optional bhndbus | bhndb
-dev/bhnd/bhndb/bhndb_pci.c optional bhndbus pci | bhndb pci
-dev/bhnd/bhndb/bhndb_pci_hwdata.c  optional bhndbus pci | bhndb pci
-dev/bhnd/bhndb/bhndb_pci_sprom.c   optional bhndbus pci | bhndb pci
-dev/bhnd/bhndb/bhndb_subr.coptional bhndbus pci | bhndb
-dev/bhnd/bcma/bcma.c   optional bhndbus | bcma
-dev/bhnd/bcma/bcma_bhndb.c optional bhndbus | bcma bhndb
-dev/bhnd/bcma/bcma_erom.c  optional bhndbus | bcma
-dev/bhnd/bcma/bcma_subr.c  optional bhndbus | bcma
-dev/bhnd/cores/chipc/chipc.c   optional bhndbus | bhnd
-dev/bhnd/cores/chipc/chipc_subr.c  optional bhndbus | bhnd
-dev/bhnd/cores/chipc/bhnd_chipc_if.m   optional bhndbus | bhnd
-dev/bhnd/cores/chipc/bhnd_sprom_chipc.coptional bhndbus | bhnd
-dev/bhnd/cores/pci/bhnd_pci.c  optional bhndbus pci | bhnd pci
-dev/bhnd/cores/pci/bhnd_pci_hostb.coptional bhndbus pci 

svn commit: r301411 - in head/sys/dev/bhnd: cores/chipc nvram

2016-06-04 Thread Landon J. Fuller
Author: landonf
Date: Sat Jun  4 19:58:01 2016
New Revision: 301411
URL: https://svnweb.freebsd.org/changeset/base/301411

Log:
  bhnd(4): support IPX OTP NVRAM/SPROM data source
  
  Add support for fetching SPROM data from OTP on chipsets with an
  IPX OTP controller (including the BCM43225).
  
  This integrates the NVRAM data source into the chipc_caps capability
  structure, and adds a sprom_offset field that can be used with OTP
  to locate the SPROM image data (found within the general use
  region, H/W subregion).
  
  This also removes one of two duplicate parse error messages reported by
  both the bhnd_sprom driver and the underlying SPROM parsing API.
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D6729

Modified:
  head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m
  head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c
  head/sys/dev/bhnd/cores/chipc/chipc.c
  head/sys/dev/bhnd/cores/chipc/chipc.h
  head/sys/dev/bhnd/cores/chipc/chipcreg.h
  head/sys/dev/bhnd/cores/chipc/chipcvar.h
  head/sys/dev/bhnd/nvram/bhnd_nvram.h
  head/sys/dev/bhnd/nvram/bhnd_sprom.c
  head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c
  head/sys/dev/bhnd/nvram/bhnd_spromvar.h

Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m
==
--- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m   Sat Jun  4 19:53:47 
2016(r301410)
+++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m   Sat Jun  4 19:58:01 
2016(r301411)
@@ -65,15 +65,6 @@ CODE {
 }
 
 /**
- * Return the preferred NVRAM data source.
- *
- * @param dev A bhnd(4) ChipCommon device.
- */
-METHOD bhnd_nvram_src_t nvram_src {
-   device_t dev;
-}
-
-/**
  * Write @p value with @p mask directly to the chipctrl register.
  *
  * @param dev A bhnd(4) ChipCommon device.
@@ -103,7 +94,7 @@ METHOD struct chipc_caps * get_caps {
 } DEFAULT bhnd_chipc_generic_get_caps;
 
 /**
- * Enable hardware access to the SPROM.
+ * Enable hardware access to the SPROM/OTP source.
  * 
  * @param sc chipc driver state.
  *
@@ -116,7 +107,7 @@ METHOD int enable_sprom {
 }
 
 /**
- * Release hardware access to the SPROM.
+ * Release hardware access to the SPROM/OTP source.
  * 
  * @param sc chipc driver state.
  */

Modified: head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c
==
--- head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.cSat Jun  4 19:53:47 
2016(r301410)
+++ head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.cSat Jun  4 19:58:01 
2016(r301411)
@@ -48,12 +48,19 @@ __FBSDID("$FreeBSD$");
 
 #include "bhnd_nvram_if.h"
 
-#include "chipc.h"
+#include "chipcvar.h"
+#include "chipc_private.h"
+
+#defineCHIPC_VALID_SPROM_SRC(_src) \
+   ((_src) == BHND_NVRAM_SRC_SPROM || (_src) == BHND_NVRAM_SRC_OTP)
 
 static void
 chipc_sprom_identify(driver_t *driver, device_t parent)
 {
-   if (bhnd_chipc_nvram_src(parent) != BHND_NVRAM_SRC_SPROM)
+   struct chipc_caps *caps;
+   
+   caps = BHND_CHIPC_GET_CAPS(parent);
+   if (!CHIPC_VALID_SPROM_SRC(caps->nvram_src))
return;
 
if (device_find_child(parent, "bhnd_nvram", 0) != NULL)
@@ -66,13 +73,15 @@ chipc_sprom_identify(driver_t *driver, d
 static int
 chipc_sprom_probe(device_t dev)
 {
-   device_tchipc;
-   int error;
+   struct chipc_caps   *caps;
+   device_t chipc;
+   int  error;
 
chipc = device_get_parent(dev);
+   caps = BHND_CHIPC_GET_CAPS(chipc);
 
-   /* Only match on SPROM devices */
-   if (BHND_CHIPC_NVRAM_SRC(chipc) != BHND_NVRAM_SRC_SPROM)
+   /* Only match on SPROM/OTP devices */
+   if (!CHIPC_VALID_SPROM_SRC(caps->nvram_src))
return (ENXIO);
 
/* Defer to default driver implementation */
@@ -85,16 +94,19 @@ chipc_sprom_probe(device_t dev)
 static int
 chipc_sprom_attach(device_t dev)
 {
-   device_tchipc;
-   int error;
+   struct chipc_caps   *caps;
+   device_t chipc;
+   int  error;
+
+   chipc = device_get_parent(dev);
+   caps = BHND_CHIPC_GET_CAPS(chipc);
 
/* Request that ChipCommon enable access to SPROM hardware before
 * delegating attachment (and SPROM parsing) to the common driver */
-   chipc = device_get_parent(dev);
if ((error = BHND_CHIPC_ENABLE_SPROM(chipc)))
return (error);
 
-   error = bhnd_sprom_attach(dev);
+   error = bhnd_sprom_attach(dev, caps->sprom_offset);
BHND_CHIPC_DISABLE_SPROM(chipc);
return (error);
 }

Modified: head/sys/dev/bhnd/cores/chipc/chipc.c
==
--- head/sys/dev/bhnd/cores/chipc/chipc.c   Sat Jun  4 19:53:47 2016
(r301410)
+++ head/sys/dev/

svn commit: r301412 - in head/lib: libc/sys libthr

2016-06-04 Thread Konstantin Belousov
Author: kib
Date: Sat Jun  4 20:20:14 2016
New Revision: 301412
URL: https://svnweb.freebsd.org/changeset/base/301412

Log:
  Fix markup.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libc/sys/_umtx_op.2
  head/lib/libthr/libthr.3

Modified: head/lib/libc/sys/_umtx_op.2
==
--- head/lib/libc/sys/_umtx_op.2Sat Jun  4 19:58:01 2016
(r301411)
+++ head/lib/libc/sys/_umtx_op.2Sat Jun  4 20:20:14 2016
(r301412)
@@ -472,7 +472,7 @@ read of the umutex memory faults
 .It
 the list length limit described in
 .Xr libthr 3
- is reached.
+is reached.
 .El
 .Pp
 Every mutex in both lists is unlocked as if the

Modified: head/lib/libthr/libthr.3
==
--- head/lib/libthr/libthr.3Sat Jun  4 19:58:01 2016(r301411)
+++ head/lib/libthr/libthr.3Sat Jun  4 20:20:14 2016(r301412)
@@ -234,7 +234,7 @@ installs interposing handlers into the h
 .Li libc .
 The interposers provide real locking implementation instead of the
 stubs for single-threaded processes in
-.Li ,
+.Li libc ,
 cancellation support and some modifications to the signal operations.
 .Pp
 .Nm
___
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: r301413 - head/usr.bin/getent

2016-06-04 Thread Mark Johnston
Author: markj
Date: Sat Jun  4 21:34:06 2016
New Revision: 301413
URL: https://svnweb.freebsd.org/changeset/base/301413

Log:
  Document getent(1)'s ability to enumerate netgroup members.
  
  MFC after:3 days

Modified:
  head/usr.bin/getent/getent.1
  head/usr.bin/getent/getent.c

Modified: head/usr.bin/getent/getent.1
==
--- head/usr.bin/getent/getent.1Sat Jun  4 20:20:14 2016
(r301412)
+++ head/usr.bin/getent/getent.1Sat Jun  4 21:34:06 2016
(r301413)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 24, 2005
+.Dd June 4, 2016
 .Dt GETENT 1
 .Os
 .Sh NAME
@@ -62,6 +62,7 @@ argument may be one of:
 .It Li ethers Ta address name
 .It Li group Ta group:passwd:gid:[member[,member]...]
 .It Li hosts Ta address name [alias ...]
+.It Li netgroup Ta (host,user,domain) [...]
 .It Li networks Ta name network [alias ...]
 .It Li passwd Ta user:passwd:uid:gid:gecos:home_dir:shell
 .It Li protocols Ta name protocol [alias ...]
@@ -107,6 +108,7 @@ or 3 if there is no support for enumerat
 .Xr ethers 5 ,
 .Xr group 5 ,
 .Xr hosts 5 ,
+.Xr netgroup 5 ,
 .Xr networks 5 ,
 .Xr nsswitch.conf 5 ,
 .Xr passwd 5 ,

Modified: head/usr.bin/getent/getent.c
==
--- head/usr.bin/getent/getent.cSat Jun  4 20:20:14 2016
(r301412)
+++ head/usr.bin/getent/getent.cSat Jun  4 21:34:06 2016
(r301413)
@@ -84,13 +84,13 @@ static struct getentdb {
{   "ethers",   ethers, },
{   "group",group,  },
{   "hosts",hosts,  },
+   {   "netgroup", netgroup,   },
{   "networks", networks,   },
{   "passwd",   passwd, },
{   "protocols",protocols,  },
{   "rpc",  rpc,},
{   "services", services,   },
{   "shells",   shells, },
-   {   "netgroup", netgroup,   },
{   "utmpx",utmpx,  },
 
{   NULL,   NULL,   },
___
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: r301414 - head/sys/dev/filemon

2016-06-04 Thread Bryan Drewery
Author: bdrewery
Date: Sat Jun  4 23:34:51 2016
New Revision: 301414
URL: https://svnweb.freebsd.org/changeset/base/301414

Log:
  Fix build after r301404.
  
  X-MFC-With:   r301404
  MFC after:1 week

Modified:
  head/sys/dev/filemon/filemon_wrapper.c

Modified: head/sys/dev/filemon/filemon_wrapper.c
==
--- head/sys/dev/filemon/filemon_wrapper.c  Sat Jun  4 21:34:06 2016
(r301413)
+++ head/sys/dev/filemon/filemon_wrapper.c  Sat Jun  4 23:34:51 2016
(r301414)
@@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_compat.h"
 
+#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32)
+extern struct sysent freebsd32_sysent[];
+#endif
+
 static eventhandler_tag filemon_exec_tag;
 static eventhandler_tag filemon_exit_tag;
 static eventhandler_tag filemon_fork_tag;
___
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: r301415 - head/tools/build/mk

2016-06-04 Thread Kurt Lidl
Author: lidl
Date: Sun Jun  5 01:40:08 2016
New Revision: 301415
URL: https://svnweb.freebsd.org/changeset/base/301415

Log:
  Correct path for blacklistd.conf in OptionalObsoleteFiles.inc
  
  Fix typo made when adding the blacklistd.conf file to 
OptionalObsoleteFiles.inc
  
  Submitted by: Herbert J. Skuhra ( herbert at mailbox.org )
  Reviewed by:  rpaulo
  Approved by:  rpaulo
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6715

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sat Jun  4 23:34:51 
2016(r301414)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sun Jun  5 01:40:08 
2016(r301415)
@@ -447,9 +447,9 @@ OLD_FILES+=usr/share/man/man3/blacklist_
 OLD_FILES+=usr/share/man/man3/blacklist_r.3.gz
 OLD_FILES+=usr/share/man/man3/blacklist_sa.3.gz
 OLD_FILES+=usr/share/man/man3/blacklist_sa_r.3.gz
+OLD_FILES+=usr/share/man/man5/blacklistd.conf.5.gz
 OLD_FILES+=usr/share/man/man8/blacklistctl.8.gz
 OLD_FILES+=usr/share/man/man8/blacklistd.8.gz
-OLD_FILES+=usr/share/man/man8/blacklistd.conf.5.gz
 .endif
 
 .if ${MK_BLUETOOTH} == no
___
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: r301416 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  5 01:42:37 2016
New Revision: 301416
URL: https://svnweb.freebsd.org/changeset/base/301416

Log:
  [ath_hal] Make the AR9462 2.0 initvals from ath9k compile.
  
  The (upcoming) semi-working AR9462 2.1 support uses the 2.0 initvals
  where appropriate, and those need to at least compile under freebsd.

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h   Sun Jun 
 5 01:40:08 2016(r301415)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h   Sun Jun 
 5 01:42:37 2016(r301416)
@@ -22,13 +22,14 @@
 
 #define ar9462_2p0_mac_postamble ar9331_1p1_mac_postamble
 
-#define ar9462_2p0_common_wo_xlna_rx_gain 
ar9300Common_wo_xlna_rx_gain_table_2p2
+//#define ar9462_2p0_common_wo_xlna_rx_gain 
ar9300Common_wo_xlna_rx_gain_table_2p2
+#define ar9462_2p0_common_wo_xlna_rx_gain 
ar9300Common_wo_xlna_rx_gain_table_osprey_2p2
 
 #define ar9462_2p0_common_5g_xlna_only_rxgain ar9462_2p0_common_mixed_rx_gain
 
 #define ar9462_2p0_baseband_core_txfir_coeff_japan_2484 
ar9300_2p2_baseband_core_txfir_coeff_japan_2484
 
-static const u32 ar9462_2p0_modes_fast_clock[][3] = {
+static const uint32_t ar9462_2p0_modes_fast_clock[][3] = {
/* Addr  5G_HT20 5G_HT40   */
{0x1030, 0x0268, 0x04d0},
{0x1070, 0x018c, 0x0318},
@@ -41,7 +42,7 @@ static const u32 ar9462_2p0_modes_fast_c
{0xa254, 0x0898, 0x1130},
 };
 
-static const u32 ar9462_2p0_baseband_postamble[][5] = {
+static const uint32_t ar9462_2p0_baseband_postamble[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
{0x9810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d},
{0x9820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae},
@@ -100,7 +101,7 @@ static const u32 ar9462_2p0_baseband_pos
{0xb284, 0x, 0x, 0x0550, 0x0550},
 };
 
-static const u32 ar9462_2p0_common_rx_gain[][2] = {
+static const uint32_t ar9462_2p0_common_rx_gain[][2] = {
/* Addr  allmodes  */
{0xa000, 0x0001},
{0xa004, 0x00030002},
@@ -360,21 +361,21 @@ static const u32 ar9462_2p0_common_rx_ga
{0xb1fc, 0x0196},
 };
 
-static const u32 ar9462_2p0_pciephy_clkreq_disable_L1[][2] = {
+static const uint32_t ar9462_2p0_pciephy_clkreq_disable_L1[][2] = {
/* Addr  allmodes  */
{0x00018c00, 0x18213ede},
{0x00018c04, 0x000801d8},
{0x00018c08, 0x0003780c},
 };
 
-static const u32 ar9462_2p0_radio_postamble_sys2ant[][5] = {
+static const uint32_t ar9462_2p0_radio_postamble_sys2ant[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
{0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
{0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
{0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 };
 
-static const u32 ar9462_2p0_modes_low_ob_db_tx_gain[][5] = {
+static const uint32_t ar9462_2p0_modes_low_ob_db_tx_gain[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
{0x98bc, 0x0002, 0x0002, 0x0002, 0x0002},
{0xa2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
@@ -443,12 +444,12 @@ static const u32 ar9462_2p0_modes_low_ob
{0x00016454, 0x6db6, 0x6db6, 0x6db6, 0x6db6},
 };
 
-static const u32 ar9462_2p0_soc_postamble[][5] = {
+static const uint32_t ar9462_2p0_soc_postamble[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
{0x7010, 0x0033, 0x0033, 0x0033, 0x0033},
 };
 
-static const u32 ar9462_2p0_baseband_core[][2] = {
+static const uint32_t ar9462_2p0_baseband_core[][2] = {
/* Addr  allmodes  */
{0x9800, 0xafe68e30},
{0x9804, 0xfd14e000},
@@ -598,7 +599,7 @@ static const u32 ar9462_2p0_baseband_cor
{0xb6b4, 0x0001},
 };
 
-static const u32 ar9462_2p0_radio_postamble[][5] = {
+static const uint32_t ar9462_2p0_radio_postamble[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
{0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
{0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
@@ -606,7 +607,7 @@ static const u32 ar9462_2p0_radio_postam
{0x0001650c, 0x4800, 0x4000, 0x4000, 0x4000},
 };
 
-static const u32 ar9462_2p0_modes_mix_ob_db_tx_gain[][5] = {
+static const uint32_t ar9462_2p0_modes_mix_ob_db_tx_gain[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
{0x98bc, 0x0002, 0x0002, 0x0002, 0x0002},
{0xa2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352

svn commit: r301417 - head/libexec/rlogind

2016-06-04 Thread Kurt Lidl
Author: lidl
Date: Sun Jun  5 01:42:58 2016
New Revision: 301417
URL: https://svnweb.freebsd.org/changeset/base/301417

Log:
  Add blacklist support to rlogind
  
  Reviewed by:  rpaulo
  Approved by:  rpaulo
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6593

Modified:
  head/libexec/rlogind/Makefile
  head/libexec/rlogind/rlogind.c

Modified: head/libexec/rlogind/Makefile
==
--- head/libexec/rlogind/Makefile   Sun Jun  5 01:42:37 2016
(r301416)
+++ head/libexec/rlogind/Makefile   Sun Jun  5 01:42:58 2016
(r301417)
@@ -14,4 +14,10 @@ WARNS?=  2
 CFLAGS+= -DINET6
 .endif
 
+.if ${MK_BLACKLIST_SUPPORT} != "no"
+CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include
+LIBADD+= blacklist
+LDFLAGS+=-L${LIBBLACKLISTDIR}
+.endif
+
 .include 

Modified: head/libexec/rlogind/rlogind.c
==
--- head/libexec/rlogind/rlogind.c  Sun Jun  5 01:42:37 2016
(r301416)
+++ head/libexec/rlogind/rlogind.c  Sun Jun  5 01:42:58 2016
(r301417)
@@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-
+#ifdef USE_BLACKLIST
+#include 
+#endif
 
 #ifndef TIOCPKT_WINDOW
 #define TIOCPKT_WINDOW 0x80
@@ -229,6 +231,9 @@ doit(int f, union sockunion *fromp)
/* error check ? */
syslog(LOG_NOTICE, "Connection from %s on illegal port",
   nameinfo);
+#ifdef USE_BLACKLIST
+   blacklist(1, STDIN_FILENO, "illegal port");
+#endif
fatal(f, "Permission denied", 0);
}
 #ifdef IP_OPTIONS
@@ -252,6 +257,9 @@ doit(int f, union sockunion *fromp)
"Connection refused from %s 
with IP option %s",

inet_ntoa(fromp->su_sin.sin_addr),
c == IPOPT_LSRR ? "LSRR" : 
"SSRR");
+#ifdef USE_BLACKLIST
+   blacklist(1, STDIN_FILENO, "source 
routing present");
+#endif
exit(1);
}
if (c == IPOPT_EOL)
@@ -281,11 +289,17 @@ doit(int f, union sockunion *fromp)
if (f > 2)  /* f should always be 0, but... */
(void) close(f);
setup_term(0);
-if (*lusername=='-') {
+   if (*lusername=='-') {
syslog(LOG_ERR, "tried to pass user \"%s\" to login",
   lusername);
+#ifdef USE_BLACKLIST
+   blacklist(1, STDIN_FILENO, "invalid user");
+#endif
fatal(STDERR_FILENO, "invalid user", 0);
}
+#ifdef USE_BLACKLIST
+   blacklist(0, STDIN_FILENO, "success");
+#endif
if (authenticated) {
execl(_PATH_LOGIN, "login", "-p",
"-h", hostname, "-f", lusername, (char *)NULL);
@@ -508,8 +522,12 @@ getstr(char *buf, int cnt, char *errmsg)
do {
if (read(STDIN_FILENO, &c, 1) != 1)
exit(1);
-   if (--cnt < 0)
+   if (--cnt < 0) {
+#ifdef USE_BLACKLIST
+   blacklist(1, STDIN_FILENO, "buffer overflow");
+#endif
fatal(STDOUT_FILENO, errmsg, 0);
+   }
*buf++ = c;
} while (c != 0);
 }
___
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: r301418 - head/sys/dev/acpica

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  5 02:02:51 2016
New Revision: 301418
URL: https://svnweb.freebsd.org/changeset/base/301418

Log:
  [acpi] graphics drivers want access to acpi lid handle
  
  the graphics drivers can benefit from access to the lid handle for querying 
and getting notifications
  
  Submitted by: kmacy
  Differential Revision:https://reviews.freebsd.org/D6643

Modified:
  head/sys/dev/acpica/acpi_lid.c

Modified: head/sys/dev/acpica/acpi_lid.c
==
--- head/sys/dev/acpica/acpi_lid.c  Sun Jun  5 01:42:58 2016
(r301417)
+++ head/sys/dev/acpica/acpi_lid.c  Sun Jun  5 02:02:51 2016
(r301418)
@@ -52,6 +52,8 @@ struct acpi_lid_softc {
 intlid_status; /* open or closed */
 };
 
+ACPI_HANDLE acpi_lid_handle;
+
 ACPI_SERIAL_DECL(lid, "ACPI lid");
 
 static int acpi_lid_probe(device_t dev);
@@ -105,7 +107,7 @@ acpi_lid_attach(device_t dev)
 
 sc = device_get_softc(dev);
 sc->lid_dev = dev;
-sc->lid_handle = acpi_get_handle(dev);
+acpi_lid_handle = sc->lid_handle = acpi_get_handle(dev);
 
 /*
  * If a system does not get lid events, it may make sense to change
___
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: r301419 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  5 02:15:29 2016
New Revision: 301419
URL: https://svnweb.freebsd.org/changeset/base/301419

Log:
  [ath_hal] convert the MCI code over to work on Jupiter 2.1.
  
  (Note: jupiter 1.0 was emulation / test silicon, and was never released
  in production.  So, yes, AR_SREV_JUPITER() would really be fine.)

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cSun Jun  5 
02:02:51 2016(r301418)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_mci.cSun Jun  5 
02:15:29 2016(r301419)
@@ -107,7 +107,7 @@ void ar9300_mci_osla_setup(struct ath_ha
 static void ar9300_mci_reset_req_wakeup(struct ath_hal *ah)
 {
 /* to be tested in emulation */
-if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) {
+if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) {
 OS_REG_RMW_FIELD(ah, AR_MCI_COMMAND2,
 AR_MCI_COMMAND2_RESET_REQ_WAKEUP, 1);
 OS_DELAY(1);
@@ -364,7 +364,7 @@ static void ar9300_mci_send_2g5g_status(
 struct ath_hal_9300 *ahp = AH9300(ah);
 u_int32_t new_flags, to_set, to_clear;
 
-if ((AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) &&
+if ((AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) &&
 (ahp->ah_mci_coex_2g5g_update == AH_TRUE) &&
 (ahp->ah_mci_bt_state != MCI_BT_SLEEP))
 {
@@ -409,7 +409,7 @@ void ar9300_mci_2g5g_switch(struct ath_h
 
 OS_REG_CLR_BIT(ah, AR_MCI_TX_CTRL,
 AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
-if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) {
+if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) {
 OS_REG_CLR_BIT(ah, AR_GLB_CONTROL,
 AR_BTCOEX_CTRL_BT_OWN_SPDT_CTRL);
 if (!(ah->ah_config.ath_hal_mci_config &
@@ -425,7 +425,7 @@ void ar9300_mci_2g5g_switch(struct ath_h
 
 OS_REG_SET_BIT(ah, AR_MCI_TX_CTRL,
 AR_MCI_TX_CTRL_DISABLE_LNA_UPDATE);
-if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) {
+if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) {
 OS_REG_SET_BIT(ah, AR_GLB_CONTROL,
 AR_BTCOEX_CTRL_BT_OWN_SPDT_CTRL);
 ar9300_mci_osla_setup(ah, AH_FALSE);
@@ -1035,7 +1035,7 @@ void ar9300_mci_reset(struct ath_hal *ah
 }
 
 
-if (is_2g && (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) &&
+if (is_2g && (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) &&
  !(ah->ah_config.ath_hal_mci_config &
ATH_MCI_CONFIG_DISABLE_OSLA))
 {
@@ -1045,7 +1045,7 @@ void ar9300_mci_reset(struct ath_hal *ah
 ar9300_mci_osla_setup(ah, AH_FALSE);
 }
 
-if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) {
+if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) {
 OS_REG_SET_BIT(ah, AR_GLB_CONTROL, AR_BTCOEX_CTRL_SPDT_ENABLE);
 
 OS_REG_RMW_FIELD(ah, AR_BTCOEX_CTRL3,
@@ -1743,7 +1743,7 @@ ar9300_mci_state(struct ath_hal *ah, u_i
 ar9300_mci_send_coex_bt_status_query(ah, AH_TRUE,
 MCI_GPM_COEX_QUERY_BT_DEBUG);
 OS_DELAY(10);
-if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) {
+if (AR_SREV_JUPITER_20_OR_LATER(ah) || 
AR_SREV_APHRODITE(ah)) {
 ar9300_mci_send_coex_bt_flags(ah, AH_TRUE,
 MCI_GPM_COEX_BT_FLAGS_READ, 0);
 }
___
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: r301420 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  5 02:16:16 2016
New Revision: 301420
URL: https://svnweb.freebsd.org/changeset/base/301420

Log:
  [ath_hal] teach the reset path(s) about Jupiter 2.1.
  
  This was just .. not programming in things, and thus large chunks
  of the radio wouldn't work.  Notably, 5GHz didn't work.

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Sun Jun  5 
02:15:29 2016(r301419)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Sun Jun  5 
02:16:16 2016(r301420)
@@ -3000,7 +3000,7 @@ ar9300_process_ini(struct ath_hal *ah, s
 ar9300_prog_ini(ah, &ahp->ah_ini_mac[i], modes_index);
 ar9300_prog_ini(ah, &ahp->ah_ini_bb[i], modes_index);
 ar9300_prog_ini(ah, &ahp->ah_ini_radio[i], modes_index);
-if ((i == ATH_INI_POST) && (AR_SREV_JUPITER_20(ah) || 
AR_SREV_APHRODITE(ah))) {
+if ((i == ATH_INI_POST) && (AR_SREV_JUPITER_20_OR_LATER(ah) || 
AR_SREV_APHRODITE(ah))) {
 ar9300_prog_ini(ah, &ahp->ah_ini_radio_post_sys2ant, modes_index);
 }
 
@@ -3118,7 +3118,8 @@ ar9300_process_ini(struct ath_hal *ah, s
 }
 
 #if 0
-if (AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)) {
+/* XXX TODO! */
+if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) {
 ar9300_prog_ini(ah, &ahp->ah_ini_BTCOEX_MAX_TXPWR, 1);
 }
 #endif
@@ -4497,7 +4498,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPM
 
 #if ATH_SUPPORT_MCI
 if (AH_PRIVATE(ah)->ah_caps.halMciSupport &&
-(AR_SREV_JUPITER_20(ah) || AR_SREV_APHRODITE(ah)))
+(AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)))
 {
 ar9300_mci_2g5g_changed(ah, IEEE80211_IS_CHAN_2GHZ(chan));
 }
___
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: r301421 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  5 02:17:51 2016
New Revision: 301421
URL: https://svnweb.freebsd.org/changeset/base/301421

Log:
  [ath_hal] Add Jupiter 2.1 (AR9462 mac 640.3) support.
  
  Turns out I wasn't even initialising or programming a lot of stuff
  for the AR9462 2.1 chip.  Oops.
  
  This mostly gets it working. powersave scan results in some pretty
  hilarious NFcal hangs and I don't see beacons reliably.
  There are still some xlna gain tables missing that ath9k has; I'll
  follow up with some fixes and then see if the QCAFN222 NIC I have
  tests this path.
  
  Tested:
  
  * QCAFN222 NIC, STA mode, 2GHz and 5GHz

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun  5 
02:16:16 2016(r301420)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun  5 
02:17:51 2016(r301421)
@@ -38,7 +38,9 @@
 #include "ar9300/ar9485.ini"
 #include "ar9300/ar9485_1_1.ini"
 #include "ar9300/ar9300_jupiter10.ini"
+/* TODO: convert the 2.0 code to use the new initvals from ath9k */
 #include "ar9300/ar9300_jupiter20.ini"
+#include "ar9300/ar9462_2p0_initvals.h"
 #include "ar9300/ar9462_2p1_initvals.h"
 #include "ar9300/ar9580.ini"
 #include "ar9300/ar955x.ini"
@@ -1676,10 +1678,11 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC
 ar9300_jupiter_1p0_baseband_core_txfir_coeff_japan_2484), 2);
 
 }
-else if (AR_SREV_JUPITER_20(ah)) {
+else if (AR_SREV_JUPITER_20_OR_LATER(ah)) {
 /* Jupiter: new INI format (pre, core, post arrays per subsystem) */
 
 /* FreeBSD: just override the registers for jupiter 2.1 */
+/* XXX TODO: refactor this stuff out; reinit all the 2.1 registers */
 
 /* mac */
 INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_PRE], NULL, 0, 0);
@@ -2923,6 +2926,7 @@ ar9300_fill_capability_info(struct ath_h
 p_cap->halMciSupport = AH_FALSE;
 }
 
+/* XXX TODO: jupiter 2.1? */
 if (AR_SREV_JUPITER_20(ah)) {
 p_cap->halRadioRetentionSupport = AH_TRUE;
 } else {
@@ -3533,13 +3537,19 @@ void ar9300_rx_gain_table_apply(struct a
 ar9300_common_mixed_rx_gain_table_jupiter_1p0,
 ARRAY_LENGTH(ar9300_common_mixed_rx_gain_table_jupiter_1p0), 
2);
 break;
-}
+}
 else if (AR_SREV_JUPITER_20(ah)) {
 INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, 
 ar9300Common_mixed_rx_gain_table_jupiter_2p0,
 ARRAY_LENGTH(ar9300Common_mixed_rx_gain_table_jupiter_2p0), 2);
 break;
 }
+else if (AR_SREV_JUPITER_21(ah)) {
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, 
+ar9462_2p1_common_mixed_rx_gain,
+ARRAY_LENGTH(ar9462_2p1_common_mixed_rx_gain), 2);
+break;
+}
 case 0:
 default:
 if (AR_SREV_HORNET_12(ah)) {
@@ -3583,6 +3593,10 @@ void ar9300_rx_gain_table_apply(struct a
 INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, 
 ar9300Common_rx_gain_table_jupiter_2p0,
 ARRAY_LENGTH(ar9300Common_rx_gain_table_jupiter_2p0), 2);
+} else if (AR_SREV_JUPITER_21(ah)) {
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
+ar9462_2p1_common_rx_gain,
+ARRAY_LENGTH(ar9462_2p1_common_rx_gain), 2);
 } else if (AR_SREV_AR9580(ah)) {
 INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
 ar9300_common_rx_gain_table_ar9580_1p0,
@@ -3638,6 +3652,11 @@ void ar9300_rx_gain_table_apply(struct a
 ar9300Common_wo_xlna_rx_gain_table_jupiter_2p0,
 ARRAY_LENGTH(ar9300Common_wo_xlna_rx_gain_table_jupiter_2p0),
 2);
+} else if (AR_SREV_JUPITER_21(ah)) {
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
+ar9462_2p1_common_wo_xlna_rx_gain,
+ARRAY_LENGTH(ar9462_2p1_common_wo_xlna_rx_gain),
+2);
 } else if (AR_SREV_APHRODITE(ah)) {
 INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, 
 ar956XCommon_wo_xlna_rx_gain_table_aphrodite_1p0,
@@ -3718,11 +3737,16 @@ void ar9300_tx_gain_table_apply(struct a
 ar9300_modes_low_ob_db_tx_gain_table_jupiter_1p0,
 ARRAY_LENGTH(ar9300_modes_low_ob_db_tx_gain_table_jupiter_1p0),
 5);
-} else if (AR_SREV_JUPITER_20(ah)) {
+ } else if (AR_SREV_JUPITER_20(ah)) {
 INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
 ar9300Modes_low_ob_db_tx_gain_table_jupiter_2p0,
 ARRAY_LENGTH(ar9300Modes_low_ob_db_tx_gain_table_jupiter_2p0),
 5);
+   } else if (AR_SREV_JUPITER_21(ah)) {
+INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
+  

svn commit: r301423 - head/sys/contrib/dev/ath/ath_hal/ar9300

2016-06-04 Thread Adrian Chadd
Author: adrian
Date: Sun Jun  5 05:55:27 2016
New Revision: 301423
URL: https://svnweb.freebsd.org/changeset/base/301423

Log:
  [ath_hal] add AR9462 (jupiter) RX gain / XLNA programming.
  
  This seems to make 5G work better.
  
  It doesn't fix powersave handling though, that still sees the PHY get
  stuck during initial calibration and everything goes pear shaped.
  I'll look into that later.
  
  Tested:
  
  * QCAFN222 NIC, STA mode, 5GHz
  
  Obtained from:Linux ath9k

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.hSun Jun  5 05:49:33 
2016(r301422)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.hSun Jun  5 05:55:27 
2016(r301423)
@@ -635,6 +635,10 @@ struct ath_hal_9300 {
 struct ar9300_ini_array ah_ini_japan2484;
 struct ar9300_ini_array ah_ini_radio_post_sys2ant;
 struct ar9300_ini_array ah_ini_BTCOEX_MAX_TXPWR;
+struct ar9300_ini_array ah_ini_modes_rxgain_xlna;
+struct ar9300_ini_array ah_ini_modes_rxgain_bb_core;
+struct ar9300_ini_array ah_ini_modes_rxgain_bb_postamble;
+
 /* 
  * New INI format starting with Osprey 2.0 INI.
  * Pre, core, post arrays for each sub-system (mac, bb, radio, soc)

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun  5 
05:49:33 2016(r301422)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Jun  5 
05:55:27 2016(r301423)
@@ -3542,14 +3542,50 @@ void ar9300_rx_gain_table_apply(struct a
 INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, 
 ar9300Common_mixed_rx_gain_table_jupiter_2p0,
 ARRAY_LENGTH(ar9300Common_mixed_rx_gain_table_jupiter_2p0), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_core,
+ar9462_2p0_baseband_core_mix_rxgain,
+ARRAY_LENGTH(ar9462_2p0_baseband_core_mix_rxgain), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_postamble,
+ar9462_2p0_baseband_postamble_mix_rxgain,
+ARRAY_LENGTH(ar9462_2p0_baseband_postamble_mix_rxgain), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna,
+ar9462_2p0_baseband_postamble_5g_xlna,
+ARRAY_LENGTH(ar9462_2p0_baseband_postamble_5g_xlna), 2);
 break;
 }
 else if (AR_SREV_JUPITER_21(ah)) {
 INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain, 
 ar9462_2p1_common_mixed_rx_gain,
 ARRAY_LENGTH(ar9462_2p1_common_mixed_rx_gain), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_core,
+ar9462_2p1_baseband_core_mix_rxgain,
+ARRAY_LENGTH(ar9462_2p1_baseband_core_mix_rxgain), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bb_postamble,
+ar9462_2p1_baseband_postamble_mix_rxgain,
+ARRAY_LENGTH(ar9462_2p1_baseband_postamble_mix_rxgain), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna,
+ar9462_2p1_baseband_postamble_5g_xlna,
+ARRAY_LENGTH(ar9462_2p1_baseband_postamble_5g_xlna), 2);
+
 break;
 }
+case 3:
+if (AR_SREV_JUPITER_21(ah)) {
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
+ar9462_2p1_common_5g_xlna_only_rxgain,
+ARRAY_LENGTH(ar9462_2p1_common_5g_xlna_only_rxgain), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna,
+ar9462_2p1_baseband_postamble_5g_xlna,
+ARRAY_LENGTH(ar9462_2p1_baseband_postamble_5g_xlna), 2);
+} else if (AR_SREV_JUPITER_20(ah)) {
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
+ar9462_2p0_common_5g_xlna_only_rxgain,
+ARRAY_LENGTH(ar9462_2p0_common_5g_xlna_only_rxgain), 2);
+INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_xlna,
+ar9462_2p0_baseband_postamble_5g_xlna,
+ARRAY_LENGTH(ar9462_2p0_baseband_postamble_5g_xlna), 2);
+}
+break;
 case 0:
 default:
 if (AR_SREV_HORNET_12(ah)) {

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Sun Jun  5 
05:49:33 2016(r301422)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Sun Jun  5 
05:55:27 2016(r301423)
@@ -3053,6 +3053,26 @@ ar9300_process_ini(struct ath_hal *ah, s
 REG_WRITE_ARRAY(&ahp->ah_ini_modes_rxgain, 

svn commit: r301427 - head/sys/dev/sfxge/common

2016-06-04 Thread Andrew Rybchenko
Author: arybchik
Date: Sun Jun  5 06:37:54 2016
New Revision: 301427
URL: https://svnweb.freebsd.org/changeset/base/301427

Log:
  sfxge(4): allow firmware to auto-configure event queues on Medford
  
  On Medford, licenses are required to enable RX and event cut through and to
  disable RX batching. To avoid the need for the driver to make decisions based 
on
  the licensing state, the MC_CMD_INIT_EVQ has been extended to allow us to 
leave
  the decision to the firmware. If the adapter is licensed for low-latency use,
  the firmware will choose the optimal settings for latency, otherwise it will 
use
  the best settings for throughput.
  
  For Huntington we still need to choose the settings ourselves.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week
  Differential Revision:  https://reviews.freebsd.org/D6717

Modified:
  head/sys/dev/sfxge/common/ef10_ev.c
  head/sys/dev/sfxge/common/ef10_nic.c
  head/sys/dev/sfxge/common/efx.h

Modified: head/sys/dev/sfxge/common/ef10_ev.c
==
--- head/sys/dev/sfxge/common/ef10_ev.c Sun Jun  5 06:06:55 2016
(r301426)
+++ head/sys/dev/sfxge/common/ef10_ev.c Sun Jun  5 06:37:54 2016
(r301427)
@@ -139,7 +139,8 @@ efx_mcdi_init_evq(
__inefsys_mem_t *esmp,
__insize_t nevs,
__inuint32_t irq,
-   __inuint32_t us)
+   __inuint32_t us,
+   __inboolean_t low_latency)
 {
efx_mcdi_req_t req;
uint8_t payload[
@@ -149,7 +150,7 @@ efx_mcdi_init_evq(
uint64_t addr;
int npages;
int i;
-   int supports_rx_batching;
+   int ev_cut_through;
efx_rc_t rc;
 
npages = EFX_EVQ_NBUFS(nevs);
@@ -170,21 +171,19 @@ efx_mcdi_init_evq(
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_IRQ_NUM, irq);
 
/*
-* On Huntington RX and TX event batching can only be requested
-* together (even if the datapath firmware doesn't actually support RX
-* batching).
-* Cut through is incompatible with RX batching and so enabling cut
-* through disables RX batching (but it does not affect TX batching).
+* On Huntington RX and TX event batching can only be requested together
+* (even if the datapath firmware doesn't actually support RX
+* batching). If event cut through is enabled no RX batching will occur.
 *
-* So always enable RX and TX event batching, and enable cut through
-* if RX event batching isn't supported (i.e. on low latency firmware).
+* So always enable RX and TX event batching, and enable event cut
+* through if we want low latency operation.
 */
-   supports_rx_batching = enp->en_nic_cfg.enc_rx_batching_enabled ? 1 : 0;
+   ev_cut_through = low_latency ? 1 : 0;
MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS,
INIT_EVQ_IN_FLAG_INTERRUPTING, 1,
INIT_EVQ_IN_FLAG_RPTR_DOS, 0,
INIT_EVQ_IN_FLAG_INT_ARMD, 0,
-   INIT_EVQ_IN_FLAG_CUT_THRU, !supports_rx_batching,
+   INIT_EVQ_IN_FLAG_CUT_THRU, ev_cut_through,
INIT_EVQ_IN_FLAG_RX_MERGE, 1,
INIT_EVQ_IN_FLAG_TX_MERGE, 1);
 
@@ -250,6 +249,114 @@ fail1:
return (rc);
 }
 
+
+static __checkReturn   efx_rc_t
+efx_mcdi_init_evq_v2(
+   __inefx_nic_t *enp,
+   __inunsigned int instance,
+   __inefsys_mem_t *esmp,
+   __insize_t nevs,
+   __inuint32_t irq,
+   __inuint32_t us)
+{
+   efx_mcdi_req_t req;
+   uint8_t payload[
+   MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
+   MC_CMD_INIT_EVQ_V2_OUT_LEN)];
+   efx_qword_t *dma_addr;
+   uint64_t addr;
+   int npages;
+   int i;
+   efx_rc_t rc;
+
+   npages = EFX_EVQ_NBUFS(nevs);
+   if (MC_CMD_INIT_EVQ_V2_IN_LEN(npages) > MC_CMD_INIT_EVQ_V2_IN_LENMAX) {
+   rc = EINVAL;
+   goto fail1;
+   }
+
+   (void) memset(payload, 0, sizeof (payload));
+   req.emr_cmd = MC_CMD_INIT_EVQ;
+   req.emr_in_buf = payload;
+   req.emr_in_length = MC_CMD_INIT_EVQ_V2_IN_LEN(npages);
+   req.emr_out_buf = payload;
+   req.emr_out_length = MC_CMD_INIT_EVQ_V2_OUT_LEN;
+
+   MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_SIZE, nevs);
+   MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance);
+   MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq);
+
+   MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS,
+   INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1,
+   INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0,
+   INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0,
+   INIT_EVQ_V2_IN_FLAG_TYPE, MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO);
+
+   /* If the value is zero then disable the timer */
+