]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMFV: libpcap 1.4.0.
Xin LI [Thu, 30 May 2013 08:02:00 +0000 (08:02 +0000)]
MFV: libpcap 1.4.0.

MFC after: 4 weeks

11 years agoVendor import of libpcap 1.4.0.
Xin LI [Thu, 30 May 2013 06:41:26 +0000 (06:41 +0000)]
Vendor import of libpcap 1.4.0.

11 years agoAdd __sync_synchronize().
Ed Schouten [Thu, 30 May 2013 06:20:50 +0000 (06:20 +0000)]
Add __sync_synchronize().

This function can easily be implemented on top of the mb() macro
provided by <machine/atomic.h>.

11 years agoUse #ifdef instead of #if defined.
Ed Schouten [Thu, 30 May 2013 06:20:23 +0000 (06:20 +0000)]
Use #ifdef instead of #if defined.

This makes these tests a bit more consistent with the tests done at the
bottom of the file.

11 years agoI'm happy to finally commit stephen@'s implementations of cacos,
David Schultz [Thu, 30 May 2013 04:49:26 +0000 (04:49 +0000)]
I'm happy to finally commit stephen@'s implementations of cacos,
cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@
for working on these.

Submitted by: stephen@
Reviewed by: bde

11 years agoFix some harmless bugs in a test.
David Schultz [Thu, 30 May 2013 04:47:03 +0000 (04:47 +0000)]
Fix some harmless bugs in a test.

11 years agoBasic tests for complex inverse trig and hyperbolic functions.
David Schultz [Thu, 30 May 2013 04:46:36 +0000 (04:46 +0000)]
Basic tests for complex inverse trig and hyperbolic functions.

11 years agoMFP4 @217311
Brooks Davis [Thu, 30 May 2013 01:22:50 +0000 (01:22 +0000)]
MFP4 @217311

Intel and Sharp flash power on with their blocks in a "locked" state.
Unlocked them before attempting to perform an erase or write action and
relock when the action is complete.

11 years agoMFP4 @222836
Brooks Davis [Thu, 30 May 2013 01:19:02 +0000 (01:19 +0000)]
MFP4 @222836

Add support for partitioning CFI disks from FDT using geom_flashmap.

Sponsored by: DARPA, AFRL

11 years agoAllow unmapped I/O via aacd(4). It shouldn't be too hard to add the
Marius Strobl [Thu, 30 May 2013 00:22:07 +0000 (00:22 +0000)]
Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the
same support for aacp(4), I'm lacking the necessary hardware for
testing, though.

11 years ago- Remove pointless returns.
Marius Strobl [Thu, 30 May 2013 00:11:22 +0000 (00:11 +0000)]
- Remove pointless returns.
- Make cm_data a void pointer and cm_flags unsigned as appropriate.

MFC after: 3 days

11 years agoFix a typo in r249213; the second bus_if.h should have been isa_if.h.
Marius Strobl [Wed, 29 May 2013 23:56:49 +0000 (23:56 +0000)]
Fix a typo in r249213; the second bus_if.h should have been isa_if.h.

11 years agoAdd support for tethering on the iPhone 4S
Eitan Adler [Wed, 29 May 2013 20:36:51 +0000 (20:36 +0000)]
Add support for tethering on the iPhone 4S

PR: usb/179078
Submitted by: Christopher Sean Hilton <chris@vindaloo.com>
MFC After: 1 week

11 years agoModify atf::fs::path::get_process_helpers_path API to properly
Marcel Moolenaar [Wed, 29 May 2013 19:41:36 +0000 (19:41 +0000)]
Modify atf::fs::path::get_process_helpers_path API to properly
handle pathing with detail/ tests. Based on patch pushed upstream to
ATF project.

Obtained from: Garrett Cooper <yaneurabeya@gmail.com>

11 years agoMake the instruction order for buildworld agree with UPDATING and the
Chris Rees [Wed, 29 May 2013 19:16:59 +0000 (19:16 +0000)]
Make the instruction order for buildworld agree with UPDATING and the
Handbook.

Reviewed by: imp, bdrewery, netchild
Approved by: gjb (mentor)

11 years agoDon't assign the copyright to the FreeBSD foundation for the years
Marcel Moolenaar [Wed, 29 May 2013 16:51:03 +0000 (16:51 +0000)]
Don't assign the copyright to the FreeBSD foundation for the years
this file is in FreeBSD. There's formality to this that hasn't
happened and Juniper is perfectly fine with being the holder.

Discussed with: eadler, imp, jhb

11 years agoAdd my entry.
Chris Rees [Wed, 29 May 2013 13:36:33 +0000 (13:36 +0000)]
Add my entry.

Approved by: bcr, gjb (mentors)

11 years agoForced commit to note that the sandbox issue was not about libraries, as
Dag-Erling Smørgrav [Wed, 29 May 2013 12:40:28 +0000 (12:40 +0000)]
Forced commit to note that the sandbox issue was not about libraries, as
I erroneously stated in the commit log, but about a CRIOGET ioctl failing
due to a preceding setrlimit(RLIMIT_NOFILES, 0) call.

