]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoRevert previous commit. The bug was actually caused by an issue
George V. Neville-Neil [Wed, 25 Jul 2012 17:49:01 +0000 (17:49 +0000)]
Revert previous commit.  The bug was actually caused by an issue
in pre 1.8.5 versions of sudo which were sending too many
SIGINTs to processes when the user hit Ctrl-C.

Pointed out by: avg@, rpaulo@, sbruno@

11 years agoUpdate supported hardware list after r238766.
Gavin Atkinson [Wed, 25 Jul 2012 17:25:44 +0000 (17:25 +0000)]
Update supported hardware list after r238766.

MFC after: 1 week

11 years agoremove some extra testing code that slipped into the previous commit
Luigi Rizzo [Wed, 25 Jul 2012 12:51:33 +0000 (12:51 +0000)]
remove some extra testing code that slipped into the previous commit

Reported-by: Alexander Motin
11 years agoFix a problem when CARP is enabled on the interface for IPv4
Bjoern A. Zeeb [Wed, 25 Jul 2012 12:14:39 +0000 (12:14 +0000)]
Fix a problem when CARP is enabled on the interface for IPv4
but not for IPv6.  The current checks in nd6_nbr.c along with the
old version will result in ifa being NULL and subsequently the
packet will be dropped.  This prevented NS/NA, from working and
with that IPv6.

Now return the ifa from the carp lookup function in two cases:
1) if the address matches, is a carp address, and we are MASTER
   (as before),
2) if the address matches but it is not a carp address at all (new).

Reported by: Peter Wemm (new Y! FreeBSD cluster, eating our own dogfood)
Tested on: New Y! FreeBSD cluster machines
Reviewed by: glebius

11 years agoUpdate the list of devices supported by uplcom. Although this only adds
Gavin Atkinson [Wed, 25 Jul 2012 11:33:43 +0000 (11:33 +0000)]
Update the list of devices supported by uplcom.  Although this only adds
one device (support for Motorola cables), this syncronises us with:

OpenBSD src/sys/dev/usb/uplcom.c 1.56
NetBSD  src/sys/dev/usb/uplcom.c 1.73
Linux   kernel.org HEAD

MFC after: 1 week

11 years agoUse legacy interrupts as a default. This gives up to 10% speedup
Luigi Rizzo [Wed, 25 Jul 2012 11:28:15 +0000 (11:28 +0000)]
Use legacy interrupts as a default. This gives up to 10% speedup
when used in qemu (and this driver is for non-PCIe cards,
so probably its largest use is in virtualized environments).

Approved by: Jack Vogel
MFC after: 3 days

11 years agoPreen unused Makefiles, programs and ftdump.c which has been renamed
Warner Losh [Wed, 25 Jul 2012 06:04:38 +0000 (06:04 +0000)]
Preen unused Makefiles, programs and ftdump.c which has been renamed
to fdtdump.c in the upstream repo.  This escaped my attention in the
import.

11 years agoAdd rmb() to tsc_read_##x to enforce serialization of rdtsc captures.
Jim Harris [Tue, 24 Jul 2012 22:10:11 +0000 (22:10 +0000)]
Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures.

Intel Architecture Manual specifies that rdtsc instruction is not serialized,
so without this change, TSC synchronization test would periodically fail,
resulting in use of HPET timecounter instead of TSC-low.  This caused
severe performance degradation (40-50%) when running high IO/s workloads due to
HPET MMIO reads and GEOM stat collection.

Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC synchronization
fail approximately 20% of the time.

Sponsored by: Intel
Reviewed by: kib
MFC after: 3 days

11 years agoAlign the header with output.
Mikolaj Golub [Tue, 24 Jul 2012 19:40:12 +0000 (19:40 +0000)]
Align the header with output.

MFC after: 3 days

11 years agoHeavy DNSSEC Validation Load Can Cause a "Bad Cache" Assertion Failure
Doug Barton [Tue, 24 Jul 2012 18:53:28 +0000 (18:53 +0000)]
Heavy DNSSEC Validation Load Can Cause a "Bad Cache" Assertion Failure
in BIND9

High numbers of queries with DNSSEC validation enabled can cause an
assertion failure in named, caused by using a "bad cache" data structure
before it has been initialized.

CVE: CVE-2012-3817
Posting date: 24 July, 2012

11 years agoVendor import of BIND 9.8.3-P2
Doug Barton [Tue, 24 Jul 2012 18:48:17 +0000 (18:48 +0000)]
Vendor import of BIND 9.8.3-P2

11 years agoFix a bug in interrupt handling so that we're only considered
George V. Neville-Neil [Tue, 24 Jul 2012 18:01:28 +0000 (18:01 +0000)]
Fix a bug in interrupt handling so that we're only considered
impatient if we sent more than 2 INT signals.  This fixes a bug where
we wouldn't see aggregations print on the command line if we Ctrl-C'd
a dtrace script or command line invocation.

