]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoMore ECN fixes:
Randall Stewart [Mon, 31 Jan 2011 11:50:11 +0000 (11:50 +0000)]
More ECN fixes:
1) We now remove ECN-Nonce since it will no longer continue as a I-D
2) Eliminate last_tsn_echo, this tied us to an assoc not the net
   and thus we were not doing m-homing on the ECN-Echo senders side right.
3) Increment the count going out even if the TSN in lower in the pending
   ECN-Echo, this way the receiver knows exactly how many packets were
   marked even with network re-ordering
4) Fix so we DO NOT stop doing delayed sack if a ECN Echo is in queue
MFC after: 1 month

13 years agoUse correct alphabetical order for xz(1) in SEE ALSO section
Martin Matuska [Mon, 31 Jan 2011 11:30:26 +0000 (11:30 +0000)]
Use correct alphabetical order for xz(1) in SEE ALSO section
of newsyslog manpages.

Reported by: maxim
MFC after: 3 weeks

13 years agoAdd xz(1) support to newsyslog.
Martin Matuska [Mon, 31 Jan 2011 10:57:54 +0000 (10:57 +0000)]
Add xz(1) support to newsyslog.
Rewrite and simplify logfile compression code.

Approved by: gad
MFC after: 3 weeks

13 years agoMFV of tzdata2011a, r218120
Edwin Groothuis [Mon, 31 Jan 2011 09:22:49 +0000 (09:22 +0000)]
MFV of tzdata2011a, r218120

- Cleanup rules for Australia/South_Australia (nothing changed)
- Add historical information for Honolulu.

13 years agoVendor import of tzdata2011a:
Edwin Groothuis [Mon, 31 Jan 2011 09:17:30 +0000 (09:17 +0000)]
Vendor import of tzdata2011a:

- Cleanup rules for Australia/South_Australia (nothing changed)
- Add historical information for Honolulu.

Obtained from:  ftp://elsie.nci.nih.gov/pub/

13 years agoo Add user 'hast'.
Maxim Konovalov [Mon, 31 Jan 2011 07:47:28 +0000 (07:47 +0000)]
o Add user 'hast'.

13 years agoYet another unimplemented futex operation, print out about.
Dmitry Chagin [Mon, 31 Jan 2011 06:06:23 +0000 (06:06 +0000)]
Yet another unimplemented futex operation, print out about.

Submitted by: arundel
MFC after: 1 month.

13 years agoImplement a futex BITSET op.
Dmitry Chagin [Mon, 31 Jan 2011 05:59:05 +0000 (05:59 +0000)]
Implement a futex BITSET op.

Submitted by: arundel
MFC after: 1 month.

13 years agoUpdate interface stats counters to match the current format in linux and
Bjoern A. Zeeb [Mon, 31 Jan 2011 00:09:52 +0000 (00:09 +0000)]
Update interface stats counters to match the current format in linux and
try to export as much information as we can match.

Requested on: Debian GNU/kFreeBSD list (debian-bsd lists.debian.org) 2010-12
Tested by: Mats Erik Andersson (mats.andersson gisladisker.se)
MFC after: 10 days

13 years agoRelease the free page queues lock earlier in vm_page_alloc().
Alan Cox [Sun, 30 Jan 2011 23:55:48 +0000 (23:55 +0000)]
Release the free page queues lock earlier in vm_page_alloc().

Discussed with: kib@

13 years agosh: Send messages about signals to stderr.
Jilles Tjoelker [Sun, 30 Jan 2011 22:57:52 +0000 (22:57 +0000)]
sh: Send messages about signals to stderr.

This is required by POSIX and seems to make more sense.

See also r217557.

13 years agoRegen for r218101.
Dmitry Chagin [Sun, 30 Jan 2011 20:38:26 +0000 (20:38 +0000)]
Regen for r218101.

MFC after: 1 Month.

13 years agoChange linux futex syscall definition to match actual linux one.
Dmitry Chagin [Sun, 30 Jan 2011 20:31:43 +0000 (20:31 +0000)]
Change linux futex syscall definition to match actual linux one.

MFC after: 1 Month.

13 years agoThe kern_wait() code already removes the SIGCHLD signal for the waited
Dmitry Chagin [Sun, 30 Jan 2011 18:17:38 +0000 (18:17 +0000)]
The kern_wait() code already removes the SIGCHLD signal for the waited
process. Removing other SIGCHLD signals is not needed and may cause
problems.

Pointed out by: jilles

MFC after: 1 Month.

13 years agoFix grammar in comment.
Konstantin Belousov [Sun, 30 Jan 2011 16:21:25 +0000 (16:21 +0000)]
Fix grammar in comment.

Pointy hat to: kib
MFC after: 1 week

13 years agoMake ldd(1) work when versioned dependency file is cannot be loaded.
Konstantin Belousov [Sun, 30 Jan 2011 16:14:09 +0000 (16:14 +0000)]
Make ldd(1) work when versioned dependency file is cannot be loaded.
Instead of aborting in locate_dependency(), propagate the error to
caller. The rtld startup function does the right thing with an error
from rtld_verify_versions(), depending on the mode of operation.

