svn commit: r296988 - head/usr.sbin/bsdinstall/scripts

2016-03-18 Thread Allan Jude
Author: allanjude
Date: Thu Mar 17 17:53:38 2016
New Revision: 296988
URL: https://svnweb.freebsd.org/changeset/base/296988

Log:
  Remove 50% ZFS conditional from bsdinstall/zfsboot
  
  Remove the requirement that the resulting partition table be atleast 50% ZFS
  
  PR:   208094
  Requested by: brooks
  Sponsored by: ScaleEngine Inc.

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootThu Mar 17 12:30:21 2016
(r296987)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootThu Mar 17 17:53:38 2016
(r296988)
@@ -302,7 +302,7 @@ msg_swap_mirror_help="Mirror swap partit
 msg_swap_size="Swap Size"
 msg_swap_size_help="Customize how much swap space is allocated to each 
selected disk"
 msg_swap_toosmall="The selected swap size (%s) is to small. Please enter a 
value greater than 100MB or enter 0 for no swap"
-msg_these_disks_are_too_small="These disks are too small given the amount of 
requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or 
more of each of the following selected disk\ndevices (not recommended):\n\n  
%s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of 
devices."
+msg_these_disks_are_too_small="These disks are smaller than the amount of 
requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 100%% or 
more of each of the following selected disks:\n\n  %s\n\nRecommend changing 
partition size(s) and/or selecting a\ndifferent set of disks."
 msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'"
 msg_unsupported_partition_scheme="%s is an unsupported partition scheme"
 msg_user_cancelled="User Cancelled."
@@ -1483,11 +1483,12 @@ while :; do
# NB: dialog_menu_layout supports running non-interactively
dialog_menu_layout || continue
 
-   # Make sure each disk will be at least 50% ZFS
+   # Make sure each disk will have room for ZFS
if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize &&
-  f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize
+  f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize &&
+  f_expand_number "1g" zpoolmin
then
-   minsize=$swapsize teeny_disks=
+   minsize=$(( $swapsize + $zpoolmin )) teeny_disks=
[ "$ZFSBOOT_BOOT_POOL" ] &&
minsize=$(( $minsize + $bootsize ))
for disk in $ZFSBOOT_DISKS; do
@@ -1495,7 +1496,6 @@ while :; do
$disk $DEVICE_TYPE_DISK device
$device get capacity disksize || continue
[ ${disksize:-0} -ge 0 ] || disksize=0
-   disksize=$(( $disksize - $minsize ))
[ $disksize -lt $minsize ] &&
teeny_disks="$teeny_disks $disk"
done
___
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: r296987 - head/sys/ofed/drivers/net/mlx4

2016-03-18 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Mar 17 12:30:21 2016
New Revision: 296987
URL: https://svnweb.freebsd.org/changeset/base/296987

Log:
  Add missing curly brackets in for loop.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/ofed/drivers/net/mlx4/en_port.c