MFC after: 2 weeks

11 years agoUpdate to latest git version of dtc to get new dtsv2 support,
Warner Losh [Tue, 24 Jul 2012 16:29:33 +0000 (16:29 +0000)]
Update to latest git version of dtc to get new dtsv2 support,
including the include directive.

Fix minor build issue corrected by converting yypush_buffer_state and
yypop_buffer_state to yy_set_buffer_state and a hard-coded 100-deep
stack.  It was easier to fix it here than to import that support into
our flex.

The new tools and test hardness remain unsupported at the moment.

11 years agoDon't ever build files depending on the directory where they are placed in.
Andrey A. Chernov [Tue, 24 Jul 2012 16:03:28 +0000 (16:03 +0000)]
Don't ever build files depending on the directory where they are placed in.
It is obvious that its modification time will change with each such file
builded.
This bug cause whole libelf to rebuild itself each second make run
(and relink that files on each first make run) in the loop.

11 years agoFix off by one error in ses_enc_desc_last_byte().
Alexander Motin [Tue, 24 Jul 2012 13:32:49 +0000 (13:32 +0000)]
Fix off by one error in ses_enc_desc_last_byte().

11 years agoDo not call ses_softc_cleanup() in case of configuration read failure.
Alexander Motin [Tue, 24 Jul 2012 13:08:43 +0000 (13:08 +0000)]
Do not call ses_softc_cleanup() in case of configuration read failure.
Just free inclomplete daemon cache instead to let it retry next time.
Premature ses_softc_cleanup() caused NULL dereference when freed softc
was accessed later.

11 years agoAdd missing files in f807af192828222dee7a5c9f94d999673bb4d8a1 import.
Warner Losh [Tue, 24 Jul 2012 04:12:44 +0000 (04:12 +0000)]
Add missing files in f807af192828222dee7a5c9f94d999673bb4d8a1 import.

11 years agoImport dtc from git://git.jdl.com/software/dtc
Warner Losh [Tue, 24 Jul 2012 02:58:10 +0000 (02:58 +0000)]
Import dtc from git://git.jdl.com/software/dtc
hash f807af192828222dee7a5c9f94d999673bb4d8a1

11 years agoAddendum to r238604. If the inactive queue scan isn't restarted, then
Alan Cox [Tue, 24 Jul 2012 02:35:30 +0000 (02:35 +0000)]
Addendum to r238604.  If the inactive queue scan isn't restarted, then
the variable "addl_page_shortage_init" isn't needed.

X-MFC after: r238604

11 years agoAdd a new HAL method - the AR93xx and later NICs have a separate
Adrian Chadd [Tue, 24 Jul 2012 01:18:19 +0000 (01:18 +0000)]
Add a new HAL method - the AR93xx and later NICs have a separate
TX descriptor ring for TX status completion. This API call will pass
the allocated buffer details to the HAL.

11 years agoMFV: less v451.
Xin LI [Tue, 24 Jul 2012 01:09:11 +0000 (01:09 +0000)]
MFV: less v451.

11 years agoModify ath_descdma_setup() to take a descriptor size parameter.
Adrian Chadd [Mon, 23 Jul 2012 23:40:13 +0000 (23:40 +0000)]
Modify ath_descdma_setup() to take a descriptor size parameter.

The AR9300 and later descriptors are 128 bytes, however I'd like to make
sure that isn't used for earlier chips.

* Populate the TX descriptor length field in the softc with
  sizeof(ath_desc)

* Use this field when allocating the TX descriptors

* Pre-AR93xx TX/RX descriptors will use the ath_desc size; newer ones will
  query the HAL for these sizes.

11 years agoVendor import of v451 (beta)
Xin LI [Mon, 23 Jul 2012 21:31:53 +0000 (21:31 +0000)]
Vendor import of v451 (beta)

11 years agoHook ld80/s_expl.c or ld128/s_expl.c into the building of libm.
Steve Kargl [Mon, 23 Jul 2012 19:23:49 +0000 (19:23 +0000)]
Hook ld80/s_expl.c or ld128/s_expl.c into the building of libm.

PR: standards/152415
Approved by: das (mentor)

11 years agoForcibly shut up clang warning about NULL pointer dereference.
Konstantin Belousov [Mon, 23 Jul 2012 19:16:31 +0000 (19:16 +0000)]
Forcibly shut up clang warning about NULL pointer dereference.

MFC after: 3 weeks