Reported by: maho
In collaboration with: kan
MFC after: 1 week

13 years agoFix the 'scan hang' issue.
Bernhard Schmidt [Sun, 30 Jan 2011 14:22:45 +0000 (14:22 +0000)]
Fix the 'scan hang' issue.

When requesting a scan and one is already in progess, e.g. while in scan
state, we happily wait for a scan done notification. Though, this
notification might never be sent, e.g. if we are trying to find a network
to associate to and there is none. Instead of always waiting for a
notification just do so if a new scan has been started. For both cases the
scan cache is used to report available networks even if the content might
not be fresh.

MFC after: 1 month

13 years agoInstead of always returning 0 to a scan request, indicate if there is
Bernhard Schmidt [Sun, 30 Jan 2011 14:05:21 +0000 (14:05 +0000)]
Instead of always returning 0 to a scan request, indicate if there is
one running already.

MFC after: 1 month

13 years agoChange return code semantics of start_scan_locked(). Instead of reporting
Bernhard Schmidt [Sun, 30 Jan 2011 14:00:50 +0000 (14:00 +0000)]
Change return code semantics of start_scan_locked(). Instead of reporting
if a scan is running, report if a scan has been started. The return value
itself is not (yet) used anywhere in the tree and it is also not exported
to userspace.

MFC after: 1 month

13 years agoWhen doing a scan while being associated it is possible that the scan
Bernhard Schmidt [Sun, 30 Jan 2011 13:17:45 +0000 (13:17 +0000)]
When doing a scan while being associated it is possible that the scan
is deferred for the time it takes to flush the TX queue. This work being
done the scan then is continued, but only if it is marked to do so. As
the 'ifconfig scan' request is meant to be used after the interface is
brought up, request a background scan by default. This behaviour is
already documented in manual page.

This fixes on possible case where 'ifconfig scan' hangs infinitely.

MFC after: 1 month

13 years agosyscons: install all available kbdmaps
Ulrich Spörlein [Sun, 30 Jan 2011 12:57:10 +0000 (12:57 +0000)]
syscons: install all available kbdmaps

eee_nordic.kbd, us.dvorakl.kbd, and us.dvorakr.kbd were not installed.

Found by: Neil Short <neshort@yahoo.com>
MFC after: 3 weeks

13 years agoAdd support for the m25p64; lifted straight from Linux.
Adrian Chadd [Sun, 30 Jan 2011 12:14:06 +0000 (12:14 +0000)]
Add support for the m25p64; lifted straight from Linux.

This flash chip is found on the Ubiquiti LS-SR71 board.
I've successfully tested reading; I've not tried writing to it yet.

13 years agoHonor the IEEE80211_SCAN_BGSCAN flag, which makes it possible to actually
Bernhard Schmidt [Sun, 30 Jan 2011 11:23:59 +0000 (11:23 +0000)]
Honor the IEEE80211_SCAN_BGSCAN flag, which makes it possible to actually
request a background scan using IEEE80211_IOC_SCAN_BGSCAN.

MFC after: 1 month

13 years agoFix boot on SMP systems after r218075 by delaying CPU binding until a
Nathan Whitehorn [Sat, 29 Jan 2011 23:26:28 +0000 (23:26 +0000)]
Fix boot on SMP systems after r218075 by delaying CPU binding until a
SYSINIT.

Reviewed by: marcel

13 years agoRemove duplicate printing of TF_NOPUSH in db_print_tflags().
Bjoern A. Zeeb [Sat, 29 Jan 2011 22:11:13 +0000 (22:11 +0000)]
Remove duplicate printing of TF_NOPUSH in db_print_tflags().

MFC after: 10 days

13 years agoDon't operate on the parent of the PCI node. It's the PCI node itself
Marcel Moolenaar [Sat, 29 Jan 2011 21:14:29 +0000 (21:14 +0000)]
Don't operate on the parent of the PCI node. It's the PCI node itself
that represents the host controller. This makes the FDT PCI support
working an a bare-bones manner. This needs a lot more work, of which
the beginning are at the end of the file, compiled-out with #if 0.

The intend being that both the Marvell PCIE and Freescale PCI/PCIX/PCIE
duplicate the same platform-independent domain initialization, that
should be moved into an unified implementation in the FDT code. Handling
of resources requires help from the platform. A unified implementation
allows us to properly support PCI devices listed in the device tree and
configured according to the device tree specification.

Sponsored by: Juniper Networks

13 years agoCall newbus_device_create() for PCI devices. Call pci_from_fdt_node()
Marcel Moolenaar [Sat, 29 Jan 2011 21:08:03 +0000 (21:08 +0000)]
Call newbus_device_create() for PCI devices. Call pci_from_fdt_node()
for the newly created device_t, rather than the parent.