11 years agoTurn the reassociate debug print into a DPRINTF.
Adrian Chadd [Wed, 29 May 2013 05:10:11 +0000 (05:10 +0000)]
Turn the reassociate debug print into a DPRINTF.

11 years agoFix a false -> AH_FALSE.
Adrian Chadd [Wed, 29 May 2013 04:21:42 +0000 (04:21 +0000)]
Fix a false -> AH_FALSE.

Now, why this hasn't tripped _any_ tinderbox builds yet, I dunno.
It's been like this for a while.

11 years agoRemove clause 3 and 4 from TNF licenses
Ed Maste [Wed, 29 May 2013 01:54:10 +0000 (01:54 +0000)]
Remove clause 3 and 4 from TNF licenses

Per the NetBSD Foundation statement
  Third parties are encouraged to change the license on any files which
  have a 4-clause license contributed to the NetBSD Foundation to a
  2-clause license.

11 years agoShuffle around the cleanup unpause calls a bit.
Adrian Chadd [Wed, 29 May 2013 01:40:13 +0000 (01:40 +0000)]
Shuffle around the cleanup unpause calls a bit.

11 years agoAdd a patch analygous to r248567, r248581, r251079 to the
Rick Macklem [Wed, 29 May 2013 00:32:49 +0000 (00:32 +0000)]
Add a patch analygous to r248567, r248581, r251079 to the
old NFS client to avoid the panic reported in the PR by
doing the vnode_pager_setsize() call after unlocking the mutex.

PR: 177335
MFC after: 2 weeks

11 years agoRevert a local change that sets the default for UsePrivilegeSeparation to
Dag-Erling Smørgrav [Wed, 29 May 2013 00:19:58 +0000 (00:19 +0000)]
Revert a local change that sets the default for UsePrivilegeSeparation to
"sandbox" instead of "yes".  In sandbox mode, the privsep child is unable
to load additional libraries and will therefore crash when trying to take
advantage of crypto offloading on CPUs that support it.

11 years agoRemove references to CVS_UPDATE and SUP_UPDATE to catch up with r251084.
Glen Barber [Tue, 28 May 2013 23:52:01 +0000 (23:52 +0000)]
Remove references to CVS_UPDATE and SUP_UPDATE to catch up with r251084.

MFC after: 1 month
X-MFC-With: r251084, r251085

11 years agoFix typo introduced in r251084.
Glen Barber [Tue, 28 May 2013 23:46:13 +0000 (23:46 +0000)]
Fix typo introduced in r251084.

MFC after: 1 month
X-MFC-With: r251084

11 years agor245757 introduced warning output if update method is set to CVS_UPDATE
Glen Barber [Tue, 28 May 2013 23:43:47 +0000 (23:43 +0000)]
r245757 introduced warning output if update method is set to CVS_UPDATE
or SUP_UPDATE.

CVS exporter for head/ is turned off for nearly one month now.

It is finally time to swing the ax at these update methods.

Reviewed by: eadler
MFC after: 1 month

11 years agoPost-r248567, there were times when the client would return a
Rick Macklem [Tue, 28 May 2013 22:36:01 +0000 (22:36 +0000)]
Post-r248567, there were times when the client would return a
truncated directory for some NFS servers. This turned out to
be because the size of a directory reported by an NFS server
can be smaller that the ufs-like directory created from the
RPC XDR in the client. This patch fixes the problem by changing
r248567 so that vnode_pager_setsize() is only done for regular files.

Reported and tested by: hartmut.brandt@dlr.de
Reviewed by: kib
MFC after: 1 week

11 years agosleep: Improve nanosleep() error handling:
Jilles Tjoelker [Tue, 28 May 2013 22:07:31 +0000 (22:07 +0000)]
sleep: Improve nanosleep() error handling:

 * Work around kernel bugs that cause a spurious [EINTR] return if a
   debugger (such as truss(1)) is attached.

 * Write an error message if an error other than [EINTR] occurs.

PR: bin/178664

11 years agoo Change the locking scheme for swp_bcount.
Attilio Rao [Tue, 28 May 2013 22:07:23 +0000 (22:07 +0000)]
o Change the locking scheme for swp_bcount.
  It can now be accessed with a write lock on the object containing it OR
  with a read lock on the object containing it along with the swhash_mtx.
o Remove some duplicate assertions for swap_pager_freespace() and
  swap_pager_unswapped() but keep the object locking references for
  documentation.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc

11 years agoAvoid reading back certain registers following a write. This is an optimization.
David C Somayajulu [Tue, 28 May 2013 22:00:37 +0000 (22:00 +0000)]
Avoid reading back certain registers following a write. This is an optimization.

Submitted by: David C Somayajulu
Approved by: George Neville Neil