11 years agoCompute the exponential of x for Intel 80-bit format and IEEE 128-bit
Steve Kargl [Mon, 23 Jul 2012 19:13:55 +0000 (19:13 +0000)]
Compute the exponential of x for Intel 80-bit format and IEEE 128-bit
format.  These implementations are based on

PTP Tang, "Table-driven implementation of the exponential function
in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15,
144-157 (1989).

PR: standards/152415
Submitted by: kargl
Reviewed by: bde, das
Approved by: das (mentor)

11 years agoWhen WITHOUT_CLANG is being used, also clean out the clang 3.1 headers
Dimitry Andric [Mon, 23 Jul 2012 16:36:13 +0000 (16:36 +0000)]
When WITHOUT_CLANG is being used, also clean out the clang 3.1 headers
in OptionalObsoleteFiles.inc.

PR: misc/169902
Submitted by: Thomas Eberhardt <sneakywumpus@googlemail.com>
MFC after: 3 days

11 years agoQuirk MS keyboard so that function keys work
Ed Maste [Mon, 23 Jul 2012 15:14:28 +0000 (15:14 +0000)]
Quirk MS keyboard so that function keys work

The function keys on a Microsoft Natural Egronomic Keyboard 4000 have been
repurposed as "Help", "Undo", "Redo" etc., and a special "F Lock" key is
required to return them to their normal purpose.

This change enables the UQ_KBD_BOOTPROTO quirk for the MS Natural 4000
keyboard to get the keys working again.  More extensive changes to the USB
keyboard infrastructure would be needed to fully support the "F Lock" mode
and the extended keys on this keyboard.

PR: usb/116947
Approved by: hselasky@

11 years agou3g: add support for Huawei E392 LTE modem
Eygene Ryabinkin [Mon, 23 Jul 2012 14:22:45 +0000 (14:22 +0000)]
u3g: add support for Huawei E392 LTE modem

I am using it rebranded and it carries the label "Megafon"
(it is Russian mobile operator); works fine with my 3G network.

Approved by: hselasky

11 years agoRevert this; it wasn't supposed to be part of this commit.
Adrian Chadd [Mon, 23 Jul 2012 03:55:19 +0000 (03:55 +0000)]
Revert this; it wasn't supposed to be part of this commit.

11 years agoBegin separating out the TX DMA setup in preparation for TX EDMA support.
Adrian Chadd [Mon, 23 Jul 2012 03:52:18 +0000 (03:52 +0000)]
Begin separating out the TX DMA setup in preparation for TX EDMA support.

* Introduce TX DMA setup/teardown methods, mirroring what's done in
  the RX path.

  Although the TX DMA descriptor is setup via ath_desc_alloc() /
  ath_desc_free(), there TX status descriptor ring will be allocated
  in this path.

* Remove some of the TX EDMA capability probing from the RX path and
  push it into the new TX EDMA path.

11 years agoFlesh out a new DMA map for the EDMA TX completion status, as well
Adrian Chadd [Mon, 23 Jul 2012 02:49:25 +0000 (02:49 +0000)]
Flesh out a new DMA map for the EDMA TX completion status, as well
as a lock to go with that whole code path.

11 years agoBegin modifying the descriptor allocation functions to support a variable
Adrian Chadd [Mon, 23 Jul 2012 02:26:33 +0000 (02:26 +0000)]
Begin modifying the descriptor allocation functions to support a variable
sized TX descriptor.

This is required for the AR93xx EDMA support which requires 128 byte
TX descriptors (which is significantly larger than the earlier
hardware.)

11 years agoDocument the following in rc.conf.5:
Glen Barber [Sun, 22 Jul 2012 23:21:21 +0000 (23:21 +0000)]
Document the following in rc.conf.5:
 - rtsold_enable
 - rtsold_flags
 - rtsol_flags

MFC after: 1 week

11 years agoCorrect ugen.4 to show that it has been integrated into usb(4). Also fix
Warren Block [Sun, 22 Jul 2012 21:43:46 +0000 (21:43 +0000)]
Correct ugen.4 to show that it has been integrated into usb(4).  Also fix
some punctuation errors.

Approved by: hps
MFC after: 3 days

11 years agoDerive FREEBSD_PART from /etc/fstab, and make it full device name.
Poul-Henning Kamp [Sun, 22 Jul 2012 20:55:42 +0000 (20:55 +0000)]
Derive FREEBSD_PART from /etc/fstab, and make it full device name.

Give suggestion for next steps when done.

Inspired by patches from: Flemming "F3" Jacobsen

11 years agoPut struct ostat and struct nstat under #ifdef _KERNEL. The
Konstantin Belousov [Sun, 22 Jul 2012 20:08:38 +0000 (20:08 +0000)]
Put struct ostat and struct nstat under #ifdef _KERNEL. The
compatibility definitions are only needed for implementation of the
syscalls, they cause namespace pollution and are not useful for
applications.