13 years agoFix the interrupt code, broken 7 months ago. The interrupt framework
Marcel Moolenaar [Sat, 29 Jan 2011 20:58:38 +0000 (20:58 +0000)]
Fix the interrupt code, broken 7 months ago. The interrupt framework
already supported nested PICs, but was limited to having a nested
AT-PIC only. With G5 support the need for nested OpenPIC controllers
needed to be added. This was done the wrong way and broke the MPC8555
eval system in the process.

OFW, as well as FDT, describe the interrupt routing in terms of a
controller and an interrupt pin on it. This needs to be mapped to a
flat and global resource: the IRQ. The IRQ is the same as the PCI
intline and as such needs to be representable in 8 bits. Secondly,
ISA support pretty much dictates that IRQ 0-15 should be reserved
for ISA interrupts, because of the internal workins of south bridges.
Both were broken.

This change reverts revision 209298 for a big part and re-implements
it simpler. In particular:
o   The id() method of the PIC I/F is removed again. It's not needed.
o   The openpic_attach() function has been changed to take the OFW
    or FDT phandle of the controller as a second argument. All bus
    attachments that previously used openpic_attach() as the attach
    method of the device I/F now implement as bus-specific method
    and pass the phandle_t to the renamed openpic_attach().
o   Change powerpc_register_pic() to take a few more arguments. In
    particular:
    -   Pass the number of IPIs specificly. The number of IRQs carved
out for a PIC is the sum of the number of int. pins and IPIs.
    -   Pass a flag indicating whether the PIC is an AT-PIC or not.
This tells the interrupt framework whether to assign IRQ 0-15
or some other range.
o   Until we implement proper multi-pass bus enumeration, we have to
    handle the case where we need to map from PIC+pin to IRQ *before*
    the PIC gets registered. This is done in a similar way as before,
    but rather than carving out 256 IRQs per PIC, we carve out 128
    IRQs (124 pins + 4 IPIs). This is supposed to handle the G5 case,
    but should really be fixed properly using multiple passes.
o   Have the interrupt framework set root_pic in most cases and not
    put that burden in PIC drivers (for the most part).
o   Remove powerpc_ign_lookup() and replace it with powerpc_get_irq().
    Remove IGN_SHIFT, INTR_INTLINE and INTR_IGN.

Related to the above, fix the Freescale PCI controller driver, broken
by the FDT code. Besides not attaching properly, bus numbers were
assigned improperly and enumeration was broken in general. This
prevented the AT PIC from being discovered and interrupt routing to
work properly. Consequently, the ata(4) controller stopped functioning.

Fix the driver, and FDT PCI support, enough to get the MPC8555CDS
going again. The FDT PCI code needs a whole lot more work.

No breakages are expected, but lackiong G5 hardware, it's possible
that there are unpleasant side-effects. At least MPC85xx support is
back to where it was 7 months ago -- it's amazing how badly support
can be broken in just 7 months...

Sponsored by: Juniper Networks

13 years agoHave nexus behave the same as the one on ARM (marvell SoCs), so as to
Marcel Moolenaar [Sat, 29 Jan 2011 20:28:17 +0000 (20:28 +0000)]
Have nexus behave the same as the one on ARM (marvell SoCs), so as to
prevent warnings during boot WRT to the fdtbus attachment.

13 years agoIntroduce macro FDT_MAP_IRQ to map from an interrupt controller and
Marcel Moolenaar [Sat, 29 Jan 2011 20:25:20 +0000 (20:25 +0000)]
Introduce macro FDT_MAP_IRQ to map from an interrupt controller and
interrupt pin pair to a global IRQ number. When multiple PICs exist
on a board, the interrupt pin alone is not unique.

13 years agoFixes to ECN in SCTP.
Randall Stewart [Sat, 29 Jan 2011 19:55:29 +0000 (19:55 +0000)]
Fixes to ECN in SCTP.
1) ECN was on an association basis, this is incorrect and
   will not work with CMT or for that matter if the user
   is sending to multiple addresses. This commit makes
   ECN on a per path basis.
2) Adopt the new format for the ECN internet draft. This also
   maintains compatability with old format chunks as well.
3) Keep track of the real time of a RTT down to micro seconds.
   For some future conditional features (for like a data center
   this is good information to have).
MFC after: 1 month

13 years agoReenable the call to vm_map_simplify_entry() from vm_map_insert() for non-
Alan Cox [Sat, 29 Jan 2011 15:23:02 +0000 (15:23 +0000)]
Reenable the call to vm_map_simplify_entry() from vm_map_insert() for non-
MAP_STACK_* entries.  (See r71983 and r74235.)

In some cases, performing this call to vm_map_simplify_entry() halves the
number of vm map entries used by the Sun JDK.

13 years agoAvoid writing CCA threshold values for the EXT radios for non-HT40 channels.
Adrian Chadd [Sat, 29 Jan 2011 14:36:31 +0000 (14:36 +0000)]
Avoid writing CCA threshold values for the EXT radios for non-HT40 channels.