11 years agoUpdate comments to reflect use of svn/svnup to keep the src/ tree up
Glen Barber [Tue, 28 May 2013 21:57:55 +0000 (21:57 +0000)]
Update comments to reflect use of svn/svnup to keep the src/ tree up
to date.

MFC after: 3 days

11 years agoTemporarily revert r251058 - it breaks documented use of makeoptions
Peter Wemm [Tue, 28 May 2013 21:29:05 +0000 (21:29 +0000)]
Temporarily revert r251058 - it breaks documented use of makeoptions
including the tinderbox.

 http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-i386-i386.full
 make: don't know how to make modules-all. Stop
 make: stopped in /obj/i386.i386/src/sys/PAE
 *** Error code 2

11 years agoMFp4 @229086:
Pawel Jakub Dawidek [Tue, 28 May 2013 21:25:28 +0000 (21:25 +0000)]
MFp4 @229086:

Make use of Capsicum to protect kdump(1), as it might be used to parse data
from untrusted sources:

- Sandbox kdump(1) using capability mode.
- Limit stdin descriptor (where opened file is moved to) to only
  CAP_READ and CAP_FSTAT rights.
- Limit stdout descriptor to only CAP_WRITE, CAP_FSTAT and CAP_IOCTL.
  Plus limit allowed ioctls to TIOCGETA only, which is needed for
  isatty() to work.
- Limit stderr descriptor to only CAP_WRITE and CAP_FSTAT. In addition
  if the -s option is not given, grant CAP_IOCTL right, but allow for
  TIOCGWINSZ ioctl only, as we need screen width to dump the data.
- Before entering capability mode call catopen("libc", NL_CAT_LOCALE),
  which opens message catalogs and caches data, so that strerror(3)
  and strsignal(3) can work in a sandbox.

Sponsored by: The FreeBSD Foundation
Discussed with: rwatson

11 years agoMFp4 @229085:
Pawel Jakub Dawidek [Tue, 28 May 2013 21:21:46 +0000 (21:21 +0000)]
MFp4 @229085:

Rearrange the code so we don't call ioctl(TIOCGWINSZ) if the -s option is given,
as the result won't be used then.

Sponsored by: The FreeBSD Foundation

11 years agoRemove the advertising clause from the Regents of the University of
Ed Maste [Tue, 28 May 2013 21:05:06 +0000 (21:05 +0000)]
Remove the advertising clause from the Regents of the University of
California's license, per the letter dated July 22, 1999.

11 years agoRenumber clauses to reduce diffs to other versions
Ed Maste [Tue, 28 May 2013 20:57:40 +0000 (20:57 +0000)]
Renumber clauses to reduce diffs to other versions

NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.

11 years agoRemove the advertising clause from the Regents of the University of
Ed Maste [Tue, 28 May 2013 20:37:48 +0000 (20:37 +0000)]
Remove the advertising clause from the Regents of the University of
California's license, per the letter dated July 22, 1999.

11 years agoFix warnings from newer clang versions about constexpr member functions
Dimitry Andric [Tue, 28 May 2013 20:11:28 +0000 (20:11 +0000)]
Fix warnings from newer clang versions about constexpr member functions
not being implicitly const in libc++'s <chrono> header.  The warnings
have been introduced because of new language rules recently adopted by
the C++ WG.  More info:

<http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3598.html>

MFC after: 3 days

11 years agoRevert r251023 until a more proper solution is found
Hans Petter Selasky [Tue, 28 May 2013 18:51:30 +0000 (18:51 +0000)]
Revert r251023 until a more proper solution is found
for ATI based USB controllers.

MFC after: 1 week

11 years agoAdded missing SCSI quirks from r241784
Steven Hartland [Tue, 28 May 2013 14:44:37 +0000 (14:44 +0000)]
Added missing SCSI quirks from r241784

Re-ordered SSD quirks alphabetically so they are easier to maintain.

Removed my email and PR reference from comments on each quirk.

Added quirks for more SSDs:
* Crucial M4
* Corsair Force GT
* Intel 520 Series
* Kingston E100 Series
* Samsung 830 Series

Reviewed by: pjd (mentor)
Approved by: pjd (mentor)
MFC after: 1 week

11 years ago- Fix wording. [1]
Mark Johnston [Tue, 28 May 2013 13:54:26 +0000 (13:54 +0000)]
- Fix wording. [1]
- Improve the descriptions in the FILES section. [2]

Reported by: Jason McIntyre [1]
Obtained from: NetBSD [2]
MFC after: 3 days

11 years agoDuring buildkernel, print a banner before building modules.
Dag-Erling Smørgrav [Tue, 28 May 2013 09:52:28 +0000 (09:52 +0000)]
During buildkernel, print a banner before building modules.

11 years agomdoc: silence a few mandoc lint warnings.
Joel Dahl [Tue, 28 May 2013 09:33:46 +0000 (09:33 +0000)]
mdoc: silence a few mandoc lint warnings.

11 years agoRemove redundant checks.
Michael Tuexen [Tue, 28 May 2013 09:25:58 +0000 (09:25 +0000)]
Remove redundant checks.

