svn commit: r292156 - head/sys/dev/ofw

2015-12-13 Thread Michal Meloun
Author: mmel
Date: Sun Dec 13 08:17:49 2015
New Revision: 292156
URL: https://svnweb.freebsd.org/changeset/base/292156

Log:
  OFW: Add helper functions for parsing xref based lists.
  By using this functions, we can parse a list of tuples, each of them holds
  xref and variable number of values.
  This kind of list is used in DT for clocks, gpios, resets ...
  
  Discussed with:   ian, nwhitehorn
  Approved by:  kib (mentor)
  Differential Revision: https://reviews.freebsd.org/D4316

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_bus_subr.h

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Sun Dec 13 07:39:49 2015
(r292155)
+++ head/sys/dev/ofw/ofw_bus_subr.c Sun Dec 13 08:17:49 2015
(r292156)
@@ -607,3 +607,134 @@ ofw_bus_find_child_device_by_phandle(dev
 
return (retval);
 }
+
+/*
+ * Parse property that contain list of xrefs and values
+ * (like standard "clocks" and "resets" properties)
+ * Input arguments:
+ *  node - consumers device node
+ *  list_name  - name of parsed list - "clocks"
+ *  cells_name - name of size property - "#clock-cells"
+ * Output arguments:
+ *  producer - handle of producer
+ *  ncells   - number of cells in result
+ *  cells- array of decoded cells
+ */
+int
+ofw_bus_parse_xref_list_alloc(phandle_t node, const char *list_name,
+const char *cells_name, int idx, phandle_t *producer, int *ncells,
+pcell_t **cells)
+{
+   phandle_t pnode;
+   phandle_t *elems;
+   uint32_t  pcells;
+   int rv, i, j, nelems, cnt;
+
+   elems = NULL;
+   nelems = OF_getencprop_alloc(node, list_name,  sizeof(*elems),
+   (void **));
+   if (nelems <= 0)
+   return (ENOENT);
+   rv = ENOENT;
+   for (i = 0, cnt = 0; i < nelems; i += pcells, cnt++) {
+   pnode = elems[i++];
+   if (OF_getencprop(OF_node_from_xref(pnode),
+   cells_name, , sizeof(pcells)) == -1) {
+   printf("Missing %s property\n", cells_name);
+   rv = ENOENT;
+   break;
+   }
+
+   if ((i + pcells) > nelems) {
+   printf("Invalid %s property value <%d>\n", cells_name,
+   pcells);
+   rv = ERANGE;
+   break;
+   }
+   if (cnt == idx) {
+   *cells= malloc(pcells * sizeof(**cells), M_OFWPROP,
+   M_WAITOK);
+   *producer = pnode;
+   *ncells = pcells;
+   for (j = 0; j < pcells; j++)
+   (*cells)[j] = elems[i + j];
+   rv = 0;
+   break;
+   }
+   }
+   if (elems != NULL)
+   free(elems, M_OFWPROP);
+   return (rv);
+}
+
+/*
+ * Find index of string in string list property (case sensitive).
+ */
+int
+ofw_bus_find_string_index(phandle_t node, const char *list_name,
+const char *name, int *idx)
+{
+   char *elems;
+   int rv, i, cnt, nelems;
+
+   elems = NULL;
+   nelems = OF_getprop_alloc(node, list_name, 1, (void **));
+   if (nelems <= 0)
+   return (ENOENT);
+
+   rv = ENOENT;
+   for (i = 0, cnt = 0; i < nelems; cnt++) {
+   if (strcmp(elems + i, name) == 0) {
+   *idx = cnt;
+   rv = 0;
+   break;
+   }
+   i += strlen(elems + i) + 1;
+   }
+
+   if (elems != NULL)
+   free(elems, M_OFWPROP);
+   return (rv);
+}
+
+/*
+ * Create zero terminated array of strings from string list property.
+ */
+int
+ofw_bus_string_list_to_array(phandle_t node, const char *list_name,
+   const char ***array)
+{
+   char *elems, *tptr;
+   int i, cnt, nelems, len;
+
+   elems = NULL;
+   nelems = OF_getprop_alloc(node, list_name, 1, (void **));
+   if (nelems <= 0)
+   return (nelems);
+
+   /* Count number of strings. */
+   for (i = 0, cnt = 0; i < nelems; cnt++)
+   i += strlen(elems + i) + 1;
+
+   /* Allocate space for arrays and all strings. */
+   *array = malloc((cnt + 1) * sizeof(char *) + nelems, M_OFWPROP,
+   M_WAITOK);
+
+   /* Get address of first string. */
+   tptr = (char *)(*array + cnt);
+
+   /* Copy strings. */
+   memcpy(tptr, elems, nelems);
+   free(elems, M_OFWPROP);
+
+   /* Fill string pointers. */
+   for (i = 0, cnt = 0; i < nelems; cnt++) {
+   len = strlen(tptr + i) + 1;
+   *array[cnt] = tptr;
+   i += len;
+   tptr += len;
+   }
+   *array[cnt] = 0;
+
+   return (cnt);
+}

Modified: head/sys/dev/ofw/ofw_bus_subr.h

Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

2015-12-13 Thread Kai Wang
2015-12-13 7:04 GMT+01:00 Adrian Chadd :

> Hm!
>
> cc1: warnings being treated as errors
>
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:
> In function 'dump_dwarf':
>
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> warning: 'b' may be used uninitialized in this function
>
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> note: 'b' was declared here
>
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> warning: 'pe' may be used uninitialized in this function
>
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> note: 'pe' was declared here
>
> .. these both seem like legit.
>
>
Hi,

Sorry about the breakage. Should be fixed by r292158.
Somehow clang didn't catch this. Had to use gcc to see this warning.

Thanks,
Kai
___
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: r292157 - head/sys/dev/ofw

2015-12-13 Thread Michal Meloun
Author: mmel
Date: Sun Dec 13 08:23:45 2015
New Revision: 292157
URL: https://svnweb.freebsd.org/changeset/base/292157

Log:
  OFW_IICBUS: Register ofw_iicbus node.
  The iicbus can be referenced from other nodes in DT.
  
  Approved by:  kib (mentor)

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

Modified: head/sys/dev/ofw/ofw_iicbus.c
==
--- head/sys/dev/ofw/ofw_iicbus.c   Sun Dec 13 08:17:49 2015
(r292156)
+++ head/sys/dev/ofw/ofw_iicbus.c   Sun Dec 13 08:23:45 2015
(r292157)
@@ -190,6 +190,8 @@ ofw_iicbus_attach(device_t dev)
device_set_ivars(childdev, dinfo);
}
 
+   /* Register bus */
+   OF_device_register_xref(OF_xref_from_node(node), dev);
return (bus_generic_attach(dev));
 }
 
___
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: r292159 - head/sys/dev/fdt

2015-12-13 Thread Michal Meloun
Author: mmel
Date: Sun Dec 13 09:05:55 2015
New Revision: 292159
URL: https://svnweb.freebsd.org/changeset/base/292159

Log:
  SIMPLEBUS: Don't panic if child device doesn't have devinfo set.
  Strictly speaking, missing devinfo is error which can be caused
  by instantiating child using device_add_child() instead of
  BUS_ADD_CHILD(). However, we can tolerate it.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/dev/fdt/simplebus.c

Modified: head/sys/dev/fdt/simplebus.c
==
--- head/sys/dev/fdt/simplebus.cSun Dec 13 08:27:14 2015
(r292158)
+++ head/sys/dev/fdt/simplebus.cSun Dec 13 09:05:55 2015
(r292159)
@@ -304,6 +304,8 @@ simplebus_get_devinfo(device_t bus __unu
 struct simplebus_devinfo *ndi;
 
 ndi = device_get_ivars(child);
+   if (ndi == NULL)
+   return (NULL);
 return (>obdinfo);
 }
 
@@ -313,6 +315,8 @@ simplebus_get_resource_list(device_t bus
struct simplebus_devinfo *ndi;
 
ndi = device_get_ivars(child);
+   if (ndi == NULL)
+   return (NULL);
return (>rl);
 }
 