13 years agoBring over some NF calibration changes from ath9k.
Adrian Chadd [Sat, 29 Jan 2011 14:27:20 +0000 (14:27 +0000)]
Bring over some NF calibration changes from ath9k.

Each different radio chipset has a different "good" range of CCA
(clear channel access) parameters where, if you write something
out of range, it's possible the radio will go deaf.

Also, since apparently occasionally reading the NF calibration
returns "wrong" values, so enforce those limits on what is being
written into the CCA register.

Write a default value if there's no history available.

This isn't the case right now but it may be later on when "off-channel"
scanning occurs without init'ing or changing the NF history buffer.
(As each channel may have a different noise floor; so scanning or
other off-channel activity shouldn't affect the NF history of
the current channel.)

13 years agoFix some errors introduced w/ the last commit; fix setting RTS/CTS in the 11n rate...
Adrian Chadd [Sat, 29 Jan 2011 12:30:13 +0000 (12:30 +0000)]
Fix some errors introduced w/ the last commit; fix setting RTS/CTS in the 11n rate scenario.

* I messed up a couple of things in if_athvar.h; so fix that.
* Undo some guesswork done in ar5416Set11nRateScenario() and introduce a
  flags parameter which lets the caller set a few things. To begin with,
  this includes whether to do RTS or CTS protection.
* If both RTS and CTS is set, only do RTS. Both RTS and CTS shouldn't be
  set on a frame.

13 years agoLink in the 11n specific TX methods into the HAL.
Adrian Chadd [Sat, 29 Jan 2011 12:16:26 +0000 (12:16 +0000)]
Link in the 11n specific TX methods into the HAL.

13 years agoMigrate the TX path code out of if_ath and into a separate source file.
Adrian Chadd [Sat, 29 Jan 2011 11:35:23 +0000 (11:35 +0000)]
Migrate the TX path code out of if_ath and into a separate source file.

There's two reasons for this:

* the raw and non-raw TX path shares a lot of duplicate code which should be
  refactored;
* the 11n-ready chip TX path needs a little reworking.

13 years agoRewrite the ARCH check another way for backward compatibility.
Jayachandran C. [Sat, 29 Jan 2011 10:32:00 +0000 (10:32 +0000)]
Rewrite the ARCH check another way for backward compatibility.

Compilation fails now, if TARGET_ARCH=mips instead of mipsel/mipseb.

13 years agoAdd a check for the AR9285E; I have no idea what this is.
Adrian Chadd [Sat, 29 Jan 2011 08:52:06 +0000 (08:52 +0000)]
Add a check for the AR9285E; I have no idea what this is.

The only other changes in ath9k for the AR9285E revolve around sleep modes
which are not fully implemented here yet.

13 years agoMy style(9) bug.
Dmitry Chagin [Sat, 29 Jan 2011 07:22:33 +0000 (07:22 +0000)]
My style(9) bug.

Pointed out by: kib

MFC after: 1 Month.

13 years agoBreak out the debug macros from if_ath.c into if_ath_debug.[ch] .
Adrian Chadd [Sat, 29 Jan 2011 05:08:21 +0000 (05:08 +0000)]
Break out the debug macros from if_ath.c into if_ath_debug.[ch] .

This is prep work for breaking out the TX path into a separate
set of source files.

13 years agoKeep this in sync with the ar5212 power rate table size.
Adrian Chadd [Sat, 29 Jan 2011 04:34:30 +0000 (04:34 +0000)]
Keep this in sync with the ar5212 power rate table size.
This doesn't yet know about the 802.11n radios or rates.

13 years agoFix bug in the netfront driver that caused excessive packet drops during
Justin T. Gibbs [Sat, 29 Jan 2011 02:36:45 +0000 (02:36 +0000)]
Fix bug in the netfront driver that caused excessive packet drops during
receive processing.

Remove unnecessary restrictions on the mbuf chain length built during an
LRO receive.  This restriction was copied from the Linux netfront driver
where the LRO implementation cannot handle more than 18 discontinuities.
The FreeBSD implementation has no such restriction.

MFC after: 1 week

13 years agoUse bus space functions rather than inw/outw
Andrew Turner [Sat, 29 Jan 2011 00:53:58 +0000 (00:53 +0000)]
Use bus space functions rather than inw/outw
to help a future port of the driver to ARM.

Approved by: imp (mentor)

13 years agoMove the load address of the kernel to the start of KVA as the
Andrew Turner [Sat, 29 Jan 2011 00:46:11 +0000 (00:46 +0000)]
Move the load address of the kernel to the start of KVA as the
s3c24x0 copy of initarm expects the kernel to be loaded there.

Approved by: imp (mentor)

13 years agoEliminate the use of symlook_needed function in favor of DAGS.
Alexander Kabaev [Fri, 28 Jan 2011 23:44:57 +0000 (23:44 +0000)]
Eliminate the use of symlook_needed function in favor of DAGS.