Noted by: bde
MFC after: 1 week

11 years agoReplace hardcoded /mnt with ${SBMNT} which defaults to /mnt.sysbuild
Poul-Henning Kamp [Sun, 22 Jul 2012 19:32:27 +0000 (19:32 +0000)]
Replace hardcoded /mnt with ${SBMNT} which defaults to /mnt.sysbuild

Submitted by: Flemming "F3" Jacobsen

11 years agoFix a bug which prevents "nfsstat -W" for server statistics from working.
Hiroki Sato [Sun, 22 Jul 2012 18:59:31 +0000 (18:59 +0000)]
Fix a bug which prevents "nfsstat -W" for server statistics from working.

11 years agoFix a bug introduced in r221129 that leads to a panic wen using bundled
Bjoern A. Zeeb [Sun, 22 Jul 2012 17:46:05 +0000 (17:46 +0000)]
Fix a bug introduced in r221129 that leads to a panic wen using bundled
SAs.  For now allow same address family bundles.  While discovered with
ESP and AH, which does not make a lot of sense, IPcomp could be a possible
problematic candidate.

PR: kern/164400
MFC after: 3 days

11 years agoUpdate some stale comments regarding tcbinfo locking in the TCP input
Robert Watson [Sun, 22 Jul 2012 17:31:36 +0000 (17:31 +0000)]
Update some stale comments regarding tcbinfo locking in the TCP input
path: read locks on tcbinfo are no longer used, so won't happen.  No
functional change.

MFC after: 3 days

11 years agoUse NULL instead of 0 for pointers
Kevin Lo [Sun, 22 Jul 2012 15:40:31 +0000 (15:40 +0000)]
Use NULL instead of 0 for pointers

11 years agoCosmetics: define FREEBSD32_MINUSER and AOUT32_MINUSER for struct
Konstantin Belousov [Sun, 22 Jul 2012 13:41:45 +0000 (13:41 +0000)]
Cosmetics: define FREEBSD32_MINUSER and AOUT32_MINUSER for struct
sysentvec .sv_minuser. Also improve style.

Submitted by: Oliver Pinter <oliver.pinter@gmail.com>
MFC after: 1 week

11 years agoMFCamd64 r238598:
Konstantin Belousov [Sat, 21 Jul 2012 21:52:48 +0000 (21:52 +0000)]
MFCamd64 r238598:
Provide siginfo.si_code for floating point errors when error occurs
using the SSE math processor.

MFC after:    3 weeks

11 years agoMFamd64 r238668:
Konstantin Belousov [Sat, 21 Jul 2012 21:49:05 +0000 (21:49 +0000)]
MFamd64 r238668:
Stop clearing x87 exceptions in the #MF handler.

Requested by: bde
MFC after: 1 week

11 years agoMFamd64 r238597:
Konstantin Belousov [Sat, 21 Jul 2012 21:39:23 +0000 (21:39 +0000)]
MFamd64 r238597:
Add stmxcsr.

MFC after: 3 weeks

11 years agoMFamd64 r238669:
Konstantin Belousov [Sat, 21 Jul 2012 21:39:02 +0000 (21:39 +0000)]
MFamd64 r238669:
Force clean FPU state in PCB user FPU save area for PT_I386_{GET,SET}XMMREGS.

Reported by: bde
MFC after: 1 week

11 years agoUse 16bit PIO instead of 32bit in case of misaligned buffer.
Alexander Motin [Sat, 21 Jul 2012 14:59:43 +0000 (14:59 +0000)]
Use 16bit PIO instead of 32bit in case of misaligned buffer.
It fixes kernel panic during CD write with cdrecord on sparc64.

11 years agoFix typo in comment, should be MHz here.
Gleb Smirnoff [Sat, 21 Jul 2012 14:07:43 +0000 (14:07 +0000)]
Fix typo in comment, should be MHz here.

Submitted by: Daan Vreeken <Daan vitsch.nl>

11 years agoConstently use 2-space sentence breaks.
Konstantin Belousov [Sat, 21 Jul 2012 13:53:00 +0000 (13:53 +0000)]
Constently use 2-space sentence breaks.

Submitted by:  bde
MFC after:  1 week

11 years agoStop caching curpcb in the local variable.
Konstantin Belousov [Sat, 21 Jul 2012 13:47:37 +0000 (13:47 +0000)]
Stop caching curpcb in the local variable.

Requested by:     bde
MFC after:     1 week