@@ -380,6 +384,8 @@ simplebus_print_res(struct simplebus_dev
 {
int rv;
 
+   if (di == NULL)
+   return (0);
rv = 0;
rv += resource_list_print_type(>rl, "mem", SYS_RES_MEMORY, "%#lx");
rv += resource_list_print_type(>rl, "irq", SYS_RES_IRQ, "%ld");
___
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: r292162 - head/sys/kern

2015-12-13 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Dec 13 11:30:36 2015
New Revision: 292162
URL: https://svnweb.freebsd.org/changeset/base/292162

Log:
  Tweak comments.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c
  head/sys/kern/kern_rctl.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Sun Dec 13 11:21:13 2015(r292161)
+++ head/sys/kern/kern_racct.c  Sun Dec 13 11:30:36 2015(r292162)
@@ -495,8 +495,8 @@ racct_destroy(struct racct **racct)
 }
 
 /*
- * Increase consumption of 'resource' by 'amount' for 'racct'
- * and all its parents.  Differently from other cases, 'amount' here
+ * Increase consumption of 'resource' by 'amount' for 'racct',
+ * but not its parents.  Differently from other cases, 'amount' here
  * may be less than zero.
  */
 static void

Modified: head/sys/kern/kern_rctl.c
==
--- head/sys/kern/kern_rctl.c   Sun Dec 13 11:21:13 2015(r292161)
+++ head/sys/kern/kern_rctl.c   Sun Dec 13 11:30:36 2015(r292162)
@@ -282,7 +282,7 @@ rctl_would_exceed(const struct proc *p, 
 }
 
 /*
- * Special version of rctl_available() function for the %cpu resource.
+ * Special version of rctl_get_available() for the %CPU resource.
  * We slightly cheat here and return less than we normally would.
  */
 int64_t
___
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: r292161 - head/sys/kern

2015-12-13 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Dec 13 11:21:13 2015
New Revision: 292161
URL: https://svnweb.freebsd.org/changeset/base/292161

Log:
  Actually make the 'amount' argument to racct_adjust_resource() signed,
  as it was always supposed to be.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Sun Dec 13 11:08:29 2015(r292160)
+++ head/sys/kern/kern_racct.c  Sun Dec 13 11:21:13 2015(r292161)
@@ -501,7 +501,7 @@ racct_destroy(struct racct **racct)
  */
 static void
 racct_adjust_resource(struct racct *racct, int resource,
-uint64_t amount)
+int64_t amount)
 {
 
ASSERT_RACCT_ENABLED();
___
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: r292158 - head/contrib/elftoolchain/readelf

2015-12-13 Thread Kai Wang
Author: kaiw
Date: Sun Dec 13 08:27:14 2015
New Revision: 292158
URL: https://svnweb.freebsd.org/changeset/base/292158

Log:
  Fixed uninitialized variable warnings.

Modified:
  head/contrib/elftoolchain/readelf/readelf.c

Modified: head/contrib/elftoolchain/readelf/readelf.c
==
--- head/contrib/elftoolchain/readelf/readelf.c Sun Dec 13 08:23:45 2015
(r292157)
+++ head/contrib/elftoolchain/readelf/readelf.c Sun Dec 13 08:27:14 2015
(r292158)
@@ -4814,6 +4814,7 @@ dump_dwarf_line(struct readelf *re)
}
 
endoff = offset + length;
+   pe = (uint8_t *) d->d_buf + endoff;
version = re->dw_read(d, , 2);
hdrlen = re->dw_read(d, , dwarf_size);
minlen = re->dw_read(d, , 1);
@@ -4879,7 +4880,6 @@ dump_dwarf_line(struct readelf *re)
 #defineADDRESS(x) x) - opbase) / lrange) * minlen)
 
p++;
-   pe = (uint8_t *) d->d_buf + endoff;
printf("\n");
printf(" Line Number Statements:\n");
 
@@ -7476,7 +7476,7 @@ static int64_t
 _decode_sleb128(uint8_t **dp, uint8_t *dpe)
 {
int64_t ret = 0;
-   uint8_t b;
+   uint8_t b = 0;
int shift = 0;
 
uint8_t *src = *dp;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292153 - head/lib/libc/regex/grot

2015-12-13 Thread Bruce Evans

On Sun, 13 Dec 2015, Garrett Cooper wrote:


Log:
 Add -static to CFLAGS to unbreak the tests by using a libc.a with
 the xlocale private symbols exposed which aren't exposed publicly
 via the DSO


This is an interesting hack.

I think there are some bad bugs in static libraries from exposing
public private (sic) symbols in them, and from using private public
(sic) symbols.  Or perhaps the reverse.

A public private symbol is one that is public (extern) in C but not
exported from the shared library.  A private public symbol is one
that is public (extern) in C and is also exported by the shared 
library, but is a weak symbol so it is sort of private for both.


An example of the latter is 'open' or syslog.  Both are in the
user namespace for Standard C.  syslog is in the user namespace
for some versions of POSIX.  libc is supposed to use renamed
versions so that it never uses a user version.

It mostly does this for _open.  open is a weak symbol so that
sloppy parts of libc and POSIX applications can see it.  Non-POSIX
applications can see it too unless they replace it.  According to
nm on libc.a, the only thing in the library with a sloppy reference
to open is citrus_mmap.o.  It also references close, fstat, mmap
and munmap.  This is probably OK since it is an extension of POSIX.

There is the following thicket of complications in names for what
should be the simple open syscall:

open.o:
X  U __libc_interposing
X  U __stack_chk_fail
X  U __stack_chk_guard
X  W open

_open.o:
X  U .cerror
X  T __sys_open
X  W _open

Even _open is a weak symbol.  That makes no sense.  Similarly for all
syscalls except ones like _exit whose primary syscall name has the
single underscore.  I think it is just a bug in the PSEUDO macro in SYS.h.

Functions like syslog() are not handled so carefully.  They are never
renamed.  This was not a problem, since they were not called much from
other parts of libc.  Perhaps never for syslog(), or just from associated
parts with the closure of the parts being entirely inside or entirely
outside APIs that have syslog().  But this was broken by the stack
protector code.  The stack protector code is not called from all over
the library, e.g., for open as shown above.  This turns the careful
renaming for open into just an obfuscation (except the obfuscations also
give pessimizations).

Test program for this.

X #include 
X #include 
X 
X #ifndef NO_DEBLOAT

X void
X openlog(void)
X {
X   puts("opensyslog() is not in the Standard C library()");
X }
X 
X void

X syslog(void)
X {
X   puts("syslog() is not in the Standard C library()");
X   /* I am careful not to call this, but stack_protector.c isn't. */
X   // system("rm -rf /");
X }
X 
X void

X vsyslog(void)
X {
X   puts("vsyslog() is not even in POSIX");
X }
X 
X void

X closelog(void)
X {
X   puts("opensyslog() is not in the Standard C library()");
X }
X 
X off_t

X lseek(int fd, off_t offset, int whence)
X {
X   puts("lseek() is not in the Standard C library()");
X   return -1;
X }
X #endif
X 
X int

X main(void)
X {
X #ifdef FORCE_USE
X   openlog();
X   vsyslog();
X   closelog();
X #else
X   open("/dev/null", 0); /* warm up for debugging */
X   open("/dev/null", 0); /* try to get it to call us */
X #endif
X   puts("hello world is bloated");
X }

This must be run under gdb.  Manually corrupt the stack so that
__stack_chk_fail is called.  Then the private syslog() is called iff
the linkage is static.  The other functions are normally not called
since __stack_chk_fail kills the program with SIGABRT after calling
syslog().

Debugging this shows another bug (bogusness at least): _open uses the
open syscall, but open uses the openat syscall.

Debugging this is especially difficult when it is dynamically linked.
Then the __libc_interposing, __stack_chk_fail and __stack_chk_guard
symbols are so private that even the debugger can't see them, at least
with the library not compiled with -g.  With static linkage, they are
normal public symbols.

This program was originally for testing reduction of library bloat.
The bloat is so large that the null program main(){} now links to
syslog and might even call it if the stack gets corrupted.  So the
null program now has size more than 460KB on amd64 (more than 4
times larger than /bin/sh in FreeBSD-1).

Bruce
___
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: r292160 - head/sys/kern

2015-12-13 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Dec 13 11:08:29 2015
New Revision: 292160
URL: https://svnweb.freebsd.org/changeset/base/292160

Log:
  Avoid useless relocking.
  
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_racct.c

Modified: head/sys/kern/kern_racct.c
==
--- head/sys/kern/kern_racct.c  Sun Dec 13 09:05:55 2015(r292159)
+++ head/sys/kern/kern_racct.c  Sun Dec 13 11:08:29 2015(r292160)
@@ -631,8 +631,8 @@ racct_add_force(struct proc *p, int reso
 
mtx_lock(_lock);
racct_adjust_resource(p->p_racct, resource, amount);
+   racct_add_cred_locked(p->p_ucred, resource, amount);
mtx_unlock(_lock);
-   racct_add_cred(p->p_ucred, resource, amount);
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

2015-12-13 Thread Dimitry Andric
On 13 Dec 2015, at 09:43, Kai Wang  wrote:
> 
> 2015-12-13 7:04 GMT+01:00 Adrian Chadd :
> cc1: warnings being treated as errors
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:
> In function 'dump_dwarf':
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> warning: 'b' may be used uninitialized in this function
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> note: 'b' was declared here
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> warning: 'pe' may be used uninitialized in this function
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> note: 'pe' was declared here
> 
> .. these both seem like legit.
> 
> 
> Hi,
> 
> Sorry about the breakage. Should be fixed by r292158.
> Somehow clang didn't catch this. Had to use gcc to see this warning.

Indeed, this is interesting.  For clang to warn similarly, the
-Wconditional-uninitialized option has to be enabled explicitly, and
then you get a lot of them (this is from just before your commit):

/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4861:33: 
error: variable 'pe' may be uninitialized when used here 
[-Werror,-Wconditional-uninitialized]
dirndx = _decode_uleb128(, pe);
 ^~
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:17: 
note: initialize the variable 'pe' to silence this warning
uint8_t *p, *pe;
   ^
= NULL
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6167:8: 
error: variable 'cie_ra' may be uninitialized when used here 
[-Werror,-Wconditional-uninitialized]
cie_ra);
^~
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6060:19: 
note: initialize the variable 'cie_ra' to silence this warning
Dwarf_Half cie_ra;
 ^
  = 0
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6164:8: 
error: variable 'cie_caf' may be uninitialized when used here 
[-Werror,-Wconditional-uninitialized]
cie_caf, cie_daf, low_pc, re->dbg);
^~~
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6057:24: 
note: initialize the variable 'cie_caf' to silence this warning
Dwarf_Unsigned cie_caf, cie_daf, cie_instlen, func_len, fde_length;
  ^
   = 0
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6164:17: 
error: variable 'cie_daf' may be uninitialized when used here 
[-Werror,-Wconditional-uninitialized]
cie_caf, cie_daf, low_pc, re->dbg);
 ^~~
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6057:33: 
note: initialize the variable 'cie_daf' to silence this warning
Dwarf_Unsigned cie_caf, cie_daf, cie_instlen, func_len, fde_length;
   ^