Place elements on DAG lists in breadth-first order. This allows us to
walk pre-built list in all cases where breadth-first dependency chain
enumeration is required.

Fix dlsym on special handle obtained by dlopen(NULL, ...) to do what
comment claims it does. Take advantage of recently added symlook_global
function to iterate over main objects and global DAGs lists properly in
search of a symbol. Since rtld itself provides part of the global
namespace, search rtld_obj too.

Remove recursion from init_dag and symlook_needed functions. Use
symlook_needed for ELF filtee processing only and change lookup order
used in the function to match the order used by Solaris runtime linker
under same circumstances. While there, fix weak symbol handling in the
loop so that we return the first weak symbol definition if no strong one
was found, instead of the last one.

Reviewed by: kib
MFC after:   1 month

13 years agoDon't use the MAC address in the device tree if it's all zeroes
Marcel Moolenaar [Fri, 28 Jan 2011 23:40:13 +0000 (23:40 +0000)]
Don't use the MAC address in the device tree if it's all zeroes
(i.e. 00-00-00-00-00-00). Use the currently programmed address
instead.

While here, simplify the function.

13 years agoDrop privileges in worker processes.
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:35:46 +0000 (22:35 +0000)]
Drop privileges in worker processes.

Accepting connections and handshaking in secondary is still done before
dropping privileges. It should be implemented by only accepting connections in
privileged main process and passing connection descriptors to the worker, but
is not implemented yet.

MFC after: 1 week

13 years agoImplement function that drops privileges by:
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:33:47 +0000 (22:33 +0000)]
Implement function that drops privileges by:
- chrooting to /var/empty (user hast home directory),
- setting groups to 'hast' (user hast primary group),
- setting real group id, effective group id and saved group id to 'hast',
- setting real user id, effective user id and saved user id to 'hast'.
At the end verify that those operations where successfull.

MFC after: 1 week

13 years agoChange hast user home directory to /var/empty.
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:29:38 +0000 (22:29 +0000)]
Change hast user home directory to /var/empty.

MFC after: 1 week

13 years agoAdd 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl)
Pawel Jakub Dawidek [Fri, 28 Jan 2011 22:28:12 +0000 (22:28 +0000)]
Add 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl)
to drop privileges.

MFC after: 1 week

13 years agoUse newly added descriptors_assert() function to ensure only expected
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:57:42 +0000 (21:57 +0000)]
Use newly added descriptors_assert() function to ensure only expected
descriptors are open.

MFC after: 1 week

13 years agoAdd function to assert that the only descriptors we have open are the ones
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:56:47 +0000 (21:56 +0000)]
Add function to assert that the only descriptors we have open are the ones
we expect to be open. Also assert that they point at expected type.

Because openlog(3) API is unable to tell us descriptor number it is using, we
have to close syslog socket, remember assert message in local buffer and if we
fail on assertion, reopen syslog socket and log the message.

MFC after: 1 week

13 years agoClose all unneeded descriptors after fork(2).
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:52:37 +0000 (21:52 +0000)]
Close all unneeded descriptors after fork(2).

MFC after: 1 week

13 years agoAdd comments to places where we treat errors as ciritical, but it is possible
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:51:40 +0000 (21:51 +0000)]
Add comments to places where we treat errors as ciritical, but it is possible
to handle them more gracefully.

MFC after: 1 week

13 years agoAdd function to close all unneeded descriptors after fork(2).
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:48:15 +0000 (21:48 +0000)]
Add function to close all unneeded descriptors after fork(2).

MFC after: 1 week

13 years agoInitialize all global variables on pjdlog_init().
Pawel Jakub Dawidek [Fri, 28 Jan 2011 21:36:01 +0000 (21:36 +0000)]
Initialize all global variables on pjdlog_init().

MFC after: 1 week

13 years agoKeep track of the real last RTT on each net.
Randall Stewart [Fri, 28 Jan 2011 21:05:21 +0000 (21:05 +0000)]
Keep track of the real last RTT on each net.
This will be used for Data Center congestion
control, we won't want to engage it in the
ECN code unless we KNOW that the RTT is less
than 500us.

MFC after: 1 week

13 years agoFix logic error. Due to the bug, it incorrectly checked TXQ status
Pyun YongHyeon [Fri, 28 Jan 2011 21:03:32 +0000 (21:03 +0000)]
Fix logic error. Due to the bug, it incorrectly checked TXQ status
which in turn can leave TXQ active.

Submitted by: Brad ( brad <> comstyle dot com )
MFC after: 3 days

13 years agoFix a bug in the way ECN-Echo chunk
Randall Stewart [Fri, 28 Jan 2011 20:49:15 +0000 (20:49 +0000)]
Fix a bug in the way ECN-Echo chunk
sends were being accounted for. The
counting was such that we counted only
when we queued a chunk, not when we sent it.
Now keep an additional counter for queuing and
one for sending.

MFC after: 1 week