11 years agoThe PT_I386_{GET,SET}XMMREGS and PT_{GET,SET}XSTATE operate on the
Konstantin Belousov [Sat, 21 Jul 2012 13:06:37 +0000 (13:06 +0000)]
The PT_I386_{GET,SET}XMMREGS and PT_{GET,SET}XSTATE operate on the
stopped threads. Implementation assumes that the thread's FPU context
is spilled into the PCB due to stop. This is mostly true, except when
FPU state for the thread is not initialized. Then the requests operate
on the garbage state which is currently left in the PCB, causing
confusion.

The situation is indeed observed after a signal delivery and before
#NM fault on execution of any FPU instruction in the signal handler,
since sendsig(9) drops FPU state for current thread, clearing
PCB_FPUINITDONE. When inspecting context state for the signal handler,
debugger sees the FPU state of the main program context instead of the
clear state supposed to be provided to handler.

Fix this by forcing clean FPU state in PCB user FPU save area by
performing getfpuregs(9) before accessing user FPU save area in
ptrace_machdep.c.

Note: this change will be merged to i386 kernel as well, where it is
much more important, since e.g. gdb on i386 uses PT_I386_GETXMMREGS to
inspect FPU context on CPUs that support SSE. Amd64 version of gdb
uses PT_GETFPREGS to inspect both 64 and 32 bit processes, which does
not exhibit the bug.

Reported by: bde
MFC after: 1 week

11 years agoStop clearing x87 exceptions in the #MF handler on amd64. If user code
Konstantin Belousov [Sat, 21 Jul 2012 13:05:34 +0000 (13:05 +0000)]
Stop clearing x87 exceptions in the #MF handler on amd64. If user code
understands FPU hardware enough to catch SIGFPE and unmask exceptions
in control word, then it may as well properly handle return from
SIGFPE without causing an infinite loop of #MF exceptions due to
faulting instruction restart, when needed.

Clearing exceptions causes information loss for handlers which do
understand FPU hardware, and struct siginfo si_code member cannot be
considered adequate replacement for en_sw content due to translation.

Supposed reason for clearing the exceptions, which is IRQ13 handling
oddities, were never applicable to amd64.

Note: this change will be merged to i386 kernel as well, since we do
not support IRQ13 delivery of #MF notifications for some time.

Requested by: bde
MFC after: 1 week

11 years ago(Incomplete) fixes for symbols visibility issues and style in fcntl.h.
Konstantin Belousov [Sat, 21 Jul 2012 13:02:11 +0000 (13:02 +0000)]
(Incomplete) fixes for symbols visibility issues and style in fcntl.h.

Append '__' prefix to the tag of struct oflock, and put it under BSD
namespace. Structure is needed both by libc and kernel, thus cannot be
hidden under #ifdef _KERNEL.

Move a set of non-standard F_* and O_* constants into BSD namespace.
SUSv4 explicitely allows implemenation to pollute F_* and O_* names
after fcntl.h is included, but it costs us nothing to adhere
to the specification if exact POSIX compliance level is requested by
user code.

Change some spaces after #define to tabs.

Noted by and discussed with:      bde
MFC after:   1 week

11 years agoFix typo in bzero length argument during sense fetching.
Alexander Motin [Sat, 21 Jul 2012 08:19:43 +0000 (08:19 +0000)]
Fix typo in bzero length argument during sense fetching.
For me it at least fixed CD burning in PIO mode.

MFC after: 3 days

11 years agoRemove copy/pasteo in the copyright notice.
George V. Neville-Neil [Sat, 21 Jul 2012 07:14:52 +0000 (07:14 +0000)]
Remove copy/pasteo in the copyright notice.

11 years agoAdd a new script, hotopen, which shows what uid is opening files
George V. Neville-Neil [Fri, 20 Jul 2012 23:56:23 +0000 (23:56 +0000)]
Add a new script, hotopen, which shows what uid is opening files
on a per second basis.  While here clean up the Makefile as well.

MFC after: 1 week

11 years agoMake it possible to resize opened partitions.
Edward Tomasz Napierala [Fri, 20 Jul 2012 17:51:20 +0000 (17:51 +0000)]
Make it possible to resize opened partitions.

Sponsored by: FreeBSD Foundation

11 years agoMake ZVOL resizing ('zfs set volsize') properly resize the GEOM provider.
Edward Tomasz Napierala [Fri, 20 Jul 2012 16:56:34 +0000 (16:56 +0000)]
Make ZVOL resizing ('zfs set volsize') properly resize the GEOM provider.

Sponsored by: FreeBSD Foundation

11 years agoUse proper error message when fstat(2) fails on stdout.
Jaakko Heinonen [Fri, 20 Jul 2012 08:33:23 +0000 (08:33 +0000)]
Use proper error message when fstat(2) fails on stdout.

PR: bin/159746
Submitted by: Alex K.

11 years agostyle(9).
Jaakko Heinonen [Fri, 20 Jul 2012 08:31:36 +0000 (08:31 +0000)]
style(9).

