]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoMany updates to cxgbe(4)
np [Fri, 16 Dec 2011 02:09:51 +0000 (02:09 +0000)]
Many updates to cxgbe(4)

- Device configuration via plain text config file.  Also able to operate
  when not attached to the chip as the master driver.

- Generic "work request" queue that serves as the base for both ctrl and
  ofld tx queues.

- Generic interrupt handler routine that can process any event on any
  kind of ingress queue (via a dispatch table).

- A couple of new driver ioctls.  cxgbetool can now install a firmware
  to the card ("loadfw" command) and can read the card's memory
  ("memdump" and "tcb" commands).

- Lots of assorted information within dev.t4nex.X.misc.*  This is
  primarily for debugging and won't show up in sysctl -a.

- Code to manage the L2 tables on the chip.

- Updates to cxgbe(4) man page to go with the tunables that have changed.

- Updates to the shared code in common/

- Updates to the driver-firmware interface (now at fw 1.4.16.0)

MFC after: 1 month

12 years agoPatch the new NFS server in a manner analagous to r228520 for the
rmacklem [Fri, 16 Dec 2011 00:58:41 +0000 (00:58 +0000)]
Patch the new NFS server in a manner analagous to r228520 for the
old NFS server, so that it correctly handles a count == 0 argument
for Commit.

PR: kern/118126
MFC after: 2 weeks

12 years agoIn contrib/telnet/libtelnet/sra.c, use the correct number of bytes to
dim [Fri, 16 Dec 2011 00:48:53 +0000 (00:48 +0000)]
In contrib/telnet/libtelnet/sra.c, use the correct number of bytes to
zero the password buffer.

MFC after: 1 week

12 years agoUnfortunately, clang gives a warning about sendmail code that cannot be
dim [Fri, 16 Dec 2011 00:39:44 +0000 (00:39 +0000)]
Unfortunately, clang gives a warning about sendmail code that cannot be
turned off yet.  Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.

MFC after: 1 week

12 years agoIn lib/libpmc/libpmc.c, struct pmc_cputype_map's pm_cputype field should
dim [Fri, 16 Dec 2011 00:13:43 +0000 (00:13 +0000)]
In lib/libpmc/libpmc.c, struct pmc_cputype_map's pm_cputype field should
be of type 'enum pmc_cputype', not 'enum pmc_class'.

MFC after: 1 week

12 years agoAdd "%option noinput" to aicasm_scan.l and aicasm_macro_scan.l, so no
dim [Fri, 16 Dec 2011 00:04:28 +0000 (00:04 +0000)]
Add "%option noinput" to aicasm_scan.l and aicasm_macro_scan.l, so no
unneeded input functions will be emitted.

Spotted by: arundel
MFC after: 1 week

12 years agoIn lib/libipsec/policy_token.l, use lex's standard "%option noinput"
dim [Fri, 16 Dec 2011 00:01:19 +0000 (00:01 +0000)]
In lib/libipsec/policy_token.l, use lex's standard "%option noinput"
instead of hand-defining the YY_NO_INPUT macro.

MFC after: 1 week

12 years agoIn sys/contrib/ngatm/netnatm/msg/uni_ie.c, use a more appropriate way to
dim [Thu, 15 Dec 2011 23:47:36 +0000 (23:47 +0000)]
In sys/contrib/ngatm/netnatm/msg/uni_ie.c, use a more appropriate way to
tell the compiler some parameters are purposefully unused.

MFC after: 1 week

12 years agoIn contrib/file/softmagic.c, fix a potential format string security
dim [Thu, 15 Dec 2011 23:28:17 +0000 (23:28 +0000)]
In contrib/file/softmagic.c, fix a potential format string security
problem.  (This fix has already been applied upstream, but we do not
have the latest version of file in the tree at the moment.)

MFC after: 1 week

12 years agoDefine YY_NO_INPUT in lib/libipsec/policy_token.l, so lex's input()
dim [Thu, 15 Dec 2011 23:22:24 +0000 (23:22 +0000)]
Define YY_NO_INPUT in lib/libipsec/policy_token.l, so lex's input()
function does not get defined needlessly.

MFC after: 1 week