Modified: head/sys/ofed/drivers/net/mlx4/en_port.c
==
--- head/sys/ofed/drivers/net/mlx4/en_port.cThu Mar 17 11:10:44 2016
(r296986)
+++ head/sys/ofed/drivers/net/mlx4/en_port.cThu Mar 17 12:30:21 2016
(r296987)
@@ -60,10 +60,11 @@ int mlx4_SET_VLAN_FLTR(struct mlx4_dev *
memset(filter, 0, sizeof(*filter));
for (i = VLAN_FLTR_SIZE - 1; i >= 0; i--) {
entry = 0;
-   for (j = 0; j < 32; j++)
+   for (j = 0; j < 32; j++) {
if (test_bit(index, priv->active_vlans))
entry |= 1 << j;
-index++;
+   index++;
+   }
filter->entry[i] = cpu_to_be32(entry);
}
err = mlx4_cmd(dev, mailbox->dma, priv->port, 0, MLX4_CMD_SET_VLAN_FLTR,
___
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: r296933 - in head: share/man/man9 sys/sys

2016-03-18 Thread Gleb Smirnoff
On Wed, Mar 16, 2016 at 01:32:41PM -0700, Gleb Smirnoff wrote:
T> H> +.Sh EXAMPLES
T> H> +The following example creates a static counter array exported to
T> H> +userspace through a sysctl:
T> H> +.Bd -literal -offset indent
T> H> +#define MY_SIZE 8
T> H> +static counter_u64_t array[MY_SIZE];
T> H> +SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW,
T> H> +[0], MY_SIZE, "Test counter array");
T> 
T> I always wondered what is stylistically better: array or [0]? I
T> usually prefer the former.

And now your assertion forces to do the latter.

-- 
Totus tuus, Glebius.
___
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: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib

2016-03-18 Thread John Baldwin
On Wednesday, March 16, 2016 01:27:38 PM Gleb Smirnoff wrote:
> On Tue, Mar 15, 2016 at 10:43:53AM -0700, John Baldwin wrote:
> J> > Log:
> J> >   Fix witness panic in the ipoib_ioctl() function when unloading the
> J> >   ipoib module.
> J> >   
> J> >   The bpfdetach() function is trying to turn off promiscious mode on the
> J> >   network interface it is attached to while holding a mutex. The fix
> J> >   consists of ignoring any further calls to the ipoib_ioctl() function
> J> >   when the network interface is going to be detached. The ipoib_ioctl()
> J> >   function might sleep.
> J> >   
> J> >   Sponsored by:  Mellanox Technologies
> J> >   MFC after: 1 week
> J> 
> J> In all of the other NIC drivers I have worked on the fix has been to call
> J> if_detach (or ether_ifdetach) as the first step in your detach method 
> before
> J> you try to stop the interface.  The idea is to remove external connections
> J> from your driver first, and the only after those have drained do you 
> actually
> J> shut down the hardware.  Given you are calling if_detach() just before
> J> if_free() below, ipoib just seems to be broken here.
> J> 
> J> For example, detach in a typical NIC driver does this:
> J> 
> J>struct foo_softc *sc;
> J> 
> J>sc = device_get_softc(dev);
> J>ether_ifdetach(sc->sc_ifp);
> J>FOO_LOCK(sc);
> J>foo_stop(sc);
> J>FOO_UNLOCK(sc);
> J>callout_drain(>timer);
> J>bus_teardown_intr(...);
> J>bus_release_resource(...);
> J>if_free(sc->sc_ifp);
> J> 
> J> Similarly, devices with a character device in /dev should be calling
> J> destroy_dev() first before shutting down hardware, etc.
> 
> In the new KPI in the projects/ifnet branch, I am doing the following:
> 
> - there is only one if_detach(), that does both detach and free
> - if_detach() is called at the very last stage, after stopping hardware (if 
> hw is still present)
> - driver is responsible to be ready to be called from upper half of the stack,
>   regardless of the state of hardware. Ususally it means that it should lock 
> internal mutex,
>   and check internal RUNNING flag.
> 
> Note, that hardware can go away asynchronously, so demand to call if_detach()
> before stopping hardware can't be fulfiled.

How do you prevent a userland application from doing the equivalent of
'ifconfig up' in between a driver calling foo_stop() to clear RUNNING and
the later call to if_detach?  This race is why I think as a general rule
drivers should try to detach external references first before trying to
quiesce the hardware.  Certainly if the hardware is gone there's nothing to
quiesce, but that's orthogonal to the race of how you ensure the user doesn't
"undo" the explicit hardware quiesce performed during detach when your
hardware is still around.  (You do agree that a driver should explicitly stop
hardware when being detached so it doesn't continue to DMA or fire
interrupts, right?  And that needs to happen at least once after ensuring
you can't be "upped".)  Previously some drivers tried to handle this by
duplicating logic to set a "detaching" flag during detach to ignore all
ioctls.  It seems cleaner to me for drivers to instead call if_detach first
(and let it drain once it is fixed to actually do some sort of drain
ala bus_teardown_intr()) rather than having that code duplicated in all
the drivers.

-- 
John Baldwin
___
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: r296970 - head/lib/libxo/tests

2016-03-18 Thread NGie Cooper

> On Mar 16, 2016, at 17:37, Simon J. Gerraty  wrote:
> 
> Author: sjg
> Date: Thu Mar 17 00:37:04 2016
> New Revision: 296970
> URL: https://svnweb.freebsd.org/changeset/base/296970
> 
> Log:
>  We need libutil
> 
>  and make it feasible to at least build the tests in situ
> 
> Modified:
>  head/lib/libxo/tests/Makefile
> 
> Modified: head/lib/libxo/tests/Makefile
> ==
> --- head/lib/libxo/tests/MakefileThu Mar 17 00:32:29 2016(r296969)
> +++ head/lib/libxo/tests/MakefileThu Mar 17 00:37:04 2016(r296970)
> @@ -242,8 +242,14 @@ PROGS+= test_11
> 
> CFLAGS+=-I${LIBXOSRC}/libxo
> 
> -LIBADD=xo
> +LIBADD=xo util 
> 
> SUBDIR+=encoder
> 
> +.if ${MACHINE} == "host"
> +# make it easy to test without install
> +TESTSDIR=${.OBJDIR}
> +CFLAGS+=-I${.CURDIR:H}
> +.endif
> +
> .include 

This commit seems unnecessary -- have you tried make check yet?
Thanks,
-Ngie
___
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: r296991 - head/sys/netinet6

2016-03-18 Thread Mark Johnston
Author: markj
Date: Thu Mar 17 19:01:44 2016
New Revision: 296991
URL: https://svnweb.freebsd.org/changeset/base/296991

Log:
  Modify defrouter_remove() to perform the router lookup before removal.
  
  This allows some simplification of its callers. No functional change
  intended.
  
  Tested by:Larry Rosenman (as part of a larger change)
  MFC after:1 month

Modified:
  head/sys/netinet6/nd6.h
  head/sys/netinet6/nd6_nbr.c
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/netinet6/nd6.h
==
--- head/sys/netinet6/nd6.h Thu Mar 17 18:55:54 2016(r296990)
+++ head/sys/netinet6/nd6.h Thu Mar 17 19:01:44 2016(r296991)
@@ -459,7 +459,7 @@ void defrouter_reset(void);
 void defrouter_select(void);
 void defrouter_ref(struct nd_defrouter *);
 void defrouter_rele(struct nd_defrouter *);
-void defrouter_remove(struct nd_defrouter *);
+bool defrouter_remove(struct in6_addr *, struct ifnet *);
 void defrouter_unlink(struct nd_defrouter *, struct nd_drhead *);
 void defrouter_del(struct nd_defrouter *);
 void prelist_remove(struct nd_prefix *);

Modified: head/sys/netinet6/nd6_nbr.c
==
--- head/sys/netinet6/nd6_nbr.c Thu Mar 17 18:55:54 2016(r296990)
+++ head/sys/netinet6/nd6_nbr.c Thu Mar 17 19:01:44 2016(r296991)
@@ -857,30 +857,19 @@ nd6_na_input(struct mbuf *m, int off, in
 * Remove the sender from the Default Router List and
 * update the Destination Cache entries.
 */
-   struct nd_defrouter *dr;
struct ifnet *nd6_ifp;
 
nd6_ifp = lltable_get_ifp(ln->lle_tbl);
-   ND6_WLOCK();
-   dr = defrouter_lookup_locked(>r_l3addr.addr6,
-   nd6_ifp);
-   if (dr != NULL) {
-   /* releases the ND lock */
-   defrouter_remove(dr);
-   dr = NULL;
-   } else {
-   ND6_WUNLOCK();
-   if ((ND_IFINFO(nd6_ifp)->flags & 
ND6_IFF_ACCEPT_RTADV) != 0) {
-   /*
-* Even if the neighbor is not in the 
default
-* router list, the neighbor may be used
-* as a next hop for some destinations
-* (e.g. redirect case). So we must
-* call rt6_flush explicitly.
-*/
-   rt6_flush(>ip6_src, ifp);
-   }
-   }
+   if (!defrouter_remove(>r_l3addr.addr6, nd6_ifp) &&
+   (ND_IFINFO(nd6_ifp)->flags &
+ND6_IFF_ACCEPT_RTADV) != 0)
+   /*
+* Even if the neighbor is not in the default
+* router list, the neighbor may be used as a
+* next hop for some destinations (e.g. redirect
+* case). So we must call rt6_flush explicitly.
+*/
+   rt6_flush(>ip6_src, ifp);
}
ln->ln_router = is_router;
}

Modified: head/sys/netinet6/nd6_rtr.c
==
--- head/sys/netinet6/nd6_rtr.c Thu Mar 17 18:55:54 2016(r296990)
+++ head/sys/netinet6/nd6_rtr.c Thu Mar 17 19:01:44 2016(r296991)
@@ -627,22 +627,26 @@ defrouter_reset(void)
 }
 
 /*
- * Remove a router from the global list and free it.
- *
- * The ND lock must be held and is released before returning. The caller must
- * hold a reference on the router object.
+ * Look up a matching default router list entry and remove it. Returns true if 
a
+ * matching entry was found, false otherwise.
  */