13 years agoStyle(9) fixes.
Dmitry Chagin [Fri, 28 Jan 2011 19:04:15 +0000 (19:04 +0000)]
Style(9) fixes.

MFC after: 1 Month.

13 years agoImplement a variation of the linux_common_wait() which should
Dmitry Chagin [Fri, 28 Jan 2011 18:47:07 +0000 (18:47 +0000)]
Implement a variation of the linux_common_wait() which should
be used by linuxolator itself.

Move linux_wait4() to MD path as it requires native struct
rusage translation to struct l_rusage on linux32/amd64.

MFC after: 1 Month.

13 years agoTo avoid excessive code duplication move struct rusage translation
Dmitry Chagin [Fri, 28 Jan 2011 18:28:06 +0000 (18:28 +0000)]
To avoid excessive code duplication move struct rusage translation
to a separate function.

MFC after: 1 Month.

13 years agoIf more than one thread allocated sf buffers for sendfile(2), and
Konstantin Belousov [Fri, 28 Jan 2011 17:37:09 +0000 (17:37 +0000)]
If more than one thread allocated sf buffers for sendfile(2), and
each of the threads needs more while current pool of the buffers is
exhausted, then neither thread can make progress.

Switch to nowait allocations after we got first buffer already.

Reported by: az
Reviewed by: alc (previous version)
Tested by: pho
MFC after: 1 week

13 years agoRemove SuperH architecture from a comment as we do not support it.
Sergey Kandaurov [Fri, 28 Jan 2011 17:30:24 +0000 (17:30 +0000)]
Remove SuperH architecture from a comment as we do not support it.
Presumably it was leaked from NetBSD together with rtld-elf mips support.

Approved by: kib (mentor)
MFC after: 3 days

13 years agoDo not trip a KASSERT if /dev/null cannot be opened for a setuid program.
Jilles Tjoelker [Fri, 28 Jan 2011 15:29:35 +0000 (15:29 +0000)]
Do not trip a KASSERT if /dev/null cannot be opened for a setuid program.

The fdcheckstd() function makes sure fds 0, 1 and 2 are open by opening
/dev/null. If this fails (e.g. missing devfs or wrong permissions),
fdcheckstd() will return failure and the process will exit as if it received
SIGABRT. The KASSERT is only to check that kern_open() returns the expected
fd, given that it succeeded.

Tripping the KASSERT is most likely if fd 0 is open but fd 1 or 2 are not.

MFC after: 2 weeks

13 years agoDocument the "bios-boot" partition type.
Andrey V. Elsukov [Fri, 28 Jan 2011 11:56:14 +0000 (11:56 +0000)]
Document the "bios-boot" partition type.

MFC after: 2 weeks

13 years agoAdd new user-friendly aliases for partition types for the MBR and
Andrey V. Elsukov [Fri, 28 Jan 2011 11:13:01 +0000 (11:13 +0000)]
Add new user-friendly aliases for partition types for the MBR and
EBR schemes: fat32, ebr, linux-data, linux-raid, linux-swap and
linux-lvm. Add bios-boot GUID and alias for the GPT scheme. It used by
GRUB 2 loader. Also do sorting definitions of types in diskmbr.h
and in g_part.c.

PR: bin/120990, kern/147664
MFC after: 2 weeks

13 years ago(Mostly) teach ath_rate_sample about MCS rates.
Adrian Chadd [Fri, 28 Jan 2011 08:57:58 +0000 (08:57 +0000)]
(Mostly) teach ath_rate_sample about MCS rates.

This is just the bare minimum needed to teach ath_rate_sample to try
and handle MCS rates. It doesn't at all attempt to find the best
rate by any means - it doesn't know anything about the MCS rate
relations, TX aggregation or any of the much sexier 11n stuff
that's out there.

It's just enough to transmit 11n frames and handle TX completion.

It shouldn't affect legacy (11abg) behaviour.

Obtained from: rpaulo@

13 years agoMake space for the extended 802.11n MCS rate tables.
Adrian Chadd [Fri, 28 Jan 2011 08:45:19 +0000 (08:45 +0000)]
Make space for the extended 802.11n MCS rate tables.

13 years agoBring in some 802.11n packet duration calculation functions from a mix of Sam/Rui...
Adrian Chadd [Fri, 28 Jan 2011 08:35:55 +0000 (08:35 +0000)]
Bring in some 802.11n packet duration calculation functions from a mix of Sam/Rui and linux ath9k .

This will eventually be used by rate control modules and by the TX
code for calculating packet duration when handling rts/cts protection.

Obtained from: sam@, rpaulo@, linux ath9k

13 years ago- Remove double semicolon.
Hans Petter Selasky [Fri, 28 Jan 2011 08:00:57 +0000 (08:00 +0000)]
- Remove double semicolon.
- Remove reference to sprintf. Use printf directly. This part of
the code should be optimised further to avoid many small printouts.
Setting a sensible line buffer length could help aswell when printing
out megabytes of data per second.

Approved by: thompsa (mentor)

