]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMFV: tcpdump 4.3.0.
Xin LI [Fri, 5 Oct 2012 20:19:28 +0000 (20:19 +0000)]
MFV: tcpdump 4.3.0.

MFC after: 4 weeks

11 years agoMFV: libpcap 1.3.0.
Xin LI [Fri, 5 Oct 2012 18:42:50 +0000 (18:42 +0000)]
MFV: libpcap 1.3.0.

MFC after: 4 weeks

11 years agoAllow time offsets to be negative, e.g. `at 1530 - 15 minutes`.
Martin Cracauer [Fri, 5 Oct 2012 17:54:27 +0000 (17:54 +0000)]
Allow time offsets to be negative, e.g. `at 1530 - 15 minutes`.

This is useful if you have been given some time for some event in some
format and you want your computer to do something to prepare for it.
Without having to do time arithmetic in a shellscript.

The syntax matches what the at(1) usually used on Linux supports.

11 years agoInitialise an uninitialised variable.
Adrian Chadd [Fri, 5 Oct 2012 16:44:00 +0000 (16:44 +0000)]
Initialise an uninitialised variable.

11 years agoFurther adjust the workaround in r234501. Rounding all small requests up
John Baldwin [Fri, 5 Oct 2012 15:52:31 +0000 (15:52 +0000)]
Further adjust the workaround in r234501.  Rounding all small requests up
to 32k swamped the controller causing firmware hangs.  Instead, round
requests smaller than 64k up to the next power of 2 as a general rule.
To handle the one known special case of a command that accepts a 12k
buffer returning a 24k-ish reply, round requests between 8k and 16k up
to 32k rather than 16k.  The result is that commands less than 8k should
now be rounded up to a smaller size (either 4k or 8k) rather than 32k.

PR: kern/155658
Tested by: Andreas Longwitz
MFC after: 1 week

11 years agomount.h: MNTK_VGONE_UPPER and MNTK_VGONE_WAITER were supposed to be different
Andriy Gapon [Fri, 5 Oct 2012 14:42:38 +0000 (14:42 +0000)]
mount.h: MNTK_VGONE_UPPER and MNTK_VGONE_WAITER were supposed to be different

... otherwise a waiter is never woken up.

Reported by: swills
Discussed with: jhb
Approved by: kib
MFC after: 3 days

11 years ago Provide ability for printing and decoding pfsync(4) traffic. This
Gleb Smirnoff [Fri, 5 Oct 2012 07:51:21 +0000 (07:51 +0000)]
  Provide ability for printing and decoding pfsync(4) traffic. This
doesn't mean supporting IFT_PFSYNC (which I hope will eventually
die). This means decoding packets with IP protocol of 240 caught
on any normal interface like Ethernet.

  The code is based on couple of files from OpenBSD, significantly
modified by myself.

  Parser differentiates for four levels of verbosity: no -v, -v,
-vv and -vvv.

  We don't yet forward this code upstream, because currently it
strongly relies on if_pfsync.h and even on pfvar.h. I hope that
this can be fixed in future.

Reviewed by: gnn, delphij

11 years agoFollow Broadcom datasheet:
Pyun YongHyeon [Fri, 5 Oct 2012 07:13:21 +0000 (07:13 +0000)]
Follow Broadcom datasheet:
 Delay 100 microseconds after enabling transmit MAC.
 Delay 10 microseconds after enabling receive MAC.

11 years agoAdd 40 microseconds delay after updating EMAC Mode register as
Pyun YongHyeon [Fri, 5 Oct 2012 06:24:22 +0000 (06:24 +0000)]
Add 40 microseconds delay after updating EMAC Mode register as
recommended by Broadcom data sheet.

11 years agoRemove references to CVS so that people will stop bringing it up
Doug Barton [Fri, 5 Oct 2012 05:01:42 +0000 (05:01 +0000)]
Remove references to CVS so that people will stop bringing it up

For -p:
The localtime update should have been excluded in the first place

The make.conf comparison has been OBE for some time now, and there
is no src.conf equivalent to share/examples/make.conf, so remove
the whole thing.

Update copyright

11 years agoEliminate a stale and a duplicated comment.
Alan Cox [Fri, 5 Oct 2012 04:35:20 +0000 (04:35 +0000)]
Eliminate a stale and a duplicated comment.

11 years agoAPE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep
Pyun YongHyeon [Fri, 5 Oct 2012 03:46:25 +0000 (03:46 +0000)]
APE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep
the MAC connected to the outside world.  So keep the accesses
atomic.

11 years agoDon't touch EMAC Mode and TX/RX MAC Mode register when driver is
Pyun YongHyeon [Fri, 5 Oct 2012 03:35:38 +0000 (03:35 +0000)]
Don't touch EMAC Mode and TX/RX MAC Mode register when driver is
not running.

11 years agoDo not install incomplete unwind.h from clang. This header file was meant
Jung-uk Kim [Fri, 5 Oct 2012 00:35:13 +0000 (00:35 +0000)]
Do not install incomplete unwind.h from clang.  This header file was meant
to be a wrapper for the canonical system header file.  Unfortunately, we do
not have one (yet) and some times it is causing weird failures when clang
is used for building ports.  More complete and correct file will come from
libcxxrt in the future.