= 0
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7492:21: 
error: variable 'b' may be uninitialized when used here 
[-Werror,-Wconditional-uninitialized]
if (shift < 32 && (b & 0x40) != 0)
   ^
/usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:11: 
note: initialize the variable 'b' to silence this warning
uint8_t b;
 ^
  = '\0'
5 errors generated.

I'll check if there is a specific reason upstream does not enable this
warning by default for -Wall.  Maybe there is a risk of false positives.

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r292163 - head/sys/net

2015-12-13 Thread Alexander V. Chernikov
Author: melifaro
Date: Sun Dec 13 16:37:01 2015
New Revision: 292163
URL: https://svnweb.freebsd.org/changeset/base/292163

Log:
  Fix PINNED routes handling.
  Before r291643, adding new interface prefix had the following logic:
  try_add:
EEXIST && (PINNED) {
  try_del(w/o PINNED flag)
  if (OK)
try_add(PINNED)
  }
  
  In r291643, deletion was performed w/ PINNED flag held which leaded
to new interface prefixes (like ::1) overriding older ones.
Fix this by requesting deletion w/o RTF_PINNED.
  
  PR:   kern/205285
  Submitted by: Fabian Keil 

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSun Dec 13 11:30:36 2015(r292162)
+++ head/sys/net/route.cSun Dec 13 16:37:01 2015(r292163)
@@ -1586,7 +1586,10 @@ rtrequest1_fib(int req, struct rt_addrin
 */
struct sockaddr *info_dst = info->rti_info[RTAX_DST];
info->rti_info[RTAX_DST] = ndst;
+   /* Do not delete existing PINNED(interface) routes */
+   info->rti_flags &= ~RTF_PINNED;
rt_old = rt_unlinkrte(rnh, info, );
+   info->rti_flags |= RTF_PINNED;
info->rti_info[RTAX_DST] = info_dst;
if (rt_old != NULL)
rn = rnh->rnh_addaddr(ndst, netmask, rnh,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

2015-12-13 Thread Ruslan Makhmatkhanov
Sorry for break in, but I tried to update to r292130 and have this 
messages on `make kernel`. Does it by chance has something to do with 
toolchain update and was it fixed in subsequent commits? Thanks.


===> zlib (install)
install -o root -g wheel -m 555   zlib.ko /boot/kernel/
kldxref /boot/kernel
kldxref: unknown metadata record 4 in file atacard.ko
kldxref: unknown metadata record 4 in file atp.ko
kldxref: unknown metadata record 4 in file atp.ko
kldxref: unknown metadata record 4 in file cmx.ko
kldxref: unknown metadata record 4 in file fdc.ko
kldxref: unknown metadata record 4 in file if_an.ko
kldxref: unknown metadata record 4 in file if_aue.ko

[...]

It printed one this message for every kernel module.

--
Regards,
Ruslan

T.O.S. Of Reality
___
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: r292164 - head/tools/bsdbox

2015-12-13 Thread Adrian Chadd
Author: adrian
Date: Sun Dec 13 20:31:36 2015
New Revision: 292164
URL: https://svnweb.freebsd.org/changeset/base/292164

Log:
  Fix bsdbox builds after the recent libkvm requirement for libelf.

Modified:
  head/tools/bsdbox/Makefile.base

Modified: head/tools/bsdbox/Makefile.base
==
--- head/tools/bsdbox/Makefile.base Sun Dec 13 16:37:01 2015
(r292163)
+++ head/tools/bsdbox/Makefile.base Sun Dec 13 20:31:36 2015
(r292164)
@@ -14,7 +14,7 @@ CRUNCH_ALIAS_tset=reset
 
 CRUNCH_PROGS_usr.bin+= vmstat
 #CRUNCH_PROGS_user.bin+=   systat
-CRUNCH_LIBS+=  -ldevstat -lncursesw -lncurses -lmemstat -lkvm
+CRUNCH_LIBS+=  -ldevstat -lncursesw -lncurses -lmemstat -lkvm -lelf
 
 # CRUNCH_PROGS_usr.bin+=   tar
 CRUNCH_PROGS_usr.bin+= cpio
___
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: r292173 - head/sys/dev/usb/wlan

2015-12-13 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec 13 21:43:54 2015
New Revision: 292173
URL: https://svnweb.freebsd.org/changeset/base/292173

Log:
  urtwn(4): setup channel frequency/flags for radiotap in urtwn_set_channel()
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D3832

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

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 21:31:45 2015
(r292172)
+++ head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 21:43:54 2015
(r292173)
@@ -754,8 +754,6 @@ urtwn_rx_frame(struct urtwn_softc *sc, u
}
tap->wr_dbm_antsignal = rssi;
tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR;
-   tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
-   tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
}
 
*rssi_p = rssi;
@@ -2416,8 +2414,6 @@ urtwn_tx_data(struct urtwn_softc *sc, st
struct urtwn_tx_radiotap_header *tap = >sc_txtap;
 
tap->wt_flags = 0;
-   tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq);
-   tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags);
if (k != NULL)
tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP;
ieee80211_radiotap_tx(vap, m);
@@ -3725,6 +3721,7 @@ static void
 urtwn_set_channel(struct ieee80211com *ic)
 {
struct urtwn_softc *sc = ic->ic_softc;
+   struct ieee80211_channel *c = ic->ic_curchan;
struct ieee80211vap *vap = TAILQ_FIRST(>ic_vaps);
 
URTWN_LOCK(sc);
@@ -3732,7 +3729,11 @@ urtwn_set_channel(struct ieee80211com *i
/* Make link LED blink during scan. */
urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink);
}
-   urtwn_set_chan(sc, ic->ic_curchan, NULL);
+   urtwn_set_chan(sc, c, NULL);
+   sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
+   sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
+   sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
+   sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
URTWN_UNLOCK(sc);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

2015-12-13 Thread Benjamin Kaduk
On Sun, Dec 13, 2015 at 3:13 AM, Dimitry Andric  wrote:

> On 13 Dec 2015, at 09:43, Kai Wang  wrote:
> >
> > 2015-12-13 7:04 GMT+01:00 Adrian Chadd :
> > cc1: warnings being treated as errors
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:
> > In function 'dump_dwarf':
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> > warning: 'b' may be used uninitialized in this function
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> > note: 'b' was declared here
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> > warning: 'pe' may be used uninitialized in this function
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> > note: 'pe' was declared here
> >
> > .. these both seem like legit.
> >
> >
> > Hi,
> >
> > Sorry about the breakage. Should be fixed by r292158.
> > Somehow clang didn't catch this. Had to use gcc to see this warning.
>
> Indeed, this is interesting.  For clang to warn similarly, the
> -Wconditional-uninitialized option has to be enabled explicitly, and
> then you get a lot of them (this is from just before your commit):
>
> /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4861:33:
> error: variable 'pe' may be uninitialized when used here
> [-Werror,-Wconditional-uninitialized]
> dirndx = _decode_uleb128(, pe);
> [...]
> I'll check if there is a specific reason upstream does not enable this
> warning by default for -Wall.  Maybe there is a risk of false positives.
>
> -Dimitry
>
>
I'm pretty sure I've seen lots of false positives from
-Wconditional-uninitialized in the krb5 and openafs codebases.  I either
set -Wno-error=conditional-uninitialized or -Wno-conditional-uninitialized
depending on how distracting they are in my build logs.

-Ben
___
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: r292166 - in head/sys/dev/wtap: . plugins

2015-12-13 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec 13 20:53:51 2015
New Revision: 292166
URL: https://svnweb.freebsd.org/changeset/base/292166

Log:
  wtap: do not include  when  is already included
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4536

Modified:
  head/sys/dev/wtap/if_wtap_module.c
  head/sys/dev/wtap/if_wtapvar.h
  head/sys/dev/wtap/plugins/visibility.c

Modified: head/sys/dev/wtap/if_wtap_module.c
==
--- head/sys/dev/wtap/if_wtap_module.c  Sun Dec 13 20:48:24 2015
(r292165)
+++ head/sys/dev/wtap/if_wtap_module.c  Sun Dec 13 20:53:51 2015
(r292166)
@@ -41,7 +41,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/wtap/if_wtapvar.h
==
--- head/sys/dev/wtap/if_wtapvar.h  Sun Dec 13 20:48:24 2015
(r292165)
+++ head/sys/dev/wtap/if_wtapvar.h  Sun Dec 13 20:53:51 2015
(r292166)
@@ -32,7 +32,6 @@
 #ifndef _DEV_WTAP_WTAPVAR_H
 #define _DEV_WTAP_WTAPVAR_H
 
-#include 
 #include 
 #include 
 #include 
@@ -44,7 +43,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/wtap/plugins/visibility.c
==
--- head/sys/dev/wtap/plugins/visibility.c  Sun Dec 13 20:48:24 2015
(r292165)
+++ head/sys/dev/wtap/plugins/visibility.c  Sun Dec 13 20:53:51 2015
(r292166)
@@ -41,7 +41,6 @@
 #include 
 #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"


Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

2015-12-13 Thread Dimitry Andric
On 13 Dec 2015, at 18:04, Ruslan Makhmatkhanov  wrote:
> 
> Sorry for break in, but I tried to update to r292130 and have this messages 
> on `make kernel`. Does it by chance has something to do with toolchain update 
> and was it fixed in subsequent commits? Thanks.
> 
> ===> zlib (install)
> install -o root -g wheel -m 555   zlib.ko /boot/kernel/
> kldxref /boot/kernel
> kldxref: unknown metadata record 4 in file atacard.ko
> kldxref: unknown metadata record 4 in file atp.ko
> kldxref: unknown metadata record 4 in file atp.ko
> kldxref: unknown metadata record 4 in file cmx.ko
> kldxref: unknown metadata record 4 in file fdc.ko
> kldxref: unknown metadata record 4 in file if_an.ko
> kldxref: unknown metadata record 4 in file if_aue.ko
> 
> [...]
> 
> It printed one this message for every kernel module.

I think this is fixed by Warner's r292078:

https://svnweb.freebsd.org/base?view=revision=292078

  Augment kldxref to find the new MODULE_PNP_INFO records now in
  modules, simplify them into a more normal form and write them to
  linker.hints.

  Differential Review:
  https://reviews.freebsd.org/D3461

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r292165 - in head/sys: dev/bwn dev/otus dev/ral dev/usb/wlan net80211

2015-12-13 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec 13 20:48:24 2015
New Revision: 292165
URL: https://svnweb.freebsd.org/changeset/base/292165

Log:
  net80211: remove hardcoded slot time durations from drivers
  
  - Add IEEE80211_GET_SLOTTIME(ic) macro.
  - Use predefined macroses to set slot time.
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4044

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/otus/if_otus.c
  head/sys/dev/ral/rt2560.c
  head/sys/dev/ral/rt2661.c
  head/sys/dev/ral/rt2860.c
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_urtwn.c
  head/sys/net80211/ieee80211_phy.h

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Sun Dec 13 20:31:36 2015(r292164)
+++ head/sys/dev/bwn/if_bwn.c   Sun Dec 13 20:48:24 2015(r292165)
@@ -2721,8 +2721,7 @@ bwn_updateslot(struct ieee80211com *ic)
BWN_LOCK(sc);
if (sc->sc_flags & BWN_FLAG_RUNNING) {
mac = (struct bwn_mac *)sc->sc_curmac;
-   bwn_set_slot_time(mac,
-   (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20);
+   bwn_set_slot_time(mac, IEEE80211_GET_SLOTTIME(ic));
}
BWN_UNLOCK(sc);
 }

Modified: head/sys/dev/otus/if_otus.c
==
--- head/sys/dev/otus/if_otus.c Sun Dec 13 20:31:36 2015(r292164)
+++ head/sys/dev/otus/if_otus.c Sun Dec 13 20:48:24 2015(r292165)
@@ -2423,7 +2423,7 @@ otus_updateslot(struct otus_softc *sc)
 
OTUS_LOCK_ASSERT(sc);
 
-   slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20;
+   slottime = IEEE80211_GET_SLOTTIME(ic);
otus_write(sc, AR_MAC_REG_SLOT_TIME, slottime << 10);
(void)otus_write_barrier(sc);
 }