11 years agoAdd a needed #include due to my recent change.
Adrian Chadd [Fri, 20 Jul 2012 07:49:26 +0000 (07:49 +0000)]
Add a needed #include due to my recent change.

11 years agoAdd missing SRCS.
Adrian Chadd [Fri, 20 Jul 2012 07:38:11 +0000 (07:38 +0000)]
Add missing SRCS.

11 years agoAdd the new athratestats tool.
Adrian Chadd [Fri, 20 Jul 2012 07:17:24 +0000 (07:17 +0000)]
Add the new athratestats tool.

12 years agoTidy things up substantially:
Adrian Chadd [Fri, 20 Jul 2012 06:11:26 +0000 (06:11 +0000)]
Tidy things up substantially:

* remove some debugging;
* introduce command line arguments;
* introduce support for non-ath0 interfaces.

12 years agoDon't forget to initialize return value.
David Xu [Fri, 20 Jul 2012 05:47:12 +0000 (05:47 +0000)]
Don't forget to initialize return value.

12 years agoSimplify code by replacing _thr_ref_add() with _thr_find_thread().
David Xu [Fri, 20 Jul 2012 03:37:19 +0000 (03:37 +0000)]
Simplify code by replacing _thr_ref_add() with _thr_find_thread().

12 years agoEliminate duplicated code.
David Xu [Fri, 20 Jul 2012 03:27:07 +0000 (03:27 +0000)]
Eliminate duplicated code.

12 years agoDon't assign same value.
David Xu [Fri, 20 Jul 2012 03:22:17 +0000 (03:22 +0000)]
Don't assign same value.

12 years agoEliminate duplicated code.
David Xu [Fri, 20 Jul 2012 03:16:52 +0000 (03:16 +0000)]
Eliminate duplicated code.

12 years agoEliminate duplicated code.
David Xu [Fri, 20 Jul 2012 03:00:41 +0000 (03:00 +0000)]
Eliminate duplicated code.

12 years agoUse the rate control table to display the rate rather than the rix,
Adrian Chadd [Fri, 20 Jul 2012 02:18:47 +0000 (02:18 +0000)]
Use the rate control table to display the rate rather than the rix,
making the output of this program much more meaningful.

12 years agoIntroduce a rate table TLV so rate table statistics consumers
Adrian Chadd [Fri, 20 Jul 2012 02:17:48 +0000 (02:17 +0000)]
Introduce a rate table TLV so rate table statistics consumers
know how to map rix -> rate code.

12 years agoDon't forget to release a thread reference count,
David Xu [Fri, 20 Jul 2012 01:56:14 +0000 (01:56 +0000)]
Don't forget to release a thread reference count,
replace _thr_ref_add() with _thr_find_thread(),
so reference count is no longer needed.

MFC after: 3 days

12 years agoBump this up to match what the HAL is at now.
Adrian Chadd [Fri, 20 Jul 2012 01:41:18 +0000 (01:41 +0000)]
Bump this up to match what the HAL is at now.

12 years agoImplement a first cut of the 'sample' rate statistics userland utility.
Adrian Chadd [Fri, 20 Jul 2012 01:38:03 +0000 (01:38 +0000)]
Implement a first cut of the 'sample' rate statistics userland utility.

This outputs almost exactly the same information as the kernel sysctl does,
however the rix -> rate mapping isn't yet available as a TLV.

12 years agoEnable the basic node-based rate control statistics via an ioctl().
Adrian Chadd [Fri, 20 Jul 2012 01:36:46 +0000 (01:36 +0000)]
Enable the basic node-based rate control statistics via an ioctl().

12 years agoAdd a per-node rate control routine for each rate control module.
Adrian Chadd [Fri, 20 Jul 2012 01:36:02 +0000 (01:36 +0000)]
Add a per-node rate control routine for each rate control module.

For now, the only module implement is 'sample', and that's only partially
implemented.  The main issue here with reusing this structure in userland
is that it uses 'rix' everywhere, which requires the userland code to
have access to the current HAL rate table.

For now, this is a very large work in progress.

Specific details:

* The rate control information is per-node at the moment and wrapped
  in a TLV, to ease parsing and backwards compatibility.
* .. but so I can be slack for now, the userland statistics are just
  a copy of the kernel-land sample node state.
* However, for now use a temporary copy and change the rix entries
  to dot11rate entries to make it slightly easier to eyeball.

Problems:

* The actual rate information table is unfortunately indexed by rix
  and it doesn't contain a rate code.  So the userland side of this
  currently has no way to extract out a mapping.

TODO:

* Add a TLV payload to dump out the rate control table mapping so
  'rix' can be turned into a dot11 / MCS rate.