MFC after: 2 weeks

11 years agoFix cexp regression tests that have an infinite real part. The signs of the
Tijl Coosemans [Tue, 28 May 2013 08:50:50 +0000 (08:50 +0000)]
Fix cexp regression tests that have an infinite real part. The signs of the
result depend on the cosine and sine of the imaginary part.
Small values are used in the new tests such that cosine and sine are well
defined.

Reviewed by: das

11 years agoThe getcontext() from the __fillcontextx() call in the
Konstantin Belousov [Tue, 28 May 2013 04:54:16 +0000 (04:54 +0000)]
The getcontext() from the __fillcontextx() call in the
check_deferred_signal() returns twice, since handle_signal() emulates
the return from the normal signal handler by sigreturn(2)ing the
passed context.  Second return is performed on the destroyed stack
frame, because __fillcontextx() has already returned.  This causes
undefined and bad behaviour, usually the victim thread gets SIGSEGV.

Avoid nested frame and the need to return from it by doing direct call
to getcontext() in the check_deferred_signal() and using a new private
libc helper __fillcontextx2() to complement the context with the
extended CPU state if the deferred signal is still present.

The __fillcontextx() is now unused, but is kept to allow older
libthr.so to be used with the new libc.

Mark __fillcontextx() as returning twice [1].

Reported by: pgj
Pointy hat to: kib
Discussed with: dim
Tested by: pgj, dim
Suggested by: jilles [1]
MFC after: 1 week

11 years agoStyle(9)
Steve Kargl [Mon, 27 May 2013 22:45:05 +0000 (22:45 +0000)]
Style(9)

Approved by: das (implicit)
Reported by: jh

11 years agoChange the closeallfds() routine to use closefrom() when it is
Garance A Drosehn [Mon, 27 May 2013 22:19:01 +0000 (22:19 +0000)]
Change the closeallfds() routine to use closefrom() when it is
available (closefrom() was added to FreeBSD in 8.0-release).
The selection is made at compile-time, as I still compile a
FreeBSD-based version of lpr&friends on other platforms.

While testing I out that (at least on my system) lpd has been
closing 11095 fd's, when there are only 6 fd's open.  The old
code took 120 times more clocktime than calling closefrom().
(although that was still less than 2/1000-ths of a second!)

Reviewed by: jilles
MFC after: 2 weeks

11 years agocap_rights_limit(2): CAP_ACCEPT also permits accept4(2).
Jilles Tjoelker [Mon, 27 May 2013 21:37:19 +0000 (21:37 +0000)]
cap_rights_limit(2): CAP_ACCEPT also permits accept4(2).

11 years ago* Update polynomial coefficients.
Steve Kargl [Mon, 27 May 2013 20:43:16 +0000 (20:43 +0000)]
* Update polynomial coefficients.
* Use ENTERI/RETURNI to allow the use of FP_PE on i386 target.

Reviewed by: das (and bde a long time ago)
Approved by: das (mentor)
Obtained from: bde (polynomial coefficients)

11 years agoPartially apply the capitalization of the heading word of the sequence
Konstantin Belousov [Mon, 27 May 2013 18:45:45 +0000 (18:45 +0000)]
Partially apply the capitalization of the heading word of the sequence
and fix typo.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoUse slightly more idiomatic expression to get the address of array.
Konstantin Belousov [Mon, 27 May 2013 18:39:39 +0000 (18:39 +0000)]
Use slightly more idiomatic expression to get the address of array.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoThe _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit
Konstantin Belousov [Mon, 27 May 2013 18:36:46 +0000 (18:36 +0000)]
The _MC_HASFPXSTATE and _MC_IA32_HASFPXSTATE flags have the same bit
value on purpose, but the ia32 context handling code is logically more
correct to use the _MC_IA32_HASFPXSTATE name for the flag.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoThe ia32_get_mcontext() does not need to set PCB_FULL_IRET. The
Konstantin Belousov [Mon, 27 May 2013 18:31:15 +0000 (18:31 +0000)]
The ia32_get_mcontext() does not need to set PCB_FULL_IRET.  The
usermode context state is not changed by the get operation, and
get_mcontext() does not require full iret as well.

Tested by: dim, pgj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen reporting the fault details, also print %rsp.
Konstantin Belousov [Mon, 27 May 2013 18:29:20 +0000 (18:29 +0000)]
When reporting the fault details, also print %rsp.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoWhen handling an exception from the attempt from loading the faulting
Konstantin Belousov [Mon, 27 May 2013 18:26:08 +0000 (18:26 +0000)]
When handling an exception from the attempt from loading the faulting
context on return from the trap handler, re-enable the interrupts on
i386 and amd64.  The trap return path have to disable interrupts since
the sequence of loading the machine state is not atomic.  The trap()
function which transfers the control to the special handler would
enable the interrupt, but an iret loads the previous eflags with PSL_I
clear.  Then, the special handler calls trap() on its own, which now
sees the original eflags with PSL_I set and does not enable
interrupts.