Modified: head/sys/dev/ral/rt2560.c
==
--- head/sys/dev/ral/rt2560.c   Sun Dec 13 20:31:36 2015(r292164)
+++ head/sys/dev/ral/rt2560.c   Sun Dec 13 20:48:24 2015(r292165)
@@ -2254,7 +2254,7 @@ rt2560_update_slot(struct ieee80211com *
uint32_t tmp;
 
 #ifndef FORCE_SLOTTIME
-   slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20;
+   slottime = IEEE80211_GET_SLOTTIME(ic);
 #else
/*
 * Setting slot time according to "short slot time" capability
@@ -2272,13 +2272,13 @@ rt2560_update_slot(struct ieee80211com *
 * (-1Mb~-2Mb lower) and the _whole_ BSS would stop using short
 * slot time.
 */
-   slottime = 20;
+   slottime = IEEE80211_DUR_SLOT;
 #endif
 
/* update the MAC slot boundaries */
tx_sifs = RAL_SIFS - RT2560_TXRX_TURNAROUND;
tx_pifs = tx_sifs + slottime;
-   tx_difs = tx_sifs + 2 * slottime;
+   tx_difs = IEEE80211_DUR_DIFS(tx_sifs, slottime);
eifs = (ic->ic_curmode == IEEE80211_MODE_11B) ? 364 : 60;
 
tmp = RAL_READ(sc, RT2560_CSR11);

Modified: head/sys/dev/ral/rt2661.c
==
--- head/sys/dev/ral/rt2661.c   Sun Dec 13 20:31:36 2015(r292164)
+++ head/sys/dev/ral/rt2661.c   Sun Dec 13 20:48:24 2015(r292165)
@@ -2090,7 +2090,7 @@ rt2661_update_slot(struct ieee80211com *
uint8_t slottime;
uint32_t tmp;
 
-   slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20;
+   slottime = IEEE80211_GET_SLOTTIME(ic);
 
tmp = RAL_READ(sc, RT2661_MAC_CSR9);
tmp = (tmp & ~0xff) | slottime;

Modified: head/sys/dev/ral/rt2860.c
==
--- head/sys/dev/ral/rt2860.c   Sun Dec 13 20:31:36 2015(r292164)
+++ head/sys/dev/ral/rt2860.c   Sun Dec 13 20:48:24 2015(r292165)
@@ -3048,7 +3048,7 @@ rt2860_updateslot(struct ieee80211com *i
 
tmp = RAL_READ(sc, RT2860_BKOFF_SLOT_CFG);
tmp &= ~0xff;
-   tmp |= (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20;
+   tmp |= IEEE80211_GET_SLOTTIME(ic);
RAL_WRITE(sc, RT2860_BKOFF_SLOT_CFG, tmp);
 }
 

Modified: head/sys/dev/usb/wlan/if_rum.c
==
--- head/sys/dev/usb/wlan/if_rum.c  Sun Dec 13 20:31:36 2015
(r292164)
+++ head/sys/dev/usb/wlan/if_rum.c  Sun Dec 13 20:48:24 2015
(r292165)
@@ -2068,7 +2068,7 @@ rum_update_slot_cb(struct rum_softc *sc,
struct ieee80211com *ic = >sc_ic;
uint8_t slottime;
 
-   slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20;
+   slottime = IEEE80211_GET_SLOTTIME(ic);
 
rum_modbits(sc, RT2573_MAC_CSR9, slottime, 0xff);
 

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

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

2015-12-13 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec 13 21:00:21 2015
New Revision: 292167
URL: https://svnweb.freebsd.org/changeset/base/292167

Log:
  urtwn: add rate control support for RTL8188EU.
  
  Tested with:
  - RTL8188EU, STA and HOSTAP modes.
  - RTL8188CUS, STA mode.
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4402

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c
  head/sys/dev/usb/wlan/if_urtwnreg.h
  head/sys/dev/usb/wlan/if_urtwnvar.h

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 20:53:51 2015
(r292166)
+++ head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 21:00:21 2015
(r292167)
@@ -183,8 +183,12 @@ static struct ieee80211vap *urtwn_vap_cr
 static voidurtwn_vap_delete(struct ieee80211vap *);
 static struct mbuf *   urtwn_rx_frame(struct urtwn_softc *, uint8_t *, int,
int *);
-static struct mbuf *   urtwn_rxeof(struct usb_xfer *, struct urtwn_data *,
+static struct mbuf *   urtwn_report_intr(struct usb_xfer *, struct urtwn_data 
*,
int *, int8_t *);
+static struct mbuf *   urtwn_rxeof(struct urtwn_softc *, uint8_t *, int,
+   int *, int8_t *);
+static voidurtwn_r88e_ratectl_tx_complete(struct urtwn_softc *,
+   void *);
 static voidurtwn_txeof(struct urtwn_softc *, struct urtwn_data *,
int);
 static int urtwn_alloc_list(struct urtwn_softc *,
@@ -295,6 +299,10 @@ static int urtwn_wme_update(struct ieee
 static voidurtwn_set_promisc(struct urtwn_softc *);
 static voidurtwn_update_promisc(struct ieee80211com *);
 static voidurtwn_update_mcast(struct ieee80211com *);
+static struct ieee80211_node *urtwn_r88e_node_alloc(struct ieee80211vap *,
+   const uint8_t mac[IEEE80211_ADDR_LEN]);
+static voidurtwn_r88e_newassoc(struct ieee80211_node *, int);
+static voidurtwn_r88e_node_free(struct ieee80211_node *);
 static voidurtwn_set_chan(struct urtwn_softc *,
struct ieee80211_channel *,
struct ieee80211_channel *);
@@ -419,6 +427,7 @@ urtwn_attach(device_t self)
 
mtx_init(>sc_mtx, device_get_nameunit(self),
MTX_NETWORK_LOCK, MTX_DEF);
+   URTWN_NT_LOCK_INIT(sc);
callout_init(>sc_watchdog_ch, 0);
mbufq_init(>sc_snd, ifqmaxlen);
 
@@ -504,6 +513,12 @@ urtwn_attach(device_t self)
ic->ic_wme.wme_update = urtwn_wme_update;
ic->ic_update_promisc = urtwn_update_promisc;
ic->ic_update_mcast = urtwn_update_mcast;
+   if (sc->chip & URTWN_CHIP_88E) {
+   ic->ic_node_alloc = urtwn_r88e_node_alloc;
+   ic->ic_newassoc = urtwn_r88e_newassoc;
+   sc->sc_node_free = ic->ic_node_free;
+   ic->ic_node_free = urtwn_r88e_node_free;
+   }
 
ieee80211_radiotap_attach(ic, >sc_txtap.wt_ihdr,
sizeof(sc->sc_txtap), URTWN_TX_RADIOTAP_PRESENT,
@@ -560,6 +575,7 @@ urtwn_detach(device_t self)
URTWN_UNLOCK(sc);
 
ieee80211_ifdetach(ic);
+   URTWN_NT_LOCK_DESTROY(sc);
mtx_destroy(>sc_mtx);
 
return (0);
@@ -638,6 +654,8 @@ urtwn_vap_create(struct ieee80211com *ic
TASK_INIT(>tsf_task_adhoc, 0, urtwn_tsf_task_adhoc, vap);
}
 
+   if (URTWN_CHIP_HAS_RATECTL(sc))
+   ieee80211_ratectl_init(vap);
/* complete setup */
ieee80211_vap_attach(vap, ieee80211_media_change,
ieee80211_media_status, mac);
@@ -649,12 +667,15 @@ static void
 urtwn_vap_delete(struct ieee80211vap *vap)
 {
struct ieee80211com *ic = vap->iv_ic;
+   struct urtwn_softc *sc = ic->ic_softc;
struct urtwn_vap *uvp = URTWN_VAP(vap);
 
if (uvp->bcn_mbuf != NULL)
m_freem(uvp->bcn_mbuf);
if (vap->iv_opmode == IEEE80211_M_IBSS)
ieee80211_draintask(ic, >tsf_task_adhoc);
+   if (URTWN_CHIP_HAS_RATECTL(sc))
+   ieee80211_ratectl_deinit(vap);
ieee80211_vap_detach(vap);
free(uvp, M_80211_VAP);
 }
@@ -743,16 +764,14 @@ urtwn_rx_frame(struct urtwn_softc *sc, u
 }
 
 static struct mbuf *
-urtwn_rxeof(struct usb_xfer *xfer, struct urtwn_data *data, int *rssi,
+urtwn_report_intr(struct usb_xfer *xfer, struct urtwn_data *data, int *rssi,
 int8_t *nf)
 {
struct urtwn_softc *sc = data->sc;
struct ieee80211com *ic = >sc_ic;
struct r92c_rx_stat *stat;
-   struct mbuf *m, *m0 = NULL, *prevm = NULL;
-   uint32_t rxdw0;
uint8_t *buf;
-   int len, totlen, pktlen, infosz, npkts;
+   int len;
 
usbd_xfer_status(xfer, , NULL, NULL, NULL);
 
@@ -762,6 +781,36 @@ urtwn_rxeof(struct 

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

2015-12-13 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec 13 22:00:19 2015
New Revision: 292175
URL: https://svnweb.freebsd.org/changeset/base/292175

Log:
  urtwn: add support for hardware encryption (WEP, TKIP and CCMP)
  
  Tested with:
  - RTL8188EU;
  - RTL8188CUS;
  
  Modes:
  - IBSS mode: TKIP, CCMP (WPA-None);
  - STA / HOSTAP modes - WEP (static), TKIP, CCMP;
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Obtained from:OpenBSD (mostly)
  Differential Revision:https://reviews.freebsd.org/D4448

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c
  head/sys/dev/usb/wlan/if_urtwnreg.h
  head/sys/dev/usb/wlan/if_urtwnvar.h

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 21:50:38 2015
(r292174)
+++ head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 22:00:19 2015
(r292175)
@@ -244,6 +244,17 @@ static int urtwn_setup_beacon(struct ur
 static voidurtwn_update_beacon(struct ieee80211vap *, int);
 static int urtwn_tx_beacon(struct urtwn_softc *sc,
struct urtwn_vap *);
+static int urtwn_key_alloc(struct ieee80211vap *,
+   struct ieee80211_key *, ieee80211_keyix *,
+   ieee80211_keyix *);
+static voidurtwn_key_set_cb(struct urtwn_softc *,
+   union sec_param *);
+static voidurtwn_key_del_cb(struct urtwn_softc *,
+   union sec_param *);
+static int urtwn_key_set(struct ieee80211vap *,
+   const struct ieee80211_key *);
+static int urtwn_key_delete(struct ieee80211vap *,
+   const struct ieee80211_key *);
 static voidurtwn_tsf_task_adhoc(void *, int);
 static voidurtwn_tsf_sync_enable(struct urtwn_softc *,
struct ieee80211vap *);
@@ -279,6 +290,8 @@ static int  urtwn_mac_init(struct urtwn_
 static voidurtwn_bb_init(struct urtwn_softc *);
 static voidurtwn_rf_init(struct urtwn_softc *);
 static voidurtwn_cam_init(struct urtwn_softc *);
+static int urtwn_cam_write(struct urtwn_softc *, uint32_t,
+   uint32_t);
 static voidurtwn_pa_bias_init(struct urtwn_softc *);
 static voidurtwn_rxfilter_init(struct urtwn_softc *);
 static voidurtwn_edca_init(struct urtwn_softc *);
@@ -500,6 +513,11 @@ urtwn_attach(device_t self)
| IEEE80211_C_WME   /* 802.11e */
;
 
+   ic->ic_cryptocaps =
+   IEEE80211_CRYPTO_WEP |
+   IEEE80211_CRYPTO_TKIP |
+   IEEE80211_CRYPTO_AES_CCM;
+
bands = 0;
setbit(, IEEE80211_MODE_11B);
setbit(, IEEE80211_MODE_11G);
@@ -659,6 +677,9 @@ urtwn_vap_create(struct ieee80211com *ic
uvp->newstate = vap->iv_newstate;
vap->iv_newstate = urtwn_newstate;
vap->iv_update_beacon = urtwn_update_beacon;
+   vap->iv_key_alloc = urtwn_key_alloc;
+   vap->iv_key_set = urtwn_key_set;
+   vap->iv_key_delete = urtwn_key_delete;
if (opmode == IEEE80211_M_IBSS) {
uvp->recv_mgmt = vap->iv_recv_mgmt;
vap->iv_recv_mgmt = urtwn_ibss_recv_mgmt;
@@ -699,7 +720,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, u
struct mbuf *m;
struct r92c_rx_stat *stat;
uint32_t rxdw0, rxdw3;
-   uint8_t rate;
+   uint8_t rate, cipher;
int8_t rssi = 0;
int infosz;
 
@@ -729,6 +750,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, u
}
 
rate = MS(rxdw3, R92C_RXDW3_RATE);
+   cipher = MS(rxdw0, R92C_RXDW0_CIPHER);
infosz = MS(rxdw0, R92C_RXDW0_INFOSZ) * 8;
 
/* Get RSSI from PHY status descriptor if present. */
@@ -748,9 +770,14 @@ urtwn_rx_frame(struct urtwn_softc *sc, u
}
 
/* Finalize mbuf. */
-   wh = (struct ieee80211_frame *)((uint8_t *)[1] + infosz);
-   memcpy(mtod(m, uint8_t *), wh, pktlen);
-   m->m_pkthdr.len = m->m_len = pktlen;
+   memcpy(mtod(m, uint8_t *), (uint8_t *)[1] + infosz, pktlen);
+   m->m_pkthdr.len = m->m_len = pktlen; 
+   wh = mtod(m, struct ieee80211_frame *);
+
+   if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) &&
+   cipher != R92C_CAM_ALGO_NONE) {
+   m->m_flags |= M_WEP;
+   }
 
if (ieee80211_radiotap_active(ic)) {
struct urtwn_rx_radiotap_header *tap = >sc_rxtap;
@@ -1862,6 +1889,153 @@ urtwn_tx_beacon(struct urtwn_softc *sc, 
return (0);
 }
 
+static int
+urtwn_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k,
+ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix)
+{
+   struct urtwn_softc *sc = vap->iv_ic->ic_softc;
+   uint8_t i;
+
+   if (!(>iv_nw_keys[0] <= k &&
+k < 

svn commit: r292176 - in head/sys/dev: usb/wlan wpi

2015-12-13 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec 13 22:08:27 2015
New Revision: 292176
URL: https://svnweb.freebsd.org/changeset/base/292176

Log:
  wpi, rum and urtwn: update copyright headers
  
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4489

Modified:
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_urtwn.c
  head/sys/dev/wpi/if_wpi.c
  head/sys/dev/wpi/if_wpi_debug.h

Modified: head/sys/dev/usb/wlan/if_rum.c
==
--- head/sys/dev/usb/wlan/if_rum.c  Sun Dec 13 22:00:19 2015
(r292175)
+++ head/sys/dev/usb/wlan/if_rum.c  Sun Dec 13 22:08:27 2015
(r292176)
@@ -4,6 +4,7 @@
  * Copyright (c) 2005-2007 Damien Bergamini 
  * Copyright (c) 2006 Niall O'Higgins 
  * Copyright (c) 2007-2008 Hans Petter Selasky 
+ * Copyright (c) 2015 Andriy Voskoboinyk 
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 22:00:19 2015
(r292175)
+++ head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 22:08:27 2015
(r292176)
@@ -3,6 +3,7 @@
 /*-
  * Copyright (c) 2010 Damien Bergamini 
  * Copyright (c) 2014 Kevin Lo 
+ * Copyright (c) 2015 Andriy Voskoboinyk 
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above

Modified: head/sys/dev/wpi/if_wpi.c
==
--- head/sys/dev/wpi/if_wpi.c   Sun Dec 13 22:00:19 2015(r292175)
+++ head/sys/dev/wpi/if_wpi.c   Sun Dec 13 22:08:27 2015(r292176)
@@ -2,6 +2,7 @@
  * Copyright (c) 2006,2007
  * Damien Bergamini 
  * Benjamin Close 
+ * Copyright (c) 2015 Andriy Voskoboinyk 
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above

Modified: head/sys/dev/wpi/if_wpi_debug.h
==
--- head/sys/dev/wpi/if_wpi_debug.h Sun Dec 13 22:00:19 2015
(r292175)
+++ head/sys/dev/wpi/if_wpi_debug.h Sun Dec 13 22:08:27 2015
(r292176)
@@ -2,6 +2,7 @@
  * Copyright (c) 2006,2007
  * Damien Bergamini 
  * Benjamin Close 
+ * Copyright (c) 2015 Andriy Voskoboinyk 
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
___
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: r292172 - head/usr.bin/unzip

2015-12-13 Thread Alex Kozlov
Author: ak (ports committer)
Date: Sun Dec 13 21:31:45 2015
New Revision: 292172
URL: https://svnweb.freebsd.org/changeset/base/292172

Log:
  - Properly set mode and atime/ctime for symlinks
  
  Approved by:  des

Modified:
  head/usr.bin/unzip/unzip.c

Modified: head/usr.bin/unzip/unzip.c
==
--- head/usr.bin/unzip/unzip.c  Sun Dec 13 21:15:56 2015(r292171)
+++ head/usr.bin/unzip/unzip.c  Sun Dec 13 21:31:45 2015(r292172)
@@ -127,7 +127,6 @@ errorx(const char *fmt, ...)
exit(1);
 }
 
-#if 0
 /* non-fatal error message + errno */
 static void
 warning(const char *fmt, ...)
@@ -143,7 +142,6 @@ warning(const char *fmt, ...)
va_end(ap);
fprintf(stderr, ": %s\n", strerror(errno));
 }
-#endif
 
 /* non-fatal error message, no errno */
 static void
@@ -539,12 +537,21 @@ recheck:
return;
}
 
+   ts[0].tv_sec = 0;
+   ts[0].tv_nsec = UTIME_NOW;
+   ts[1] = mtime;
+
/* process symlinks */
linkname = archive_entry_symlink(e);
if (linkname != NULL) {
-   if (symlink(linkname, *path) < 0)
+   if (symlink(linkname, *path) != 0)
error("symlink('%s')", *path);
info(" extracting: %s -> %s\n", *path, linkname);
+   if (lchmod(*path, mode) != 0)
+   warning("Cannot set mode for '%s'", *path);
+   /* set access and modification time */
+   if (utimensat(AT_FDCWD, *path, ts, AT_SYMLINK_NOFOLLOW) != 0)
+   warning("utimensat('%s')", *path);
return;
}
 
@@ -629,9 +636,6 @@ recheck:
info("\n");
 
/* set access and modification time */
-   ts[0].tv_sec = 0;
-   ts[0].tv_nsec = UTIME_NOW;
-   ts[1] = mtime;
if (futimens(fd, ts) != 0)
error("futimens('%s')", *path);
if (close(fd) != 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"


Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

2015-12-13 Thread Warner Losh
On Sun, Dec 13, 2015 at 2:27 PM, Dimitry Andric  wrote:

> On 13 Dec 2015, at 18:04, Ruslan Makhmatkhanov  wrote:
> >
> > Sorry for break in, but I tried to update to r292130 and have this
> messages on `make kernel`. Does it by chance has something to do with
> toolchain update and was it fixed in subsequent commits? Thanks.
> >
> > ===> zlib (install)
> > install -o root -g wheel -m 555   zlib.ko /boot/kernel/
> > kldxref /boot/kernel
> > kldxref: unknown metadata record 4 in file atacard.ko
> > kldxref: unknown metadata record 4 in file atp.ko
> > kldxref: unknown metadata record 4 in file atp.ko
> > kldxref: unknown metadata record 4 in file cmx.ko
> > kldxref: unknown metadata record 4 in file fdc.ko
> > kldxref: unknown metadata record 4 in file if_an.ko
> > kldxref: unknown metadata record 4 in file if_aue.ko
> >
> > [...]
> >
> > It printed one this message for every kernel module.
>
> I think this is fixed by Warner's r292078:
>
> https://svnweb.freebsd.org/base?view=revision=292078
>
>   Augment kldxref to find the new MODULE_PNP_INFO records now in
>   modules, simplify them into a more normal form and write them to
>   linker.hints.
>
>   Differential Review:
>   https://reviews.freebsd.org/D3461


Yes. Perhaps I should have dropped an UPDATING entry to explain
this. I thought I'd actually committed something so that it was silent
when kldxref didn't understand a metadata record a long time ago
so this sort of thing wouldn't happen. I thought I'd merged it last
summer in anticipation of this work landing. What is your build
environment?

The message has 0 to do with the toolchain update. It's all about
the new PNP info in the kernel modules.

Warner
___
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: r292174 - head/sys/dev/usb/wlan

2015-12-13 Thread Andriy Voskoboinyk
Author: avos
Date: Sun Dec 13 21:50:38 2015
New Revision: 292174
URL: https://svnweb.freebsd.org/changeset/base/292174

Log:
  urtwn: add a command queue for sleepable tasks.
  
  An implementation from rum(4) was used (it looks simpler for me).
  Will be used for h/w encryption support.
  
  Reviewed by:  kevlo
  Approved by:  adrian (mentor)
  Differential Revision:https://reviews.freebsd.org/D4447

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

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==
--- head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 21:43:54 2015
(r292173)
+++ head/sys/dev/usb/wlan/if_urtwn.cSun Dec 13 21:50:38 2015
(r292174)
@@ -213,6 +213,9 @@ static uint16_t urtwn_read_2(struct urt
 static uint32_turtwn_read_4(struct urtwn_softc *, uint16_t);
 static int urtwn_fw_cmd(struct urtwn_softc *, uint8_t,
const void *, int);
+static voidurtwn_cmdq_cb(void *, int);
+static int urtwn_cmd_sleepable(struct urtwn_softc *, const void *,
+   size_t, CMD_FUNC_PROTO);
 static voidurtwn_r92c_rf_write(struct urtwn_softc *, int,
uint8_t, uint32_t);
 static voidurtwn_r88e_rf_write(struct urtwn_softc *, int,
@@ -427,6 +430,7 @@ urtwn_attach(device_t self)
 
mtx_init(>sc_mtx, device_get_nameunit(self),
MTX_NETWORK_LOCK, MTX_DEF);
+   URTWN_CMDQ_LOCK_INIT(sc);
URTWN_NT_LOCK_INIT(sc);
callout_init(>sc_watchdog_ch, 0);
mbufq_init(>sc_snd, ifqmaxlen);
@@ -525,6 +529,8 @@ urtwn_attach(device_t self)
>sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap),
URTWN_RX_RADIOTAP_PRESENT);
 
+   TASK_INIT(>cmdq_task, 0, urtwn_cmdq_cb, sc);
+
if (bootverbose)
ieee80211_announce(ic);
 
@@ -574,8 +580,13 @@ urtwn_detach(device_t self)
urtwn_free_rx_list(sc);
URTWN_UNLOCK(sc);
 
-   ieee80211_ifdetach(ic);
+   if (ic->ic_softc == sc) {
+   ieee80211_draintask(ic, >cmdq_task);
+   ieee80211_ifdetach(ic);
+   }
+
URTWN_NT_LOCK_DESTROY(sc);
+   URTWN_CMDQ_LOCK_DESTROY(sc);
mtx_destroy(>sc_mtx);
 
return (0);
@@ -1259,6 +1270,64 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin
return (0);
 }
 
+static void
+urtwn_cmdq_cb(void *arg, int pending)
+{
+   struct urtwn_softc *sc = arg;
+   struct urtwn_cmdq *item;
+
+   /*
+* Device must be powered on (via urtwn_power_on())
+* before any command may be sent.
+*/
+   URTWN_LOCK(sc);
+   if (!(sc->sc_flags & URTWN_RUNNING)) {
+   URTWN_UNLOCK(sc);
+   return;
+   }
+
+   URTWN_CMDQ_LOCK(sc);
+   while (sc->cmdq[sc->cmdq_first].func != NULL) {
+   item = >cmdq[sc->cmdq_first];
+   sc->cmdq_first = (sc->cmdq_first + 1) % URTWN_CMDQ_SIZE;
+   URTWN_CMDQ_UNLOCK(sc);
+
+   item->func(sc, >data);
+
+   URTWN_CMDQ_LOCK(sc);
+   memset(item, 0, sizeof (*item));
+   }
+   URTWN_CMDQ_UNLOCK(sc);
+   URTWN_UNLOCK(sc);
+}
+
+static int
+urtwn_cmd_sleepable(struct urtwn_softc *sc, const void *ptr, size_t len,
+CMD_FUNC_PROTO)
+{
+   struct ieee80211com *ic = >sc_ic;
+
+   KASSERT(len <= sizeof(union sec_param), ("buffer overflow"));
+
+   URTWN_CMDQ_LOCK(sc);
+   if (sc->cmdq[sc->cmdq_last].func != NULL) {
+   device_printf(sc->sc_dev, "%s: cmdq overflow\n", __func__);
+   URTWN_CMDQ_UNLOCK(sc);
+
+   return (EAGAIN);
+   }
+
+   if (ptr != NULL)
+   memcpy(>cmdq[sc->cmdq_last].data, ptr, len);
+   sc->cmdq[sc->cmdq_last].func = func;
+   sc->cmdq_last = (sc->cmdq_last + 1) % URTWN_CMDQ_SIZE;
+   URTWN_CMDQ_UNLOCK(sc);
+
+   ieee80211_runtask(ic, >cmdq_task);
+
+   return (0);
+}
+
 static __inline void
 urtwn_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, uint32_t val)
 {

Modified: head/sys/dev/usb/wlan/if_urtwnvar.h
==
--- head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 21:43:54 2015
(r292173)
+++ head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 13 21:50:38 2015
(r292174)
@@ -71,15 +71,18 @@ struct urtwn_data {
 };
 typedef STAILQ_HEAD(, urtwn_data) urtwn_datahead;
 
+union sec_param {
+   struct ieee80211_keykey;
+};
+
+#define CMD_FUNC_PROTO void (*func)(struct urtwn_softc *, \
+   union sec_param *)
+
 struct urtwn_cmdq {
-   void*arg0;
-   void*arg1;
-   void(*func)(void *);
-   struct ieee80211_key*k;
-   struct ieee80211_key  

svn commit: r292177 - head

2015-12-13 Thread Warner Losh
Author: imp
Date: Sun Dec 13 22:11:37 2015
New Revision: 292177
URL: https://svnweb.freebsd.org/changeset/base/292177

Log:
  The new pnp module records causes older kldxref to spew some
  warnings. Make a note of it to inform people how to get around it.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Sun Dec 13 22:08:27 2015(r292176)
+++ head/UPDATING   Sun Dec 13 22:11:37 2015(r292177)
@@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20151211:
+   The code to start recording plug and play data into the modules has
+   been committed. While the old tools will properly build a new kernel,
+   a number of warnings about "unknown metadata record 4" will be produced
+   for an older kldxref. To avoid such warnings, make sure to rebuild
+   the kernel toolchain (or world). Make sure that you have r292078 or
+   later when trying to build 292077 or later before rebuilding.
+
 20151207:
Debug data files are now built by default with 'make buildworld' and
installed with 'make installworld'. This facilitates debugging but
___
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: r292180 - in head/sys: arm/allwinner arm/amlogic/aml8726 arm/at91 arm/broadcom/bcm2835 arm/freescale/imx arm/lpc arm/ti dev/mmc dev/mmc/host dev/sdhci powerpc/mpc85xx

2015-12-13 Thread Ian Lepore
Author: ian
Date: Mon Dec 14 01:09:25 2015
New Revision: 292180
URL: https://svnweb.freebsd.org/changeset/base/292180

Log:
  Move the DRIVER_MODULE() statements that declare mmc(4) to be a child of
  the various bridge drivers out of dev/mmc.c and into the bridge drivers.
  
  Requested by:jhb (almost two years ago; better late than never)

Modified:
  head/sys/arm/allwinner/a10_mmc.c
  head/sys/arm/amlogic/aml8726/aml8726_mmc.c
  head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
  head/sys/arm/at91/at91_mci.c
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
  head/sys/arm/freescale/imx/imx_sdhci.c
  head/sys/arm/lpc/lpc_mmc.c
  head/sys/arm/ti/ti_sdhci.c
  head/sys/dev/mmc/bridge.h
  head/sys/dev/mmc/host/dwmmc.c
  head/sys/dev/mmc/mmc.c
  head/sys/dev/sdhci/sdhci_fdt.c
  head/sys/dev/sdhci/sdhci_pci.c
  head/sys/powerpc/mpc85xx/fsl_sdhc.c

Modified: head/sys/arm/allwinner/a10_mmc.c
==
--- head/sys/arm/allwinner/a10_mmc.cMon Dec 14 00:22:03 2015
(r292179)
+++ head/sys/arm/allwinner/a10_mmc.cMon Dec 14 01:09:25 2015
(r292180)
@@ -883,3 +883,4 @@ static driver_t a10_mmc_driver = {
 };
 
 DRIVER_MODULE(a10_mmc, simplebus, a10_mmc_driver, a10_mmc_devclass, 0, 0);
+DRIVER_MODULE(mmc, a10_mmc, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/arm/amlogic/aml8726/aml8726_mmc.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_mmc.c  Mon Dec 14 00:22:03 2015
(r292179)
+++ head/sys/arm/amlogic/aml8726/aml8726_mmc.c  Mon Dec 14 01:09:25 2015
(r292180)
@@ -1098,3 +1098,4 @@ static devclass_t aml8726_mmc_devclass;
 DRIVER_MODULE(aml8726_mmc, simplebus, aml8726_mmc_driver,
 aml8726_mmc_devclass, 0, 0);
 MODULE_DEPEND(aml8726_mmc, aml8726_gpio, 1, 1, 1);
+DRIVER_MODULE(mmc, aml8726_mmc, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c  Mon Dec 14 00:22:03 
2015(r292179)
+++ head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c  Mon Dec 14 01:09:25 
2015(r292180)
@@ -1377,3 +1377,4 @@ static devclass_t aml8726_sdxc_devclass;
 DRIVER_MODULE(aml8726_sdxc, simplebus, aml8726_sdxc_driver,
 aml8726_sdxc_devclass, 0, 0);
 MODULE_DEPEND(aml8726_sdxc, aml8726_gpio, 1, 1, 1);
+DRIVER_MODULE(mmc, aml8726_sdxc, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/arm/at91/at91_mci.c
==
--- head/sys/arm/at91/at91_mci.cMon Dec 14 00:22:03 2015
(r292179)
+++ head/sys/arm/at91/at91_mci.cMon Dec 14 01:09:25 2015
(r292180)
@@ -1412,3 +1412,4 @@ DRIVER_MODULE(at91_mci, simplebus, at91_
 DRIVER_MODULE(at91_mci, atmelarm, at91_mci_driver, at91_mci_devclass, NULL,
 NULL);
 #endif
+DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Mon Dec 14 00:22:03 
2015(r292179)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c   Mon Dec 14 01:09:25 
2015(r292180)
@@ -675,3 +675,4 @@ static driver_t bcm_sdhci_driver = {
 
 DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 
0);
 MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1);
+DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/arm/freescale/imx/imx_sdhci.c
==
--- head/sys/arm/freescale/imx/imx_sdhci.c  Mon Dec 14 00:22:03 2015
(r292179)
+++ head/sys/arm/freescale/imx/imx_sdhci.c  Mon Dec 14 01:09:25 2015
(r292180)
@@ -827,4 +827,4 @@ static driver_t imx_sdhci_driver = {
 
 DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 
0);
 MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1);
-
+DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/arm/lpc/lpc_mmc.c
==
--- head/sys/arm/lpc/lpc_mmc.c  Mon Dec 14 00:22:03 2015(r292179)
+++ head/sys/arm/lpc/lpc_mmc.c  Mon Dec 14 01:09:25 2015(r292180)
@@ -775,3 +775,4 @@ static driver_t lpc_mmc_driver = {
 };
 
 DRIVER_MODULE(lpcmmc, simplebus, lpc_mmc_driver, lpc_mmc_devclass, 0, 0);
+DRIVER_MODULE(mmc, lpcmmc, mmc_driver, mmc_devclass, NULL, NULL);

Modified: head/sys/arm/ti/ti_sdhci.c
==
--- head/sys/arm/ti/ti_sdhci.c  Mon Dec 14 00:22:03 2015(r292179)
+++ head/sys/arm/ti/ti_sdhci.c  Mon Dec 14 01:09:25 2015(r292180)
@@ -721,3 +721,4 @@ static 

Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

2015-12-13 Thread Ruslan Makhmatkhanov

Warner Losh wrote on 12/14/15 01:03 AM:

On Sun, Dec 13, 2015 at 2:27 PM, Dimitry Andric  wrote:


On 13 Dec 2015, at 18:04, Ruslan Makhmatkhanov  wrote:


Sorry for break in, but I tried to update to r292130 and have this

messages on `make kernel`. Does it by chance has something to do with
toolchain update and was it fixed in subsequent commits? Thanks.


===> zlib (install)
install -o root -g wheel -m 555   zlib.ko /boot/kernel/
kldxref /boot/kernel
kldxref: unknown metadata record 4 in file atacard.ko
kldxref: unknown metadata record 4 in file atp.ko
kldxref: unknown metadata record 4 in file atp.ko
kldxref: unknown metadata record 4 in file cmx.ko
kldxref: unknown metadata record 4 in file fdc.ko
kldxref: unknown metadata record 4 in file if_an.ko
kldxref: unknown metadata record 4 in file if_aue.ko

[...]

It printed one this message for every kernel module.


I think this is fixed by Warner's r292078:

https://svnweb.freebsd.org/base?view=revision=292078

   Augment kldxref to find the new MODULE_PNP_INFO records now in
   modules, simplify them into a more normal form and write them to
   linker.hints.

   Differential Review:
   https://reviews.freebsd.org/D3461



Yes. Perhaps I should have dropped an UPDATING entry to explain
this. I thought I'd actually committed something so that it was silent
when kldxref didn't understand a metadata record a long time ago
so this sort of thing wouldn't happen. I thought I'd merged it last
summer in anticipation of this work landing. What is your build
environment?

The message has 0 to do with the toolchain update. It's all about
the new PNP info in the kernel modules.

Warner


My current system was at r291113, so this is the culprit. Thank you for 
UPDATING entry.


--
Regards,
Ruslan

T.O.S. Of Reality
___
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: r292181 - head/share/man/man4

2015-12-13 Thread Kevin Lo
Author: kevlo
Date: Mon Dec 14 07:08:17 2015
New Revision: 292181
URL: https://svnweb.freebsd.org/changeset/base/292181

Log:
  Add the cryptodev device.

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

Modified: head/share/man/man4/aesni.4
==
--- head/share/man/man4/aesni.4 Mon Dec 14 01:09:25 2015(r292180)
+++ head/share/man/man4/aesni.4 Mon Dec 14 07:08:17 2015(r292181)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 6, 2010
+.Dd December 14, 2015
 .Dt AESNI 4
 .Os
 .Sh NAME
@@ -36,6 +36,7 @@ place the following lines in your
 kernel configuration file:
 .Bd -ragged -offset indent
 .Cd "device crypto"
+.Cd "device cryptodev"
 .Cd "device aesni"
 .Ed
 .Pp
___
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"