* .. then remove the temporary copy.

12 years agoCreate an ioctl API for fetching the current rate control information.
Adrian Chadd [Fri, 20 Jul 2012 01:27:20 +0000 (01:27 +0000)]
Create an ioctl API for fetching the current rate control information.

12 years agoImport an updated version of moduli(5) manual page from OpenBSD.
Xin LI [Fri, 20 Jul 2012 01:11:53 +0000 (01:11 +0000)]
Import an updated version of moduli(5) manual page from OpenBSD.

MFC after: 1 month

12 years agoPrepare for (re)using this header file in userland.
Adrian Chadd [Fri, 20 Jul 2012 00:47:23 +0000 (00:47 +0000)]
Prepare for (re)using this header file in userland.

Remove the inlined code from the header file if it's compiled in userland.
It's not required and it shouldn't be there in the first place.

12 years agoRevert SVN r238628 (mistake).
Devin Teske [Thu, 19 Jul 2012 22:41:00 +0000 (22:41 +0000)]
Revert SVN r238628 (mistake).

12 years agoFix syntax errors (s/:=/:-/).
Devin Teske [Thu, 19 Jul 2012 22:33:13 +0000 (22:33 +0000)]
Fix syntax errors (s/:=/:-/).

Reviewed by: emaste (mentor)
Approved by: emaste (mentor)
MFC after: 3 days

12 years agoRemove line which was accidentally kept in r238614.
Konstantin Belousov [Thu, 19 Jul 2012 20:38:03 +0000 (20:38 +0000)]
Remove line which was accidentally kept in r238614.

Submitted by: pjd
Pointy hat to: kib
MFC after: 1 week

12 years agoMerge more cosmetical changes from NetBSD's libedit.
Pedro F. Giffuni [Thu, 19 Jul 2012 19:15:47 +0000 (19:15 +0000)]
Merge more cosmetical changes from NetBSD's libedit.

makelist:
change tr '[a-z]' '[A-Z]' to tr '[:lower:]' '[:upper:]' so that POSIX
systems work proerly regardsless of environment variable settings.

tokenizer.c:
pass lint on _LP64

Obtained from: NetBSD
MFC after: 2 weeks

12 years agoIntroduce curpcb magic variable, similar to curthread, which is MD
Konstantin Belousov [Thu, 19 Jul 2012 19:09:12 +0000 (19:09 +0000)]
Introduce curpcb magic variable, similar to curthread, which is MD
amd64.  It is implemented as __pure2 inline with non-volatile asm read
from pcpu, which allows a compiler to cache its results.

Convert most PCPU_GET(pcb) and curthread->td_pcb accesses into curpcb.

Note that __curthread() uses magic value 0 as an offsetof(struct pcpu,
pc_curthread). It seems to be done this way due to machine/pcpu.h
needs to be processed before sys/pcpu.h, because machine/pcpu.h
contributes machine-depended fields to the struct pcpu definition. As
result, machine/pcpu.h cannot use struct pcpu yet.

The __curpcb() also uses a magic constant instead of offsetof(struct
pcpu, pc_curpcb) for the same reason. The constants are now defined as
symbols and CTASSERTs are added to ensure that future KBI changes do
not break the code.

Requested and reviewed by: bde
MFC after:    3 weeks

12 years agoAllow to specify no source-address-selection policy
Maksim Yevmenkin [Thu, 19 Jul 2012 15:36:36 +0000 (15:36 +0000)]
Allow to specify no source-address-selection policy

MFC after: 1 week

12 years agoRevert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user
Marius Strobl [Thu, 19 Jul 2012 14:43:46 +0000 (14:43 +0000)]
Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user
data introduced in r236061. Using that flag doesn't make that much
sense on this case as the DMA maps using it are also created during
sym_pci_attach(). Moreover, due to the maxsegsz parameter used, doing
so may exhaust the bounce pages pool on architectures requiring
bounce pages. [1]
While at it, use a slightly more appropriate maxsegsz parameter.

PR: 169526
Submitted by: Mike Watters [1]
MFC after: 3 days

12 years agoAdd share/examples/libusb20 to the list of directories.
Joerg Wunsch [Thu, 19 Jul 2012 11:18:41 +0000 (11:18 +0000)]
Add share/examples/libusb20 to the list of directories.

12 years agoFix several reads beyond the mapped first page of the binary in the
Konstantin Belousov [Thu, 19 Jul 2012 11:15:53 +0000 (11:15 +0000)]
Fix several reads beyond the mapped first page of the binary in the
ELF parser. Specifically, do not allow note reader and interpreter
path comparision in the brandelf code to read past end of the page.
This may happen if specially crafter ELF image is activated.