The end result is that signal delivery and process exiting code could
be executed with interrupts disabled, which is generally wrong and
triggers several assertions.

For amd64, the interrupts are enabled conditionally based on PSL_I in
the eflags of the outer frame, as it is already done for
doreti_iret_fault.  For i386, the interrupts are enabled
unconditionally, the ast loop could have opened a window with
interrupts enabled just before the iret anyway.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoFix some regressions caused by the switch from gcc to clang. The fixes
David Schultz [Mon, 27 May 2013 08:50:10 +0000 (08:50 +0000)]
Fix some regressions caused by the switch from gcc to clang. The fixes
are workarounds for various symptoms of the problem described in clang
bugs 3929, 8100, 8241, 10409, and 12958.

The regression tests did their job: they failed, someone brought it
up on the mailing lists, and then the issue got ignored for 6 months.
Oops. There may still be some regressions for functions we don't have
test coverage for yet.

11 years agoWorkaround for for a problem seen with ATI Technologies EHCI
Hans Petter Selasky [Mon, 27 May 2013 06:32:07 +0000 (06:32 +0000)]
Workaround for for a problem seen with ATI Technologies EHCI
controller hardware most likely present on UHCI chipsets aswell. The
bug manifests itself when issuing isochronous transfers and bulk
transfers towards the same device simultaneously. From time to time it
happens that either the completion IRQ was missing or that the
completion IRQ was happening before the ITD/SITD was completely
written back to memory. The workaround assumes that double buffered
isochronous transfers are used, and that a second interrupt is
generated at the beginning of the next isochronous transfer to
complete the previous one. Possibly skipping the interrupt at the last
isochronous frame is possible, but will then break single buffered
isochronous transfers. For now we can live with some extra interrupts.

MFC after: 1 week

11 years agoFix ONFI chip detection.
Grzegorz Bernacki [Mon, 27 May 2013 06:24:31 +0000 (06:24 +0000)]
Fix ONFI chip detection.

Submitted by: Alexander Fedorov <alexander.fedorov@rtlservice.com>

11 years agoAdd DTS for AM335x EVM with properly muxed PWM and LCD pins, and
Oleksandr Tymoshenko [Mon, 27 May 2013 00:26:29 +0000 (00:26 +0000)]
Add DTS for AM335x EVM with properly muxed PWM and LCD pins, and
LCD panel description

11 years agoAdd PWM and LCDC nodes to base DTS for AM335x-based devices
Oleksandr Tymoshenko [Mon, 27 May 2013 00:23:59 +0000 (00:23 +0000)]
Add PWM and LCDC nodes to base DTS for AM335x-based devices

11 years agoAM335x LCD controller driver with syscons support
Oleksandr Tymoshenko [Mon, 27 May 2013 00:23:01 +0000 (00:23 +0000)]
AM335x LCD controller driver with syscons support

Limitations:
- Raster mode only
- 24 and 32 bpp only

11 years agoAdd PWM module driver for AM335x. Only eCAS subsystem is supported
Oleksandr Tymoshenko [Mon, 27 May 2013 00:13:27 +0000 (00:13 +0000)]
Add PWM module driver for AM335x. Only eCAS subsystem is supported

Export function to configure eCAS submodule from another drivers.
It's used to control LCD panel backlight on AM335x EVM.

11 years agoAdd SCM registers definitions for AM335x platform
Oleksandr Tymoshenko [Mon, 27 May 2013 00:09:04 +0000 (00:09 +0000)]
Add SCM registers definitions for AM335x platform

11 years agoAdd clock definitions for LCD controller and PWM module
Oleksandr Tymoshenko [Mon, 27 May 2013 00:06:24 +0000 (00:06 +0000)]
Add clock definitions for LCD controller and PWM module

11 years agoMigrate ath(4) to now use if_transmit instead of the legacy if_start
Adrian Chadd [Sun, 26 May 2013 22:23:39 +0000 (22:23 +0000)]
Migrate ath(4) to now use if_transmit instead of the legacy if_start
and if queue mechanism; also fix up (non-11n) TX fragment handling.

This may result in a bit of a performance drop for now but I plan on
debugging and resolving this at a later stage.

Whilst here, fix the transmit path so fragment transmission works.

The TX fragmentation handling is a bit more special.  In order to
correctly transmit TX fragments, there's a bunch of corner cases that
need to be handled:

* They must be transmitted back to back, in the same order..
* .. ie, you need to hold the TX lock whilst transmitting this
  set of fragments rather than interleaving it with other MSDUs
  destined to other nodes;
* The length of the next fragment is required when transmitting, in
  order to correctly set the NAV field in the current frame to the
  length of the next frame; which requires ..
* .. that we know the transmit duration of the next frame, which ..
* .. requires us to set the rate of all fragments to the same length,
  or make the decision up-front, etc.