13 years agoCDDL fixes for MIPS n32.
Jayachandran C. [Fri, 28 Jan 2011 06:12:59 +0000 (06:12 +0000)]
CDDL fixes for MIPS n32.

Provide 64 bit atomic ops, and use 32 bit pointer.

13 years agoStyle(9) fix.
Dmitry Chagin [Fri, 28 Jan 2011 05:42:14 +0000 (05:42 +0000)]
Style(9) fix.

MFC after: 1 month.

13 years agosh: Add test for EXIT trap in command substitution.
Jilles Tjoelker [Thu, 27 Jan 2011 23:08:20 +0000 (23:08 +0000)]
sh: Add test for EXIT trap in command substitution.

This is not really realistic but is an opposition to $(trap).

13 years agolinux_sigreturn() loads the struct trapframe from l_sigcontext
Konstantin Belousov [Thu, 27 Jan 2011 21:45:38 +0000 (21:45 +0000)]
linux_sigreturn() loads the struct trapframe from l_sigcontext
members, thus making a signed extension of 32 bit register
context. If the register is not touched in usermode between
return from signal and next syscall entry, the sign-extension
part of 64bit register is not cleared, causing
linux32_fetch_syscall_args() to read wrong values.

Use unsigned type for the registers in the linux sigcontext.

Reported by: Jacob Frelinger <jacob.frelinger duke edu>, arundel
In collaboration with: dchagin
MFC after: 1 week

13 years agoixgb(4) does not support altq(4) yet.
Pyun YongHyeon [Thu, 27 Jan 2011 20:08:14 +0000 (20:08 +0000)]
ixgb(4) does not support altq(4) yet.

13 years agoBackout r216577. ixgb(4) does not support altq(4) yet.
Pyun YongHyeon [Thu, 27 Jan 2011 20:06:24 +0000 (20:06 +0000)]
Backout r216577. ixgb(4) does not support altq(4) yet.

13 years agoRemember created control connection so on fork(2) we can close it in child.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:33:57 +0000 (19:33 +0000)]
Remember created control connection so on fork(2) we can close it in child.

Found with: procstat(1)
MFC after: 1 week

13 years agoClose the control socket before exiting, so it will be unlinked.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:31:35 +0000 (19:31 +0000)]
Close the control socket before exiting, so it will be unlinked.

MFC after: 1 week

13 years agoExtend pjdlog_verify() to support the following additional macros:
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:28:29 +0000 (19:28 +0000)]
Extend pjdlog_verify() to support the following additional macros:
PJDLOG_RVERIFY() - always check expression and on false log the given message
and exit.
PJDLOG_RASSERT() - check expression when NDEBUG is not defined and on false log
given message and exit.
PJDLOG_ABORT() - log the given message and exit.

MFC after: 1 week

13 years agoAdd functions to initialize/finalize pjdlog. This allows to open/close log
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:24:07 +0000 (19:24 +0000)]
Add functions to initialize/finalize pjdlog. This allows to open/close log
file at will.

MFC after: 1 week

13 years agoUse my copyright for 2011 work.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:18:42 +0000 (19:18 +0000)]
Use my copyright for 2011 work.

MFC after: 1 week

13 years agoAdd LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately open
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:15:25 +0000 (19:15 +0000)]
Add LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately open
so there are no surprises once we start chrooting or using capsicum.

MFC after: 1 week

13 years ago- Remove obvious NOTREACHED comment after abort() call.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:12:44 +0000 (19:12 +0000)]
- Remove obvious NOTREACHED comment after abort() call.
- Remove redundant newline at the end of the file.

MFC after: 1 week

13 years agoRemove __dead2 from pjdlog_verify() prototype, it does return sometimes.
Pawel Jakub Dawidek [Thu, 27 Jan 2011 19:10:24 +0000 (19:10 +0000)]
Remove __dead2 from pjdlog_verify() prototype, it does return sometimes.

MFC after: 1 week

13 years agoAdd support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE
Konstantin Belousov [Thu, 27 Jan 2011 16:10:25 +0000 (16:10 +0000)]
Add support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE
covering the whole page, free the page. Otherwise, clear the region and
mark it clean. Not marking the page dirty could reinstantiate cleared
data, but it is allowed by BIO_DELETE specification and saves unneeded
write to swap.

Reviewed by: alc
Tested by: pho
MFC after: 2 weeks

13 years agoImplement sf_buf using direct map (XKPHYS) in MIPS n64.
Jayachandran C. [Thu, 27 Jan 2011 14:49:22 +0000 (14:49 +0000)]
Implement sf_buf using direct map (XKPHYS) in MIPS n64.

- Provide trivial implementation of sf_buf_alloc(), sf_buf_free(),
  sf_buf_kva() and sf_buf_page() using direct map for n64.
- uio_machdep.c - use macros so that the direct map will be used in
  case of n64.

Reviewed by: imp (earlier version)
Obtained from: jmallett (user/jmallett/octeon)