-void
-defrouter_remove(struct nd_defrouter *dr)
+bool
+defrouter_remove(struct in6_addr *addr, struct ifnet *ifp)
 {
+   struct nd_defrouter *dr;
 
-   ND6_WLOCK_ASSERT();
-   KASSERT(dr->refcnt >= 2, ("unexpected refcount 0x%x", dr->refcnt));
+   ND6_WLOCK();
+   dr = defrouter_lookup_locked(addr, ifp);
+   if (dr == NULL) {
+   ND6_WUNLOCK();
+   return (false);
+   }
 
defrouter_unlink(dr, NULL);
ND6_WUNLOCK();
defrouter_del(dr);
defrouter_rele(dr);
+   return (true);
 }
 
 /*
@@ -850,14 +854,14 @@ defrtrlist_update(struct nd_defrouter *n
struct nd_defrouter *dr, *n;
int oldpref;
 
-   

svn commit: r297006 - head/sys/net80211

2016-03-18 Thread Adrian Chadd
Author: adrian
Date: Fri Mar 18 03:55:00 2016
New Revision: 297006
URL: https://svnweb.freebsd.org/changeset/base/297006

Log:
  Add initial 802.11ac IEs and fields.
  
  This is a subset of what's in the linux 802.11ac implementation.
  
  I've verified that the bits that mention an 802.11ac draft are
  still the same in 802.11ac-2013 and noted it accordingly.
  
  This is for the most part one big no-op.
  
  Obtained from:802.11ac-2013.pdf

Modified:
  head/sys/net80211/ieee80211.h

Modified: head/sys/net80211/ieee80211.h
==
--- head/sys/net80211/ieee80211.h   Fri Mar 18 02:59:10 2016
(r297005)
+++ head/sys/net80211/ieee80211.h   Fri Mar 18 03:55:00 2016
(r297006)
@@ -696,6 +696,118 @@ struct ieee80211_ie_htinfo {
 #defineIEEE80211_HTINFO_BASIC_STBCMCS_S 0
 #defineIEEE80211_HTINFO_DUALPROTECTED  0x80
 
+
+/*
+ * 802.11ac definitions - 802.11ac-2013 .
+ */
+
+/* VHT opmode bits */
+#defineIEEE80211_VHT_OPMODE_CHANWIDTH_MASK 3
+#defineIEEE80211_VHT_OPMODE_CHANWIDTH_20MHZ0
+#defineIEEE80211_VHT_OPMODE_CHANWIDTH_40MHZ1
+#defineIEEE80211_VHT_OPMODE_CHANWIDTH_80MHZ2
+#defineIEEE80211_VHT_OPMODE_CHANWIDTH_160MHZ   3
+#defineIEEE80211_VHT_OPMODE_RX_NSS_MASK0x70
+#defineIEEE80211_VHT_OPMODE_RX_NSS_SHIFT   4
+#defineIEEE80211_VHT_OPMODE_RX_NSS_TYPE_BF 0x80
+
+/*
+ * Maximum length of A-MPDU that the STA can RX in VHT.
+ * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets)
+ */
+#defineIEEE80211_VHTCAP_MAX_AMPDU_8K   0
+#defineIEEE80211_VHTCAP_MAX_AMPDU_16K  1
+#defineIEEE80211_VHTCAP_MAX_AMPDU_32K  2
+#defineIEEE80211_VHTCAP_MAX_AMPDU_64K  3
+#defineIEEE80211_VHTCAP_MAX_AMPDU_128K 4
+#defineIEEE80211_VHTCAP_MAX_AMPDU_256K 5
+#defineIEEE80211_VHTCAP_MAX_AMPDU_512K 6
+#defineIEEE80211_VHTCAP_MAX_AMPDU_1024K7
+
+/*
+ * VHT MCS information.
+ * + rx_highest/tx_highest: optional; maximum long GI VHT PPDU
+ *data rate.  1Mbit/sec units.
+ * + rx_mcs_map/tx_mcs_map: bitmap of per-stream supported MCS;
+ *2 bits each.
+ */
+#defineIEEE80211_VHT_MCS_SUPPORT_0_7   0   /* MCS0-7 */
+#defineIEEE80211_VHT_MCS_SUPPORT_0_8   1   /* MCS0-8 */
+#defineIEEE80211_VHT_MCS_SUPPORT_0_9   2   /* MCS0-9 */
+#defineIEEE80211_VHT_MCS_NOT_SUPPORTED 3   /* not 
supported */
+
+struct ieee80211_vht_mcs_info {
+   uint16_t rx_mcs_map;
+   uint16_t rx_highest;
+   uint16_t tx_mcs_map;
+   uint16_t tx_highest;
+} __packed;
+
+/* VHT capabilities element: 802.11ac-2013 8.4.2.160 */
+struct ieee80211_ie_vhtcap {
+   uint8_t ie;
+   uint8_t len;
+   uint32_t vht_cap_info;
+   struct ieee80211_vht_mcs_info supp_mcs;
+} __packed;
+
+#defineIEEE80211_VHT_CHANWIDTH_USE_HT  0   /* Use HT IE 
for chw */
+#defineIEEE80211_VHT_CHANWIDTH_80MHZ   1   /* 80MHz */
+#defineIEEE80211_VHT_CHANWIDTH_160MHZ  2   /* 160MHz */
+#defineIEEE80211_VHT_CHANWIDTH_80P80MHZ3   /* 80+80MHz */
+
+/* VHT operation IE - 802.11ac-2013 8.4.2.161 */
+struct ieee80211_ie_vht_operation {
+   uint8_t ie;
+   uint8_t len;
+   uint8_t chan_width;
+   uint8_t center_freq_seg1_idx;
+   uint8_t center_freq_seg2_idx;
+   uint16_t basic_mcs_set;
+} __packed;
+
+/* 802.11ac VHT Capabilities */
+#defineIEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895   0x
+#defineIEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991   0x0001
+#defineIEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454  0x0002
+#defineIEEE80211_VHTCAP_MAX_MPDU_MASK  0x0003
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 0x0004
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ
0x0008
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK   0x000C
+#defineIEEE80211_VHTCAP_RXLDPC 0x0010
+#defineIEEE80211_VHTCAP_SHORT_GI_800x0020
+#defineIEEE80211_VHTCAP_SHORT_GI_160   0x0040
+#defineIEEE80211_VHTCAP_TXSTBC 0x0080
+#defineIEEE80211_VHTCAP_RXSTBC_1   0x0100
+#defineIEEE80211_VHTCAP_RXSTBC_2   0x0200
+#defineIEEE80211_VHTCAP_RXSTBC_3   0x0300
+#defineIEEE80211_VHTCAP_RXSTBC_4   0x0400
+#defineIEEE80211_VHTCAP_RXSTBC_MASK0x0700
+#defineIEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE  0x0800
+#defineIEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE  0x1000
+#defineIEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT   13
+#defineIEEE80211_VHTCAP_BEAMFORMEE_STS_MASK \
+   (7 << 

svn commit: r297027 - head/sbin/ping

2016-03-18 Thread Maxim Konovalov
Author: maxim
Date: Fri Mar 18 15:44:21 2016
New Revision: 297027
URL: https://svnweb.freebsd.org/changeset/base/297027

Log:
  o Restore some good whitespace killed in the previous commit.
  
  Spotted by:   bjk

Modified:
  head/sbin/ping/ping.c

Modified: head/sbin/ping/ping.c
==
--- head/sbin/ping/ping.c   Fri Mar 18 15:27:57 2016(r297026)
+++ head/sbin/ping/ping.c   Fri Mar 18 15:44:21 2016(r297027)
@@ -794,7 +794,7 @@ main(int argc, char *const *argv)
 #endif
if (sweepmax) {
if (sweepmin > sweepmax)
-   errx(EX_USAGE,"Maximum packet size must be no less than 
the minimum packet size");
+   errx(EX_USAGE, "Maximum packet size must be no less 
than the minimum packet size");
 
if (datalen != DEFDATALEN)
errx(EX_USAGE, "Packet size and ping sweep are mutually 
exclusive");
___
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: r297012 - head/share/man/man9

2016-03-18 Thread Julian Elischer
Author: julian
Date: Fri Mar 18 07:59:38 2016
New Revision: 297012
URL: https://svnweb.freebsd.org/changeset/base/297012

Log:
  Add a few details that make it easier to use this macro.
  
  MFC after:1 week
  Sponsored by: Panzura inc

Modified:
  head/share/man/man9/SYSCALL_MODULE.9

Modified: head/share/man/man9/SYSCALL_MODULE.9
==
--- head/share/man/man9/SYSCALL_MODULE.9Fri Mar 18 07:13:09 2016
(r297011)
+++ head/share/man/man9/SYSCALL_MODULE.9Fri Mar 18 07:59:38 2016
(r297012)
@@ -57,6 +57,8 @@ A pointer to an
 which saves the offset in
 .Vt "struct sysent"
 where the syscall is allocated.
+If the location pointed to by offset holds a non 0 number it will be used if 
possible.
+If it holds 0 then one will be assigned.
 .It Fa new_sysent
 is a pointer to a structure that specifies the function implementing
 the syscall and the number of arguments this function needs (see
@@ -72,6 +74,17 @@ The argument passed to the callback func
 .Fa evh
 event handler when it is called.
 .El
+.Pp
+The syscall number assigned to the module can be retrieved using the
+.Xr modstat 3
+and
+.Xr modfind 3
+library functions in libc.
+The MACRO
+.Fn SYSCALL_MODULE_HELPER
+includes 
+.Fn SYSCALL_MODULE
+and much of its boilerplate code.
 .Sh EXAMPLES
 A minimal example for a syscall module can be found in
 .Pa /usr/share/examples/kld/syscall/module/syscall.c .
___
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: r296980 - head/sys/arm/ti/cpsw

2016-03-18 Thread Luiz Otavio O Souza
Author: loos
Date: Thu Mar 17 06:23:48 2016
New Revision: 296980
URL: https://svnweb.freebsd.org/changeset/base/296980

Log:
  Fixes a few style(9) issues, remove extra blank lines.
  
  No functional changes.
  
  Sponsored by: Rubicon Comunications (Netgate)

Modified:
  head/sys/arm/ti/cpsw/if_cpsw.c
  head/sys/arm/ti/cpsw/if_cpswreg.h
  head/sys/arm/ti/cpsw/if_cpswvar.h

Modified: head/sys/arm/ti/cpsw/if_cpsw.c
==
--- head/sys/arm/ti/cpsw/if_cpsw.c  Thu Mar 17 04:21:57 2016
(r296979)
+++ head/sys/arm/ti/cpsw/if_cpsw.c  Thu Mar 17 06:23:48 2016
(r296980)
@@ -148,8 +148,7 @@ static int cpsw_stats_sysctl(SYSCTL_HAND
  * Packets with more segments than this will be defragmented before
  * they are queued.
  */
-#define CPSW_TXFRAGS 8
-
+#defineCPSW_TXFRAGS8
 
 /*
  * TODO: The CPSW subsystem (CPSW_SS) can drive two independent PHYs
@@ -251,7 +250,7 @@ static struct cpsw_stat {
  * Basic debug support.
  */
 
-#define IF_DEBUG(sc)  if (sc->cpsw_if_flags & IFF_DEBUG)
+#defineIF_DEBUG(sc)if (sc->cpsw_if_flags & IFF_DEBUG)
 
 static void
 cpsw_debugf_head(const char *funcname)
@@ -274,35 +273,34 @@ cpsw_debugf(const char *fmt, ...)
 
 }
 
-#define CPSW_DEBUGF(a) do {\
-   IF_DEBUG(sc) {  \
-   cpsw_debugf_head(__func__); \
-   cpsw_debugf a;  \
-   }   \
+#defineCPSW_DEBUGF(a) do { 
\
+   IF_DEBUG(sc) {  \
+   cpsw_debugf_head(__func__); \
+   cpsw_debugf a;  \
+   }   \
 } while (0)
 
-
 /*
  * Locking macros
  */
-#define CPSW_TX_LOCK(sc) do {  \
+#defineCPSW_TX_LOCK(sc) do {   
\
mtx_assert(&(sc)->rx.lock, MA_NOTOWNED);\
mtx_lock(&(sc)->tx.lock);   \
 } while (0)
 
-#define CPSW_TX_UNLOCK(sc) mtx_unlock(&(sc)->tx.lock)
-#define CPSW_TX_LOCK_ASSERT(sc)mtx_assert(&(sc)->tx.lock, MA_OWNED)
+#defineCPSW_TX_UNLOCK(sc)  mtx_unlock(&(sc)->tx.lock)
+#defineCPSW_TX_LOCK_ASSERT(sc) mtx_assert(&(sc)->tx.lock, MA_OWNED)
 
-#define CPSW_RX_LOCK(sc) do {  \
+#defineCPSW_RX_LOCK(sc) do {   
\
mtx_assert(&(sc)->tx.lock, MA_NOTOWNED);\
mtx_lock(&(sc)->rx.lock);   \
 } while (0)
 
-#define CPSW_RX_UNLOCK(sc) mtx_unlock(&(sc)->rx.lock)
-#define CPSW_RX_LOCK_ASSERT(sc)mtx_assert(&(sc)->rx.lock, MA_OWNED)
+#defineCPSW_RX_UNLOCK(sc)  mtx_unlock(&(sc)->rx.lock)
+#defineCPSW_RX_LOCK_ASSERT(sc) mtx_assert(&(sc)->rx.lock, MA_OWNED)
 
-#define CPSW_GLOBAL_LOCK(sc) do {  \
-   if ((mtx_owned(&(sc)->tx.lock) ? 1 : 0) !=  \
+#defineCPSW_GLOBAL_LOCK(sc) do {   
\
+   if ((mtx_owned(&(sc)->tx.lock) ? 1 : 0) !=  \
(mtx_owned(&(sc)->rx.lock) ? 1 : 0)) {  \
panic("cpsw deadlock possibility detection!");  \
}   \
@@ -310,12 +308,12 @@ cpsw_debugf(const char *fmt, ...)
mtx_lock(&(sc)->rx.lock);   \
 } while (0)
 
-#define CPSW_GLOBAL_UNLOCK(sc) do {\
-   CPSW_RX_UNLOCK(sc); \
-   CPSW_TX_UNLOCK(sc); \
+#defineCPSW_GLOBAL_UNLOCK(sc) do { 
\
+   CPSW_RX_UNLOCK(sc); \
+   CPSW_TX_UNLOCK(sc); \
 } while (0)
 
-#define CPSW_GLOBAL_LOCK_ASSERT(sc) do {   \
+#defineCPSW_GLOBAL_LOCK_ASSERT(sc) do {
\
CPSW_TX_LOCK_ASSERT(sc);\
CPSW_RX_LOCK_ASSERT(sc);\
 } while (0)
@@ -328,7 +326,7 @@ cpsw_debugf(const char *fmt, ...)
 
 #definecpsw_cpdma_bd_offset(i) (CPSW_CPPI_RAM_OFFSET + ((i)*16))
 
-#definecpsw_cpdma_bd_paddr(sc, slot)   \
+#definecpsw_cpdma_bd_paddr(sc, slot)   
\

svn commit: r296993 - head/sys/arm/ti/cpsw

2016-03-18 Thread Luiz Otavio O Souza
Author: loos
Date: Thu Mar 17 19:35:08 2016
New Revision: 296993
URL: https://svnweb.freebsd.org/changeset/base/296993

Log:
  Add support for dual emac mode.
  
  In dual emac mode, the CPSW subsystem provides two independent ethernets.
  
  This is implemented (as recommended by TI's TRM) with a mixture of switch
  settings (vlans) and specific features of CPSW subsystem.
  
  The driver was splitted to accommodate the shared parts (RX and TX rings
  for example) while it still provides two independent ethernets.
  
  Each of the ethernet ports driver has it's own set of MDIO registers among
  the other private settings.
  
  Previously this driver always operate in promisc mode, now the Switch ALE
  (address table entry) is properly initialized and enabled.
  
  The driver is also tested (and known to work) with both ports operating in
  single port mode (active_slave 0 or 1).
  
  Tested on uBMC (dual emac mode, both ports in single mode, giga and fast
  ethernet) and BBB (single port, fast ethernet).
  
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/sys/arm/ti/cpsw/if_cpsw.c
  head/sys/arm/ti/cpsw/if_cpswreg.h
  head/sys/arm/ti/cpsw/if_cpswvar.h

Modified: head/sys/arm/ti/cpsw/if_cpsw.c
==
--- head/sys/arm/ti/cpsw/if_cpsw.c  Thu Mar 17 19:28:15 2016
(r296992)
+++ head/sys/arm/ti/cpsw/if_cpsw.c  Thu Mar 17 19:35:08 2016
(r296993)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2012 Damjan Marion 
+ * Copyright (c) 2016 Rubicon Communications, LLC (Netgate)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -93,50 +94,54 @@ __FBSDID("$FreeBSD$");
 
 /* Device probe/attach/detach. */
 static int cpsw_probe(device_t);
-static void cpsw_init_slots(struct cpsw_softc *);
 static int cpsw_attach(device_t);
-static void cpsw_free_slot(struct cpsw_softc *, struct cpsw_slot *);
 static int cpsw_detach(device_t);
+static int cpswp_probe(device_t);
+static int cpswp_attach(device_t);
+static int cpswp_detach(device_t);
+
+static phandle_t cpsw_get_node(device_t, device_t);
 
 /* Device Init/shutdown. */
-static void cpsw_init(void *);
-static void cpsw_init_locked(void *);
 static int cpsw_shutdown(device_t);
-static void cpsw_shutdown_locked(struct cpsw_softc *);
+static void cpswp_init(void *);
+static void cpswp_init_locked(void *);
+static void cpswp_stop_locked(struct cpswp_softc *);
 
 /* Device Suspend/Resume. */
 static int cpsw_suspend(device_t);
 static int cpsw_resume(device_t);
 
 /* Ioctl. */
-static int cpsw_ioctl(struct ifnet *, u_long command, caddr_t data);
+static int cpswp_ioctl(struct ifnet *, u_long command, caddr_t data);
 
-static int cpsw_miibus_readreg(device_t, int phy, int reg);
-static int cpsw_miibus_writereg(device_t, int phy, int reg, int value);
-static void cpsw_miibus_statchg(device_t);
+static int cpswp_miibus_readreg(device_t, int phy, int reg);
+static int cpswp_miibus_writereg(device_t, int phy, int reg, int value);
+static void cpswp_miibus_statchg(device_t);
 
 /* Send/Receive packets. */
 static void cpsw_intr_rx(void *arg);
 static struct mbuf *cpsw_rx_dequeue(struct cpsw_softc *);
 static void cpsw_rx_enqueue(struct cpsw_softc *);
-static void cpsw_start(struct ifnet *);
-static void cpsw_tx_enqueue(struct cpsw_softc *);
+static void cpswp_start(struct ifnet *);
+static void cpswp_tx_enqueue(struct cpswp_softc *);
 static int cpsw_tx_dequeue(struct cpsw_softc *);
 
 /* Misc interrupts and watchdog. */
 static void cpsw_intr_rx_thresh(void *);
 static void cpsw_intr_misc(void *);
-static void cpsw_tick(void *);
-static void cpsw_ifmedia_sts(struct ifnet *, struct ifmediareq *);
-static int cpsw_ifmedia_upd(struct ifnet *);
-static void cpsw_tx_watchdog(struct cpsw_softc *);
+static void cpswp_tick(void *);
+static void cpswp_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static int cpswp_ifmedia_upd(struct ifnet *);
+static void cpsw_tx_watchdog(void *);
 
 /* ALE support */
-static void cpsw_ale_read_entry(struct cpsw_softc *, uint16_t idx, uint32_t 
*ale_entry);
-static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t idx, uint32_t 
*ale_entry);
-static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t portmap, uint8_t 
*mac);
-static int cpsw_ale_update_addresses(struct cpsw_softc *, int purge);
+static void cpsw_ale_read_entry(struct cpsw_softc *, uint16_t, uint32_t *);
+static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t, uint32_t *);
+static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t, int, uint8_t *);
 static void cpsw_ale_dump_table(struct cpsw_softc *);