To facilitate this, I've added a new ath_buf field to describe the
length of the next fragment.  This avoids having to keep the mbuf
chain together.  This used to work before my 11n TX path work because
the ath_tx_start() routine would be handed a single mbuf with m_nextpkt
pointing to the next frame, and that would be maintained all the way
up to when the duration calculation was done.  This doesn't hold
true any longer - the actual queuing may occur at any point in the
future (think ath_node TID software queuing) so this information
needs to be maintained.

Right now this does work for non-11n frames but it doesn't at all
enforce the same rate control decision for all frames in the fragment.
I plan on fixing this in a followup commit.

RTS/CTS has the same issue, I'll look at fixing this in a subsequent
commit.

Finaly, 11n fragment support requires the driver to have fully
decided what the rate scenario setup is - including 20/40MHz,
short/long GI, STBC, LDPC, number of streams, etc.  Right now that
decision is (currently) made _after_ the NAV field value is updated.
I'll fix all of this in subsequent commits.

Tested:

* AR5416, STA, transmitting 11abg fragments
* AR5416, STA, 11n fragments work but the NAV field is incorrect for
  the reasons above.

TODO:

* It would be nice to be able to queue mbufs per-node and per-TID so
  we can only queue ath_buf entries when it's time to assemble frames
  to send to the hardware.

  But honestly, we should just do that level of software queue management
  in net80211 rather than ath(4), so I'm going to leave this alone for now.

* More thorough AP, mesh and adhoc testing.

* Ensure that net80211 doesn't hand us fragmented frames when A-MPDU has
  been negotiated, as we can't do software retransmission of fragments.

* .. set CLRDMASK when transmitting fragments, just to ensure.

11 years agoUnbreak ia64 tinderbox: 64-bit support was made conditional upon
Marcel Moolenaar [Sun, 26 May 2013 22:11:13 +0000 (22:11 +0000)]
Unbreak ia64 tinderbox: 64-bit support was made conditional upon
__amd64__, and thus limited. Eliminate 2 trivial conditionals by
casting the 64-bit integral, holding an address, via (uintptr_t)
to (void *) and replace the last remaining check for __amd64__
with a check for __LP64__ instead.

11 years agos/recieve/receive
Jens Schweikhardt [Sun, 26 May 2013 18:57:59 +0000 (18:57 +0000)]
s/recieve/receive

11 years agoRemove backwards compat layer which was added in r71419 (in 2001).
Eitan Adler [Sun, 26 May 2013 14:54:06 +0000 (14:54 +0000)]
Remove backwards compat layer which was added in r71419 (in 2001).

This change is not intended for MFC.

Reviewed by: peter

11 years agoPull in r182656 from upstream llvm trunk:
Dimitry Andric [Sun, 26 May 2013 14:14:42 +0000 (14:14 +0000)]
Pull in r182656 from upstream llvm trunk:

  LoopVectorize: LoopSimplify can't canonicalize loops with an
  indirectbr in it, don't assert on those cases.

  Fixes PR16139.

This should fix clang assertion failures when optimizing at -O3, similar
to:

  Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"),
  function canVectorize, file
  contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171.

Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de>
PR: ports/178332, ports/178977
MFC after: 3 days

11 years agoMove libmd.so.5 to the proper place and add missing lib32 entry.
Antoine Brodin [Sun, 26 May 2013 09:25:14 +0000 (09:25 +0000)]
Move libmd.so.5 to the proper place and add missing lib32 entry.

11 years agoRework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
Jeremie Le Hen [Sat, 25 May 2013 22:17:14 +0000 (22:17 +0000)]
Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
The build system is really intricate and I had a hard time to remind the
whole picture even when reading my own words.  This one will hopefully
be better.

11 years agoMake the malloc(3) family of functions weak and make their non-weak
Marcel Moolenaar [Sat, 25 May 2013 18:59:11 +0000 (18:59 +0000)]
Make the malloc(3) family of functions weak and make their non-weak
implementations visible for use by applications. The functions $F that
are now weak symbols are:
allocm, calloc, dallocm, free, malloc, malloc_usable_size,
nallocm, posix_memalign, rallocm, realloc, sallocm

The non-weak implementations of $F are exported as __$F.

Submitted by: stevek@juniper.net
Reviewed by: jasone@, kib@
Approved by: jasone@ (jemalloc)
Obtained from: juniper Networks, Inc

11 years agoAdd C11 macros CMPLX(), CMPLXF() and CMPLXL().
Ed Schouten [Sat, 25 May 2013 18:55:55 +0000 (18:55 +0000)]
Add C11 macros CMPLX(), CMPLXF() and CMPLXL().

Clang allows us to initialize complex numbers using an array
initializer, casted to a complex type. GCC has a builtin called
__builtin_complex().

11 years agoAdd missing #includes, to keep Clang silent.
Ed Schouten [Sat, 25 May 2013 18:04:24 +0000 (18:04 +0000)]
Add missing #includes, to keep Clang silent.