Discussed with: dim, kib, theraven
MFC after: 1 week

11 years agoVendor import of tcpdump 4.3.0.
Xin LI [Thu, 4 Oct 2012 22:40:22 +0000 (22:40 +0000)]
Vendor import of tcpdump 4.3.0.

11 years agoVendor import of libpcap 1.3.0.
Xin LI [Thu, 4 Oct 2012 21:07:56 +0000 (21:07 +0000)]
Vendor import of libpcap 1.3.0.

11 years agoDisplay the matrix of inter-domain distances in the SLIT table. This is
John Baldwin [Thu, 4 Oct 2012 20:00:32 +0000 (20:00 +0000)]
Display the matrix of inter-domain distances in the SLIT table.  This is
used to complement the SRAT table on NUMA machines.

MFC after: 1 week

11 years agoFix some memory allocation errors:
Jamie Gritton [Thu, 4 Oct 2012 19:07:05 +0000 (19:07 +0000)]
Fix some memory allocation errors:

* jail_setv will leak a parameter name if jailparam_import fails.
* jailparam_all loses the jailparam pointer on realloc error
  (a clear freshman mistake).
* If jailparam_init fails, the caller doesn't need to jailparam_free
  the buffer.  That's not really clear, so set things to NULL allowing
  jailparam_free to work without error (though it's still not required).

11 years agoMove properly to the next parameter when jailparam_init fails
Jamie Gritton [Thu, 4 Oct 2012 18:59:46 +0000 (18:59 +0000)]
Move properly to the next parameter when jailparam_init fails
 (i.e. on an unknown parameter), to avoid freeing bogus pointers.

11 years agoImplement the quarter rate fractional channel programming for the
Adrian Chadd [Thu, 4 Oct 2012 15:42:45 +0000 (15:42 +0000)]
Implement the quarter rate fractional channel programming for the
AR5416 and AR9280, but leave it disabled by default.

TL;DR: don't enable this code at all unless you go through the process
of getting the NIC re-certified.  This is purely to be used as a
reference and NOT a certified solution by any stretch of the imagination.

The background:

The AR5112 RF synth right up to the AR5133 RF synth (used on the AR5416,
derivative is used for the AR9130/AR9160) only implement down to 2.5MHz
channel spacing in 5GHz.  Ie, the RF synth is programmed in steps of 2.5MHz
(or 5, 10, 20MHz.) So they can't represent the quarter rate channels
in the 4.9GHz PSB (which end in xxx2MHz and xxx7MHz).  They support
fractional spacing in 2GHz (1MHz spacing) (or things wouldn't work,
right?)

So instead of doing this, the RF synth programming for the AR5112 and
later code will round to the nearest available frequency.

If all NICs were RF5112 or later, they'll inter-operate fine - they all
program the same. (And for reference, only the latest revision of the
RF5111 NICs do it, but the driver doesn't yet implement the programming.)

However:

* The AR5416 programming didn't at all implement the fractional synth
  work around as above;
* The AR9280 programming actually programmed the accurate centre frequency
  and thus wouldn't inter-operate with the legacy NICs.

So this patch:

* Implements the 4.9GHz PSB fractional synth workaround, exactly as the
  RF5112 and later code does;
* Adds a very dirty workaround from me to calculate the same channel
  centre "fudge" to the AR9280 code when operating on fractional frequencies
  in 5GHz.

HOWEVER however:

It is disabled by default.  Since the HAL didn't implement this feature,
it's highly unlikely that the AR5416 and AR928x has been tested in these
centre frequencies.  There's a lot of regulatory compliance testing required
before a NIC can have this enabled - checking for centre frequency,
for drift, for synth spurs, for distortion and spectral mask compliance.
There's likely a lot of other things that need testing so please don't
treat this as an exhaustive, authoritative list.  There's a perfectly good
process out there to get a NIC certified by your regulatory domain, please
go and engage someone to do that for you and pay the relevant fees.

If a company wishes to grab this work and certify existing 802.11n NICs
for work in these bands then please be my guest.  The AR9280 works fine
on the correct fractional synth channels (49x2 and 49x7Mhz) so you don't
need to get certification for that. But the 500KHz offset hack may have
the above issues (spur, distortion, accuracy, etc) so you will need to
get the NIC recertified.

Please note that it's also CARD dependent.  Just because the RF synth
will behave correctly doesn't at all mean that the card design will also
behave correctly.  So no, I won't enable this by default if someone
verifies a specific AR5416/AR9280 NIC works.  Please don't ask.

Tested:

I used the following NICs to do basic interoperability testing at
half and quarter rates.  However, I only did very minimal spectrum
analyser testing (mostly "am I about to blow things up" testing;
not "certification ready" testing):

* AR5212 + AR5112 synth
* AR5413 + AR5413 synth
* AR5416 + AR5113 synth
* AR9280

11 years agoDefine clang feature test macro __has_extension. It's used in stdatomic.h.
Tijl Coosemans [Thu, 4 Oct 2012 08:53:05 +0000 (08:53 +0000)]
Define clang feature test macro __has_extension. It's used in stdatomic.h.

11 years agoRemove the M_NOWAIT from bridge_rtable_init as it isn't needed. The function
Andrew Thompson [Thu, 4 Oct 2012 07:40:55 +0000 (07:40 +0000)]
Remove the M_NOWAIT from bridge_rtable_init as it isn't needed. The function
return value is not even checked and could lead to a panic on a null sc_rthash.

MFC after: 2 weeks

11 years agoFix HISTORY.
Joel Dahl [Thu, 4 Oct 2012 06:33:03 +0000 (06:33 +0000)]
Fix HISTORY.

11 years agorpc: convert all uid and gid variables to u_int.
Pedro F. Giffuni [Thu, 4 Oct 2012 04:15:18 +0000 (04:15 +0000)]
rpc: convert all uid and gid variables to u_int.

After further discussion, instead of pretending to use
uid_t and gid_t as upstream Solaris and linux try to, we
are better using u_int, which is in fact what the code
can handle and best approaches the range of values used
by uid and gid.

Discussed with: bde
Reviewed by: bde

11 years agoPause and unpause the software queues for a given node based on the
Adrian Chadd [Wed, 3 Oct 2012 23:23:45 +0000 (23:23 +0000)]
Pause and unpause the software queues for a given node based on the
net80211 node power save state.

* Add an ATH_NODE_UNLOCK_ASSERT() check
* Add a new node field - an_is_powersave
* Pause/unpause the queue based on the node state
* Attempt to handle net80211 concurrency issues so the queue
  doesn't get paused/unpaused more than once at a time from
  the net80211 power save code.

Whilst here (and breaking my usual rule), set CLRDMASK when a queue
is unpaused, regardless of whether the queue has some pending traffic.
This means the first frame from that TID (now or later) will hvae
CLRDMASK set.

Also whilst here, bump the swretrymax counters whenever the
filtered frames code expires a frame.  Again, breaking my rule, but
this is just a statistics thing rather than a functional change.

This doesn't fix ps-poll (but it doesn't break it too much worse
than it is at the present) or correcting the TID updates.
That's next on the list.

Tested:
* AR9220 AP (Atheros AP96 reference design)
* Macbook Pro and LG Optimus 1 Android phone, both setting
  and clearing power save state (but not using PS-POLL.)

11 years agoClean up compiler warnings.
Ed Maste [Wed, 3 Oct 2012 22:02:16 +0000 (22:02 +0000)]
Clean up compiler warnings.

More work is needed here but this now builds with WARNS=6.

Sponsored by: ADARA Networks
MFC after: 2 weeks

11 years agoSort manual page cross references.
Niclas Zeising [Wed, 3 Oct 2012 21:56:16 +0000 (21:56 +0000)]
Sort manual page cross references.

Approved by: joel (mentor)

11 years agoRemove whitespace at EOL
Niclas Zeising [Wed, 3 Oct 2012 21:50:53 +0000 (21:50 +0000)]
Remove whitespace at EOL

Approved by: joel (mentor)

11 years agoCast through void * to silence compiler warning
Ed Maste [Wed, 3 Oct 2012 21:41:20 +0000 (21:41 +0000)]
Cast through void * to silence compiler warning

The base netmap pointer and offsets involved are provided by the kernel
side of the netmap interface and will have appropriate alignment.

Sponsored by: ADARA Networks
MFC After: 2 weeks

11 years agorpc: convert all uid and gid variables of the type uid_t and gid_t.
Pedro F. Giffuni [Wed, 3 Oct 2012 20:39:11 +0000 (20:39 +0000)]
rpc: convert all uid and gid variables of the type uid_t and gid_t.

The previous change (based on Solaris) doesn't work properly either
as the casting only has the effect of quieting the compiler.

Move back to the previous solution but adjust the sizeof()
type in xdr_array(). This should mostly work (by accident).

Reported by: bde

11 years agoReplace all references to loader_callbacks_v1 with loader_callbacks.
Andrey V. Elsukov [Wed, 3 Oct 2012 17:20:34 +0000 (17:20 +0000)]
Replace all references to loader_callbacks_v1 with loader_callbacks.

Suggested by: grehan@

11 years agoPull in r164717 from upstream clang trunk:
Dimitry Andric [Wed, 3 Oct 2012 16:48:28 +0000 (16:48 +0000)]
Pull in r164717 from upstream clang trunk:

  Allow -MF to be used in combination with -E -M or -E -MM.

This should help with building the lang/ghc port.

MFC after: 1 week

11 years agoFix faulty error code handling in read(2) on TTYs.
Ed Schouten [Wed, 3 Oct 2012 13:51:03 +0000 (13:51 +0000)]
Fix faulty error code handling in read(2) on TTYs.

When performing a non-blocking read(2), on a TTY while no data is
available, we should return EAGAIN. But if there's a modem disconnect,
we should return 0. Right now we only return 0 when doing a blocking
read, which is wrong.

MFC after: 1 month

11 years agoFix build without `options ATA_CAM`, broken by r241144.
Alexander Motin [Wed, 3 Oct 2012 12:43:26 +0000 (12:43 +0000)]
Fix build without `options ATA_CAM`, broken by r241144.

11 years agoCorrect detection of a superblock.
Grzegorz Bernacki [Wed, 3 Oct 2012 10:06:48 +0000 (10:06 +0000)]
Correct detection of a superblock.

Obtained from: Smartcom Bulgaria AD

11 years agoReimplement pmap_qremove() using the new TLB invalidation function for
Alan Cox [Wed, 3 Oct 2012 05:42:15 +0000 (05:42 +0000)]
Reimplement pmap_qremove() using the new TLB invalidation function for
efficiently invalidating address ranges.

11 years agoTidy up a bit:
Alan Cox [Wed, 3 Oct 2012 05:06:45 +0000 (05:06 +0000)]
Tidy up a bit:

Update some of the comments.  In particular, use "sleep" in preference to
"block" where appropriate.

Eliminate some unnecessary casts.

Make a few whitespace changes for consistency.

Reviewed by: kib
MFC after: 3 days

11 years agoOptimize prev. commit for speed.
Andrey A. Chernov [Wed, 3 Oct 2012 04:46:58 +0000 (04:46 +0000)]
Optimize prev. commit for speed.
1) Don't iterate the loop from the environment array beginning each time,
iterate it under the last place we deactivate instead.
2) Call __rebuild_environ() not on each iteration but once, only at the end
of whole loop (of course, only in case if something is changed).