Submitted by: Lukasz Wojcik <lukasz.wojcik zoho com>
MFC after: 3 days

12 years agoDocument F_DUPFD_CLOEXEC. Also provide some wording changes for
Konstantin Belousov [Thu, 19 Jul 2012 10:23:59 +0000 (10:23 +0000)]
Document F_DUPFD_CLOEXEC. Also provide some wording changes for
F_DUPFD to make it less confusing, at least for me.

MFC after: 1 week

12 years agoImplement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4.
Konstantin Belousov [Thu, 19 Jul 2012 10:22:54 +0000 (10:22 +0000)]
Implement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4.

PR:   standards/169962
Submitted by: Jukka A. Ukkonen <jau iki fi>
MFC after: 1 week

12 years agoUpdate my e-mail to my FreeBSD one.
Niclas Zeising [Thu, 19 Jul 2012 08:56:30 +0000 (08:56 +0000)]
Update my e-mail to my FreeBSD one.

Approved by: joel (mentor)

12 years agoDon't unnecessarily set PGA_REFERENCED in pmap_enter().
Alan Cox [Thu, 19 Jul 2012 05:34:19 +0000 (05:34 +0000)]
Don't unnecessarily set PGA_REFERENCED in pmap_enter().

12 years agoConvert the TX path to use the new HAL methods for accessing the
Adrian Chadd [Thu, 19 Jul 2012 03:51:16 +0000 (03:51 +0000)]
Convert the TX path to use the new HAL methods for accessing the
TX descriptor link pointers.

This is required for the AR93xx and later chipsets.

The RX path is slightly different - the legacy RX path directly
accesses ath_desc->ds_link for now, however this isn't at all done
for EDMA (FIFO) RX.

Now, for those performing a little software archeology here:

This is all a bit sub-optimal. "struct ath_desc" is only really relevant
for the pre-AR93xx NICs - where ds_link and ds_data is always in the
same location.

The AR93xx and later NICs have different descriptor layouts altogether.

Now, for AR93xx and later NICs, you should never directly reference
ds_link and ds_data, as:

* the RX descriptors don't have either - the data is _after_ the RX
  descriptor.  They're just one large buffer.  There's also no need for
  a per-descriptor RX buffer size as they're all fixed sizes.

* the TX descriptors have 4 buffer and 4 length fields _and_ a link
  pointer.  Each frame takes up one TX FIFO pointer, but it can contain
  multiple subframes (either multiple frames in a buffer, and/or
  multiple frames in an aggregate/RIFS burst.)

* .. so, when TX frames are queued to a hardware queue, the link
  pointer is ONLY for buffers in that frame/aggregate.  The next frame
  starts in a new FIFO pointer.

* Finally, descriptor completion status is in a different ring.
  I'll write something up about that when its time to do so.

This was inspired by Linux ath9k and the reference driver but is a
reimplementation.

Obtained from: Linux ath9k, Qualcomm Atheros

12 years agoUse HAL_NUM_RX_QUEUES rather than a magic constant.
Adrian Chadd [Thu, 19 Jul 2012 03:18:15 +0000 (03:18 +0000)]
Use HAL_NUM_RX_QUEUES rather than a magic constant.

12 years agoBreak out the TX descriptor link field into HAL methods.
Adrian Chadd [Thu, 19 Jul 2012 02:25:14 +0000 (02:25 +0000)]
Break out the TX descriptor link field into HAL methods.

The DMA FIFO chips (AR93xx and later) differ slightly to th elegacy
chips:

* The RX DMA descriptors don't have a ds_link field;
* The TX DMA descriptors have a ds_link field however at a different
  offset.

This is a reimplementation based on what the reference driver and ath9k
does.

A subsequent commit will enable it in the TX and beacon paths.

Obtained from: Linux ath9k, Qualcomm Atheros

12 years agoXref mwl(4) and rum(4) in hostapd(8).
Glen Barber [Wed, 18 Jul 2012 23:32:12 +0000 (23:32 +0000)]
Xref mwl(4) and rum(4) in hostapd(8).

MFC after: 3 days

12 years agoMove -n ${_jail} before ${_flags} so that any -n options in ${_flags}
Dag-Erling Smørgrav [Wed, 18 Jul 2012 23:01:23 +0000 (23:01 +0000)]
Move -n ${_jail} before ${_flags} so that any -n options in ${_flags}
will override ours instead of the other way around.

12 years agoDo not restart scan of the inactive queue when non-inactive page is
Konstantin Belousov [Wed, 18 Jul 2012 21:47:50 +0000 (21:47 +0000)]
Do not restart scan of the inactive queue when non-inactive page is
found. Rather, we shall not find such pages on inactive queue at all.

Requested and reviewed by: alc
MFC after:    2 weeks