11 years agoFix some statical clang analyzer warnings.
Hans Petter Selasky [Sat, 25 May 2013 17:09:58 +0000 (17:09 +0000)]
Fix some statical clang analyzer warnings.

11 years agoFix <uchar.h> in for C++11.
Ed Schouten [Sat, 25 May 2013 16:58:12 +0000 (16:58 +0000)]
Fix <uchar.h> in for C++11.

It turns out that in C++11, char16_t and char32_t are built-in types;
language keywords. Just fix this by putting traditional _*_T_DECLARED
blocks around the definitions. We'll just predefine these in
<sys/_types.h>.

This also opens up the possibility to define char16_t in other header
files, if ever needed (e.g. if we would gain a <ctype.h> for
char16_t/char32_t).

11 years agoPrevent shadowing.
Ed Schouten [Sat, 25 May 2013 15:36:15 +0000 (15:36 +0000)]
Prevent shadowing.

The name line_number seems to be used as a function parameter name for
one of the Lex functions. Change the name to linenumber.

11 years agosigreturn(2): Remove ancient compatibility warning about 4.2BSD.
Jilles Tjoelker [Sat, 25 May 2013 13:59:40 +0000 (13:59 +0000)]
sigreturn(2): Remove ancient compatibility warning about 4.2BSD.

The HISTORY subsection still says that sigreturn() was added in 4.3BSD.

11 years agoMake some tiny improvements to iconv_open().
Ed Schouten [Sat, 25 May 2013 12:13:54 +0000 (12:13 +0000)]
Make some tiny improvements to iconv_open().

- Remove an unneeded variable.
- Fix whitespace bugs.
- Fix typoes in comment.
- Improve string handling a bit. Don't handroll strstr() and don't
  terminate a strdup()'ed string. Instead, simply strndup() the part we
  need.

11 years agoOnly call free() on something we allocated.
Ed Schouten [Sat, 25 May 2013 12:11:20 +0000 (12:11 +0000)]
Only call free() on something we allocated.

If we were already provided a struct _citrus_iconv (e.g. through
iconv_open_into()), we should not call free() in case io_init_context()
fails. Instead, call it on the pointer of the allocated object, which
will be NULL in case of iconv_open_into().

11 years agoRevert r250972 to fix build.
Glen Barber [Sat, 25 May 2013 07:17:16 +0000 (07:17 +0000)]
Revert r250972 to fix build.

11 years agoFix net80211 fragment creation.
Adrian Chadd [Sat, 25 May 2013 06:28:30 +0000 (06:28 +0000)]
Fix net80211 fragment creation.

When creating fragment frames, the header length should honour the
DATAPAD flag.

This fixes the fragments that are queued to the ath(4) driver but it
doesn't yet fix fragment transmission.  That requires further changes
to the ath(4) transmit path.  Well, strictly speaking, it requires
further changes to _all_ wifi driver transmit paths, but this is at least
a start.

Tested:

* AR5416, STA mode, w/ fragthreshold set to 256.

11 years agoThe error handling for writes to the target file could lead to the final
Stefan Eßer [Fri, 24 May 2013 18:54:52 +0000 (18:54 +0000)]
The error handling for writes to the target file could lead to the final
fclose() being skipped. Fix this by using boolean "&" and "|" instead of
short-cut operators "&&" and "||".
While here, increment the last part of the version string. The reason is
the fixed output file selection logic in pch.c, which was committed as
r250943, yesterday.

Reviewed by: pfg