MFC after:      1 week

11 years agorpc: convert all uid and gid variables of the type uid_t and gid_t.
Pedro F. Giffuni [Wed, 3 Oct 2012 03:44:23 +0000 (03:44 +0000)]
rpc: convert all uid and gid variables of the type uid_t and gid_t.

As part of the previous commit, uses of xdr_int() were replaced
with xdr_u_int(). This has undesired effects as the second
argument doesn't match exactly uid_t or gid_t. It also breaks
assumptions in the size of the provided types.

To work around those issues we revert back to the use of xdr_int()
but provide proper casting so the behaviour doesn't change.

While here fix a style issue in the affected lines.

Reported by: bde

11 years agoImport sysutils/sysrc from the ports tree (current version 5.1). Importing
Devin Teske [Wed, 3 Oct 2012 02:32:47 +0000 (02:32 +0000)]
Import sysutils/sysrc from the ports tree (current version 5.1). Importing
disconnected under the WITH_BSDCONFIG flag (a good idea since this version of
sysrc(8) indeed requires the `sysrc.subr' module installed by bsdconfig(8)).

Multiple reasons sysrc should not simply continue to live in ports. The most
important being that it is tightly coupled with the base.

Approved by: adrian (co-mentor)

11 years agoMerge bmake-20120831 from vendor/NetBSD/bmake/dist.
Marcel Moolenaar [Wed, 3 Oct 2012 00:41:46 +0000 (00:41 +0000)]
Merge bmake-20120831 from vendor/NetBSD/bmake/dist.

Provenance: ftp://ftp.netbsd.org/pub/NetBSD/misc/sjg

11 years agoAdd casts to unbreak the i386 PAE build for the mps(4) driver.
Kenneth D. Merry [Tue, 2 Oct 2012 23:04:12 +0000 (23:04 +0000)]
Add casts to unbreak the i386 PAE build for the mps(4) driver.

MFC after: 3 days
Prompted by: Garrett Cooper

11 years agoImplement SATA revision (speed) control for legacy SATA controller for
Alexander Motin [Tue, 2 Oct 2012 22:03:21 +0000 (22:03 +0000)]
Implement SATA revision (speed) control for legacy SATA controller for
both boot (via loader tunables) and run-time (via `camcontrol negotiate`).
Tested to work at least on NVIDIA MCP55 chipset.

H/w provided by: glebius

11 years agolibtirpc: be sure to free cl_netid and cl_tp
Pedro F. Giffuni [Tue, 2 Oct 2012 19:10:19 +0000 (19:10 +0000)]
libtirpc: be sure to free cl_netid and cl_tp

When creating a client with clnt_tli_create, it uses strdup to copy
strings for these fields if nconf is passed in. clnt_dg_destroy frees
these strings already. Make sure clnt_vc_destroy frees them in the same
way.

This change matches the reference (OpenSolaris) implementation.

Tested by: David Wolfskill
Obtained from: Bull GNU/Linux NFSv4 Project (libtirpc)
MFC after: 2 weeks

11 years agoFix __rpc_getconfip
Pedro F. Giffuni [Tue, 2 Oct 2012 19:03:21 +0000 (19:03 +0000)]
Fix __rpc_getconfip

__rpc_getconfip is supposed to return the first netconf
entry supporting tcp or udp, respectively. The code will
currently return the *last* entry, plus it will leak
memory when there is more than one such entry.

This change matches the reference (OpenSolaris)
implementation.

Tested by: David Wolfskill
Obtained from: Bull GNU/linux NFSv4 Project (libtirpc)
MFC after: 1 week

11 years agoRPC: Convert all uid and gid variables of the type uid_t and gid_t.
Pedro F. Giffuni [Tue, 2 Oct 2012 19:00:56 +0000 (19:00 +0000)]
RPC: Convert all uid and gid variables of the type uid_t and gid_t.

This matches what upstream (OpenSolaris) does.

Tested by: David Wolfskill
Obtained from: Bull GNU/Linux NFSv4 project (libtirpc)
MFC after: 3 days

11 years agoFix spelling of the function name in two assertion messages.
Garrett Wollman [Tue, 2 Oct 2012 18:38:05 +0000 (18:38 +0000)]
Fix spelling of the function name in two assertion messages.

11 years agoUpdate UPDATING with the ABI change for net80211.
Adrian Chadd [Tue, 2 Oct 2012 17:46:32 +0000 (17:46 +0000)]
Update UPDATING with the ABI change for net80211.

11 years agoMigrate the power-save functions to be overridable VAP methods.
Adrian Chadd [Tue, 2 Oct 2012 17:45:19 +0000 (17:45 +0000)]
Migrate the power-save functions to be overridable VAP methods.

This turns ieee80211_node_pwrsave(), ieee80211_sta_pwrsave() and
ieee80211_recv_pspoll() into methods.

The intent is to let drivers override these and tie into the power save
management pathway.

For ath(4), this is the beginning of forcing a node software queue to
stop and start as needed, as well as supporting "leaking" single frames
from the software queue to the hardware.

Right now, ieee80211_recv_pspoll() will attempt to transmit a single frame
to the hardware (whether it be a data frame on the power-save queue or
a NULL data frame) but the driver may have hardware/software queued frames
queued up.  This initial work is an attempt at providing the hooks required
to implement correct behaviour.

Allowing ieee80211_node_pwrsave() to be overridden allows the ath(4)
driver to pause and unpause the entire software queue for a given node.
It doesn't make sense to transmit anything whilst the node is asleep.

Please note that there are other corner cases to correctly handle -
specifically, setting the MORE data bit correctly on frames to a station,
as well as keeping the TIM updated.  Those particular issues can be
addressed later.

11 years agoUsing putenv() and later direct pointer contents modification it is possibe
Andrey A. Chernov [Tue, 2 Oct 2012 17:44:08 +0000 (17:44 +0000)]
Using putenv() and later direct pointer contents modification it is possibe
to craft environment variables with similar names like that:
a=1
a=2
...
unsetenv("a") should remove them all to make later getenv("a") impossible.
Fix it to do so (this is GNU autoconf test #3 failure too).

PR:             172273
MFC after:      1 week

11 years agoFix alignment related warnings reported by gcc
Eitan Adler [Tue, 2 Oct 2012 14:48:03 +0000 (14:48 +0000)]
Fix alignment related warnings reported by gcc
Switch from old style arguments to modern C
remove WARNS as a result

tested with "make universe"

Approved by: cperciva
MFC after: 1 week

11 years agoTo reduce volume of pfsync traffic:
Gleb Smirnoff [Tue, 2 Oct 2012 12:44:46 +0000 (12:44 +0000)]
To reduce volume of pfsync traffic:
- Scan request update queue to prevent doubles.
- Do not push undersized daragram in pfsync_update_request().

11 years agoRename the module for 'device enc' to "if_enc" to avoid conflicting with
John Baldwin [Tue, 2 Oct 2012 12:25:30 +0000 (12:25 +0000)]
Rename the module for 'device enc' to "if_enc" to avoid conflicting with
the CAM "enc" peripheral (part of ses(4)).  Previously the two modules
used the same name, so only one was included in a linked kernel causing
enc0 to not be created if you added IPSEC to GENERIC.  The new module
name follows the pattern of other network interfaces (e.g. "if_loop").

MFC after: 1 week

11 years ago There is a complex race in in_pcblookup_hash() and in_pcblookup_group().
Gleb Smirnoff [Tue, 2 Oct 2012 12:03:02 +0000 (12:03 +0000)]
 There is a complex race in in_pcblookup_hash() and in_pcblookup_group().
Both functions need to obtain lock on the found PCB, and they can't do
classic inter-lock with the PCB hash lock, due to lock order reversal.
To keep the PCB stable, these functions put a reference on it and after PCB
lock is acquired drop it. If the reference was the last one, this means
we've raced with in_pcbfree() and the PCB is no longer valid.

  This approach works okay only if we are acquiring writer-lock on the PCB.
In case of reader-lock, the following scenario can happen:

  - 2 threads locate pcb, and do in_pcbref() on it.
  - These 2 threads drop the inp hash lock.
  - Another thread comes to delete pcb via in_pcbfree(), it obtains hash lock,
    does in_pcbremlists(), drops hash lock, and runs in_pcbrele_wlocked(), which
    doesn't free the pcb due to two references on it. Then it unlocks the pcb.
  - 2 aforementioned threads acquire reader lock on the pcb and run
    in_pcbrele_rlocked(). One gets 1 from in_pcbrele_rlocked() and continues,
    second gets 0 and considers pcb freed, returns.
  - The thread that got 1 continutes working with detached pcb, which later
    leads to panic in the underlying protocol level.

  To plumb that problem an additional INPCB flag introduced - INP_FREED. We
check for that flag in the in_pcbrele_rlocked() and if it is set, we pretend
that that was the last reference.

Discussed with: rwatson, jhb
Reported by: Vladimir Medvedkin <medved rambler-co.ru>

11 years agoStyle.
Hans Petter Selasky [Tue, 2 Oct 2012 10:09:23 +0000 (10:09 +0000)]
Style.

MFC after: 1 week

11 years agoRemove unused field.
Hans Petter Selasky [Tue, 2 Oct 2012 10:05:39 +0000 (10:05 +0000)]
Remove unused field.

MFC after: 1 week

11 years agomdoc: point to an existing cross reference.
Sergey Kandaurov [Tue, 2 Oct 2012 09:53:50 +0000 (09:53 +0000)]
mdoc: point to an existing cross reference.

11 years agoFix build with LOG_FILE undefined and DEBUGGING disabled.
Sergey Kandaurov [Tue, 2 Oct 2012 09:23:16 +0000 (09:23 +0000)]
Fix build with LOG_FILE undefined and DEBUGGING disabled.

11 years agoFix build with DEBUGGING disabled.
Sergey Kandaurov [Tue, 2 Oct 2012 09:19:28 +0000 (09:19 +0000)]
Fix build with DEBUGGING disabled.

11 years agoIntroduce a new TLB invalidation function for efficiently invalidating
Alan Cox [Tue, 2 Oct 2012 07:14:22 +0000 (07:14 +0000)]
Introduce a new TLB invalidation function for efficiently invalidating
address ranges, and use this function in pmap_remove().

Tested by: jchandra

11 years agoProvide a generic way to disable devices at boot time
Eitan Adler [Tue, 2 Oct 2012 03:33:41 +0000 (03:33 +0000)]
Provide a generic way to disable devices at boot time

PR: kern/119202
Requested by: peterj
Reviewed by: sbruno, jhb
Approved by: cperciva
MFC after: 1 week

11 years agoImplement the Sun/GNU extension of using a default
Eitan Adler [Tue, 2 Oct 2012 00:30:26 +0000 (00:30 +0000)]
Implement the Sun/GNU extension of using a default
prefix when no arguments are supplied.

Reviewed by: jilles
Approved by: cperciva
MFC after: 1 week

11 years agoadd SG state type
Eitan Adler [Tue, 2 Oct 2012 00:30:20 +0000 (00:30 +0000)]
add SG state type

PR: bin/171664
Submitted by: Jan Beich jbeich@tormail.org
Approved by: cperciva
MFC after: 1 week

11 years agoCorrect the tip about finding all the directories on the system
Eitan Adler [Tue, 2 Oct 2012 00:30:15 +0000 (00:30 +0000)]
Correct the tip about finding all the directories on the system
Add a tip about clearing the screen.
Make things more consistent by removing quotes around 'make search'

Approved by: cperciva
MFC after: 3 days

11 years agoIndicate (loudly) that ports csup is going away.
Eitan Adler [Mon, 1 Oct 2012 22:27:34 +0000 (22:27 +0000)]
Indicate (loudly) that ports csup is going away.

While here clarify some other portions.

Approved by: cperciva (implicit)
MFC after: 3 days

11 years agoAdd the mps(4) driver to the i386 GENERIC config file. LSI has tested it
Kenneth D. Merry [Mon, 1 Oct 2012 21:42:32 +0000 (21:42 +0000)]
Add the mps(4) driver to the i386 GENERIC config file.  LSI has tested it
on i386 and verified that it works.

Submitted by: Harald Schmalzbauer, John Baldwin, Kashyap Desai
MFC after: 3 days

11 years agoDo not treat empty name as an uid 0
Baptiste Daroussin [Mon, 1 Oct 2012 17:00:33 +0000 (17:00 +0000)]
Do not treat empty name as an uid 0

Reported by: Robert Bonomi <bonomi@mail.r-bonomi.com>

11 years agoRemove useless atoi(3), previous strspn(3) makes sure that a_name->val is a
Baptiste Daroussin [Mon, 1 Oct 2012 16:42:07 +0000 (16:42 +0000)]
Remove useless atoi(3), previous strspn(3) makes sure that a_name->val is a
number.
This also allow pw user show to work as expected.

PR: bin/172112
Submitted by: "Ilya A. Arkhipov" <rum1cro@yandex.ru>
MFC after: 1 month

11 years agoSupport kernel options from ubldr.
Tim Kientzle [Mon, 1 Oct 2012 14:56:48 +0000 (14:56 +0000)]
Support kernel options from ubldr.

11 years agoAttila Bogar and Herbert Poeckl both reported similar problems
Rick Macklem [Mon, 1 Oct 2012 12:28:58 +0000 (12:28 +0000)]
Attila Bogar and Herbert Poeckl both reported similar problems
w.r.t. a Linux NFS client doing a krb5 NFS mount against the
FreeBSD server. We determined this was a Linux bug:
http://www.spinics.net/lists/linux-nfs/msg32466.html, however
the mount failed to work, because the Destroy operation with a
bogus encrypted checksum destroyed the authenticator handle.
This patch changes the rpcsec_gss code so that it doesn't
Destroy the authenticator handle for this case and, as such,
the Linux mount will work.

Tested by: Attila Bogar and Herbert Poeckl
MFC after: 2 weeks

11 years ago- Rename .sgml files to .xml to track the recent doc changes
Gabor Kovesdan [Mon, 1 Oct 2012 11:26:49 +0000 (11:26 +0000)]
- Rename .sgml files to .xml to track the recent doc changes

MFC after: 1 day

11 years agoAdd the UPDATING note about padlock rng support requiring the config change.
Konstantin Belousov [Mon, 1 Oct 2012 10:46:35 +0000 (10:46 +0000)]
Add the UPDATING note about padlock rng support requiring the config change.

Requested by: Dewayne Geraghty <dewayne.geraghty@heuristicsystems.com.au>
MFC after: 3 days

11 years agoRegenerate usb.conf
Hans Petter Selasky [Mon, 1 Oct 2012 06:48:59 +0000 (06:48 +0000)]
Regenerate usb.conf

MFC after: 1 week

11 years ago- Enforce CAP_MKFIFO on mkfifoat(2), not on mknodat(2). Without this change
Pawel Jakub Dawidek [Mon, 1 Oct 2012 05:43:24 +0000 (05:43 +0000)]
- Enforce CAP_MKFIFO on mkfifoat(2), not on mknodat(2). Without this change
  mkfifoat(2) was not restricted.
- Introduce CAP_MKNOD and enforce it on mknodat(2).

Sponsored by: FreeBSD Foundation
MFC after: 2 weeks

11 years agoInherit USB mode from RootHUB port where the USB device is connected.
Hans Petter Selasky [Mon, 1 Oct 2012 05:42:43 +0000 (05:42 +0000)]
Inherit USB mode from RootHUB port where the USB device is connected.
Only RootHUB ports can be dual mode. Disallow OTG ports on external HUBs.
This simplifies some checks in the USB controller drivers.

MFC after: 1 week

11 years agoRemove unused variables from the OMAP ehci code.
Andrew Turner [Mon, 1 Oct 2012 05:15:13 +0000 (05:15 +0000)]
Remove unused variables from the OMAP ehci code.

11 years agoFix the clobber list on the atomic operators that do comparisons. Without
Andrew Turner [Mon, 1 Oct 2012 05:12:17 +0000 (05:12 +0000)]
Fix the clobber list on the atomic operators that do comparisons. Without
this some compilers will place a cmp instruction before the atomic operation
and expect to be able to use the result afterwards. By adding "cc" to the
list of used registers we tell the compiler to not do this.

11 years agoThe USB Bluetooth driver should only grab its own interfaces. This allows the
Hans Petter Selasky [Sun, 30 Sep 2012 19:31:20 +0000 (19:31 +0000)]
The USB Bluetooth driver should only grab its own interfaces. This allows the
USB bluetooth driver to co-exist with other USB device classes and drivers.

Reported by: Geoffrey Levand
MFC after: 1 week

11 years ago- Simplify the implementation of atomic_compare_exchange_strong_explicit.
Tijl Coosemans [Sun, 30 Sep 2012 17:33:30 +0000 (17:33 +0000)]
- Simplify the implementation of atomic_compare_exchange_strong_explicit.
- Evaluate the memory order argument in atomic_fetch_*_explicit macros.
- Implement atomic_store_explicit using atomic_exchange_explicit instead
  of a plain assignment.

Reviewed by: theraven
MFC after: 2 weeks

11 years agoAdd missing header needed by free(9).
Kevin Lo [Sun, 30 Sep 2012 15:42:20 +0000 (15:42 +0000)]
Add missing header needed by free(9).
Spotted by: David Wolfskill <david at catwhisker dot org>

11 years agoFix the style.
Andrey V. Elsukov [Sun, 30 Sep 2012 13:17:33 +0000 (13:17 +0000)]
Fix the style.

11 years agoRemember the file format of the last loaded module and try to use it for
Andrey V. Elsukov [Sun, 30 Sep 2012 13:14:37 +0000 (13:14 +0000)]
Remember the file format of the last loaded module and try to use it for
next files.

11 years agoReduce the number of attempts to detect proper kld format for the amd64
Andrey V. Elsukov [Sun, 30 Sep 2012 12:24:15 +0000 (12:24 +0000)]
Reduce the number of attempts to detect proper kld format for the amd64
loader.

11 years agoRemove an unneeded NULL check after M_WAITOK.
Kevin Lo [Sun, 30 Sep 2012 09:26:26 +0000 (09:26 +0000)]
Remove an unneeded NULL check after M_WAITOK.

11 years agoFree result of device_get_children(9).
Kevin Lo [Sun, 30 Sep 2012 09:21:10 +0000 (09:21 +0000)]
Free result of device_get_children(9).

11 years agoFix disk_cleanup() to work without DISK_DEBUG too.
Andrey V. Elsukov [Sun, 30 Sep 2012 07:52:40 +0000 (07:52 +0000)]
Fix disk_cleanup() to work without DISK_DEBUG too.

11 years agomdoc: remove superfluous paragraph macro.
Joel Dahl [Sun, 30 Sep 2012 07:51:57 +0000 (07:51 +0000)]
mdoc: remove superfluous paragraph macro.

11 years agoStop calling pmap_remove_write() from pmap_remove_all(). Doing so is not
Alan Cox [Sun, 30 Sep 2012 03:54:57 +0000 (03:54 +0000)]
Stop calling pmap_remove_write() from pmap_remove_all().  Doing so is not
only inefficient but also leads to recursive lock acquisition.

Tested by: ray

11 years agoclarify the wording for 'first' and 'last'
Eitan Adler [Sun, 30 Sep 2012 03:25:04 +0000 (03:25 +0000)]
clarify the wording for 'first' and 'last'

Approved by: wblock
MFC after: 3 days

11 years agoDocument the security.bsd.unprivileged_idprio in idprio(1) in addition
Eitan Adler [Sun, 30 Sep 2012 03:21:21 +0000 (03:21 +0000)]
Document the security.bsd.unprivileged_idprio in idprio(1) in addition
to rtprio(2).

Approved by: wblock
MFC after: 3 days

11 years agoEliminate an unused declaration.
Alan Cox [Sat, 29 Sep 2012 22:28:00 +0000 (22:28 +0000)]
Eliminate an unused declaration.

11 years agoClear and re-setup all function pointers that glue pf(4) and pfsync(4)
Gleb Smirnoff [Sat, 29 Sep 2012 20:11:00 +0000 (20:11 +0000)]
Clear and re-setup all function pointers that glue pf(4) and pfsync(4)
together whenever the pfsync0 is brought down or up respectively.

11 years agoSimplify send out queue code:
Gleb Smirnoff [Sat, 29 Sep 2012 20:02:26 +0000 (20:02 +0000)]
Simplify send out queue code:
- Write method of a queue now is void,length of item is taken
  as queue property.
- Write methods don't need to know about mbud, supply just buf
  to them.
- No need for safe queue iterator in pfsync_sendout().

Obtained from: OpenBSD

11 years agoEliminate unused variables.
Alan Cox [Sat, 29 Sep 2012 19:09:11 +0000 (19:09 +0000)]
Eliminate unused variables.

11 years agoAdd support for mincore(). Specifically, this is an adaptation of the
Alan Cox [Sat, 29 Sep 2012 17:20:16 +0000 (17:20 +0000)]
Add support for mincore().  Specifically, this is an adaptation of the
pmap_mincore() implementation that was added to the original arm pmap
in r235717.

11 years agoAlmost each time when loader opens a file, this leads to calling
Andrey V. Elsukov [Sat, 29 Sep 2012 16:47:56 +0000 (16:47 +0000)]
Almost each time when loader opens a file, this leads to calling
disk_open(). Very often this is called several times for one file.
This leads to reading partition table metadata for each call. To
reduce the number of disk I/O we have a simple block cache, but it
is very dumb and more than half of I/O operations related to reading
metadata, misses this cache.

Introduce new cache layer to resolve this problem. It is independent
and doesn't need initialization like bcache, and will work by default
for all loaders which use the new DISK API. A successful disk_open()
call to each new disk or partition produces new entry in the cache.
Even more, when disk was already open, now opening of any nested
partitions does not require reading top level partition table.
So, if without this cache, partition table metadata was read around
20-50 times during boot, now it reads only once. This affects the booting
from GPT and MBR from the UFS.

11 years ago- Get rid of #ifdef __FreeBSD__.
Gleb Smirnoff [Sat, 29 Sep 2012 16:42:01 +0000 (16:42 +0000)]
- Get rid of #ifdef __FreeBSD__.
- Use correct format when printing uint64_t.

11 years ago* src/math_private.h:
Steve Kargl [Sat, 29 Sep 2012 16:40:12 +0000 (16:40 +0000)]
* src/math_private.h:
  . Change the API for the LD80C by removing the explicit passing
    of the sign bit.  The sign can be determined from the last
    parameter of the macro.
  . On i386, load long double by bit manipulations to work around
    at least a gcc compiler issue.  On non-i386 ld80 architectures,
    use a simple assignment.

* ld80/s_expl.c:
  . Update the only consumer of LD80C.

Submitted by: bde
Approved by: das (mentor)

11 years agoIf devclass_get_devices(9) returns success but a count of 0,
Kevin Lo [Sat, 29 Sep 2012 16:27:13 +0000 (16:27 +0000)]
If devclass_get_devices(9) returns success but a count of 0,
free the pointer.

11 years agoAdd missing va_end.
Kevin Lo [Sat, 29 Sep 2012 16:19:01 +0000 (16:19 +0000)]
Add missing va_end.