13 years agoFix n32 compile.
Jayachandran C. [Thu, 27 Jan 2011 14:16:12 +0000 (14:16 +0000)]
Fix n32 compile.

These changes are needed to fix n32 compile after the recent change of
mips n32 MACHINE_ARCH to mipsn32eb/mipsn32el.

Reviewed by: imp, bz (earlier version)

13 years agoInitialise the chainmask from the EEPROM rather than the hard-coded defaults.
Adrian Chadd [Thu, 27 Jan 2011 09:26:37 +0000 (09:26 +0000)]
Initialise the chainmask from the EEPROM rather than the hard-coded defaults.

The defaults enabled three chains on the AR5416 even if the card has two
chains. This restores that and ensures that only the correct TX/RX
chainmasks are used.

When HT modes are enabled, all TX chains will be correctly enabled.

This should now enable analog chain swapping with 2-chain cards.
I'm not sure if this is needed for just the AR5416 or whether
it also applies to AR9160, AR9280 and AR9287 (later on); I'll have
to get clarification.

13 years agoAdd missing getCapability call for AR5416.
Adrian Chadd [Thu, 27 Jan 2011 08:42:50 +0000 (08:42 +0000)]
Add missing getCapability call for AR5416.

13 years agoWhile inspecting the disklabel check that start offset of partition is
Andrey V. Elsukov [Thu, 27 Jan 2011 08:02:26 +0000 (08:02 +0000)]
While inspecting the disklabel check that start offset of partition is
within provider's bounds. If not then reject this disklabel.
Mark bbarea as NULL to do not free it again in destroy method.

MFC after: 1 week

13 years agoMake a note to re-check whether that particular check is needed.
Adrian Chadd [Thu, 27 Jan 2011 07:33:17 +0000 (07:33 +0000)]
Make a note to re-check whether that particular check is needed.

13 years agoQuick fix to a comment.
George V. Neville-Neil [Thu, 27 Jan 2011 03:32:16 +0000 (03:32 +0000)]
Quick fix to a comment.

13 years agoWriting to the analog registers on the AR9220 (Merlin PCI) seems to require a delay.
Adrian Chadd [Thu, 27 Jan 2011 02:56:03 +0000 (02:56 +0000)]
Writing to the analog registers on the AR9220 (Merlin PCI) seems to require a delay.

This, along with an initval change which will appear in a subsequent commit,
fixes bus panics that I have been seing with the AR9220 on a Routerstation Pro
(AR7161 MIPS board.)

Obtained from: Linux ath9k
PR: kern/154220

13 years agoExplicitly wire the user buffer rather than doing it implicitly in
Matthew D Fleming [Thu, 27 Jan 2011 00:34:12 +0000 (00:34 +0000)]
Explicitly wire the user buffer rather than doing it implicitly in
sbuf_new_for_sysctl(9).  This allows using an sbuf with a SYSCTL_OUT
drain for extremely large amounts of data where the caller knows that
appropriate references are held, and sleeping is not an issue.

Inspired by: rwatson

13 years agoRemove the CTLFLAG_NOLOCK as it seems to be both unused and
Matthew D Fleming [Wed, 26 Jan 2011 22:48:09 +0000 (22:48 +0000)]
Remove the CTLFLAG_NOLOCK as it seems to be both unused and
unfunctional.  Wiring the user buffer has only been done explicitly
since r101422.

Mark the kern.disks sysctl as MPSAFE since it is and it seems to have
been mis-using the NOLOCK flag.

Partially break the KPI (but not the KBI) for the sysctl_req 'lock'
field since this member should be private and the "REQ_LOCKED" state
seems meaningless now.

13 years agoDocument newly added tunables.
Pyun YongHyeon [Wed, 26 Jan 2011 21:59:59 +0000 (21:59 +0000)]
Document newly added tunables.
 hw.re.intr_filter
 hw.re.msix_disable
 dev.re.%d.int_rx_mod

13 years ago* Use 300 ms as the default for RTO_MIN.
Michael Tuexen [Wed, 26 Jan 2011 21:38:17 +0000 (21:38 +0000)]
* Use 300 ms as the default for RTO_MIN.
* Disable burst mitigation by default.
* Remove unused constant.
Discussed with rrs.
MFC after: 3 months.

13 years agoAdd support for RTL8105E PCIe Fast Ethernet controller. It seems
Pyun YongHyeon [Wed, 26 Jan 2011 21:14:20 +0000 (21:14 +0000)]
Add support for RTL8105E PCIe Fast Ethernet controller. It seems
the controller has a kind of embedded controller/memory and vendor
applies a large set of magic code via undocumented PHY registers in
device initialization stage. I guess it's a firmware image for the
embedded controller in RTL8105E since the code is too big compared
to other DSP fixups. However I have no idea what that magic code
does and what's purpose of the embedded controller. Fortunately
driver seems to still work without loading the firmware.

While I'm here change device description of RTL810xE controller.

H/W donated by: Realtek Semiconductor Corp.