svn commit: r298876 - in head: lib/libutil sbin/hastd usr.bin/newgrp

2016-05-01 Thread Ed Schouten
Author: ed
Date: Sun May  1 08:22:11 2016
New Revision: 298876
URL: https://svnweb.freebsd.org/changeset/base/298876

Log:
  Remove useless calls to basename().
  
  There are a couple of places in the source three where we call
  basename() on constant strings. This is bad, because the prototype
  standardized by POSIX allows the implementation to use its argument as a
  storage buffer.
  
  This change eliminates some of these unportable calls to basename() in
  cases where it was only added for cosmetical reasons, namely to trim
  argv[0]. There's nothing wrong with setting argv[0] to the full path.
  
  Reviewed by:  jilles
  Differential Revision:https://reviews.freebsd.org/D6093

Modified:
  head/lib/libutil/pw_util.c
  head/sbin/hastd/hooks.c
  head/usr.bin/newgrp/newgrp.c

Modified: head/lib/libutil/pw_util.c
==
--- head/lib/libutil/pw_util.c  Sun May  1 05:01:10 2016(r298875)
+++ head/lib/libutil/pw_util.c  Sun May  1 08:22:11 2016(r298876)
@@ -58,7 +58,6 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -315,7 +314,7 @@ pw_edit(int notsetuid)
(void)setuid(getuid());
}
errno = 0;
-   execlp(editor, basename(editor), tempname, (char *)NULL);
+   execlp(editor, editor, tempname, (char *)NULL);
_exit(errno);
default:
/* parent */

Modified: head/sbin/hastd/hooks.c
==
--- head/sbin/hastd/hooks.c Sun May  1 05:01:10 2016(r298875)
+++ head/sbin/hastd/hooks.c Sun May  1 08:22:11 2016(r298876)
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -352,7 +351,7 @@ hook_execv(const char *path, va_list ap)
return;
 
memset(args, 0, sizeof(args));
-   args[0] = basename(path);
+   args[0] = __DECONST(char *, path);
for (ii = 1; ii < sizeof(args) / sizeof(args[0]); ii++) {
args[ii] = va_arg(ap, char *);
if (args[ii] == NULL)

Modified: head/usr.bin/newgrp/newgrp.c
==
--- head/usr.bin/newgrp/newgrp.cSun May  1 05:01:10 2016
(r298875)
+++ head/usr.bin/newgrp/newgrp.cSun May  1 08:22:11 2016
(r298876)
@@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -290,7 +289,7 @@ loginshell(void)
if (ticket != NULL)
setenv("KRBTKFILE", ticket, 1);
 
-   if (asprintf(args, "-%s", basename(shell)) < 0)
+   if (asprintf(args, "-%s", shell) < 0)
err(1, "asprintf");
args[1] = NULL;
 
@@ -306,6 +305,6 @@ doshell(void)
shell = pwd->pw_shell;
if (*shell == '\0')
shell = _PATH_BSHELL;
-   execl(shell, basename(shell), (char *)NULL);
+   execl(shell, shell, (char *)NULL);
err(1, "%s", shell);
 }
___
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: r298877 - head/sys/dev/iwm

2016-05-01 Thread Andriy Voskoboinyk
Author: avos
Date: Sun May  1 14:27:27 2016
New Revision: 298877
URL: https://svnweb.freebsd.org/changeset/base/298877

Log:
  iwm: switch to ieee80211_add_channel()
  
  - Switch to ieee80211_add_channel().
  - Parse/set more channel flags (DFS, NOADHOC).
  - Add ic_getradiocaps() method.
  
  Reviewed by:  adrian
  Differential Revision:https://reviews.freebsd.org/D6150

Modified:
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwmvar.h

Modified: head/sys/dev/iwm/if_iwm.c
==
--- head/sys/dev/iwm/if_iwm.c   Sun May  1 08:22:11 2016(r298876)
+++ head/sys/dev/iwm/if_iwm.c   Sun May  1 14:27:27 2016(r298877)
@@ -166,12 +166,15 @@ const uint8_t iwm_nvm_channels[] = {
/* 2.4 GHz */
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
/* 5 GHz */
-   36, 40, 44 , 48, 52, 56, 60, 64,
+   36, 40, 44, 48, 52, 56, 60, 64,
100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144,
149, 153, 157, 161, 165
 };
 #define IWM_NUM_2GHZ_CHANNELS  14
 
+_Static_assert(nitems(iwm_nvm_channels) <= IWM_NUM_CHANNELS,
+"IWM_NUM_CHANNELS is too small");
+
 /*
  * XXX For now, there's simply a fixed set of rate table entries
  * that are populated.
@@ -241,8 +244,12 @@ static int iwm_nvm_read_chunk(struct iwm
uint16_t, uint8_t *, uint16_t *);
 static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *,
 uint16_t *);
-static voidiwm_init_channel_map(struct iwm_softc *,
- const uint16_t * const);
+static uint32_tiwm_eeprom_channel_flags(uint16_t);
+static voidiwm_add_channel_band(struct iwm_softc *,
+   struct ieee80211_channel[], int, int *, int, int,
+   const uint8_t[]);
+static voidiwm_init_channel_map(struct ieee80211com *, int, int *,
+   struct ieee80211_channel[]);
 static int iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *,
   const uint16_t *, const uint16_t *, uint8_t,
   uint8_t);
@@ -1634,6 +1641,7 @@ enum nvm_sku_bits {
  * @IWM_NVM_CHANNEL_IBSS: usable as an IBSS channel
  * @IWM_NVM_CHANNEL_ACTIVE: active scanning allowed
  * @IWM_NVM_CHANNEL_RADAR: radar detection required
+ * XXX cannot find this (DFS) flag in iwl-nvm-parse.c
  * @IWM_NVM_CHANNEL_DFS: dynamic freq selection candidate
  * @IWM_NVM_CHANNEL_WIDE: 20 MHz channel okay (?)
  * @IWM_NVM_CHANNEL_40MHZ: 40 MHz channel okay (?)
@@ -1653,97 +1661,91 @@ enum iwm_nvm_channel_flags {
 };
 
 /*
- * Add a channel to the net80211 channel list.
- *
- * ieee is the ieee channel number
- * ch_idx is channel index.
- * mode is the channel mode - CHAN_A, CHAN_B, CHAN_G.
- * ch_flags is the iwm channel flags.
- *
- * Return 0 on OK, < 0 on error.
+ * Translate EEPROM flags to net80211.
  */