11 years agoFix building on slightly older -current and stable systems after
Marcel Moolenaar [Fri, 24 May 2013 15:53:13 +0000 (15:53 +0000)]
Fix building on slightly older -current and stable systems after
the switch to bmake. The rescue bits are built via crunchgen,
which didn't respect the MAKE environment variable until r237574
(i.e. ~11 months ago). This resulted in a failure due to bmake's
internal -J flag being passed around and not being understood by
the standard (i.e. host's) make.
Note that the failure is conditional upon having the jobServer
feature enabled within bmake.

11 years agoMention the "nojailvnet" keyword.
Jamie Gritton [Fri, 24 May 2013 14:57:38 +0000 (14:57 +0000)]
Mention the "nojailvnet" keyword.

MFC after: 3 days

11 years agoEnforce validation on the selected delete method via sysctl.
Steven Hartland [Fri, 24 May 2013 11:27:06 +0000 (11:27 +0000)]
Enforce validation on the selected delete method via sysctl.

This prevents users from selecting a delete method which may cause
corruption e.g. MPS WS16 on pre P14 firmware.

Reviewed by: pjd (mentor)
Approved by: pjd (mentor)
MFC after: 2 days

11 years agoFix the data corruption on the swap-backed md.
Konstantin Belousov [Fri, 24 May 2013 09:48:42 +0000 (09:48 +0000)]
Fix the data corruption on the swap-backed md.

Assign the rv variable a success code if the pager was not asked for
the page.  Using an error code from the previous processed page caused
zeroing of the valid page, when e.g. the previous page was not
available in the pager.

Reported by: lstewart
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

11 years agoDriver 'aacraid' added. Supports Adaptec by PMC RAID controller families Series 6...
Achim Leubner [Fri, 24 May 2013 09:22:43 +0000 (09:22 +0000)]
Driver 'aacraid' added. Supports Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products. Older Adaptec RAID controller families are supported by the 'aac' driver.

Approved by: scottl (mentor)

11 years agoWithdraw http://svnweb.freebsd.org/changeset/base/250809
Michael Tuexen [Fri, 24 May 2013 09:21:18 +0000 (09:21 +0000)]
Withdraw http://svnweb.freebsd.org/changeset/base/250809
since the real fix is in http://svnweb.freebsd.org/changeset/base/250952.

11 years agoThe fasttrap provider cleans up probes asynchronously when a process with
Mark Johnston [Fri, 24 May 2013 03:29:32 +0000 (03:29 +0000)]
The fasttrap provider cleans up probes asynchronously when a process with
USDT probes exits. This was previously done with a callout; however, it is
possible to sleep while holding the DTrace mutexes, so a panic will occur
on INVARIANTS kernels if the callout handler can't immediately acquire one
of these mutexes. This panic will be frequently triggered on systems where
a USDT-enabled program (perl, for instance) is often run.

This revision changes the fasttrap cleanup mechanism so that a dedicated
thread is used instead of a callout. The old behaviour is otherwise
preserved.

Reviewed by: rpaulo
MFC after: 1 month

11 years agoInitialising the new fibnum field to a known value turns out to
Julian Elischer [Fri, 24 May 2013 02:18:37 +0000 (02:18 +0000)]
Initialising the new fibnum field to a known value turns out to
be a GOOD IDEA (TM).
Apparently MOST users set this (e.g. tcp and friends) but there are a few
users that just assume that it is a sensible value but then go on to read it.
These include SCTP, pf and the FLOWTABLE option (and maybe others).

11 years agoEnsure alq's shutdown_pre_sync event handler is deregistered on module unload to
Lawrence Stewart [Fri, 24 May 2013 00:49:12 +0000 (00:49 +0000)]
Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to
avoid a dangling pointer and eventual panic on system shutdown.

Reported by: Ali <comnetboy at gmail.com>
Tested by: Ali <comnetboy at gmail.com>
MFC after: 1 week

11 years agoWhile waiting for the bpf hold buffer to become idle, check
Guy Helmer [Thu, 23 May 2013 21:33:10 +0000 (21:33 +0000)]
While waiting for the bpf hold buffer to become idle, check
the return value from mtx_sleep() and exit bpfread() on
errors such as EINTR.

Reviewed by: jhb

11 years agoUse proper malloc type for ioctls white-list.
Pawel Jakub Dawidek [Thu, 23 May 2013 21:07:26 +0000 (21:07 +0000)]
Use proper malloc type for ioctls white-list.

Reported by: pho
Tested by: pho

11 years agoFix target selection logic, which did not comply with the man page.
Stefan Eßer [Thu, 23 May 2013 20:57:20 +0000 (20:57 +0000)]
Fix target selection logic, which did not comply with the man page.

Instead of using the file with the least order of path name components,
shortest filename and finally the shortest basename (with the search
stopping as soon as one of these conditions is true), the first filename
checked was used as the reference, and another filename was only selected
if all of the above comparisons are in favour of the latter file.

This was wrong, because filenames with path less components were only
considered, if both of the other conditions were true as well. In fact,
the first filename to be checked had good chances to be selected in the
end, since it only needed to be better with regard to any one of the
three criteria ...

Reviewed by: delphij@freebsd.org

11 years agoAdd support for netgroup, based on patch in the PR but made consistent
Guy Helmer [Thu, 23 May 2013 20:52:30 +0000 (20:52 +0000)]
Add support for netgroup, based on patch in the PR but made consistent
with existing style.

PR: bin/132692

11 years agoInclude descriptions of the flags and fields printed when dumping the
Mark Johnston [Thu, 23 May 2013 19:50:36 +0000 (19:50 +0000)]
Include descriptions of the flags and fields printed when dumping the
IPv6 prefix list.

Reviewed by: hrs
MFC after: 1 week

11 years agoChange the copyright notice to a standard BSD 2-clause license and assign
Marcel Moolenaar [Thu, 23 May 2013 19:47:37 +0000 (19:47 +0000)]
Change the copyright notice to a standard BSD 2-clause license and assign
ownership to the FreeBSD foundation for the years this file has been in
the FreeBSD repository.

This file was originally created by Juniper as part of upgrading to FreeBSD
4.10 (which had no MIPS support) and held functions found on other machines
It grew actual functionality over time. The functionaliy was copied from
other architectures and ported to MIPS on a as-needed basis.

Approved by: Mark Baushke (Juniper IP)
Approved by: Megan Sugiyama (Juniper legal)
Pointed out by: jmallett@
Requested by: core (jhb@)