+static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int);
+static int cpswp_ale_update_addresses(struct cpswp_softc *, int);
 
 /* Statistics and sysctls. */
 static void cpsw_add_sysctls(struct cpsw_softc *);
@@ -150,24 +155,7 @@ static int cpsw_stats_sysctl(SYSCTL_HAND
  */
 

svn commit: r296948 - head/sys/arm/arm

2016-03-18 Thread Ed Maste
Author: emaste
Date: Wed Mar 16 18:55:17 2016
New Revision: 296948
URL: https://svnweb.freebsd.org/changeset/base/296948

Log:
  Remove armeb FreeBSD 6 compat shim
  
  r296861 addressed a build failure due to undefined SYS_freebsd6_lseek
  by adding a COMPAT_FREEBSD6 conditional, but we do not support FreeBSD 6
  compatibility on armeb anyway so remove it completely.
  
  Reviewed by:  andrew, bz
  Differential Revision:https://reviews.freebsd.org/D5643

Modified:
  head/sys/arm/arm/vm_machdep.c

Modified: head/sys/arm/arm/vm_machdep.c
==
--- head/sys/arm/arm/vm_machdep.c   Wed Mar 16 18:39:48 2016
(r296947)
+++ head/sys/arm/arm/vm_machdep.c   Wed Mar 16 18:55:17 2016
(r296948)
@@ -191,11 +191,7 @@ cpu_set_syscall_retval(struct thread *td
register_t code = ap[_QUAD_LOWWORD];
if (td->td_proc->p_sysent->sv_mask)
code &= td->td_proc->p_sysent->sv_mask;
-   fixup = (
-#if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek)
-   code != SYS_freebsd6_lseek &&
-#endif
-   code != SYS_lseek) ? 1 : 0;
+   fixup = (code != SYS_lseek);
}
 #endif
 
___
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: r296933 - in head: share/man/man9 sys/sys

2016-03-18 Thread Gleb Smirnoff
On Wed, Mar 16, 2016 at 08:37:52AM +, Hans Petter Selasky wrote:
H> Modified: head/sys/sys/sysctl.h
H> 
==
H> --- head/sys/sys/sysctl.hWed Mar 16 06:42:15 2016(r296932)
H> +++ head/sys/sys/sysctl.hWed Mar 16 08:37:52 2016(r296933)
H> @@ -654,8 +654,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
H>  SYSCTL_OID(parent, nbr, name,   \
H>  CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \
H>  (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \
H> -CTASSERT(((access) & CTLTYPE) == 0 ||   \
H> -((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE)
H> +CTASSERTaccess) & CTLTYPE) == 0 ||  \
H> +((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) &&\
H> +sizeof(counter_u64_t) == sizeof(*(ptr)) &&  \
H> +sizeof(uint64_t) == sizeof(**(ptr)))

I don't agree with the last line. Does it assert that counter_u64_t is
implemented using uint64_t? That is true, but that is internal detail,
that might be changed in future.

-- 
Totus tuus, Glebius.
___
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: r296990 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace/aarch64 dev/dtrace/amd64 dev/dtrace/arm dev/dtrace/i386 dev/dtrace/mips dev/dtrace/powerpc

2016-03-18 Thread Mark Johnston
Author: markj
Date: Thu Mar 17 18:55:54 2016
New Revision: 296990
URL: https://svnweb.freebsd.org/changeset/base/296990

Log:
  Remove unused variables dtrace_in_probe and dtrace_in_probe_addr.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/arm/dtrace_subr.c
  head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
  head/sys/cddl/dev/dtrace/mips/dtrace_subr.c
  head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cThu Mar 
17 18:49:37 2016(r296989)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cThu Mar 
17 18:55:54 2016(r296990)
@@ -246,10 +246,6 @@ static int dtrace_dynvar_failclean; /* 
 #ifndef illumos
 static struct mtx  dtrace_unr_mtx;
 MTX_SYSINIT(dtrace_unr_mtx, _unr_mtx, "Unique resource identifier", 
MTX_DEF);
-intdtrace_in_probe;/* non-zero if executing a probe */
-#if defined(__i386__) || defined(__amd64__) || defined(__mips__) || 
defined(__powerpc__)
-uintptr_t  dtrace_in_probe_addr;   /* Address of invop when already in 
probe */
-#endif
 static eventhandler_tagdtrace_kld_load_tag;
 static eventhandler_tagdtrace_kld_unload_try_tag;
 #endif

Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c  Thu Mar 17 18:49:37 
2016(r296989)
+++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c  Thu Mar 17 18:55:54 
2016(r296990)
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-extern uintptr_t   dtrace_in_probe_addr;
-extern int dtrace_in_probe;
 extern dtrace_id_t dtrace_probeid_error;
 extern int (*dtrace_invop_jump_addr)(struct trapframe *);
 extern void dtrace_getnanotime(struct timespec *tsp);

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cThu Mar 17 18:49:37 
2016(r296989)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cThu Mar 17 18:55:54 
2016(r296990)
@@ -44,9 +44,6 @@
 #include 
 #include 
 
-extern uintptr_t   dtrace_in_probe_addr;
-extern int dtrace_in_probe;
-
 extern void dtrace_getnanotime(struct timespec *tsp);
 
 int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t);

Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c  Thu Mar 17 18:49:37 2016
(r296989)
+++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c  Thu Mar 17 18:55:54 2016
(r296990)
@@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$");
 #defineBIT_LR  14
 #defineBIT_SP  13
 
-extern uintptr_t   dtrace_in_probe_addr;
-extern int dtrace_in_probe;
 extern dtrace_id_t dtrace_probeid_error;
 extern int (*dtrace_invop_jump_addr)(struct trapframe *);
 extern void dtrace_getnanotime(struct timespec *tsp);

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Mar 17 18:49:37 2016
(r296989)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Mar 17 18:55:54 2016
(r296990)
@@ -46,8 +46,6 @@
 #include 
 
 extern uintptr_t   kernelbase;
-extern uintptr_t   dtrace_in_probe_addr;
-extern int dtrace_in_probe;
 
 extern void dtrace_getnanotime(struct timespec *tsp);
 

Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Thu Mar 17 18:49:37 2016
(r296989)
+++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Thu Mar 17 18:55:54 2016
(r296990)
@@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$");
 
 #defineDELAYBRANCH(x)  ((int)(x) < 0)

-extern uintptr_t   dtrace_in_probe_addr;
-extern int dtrace_in_probe;
 extern dtrace_id_t dtrace_probeid_error;
 
 int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t);

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c  Thu Mar 17 18:49:37 
2016(r296989)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c  Thu Mar 17 18:55:54 
2016(r296990)
@@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$");
 
 #defineDELAYBRANCH(x)  ((int)(x) < 0)


svn commit: r297048 - head/sys/net80211

2016-03-18 Thread Adrian Chadd
Author: adrian
Date: Sat Mar 19 04:37:33 2016
New Revision: 297048
URL: https://svnweb.freebsd.org/changeset/base/297048

Log:
  [net80211] Add VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164
  
  This .. seems inconsistently transmitted from various vendors.

Modified:
  head/sys/net80211/ieee80211.h

Modified: head/sys/net80211/ieee80211.h
==
--- head/sys/net80211/ieee80211.h   Fri Mar 18 23:55:25 2016
(r297047)
+++ head/sys/net80211/ieee80211.h   Sat Mar 19 04:37:33 2016
(r297048)
@@ -803,6 +803,39 @@ struct ieee80211_ie_vht_operation {
 #defineIEEE80211_VHTCAP_RX_ANTENNA_PATTERN 0x1000
 #defineIEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x2000
 
+/*
+ * VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164
+ *
+ * This defines the maximum transmit power for various bandwidths.
+ */
+/*
+ * Count is how many elements follow and what they're for:
+ *
+ * 0 - 20 MHz
+ * 1 - 20+40 MHz
+ * 2 - 20+40+80 MHz
+ * 3 - 20+40+80+(160, 80+80) MHz
+ */
+#defineIEEE80211_VHT_TXPWRENV_INFO_COUNT_SHIFT 0
+#defineIEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK  0x07
+
+/*
+ * Unit is the tx power representation.  It should be EIRP for now;
+ * other values are reserved.
+ */
+#defineIEEE80211_VHT_TXPWRENV_UNIT_MASK0x38
+#defineIEEE80211_VHT_TXPWRENV_UNIT_SHIFT   3
+
+/* This value is within the unit mask/shift above */
+#defineIEEE80211_VHT_TXPWRENV_UNIT_EIRP0
+
+struct ieee80211_ie_vht_txpwrenv {
+   uint8_t ie;
+   uint8_t len;
+   uint8_t tx_info;
+   int8_t tx_elem[0];  /* TX power elements, 1/2 dB, signed */
+};
+
 /* VHT action codes */
 #defineWLAN_ACTION_VHT_COMPRESSED_BF   0
 #defineWLAN_ACTION_VHT_GROUPID_MGMT1
___
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: r297011 - head/sys/arm/nvidia

2016-03-18 Thread Michal Meloun
Author: mmel
Date: Fri Mar 18 07:13:09 2016
New Revision: 297011
URL: https://svnweb.freebsd.org/changeset/base/297011

Log:
  TEGRA: Fix tegra_pcie driver after rman_res_t size change.

Modified:
  head/sys/arm/nvidia/tegra_pcie.c

Modified: head/sys/arm/nvidia/tegra_pcie.c
==
--- head/sys/arm/nvidia/tegra_pcie.cFri Mar 18 04:22:07 2016
(r297010)
+++ head/sys/arm/nvidia/tegra_pcie.cFri Mar 18 07:13:09 2016
(r297011)
@@ -491,7 +491,7 @@ tegra_pcib_alloc_resource(device_t dev, 
struct rman *rm;
struct resource *res;
 
-   debugf("%s: enter %d start %lx end %lx count %lx\n", __func__,
+   debugf("%s: enter %d start %#jx end %#jx count %#jx\n", __func__,
type, start, end, count);
sc = device_get_softc(dev);
 
@@ -513,7 +513,7 @@ tegra_pcib_alloc_resource(device_t dev, 
 
if (bootverbose) {
device_printf(dev,
-   "rman_reserve_resource: start=%#lx, end=%#lx, count=%#lx\n",
+   "rman_reserve_resource: start=%#jx, end=%#jx, count=%#jx\n",
start, end, count);
}
 
@@ -532,7 +532,7 @@ tegra_pcib_alloc_resource(device_t dev, 
 fail:
if (bootverbose) {
device_printf(dev, "%s FAIL: type=%d, rid=%d, "
-   "start=%016lx, end=%016lx, count=%016lx, flags=%x\n",
+   "start=%016jx, end=%016jx, count=%016jx, flags=%x\n",
__func__, type, *rid, start, end, count, flags);
}
 
@@ -565,14 +565,13 @@ tegra_pcib_release_resource(device_t dev
 
 static int
 tegra_pcib_adjust_resource(device_t dev, device_t child, int type,
-   struct resource *res, u_long start, u_long end)
+   struct resource *res, rman_res_t start, rman_res_t 
end)
 {
struct tegra_pcib_softc *sc;
struct rman *rm;
 
sc = device_get_softc(dev);
-   debugf("%s: %d start %lx end %lx \n", __func__,
-   type, start, end);
+   debugf("%s: %d start %jx end %jx \n", __func__, type, start, end);
 
 #if defined(NEW_PCIB) && defined(PCI_RES_BUS)
if (type == PCI_RES_BUS)
@@ -609,7 +608,7 @@ tegra_pcib_pcie_activate_resource(device
}
 
if (bootverbose)
-   printf("%s: start %zx, len %ld\n", __func__, start,
+   printf("%s: start %zx, len %jd\n", __func__, start,
rman_get_size(r));
 
p = pmap_mapdev(start, (vm_size_t)rman_get_size(r));
@@ -667,7 +666,7 @@ tegra_pcib_route_interrupt(device_t bus,
struct tegra_pcib_softc *sc;
 
sc = device_get_softc(bus);
-   device_printf(bus, "route pin %d for device %d.%d to %lu\n",
+   device_printf(bus, "route pin %d for device %d.%d to %ju\n",
  pin, pci_get_slot(dev), pci_get_function(dev),
  rman_get_start(sc->irq_res));
 
___
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: r296938 - head/sys/arm/conf

2016-03-18 Thread Andrew Turner
Author: andrew
Date: Wed Mar 16 15:31:09 2016
New Revision: 296938
URL: https://svnweb.freebsd.org/changeset/base/296938

Log:
  Remove old COMPAT_FREEBSD options from the ARM kernel configs. We replaced
  the ABI in 10.0, and have removed support for the old ABI in 11. As such
  any of these options to provide compatibility prior to 10 are unneeded.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/conf/ATMEL
  head/sys/arm/conf/CNS11XXNAS
  head/sys/arm/conf/EFIKA_MX
  head/sys/arm/conf/ETHERNUT5
  head/sys/arm/conf/IMX53
  head/sys/arm/conf/NOTES
  head/sys/arm/conf/SAM9260EK
  head/sys/arm/conf/std.arm
  head/sys/arm/conf/std.armv6

Modified: head/sys/arm/conf/ATMEL
==
--- head/sys/arm/conf/ATMEL Wed Mar 16 14:00:45 2016(r296937)
+++ head/sys/arm/conf/ATMEL Wed Mar 16 15:31:09 2016(r296938)
@@ -57,11 +57,6 @@ options  GEOM_PART_BSD   # BSD partition 
 optionsGEOM_PART_MBR   # MBR partition scheme
 optionsGEOM_PART_GPT   # GUID Partition Tables.
 optionsGEOM_LABEL  # Provides labelization
-optionsCOMPAT_FREEBSD5 # Compatible with FreeBSD5
-optionsCOMPAT_FREEBSD6 # Compatible with FreeBSD6
-optionsCOMPAT_FREEBSD7 # Compatible with FreeBSD7
-optionsCOMPAT_FREEBSD9 # Compatible with FreeBSD9
-optionsCOMPAT_FREEBSD10# Compatible with FreeBSD10
 optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI
 optionsKTRACE  # ktrace(1) support
 optionsSTACK   # stack(9) support

Modified: head/sys/arm/conf/CNS11XXNAS
==
--- head/sys/arm/conf/CNS11XXNASWed Mar 16 14:00:45 2016
(r296937)
+++ head/sys/arm/conf/CNS11XXNASWed Mar 16 15:31:09 2016
(r296938)
@@ -46,11 +46,6 @@ options  DDB # Enable the kernel 
debug
 #options   DIAGNOSTIC
 
 
-#options   COMPAT_FREEBSD5
-#options   COMPAT_FREEBSD6
-#options   COMPAT_FREEBSD7n
-
-
 optionsSCHED_ULE   # ULE scheduler
 #options   SCHED_4BSD  # 4BSD scheduler
 optionsGEOM_PART_BSD   # BSD partition scheme

Modified: head/sys/arm/conf/EFIKA_MX
==
--- head/sys/arm/conf/EFIKA_MX  Wed Mar 16 14:00:45 2016(r296937)
+++ head/sys/arm/conf/EFIKA_MX  Wed Mar 16 15:31:09 2016(r296938)
@@ -30,9 +30,6 @@ options   SOC_IMX51
 optionsSCHED_4BSD  # 4BSD scheduler
 #options   MD_ROOT # MD is a potential root device
 #options   NFSD# Network Filesystem Server
-#options   COMPAT_FREEBSD5 # Compatible with FreeBSD5
-#options   COMPAT_FREEBSD6 # Compatible with FreeBSD6
-#options   COMPAT_FREEBSD7 # Compatible with FreeBSD7
 optionsPLATFORM
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 

Modified: head/sys/arm/conf/ETHERNUT5
==
--- head/sys/arm/conf/ETHERNUT5 Wed Mar 16 14:00:45 2016(r296937)
+++ head/sys/arm/conf/ETHERNUT5 Wed Mar 16 15:31:09 2016(r296938)
@@ -53,9 +53,6 @@ options   GEOM_PART_BSD   # BSD partition 
 optionsGEOM_PART_MBR   # MBR partition scheme
 #options   GEOM_PART_GPT   # GUID Partition Tables.
 #options   GEOM_LABEL  # Provides labelization
-#options   COMPAT_FREEBSD5 # Compatible with FreeBSD5
-#options   COMPAT_FREEBSD6 # Compatible with FreeBSD6
-#options   COMPAT_FREEBSD7 # Compatible with FreeBSD7
 optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI
 optionsKTRACE  # ktrace(1) support
 #options   STACK   # stack(9) support

Modified: head/sys/arm/conf/IMX53
==
--- head/sys/arm/conf/IMX53 Wed Mar 16 14:00:45 2016(r296937)
+++ head/sys/arm/conf/IMX53 Wed Mar 16 15:31:09 2016(r296938)
@@ -27,9 +27,6 @@ options   SOC_IMX53
 
 optionsSCHED_4BSD  # 4BSD scheduler
 #options   NFSD# Network Filesystem Server
-#options   COMPAT_FREEBSD5 # Compatible with FreeBSD5
-#options   COMPAT_FREEBSD6 # Compatible with FreeBSD6
-#options   COMPAT_FREEBSD7 # Compatible with FreeBSD7
 optionsPLATFORM
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 

Modified: head/sys/arm/conf/NOTES
==
--- head/sys/arm/conf/NOTES Wed 

Re: svn commit: r296918 - head/sys/fs/autofs

2016-03-18 Thread Baptiste Daroussin
On Wed, Mar 16, 2016 at 03:01:56PM +0100, Edward Tomasz Napierala wrote:
> You're right.  I've added the explicit cast to void, let's see
> if that helps.
> 
> On 0315T1346, Conrad Meyer wrote:
> > Instead you will get, "warning: unused but set variable 'error'" on
> > -NODEBUG builds.  Maybe add:
> > 
> > (void)error;

Why everyone keeps casting when we have __unused?

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r297039 - head/sys/x86/x86

2016-03-18 Thread Konstantin Belousov
On Fri, Mar 18, 2016 at 07:48:49PM +, John Baldwin wrote:
>  
> - for (x = 0; x < delay; x += 5) {
> + for (x = 0; x < delay; x++) {
>   if ((lapic_read_icr_lo() & APIC_DELSTAT_MASK) ==
>   APIC_DELSTAT_IDLE)
>   return (1);
> - DELAY(5);
> + DELAY(1);
>   }
>   return (0);
>  }

Ideally we would structure the loop differently. I think it is more
efficient WRT latency to only block execution by ia32_pause(), and
compare the the getbinuptime() results to calculate spent time, on each
loop step.
___
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"