-static int
-iwm_init_net80211_channel(struct iwm_softc *sc, int ieee, int ch_idx,
-int mode, uint16_t ch_flags)
+static uint32_t
+iwm_eeprom_channel_flags(uint16_t ch_flags)
 {
-   /* XXX for now, no overflow checking! */
-   struct ieee80211com *ic = &sc->sc_ic;
-   int is_5ghz, flags;
-   struct ieee80211_channel *channel;
-
-   channel = &ic->ic_channels[ic->ic_nchans++];
-   channel->ic_ieee = ieee;
+   uint32_t nflags;
 
-   is_5ghz = ch_idx >= IWM_NUM_2GHZ_CHANNELS;
-   if (!is_5ghz) {
-   flags = IEEE80211_CHAN_2GHZ;
-   channel->ic_flags = mode;
-   } else {
-   flags = IEEE80211_CHAN_5GHZ;
-   channel->ic_flags = mode;
+   nflags = 0;
+   if ((ch_flags & IWM_NVM_CHANNEL_ACTIVE) == 0)
+   nflags |= IEEE80211_CHAN_PASSIVE;
+   if ((ch_flags & IWM_NVM_CHANNEL_IBSS) == 0)
+   nflags |= IEEE80211_CHAN_NOADHOC;
+   if (ch_flags & IWM_NVM_CHANNEL_RADAR) {
+   nflags |= IEEE80211_CHAN_DFS;
+   /* Just in case. */
+   nflags |= IEEE80211_CHAN_NOADHOC;
}
-   channel->ic_freq = ieee80211_ieee2mhz(ieee, flags);
 
-   if (!(ch_flags & IWM_NVM_CHANNEL_ACTIVE))
-   channel->ic_flags |= IEEE80211_CHAN_PASSIVE;
-   return (0);
+   return (nflags);
 }
 
 static void
-iwm_init_channel_map(struct iwm_softc *sc, const uint16_t * const nvm_ch_flags)
+iwm_add_channel_band(struct iwm_softc *sc, struct ieee80211_channel chans[],
+int maxchans, int *nchans, int ch_idx, int ch_num, const uint8_t bands[])
 {
-   struct ieee80211com *ic = &sc->sc_ic;
-   struct iwm_nvm_data *data = &sc->sc_nvm;
-   int ch_idx;
+   const uint16_t * const nvm_ch_flags = sc->sc_nvm.nvm_ch_flags;
+   uint32_t nflags;
uint16_t ch_flags;
-   int hw_value;
+   uint8_t ieee;
+   int error;
 
-   for (ch_idx = 0; ch_idx < nitems(iwm_nvm_channels); ch_idx++) {
+   for

svn commit: r298878 - head/usr.bin/localedef

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:10:56 2016
New Revision: 298878
URL: https://svnweb.freebsd.org/changeset/base/298878

Log:
  localedef(1): minor spelling fixes on comments.
  
  No functional change.

Modified:
  head/usr.bin/localedef/charmap.c
  head/usr.bin/localedef/collate.c
  head/usr.bin/localedef/scanner.c
  head/usr.bin/localedef/time.c

Modified: head/usr.bin/localedef/charmap.c
==
--- head/usr.bin/localedef/charmap.cSun May  1 14:27:27 2016
(r298877)
+++ head/usr.bin/localedef/charmap.cSun May  1 16:10:56 2016
(r298878)
@@ -324,7 +324,7 @@ add_charmap_char(const char *name, int v
 
 /*
  * POSIX insists that certain entries be present, even when not in the
- * orginal charmap file.
+ * original charmap file.
  */
 void
 add_charmap_posix(void)

Modified: head/usr.bin/localedef/collate.c
==
--- head/usr.bin/localedef/collate.cSun May  1 14:27:27 2016
(r298877)
+++ head/usr.bin/localedef/collate.cSun May  1 16:10:56 2016
(r298878)
@@ -1120,7 +1120,7 @@ dump_collate(void)
collate_chain_t *chain;
 
/*
-* We have to run throught a preliminary pass to identify all the
+* We have to run through a preliminary pass to identify all the
 * weights that we use for each sorting level.
 */
for (i = 0; i < NUM_WT; i++) {

Modified: head/usr.bin/localedef/scanner.c
==
--- head/usr.bin/localedef/scanner.cSun May  1 14:27:27 2016
(r298877)
+++ head/usr.bin/localedef/scanner.cSun May  1 16:10:56 2016
(r298878)
@@ -181,7 +181,7 @@ static struct token {
 
/*
 * These are keywords used in the charmap file.  Note that
-* Solaris orginally used angle brackets to wrap some of them,
+* Solaris originally used angle brackets to wrap some of them,
 * but we removed that to simplify our parser.  The first of these
 * items are "global items."
 */

Modified: head/usr.bin/localedef/time.c
==
--- head/usr.bin/localedef/time.c   Sun May  1 14:27:27 2016
(r298877)
+++ head/usr.bin/localedef/time.c   Sun May  1 16:10:56 2016
(r298878)
@@ -262,7 +262,7 @@ dump_time(void)
 * NOTE: If date_fmt is not specified, then we'll default to
 * using the %c for date.  This is reasonable for most
 * locales, although for reasons that I don't understand
-* Solaris historically has had a seperate format for date.
+* Solaris historically has had a separate format for date.
 */
if ((putl_category(tm.X_fmt, f) == EOF) ||
(putl_category(tm.x_fmt, f) == EOF) ||
___
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: r298879 - in head/usr.bin: iscsictl m4 timeout timeout/tests whereis xlint/lint2

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:13:05 2016
New Revision: 298879
URL: https://svnweb.freebsd.org/changeset/base/298879

Log:
  usr.bin: minor spelling fixes on comments.
  
  No functional change.

Modified:
  head/usr.bin/iscsictl/iscsictl.c
  head/usr.bin/m4/eval.c
  head/usr.bin/timeout/tests/timeout.sh
  head/usr.bin/timeout/timeout.c
  head/usr.bin/whereis/whereis.c
  head/usr.bin/xlint/lint2/chk.c

Modified: head/usr.bin/iscsictl/iscsictl.c
==
--- head/usr.bin/iscsictl/iscsictl.cSun May  1 16:10:56 2016
(r298878)
+++ head/usr.bin/iscsictl/iscsictl.cSun May  1 16:13:05 2016
(r298879)
@@ -771,7 +771,7 @@ main(int argc, char **argv)
xo_errx(1, "at most one of -A, -M, -R, or -L may be specified");
 
/*
-* Note that we ignore unneccessary/inapplicable "-c" flag; so that
+* Note that we ignore unnecessary/inapplicable "-c" flag; so that
 * people can do something like "alias ISCSICTL="iscsictl -c path"
 * in shell scripts.
 */

Modified: head/usr.bin/m4/eval.c
==
--- head/usr.bin/m4/eval.c  Sun May  1 16:10:56 2016(r298878)
+++ head/usr.bin/m4/eval.c  Sun May  1 16:13:05 2016(r298879)
@@ -895,7 +895,7 @@ dosub(const char *argv[], int argc)
  * function of ICON language. Within mapvec, we replace every character 
  * of "from" with the corresponding character in "to". 
  * If "to" is shorter than "from", than the corresponding entries are null, 
- * which means that those characters dissapear altogether. 
+ * which means that those characters disappear altogether. 
  */
 static void
 map(char *dest, const char *src, const char *from, const char *to)

Modified: head/usr.bin/timeout/tests/timeout.sh
==
--- head/usr.bin/timeout/tests/timeout.sh   Sun May  1 16:10:56 2016
(r298878)
+++ head/usr.bin/timeout/tests/timeout.sh   Sun May  1 16:13:05 2016
(r298879)
@@ -83,7 +83,7 @@ exit_numbers_body()
-s exit:124 \
-x timeout .1 sleep 1
 
-   # With preserv status exit shoudl be 128 + TERM aka 143
+   # With preserv status exit should be 128 + TERM aka 143
atf_check \
-o empty \
-e empty \

Modified: head/usr.bin/timeout/timeout.c
==
--- head/usr.bin/timeout/timeout.c  Sun May  1 16:10:56 2016
(r298878)
+++ head/usr.bin/timeout/timeout.c  Sun May  1 16:13:05 2016
(r298879)
@@ -227,7 +227,7 @@ main(int argc, char **argv)
argv++;
 
if (!foreground) {
-   /* Aquire a reaper */
+   /* Acquire a reaper */
if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1)
err(EX_OSERR, "Fail to acquire the reaper");
}

Modified: head/usr.bin/whereis/whereis.c
==
--- head/usr.bin/whereis/whereis.c  Sun May  1 16:10:56 2016
(r298878)
+++ head/usr.bin/whereis/whereis.c  Sun May  1 16:13:05 2016
(r298879)
@@ -505,7 +505,7 @@ main(int argc, char **argv)
(rlen = matches[1].rm_eo - 
 matches[1].rm_so) > 0) {
/*
-* man -w found formated
+* man -w found formatted
 * page, need to pick up
 * source page name.
 */

Modified: head/usr.bin/xlint/lint2/chk.c
==
--- head/usr.bin/xlint/lint2/chk.c  Sun May  1 16:10:56 2016
(r298878)
+++ head/usr.bin/xlint/lint2/chk.c  Sun May  1 16:13:05 2016
(r298879)
@@ -459,7 +459,7 @@ chkau(hte_t *hte, int n, sym_t *def, sym
promote = def != NULL && def->s_osdef;
 
/*
-* If we compair with a definition or declaration, we must perform
+* If we compare with a definition or declaration, we must perform
 * the same checks for qualifiers in indirected types as in
 * assignments.
 */
___
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: r298880 - in head/release/picobsd: build tinyware/ns

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:16:11 2016
New Revision: 298880
URL: https://svnweb.freebsd.org/changeset/base/298880

Log:
  picobsd: minor spelling fixes.

Modified:
  head/release/picobsd/build/picobsd
  head/release/picobsd/tinyware/ns/ns.c

Modified: head/release/picobsd/build/picobsd
==
--- head/release/picobsd/build/picobsd  Sun May  1 16:13:05 2016
(r298879)
+++ head/release/picobsd/build/picobsd  Sun May  1 16:16:11 2016
(r298880)
@@ -363,7 +363,7 @@ do_install() {
return
 fi
 dialog --title "Build ${THETYPE} completed" --inputbox \
-"\nThe build process was completed successfuly.\n\
+"\nThe build process was completed successfully.\n\
 `cat .build.reply` \n\n\
 Now we are going to install the image on the floppy.\n\
 Please insert a blank floppy in /dev/fd0.\\n

Modified: head/release/picobsd/tinyware/ns/ns.c
==
--- head/release/picobsd/tinyware/ns/ns.c   Sun May  1 16:13:05 2016
(r298879)
+++ head/release/picobsd/tinyware/ns/ns.c   Sun May  1 16:16:11 2016
(r298880)
@@ -700,7 +700,7 @@ stats(char *proto)
return 0;
if (pflag) {
if (proto == NULL) {
-   fprintf(stderr, "Option '-p' requires paramter.\n");
+   fprintf(stderr, "Option '-p' requires parameter.\n");
usage();
exit(-1);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298881 - in head/tools: build/mk regression/sockets/so_setfib tools/fixwhite tools/ipw tools/nanobsd tools/nanobsd/dhcpd tools/nanobsd/embedded tools/shlib-compat tools/wtap/vis_map to...

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:20:14 2016
New Revision: 298881
URL: https://svnweb.freebsd.org/changeset/base/298881

Log:
  tools: minor spelling fixes.
  
  Mostly comments but also some user-visible strings.
  
  MFC after:2 weeks

Modified:
  head/tools/build/mk/Makefile.boot
  head/tools/regression/sockets/so_setfib/so_setfib.c
  head/tools/tools/fixwhite/fixwhite.1
  head/tools/tools/fixwhite/fixwhite.c
  head/tools/tools/ipw/ipwstats.c
  head/tools/tools/nanobsd/defaults.sh
  head/tools/tools/nanobsd/dhcpd/common
  head/tools/tools/nanobsd/embedded/README
  head/tools/tools/nanobsd/embedded/common
  head/tools/tools/shlib-compat/shlib-compat.py
  head/tools/tools/wtap/vis_map/vis_map.c
  head/tools/tools/wtap/wtap/wtap.c

Modified: head/tools/build/mk/Makefile.boot
==
--- head/tools/build/mk/Makefile.boot   Sun May  1 16:16:11 2016
(r298880)
+++ head/tools/build/mk/Makefile.boot   Sun May  1 16:20:14 2016
(r298881)
@@ -5,5 +5,5 @@ DPADD+= ${WORLDTMP}/legacy/usr/lib/libe
 LDADD+=-legacy
 LDFLAGS+=  -L${WORLDTMP}/legacy/usr/lib
 
-# we do not want to capture dependencies refering to the above
+# we do not want to capture dependencies referring to the above
 UPDATE_DEPENDFILE= no

Modified: head/tools/regression/sockets/so_setfib/so_setfib.c
==
--- head/tools/regression/sockets/so_setfib/so_setfib.c Sun May  1 16:16:11 
2016(r298880)
+++ head/tools/regression/sockets/so_setfib/so_setfib.c Sun May  1 16:20:14 
2016(r298881)
@@ -175,7 +175,7 @@ main(int argc __unused, char *argv[] __u
return (0);
}
 
-   /* Initalize randomness. */
+   /* Initialize randomness. */
srandomdev();
 
/* Get number of FIBs supported by kernel. */

Modified: head/tools/tools/fixwhite/fixwhite.1
==
--- head/tools/tools/fixwhite/fixwhite.1Sun May  1 16:16:11 2016
(r298880)
+++ head/tools/tools/fixwhite/fixwhite.1Sun May  1 16:20:14 2016
(r298881)
@@ -43,6 +43,6 @@ trailing whitespace characters from ever
 Multiple successive empty lines are merged together.
 If the whitespace at the beginning of a sentence is exactly a multiple
 of eight spaces, the whitespace is replaced by tabs.
-Also, spaces preceeding tabs will be merged into the tab character.
+Also, spaces preceding tabs will be merged into the tab character.
 .Sh AUTHORS
 .An Ed Schouten Aq Mt e...@freebsd.org

Modified: head/tools/tools/fixwhite/fixwhite.c
==
--- head/tools/tools/fixwhite/fixwhite.cSun May  1 16:16:11 2016
(r298880)
+++ head/tools/tools/fixwhite/fixwhite.cSun May  1 16:20:14 2016
(r298881)
@@ -95,7 +95,7 @@ savewhite(char c, bool leading)
savebyte(' ');
break;
case '\t':
-   /* Convert preceeding spaces to tabs. */
+   /* Convert preceding spaces to tabs. */
ncolumn = (column / 8 + 1) * 8;
while (peekbyte(1, ' ')) {
queuelen--;

Modified: head/tools/tools/ipw/ipwstats.c
==
--- head/tools/tools/ipw/ipwstats.c Sun May  1 16:16:11 2016
(r298880)
+++ head/tools/tools/ipw/ipwstats.c Sun May  1 16:20:14 2016
(r298881)
@@ -89,7 +89,7 @@ static const struct statistic tbl[] = {
{ 27, "Number of reassociation requests transmitted", INT },
{ 28, "Number of reassociation responses transmitted", INT },
{ 29, "Number of probe requests transmitted", INT },
-   { 30, "Number of probe reponses transmitted", INT },
+   { 30, "Number of probe responses transmitted", INT },
{ 31, "Number of beacons transmitted", INT },
{ 32, "Number of ATIM frames transmitted", INT },
{ 33, "Number of disassociation requests transmitted", INT },
@@ -137,7 +137,7 @@ static const struct statistic tbl[] = {
{ 89, "Number of reassociation requests received", INT },
{ 90, "Number of reassociation responses received", INT },
{ 91, "Number of probe requests received", INT },
-   { 92, "Number of probe reponses received", INT },
+   { 92, "Number of probe responses received", INT },
{ 93, "Number of beacons received", INT },
{ 94, "Number of ATIM frames received", INT },
{ 95, "Number of disassociation requests received", INT },

Modified: head/tools/tools/nanobsd/defaults.sh
==
--- head/tools/tools/nanobsd/defaults.shSun May  1 16:16:11 2016
(r298880)
+++ head/tools/tools/nanobsd/defaults.shSun May  1 

svn commit: r298882 - in head/share: examples/ipfilter examples/kld/cdev/test mk

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:29:02 2016
New Revision: 298882
URL: https://svnweb.freebsd.org/changeset/base/298882

Log:
  share: minor spelling fixes.
  
  Mostly comments but these tend to be user-visible.
  
  MFC after:2 weeks

Modified:
  head/share/examples/ipfilter/ipf-howto.txt
  head/share/examples/kld/cdev/test/Makefile
  head/share/mk/bsd.cpu.mk
  head/share/mk/bsd.subdir.mk
  head/share/mk/local.gendirdeps.mk

Modified: head/share/examples/ipfilter/ipf-howto.txt
==
--- head/share/examples/ipfilter/ipf-howto.txt  Sun May  1 16:20:14 2016
(r298881)
+++ head/share/examples/ipfilter/ipf-howto.txt  Sun May  1 16:29:02 2016
(r298882)
@@ -1036,11 +1036,11 @@ In  this  case,  the server is running n
 it's not a server, it's a client.  And this  client  doesn't
 want  unauthorized  packets  entering  its  IP stack at all.
 However, the client wants full access to  the  internet  and
-the  reply packets that such privledge entails.  This simple
+the reply packets that such privilege entails.  This simple
 ruleset creates state entries for  every  new  outgoing  TCP
 session.   Again,  since a state entry is created, these new
 TCP sessions are free to talk back and forth as they  please
-without  the  hinderance or inspection of the firewall rule-
+without the hindrance or inspection of the firewall rule-
 set.  We mentioned that this also works for UDP and ICMP:
 
 block in  quick on tun0 all
@@ -1271,7 +1271,7 @@ forgeries and allow fragments:
 This  works  because  every  packet  that  should be allowed
 through makes it into the state table  before  the  blocking
 rules  are reached. The only scan this won't detect is a SYN
-scan itself.  If you're truely worried about that, you might
+scan itself.  If you're truly worried about that, you might
 even want to log all initial SYN packets.
 
 3.6.  Responding To a Blocked Packet

Modified: head/share/examples/kld/cdev/test/Makefile
==
--- head/share/examples/kld/cdev/test/Makefile  Sun May  1 16:20:14 2016
(r298881)
+++ head/share/examples/kld/cdev/test/Makefile  Sun May  1 16:29:02 2016
(r298882)
@@ -73,7 +73,7 @@ WARNS?=   5
 MODSTAT= /sbin/kldstat
 
 load:
-   @echo "This test program will call the sample kld characer device ";
+   @echo "This test program will call the sample kld character device ";
@echo "driver."
@echo
@echo "The sample driver will display a message on the"

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkSun May  1 16:20:14 2016(r298881)
+++ head/share/mk/bsd.cpu.mkSun May  1 16:29:02 2016(r298882)
@@ -122,10 +122,10 @@ _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1
 _CPUCFLAGS = -march=${CPUTYPE}
 .  else
 # Common values for FreeBSD
-# arm: (any arm v4 or v5 processor you are targetting)
+# arm: (any arm v4 or v5 processor you are targeting)
 #  arm920t, arm926ej-s, marvell-pj4, fa526, fa626,
 #  fa606te, fa626te, fa726te
-# armv6: (any arm v7 or v8 processor you are targetting and the arm1176jzf-s)
+# armv6: (any arm v7 or v8 processor you are targeting and the arm1176jzf-s)
 #  arm1176jzf-s, generic-armv7-a, cortex-a5, cortex-a7, cortex-a8,
 #  cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57,
 #  cortex-a72, exynos-m1

Modified: head/share/mk/bsd.subdir.mk
==
--- head/share/mk/bsd.subdir.mk Sun May  1 16:20:14 2016(r298881)
+++ head/share/mk/bsd.subdir.mk Sun May  1 16:29:02 2016(r298882)
@@ -16,7 +16,7 @@
 #
 # SUBDIR   A list of subdirectories that should be built as well.
 #  Each of the targets will execute the same target in the
-#  subdirectories. SUBDIR.yes is automatically appeneded
+#  subdirectories. SUBDIR.yes is automatically appended
 #  to this list.
 #
 # +++ targets +++

Modified: head/share/mk/local.gendirdeps.mk
==
--- head/share/mk/local.gendirdeps.mk   Sun May  1 16:20:14 2016
(r298881)
+++ head/share/mk/local.gendirdeps.mk   Sun May  1 16:29:02 2016
(r298882)
@@ -3,7 +3,7 @@
 # we need a keyword, this noise is to prevent it being expanded
 GENDIRDEPS_HEADER= echo '\# ${FreeBSD:L:@v@$$$v$$ @:M*F*}';
 
-# supress optional/auto dependecies
+# suppress optional/auto dependencies
 # local.dirdeps.mk will put them in if necessary
 GENDIRDEPS_FILTER+= \
Nbin/cat.host \
___
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: r298883 - in head/usr.sbin/bluetooth: btpand hccontrol

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:36:14 2016
New Revision: 298883
URL: https://svnweb.freebsd.org/changeset/base/298883

Log:
  bluetooth: minor spelling fixes.
  
  User-visible strings.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/bluetooth/btpand/btpand.c
  head/usr.sbin/bluetooth/hccontrol/node.c

Modified: head/usr.sbin/bluetooth/btpand/btpand.c
==
--- head/usr.sbin/bluetooth/btpand/btpand.c Sun May  1 16:29:02 2016
(r298882)
+++ head/usr.sbin/bluetooth/btpand/btpand.c Sun May  1 16:36:14 2016
(r298883)
@@ -66,7 +66,7 @@ static const struct {
const char *desc;
 } services[] = {
{ "PANU", SDP_SERVICE_CLASS_PANU, "Personal Area Networking User" },
-   { "NAP",  SDP_SERVICE_CLASS_NAP,  "Network Acess Point"   },
+   { "NAP",  SDP_SERVICE_CLASS_NAP,  "Network Access Point"
  },
{ "GN",   SDP_SERVICE_CLASS_GN,   "Group Network" },
 };
 

Modified: head/usr.sbin/bluetooth/hccontrol/node.c
==
--- head/usr.sbin/bluetooth/hccontrol/node.cSun May  1 16:29:02 2016
(r298882)
+++ head/usr.sbin/bluetooth/hccontrol/node.cSun May  1 16:36:14 2016
(r298883)
@@ -592,7 +592,7 @@ struct hci_command  node_commands[] = {
 "Write the value of the Role Switch parameter for the HCI node. By default,\n" 
\
 "if Role Switch is supported, local device will try to perform Role Switch\n" \
 "and become Master on incoming connection. Some devices do not support Role\n" 
\
-"Switch and thus incomming connections from such devices will fail. Setting\n" 
\
+"Switch and thus incoming connections from such devices will fail. Setting\n" \
 "this parameter to zero will prevent Role Switch and thus accepting device\n" \
 "will remain Slave",
 &hci_write_node_role_switch
___
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: r298884 - in head/usr.sbin: bsdconfig/share bsdconfig/share/media bsdconfig/share/packages bsdconfig/startup/share bsdinstall/scripts

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:38:12 2016
New Revision: 298884
URL: https://svnweb.freebsd.org/changeset/base/298884

Log:
  usr.sbin/bsdconfig: minor spelling fixes on comments.
  
  No functional change.

Modified:
  head/usr.sbin/bsdconfig/share/common.subr
  head/usr.sbin/bsdconfig/share/dialog.subr
  head/usr.sbin/bsdconfig/share/geom.subr
  head/usr.sbin/bsdconfig/share/media/tcpip.subr
  head/usr.sbin/bsdconfig/share/packages/index.subr
  head/usr.sbin/bsdconfig/share/packages/packages.subr
  head/usr.sbin/bsdconfig/startup/share/rcconf.subr
  head/usr.sbin/bsdconfig/startup/share/rcvar.subr
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdconfig/share/common.subr
==
--- head/usr.sbin/bsdconfig/share/common.subr   Sun May  1 16:36:14 2016
(r298883)
+++ head/usr.sbin/bsdconfig/share/common.subr   Sun May  1 16:38:12 2016
(r298884)
@@ -167,7 +167,7 @@ f_debug_init()
[ "$debugFile" ] && { [ "${debug+set}" ] || debug=1; }
 
#
-   # Make debugging persistant if set
+   # Make debugging persistent if set
#
[ "$debug" ] && export debug
[ "$debugFile" ] && export debugFile
@@ -175,7 +175,7 @@ f_debug_init()
#
# Truncate debug file unless requested otherwise. Note that we will
# trim a leading plus (`+') from the value of debugFile to support
-   # persistant meaning that f_dprintf() should print both to standard
+   # persistent meaning that f_dprintf() should print both to standard
# output and $debugFile (minus the leading plus, of course).
#
local _debug_file="${debugFile#+}"

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Sun May  1 16:36:14 2016
(r298883)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Sun May  1 16:38:12 2016
(r298884)
@@ -105,10 +105,10 @@ DIALOG_ESC=255
 #
 # When manually sizing Xdialog(1) widgets such as calendar and timebox, you'll
 # need to know the size of the embedded GUI objects because the height passed
-# to Xdialog(1) for these widgets has to be tall enough to accomodate them.
+# to Xdialog(1) for these widgets has to be tall enough to accommodate them.
 #
 # These values are helpful when manually sizing with dialog(1) too, but in a
-# different way. dialog(1) does not make you accomodate the custom items in the
+# different way. dialog(1) does not make you accommodate the custom items in 
the
 # height (but does for width) -- a height of 3 will display three lines and a
 # full calendar, for example (whereas Xdialog will truncate the calendar if
 # given a height of 3). For dialog(1), use these values for making sure that
@@ -703,7 +703,7 @@ f_dialog_buttonbox_size()
 
# Adjust height if desired
if [ "$__var_height" ]; then
-   # Add height to accomodate the buttons
+   # Add height to accommodate the buttons
__height_bbox_size=$(( $__height_bbox_size + 2 ))
 
# Adjust for clipping with Xdialog(1) on Linux/GTK2
@@ -1382,7 +1382,7 @@ f_dialog_calendar_size()
__height=$( echo "$__prompt" | f_number_of_lines )
 
if [ "$USE_XDIALOG" ]; then
-   # Add height to accomodate for embedded calendar widget
+   # Add height to accommodate for embedded calendar widget
__height=$(( $__height + $DIALOG_CALENDAR_HEIGHT - 1 ))
 
# Also, bump height if backtitle is enabled

Modified: head/usr.sbin/bsdconfig/share/geom.subr
==
--- head/usr.sbin/bsdconfig/share/geom.subr Sun May  1 16:36:14 2016
(r298883)
+++ head/usr.sbin/bsdconfig/share/geom.subr Sun May  1 16:38:12 2016
(r298884)
@@ -91,7 +91,7 @@ f_struct_define GEOM_PROVIDER_CONFIG \
 # f_geom_get_all
 #
 # Parse sysctl(8) `kern.geom.confxml' data into a series of structs. GEOM
-# classes are at the top of the heirarchy and are stored as numbered structs
+# classes are at the top of the hierarchy and are stored as numbered structs
 # from 1 to $NGEOM_CLASSES (set by this function) named `geom_class_C'. GEOM
 # objects within each class are stored as numbered structs from 1 to `ngeoms'
 # (a property of the GEOM class struct) named `geom_class_C_geom_N' (where C

Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr
==
--- head/usr.sbin/bsdconfig/share/media/tcpip.subr  Sun May  1 16:36:14 
2016(r298883)
+++ head/usr.sbin/bsdconfig/share/media/tcpip.subr  Sun May  1 16:38:12 
2016(r298884)
@@ -1129,7 +1129,7 @@ f_host_lookup()
 #  allows you to have a mostly non-interactive scr

svn commit: r298885 - head/usr.sbin/pmcstat

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:40:56 2016
New Revision: 298885
URL: https://svnweb.freebsd.org/changeset/base/298885

Log:
  pmcstat: minor spelling fixes.
  
  Mostly comments bur also a user-visible string.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/pmcstat/pmcpl_calltree.c
  head/usr.sbin/pmcstat/pmcstat_log.c

Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c
==
--- head/usr.sbin/pmcstat/pmcpl_calltree.c  Sun May  1 16:38:12 2016
(r298884)
+++ head/usr.sbin/pmcstat/pmcpl_calltree.c  Sun May  1 16:40:56 2016
(r298885)
@@ -830,7 +830,7 @@ pmcpl_ct_node_printchild(struct pmcpl_ct
 
/*
 * Child cost.
-* TODO: attach child cost to the real position in the funtion.
+* TODO: attach child cost to the real position in the function.
 * TODO: cfn= / call  addr() / addr(call ) 
 */
for (i=0 ; ipct_narc; i++) {

Modified: head/usr.sbin/pmcstat/pmcstat_log.c
==
--- head/usr.sbin/pmcstat/pmcstat_log.c Sun May  1 16:38:12 2016
(r298884)
+++ head/usr.sbin/pmcstat/pmcstat_log.c Sun May  1 16:40:56 2016
(r298885)
@@ -1372,7 +1372,7 @@ pmcstat_analyze_log(void)
assert(args.pa_flags & FLAG_DO_ANALYSIS);
 
if (elf_version(EV_CURRENT) == EV_NONE)
-   err(EX_UNAVAILABLE, "Elf library intialization failed");
+   err(EX_UNAVAILABLE, "Elf library initialization failed");
 
while (pmclog_read(args.pa_logparser, &ev) == 0) {
assert(ev.pl_state == PMCLOG_OK);
___
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: r298886 - in head/usr.sbin: camdd cron/cron ctladm gssd jail lpr/common_source lpr/lpd nandsim rtadvd

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:41:25 2016
New Revision: 298886
URL: https://svnweb.freebsd.org/changeset/base/298886

Log:
  usr.sbin: minor spelling fixes on comments.
  
  No functional change.

Modified:
  head/usr.sbin/camdd/camdd.c
  head/usr.sbin/cron/cron/cron.c
  head/usr.sbin/cron/cron/popen.c
  head/usr.sbin/ctladm/ctladm.c
  head/usr.sbin/gssd/gssd.c
  head/usr.sbin/jail/jailparse.y
  head/usr.sbin/lpr/common_source/common.c
  head/usr.sbin/lpr/lpd/recvjob.c
  head/usr.sbin/nandsim/nandsim_cfgparse.c
  head/usr.sbin/rtadvd/rtadvd.c

Modified: head/usr.sbin/camdd/camdd.c
==
--- head/usr.sbin/camdd/camdd.c Sun May  1 16:40:56 2016(r298885)
+++ head/usr.sbin/camdd/camdd.c Sun May  1 16:41:25 2016(r298886)
@@ -446,7 +446,7 @@ static int need_status = 0;
 #endif
 
 
-/* Generically usefull offsets into the peripheral private area */
+/* Generically useful offsets into the peripheral private area */
 #define ppriv_ptr0 periph_priv.entries[0].ptr
 #define ppriv_ptr1 periph_priv.entries[1].ptr
 #define ppriv_field0 periph_priv.entries[0].field

Modified: head/usr.sbin/cron/cron/cron.c
==
--- head/usr.sbin/cron/cron/cron.c  Sun May  1 16:40:56 2016
(r298885)
+++ head/usr.sbin/cron/cron/cron.c  Sun May  1 16:41:25 2016
(r298886)
@@ -228,7 +228,7 @@ cron_tick(cron_db *db, int secres)
register user   *u;
register entry  *e;
 
-   /* make 0-based values out of these so we can use them as indicies
+   /* make 0-based values out of these so we can use them as indices
 */
second = (secres == 0) ? 0 : tm->tm_sec -FIRST_SECOND;
minute = tm->tm_min -FIRST_MINUTE;
@@ -289,7 +289,7 @@ cron_tick(cron_db *db, int secres)
time_t difftime = TargetTime + tm->tm_gmtoff - diff;
gmtime_r(&difftime, &otztm);
 
-   /* make 0-based values out of these so we can use them 
as indicies
+   /* make 0-based values out of these so we can use them 
as indices
 */
otzsecond = (secres == 0) ? 0 : otztm.tm_sec 
-FIRST_SECOND;
otzminute = otztm.tm_min -FIRST_MINUTE;

Modified: head/usr.sbin/cron/cron/popen.c
==
--- head/usr.sbin/cron/cron/popen.c Sun May  1 16:40:56 2016
(r298885)
+++ head/usr.sbin/cron/cron/popen.c Sun May  1 16:41:25 2016
(r298886)
@@ -47,7 +47,7 @@ static const char rcsid[] =
 #define WANT_GLOBBING 0
 
 /*
- * Special version of popen which avoids call to shell.  This insures noone
+ * Special version of popen which avoids call to shell.  This insures no one
  * may create a pipe to a hidden program as a side effect of a list or dir
  * command.
  */

Modified: head/usr.sbin/ctladm/ctladm.c
==
--- head/usr.sbin/ctladm/ctladm.c   Sun May  1 16:40:56 2016
(r298885)
+++ head/usr.sbin/ctladm/ctladm.c   Sun May  1 16:41:25 2016
(r298886)
@@ -2922,7 +2922,7 @@ cctl_islist_end_element(void *user_data,
/* Nothing. */
} else {
/*
-* Unknown element; ignore it for forward compatiblity.
+* Unknown element; ignore it for forward compatibility.
 */
}
 

Modified: head/usr.sbin/gssd/gssd.c
==
--- head/usr.sbin/gssd/gssd.c   Sun May  1 16:40:56 2016(r298885)
+++ head/usr.sbin/gssd/gssd.c   Sun May  1 16:41:25 2016(r298886)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
 
 struct gss_resource {
LIST_ENTRY(gss_resource) gr_link;
-   uint64_tgr_id;  /* indentifier exported to kernel */
+   uint64_tgr_id;  /* identifier exported to kernel */
void*   gr_res; /* GSS-API resource pointer */
 };
 LIST_HEAD(gss_resource_list, gss_resource) gss_resources;

Modified: head/usr.sbin/jail/jailparse.y
==
--- head/usr.sbin/jail/jailparse.y  Sun May  1 16:40:56 2016
(r298885)
+++ head/usr.sbin/jail/jailparse.y  Sun May  1 16:41:25 2016
(r298886)
@@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
 
 /*
  * A config file is a series of jails (containing parameters) and jail-less
- * parameters which realy belong to a global pseudo-jail.
+ * parameters which really belong to a global pseudo-jail.
  */
 conf   :
;

Modified: head/usr.sbin/lpr/common_source/common.c
==
--- head/usr.sbin/lpr/common_source/common.cSun May  1 16:40:56 2016
(r29

svn commit: r298887 - in head/etc: . ntp rc.d

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 16:43:22 2016
New Revision: 298887
URL: https://svnweb.freebsd.org/changeset/base/298887

Log:
  etc: minor spelling fixes.
  
  Mostly comments but these tend to be user-visible.
  
  MFC after:2 weeks

Modified:
  head/etc/ntp/leap-seconds
  head/etc/protocols
  head/etc/rc.d/sendmail
  head/etc/rc.initdiskless

Modified: head/etc/ntp/leap-seconds
==
--- head/etc/ntp/leap-seconds   Sun May  1 16:41:25 2016(r298886)
+++ head/etc/ntp/leap-seconds   Sun May  1 16:43:22 2016(r298887)
@@ -46,7 +46,7 @@
 #  by the International Bureau of Weights and Measures
 #  (BIPM). See www.bipm.fr for more information.
 #
-#  3. The current defintion of the relationship between UTC 
+#  3. The current definition of the relationship between UTC 
 #  and TAI dates from 1 January 1972. A number of different 
 #  time scales were in use before than epoch, and it can be 
 #  quite difficult to compute precise timestamps and time 

Modified: head/etc/protocols
==
--- head/etc/protocols  Sun May  1 16:41:25 2016(r298886)
+++ head/etc/protocols  Sun May  1 16:43:22 2016(r298887)
@@ -43,7 +43,7 @@ merit-inp 32  MERIT-INP   # MERIT Internoda
 dccp   33  DCCP# Datagram Congestion Control Protocol
 3pc34  3PC # Third Party Connect Protocol
 idpr   35  IDPR# Inter-Domain Policy Routing Protocol
-xtp36  XTP # Xpress Tranfer Protocol
+xtp36  XTP # Xpress Transfer Protocol
 ddp37  DDP # Datagram Delivery Protocol
 idpr-cmtp  38  IDPR-CMTP   # IDPR Control Message Transport Proto
 tp++   39  TP++# TP++ Transport Protocol

Modified: head/etc/rc.d/sendmail
==
--- head/etc/rc.d/sendmail  Sun May  1 16:41:25 2016(r298886)
+++ head/etc/rc.d/sendmail  Sun May  1 16:43:22 2016(r298887)
@@ -79,7 +79,7 @@ sendmail_cert_create()
crlnumber   = \$dir/crlnumber   # the current crl number
crl = \$dir/crl.pem # The current CRL
private_key = \$dir/cakey.pem
-   x509_extensions = usr_cert  # The extentions to add 
to the cert
+   x509_extensions = usr_cert  # The extensions to add 
to the cert
name_opt= ca_default# Subject Name options
cert_opt= ca_default# Certificate field 
options
default_days= 365   # how long to certify 
for
@@ -100,7 +100,7 @@ sendmail_cert_create()
default_keyfile = privkey.pem
distinguished_name  = req_distinguished_name
attributes  = req_attributes
-   x509_extensions = v3_ca # The extentions to add to the self 
signed cert
+   x509_extensions = v3_ca # The extensions to add to the self 
signed cert
string_mask = utf8only
prompt = no
[ req_distinguished_name ]

Modified: head/etc/rc.initdiskless
==
--- head/etc/rc.initdisklessSun May  1 16:41:25 2016(r298886)
+++ head/etc/rc.initdisklessSun May  1 16:43:22 2016(r298887)
@@ -103,7 +103,7 @@
 #  will be created. In case of multiple entries for the same
 #  directory M, the last one in the scanning order is used.
 #  NOTE: If you only need to create a memory filesystem but not
-#  initialize it from a template, it is preferrable to specify
+#  initialize it from a template, it is preferable to specify
 #  it in fstab e.g. as  "md /tmp mfs -s=30m,rw 0 0"
 #
 # /conf/T/SUBDIR.cpio.gz
___
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: r298888 - head/usr.sbin/jail

2016-05-01 Thread Jamie Gritton
Author: jamie
Date: Sun May  1 16:48:03 2016
New Revision: 29
URL: https://svnweb.freebsd.org/changeset/base/29

Log:
  typo
  
  Submitted by: Jimmy Olgeni

Modified:
  head/usr.sbin/jail/jail.8

Modified: head/usr.sbin/jail/jail.8
==
--- head/usr.sbin/jail/jail.8   Sun May  1 16:43:22 2016(r298887)
+++ head/usr.sbin/jail/jail.8   Sun May  1 16:48:03 2016(r29)
@@ -653,7 +653,7 @@ its keys.
 If set to
 .Dq disable ,
 the jail cannot perform any sysvmsg-related system calls.
-.It Va sysvsem, sysvmsg
+.It Va sysvsem, sysvshm
 Allow access to SYSV IPC semaphore and shared memory primitives, in the
 same manner as
 .Va sysvmsg.
___
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: r298890 - in head/sys: dev/firewire i386/bios sys

2016-05-01 Thread Konstantin Belousov
Author: kib
Date: Sun May  1 17:46:56 2016
New Revision: 298890
URL: https://svnweb.freebsd.org/changeset/base/298890

Log:
  Make it explicit that D_MEM cdevsw d_flag is to signify that the
  driver is (or behaves identically to) /dev/mem.  Remove the D_MEM flag
  from random drivers.
  
  Note that currently the D_MEM flag does not affect any behaviour, but
  this going to change in the next commit.
  
  Noted and reviewed by:alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  X-Differential revision:  https://reviews.freebsd.org/D6149

Modified:
  head/sys/dev/firewire/fwdev.c
  head/sys/i386/bios/smapi.c
  head/sys/sys/conf.h

Modified: head/sys/dev/firewire/fwdev.c
==
--- head/sys/dev/firewire/fwdev.c   Sun May  1 16:49:32 2016
(r298889)
+++ head/sys/dev/firewire/fwdev.c   Sun May  1 17:46:56 2016
(r298890)
@@ -80,7 +80,6 @@ struct cdevsw firewire_cdevsw = {
.d_mmap =   fw_mmap,
.d_strategy =   fw_strategy,
.d_name =   "fw",
-   .d_flags =  D_MEM
 };
 
 struct fw_drv1 {

Modified: head/sys/i386/bios/smapi.c
==
--- head/sys/i386/bios/smapi.c  Sun May  1 16:49:32 2016(r298889)
+++ head/sys/i386/bios/smapi.c  Sun May  1 17:46:56 2016(r298890)
@@ -80,7 +80,7 @@ static struct cdevsw smapi_cdevsw = {
.d_version =D_VERSION,
.d_ioctl =  smapi_ioctl,
.d_name =   "smapi",
-   .d_flags =  D_MEM | D_NEEDGIANT,
+   .d_flags =  D_NEEDGIANT,
 };
 
 static voidsmapi_identify(driver_t *, device_t);

Modified: head/sys/sys/conf.h
==
--- head/sys/sys/conf.h Sun May  1 16:49:32 2016(r298889)
+++ head/sys/sys/conf.h Sun May  1 17:46:56 2016(r298890)
@@ -138,7 +138,7 @@ typedef int dumper_t(
 #defineD_TAPE  0x0001
 #defineD_DISK  0x0002
 #defineD_TTY   0x0004
-#defineD_MEM   0x0008
+#defineD_MEM   0x0008  /* /dev/(k)mem */
 
 #ifdef _KERNEL
 
___
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: r298891 - head/sys/vm

2016-05-01 Thread Konstantin Belousov
Author: kib
Date: Sun May  1 17:48:43 2016
New Revision: 298891
URL: https://svnweb.freebsd.org/changeset/base/298891

Log:
  Avoid duplicated calls to pmap_page_get_memattr().
  
  Avoid logging inconsistency for the /dev/mem device at all. The driver
  leaves memattr intact, and the corrective action in the device pager
  handles it right.
  
  In the logged warning, name the driver we blame, and show memory
  attributes values.
  
  Reported and tested by:   pho
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D6149

Modified:
  head/sys/vm/device_pager.c

Modified: head/sys/vm/device_pager.c
==
--- head/sys/vm/device_pager.c  Sun May  1 17:46:56 2016(r298890)
+++ head/sys/vm/device_pager.c  Sun May  1 17:48:43 2016(r298891)
@@ -299,7 +299,7 @@ old_dev_pager_fault(vm_object_t object, 
struct cdevsw *csw;
struct file *fpop;
struct thread *td;
-   vm_memattr_t memattr;
+   vm_memattr_t memattr, memattr1;
int ref, ret;
 
memattr = object->memattr;
@@ -327,10 +327,18 @@ old_dev_pager_fault(vm_object_t object, 
 
/* If "paddr" is a real page, perform a sanity check on "memattr". */
if ((m_paddr = vm_phys_paddr_to_vm_page(paddr)) != NULL &&
-   pmap_page_get_memattr(m_paddr) != memattr) {
-   memattr = pmap_page_get_memattr(m_paddr);
-   printf(
-   "WARNING: A device driver has set \"memattr\" inconsistently.\n");
+   (memattr1 = pmap_page_get_memattr(m_paddr)) != memattr) {
+   /*
+* For the /dev/mem d_mmap routine to return the
+* correct memattr, pmap_page_get_memattr() needs to
+* be called, which we do there.
+*/
+   if ((csw->d_flags & D_MEM) == 0) {
+   printf("WARNING: Device driver %s has set "
+   "\"memattr\" inconsistently (drv %u pmap %u).\n",
+   csw->d_name, memattr, memattr1);
+   }
+   memattr = memattr1;
}
if (((*mres)->flags & PG_FICTITIOUS) != 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: r298892 - head/tools/tools/netmap

2016-05-01 Thread George V. Neville-Neil
Author: gnn
Date: Sun May  1 17:55:45 2016
New Revision: 298892
URL: https://svnweb.freebsd.org/changeset/base/298892

Log:
  Add a manual page for pkt-gen.
  
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/tools/tools/netmap/pkt-gen.8   (contents, props changed)

Added: head/tools/tools/netmap/pkt-gen.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/netmap/pkt-gen.8   Sun May  1 17:55:45 2016
(r298892)
@@ -0,0 +1,179 @@
+.\" Copyright (c) 2016, George V. Neville-Neil
+.\" 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER OR CONTRIBUTORS BE
+.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 1, 2016
+.Dt PKT-GEN 8
+.Os
+.Sh NAME
+.Nm pkt-gen
+.Nd Packet generator for use with
+.Xr netmap 4
+.Sh SYNOPSIS
+.Bl -item -compact
+.It
+.Nm
+.Op Fl i Ar interface
+.Op Fl f Ar function
+.Op Fl n Ar count
+.Op Fl t Ar pkts_to_send
+.Op Fl r Ar pkts_to_receive
+.Op Fl l Ar pkt_size
+.Op Fl d Ar dst_ip[:port[-dst_ip:port]]
+.Op Fl s Ar src_ip[:port[-src_ip:port]]
+.Op Fl D Ar dst-mac
+.Op Fl S Ar src-mac
+.Op Fl a Ar cpu_id
+.Op Fl b Ar burst size
+.Op Fl c Ar cores
+.Op Fl p Ar threads
+.Op Fl T Ar report_ms
+.Op Fl P
+.Op Fl w Ar wait_for_link_time
+.Op Fl R Ar rate
+.Op Fl X
+.Op Fl H Ar len
+.Op Fl P Ar xfile
+.Op Fl z
+.Op Fl Z
+.Sh DESCRIPTION
+.Nm
+generates and receives raw network packets using
+.Xr netmap 4 .
+The arguments are as follows:
+.Pp
+.Bl -tag -width Ds
+.It Fl i Ar interface
+Network interface name.
+.It Fl f Ar function tx rx ping pong
+Set the function to transmit, receive of ping/pong.
+.It Fl n count
+Number of iterations (can be 0).
+.It Fl t pkts_to_send
+Number of packets to send.  Also forces transmit mode.
+.It Fl r Ar pkts_to_receive
+Number of packets to receive.  Also forces rx mode.
+.It Fl l Ar pkt_size
+Packet size in bytes excluding CRC.
+.It Fl d Ar dst_ip[:port[-dst_ip:port]]
+Destination IPv4 address and port, single or range.
+.It Fl s Ar src_ip[:port[-src_ip:port]]
+Source IPv4 address and port, single or range.
+.It Fl D Ar dst-mac
+Destination MAC address in colon notation.
+.It Fl S Ar src-mac
+Source MAC address in colon notation.
+.It Fl a Ar cpu_id
+Tie
+.Nm
+to a particular CPU core using
+.Xr setaffinity 2.
+.It Fl b Ar burst size
+Set the size of a burst of packets.
+.It Fl c Ar cores
+Number of cores to use.
+.It Fl p Ar threads
+Number of threads to use.
+.It Fl T Ar report_ms
+Number of milliseconds between reports.
+.It Fl P
+Use libpcap instead of netmap for reading or writing.
+.It Fl w Ar wait_for_link_time
+Number of seconds to wait to make sure that the network link is up.  A
+network device driver may take some time to create a new
+transmit/receive ring pair when
+.Xr netmap 4
+requests one.
+.It Fl R Ar rate
+Packet transmission rate.  Not setting the packet transmission rate tells
+.Nm
+to transmit packets as quickly as possible.  On servers from 2010 on-wards
+.Xr netmap 4
+is able to completely use all of the bandwidth of a 10 or 40Gbps link,
+so this option should be used unless your intention is to saturate the link.
+.It Fl X
+Dump payload transmitted or received.
+.It Fl H Ar len
+Add empty virtio-net-header with size 'len'.  This option is only use
+with Virtual Machine technologies that use virtio as a network interface.
+.It Fl P Ar file
+Load the packet from a pcap file rather than constructing it inside of
+.Nm
+.It Fl z
+Use random IPv4 src address/port
+.It Fl Z
+Use random IPv4 dst address/port
+.El
+.Pp
+.Nm
+is a raw packet generator that can utilize either
+.Xr netmap 4
+or
+.Xr bpf 4
+but which is most often uses with
+.Xr netmap 4 .
+

svn commit: r298893 - head/lib/libc/sys

2016-05-01 Thread Benedict Reuschling
Author: bcr (doc committer)
Date: Sun May  1 18:09:34 2016
New Revision: 298893
URL: https://svnweb.freebsd.org/changeset/base/298893

Log:
  Provide an example to the kqueue man page, showing
  a basic usage example.  Although it is an
  untypical example for the use of kqueue, it is
  better than nothing and should get people started.
  
  PR:   196844
  Submitted by: fernando.apesteg...@gmail.com
  Reviewed by:  kib
  Approved by:  kib
  MFC after:5 days
  Differential Revision:https://reviews.freebsd.org/D6082

Modified:
  head/lib/libc/sys/kqueue.2

Modified: head/lib/libc/sys/kqueue.2
==
--- head/lib/libc/sys/kqueue.2  Sun May  1 17:55:45 2016(r298892)
+++ head/lib/libc/sys/kqueue.2  Sun May  1 18:09:34 2016(r298893)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 2015
+.Dd May 1, 2016
 .Dt KQUEUE 2
 .Os
 .Sh NAME
@@ -603,6 +603,57 @@ will be set to indicate the error condit
 If the time limit expires, then
 .Fn kevent
 returns 0.
+.Sh EXAMPLES
+.Bd -literal -compact
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int
+main(int argc, char **argv)
+{
+struct kevent event;/* Event we want to monitor */
+struct kevent tevent;   /* Event triggered */
+int kq, fd, ret;
+
+if (argc != 2)
+   err(EXIT_FAILURE, "Usage: %s path\en", argv[0]);
+fd = open(argv[1], O_RDONLY);
+if (fd == -1)
+   err(EXIT_FAILURE, "Failed to open '%s'", argv[1]);
+
+/* Create kqueue. */
+kq = kqueue();
+if (kq == -1)
+   err(EXIT_FAILURE, "kqueue() failed");
+
+/* Initialize kevent structure. */
+EV_SET(&event, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_WRITE,
+   0, NULL);
+/* Attach event to the kqueue. */
+ret = kevent(kq, &event, 1, NULL, 0, NULL);
+if (ret == -1)
+   err(EXIT_FAILURE, "kevent register");
+if (event.flags & EV_ERROR)
+   errx(EXIT_FAILURE, "Event error: %s", strerror(event.data));
+
+for (;;) {
+   /* Sleep until something happens. */
+   ret = kevent(kq, NULL, 0, &tevent, 1, NULL);
+   if (ret == -1) {
+   err(EXIT_FAILURE, "kevent wait");
+   } else if (ret > 0) {
+   printf("Something was written in '%s'\en", argv[1]);
+   }
+}
+}
+.Ed
 .Sh ERRORS
 The
 .Fn kqueue
___
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: r298894 - head/sys/dev/otus

2016-05-01 Thread Andriy Voskoboinyk
Author: avos
Date: Sun May  1 18:15:40 2016
New Revision: 298894
URL: https://svnweb.freebsd.org/changeset/base/298894

Log:
  otus: switch to ieee80211_add_channel_list_*()
  
  - Use device's channel list instead of default one
  (from ieee80211_init_channels()).
  - Sort channels (ieee80211_add_channel_list_* requirement).
  - Add ic_getradiocaps() method.
  
  Added channels:
  2GHz band: 12, 13 and 14.
  5GHz band: 34, 38, 42, 46 and 165.
  
  Reviewed by:  adrian
  Differential Revision:https://reviews.freebsd.org/D6145

Modified:
  head/sys/dev/otus/if_otus.c
  head/sys/dev/otus/if_otusreg.h

Modified: head/sys/dev/otus/if_otus.c
==
--- head/sys/dev/otus/if_otus.c Sun May  1 18:09:34 2016(r298893)
+++ head/sys/dev/otus/if_otus.c Sun May  1 18:15:40 2016(r298894)
@@ -132,6 +132,8 @@ static device_detach_t otus_detach;
 
 static int otus_attachhook(struct otus_softc *);
 void   otus_get_chanlist(struct otus_softc *);
+static voidotus_getradiocaps(struct ieee80211com *, int, int *,
+   struct ieee80211_channel[]);
 intotus_load_firmware(struct otus_softc *, const char *,
uint32_t);
 intotus_open_pipes(struct otus_softc *);
@@ -624,7 +626,6 @@ otus_attachhook(struct otus_softc *sc)
struct ieee80211com *ic = &sc->sc_ic;
usb_device_request_t req;
uint32_t in, out;
-   uint8_t bands[IEEE80211_MODE_BYTES];
int error;
 
/* Not locked */
@@ -742,20 +743,8 @@ otus_attachhook(struct otus_softc *sc)
/* Build the list of supported channels. */
otus_get_chanlist(sc);
 #else
-   /* Set supported .11b and .11g rates. */
-   memset(bands, 0, sizeof(bands));
-   if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11G) {
-   setbit(bands, IEEE80211_MODE_11B);
-   setbit(bands, IEEE80211_MODE_11G);
-   }
-   if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11A) {
-   setbit(bands, IEEE80211_MODE_11A);
-   }
-#if 0
-   if (sc->sc_ht)
-   setbit(bands, IEEE80211_MODE_11NG);
-#endif
-   ieee80211_init_channels(ic, NULL, bands);
+   otus_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
+   ic->ic_channels);
 #endif
 
ieee80211_ifattach(ic);
@@ -763,6 +752,7 @@ otus_attachhook(struct otus_softc *sc)
ic->ic_scan_start = otus_scan_start;
ic->ic_scan_end = otus_scan_end;
ic->ic_set_channel = otus_set_channel;
+   ic->ic_getradiocaps = otus_getradiocaps;
ic->ic_vap_create = otus_vap_create;
ic->ic_vap_delete = otus_vap_delete;
ic->ic_update_mcast = otus_update_mcast;
@@ -820,6 +810,32 @@ otus_get_chanlist(struct otus_softc *sc)
}
 }
 
+static void
+otus_getradiocaps(struct ieee80211com *ic,
+int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+   struct otus_softc *sc = ic->ic_softc;
+   uint8_t bands[IEEE80211_MODE_BYTES];
+
+   /* Set supported .11b and .11g rates. */
+   memset(bands, 0, sizeof(bands));
+   if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11G) {
+   setbit(bands, IEEE80211_MODE_11B);
+   setbit(bands, IEEE80211_MODE_11G);
+#if 0
+   if (sc->sc_ht)
+   setbit(bands, IEEE80211_MODE_11NG);
+#endif
+   ieee80211_add_channel_list_2ghz(chans, maxchans, nchans,
+   ar_chans, 14, bands, 0);
+   }
+   if (sc->eeprom.baseEepHeader.opCapFlags & AR5416_OPFLAGS_11A) {
+   setbit(bands, IEEE80211_MODE_11A);
+   ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
+&ar_chans[14], nitems(ar_chans) - 14, bands, 0);
+   }
+}
+
 int
 otus_load_firmware(struct otus_softc *sc, const char *name, uint32_t addr)
 {

Modified: head/sys/dev/otus/if_otusreg.h
==
--- head/sys/dev/otus/if_otusreg.h  Sun May  1 18:09:34 2016
(r298893)
+++ head/sys/dev/otus/if_otusreg.h  Sun May  1 18:15:40 2016
(r298894)
@@ -348,8 +348,8 @@ struct ar_evt_tx_comp {
 /* List of supported channels. */
 static const uint8_t ar_chans[] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
-   36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124,
-   128, 132, 136, 140, 149, 153, 157, 161, 165, 34, 38, 42, 46
+   34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, 100, 104, 108,
+   112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165
 };
 
 /*
___
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: r298895 - head/sys/dev/usb/wlan

2016-05-01 Thread Andriy Voskoboinyk
Author: avos
Date: Sun May  1 18:53:12 2016
New Revision: 298895
URL: https://svnweb.freebsd.org/changeset/base/298895

Log:
  rum: switch to ieee80211_add_channel_list_*()
  
  - Use device's channel list instead of default one
  (from ieee80211_init_channels()).
  - Add ic_getradiocaps() method.
  
  Added channels:
  2GHz band: 12, 13 and 14.
  5Ghz band: 34, 38, 42, 46 and 165.
  
  Tested with WUSB54GC, STA / MONITOR modes.
  
  Differential Revision:https://reviews.freebsd.org/D6125

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

Modified: head/sys/dev/usb/wlan/if_rum.c
==
--- head/sys/dev/usb/wlan/if_rum.c  Sun May  1 18:15:40 2016
(r298894)
+++ head/sys/dev/usb/wlan/if_rum.c  Sun May  1 18:53:12 2016
(r298895)
@@ -269,6 +269,8 @@ static int  rum_raw_xmit(struct ieee8021
 static voidrum_scan_start(struct ieee80211com *);
 static voidrum_scan_end(struct ieee80211com *);
 static voidrum_set_channel(struct ieee80211com *);
+static voidrum_getradiocaps(struct ieee80211com *, int, int *,
+   struct ieee80211_channel[]);
 static int rum_get_rssi(struct rum_softc *, uint8_t);
 static voidrum_ratectl_start(struct rum_softc *,
struct ieee80211_node *);
@@ -336,6 +338,14 @@ static const struct {
{ 107, 0x04 }
 };
 
+static const uint8_t rum_chan_2ghz[] =
+   { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
+
+static const uint8_t rum_chan_5ghz[] =
+   { 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64,
+ 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
+ 149, 153, 157, 161, 165 };
+
 static const struct rfprog {
uint8_t chan;
uint32_tr1, r2, r3, r4;
@@ -477,7 +487,6 @@ rum_attach(device_t self)
struct rum_softc *sc = device_get_softc(self);
struct ieee80211com *ic = &sc->sc_ic;
uint32_t tmp;
-   uint8_t bands[IEEE80211_MODE_BYTES];
uint8_t iface_index;
int error, ntries;
 
@@ -548,12 +557,8 @@ rum_attach(device_t self)
IEEE80211_CRYPTO_TKIPMIC |
IEEE80211_CRYPTO_TKIP;
 
-   memset(bands, 0, sizeof(bands));
-   setbit(bands, IEEE80211_MODE_11B);
-   setbit(bands, IEEE80211_MODE_11G);
-   if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226)
-   setbit(bands, IEEE80211_MODE_11A);
-   ieee80211_init_channels(ic, NULL, bands);
+   rum_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans,
+   ic->ic_channels);
 
ieee80211_ifattach(ic);
ic->ic_update_promisc = rum_update_promisc;
@@ -561,6 +566,7 @@ rum_attach(device_t self)
ic->ic_scan_start = rum_scan_start;
ic->ic_scan_end = rum_scan_end;
ic->ic_set_channel = rum_set_channel;
+   ic->ic_getradiocaps = rum_getradiocaps;
ic->ic_transmit = rum_transmit;
ic->ic_parent = rum_parent;
ic->ic_vap_create = rum_vap_create;
@@ -3165,6 +3171,26 @@ rum_set_channel(struct ieee80211com *ic)
RUM_UNLOCK(sc);
 }
 
+static void
+rum_getradiocaps(struct ieee80211com *ic,
+int maxchans, int *nchans, struct ieee80211_channel chans[])
+{
+   struct rum_softc *sc = ic->ic_softc;
+   uint8_t bands[IEEE80211_MODE_BYTES];
+
+   memset(bands, 0, sizeof(bands));
+   setbit(bands, IEEE80211_MODE_11B);
+   setbit(bands, IEEE80211_MODE_11G);
+   ieee80211_add_channel_list_2ghz(chans, maxchans, nchans,
+   rum_chan_2ghz, nitems(rum_chan_2ghz), bands, 0);
+
+   if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) {
+   setbit(bands, IEEE80211_MODE_11A);
+   ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
+   rum_chan_5ghz, nitems(rum_chan_5ghz), bands, 0);
+   }
+}
+
 static int
 rum_get_rssi(struct rum_softc *sc, uint8_t raw)
 {
___
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: r298896 - in head/lib: libedit libfetch libgssapi libkiconv libkvm libpmc libsdp libusb libvmmapi msun/src

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 19:37:33 2016
New Revision: 298896
URL: https://svnweb.freebsd.org/changeset/base/298896

Log:
  lib: minor spelling fixes in comments.
  
  No functional change.

Modified:
  head/lib/libedit/chartype.h
  head/lib/libedit/refresh.c
  head/lib/libfetch/common.c
  head/lib/libgssapi/gss_accept_sec_context.c
  head/lib/libkiconv/quirks.c
  head/lib/libkvm/kvm.c
  head/lib/libkvm/kvm_pcpu.c
  head/lib/libkvm/kvm_vnet.c
  head/lib/libpmc/libpmc.c
  head/lib/libsdp/sdp.h
  head/lib/libusb/libusb20_desc.c
  head/lib/libvmmapi/vmmapi.h
  head/lib/msun/src/k_rem_pio2.c
  head/lib/msun/src/s_cbrt.c

Modified: head/lib/libedit/chartype.h
==
--- head/lib/libedit/chartype.h Sun May  1 18:53:12 2016(r298895)
+++ head/lib/libedit/chartype.h Sun May  1 19:37:33 2016(r298896)
@@ -204,11 +204,11 @@ protected size_t ct_enc_width(Char);
 #endif
 
 #ifndef NARROWCHAR
-/* Encode a characted into the destination buffer, provided there is sufficent
+/* Encode a characted into the destination buffer, provided there is sufficient
  * buffer space available. Returns the number of bytes used up (zero if the
  * character cannot be encoded, -1 if there was not enough space available). */
 
-/* The maximum buffer size to hold the most unwieldly visual representation,
+/* The maximum buffer size to hold the most unwieldy visual representation,
  * in this case \U+n. */
 #define VISUAL_WIDTH_MAX ((size_t)8)
 

Modified: head/lib/libedit/refresh.c
==
--- head/lib/libedit/refresh.c  Sun May  1 18:53:12 2016(r298895)
+++ head/lib/libedit/refresh.c  Sun May  1 19:37:33 2016(r298896)
@@ -561,7 +561,7 @@ re_update_line(EditLine *el, Char *old, 
nls = ++n;
 
/*
- * find same begining and same end
+ * find same beginning and same end
  */
osb = ols;
nsb = nls;

Modified: head/lib/libfetch/common.c
==
--- head/lib/libfetch/common.c  Sun May  1 18:53:12 2016(r298895)
+++ head/lib/libfetch/common.c  Sun May  1 19:37:33 2016(r298896)
@@ -471,7 +471,7 @@ fetch_ssl_hname_match(const char *h, siz
if (!fetch_ssl_hname_equal(hdot - delta, delta,
mdot1 - delta, delta))
return (0);
-   /* all tests succeded, it's a match */
+   /* all tests succeeded, it's a match */
return (1);
 }
 
@@ -1349,7 +1349,7 @@ fetch_netrc_auth(struct url *url)
  * which the proxy should not be consulted; the contents is a comma-,
  * or space-separated list of domain names.  A single asterisk will
  * override all proxy variables and no transactions will be proxied
- * (for compatability with lynx and curl, see the discussion at
+ * (for compatibility with lynx and curl, see the discussion at
  * ).
  */
 int

Modified: head/lib/libgssapi/gss_accept_sec_context.c
==
--- head/lib/libgssapi/gss_accept_sec_context.c Sun May  1 18:53:12 2016
(r298895)
+++ head/lib/libgssapi/gss_accept_sec_context.c Sun May  1 19:37:33 2016
(r298896)
@@ -135,7 +135,7 @@ choose_mech(const gss_buffer_t input, gs
return (GSS_S_COMPLETE);
} else if (input->length == 0) {
/* 
-* There is the a wierd mode of SPNEGO (in CIFS and
+* There is the a weird mode of SPNEGO (in CIFS and
 * SASL GSS-SPENGO where the first token is zero
 * length and the acceptor returns a mech_list, lets
 * hope that is what is happening now.

Modified: head/lib/libkiconv/quirks.c
==
--- head/lib/libkiconv/quirks.c Sun May  1 18:53:12 2016(r298895)
+++ head/lib/libkiconv/quirks.c Sun May  1 19:37:33 2016(r298896)
@@ -41,10 +41,10 @@
  * 
  * For example, the eucJP and Unocode mapping rule is based on
  * the JIS standard. Since Microsoft uses cp932 for Unicode mapping
- * witch is not truly based on the JIS standard, reading a file
+ * which is not truly based on the JIS standard, reading a file
  * system created by Microsoft Windows family using eucJP/Unicode
  * mapping rule will cause a problem. That's why we define eucJP-ms here.
- * The eucJP-ms has been defined by The Open Group Japan Vendor Coucil.
+ * The eucJP-ms has been defined by The Open Group Japan Vendor Council.
  *
  * Well, Apple Mac OS also has their own Unicode mappings,
  * but we won't require these quirks here, because HFS doesn't have

Modified: head/lib/libkvm/kvm.c
==
--- head/lib/libkvm/kvm.c   Sun May  1 18:53:1

svn commit: r298897 - in head/libexec: ftpd rtld-elf

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 19:39:23 2016
New Revision: 298897
URL: https://svnweb.freebsd.org/changeset/base/298897

Log:
  libexec: minor spelling fixes in comments.
  
  No functional change.

Modified:
  head/libexec/ftpd/ftpd.c
  head/libexec/ftpd/popen.c
  head/libexec/rtld-elf/malloc.c
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/ftpd/ftpd.c
==
--- head/libexec/ftpd/ftpd.cSun May  1 19:37:33 2016(r298896)
+++ head/libexec/ftpd/ftpd.cSun May  1 19:39:23 2016(r298897)
@@ -2048,7 +2048,7 @@ pdata_err:
} while (0)
 
 /*
- * Tranfer the contents of "instr" to "outstr" peer using the appropriate
+ * Transfer the contents of "instr" to "outstr" peer using the appropriate
  * encapsulation of the data subject to Mode, Structure, and Type.
  *
  * NB: Form isn't handled.

Modified: head/libexec/ftpd/popen.c
==
--- head/libexec/ftpd/popen.c   Sun May  1 19:37:33 2016(r298896)
+++ head/libexec/ftpd/popen.c   Sun May  1 19:39:23 2016(r298897)
@@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
 #defineMAXGLOBARGS 1000
 
 /*
- * Special version of popen which avoids call to shell.  This ensures noone
+ * Special version of popen which avoids call to shell.  This ensures no one
  * may create a pipe to a hidden program as a side effect of a list or dir
  * command.
  */

Modified: head/libexec/rtld-elf/malloc.c
==
--- head/libexec/rtld-elf/malloc.c  Sun May  1 19:37:33 2016
(r298896)
+++ head/libexec/rtld-elf/malloc.c  Sun May  1 19:39:23 2016
(r298897)
@@ -328,7 +328,7 @@ free(cp)
  * old malloc man page, it realloc's an already freed block.  Usually
  * this is the last block it freed; occasionally it might be farther
  * back.  We have to search all the free lists for the block in order
- * to determine its bucket: 1st we make one pass thru the lists
+ * to determine its bucket: 1st we make one pass through the lists
  * checking only the first block in each; if that fails we search
  * ``realloc_srchlen'' blocks in each list for a match (the variable
  * is extern so the caller can modify it).  If that fails we just copy

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cSun May  1 19:37:33 2016
(r298896)
+++ head/libexec/rtld-elf/rtld.cSun May  1 19:39:23 2016
(r298897)
@@ -822,7 +822,7 @@ origin_subst_one(Obj_Entry *obj, char *r
kw_len = strlen(kw);
 
/*
-* First, count the number of the keyword occurences, to
+* First, count the number of the keyword occurrences, to
 * preallocate the final string.
 */
for (p = real, subst_count = 0;; p = p1 + kw_len, subst_count++) {
___
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: r298898 - head/lib/libc/sys

2016-05-01 Thread Konstantin Belousov
Author: kib
Date: Sun May  1 20:54:29 2016
New Revision: 298898
URL: https://svnweb.freebsd.org/changeset/base/298898

Log:
  As a reader service, explain NOTE_LINK reporting for the directories.
  
  Submitted by: Vladimir Kondratyev 
  MFC after:1 week

Modified:
  head/lib/libc/sys/kqueue.2

Modified: head/lib/libc/sys/kqueue.2
==
--- head/lib/libc/sys/kqueue.2  Sun May  1 19:39:23 2016(r298897)
+++ head/lib/libc/sys/kqueue.2  Sun May  1 20:54:29 2016(r298898)
@@ -381,6 +381,10 @@ The file referenced by the descriptor wa
 The file referenced by the descriptor had its attributes changed.
 .It Dv NOTE_LINK
 The link count on the file changed.
+In particular, the
+.Dv NOTE_LINK
+event is reported if a subdirectory was created or deleted inside
+the directory referenced by the descriptor.
 .It Dv NOTE_RENAME
 The file referenced by the descriptor was renamed.
 .It Dv NOTE_REVOKE
___
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: r298899 - head/sys/net80211

2016-05-01 Thread Andriy Voskoboinyk
Author: avos
Date: Sun May  1 20:57:10 2016
New Revision: 298899
URL: https://svnweb.freebsd.org/changeset/base/298899

Log:
  net80211: calculate IEEE80211_MODE_BYTES / IEEE80211_CHAN_BYTES
  instead of hardcoding it.
  
  Suggested by: adrian

Modified:
  head/sys/net80211/_ieee80211.h
  head/sys/net80211/ieee80211_freebsd.h

Modified: head/sys/net80211/_ieee80211.h
==
--- head/sys/net80211/_ieee80211.h  Sun May  1 20:54:29 2016
(r298898)
+++ head/sys/net80211/_ieee80211.h  Sun May  1 20:57:10 2016
(r298899)
@@ -70,7 +70,7 @@ enum ieee80211_phymode {
IEEE80211_MODE_QUARTER  = 11,   /* OFDM, 1/4x clock */
 };
 #defineIEEE80211_MODE_MAX  (IEEE80211_MODE_QUARTER+1)
-#defineIEEE80211_MODE_BYTES2   /* howmany(IEEE80211_MODE_MAX, 
NBBY) */
+#defineIEEE80211_MODE_BYTEShowmany(IEEE80211_MODE_MAX, NBBY)
 
 /*
  * Operating mode.  Devices do not necessarily support
@@ -147,7 +147,7 @@ struct ieee80211_channel {
 };
 
 #defineIEEE80211_CHAN_MAX  256
-#defineIEEE80211_CHAN_BYTES32  /* howmany(IEEE80211_CHAN_MAX, 
NBBY) */
+#defineIEEE80211_CHAN_BYTEShowmany(IEEE80211_CHAN_MAX, NBBY)
 #defineIEEE80211_CHAN_ANY  0x  /* token for ``any channel'' */
 #defineIEEE80211_CHAN_ANYC \
((struct ieee80211_channel *) IEEE80211_CHAN_ANY)

Modified: head/sys/net80211/ieee80211_freebsd.h
==
--- head/sys/net80211/ieee80211_freebsd.h   Sun May  1 20:54:29 2016
(r298898)
+++ head/sys/net80211/ieee80211_freebsd.h   Sun May  1 20:57:10 2016
(r298899)
@@ -28,7 +28,7 @@
 #define _NET80211_IEEE80211_FREEBSD_H_
 
 #ifdef _KERNEL
-#include 
+#include 
 #include 
 #include 
 #include 
___
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: r298900 - in head/sys/boot: common efi/libefi i386/libi386

2016-05-01 Thread Allan Jude
Author: allanjude
Date: Sun May  1 21:06:59 2016
New Revision: 298900
URL: https://svnweb.freebsd.org/changeset/base/298900

Log:
  bcache read ahead may attempt to read past end of disk
  
  The new bcache code does not know the size of the disk, and therefore may 
attempt to read past the end of the disk while trying to fill its read-ahead 
cache.
  
  This is usually not an issue, it fails gracefully on all of my machines, but 
some BIOSes seem to retry the reads for up to 30 seconds each, resulting in a 
long stall during boot
  
  Submitted by: Toomas Soome 
  Reviewed by:  jhb, np
  Differential Revision:https://reviews.freebsd.org/D6109

Modified:
  head/sys/boot/common/bcache.c
  head/sys/boot/efi/libefi/efipart.c
  head/sys/boot/i386/libi386/bioscd.c
  head/sys/boot/i386/libi386/biosdisk.c

Modified: head/sys/boot/common/bcache.c
==
--- head/sys/boot/common/bcache.c   Sun May  1 20:57:10 2016
(r298899)
+++ head/sys/boot/common/bcache.c   Sun May  1 21:06:59 2016
(r298900)
@@ -272,20 +272,43 @@ read_strategy(void *devdata, int rw, dad
 for (i = 0; i < p_size; i++) {
bcache_invalidate(bc, p_blk + i);
 }
+
 r_size = 0;
+/*
+ * with read-ahead, it may happen we are attempting to read past
+ * disk end, as bcache has no information about disk size.
+ * in such case we should get partial read if some blocks can be
+ * read or error, if no blocks can be read.
+ * in either case we should return the data in bcache and only
+ * return error if there is no data.
+ */
 result = dd->dv_strategy(dd->dv_devdata, rw, p_blk, 0,
p_size * bcache_blksize, p_buf, &r_size);
 
-if (result)
-   goto done;
-
 r_size /= bcache_blksize;
 for (i = 0; i < r_size; i++)
bcache_insert(bc, p_blk + i);
 
-bcache_rablks += ra;
-bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset, buf,
-   size);
+/* update ra statistics */
+if (r_size != 0) {
+   if (r_size < p_size)
+   bcache_rablks += (p_size - r_size);
+   else
+   bcache_rablks += ra;
+}
+
+/* check how much data can we copy */
+for (i = 0; i < nblk; i++) {
+   if (BCACHE_LOOKUP(bc, (daddr_t)(blk + i)))
+   break;
+}
+
+size = i * bcache_blksize;
+if (size != 0) {
+   bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)) + offset,
+   buf, size);
+   result = 0;
+}
 
  done:
 if ((result == 0) && (rsize != NULL))
@@ -349,8 +372,16 @@ bcache_strategy(void *devdata, int rw, d
 
ret = read_strategy(devdata, rw, blk, offset,
csize, buf+total, &isize);
-   if (ret != 0)
-   return (ret);
+
+   /*
+* we may have error from read ahead, if we have read some data
+* return partial read.
+*/
+   if (ret != 0 || isize == 0) {
+   if (total != 0)
+   ret = 0;
+   break;
+   }
blk += (offset+isize) / bcache_blksize;
offset = 0;
total += isize;

Modified: head/sys/boot/efi/libefi/efipart.c
==
--- head/sys/boot/efi/libefi/efipart.c  Sun May  1 20:57:10 2016
(r298899)
+++ head/sys/boot/efi/libefi/efipart.c  Sun May  1 21:06:59 2016
(r298900)
@@ -321,6 +321,15 @@ efipart_realstrategy(void *devdata, int 
if (size == 0 || (size % 512) != 0)
return (EIO);
 
+   off = blk * 512;
+   /* make sure we don't read past disk end */
+   if ((off + size) / blkio->Media->BlockSize - 1 >
+   blkio->Media->LastBlock) {
+   size = blkio->Media->LastBlock + 1 -
+   off / blkio->Media->BlockSize;
+   size = size * blkio->Media->BlockSize;
+   }
+
if (rsize != NULL)
*rsize = size;
 
@@ -335,7 +344,6 @@ efipart_realstrategy(void *devdata, int 
return (ENOMEM);
 
error = 0;
-   off = blk * 512;
blk = off / blkio->Media->BlockSize;
blkoff = off % blkio->Media->BlockSize;
blksz = blkio->Media->BlockSize - blkoff;

Modified: head/sys/boot/i386/libi386/bioscd.c
==
--- head/sys/boot/i386/libi386/bioscd.c Sun May  1 20:57:10 2016
(r298899)
+++ head/sys/boot/i386/libi386/bioscd.c Sun May  1 21:06:59 2016
(r298900)
@@ -271,14 +271,25 @@ bc_realstrategy(void *devdata, int rw, d
 
if (rsize)
*rsize = 0;
-   if (blks && bc_read(unit, dblk, blks, buf)) {
+   if ((blks = bc_read(unit, dblk, blks, buf)) < 0) {
DEBUG("read error");
return (EIO);
+   } else {
+   if (size / BIOSCD_SECSIZE > blks) {
+

svn commit: r298901 - head/sbin/restore

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Sun May  1 21:17:30 2016
New Revision: 298901
URL: https://svnweb.freebsd.org/changeset/base/298901

Log:
  restore: promote some getfiles() parameters to size_t.
  
  This is based on a change from OpenBSD:
  
  "Fix restore so that it can actually restore files larger than 4GB by
  changing the type of "size" to off_t in getfiles() plus little dependent
  type cleanup, from Daniel Lucq."
  
  It is an important for machines with 32 bit longs.
  While here unsign the flags, also from OpenBSD.
  
  Obtained from:OpenBSD (through bitrig, I hate CVS)
  MFC after:2 weeks

Modified:
  head/sbin/restore/dirs.c
  head/sbin/restore/extern.h
  head/sbin/restore/tape.c

Modified: head/sbin/restore/dirs.c
==
--- head/sbin/restore/dirs.cSun May  1 21:06:59 2016(r298900)
+++ head/sbin/restore/dirs.cSun May  1 21:17:30 2016(r298901)
@@ -85,7 +85,7 @@ struct modeinfo {
mode_t mode;
uid_t uid;
gid_t gid;
-   int flags;
+   u_int flags;
int extsize;
 };
 
@@ -115,8 +115,8 @@ static struct inotab*allocinotab(struct
 static void flushent(void);
 static struct inotab   *inotablookup(ino_t);
 static RST_DIR *opendirfile(const char *);
-static void putdir(char *, long);
-static void putdirattrs(char *, long);
+static void putdir(char *, size_t);
+static void putdirattrs(char *, size_t);
 static void putent(struct direct *);
 static void rst_seekdir(RST_DIR *, long, long);
 static long rst_telldir(RST_DIR *);
@@ -323,10 +323,10 @@ searchdir(ino_t   inum, char *name)
  * Put the directory entries in the directory file
  */
 static void
-putdir(char *buf, long size)
+putdir(char *buf, size_t size)
 {
struct direct *dp;
-   long loc, i;
+   size_t loc, i;
 
for (loc = 0; loc < size; ) {
dp = (struct direct *)(buf + loc);
@@ -356,12 +356,12 @@ putdir(char *buf, long size)
   "reclen not multiple of 4 ");
if (dp->d_reclen < DIRSIZ(0, dp))
vprintf(stdout,
-  "reclen less than DIRSIZ (%d < %zu) ",
+  "reclen less than DIRSIZ (%u < %zu) ",
   dp->d_reclen, DIRSIZ(0, dp));
 #if NAME_MAX < 255
if (dp->d_namlen > NAME_MAX)
vprintf(stdout,
-  "reclen name too big (%d > %d) ",
+  "reclen name too big (%u > %u) ",
   dp->d_namlen, NAME_MAX);
 #endif
vprintf(stdout, "\n");
@@ -418,7 +418,7 @@ flushent(void)
  * Save extended attributes for a directory entry to a file.
  */
 static void
-putdirattrs(char *buf, long size)
+putdirattrs(char *buf, size_t size)
 {
 
if (mf != NULL && fwrite(buf, size, 1, mf) != 1)

Modified: head/sbin/restore/extern.h
==
--- head/sbin/restore/extern.h  Sun May  1 21:06:59 2016(r298900)
+++ head/sbin/restore/extern.h  Sun May  1 21:17:30 2016(r298901)
@@ -54,8 +54,8 @@ void   freeentry(struct entry *);
 voidfreename(char *);
 int genliteraldir(char *, ino_t);
 char   *gentempname(struct entry *);
-voidgetfile(void (*)(char *, long), void (*)(char *, long),
-   void (*)(char *, long));
+voidgetfile(void (*)(char *, size_t), void (*)(char *, size_t),
+   void (*)(char *, size_t));
 voidgetvol(long);
 voidinitsymtable(char *);
 int inodetype(ino_t);
@@ -98,7 +98,7 @@ void   swabst(u_char *, u_char *);
 voidtreescan(char *, ino_t, long (*)(char *, ino_t, int));
 ino_t   upperbnd(ino_t);
 longverifyfile(char *, ino_t, int);
-voidxtrnull(char *, long);
+voidxtrnull(char *, size_t);
 
 /* From ../dump/dumprmt.c */
 void   rmtclose(void);

Modified: head/sbin/restore/tape.c
==
--- head/sbin/restore/tape.cSun May  1 21:06:59 2016(r298900)
+++ head/sbin/restore/tape.cSun May  1 21:17:30 2016(r298901)
@@ -104,10 +104,10 @@ static int checksum(int *);
 static void findinode(struct s_spcl *);
 static void findtapeblksize(void);
 static char*setupextattr(int);
-static void xtrattr(char *, long);
+static void xtrattr(char *, size_t);
 static void set_extattr_link(char *, void *, int);
 static void set_extattr_fd(int, char *, void *, int);
-static void skiphole(void (*)(char *, long), long *);
+static void skiphole

svn commit: r298902 - in head/sys: netinet netinet6

2016-05-01 Thread Michael Tuexen
Author: tuexen
Date: Sun May  1 21:48:55 2016
New Revision: 298902
URL: https://svnweb.freebsd.org/changeset/base/298902

Log:
  When a client uses UDP encapsulation and lists IP addresses in the INIT
  chunk, enable UDP encapsulation for all those addresses.
  This helps clients using a userland stack to support multihoming if
  they are not behind a NAT.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_pcb.h
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet6/sctp6_usrreq.c

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Sun May  1 21:17:30 2016
(r298901)
+++ head/sys/netinet/sctp_input.c   Sun May  1 21:48:55 2016
(r298902)
@@ -465,7 +465,7 @@ sctp_process_init_ack(struct mbuf *m, in
/* load all addresses */
if ((retval = sctp_load_addresses_from_init(stcb, m,
(offset + sizeof(struct sctp_init_chunk)), initack_limit,
-   src, dst, NULL))) {
+   src, dst, NULL, stcb->asoc.port))) {
op_err = 
sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
"Problem with address parameters");
SCTPDBG(SCTP_DEBUG_INPUT1,
@@ -1672,7 +1672,7 @@ sctp_process_cookie_existing(struct mbuf
 */
if (sctp_load_addresses_from_init(stcb, m,
init_offset + sizeof(struct sctp_init_chunk),
-   initack_offset, src, dst, init_src)) {
+   initack_offset, src, dst, init_src, stcb->asoc.port)) {
if (how_indx < sizeof(asoc->cookie_how))
asoc->cookie_how[how_indx] = 4;
return (NULL);
@@ -1799,7 +1799,7 @@ sctp_process_cookie_existing(struct mbuf
}
if (sctp_load_addresses_from_init(stcb, m,
init_offset + sizeof(struct sctp_init_chunk),
-   initack_offset, src, dst, init_src)) {
+   initack_offset, src, dst, init_src, stcb->asoc.port)) {
if (how_indx < sizeof(asoc->cookie_how))
asoc->cookie_how[how_indx] = 10;
return (NULL);
@@ -2011,7 +2011,7 @@ sctp_process_cookie_existing(struct mbuf
 
if (sctp_load_addresses_from_init(stcb, m,
init_offset + sizeof(struct sctp_init_chunk),
-   initack_offset, src, dst, init_src)) {
+   initack_offset, src, dst, init_src, stcb->asoc.port)) {
if (how_indx < sizeof(asoc->cookie_how))
asoc->cookie_how[how_indx] = 14;
 
@@ -2123,6 +2123,7 @@ sctp_process_cookie_new(struct mbuf *m, 
stcb = sctp_aloc_assoc(inp, init_src, &error,
ntohl(initack_cp->init.initiate_tag), vrf_id,
ntohs(initack_cp->init.num_outbound_streams),
+   port,
(struct thread *)NULL
);
if (stcb == NULL) {
@@ -2212,7 +2213,7 @@ sctp_process_cookie_new(struct mbuf *m, 
/* load all addresses */
if (sctp_load_addresses_from_init(stcb, m,
init_offset + sizeof(struct sctp_init_chunk), initack_offset,
-   src, dst, init_src)) {
+   src, dst, init_src, port)) {
atomic_add_int(&stcb->asoc.refcnt, 1);
 #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
SCTP_TCB_UNLOCK(stcb);
@@ -2371,12 +2372,6 @@ sctp_process_cookie_new(struct mbuf *m, 
(*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp,
&cookie->time_entered, sctp_align_unsafe_makecopy,
SCTP_RTT_FROM_NON_DATA);
-#if defined(INET) || defined(INET6)
-   if (((*netp)->port == 0) && (port != 0)) {
-   sctp_pathmtu_adjustment(stcb, (uint16_t) ((*netp)->mtu 
- sizeof(struct udphdr)));
-   }
-   (*netp)->port = port;
-#endif
}
/* respond with a COOKIE-ACK */
sctp_send_cookie_ack(stcb);
@@ -2718,7 +2713,7 @@ sctp_handle_cookie_echo(struct mbuf *m, 
 */
if (netl == NULL) {
/* TSNH! Huh, why do I need to add this address here? */
-   if (sctp_add_remote_addr(*stcb, to, NULL, (*stcb)->asoc.port,
+   if (sctp_add_remote_addr(*stcb, to, NULL, port,
SCTP_DONOT_SETSCOPE, SCTP_IN_COOKIE_PROC)) {
return (NULL);
}

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Sun May  1 21:17:30 2016
(r298901)
+++ head/sys/netinet/sctp_output.c  Sun May  1 21:48:55 2016
(r298902)
@@ -12765,8 +12765,8 @@ sctp_lower_sosend(struct socke

svn commit: r298903 - head/sys/dev/iwn

2016-05-01 Thread Andriy Voskoboinyk
Author: avos
Date: Sun May  1 22:00:40 2016
New Revision: 298903
URL: https://svnweb.freebsd.org/changeset/base/298903

Log:
  iwn: switch to ieee80211_add_channel*()
  
  Switch to add_channel / add_channel_ht40 + pass channel's TX power
  for the last.
  
  Tested by:dhw
  Reviewed by:  adrian
  Differential Revision:https://reviews.freebsd.org/D6141

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Sun May  1 21:48:55 2016(r298902)
+++ head/sys/dev/iwn/if_iwn.c   Sun May  1 22:00:40 2016(r298903)
@@ -2381,12 +2381,24 @@ iwn_read_eeprom_band(struct iwn_softc *s
 {
struct iwn_eeprom_chan *channels = sc->eeprom_channels[n];
const struct iwn_chan_band *band = &iwn_bands[n];
-   struct ieee80211_channel *c;
+   uint8_t bands[IEEE80211_MODE_BYTES];
uint8_t chan;
-   int i, nflags;
+   int i, error, nflags;
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
 
+   memset(bands, 0, sizeof(bands));
+   if (n == 0) {
+   setbit(bands, IEEE80211_MODE_11B);
+   setbit(bands, IEEE80211_MODE_11G);
+   if (sc->sc_flags & IWN_FLAG_HAS_11N)
+   setbit(bands, IEEE80211_MODE_11NG);
+   } else {
+   setbit(bands, IEEE80211_MODE_11A);
+   if (sc->sc_flags & IWN_FLAG_HAS_11N)
+   setbit(bands, IEEE80211_MODE_11NA);
+   }
+
for (i = 0; i < band->nchan; i++) {
if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) {
DPRINTF(sc, IWN_DEBUG_RESET,
@@ -2396,49 +2408,20 @@ iwn_read_eeprom_band(struct iwn_softc *s
continue;
}
 
-   if (*nchans >= maxchans)
-   break;
-
chan = band->chan[i];
nflags = iwn_eeprom_channel_flags(&channels[i]);
-
-   c = &chans[(*nchans)++];
-   c->ic_ieee = chan;
-   c->ic_maxregpower = channels[i].maxpwr;
-   c->ic_maxpower = 2*c->ic_maxregpower;
-
-   if (n == 0) {   /* 2GHz band */
-   c->ic_freq = ieee80211_ieee2mhz(chan, IEEE80211_CHAN_G);
-   /* G =>'s B is supported */
-   c->ic_flags = IEEE80211_CHAN_B | nflags;
-
-   if (*nchans >= maxchans)
-   break;
-
-   c = &chans[(*nchans)++];
-   c[0] = c[-1];
-   c->ic_flags = IEEE80211_CHAN_G | nflags;
-   } else {/* 5GHz band */
-   c->ic_freq = ieee80211_ieee2mhz(chan, IEEE80211_CHAN_A);
-   c->ic_flags = IEEE80211_CHAN_A | nflags;
-   }
+   error = ieee80211_add_channel(chans, maxchans, nchans,
+   chan, 0, channels[i].maxpwr, nflags, bands);
+   if (error != 0)
+   break;
 
/* Save maximum allowed TX power for this channel. */
+   /* XXX wrong */
sc->maxpwr[chan] = channels[i].maxpwr;
 
DPRINTF(sc, IWN_DEBUG_RESET,
"add chan %d flags 0x%x maxpwr %d\n", chan,
channels[i].flags, channels[i].maxpwr);
-
-   if (sc->sc_flags & IWN_FLAG_HAS_11N) {
-   if (*nchans >= maxchans)
-   break;
-
-   /* add HT20, HT40 added separately */
-   c = &chans[(*nchans)++];
-   c[0] = c[-1];
-   c->ic_flags |= IEEE80211_CHAN_HT20;
-   }
}
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);
@@ -2449,12 +2432,10 @@ static void
 iwn_read_eeprom_ht40(struct iwn_softc *sc, int n, int maxchans, int *nchans,
 struct ieee80211_channel chans[])
 {
-   struct ieee80211com *ic = &sc->sc_ic;
struct iwn_eeprom_chan *channels = sc->eeprom_channels[n];
const struct iwn_chan_band *band = &iwn_bands[n];
-   struct ieee80211_channel *c, *cent, *extc;
uint8_t chan;
-   int i, nflags;
+   int i, error, nflags;
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s start\n", __func__);
 
@@ -2472,46 +2453,33 @@ iwn_read_eeprom_ht40(struct iwn_softc *s
continue;
}
 
-   if (*nchans + 1 >= maxchans)
-   break;
-
chan = band->chan[i];
nflags = iwn_eeprom_channel_flags(&channels[i]);
-
-   /*
-* Each entry defines an HT40 channel pair; find the
-* center channel, then the extension channel above.
-*/
-   cent = ieee80211_find_channel_byieee(ic, chan,
-   (n == 5 ? IEEE80211_CHAN_G 

svn commit: r298904 - in head/share/man: man4 man9

2016-05-01 Thread Warren Block
Author: wblock (doc committer)
Date: Sun May  1 22:00:41 2016
New Revision: 298904
URL: https://svnweb.freebsd.org/changeset/base/298904

Log:
  Spelling fixes supplied by pfg@, detected with codespell, plus
  additional misspellings detected by igor.
  
  MFC after:1 week

Modified:
  head/share/man/man4/cxgbe.4
  head/share/man/man4/ds3231.4
  head/share/man/man4/ng_car.4
  head/share/man/man4/ng_nat.4
  head/share/man/man4/random.4
  head/share/man/man4/uplcom.4
  head/share/man/man9/counter.9
  head/share/man/man9/fpu_kern.9
  head/share/man/man9/hash.9
  head/share/man/man9/lock.9
  head/share/man/man9/pci.9
  head/share/man/man9/sysctl.9
  head/share/man/man9/timeout.9
  head/share/man/man9/zone.9

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Sun May  1 22:00:40 2016(r298903)
+++ head/share/man/man4/cxgbe.4 Sun May  1 22:00:41 2016(r298904)
@@ -236,7 +236,7 @@ long as it is compatible with the driver
 the one already on the card.
 The default is 1.
 .It Va hw.cxgbe.fl_pktshift
-The number of bytes of padding inserted before the begining of an Ethernet
+The number of bytes of padding inserted before the beginning of an Ethernet
 frame in the receive buffer.
 The default value of 2 ensures that the Ethernet payload (usually the IP 
header)
 is at a 4 byte aligned address.

Modified: head/share/man/man4/ds3231.4
==
--- head/share/man/man4/ds3231.4Sun May  1 22:00:40 2016
(r298903)
+++ head/share/man/man4/ds3231.4Sun May  1 22:00:41 2016
(r298904)
@@ -65,9 +65,9 @@ dev.ds3231.0.32khz_enable: 1
 .It Va dev.ds3231.%d.temperature
 The read-only value of the current temperature read by the RTC.
 .It Va dev.ds3231.%d.temp_conv
-Start a new temperature convertion.
+Start a new temperature conversion.
 When read as 1, a temperature conversion is in progress.
-When read as 0 and then set to 1, a temperature convertion is started.
+When read as 0 and then set to 1, a temperature conversion is started.
 The temperature conversion runs automatically on power up and once every 64
 seconds afterward.
 .It Va dev.ds3231.%d.bbsqw

Modified: head/share/man/man4/ng_car.4
==
--- head/share/man/man4/ng_car.4Sun May  1 22:00:40 2016
(r298903)
+++ head/share/man/man4/ng_car.4Sun May  1 22:00:41 2016
(r298904)
@@ -123,9 +123,9 @@ Return current node configuration as
 .Vt "struct ng_car_bulkconf"
 .Bd -literal
 struct ng_car_hookconf {
-   uint64_t cbs;   /* Commited burst size (bytes) */
+   uint64_t cbs;   /* Committed burst size (bytes) */
uint64_t ebs;   /* Exceeded/Peak burst size (bytes) */
-   uint64_t cir;   /* Commited information rate (bits/s) */
+   uint64_t cir;   /* Committed information rate (bits/s) */
uint64_t pir;   /* Peak information rate (bits/s) */
uint8_t  green_action;  /* Action for green packets */
uint8_t  yellow_action; /* Action for yellow packets */
@@ -162,7 +162,7 @@ Return node statistics as
 .Bd -literal
 struct ng_car_hookstats {
uint64_t passed_pkts;   /* Counter for passed packets */
-   uint64_t droped_pkts;   /* Counter for droped packets */
+   uint64_t droped_pkts;   /* Counter for dropped packets */
uint64_t green_pkts;/* Counter for green packets */
uint64_t yellow_pkts;   /* Counter for yellow packets */
uint64_t red_pkts;  /* Counter for red packets */

Modified: head/share/man/man4/ng_nat.4
==
--- head/share/man/man4/ng_nat.4Sun May  1 22:00:40 2016
(r298903)
+++ head/share/man/man4/ng_nat.4Sun May  1 22:00:41 2016
(r298904)
@@ -259,7 +259,7 @@ struct ng_nat_libalias_info {
 .Ed
 In case of
 .Nm
-failed to retreive a certain counter
+failed to retrieve a certain counter
 from its
 .Xr libalias
 instance, the corresponding field is returned as

Modified: head/share/man/man4/random.4
==
--- head/share/man/man4/random.4Sun May  1 22:00:40 2016
(r298903)
+++ head/share/man/man4/random.4Sun May  1 22:00:41 2016
(r298904)
@@ -113,7 +113,7 @@ all settings are read-only.
 The
 .Pa kern.random.fortuna.minpoolsize
 sysctl is used
-to set the seed threshhold.
+to set the seed threshold.
 A smaller number gives a faster seed,
 but a less secure one.
 In practice,

Modified: head/share/man/man4/uplcom.4
==
--- head/share/man/man4/uplcom.4Sun May  1 22:00:40 2016
(r298903)
+++ head/share/man/man4/uplcom.4Sun May

svn commit: r298905 - head/sbin/growfs

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 00:44:19 2016
New Revision: 298905
URL: https://svnweb.freebsd.org/changeset/base/298905

Log:
  Use MIN() macro from sys/param.h.
  
  Reviewed by:  trasz
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D6119

Modified:
  head/sbin/growfs/growfs.c

Modified: head/sbin/growfs/growfs.c
==
--- head/sbin/growfs/growfs.c   Sun May  1 22:00:41 2016(r298904)
+++ head/sbin/growfs/growfs.c   Mon May  2 00:44:19 2016(r298905)
@@ -348,8 +348,7 @@ initcg(int cylno, time_t modtime, int fs
acg.cg_magic = CG_MAGIC;
acg.cg_cgx = cylno;
acg.cg_niblk = sblock.fs_ipg;
-   acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ?
-   sblock.fs_ipg : 2 * INOPB(&sblock);
+   acg.cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock));
acg.cg_ndblk = dmax - cbase;
if (sblock.fs_contigsumsize > 0)
acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag;
___
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: r298906 - head/sbin/newfs

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 00:45:46 2016
New Revision: 298906
URL: https://svnweb.freebsd.org/changeset/base/298906

Log:
  Use MIN()/MAX() macros from sys/param.h.
  
  Reviewed by:  trasz
  MFC after:2 weeks.
  Differential Revision:https://reviews.freebsd.org/D6118

Modified:
  head/sbin/newfs/mkfs.c

Modified: head/sbin/newfs/mkfs.c
==
--- head/sbin/newfs/mkfs.c  Mon May  2 00:44:19 2016(r298905)
+++ head/sbin/newfs/mkfs.c  Mon May  2 00:45:46 2016(r298906)
@@ -613,8 +613,7 @@ restart:
}
for (i = 0; i < sblock.fs_cssize; i += sblock.fs_bsize)
wtfs(fsbtodb(&sblock, sblock.fs_csaddr + numfrags(&sblock, i)),
-   sblock.fs_cssize - i < sblock.fs_bsize ?
-   sblock.fs_cssize - i : sblock.fs_bsize,
+   MIN(sblock.fs_cssize - i, sblock.fs_bsize),
((char *)fscs) + i);
/*
 * Update information about this partition in pack
@@ -660,8 +659,7 @@ initcg(int cylno, time_t utime)
acg.cg_magic = CG_MAGIC;
acg.cg_cgx = cylno;
acg.cg_niblk = sblock.fs_ipg;
-   acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ?
-   sblock.fs_ipg : 2 * INOPB(&sblock);
+   acg.cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock));
acg.cg_ndblk = dmax - cbase;
if (sblock.fs_contigsumsize > 0)
acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag;
@@ -771,7 +769,7 @@ initcg(int cylno, time_t utime)
 * Write out the duplicate super block, the cylinder group map
 * and two blocks worth of inodes in a single write.
 */
-   start = sblock.fs_bsize > SBLOCKSIZE ? sblock.fs_bsize : SBLOCKSIZE;
+   start = MAX(sblock.fs_bsize, SBLOCKSIZE);
bcopy((char *)&acg, &iobuf[start], sblock.fs_cgsize);
start += sblock.fs_bsize;
dp1 = (struct ufs1_dinode *)(&iobuf[start]);
___
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: r298907 - head/sbin/fsck_ffs

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 01:28:21 2016
New Revision: 298907
URL: https://svnweb.freebsd.org/changeset/base/298907

Log:
  Use MIN/MAX macros from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/sbin/fsck_ffs/fsutil.c
  head/sbin/fsck_ffs/inode.c
  head/sbin/fsck_ffs/pass2.c
  head/sbin/fsck_ffs/setup.c

Modified: head/sbin/fsck_ffs/fsutil.c
==
--- head/sbin/fsck_ffs/fsutil.c Mon May  2 00:45:46 2016(r298906)
+++ head/sbin/fsck_ffs/fsutil.c Mon May  2 01:28:21 2016(r298907)
@@ -365,8 +365,7 @@ flush(int fd, struct bufarea *bp)
for (i = 0, j = 0; i < sblock.fs_cssize; i += sblock.fs_bsize, j++) {
blwrite(fswritefd, (char *)sblock.fs_csp + i,
fsbtodb(&sblock, sblock.fs_csaddr + j * sblock.fs_frag),
-   sblock.fs_cssize - i < sblock.fs_bsize ?
-   sblock.fs_cssize - i : sblock.fs_bsize);
+   MIN(sblock.fs_cssize - i, sblock.fs_bsize));
}
 }
 
@@ -673,7 +672,7 @@ blzero(int fd, ufs2_daddr_t blk, long si
if (lseek(fd, offset, 0) < 0)
rwerror("SEEK BLK", blk);
while (size > 0) {
-   len = size > ZEROBUFSIZE ? ZEROBUFSIZE : size;
+   len = MIN(ZEROBUFSIZE, size);
if (write(fd, zero, len) != len)
rwerror("WRITE BLK", blk);
blk += len / dev_bsize;
@@ -718,8 +717,7 @@ check_cgmagic(int cg, struct bufarea *cg
cgp->cg_magic = CG_MAGIC;
cgp->cg_cgx = cg;
cgp->cg_niblk = sblock.fs_ipg;
-   cgp->cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ?
-   sblock.fs_ipg : 2 * INOPB(&sblock);
+   cgp->cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock));
if (cgbase(&sblock, cg) + sblock.fs_fpg < sblock.fs_size)
cgp->cg_ndblk = sblock.fs_fpg;
else

Modified: head/sbin/fsck_ffs/inode.c
==
--- head/sbin/fsck_ffs/inode.c  Mon May  2 00:45:46 2016(r298906)
+++ head/sbin/fsck_ffs/inode.c  Mon May  2 01:28:21 2016(r298907)
@@ -465,7 +465,7 @@ cacheino(union dinode *dp, ino_t inumber
inp->i_number = inumber;
inp->i_isize = DIP(dp, di_size);
inp->i_numblks = blks;
-   for (i = 0; i < (blks < NDADDR ? blks : NDADDR); i++)
+   for (i = 0; i < MIN(blks, NDADDR); i++)
inp->i_blks[i] = DIP(dp, di_db[i]);
if (blks > NDADDR)
for (i = 0; i < NIADDR; i++)

Modified: head/sbin/fsck_ffs/pass2.c
==
--- head/sbin/fsck_ffs/pass2.c  Mon May  2 00:45:46 2016(r298906)
+++ head/sbin/fsck_ffs/pass2.c  Mon May  2 01:28:21 2016(r298907)
@@ -182,9 +182,7 @@ pass2(void)
memset(dp, 0, sizeof(struct ufs2_dinode));
DIP_SET(dp, di_mode, IFDIR);
DIP_SET(dp, di_size, inp->i_isize);
-   for (i = 0;
-i < (inp->i_numblksi_numblks : NDADDR);
-i++)
+   for (i = 0; i < MIN(inp->i_numblks, NDADDR); i++)
DIP_SET(dp, di_db[i], inp->i_blks[i]);
if (inp->i_numblks > NDADDR)
for (i = 0; i < NIADDR; i++)

Modified: head/sbin/fsck_ffs/setup.c
==
--- head/sbin/fsck_ffs/setup.c  Mon May  2 00:45:46 2016(r298906)
+++ head/sbin/fsck_ffs/setup.c  Mon May  2 01:28:21 2016(r298907)
@@ -245,8 +245,7 @@ setup(char *dev)
goto badsb;
}
for (i = 0, j = 0; i < sblock.fs_cssize; i += sblock.fs_bsize, j++) {
-   size = sblock.fs_cssize - i < sblock.fs_bsize ?
-   sblock.fs_cssize - i : sblock.fs_bsize;
+   size = MIN(sblock.fs_cssize - i, sblock.fs_bsize);
readcnt[sblk.b_type]++;
if (blread(fsreadfd, (char *)sblock.fs_csp + i,
fsbtodb(&sblock, sblock.fs_csaddr + j * sblock.fs_frag),
___
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: r298908 - head/sbin/dumpfs

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 01:40:31 2016
New Revision: 298908
URL: https://svnweb.freebsd.org/changeset/base/298908

Log:
  Use MIN macro from sys/param.h.
  
  MFC after:2 weeks

Modified:
  head/sbin/dumpfs/dumpfs.c

Modified: head/sbin/dumpfs/dumpfs.c
==
--- head/sbin/dumpfs/dumpfs.c   Mon May  2 01:28:21 2016(r298907)
+++ head/sbin/dumpfs/dumpfs.c   Mon May  2 01:40:31 2016(r298908)
@@ -353,8 +353,7 @@ dumpcg(void)
for (i = 1; i < afs.fs_contigsumsize; i++) {
if ((i - 1) % 8 == 0)
printf("\nclusters %d-%d:", i,
-   afs.fs_contigsumsize - 1 < i + 7 ?
-   afs.fs_contigsumsize - 1 : i + 7);
+   MIN(afs.fs_contigsumsize - 1, i + 7));
printf("\t%d", cg_clustersum(&acg)[i]);
}
printf("\nclusters size %d and over: %d\n",
___
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: r298909 - head/usr.sbin/inetd

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 01:43:22 2016
New Revision: 298909
URL: https://svnweb.freebsd.org/changeset/base/298909

Log:
  Use MAX macro from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/usr.sbin/inetd/inetd.c

Modified: head/usr.sbin/inetd/inetd.c
==
--- head/usr.sbin/inetd/inetd.c Mon May  2 01:40:31 2016(r298908)
+++ head/usr.sbin/inetd/inetd.c Mon May  2 01:43:22 2016(r298909)
@@ -1934,7 +1934,7 @@ more:
if (sep->se_bi && sep->se_bi->bi_maxchild >= 0)
sep->se_maxchild = sep->se_bi->bi_maxchild;
else if (sep->se_accept) 
-   sep->se_maxchild = maxchild > 0 ? maxchild : 0;
+   sep->se_maxchild = MAX(maxchild, 0);
else
sep->se_maxchild = 1;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r298910 - head/usr.sbin/lpr/lpc

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 01:45:52 2016
New Revision: 298910
URL: https://svnweb.freebsd.org/changeset/base/298910

Log:
  Use MIN macro from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/usr.sbin/lpr/lpc/lpc.c

Modified: head/usr.sbin/lpr/lpc/lpc.c
==
--- head/usr.sbin/lpr/lpc/lpc.c Mon May  2 01:43:22 2016(r298909)
+++ head/usr.sbin/lpr/lpc/lpc.c Mon May  2 01:45:52 2016(r298910)
@@ -182,7 +182,7 @@ cmdscanner(void)
if ((bp = el_gets(el, &num)) == NULL || num == 0)
quit(0, NULL);
 
-   len = (num > MAX_CMDLINE - 1) ? MAX_CMDLINE - 1 : num;
+   len = MIN(MAX_CMDLINE - 1, num);
memcpy(cmdline, bp, len);
cmdline[len] = 0; 
history(hist, &he, H_ENTER, bp);
___
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: r298911 - head/usr.sbin/makefs/ffs

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 01:47:13 2016
New Revision: 298911
URL: https://svnweb.freebsd.org/changeset/base/298911

Log:
  Use MIN/MAX macros from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/usr.sbin/makefs/ffs/mkfs.c

Modified: head/usr.sbin/makefs/ffs/mkfs.c
==
--- head/usr.sbin/makefs/ffs/mkfs.c Mon May  2 01:45:52 2016
(r298910)
+++ head/usr.sbin/makefs/ffs/mkfs.c Mon May  2 01:47:13 2016
(r298911)
@@ -610,8 +610,7 @@ initcg(int cylno, time_t utime, const fs
acg.cg_magic = CG_MAGIC;
acg.cg_cgx = cylno;
acg.cg_niblk = sblock.fs_ipg;
-   acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ?
-   sblock.fs_ipg : 2 * INOPB(&sblock);
+   acg.cg_initediblk = MIN(sblock.fs_ipg, 2 * INOPB(&sblock));
acg.cg_ndblk = dmax - cbase;
if (sblock.fs_contigsumsize > 0)
acg.cg_nclusterblks = acg.cg_ndblk >> sblock.fs_fragshift;
@@ -730,7 +729,7 @@ initcg(int cylno, time_t utime, const fs
 * Write out the duplicate super block, the cylinder group map
 * and two blocks worth of inodes in a single write.
 */
-   start = sblock.fs_bsize > SBLOCKSIZE ? sblock.fs_bsize : SBLOCKSIZE;
+   start = MAX(sblock.fs_bsize, SBLOCKSIZE);
memcpy(&iobuf[start], &acg, sblock.fs_cgsize);
if (fsopts->needswap)
ffs_cg_swap(&acg, (struct cg*)&iobuf[start], &sblock);
___
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: r298912 - head/usr.sbin/mountd

2016-05-01 Thread Marcelo Araujo
Author: araujo
Date: Mon May  2 01:49:42 2016
New Revision: 298912
URL: https://svnweb.freebsd.org/changeset/base/298912

Log:
  Use MIN macro from sys/param.h.
  
  MFC after:2 weeks.

Modified:
  head/usr.sbin/mountd/mountd.c

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Mon May  2 01:47:13 2016
(r298911)
+++ head/usr.sbin/mountd/mountd.c   Mon May  2 01:49:42 2016
(r298912)
@@ -3171,7 +3171,7 @@ makemask(struct sockaddr_storage *ssp, i
return (-1);
 
for (i = 0; i < len; i++) {
-   bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen;
+   bits = MIN(CHAR_BIT, bitlen);
*p++ = (u_char)~0 << (CHAR_BIT - bits);
bitlen -= bits;
}
___
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: r298913 - head/usr.sbin/quot

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Mon May  2 02:13:22 2016
New Revision: 298913
URL: https://svnweb.freebsd.org/changeset/base/298913

Log:
  quot: make use of our rounddown() macro when  is available.
  
  No functional change.

Modified:
  head/usr.sbin/quot/quot.c

Modified: head/usr.sbin/quot/quot.c
==
--- head/usr.sbin/quot/quot.c   Mon May  2 01:49:42 2016(r298912)
+++ head/usr.sbin/quot/quot.c   Mon May  2 02:13:22 2016(r298913)
@@ -142,7 +142,7 @@ get_inode(int fd, struct fs *super, ino_
if (!ipbuf
&& !(ipbuf = malloc(INOSZ(super
errx(1, "allocate inodes");
-   last = (ino / INOCNT(super)) * INOCNT(super);
+   last = rounddown(ino, INOCNT(super));
if (lseek(fd, (off_t)ino_to_fsba(super, last) << 
super->fs_fshift, 0) < (off_t)0
|| read(fd, ipbuf, INOSZ(super)) != (ssize_t)INOSZ(super))
err(1, "read inodes");
@@ -414,7 +414,7 @@ dofsizes(int fd, struct fs *super, char 
errx(1, "allocate fsize structure");
fp->fsz_next = *fsp;
*fsp = fp;
-   fp->fsz_first = (ksz / FSZCNT) * FSZCNT;
+   fp->fsz_first = rounddown(ksz, FSZCNT);
fp->fsz_last = fp->fsz_first + FSZCNT;
for (i = FSZCNT; --i >= 0;) {
fp->fsz_count[i] = 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: r298914 - head/usr.sbin/rpcbind

2016-05-01 Thread Pedro F. Giffuni
Author: pfg
Date: Mon May  2 02:15:05 2016
New Revision: 298914
URL: https://svnweb.freebsd.org/changeset/base/298914

Log:
  rpcbind: use our roundup() macro when available through .
  
  No functional change.

Modified:
  head/usr.sbin/rpcbind/rpcb_svc_com.c

Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c
==
--- head/usr.sbin/rpcbind/rpcb_svc_com.cMon May  2 02:13:22 2016
(r298913)
+++ head/usr.sbin/rpcbind/rpcb_svc_com.cMon May  2 02:15:05 2016
(r298914)
@@ -634,7 +634,7 @@ rpcbproc_callit_com(struct svc_req *rqst
/*
 * Should be multiple of 4 for XDR.
 */
-   sendsz = ((sendsz + 3) / 4) * 4;
+   sendsz = roundup(sendsz, 4);
if (sendsz > RPC_BUF_MAX) {
 #ifdef notyet
buf_alloc = alloca(sendsz); /* not in IDR2? */
___
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: r298915 - head/sys/dev/mwl

2016-05-01 Thread Adrian Chadd
Author: adrian
Date: Mon May  2 04:15:15 2016
New Revision: 298915
URL: https://svnweb.freebsd.org/changeset/base/298915

Log:
  [mwl] s/struct device/device_t/
  
  Submitted by: kmacy

Modified:
  head/sys/dev/mwl/if_mwlvar.h
  head/sys/dev/mwl/mwlhal.h

Modified: head/sys/dev/mwl/if_mwlvar.h
==
--- head/sys/dev/mwl/if_mwlvar.hMon May  2 02:15:05 2016
(r298914)
+++ head/sys/dev/mwl/if_mwlvar.hMon May  2 04:15:15 2016
(r298915)
@@ -37,6 +37,7 @@
 #define _DEV_MWL_MVVAR_H
 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/mwl/mwlhal.h
==
--- head/sys/dev/mwl/mwlhal.h   Mon May  2 02:15:05 2016(r298914)
+++ head/sys/dev/mwl/mwlhal.h   Mon May  2 04:15:15 2016(r298915)
@@ -71,15 +71,13 @@ enum {
MWL_WME_AC_VO   = 3,/* voice access category */
 };
 
-struct device;
-
 struct mwl_hal {
bus_space_handle_t mh_ioh;  /* BAR 1 copied from softc */
bus_space_tag_t mh_iot;
uint32_tmh_imask;   /* interrupt mask */
/* remainder is opaque to driver */
 };
-struct mwl_hal *mwl_hal_attach(struct device *dev, uint16_t devid,
+struct mwl_hal *mwl_hal_attach(device_t dev, uint16_t devid,
 bus_space_handle_t ioh, bus_space_tag_t iot, bus_dma_tag_t tag);
 void   mwl_hal_detach(struct mwl_hal *);
 
___
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: r298918 - head/sys/dev/usb/net

2016-05-01 Thread Adrian Chadd
Author: adrian
Date: Mon May  2 05:37:25 2016
New Revision: 298918
URL: https://svnweb.freebsd.org/changeset/base/298918

Log:
  s/struct device */device_t/
  
  Submitted by: kmacy

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

Modified: head/sys/dev/usb/net/if_mos.c
==
--- head/sys/dev/usb/net/if_mos.c   Mon May  2 05:29:28 2016
(r298917)
+++ head/sys/dev/usb/net/if_mos.c   Mon May  2 05:37:25 2016
(r298918)
@@ -418,7 +418,7 @@ mos_write_mcast(struct mos_softc *sc, u_
 }
 
 static int
-mos_miibus_readreg(struct device *dev, int phy, int reg)
+mos_miibus_readreg(device_t dev, int phy, int reg)
 {
struct mos_softc *sc = device_get_softc(dev);
uWord val;
___
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: r298919 - head/sys/dev/otus

2016-05-01 Thread Adrian Chadd
Author: adrian
Date: Mon May  2 05:43:46 2016
New Revision: 298919
URL: https://svnweb.freebsd.org/changeset/base/298919

Log:
  [otus] implement monitor mode.
  
  * break out the operating mode and rx filter into new functions, rather
than them being hard-coded
  * if we're in sniffer mode or not associated, set the BSS MAC to all zero,
rather than relying on a chip reset to do it for us
  * add comments about .. how interestingly buggy the chip is.
  
  Tested:
  
  * AR9170 + AR9102, STA+monitor mode
  
  Obtained from:linux carl9170 (general chip workings, constant 
definitions)

Modified:
  head/sys/dev/otus/if_otus.c

Modified: head/sys/dev/otus/if_otus.c
==
--- head/sys/dev/otus/if_otus.c Mon May  2 05:37:25 2016(r298918)
+++ head/sys/dev/otus/if_otus.c Mon May  2 05:43:46 2016(r298919)
@@ -181,6 +181,8 @@ int otus_set_multi(struct otus_softc *)
 static int otus_updateedca(struct ieee80211com *);
 static voidotus_updateedca_locked(struct otus_softc *);
 static voidotus_updateslot(struct otus_softc *);
+static voidotus_set_operating_mode(struct otus_softc *sc);
+static voidotus_set_rx_filter(struct otus_softc *sc);
 intotus_init_mac(struct otus_softc *);
 uint32_t   otus_phy_get_def(struct otus_softc *, uint32_t);
 intotus_set_board_values(struct otus_softc *,
@@ -964,7 +966,7 @@ otus_alloc_cmd_list(struct otus_softc *s
 
for (i = 0; i < ndata; i++) {
struct otus_tx_cmd *dp = &cmd[i];
-   dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT);
+   dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT | M_ZERO);
dp->odata = NULL;
if (dp->buf == NULL) {
device_printf(sc->sc_dev,
@@ -1028,7 +1030,7 @@ otus_alloc_list(struct otus_softc *sc, s
struct otus_data *dp = &data[i];
dp->sc = sc;
dp->m = NULL;
-   dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT);
+   dp->buf = malloc(maxsz, M_USBDEV, M_NOWAIT | M_ZERO);
if (dp->buf == NULL) {
device_printf(sc->sc_dev,
"could not allocate buffer\n");
@@ -1142,6 +1144,7 @@ _otus_getbuf(struct otus_softc *sc)
STAILQ_REMOVE_HEAD(&sc->sc_tx_inactive, next);
else
bf = NULL;
+   /* XXX bzero? */
return (bf);
 }
 
@@ -1224,7 +1227,6 @@ otus_newstate(struct ieee80211vap *vap, 
struct otus_vap *uvp = OTUS_VAP(vap);
struct ieee80211com *ic = vap->iv_ic;
struct otus_softc *sc = ic->ic_softc;
-   struct ieee80211_node *ni;
enum ieee80211_state ostate;
 
ostate = vap->iv_state;
@@ -1239,18 +1241,20 @@ otus_newstate(struct ieee80211vap *vap, 
/* XXX TODO: more fleshing out! */
 
switch (nstate) {
+   case IEEE80211_S_INIT:
+   otus_set_operating_mode(sc);
+   otus_set_rx_filter(sc);
+   break;
case IEEE80211_S_RUN:
-   ni = ieee80211_ref_node(vap->iv_bss);
-
if (ic->ic_opmode == IEEE80211_M_STA) {
otus_updateslot(sc);
-   otus_set_bssid(sc, ni->ni_bssid);
+   otus_set_operating_mode(sc);
+   otus_set_rx_filter(sc);
 
/* Start calibration timer. */
taskqueue_enqueue_timeout(taskqueue_thread,
&sc->calib_to, hz);
}
-   ieee80211_free_node(ni);
break;
default:
break;
@@ -2355,6 +2359,7 @@ otus_set_multi(struct otus_softc *sc)
otus_write(sc, AR_MAC_REG_GROUP_HASH_TBL_L, lo);
otus_write(sc, AR_MAC_REG_GROUP_HASH_TBL_H, hi);
r = otus_write_barrier(sc);
+   /* XXX operating mode? filter? */
OTUS_UNLOCK(sc);
return (r);
 }
@@ -2453,7 +2458,6 @@ otus_init_mac(struct otus_softc *sc)
 
otus_write(sc, AR_MAC_REG_ACK_EXTENSION, 0x40);
otus_write(sc, AR_MAC_REG_RETRY_MAX, 0);
-   otus_write(sc, AR_MAC_REG_SNIFFER, 0x200);
otus_write(sc, AR_MAC_REG_RX_THRESHOLD, 0xc1f80);
otus_write(sc, AR_MAC_REG_RX_PE_DELAY, 0x70);
otus_write(sc, AR_MAC_REG_EIFS_AND_SIFS, 0xa144000);
@@ -2465,13 +2469,14 @@ otus_init_mac(struct otus_softc *sc)
otus_write(sc, AR_MAC_REG_BCN_HT1, 0x8000170);
otus_write(sc, AR_MAC_REG_BACKOFF_PROTECT, 0x105);
otus_write(sc, AR_MAC_REG_AMPDU_FACTOR, 0x1a);
-   /* Filter any control frames, BAR is bit 24. */
-// otus_write(sc, AR_MAC_REG_FRAMETYPE_FILTER, 0x0500);
-// otus_write(sc, AR_MAC_REG_RX_CONTROL, 0x1);
+
+   otus_set_rx_filter(sc);
+
otus_write(sc, AR_MAC_REG_BASIC_RATE, 0x150f);
otus_write(sc, AR_MAC_REG_MANDATORY_RATE, 0x150f);