12 years agoDisable one more clang warning when WARNS <= 3.
dim [Thu, 15 Dec 2011 23:13:57 +0000 (23:13 +0000)]
Disable one more clang warning when WARNS <= 3.

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, the
dim [Thu, 15 Dec 2011 23:06:46 +0000 (23:06 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, the
dt_popc() function assumes that either _ILP32 or _LP64 is defined,
otherwise it has no suitable implementation.

However, the _ILP32 and _LP64 macros come from isa_defs.h, which is not
included in this file.  Add the include now, to get the macros defined.

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c, use the
dim [Thu, 15 Dec 2011 22:46:04 +0000 (22:46 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c, use the
correct printf format for a key_t (aka long).

MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c, use the
dim [Thu, 15 Dec 2011 22:37:33 +0000 (22:37 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c, use the
correct printf format for an unsigned long.

MFC after: 1 week

12 years agoCast away a clang alignment warning in drti.c's fixsymbol() function.
dim [Thu, 15 Dec 2011 22:10:27 +0000 (22:10 +0000)]
Cast away a clang alignment warning in drti.c's fixsymbol() function.
This code only runs on i386 and amd64, so there should be no problems if
buf + sec->dofs_offset is not aligned (which is unlikely anyway).

MFC after: 1 week

12 years agoClang has more warnings enabled by default, and when using -Wall, so if WARNS
dim [Thu, 15 Dec 2011 22:08:08 +0000 (22:08 +0000)]
Clang has more warnings enabled by default, and when using -Wall, so if WARNS
is set to low values, some of them have to be disabled explicitly.

MFC after: 1 week

12 years agoModify pw_copy:
bapt [Thu, 15 Dec 2011 22:07:36 +0000 (22:07 +0000)]
Modify pw_copy:
- if pw is NULL and oldpw is not NULL then the oldpw is deleted
- if pw->pw_name != oldpw->pw_name but pw->pw_uid == oldpw->pw_uid
then it renames the user

add new gr_* functions so now gr_util API is similar to pw_util API,
this allow to manipulate groups in a safe way.

Reviewed by: des
Approved by: des
MFC after: 1 month

12 years agoRemove redundant assignment.
pjd [Thu, 15 Dec 2011 22:05:23 +0000 (22:05 +0000)]
Remove redundant assignment.

Found by: Clang Static Analyzer
MFC after: 1 week

12 years agoSimplify code by changing functions types from int to avoid, as the functions
pjd [Thu, 15 Dec 2011 22:03:17 +0000 (22:03 +0000)]
Simplify code by changing functions types from int to avoid, as the functions
always return 0.

Found by: Clang Static Analyzer
MFC after: 1 week

12 years agoRemove redundant setting of the error variable.
pjd [Thu, 15 Dec 2011 22:01:34 +0000 (22:01 +0000)]
Remove redundant setting of the error variable.

Found by: Clang Static Analyzer
MFC after: 1 week

12 years ago- Put one file into one line. This makes keeping local changes and merging
pjd [Thu, 15 Dec 2011 21:06:37 +0000 (21:06 +0000)]
- Put one file into one line. This makes keeping local changes and merging
  with FreeBSD easier for vendors.
- For optional files use variables starting with underscore.

Both changes make rc.d/Makefile look similar to sys/modules/Makefile.

Reviewed by: dim

12 years agoSince clang does not support the tls_model attribute used in malloc.c
dim [Thu, 15 Dec 2011 20:40:11 +0000 (20:40 +0000)]
Since clang does not support the tls_model attribute used in malloc.c
yet (see LLVM PR 9788), and warns about it, rub it out for now.  When
clang grows support for this attribute, I will revert this again.

MFC after: 1 week

12 years agoBring in reallocblk to ext2fs.
pfg [Thu, 15 Dec 2011 20:31:18 +0000 (20:31 +0000)]
Bring in reallocblk to ext2fs.

The feature has been standard for a while in UFS as a means to reduce
fragmentation, therefore maintaining consistent performance with
filesystem aging. This is also very similar to what ext4 calls
"delayed allocation".

In his 2010 GSoC, Zheng Liu ported and benchmarked the missing
FANCY_REALLOC code to find more consistent performance improvements than
with the preallocation approach.

PR: 159233
Author: Zheng Liu <gnehzuil AT SPAMFREE gmail DOT com>
Sponsored by: Google Inc.
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoIn lib/libc/rpc/crypt_client.c, fix a clang warning about an implicit
dim [Thu, 15 Dec 2011 20:27:36 +0000 (20:27 +0000)]
In lib/libc/rpc/crypt_client.c, fix a clang warning about an implicit
conversion between enum desdir/desmode from include/rpc/des.h, and enum
desdir/desmode from include/rpcsvc/crypt.x.  These are actually
different enums, with different value names, but by accident the integer
representation of the enum values happened to be the same.

MFC after: 1 week

12 years agoRemove meaningless self-assignment in res_send.c, otherwise clang will
dim [Thu, 15 Dec 2011 20:10:12 +0000 (20:10 +0000)]
Remove meaningless self-assignment in res_send.c, otherwise clang will
warn about it.  I guess this was originally done to silence a bogus
warning by an older version of gcc, but I could not reproduce it with
any version of gcc that I have access to.

MFC after: 1 week

12 years agoThe TCB_GET32() and TCB_GET64() macros in the i386 and amd64-specific
dim [Thu, 15 Dec 2011 19:42:25 +0000 (19:42 +0000)]
The TCB_GET32() and TCB_GET64() macros in the i386 and amd64-specific
versions of pthread_md.h have a special case of dereferencing a null
pointer.  Clang warns about this with:

In file included from lib/libthr/arch/i386/i386/pthread_md.c:36:
lib/libthr/arch/i386/include/pthread_md.h:96:10: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
        return (TCB_GET32(tcb_self));
                ^~~~~~~~~~~~~~~~~~~
lib/libthr/arch/i386/include/pthread_md.h:73:13: note: expanded from:
            : "m" (*(u_int *)(__tcb_offset(name))));            \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/libthr/arch/i386/include/pthread_md.h:96:10: note: consider using __builtin_trap() or qualifying pointer with 'volatile'

Since this indirection is done relative to the fs or gs segment, to
retrieve thread-specific data, it is an exception to the rule.

Therefore, add a volatile qualifier to tell the compiler we really want
to dereference a zero address.

MFC after: 1 week

12 years agoSimplify the implementation of the identity mapping in start_all_aps().
alc [Thu, 15 Dec 2011 17:54:23 +0000 (17:54 +0000)]
Simplify the implementation of the identity mapping in start_all_aps().
Since mpboot.s enables processor support for PG_PS before enabling
paging, there is no reason that the identity must use 4 KB page mappings.

Discussed with: jhb

12 years agoUse vm_mmap_to_errno().
jhb [Thu, 15 Dec 2011 15:17:19 +0000 (15:17 +0000)]
Use vm_mmap_to_errno().

Submitted by: kib

12 years agoSimplify rtrequest(RTM_ADD): ifa can't be NULL after rt_getifa_fib().
glebius [Thu, 15 Dec 2011 12:49:10 +0000 (12:49 +0000)]
Simplify rtrequest(RTM_ADD): ifa can't be NULL after rt_getifa_fib().

12 years agoFix a bug where sctp_sendmdg() uses uninitialized memory.
tuexen [Thu, 15 Dec 2011 12:35:03 +0000 (12:35 +0000)]
Fix a bug where sctp_sendmdg() uses uninitialized memory.

MFC after: 3 days.

12 years agoARM pmap fixes:
raj [Thu, 15 Dec 2011 12:14:15 +0000 (12:14 +0000)]
ARM pmap fixes:

- Write Buffers have to be drained after write to Page Table even if caches
  are in write-through mode.

- Make sure to sync PTE in pmap_zero_page_generic().

Submitted by: Michal Mazur
Reviewed by: cognet
Obtained from: Semihalf
MFC after: 1 month

12 years agoAdd a pointless and superfluous GNUism that people at a certain large data
theraven [Thu, 15 Dec 2011 11:21:56 +0000 (11:21 +0000)]
Add a pointless and superfluous GNUism that people at a certain large data
aggregation and advertising company seem to believe is standard.

Approved by: dim (mentor)

12 years agoSmall style(9) improvements.
theraven [Thu, 15 Dec 2011 11:16:41 +0000 (11:16 +0000)]
Small style(9) improvements.

Approved by: dim (mentor)

12 years agoAdd RADIX_MPATH to LINT.
glebius [Thu, 15 Dec 2011 11:15:23 +0000 (11:15 +0000)]
Add RADIX_MPATH to LINT.

12 years agos/timout/timeout
kevlo [Thu, 15 Dec 2011 06:29:13 +0000 (06:29 +0000)]
s/timout/timeout

12 years agoRevert r228521: sometimes job output is lost
fjoe [Thu, 15 Dec 2011 06:25:19 +0000 (06:25 +0000)]
Revert r228521: sometimes job output is lost
(see tools/regression/usr.bin/make/execution/joberr test).

openpty(fd + 0, fd + 1,...) version does not have this problem but
it sometimes enters an infinite sleep in "ttywait" state in tty_drain()
when make(1) closes slave pty.

12 years agoFix last-minute typo.
fjoe [Thu, 15 Dec 2011 06:12:43 +0000 (06:12 +0000)]
Fix last-minute typo.

12 years agoAdd job error output test.
fjoe [Thu, 15 Dec 2011 06:01:06 +0000 (06:01 +0000)]
Add job error output test.

make(1) with openpty() currently fails this test: there's a race condition
and error output is sometimes lost.

12 years agoEliminate vestiges of page coloring.
alc [Thu, 15 Dec 2011 05:07:16 +0000 (05:07 +0000)]
Eliminate vestiges of page coloring.

12 years agojob make: if stdout is a tty create a pty when running a command.
fjoe [Thu, 15 Dec 2011 03:13:23 +0000 (03:13 +0000)]
job make: if stdout is a tty create a pty when running a command.

12 years agoHonor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
delphij [Thu, 15 Dec 2011 02:26:53 +0000 (02:26 +0000)]
Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
the full length from offset is being flushed.  Note that for now VOP_FSYNC
does not support offset and length parameters so we still do the same full
VOP_FSYNC.  This issue was reported at FreeNAS support site as FreeNAS
ticket #1096.

Submitted by: "ceckerle" <ce.freenas eckerle net>
Prodded by: gcooper
Reviewed by: rmacklem
MFC after: 2 weeks

12 years ago* Add in the gpio/gpioled drivers into AR91XX_BASE.
adrian [Thu, 15 Dec 2011 01:05:38 +0000 (01:05 +0000)]
* Add in the gpio/gpioled drivers into AR91XX_BASE.
* Add in a default GPIO section for AR91XX_BASE.hints, which doesn't
  define the GPIO function masks or any GPIO pines.
* Add in the GPIO line definitions for LEDs and GPIO pins for the
  TP-WR1043nd.

I've verified the LEDs work fine using gpioset.

12 years agoRe-jiggle the GPIO code a little to remove the hard-coded AR71xx GPIO
adrian [Thu, 15 Dec 2011 01:03:49 +0000 (01:03 +0000)]
Re-jiggle the GPIO code a little to remove the hard-coded AR71xx GPIO
config and function mask setup.

* "gpiomask" now specifies which GPIO pins to enable, for devices to bind to.
* "function_set" allows bits in the function register to be set at GPIO setup.
* "function_clear" allows bits in the function register to be cleared at
  GPIO setup.

The function_set/function_clear bits allow for individual GPIO pins to either
drive a GPIO line or an alternate function - eg USB, JTAG, etc. This allows
for things like CS1/CS2 be enabled for those boards w/ >1 SPI device connected,
or disabling JTAG for the AR7240 (which is apparently needed ..)

I've verified this on the AR71xx.

12 years agoAdd the 11n chipset RF frontends to the linker set, even though they're not
adrian [Thu, 15 Dec 2011 00:59:11 +0000 (00:59 +0000)]
Add the 11n chipset RF frontends to the linker set, even though they're not
attached this way.

The AR5212 based NICs have a variety of RF frontends, so there's a linker set
which the AR5212 attach routine calls. The same framework is used for the
AR5416 and later but as there's a fixed RF frontend for each 11n NIC, it
is just directly attached.

However in the case of compiling a cut down HAL (eg _just_ AR9130 WMAC support),
the linker set ends up being empty and this causes the compile to fail.

So this is just a workaround for that - it means those users who wish an 11n
only HAL can compile the 11n chipsets and RF frontend they need, and just
"ath_ar5212" for the AR5212/AR5416 common code, and it'll just work.

Sponsored by: Hobnob, Inc.

12 years agoPrint out the radio RF version at startup, so I can better see which
adrian [Thu, 15 Dec 2011 00:55:27 +0000 (00:55 +0000)]
Print out the radio RF version at startup, so I can better see which
RF frontend versions people have when they submit problem reports.

Sponsored by: Hobnob, Inc.

12 years agoUse the correct RF version probe routine.
adrian [Thu, 15 Dec 2011 00:54:11 +0000 (00:54 +0000)]
Use the correct RF version probe routine.

Obtained from: Atheros
Sponsored by: Hobnob, Inc.

12 years agoModify the ACL code slightly to support a few nifty things:
adrian [Thu, 15 Dec 2011 00:52:30 +0000 (00:52 +0000)]
Modify the ACL code slightly to support a few nifty things:

* Call it before sending probe responses, so the ACL code has the
  chance to reject sending them.

* Pass the whole frame to the ACL code now, rather than just the
  destination MAC - that way the ACL module can look at the frame
  contents to determine what the response should be.

This is part of some uncommitted work to support band steering.

Sponsored by: Hobnob, Inc.

12 years agoCreate large page mappings in pmap_map().
alc [Wed, 14 Dec 2011 23:57:47 +0000 (23:57 +0000)]
Create large page mappings in pmap_map().

MFC after: 6 weeks

12 years agoAdd a test for r228510.
jilles [Wed, 14 Dec 2011 23:26:48 +0000 (23:26 +0000)]
Add a test for r228510.

12 years agoReflect the move of eventtimers(7) to eventtimers(4).
delphij [Wed, 14 Dec 2011 23:22:40 +0000 (23:22 +0000)]
Reflect the move of eventtimers(7) to eventtimers(4).

12 years agoFix select/poll/kqueue for write on reverse direction before first write.
jilles [Wed, 14 Dec 2011 22:26:39 +0000 (22:26 +0000)]
Fix select/poll/kqueue for write on reverse direction before first write.

The reverse direction of a pipe is lazily allocated on the first write in
that direction (because pipes are usually used in one direction only).  A
special case is needed to ensure the pipe appears writable before the first
write because there are 0 bytes of pending data in 0 bytes of buffer space
at that point, leaving 0 bytes of data that can be written with the normal
code.

Note that the first write returns [ENOMEM] if kern.ipc.maxpipekva is
exceeded and does not block or return [EAGAIN], so selecting true for write
is correct even in that case.

PR: kern/93685
Submitted by: gianni
MFC after: 2 weeks

12 years agoAdd a helper API to allow in-kernel code to map portions of shared memory
jhb [Wed, 14 Dec 2011 22:22:19 +0000 (22:22 +0000)]
Add a helper API to allow in-kernel code to map portions of shared memory
objects created by shm_open(2) into the kernel's address space.  This
provides a convenient way for creating shared memory buffers between
userland and the kernel without requiring custom character devices.

12 years agoImprove fix for random USB transfer time out.
hselasky [Wed, 14 Dec 2011 22:14:05 +0000 (22:14 +0000)]
Improve fix for random USB transfer time out.

Suggested by: YougHyeon
MFC after: 3 days

12 years agoMerge ext2_readwrite.c into ext2_vnops.c as done in UFS in r101729.
pfg [Wed, 14 Dec 2011 22:04:14 +0000 (22:04 +0000)]
Merge ext2_readwrite.c into ext2_vnops.c as done in UFS in r101729.

This removes the obfuscations mentioned in ext2_readwrite and
places the clustering funtion in a location similar to other
UFS-based implementations.

No performance or functional changeses are expected from
this move.

PR: kern/159232
Suggested by: bde
Approved by: jhb (mentor)
MFC after: 2 weeks

12 years agoAdd SEE ALSO.
joel [Wed, 14 Dec 2011 19:48:21 +0000 (19:48 +0000)]
Add SEE ALSO.

12 years agoMake *intr{cnt,names} on ARM reside in data section, similar to other arches.
raj [Wed, 14 Dec 2011 17:12:59 +0000 (17:12 +0000)]
Make *intr{cnt,names} on ARM reside in data section, similar to other arches.

sintrnames and sintrcnt are initialized with non-zero values, which were
discarded by the .bss directive, so consumers like "vmstat -i" were not
getting correct data.

Submitted by: Lukasz Plachno
Obtained from: Semihalf
MFC after: 1 month

12 years ago_rtld_bind() read-locks the bind lock, and possible plt resolution
kib [Wed, 14 Dec 2011 16:47:53 +0000 (16:47 +0000)]
_rtld_bind() read-locks the bind lock, and possible plt resolution
from the dispatcher would also acquire bind lock in read mode, which
is the supported operation. plt is explicitely designed to allow safe
multithreaded updates, so the shared lock do not cause problems.

The error in r228435 is that it allows read lock acquisition after the
write lock for the bind block.  If we dlopened the shared object that
contains IRELATIVE or jump slot which target is STT_GNU_IFUNC, then
possible recursive plt resolve from the dispatcher would cause it.

Postpone the resolution for irelative/ifunc right before initializers
are called, and drop bind lock around calls to dispatcher.  Use
initlist to iterate over the objects instead of the ->next, due to
drop of the bind lock in iteration.

For i386/reloc.c:reloc_iresolve(), fix calculation of the dispatch
function address for dso, by taking into account possible non-zero
relocbase.

MFC after: 3 weeks

12 years agoRework the attachement to probe directly on isab(4).
fabient [Wed, 14 Dec 2011 15:39:51 +0000 (15:39 +0000)]
Rework the attachement to probe directly on isab(4).
Depend on r228496.

Requested by: jhb
MFC after: 1 month

12 years agoAfter several suggestions from people, move eventtimers page from 7 to 4.
mav [Wed, 14 Dec 2011 15:19:40 +0000 (15:19 +0000)]
After several suggestions from people, move eventtimers page from 7 to 4.

12 years agoMore MLINKS for rtalloc.9
glebius [Wed, 14 Dec 2011 14:55:19 +0000 (14:55 +0000)]
More MLINKS for rtalloc.9

12 years agoUpdate this page to describe modern interfaces.
glebius [Wed, 14 Dec 2011 14:52:50 +0000 (14:52 +0000)]
Update this page to describe modern interfaces.

12 years ago- The previous commit (r228449) accidentally moved the vm.stats.vm.* sysctls
eadler [Wed, 14 Dec 2011 13:25:00 +0000 (13:25 +0000)]
- The previous commit (r228449) accidentally moved the vm.stats.vm.* sysctls
  to vm.stats.sys.  Move them back.

Noticed by: pho
Reviewed by: bde (earlier version)
Approved by: bz
MFC after: 1 week
Pointy hat to: me

12 years agoAdd PCI IDs for the Intel ICH9M SATA controllers.
mav [Wed, 14 Dec 2011 13:12:55 +0000 (13:12 +0000)]
Add PCI IDs for the Intel ICH9M SATA controllers.

MFC after: 2 weeks

12 years agoImplement BUS_ADD_CHILD() for the isab(4) driver. It already calls
jhb [Wed, 14 Dec 2011 12:34:02 +0000 (12:34 +0000)]
Implement BUS_ADD_CHILD() for the isab(4) driver.  It already calls
bus_generic_probe() and bus_generic_attach() to handle drivers that add
new children via identify methods.

MFC after: 1 week

12 years agoSlightly alter the C1X definitions in in cdefs.h:
ed [Wed, 14 Dec 2011 09:09:37 +0000 (09:09 +0000)]
Slightly alter the C1X definitions in in cdefs.h:

- Add _Alignas(). Unfortunately this macro is only partially functional.
  The C1X standard will allow both an integer and a type name to be
  passed to this macro, while this macro only allows an integer. To be
  portable, one must use _Alignas(_Alignof(double)) to use type names.

- Don't do _Static_assert() when __COUNTER__ is not supported. We'd
  better keep this implementation robust and allow it to be used in
  header files, without mysteriously breaking older compilers.

12 years agoFix for random USB transfer time out.
hselasky [Wed, 14 Dec 2011 08:52:27 +0000 (08:52 +0000)]
Fix for random USB transfer time out.

Submitted by: PseudoCylon
MFC after: 3 days

12 years agoFix definition of XHCI port power bit.
hselasky [Wed, 14 Dec 2011 08:44:16 +0000 (08:44 +0000)]
Fix definition of XHCI port power bit.

Reported by: Kohji Okuno
MFC after: 3 days

12 years agoClean up includes; the prototype for getosreldate() has moved to
ru [Wed, 14 Dec 2011 08:35:08 +0000 (08:35 +0000)]
Clean up includes; the prototype for getosreldate() has moved to
<unistd.h> in r183390.

12 years agoDo not clobber the ingress queue's congestion setting.
np [Wed, 14 Dec 2011 05:34:23 +0000 (05:34 +0000)]
Do not clobber the ingress queue's congestion setting.

MFC after: 1 month

12 years agoMatch other formatting.
obrien [Wed, 14 Dec 2011 02:31:32 +0000 (02:31 +0000)]
Match other formatting.

12 years agoUse usbd_transfer_unsetup() instead of usbd_transfer_stop() so that
hselasky [Wed, 14 Dec 2011 01:03:07 +0000 (01:03 +0000)]
Use usbd_transfer_unsetup() instead of usbd_transfer_stop() so that
we don't have to worry about locking.

MFC after: 1 weeks

12 years agoStop USB audio transfers early so that any audio applications
hselasky [Wed, 14 Dec 2011 00:48:20 +0000 (00:48 +0000)]
Stop USB audio transfers early so that any audio applications
will time out and close opened /dev/dspX.Y device(s), if
any. This is a workaround because we cannot unregister PCM
devices while the audio character device is in use.

Add a missing inclusion guard.

MFC after: 1 weeks

12 years agoImplement better support for USB controller suspend and resume.
hselasky [Wed, 14 Dec 2011 00:28:54 +0000 (00:28 +0000)]
Implement better support for USB controller suspend and resume.

This patch should remove the need for kldunload of USB
controller drivers at suspend and kldload of USB controller
drivers at resume.

This patch also fixes some build issues in avr32dci.c

MFC after: 2 weeks

12 years agoChange targ(4) to use cdevpriv, instead of multiple character devices.
ed [Tue, 13 Dec 2011 21:26:33 +0000 (21:26 +0000)]
Change targ(4) to use cdevpriv, instead of multiple character devices.

Also update the manpage and the scsi_target example program accordingly.

Discussed on: scsi@
Tested by: Chuck Tuffli <chuck tuffli net>

12 years agoDestroy DMA tag for jumbo RX buffer in device detach.
yongari [Tue, 13 Dec 2011 20:31:57 +0000 (20:31 +0000)]
Destroy DMA tag for jumbo RX buffer in device detach.

12 years agoBCM5720 performance tweak from Broadcom.
yongari [Tue, 13 Dec 2011 20:26:46 +0000 (20:26 +0000)]
BCM5720 performance tweak from Broadcom.
 o Allow multiple outstanding read requests from non-LSO read DMA engine.
 o Allow 4KB burst length reads for non-LSO frames.
 o Enable 512B burst length reads for buffer descriptors.

Submitted by: Geans Pin < geanspin <> broadcom dot com >

12 years agoReimplement CTASSERT() using _Static_assert().
ed [Tue, 13 Dec 2011 19:39:24 +0000 (19:39 +0000)]
Reimplement CTASSERT() using _Static_assert().

12 years agoMake support for C1X keywords more complete.
ed [Tue, 13 Dec 2011 19:37:27 +0000 (19:37 +0000)]
Make support for C1X keywords more complete.

- _Alignof(), which returns the aligment of a certain type.
- _Static_assert(), which can be used to check compile-time assertions.
- _Thread_local, which uses TLS on a variable.

MFC after: 3 months
Reviewed by: mdf

12 years agoRework link state tracking and remove superfluous link UP/DOWN
yongari [Tue, 13 Dec 2011 18:11:25 +0000 (18:11 +0000)]
Rework link state tracking and remove superfluous link UP/DOWN
messages.
 o Add check for actually resolved speed in miibus_statchg callback
   instead of blindly reprogramming BCE_EMAC_MODE register.  The
   callback may be called multiple times(e.g. link UP, link
   transition, auto-negotiate complete etc) while auto-negotiation
   is in progress.  All unresolved link state changes are ignored
   now and setting BCE_EMAC_MODE after link establishment is done
   once.
 o bce(4) is careful enough not to drive MII_TICK if driver got a
   valid link.  To detect lost link, bce(4) relied on link state
   change interrupt and if driver see the interrupt, it forced to
   drive MII_TICK by calling bce_tick() in interrupt handler.
   Because bce(4) generates multiple link state change interrupts
   while auto-negotiation is in progress, bce_tick() would be
   called multiple times and this resulted in generating multiple
   link UP/DOWN messages.
   With this change, bce_tick() is not called in interrupt handler
   anymore such that miibus_statchg callback handles link state
   changes with consistent manner.

Reviewed by: davidch

12 years agoDisallow various debug.kdb sysctl's when securelevel is raised.
obrien [Tue, 13 Dec 2011 17:59:16 +0000 (17:59 +0000)]
Disallow various debug.kdb sysctl's when securelevel is raised.

PR: 161350

12 years agoAdd support for __COUNTER__.
ed [Tue, 13 Dec 2011 17:34:47 +0000 (17:34 +0000)]
Add support for __COUNTER__.

__COUNTER__ allows one to obtain incrementing (read: unique) numbers
from the C preprocesor. This is useful when implementing things like a
robust implementation of CTASSERT(), which currently fails when using
it more than once on a single line of code. Probably not likely to cause
any breakage, but still.

__COUNTER__ was also added to GCC 4.3, but since that implementation is
GPLv3 licensed, I took the liberty of implementing it without looking at
any upstream sources. Therefore, this version is licensed under the same
license as the rest of the code; GPLv2.

12 years agoDon't use __P().
ed [Tue, 13 Dec 2011 14:53:26 +0000 (14:53 +0000)]
Don't use __P().

The rest of the file doesn't use it either and according to style(9), it
should not be used.

12 years agoAdd compatibility support for specifing IPv4 aliases in
glebius [Tue, 13 Dec 2011 14:36:04 +0000 (14:36 +0000)]
Add compatibility support for specifing IPv4 aliases in
rc.conf without the "inet" keyword.

Obtained from: hrs

12 years agoReplace `inline static' by `static inline'.
ed [Tue, 13 Dec 2011 14:06:01 +0000 (14:06 +0000)]
Replace `inline static' by `static inline'.

If I interpret the C standard correctly, the storage specifier should be
placed before the inline keyword. While at it, replace __inline by
inline in the files affected.

12 years ago- Add a sysctl to allow non-root users the ability to set idle
eadler [Tue, 13 Dec 2011 14:00:27 +0000 (14:00 +0000)]
- Add a sysctl to allow non-root users the ability to set idle
priorities.

- While here fix up some style nits.

Discussed with: cperciva (breifly)
Reviewed by: pjd (earlier version)
Reviewed by: bde
Approved by: jhb
MFC after: 1 month

12 years agoReplace __signed by signed.
ed [Tue, 13 Dec 2011 13:38:03 +0000 (13:38 +0000)]
Replace __signed by signed.

The signed keyword is an integral part of the C syntax. There's no need
to use __signed.

12 years agoReplace __const by const in all non-contributed source code.
ed [Tue, 13 Dec 2011 13:32:56 +0000 (13:32 +0000)]
Replace __const by const in all non-contributed source code.

As C1X is close to being released, there is no need to wrap around a
feature that is already part of C90. Most of these files already use
`const' in different placed as well.

12 years agodhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
glebius [Tue, 13 Dec 2011 11:54:51 +0000 (11:54 +0000)]
dhclient-script relied on incorrect behavior of SIOCAIFADDR ioctl,
that changed 0.0.0.0/0.0.0.0 prefix to 0.0.0.0/255.0.0.0.

In the r228313 this behavior was fixed, and since dhclient-script
got broken.

I'm not sure this fix is a perfect one, it just changes
dhclient-script to set 0.0.0.0/255.0.0.0 explicitly.

PR: kern/163206

12 years ago - Fix different variable types use in different files after r121184,
mav [Tue, 13 Dec 2011 11:13:28 +0000 (11:13 +0000)]
 - Fix different variable types use in different files after r121184,
causing problems on amd64.
 - s/%lud/%lu/.

MFC after: 1 month

12 years agoFix few bugs in isp(4) target mode support:
mav [Tue, 13 Dec 2011 09:58:05 +0000 (09:58 +0000)]
Fix few bugs in isp(4) target mode support:
 - in destroy_lun_state() assert hold == 1 instead of 0, as it should
receive hold taken by the create_lun_state() or get_lun_statep() before;
 - fix hold count leak inside rls_lun_statep() that also fired above assert;
 - in destroy_lun_state() use SIM bus number instead of SIM path id for
ISP_GET_PC_ADDR(), as it was before r196008;
 - make isp_disable_lun() to set status in CCB;
 - make isp_target_mark_aborted() set status into the proper CCB.

Reviewed by: mjacob
Sponsored by: iXsystems, inc.
MFC after: 1 month

12 years agoStaticify dumpfs.
ed [Tue, 13 Dec 2011 09:01:44 +0000 (09:01 +0000)]
Staticify dumpfs.

This tool only consists of a single C file, so we can simply mark
everything except main() static. This seems to shave off about 8% of the
binary size.

12 years agoThe "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for
ru [Tue, 13 Dec 2011 08:23:03 +0000 (08:23 +0000)]
The "inet" keyword in the "ifconfig_IF_aliasN" is mandatory for
IPv4 aliases to work since network.subr@197139.

MFC after: 3 days

12 years agoSome cleanup of BOOTP code. Initially I wanted to just change the ifioctl()
glebius [Tue, 13 Dec 2011 07:02:48 +0000 (07:02 +0000)]
Some cleanup of BOOTP code. Initially I wanted to just change the ifioctl()
usage, but end up with more changes.

- Use SIOCAIFADDR instead of old rusty SIOCSIFADDR, SIOCSIFBRDADDR
  and SIOCSIFNETMASK.
- Use queue(9) instead of hand made stailq.
- Use one socket for all ifioctl() and send/receive operations.
- Use __func__ instead of cut-n-paste in logging and panics.
- Axe some dead or strange code.

Tested by: gonzo, Stefan Bethke <stb lassitu.de>

12 years agoBelatedly catch up with r151555. in_scrubprefix() also needs this fix. We
glebius [Tue, 13 Dec 2011 06:56:43 +0000 (06:56 +0000)]
Belatedly catch up with r151555. in_scrubprefix() also needs this fix. We
should compare not only addresses, but their masks, too, when searching
for matching prefix.

12 years agoStyle(9) changes.
adrian [Tue, 13 Dec 2011 05:13:51 +0000 (05:13 +0000)]
Style(9) changes.

12 years agoDocument a large number of currently undocumented sysctls. While here
eadler [Tue, 13 Dec 2011 00:38:50 +0000 (00:38 +0000)]
Document a large number of currently undocumented sysctls. While here
fix some style(9) issues and reduce redundancy.

PR: kern/155491
PR: kern/155490
PR: kern/155489
Submitted by: Galimov Albert <wtfcrap@mail.ru>
Approved by: bde
Reviewed by: jhb
MFC after: 1 week

12 years agoRevert the approach for skipping lockstat_probe_func call when doing
attilio [Mon, 12 Dec 2011 23:29:32 +0000 (23:29 +0000)]
Revert the approach for skipping lockstat_probe_func call when doing
lock_success/lock_failure, introduced in r228424, by directly skipping
in dtrace_probe.

This mainly helps in avoiding namespace pollution and thus lockstat.h
dependency by systm.h.

As an added bonus, this also helps in MFC case.
Reviewed by: avg
MFC after: 3 months (or never)
X-MFC: r228424

12 years agoMake 64-bit procstat output ELF auxiliary vectors for 32-bit processes.
trociny [Mon, 12 Dec 2011 22:01:33 +0000 (22:01 +0000)]
Make 64-bit procstat output ELF auxiliary vectors for 32-bit processes.

Reviewed by: kib
MFC after: 1 week

12 years agoMake procstat -l output similar to the output of limits(1).
trociny [Mon, 12 Dec 2011 21:41:05 +0000 (21:41 +0000)]
Make procstat -l output similar to the output of limits(1).

Suggested by: jhb
MFC after: 1 week

12 years ago- Add support for ASCII art splash screens in TheDraw format
eadler [Mon, 12 Dec 2011 21:12:07 +0000 (21:12 +0000)]
- Add support for ASCII art splash screens in TheDraw format

PR: kern/143370
Submitted by: Antony Mawer <antony@mawer.org>
Reviewed by: gjb (doc)
Reviewed by: des (style)
Approved by: ed
MFC after: 1 month