]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoMake ldd(1) work when versioned dependency file is cannot be loaded.
kib [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.
bschmidt [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
bschmidt [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
bschmidt [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
bschmidt [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
uqs [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 [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
bschmidt [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
nwhitehorn [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().
bz [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 [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 [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 [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 [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 [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.
rrs [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-
alc [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 [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 [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 [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 [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 [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.
jchandra [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 [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.
dchagin [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 [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 [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
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 [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 [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.
kan [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 [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.
pjd [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:
pjd [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.
pjd [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)
pjd [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
pjd [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
pjd [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).
pjd [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
pjd [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).
pjd [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().
pjd [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.
rrs [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
yongari [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
rrs [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.
dchagin [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
dchagin [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
dchagin [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
kib [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.
pluknet [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 [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.
ae [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
ae [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 [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 [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 [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.
hselasky [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.
jchandra [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.
dchagin [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 [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
kib [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.
yongari [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.
yongari [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.
pjd [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.
pjd [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:
pjd [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
pjd [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.
pjd [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
pjd [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.
pjd [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.
pjd [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
kib [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.
jchandra [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.
jchandra [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 [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 [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
ae [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 [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.
gnn [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 [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
mdf [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
mdf [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.
yongari [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.
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
yongari [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.

13 years agoAdd Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The
yongari [Wed, 26 Jan 2011 21:07:44 +0000 (21:07 +0000)]
Add Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The
exact model name is not clear yet. All previous RTL8201 10/100 PHYs
used 0x8201 in MII_PHYIDR2 which in turn makes model number 0x20
but this PHY used new model number 0x08.

13 years agoDo not use interrupt taskqueue on controllers with MSI/MSI-X
yongari [Wed, 26 Jan 2011 20:25:40 +0000 (20:25 +0000)]
Do not use interrupt taskqueue on controllers with MSI/MSI-X
capability. One of reason using interrupt taskqueue in re(4) was
to reduce number of TX/RX interrupts under load because re(4)
controllers have no good TX/RX interrupt moderation mechanism.
Basic TX interrupt moderation is done by hardware for most
controllers but RX interrupt moderation through undocumented
register showed poor RX performance so it was disabled in r215025.
Using taskqueue to handle RX interrupt greatly reduced number of
interrupts but re(4) consumed all available CPU cycles to run the
taskqueue under high TX/RX network load.  This can happen even with
RTL810x fast ethernet controller and I believe this is not
acceptable for most systems.

To mitigate the issue, use one-shot timer register to moderate RX
interrupts. The timer register provides programmable one-shot timer
and can be used to suppress interrupt generation. The timer runs at
125MHZ on PCIe controllers so the minimum time allowed for the
timer is 8ns. Data sheet says the register is 32 bits but
experimentation shows only lower 13 bits are valid so maximum time
that can be programmed is 65.528us. This yields theoretical maximum
number of RX interrupts that could be generated per second is about
15260. Combined with TX completion interrupts re(4) shall generate
less than 20k interrupts. This number is still slightly high
compared to other intelligent ethernet controllers but system is
very responsive even under high network load.

Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount
of time to delay RX interrupt processing in units of us. Value 0
completely disables RX interrupt moderation. To provide old
behavior for controllers that have MSI/MSI-X capability, introduce
a new tunable hw.re.intr_filter. If the tunable is set to non-zero
value, driver will use interrupt taskqueue. The default value of
the tunable is 0. This tunable has no effect on controllers that
has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled
by administrator.

While I'm here cleanup interrupt setup/teardown since re(4) uses
single MSI/MSI-X message at this moment.

13 years agoAdd macro to test the sv_flags of any process. Change some places to test
dchagin [Wed, 26 Jan 2011 20:03:58 +0000 (20:03 +0000)]
Add macro to test the sv_flags of any process. Change some places to test
the flags instead of explicit comparing with address of known sysentvec
structures.

MFC after: 1 month

13 years agoMake SCTP_MAX_BURST compliant with the latest version of
tuexen [Wed, 26 Jan 2011 19:55:54 +0000 (19:55 +0000)]
Make SCTP_MAX_BURST compliant with the latest version of
the socket API ID. This is not compatible with the API
in stable/8.

13 years agoChange infrastructure for SCTP_MAX_BURST to allow compliance
tuexen [Wed, 26 Jan 2011 19:49:03 +0000 (19:49 +0000)]
Change infrastructure for SCTP_MAX_BURST to allow compliance
with the latest socket API ID. Especially it can be disabled.

Full compliance needs changing the structure used in the
socket option. Since this breaks the API, it will be a
seperate commit which will not be MFCed to stable/8.

MFC after: 3 months.

13 years agoUnroll vgrind filter to no longer depend on vgrind(1) during buildworld.
uqs [Wed, 26 Jan 2011 19:39:31 +0000 (19:39 +0000)]
Unroll vgrind filter to no longer depend on vgrind(1) during buildworld.

The source files haven't been touched in ages and this is unlikely
to change in the future.

13 years agoFix typo in example getopt(1) script: $i vs $1 [1]
uqs [Wed, 26 Jan 2011 18:43:15 +0000 (18:43 +0000)]
Fix typo in example getopt(1) script: $i vs $1 [1]
While here apply style hammer.

PR: docs/154289 [1]
Submitted by: Jamie Landeg Jones <jamie@bishopston.net>
MFC after: 1 week

13 years agoPrison check addresses set with multicast interface options.
deischen [Wed, 26 Jan 2011 17:31:03 +0000 (17:31 +0000)]
Prison check addresses set with multicast interface options.

Reviewed by: bz
MFC after: 1 week

13 years agoSet td_kstack_pages for thread0. This was already being done for most
mdf [Wed, 26 Jan 2011 17:06:13 +0000 (17:06 +0000)]
Set td_kstack_pages for thread0.  This was already being done for most
architectures, but i386 and amd64 were missing it.

Submitted by: Mohd Fahadullah <mfahadullah AT isilon DOT com>

13 years agoAdd missing part of r217877.
mav [Wed, 26 Jan 2011 13:10:07 +0000 (13:10 +0000)]
Add missing part of r217877.

13 years agoAdd ar5416RestoreChainMask() which will undo any AR5416 specific chainmask
adrian [Wed, 26 Jan 2011 10:48:29 +0000 (10:48 +0000)]
Add ar5416RestoreChainMask() which will undo any AR5416 specific chainmask
overriding after calibration.

This will get set for other two chain radios, such as AR9280 and later on,
AR9287. It should however be a nul operation.

13 years agoAdd an AR5416 workaround - force a different bias based on 2.4ghz channel frequency.
adrian [Wed, 26 Jan 2011 10:36:43 +0000 (10:36 +0000)]
Add an AR5416 workaround - force a different bias based on 2.4ghz channel frequency.

Obtained from: Linux ath9k

13 years agoTreat async buffer writes from the gjournal switcher thread the same as
kib [Wed, 26 Jan 2011 10:34:21 +0000 (10:34 +0000)]
Treat async buffer writes from the gjournal switcher thread the same as
from syncer. We shall not sleep on running buffer space when suspending.

Reproduced and tested by: pho
PR: kern/154228
MFC after: 1 week

13 years agoBreak out the chainmask init code into a new function - ar5416InitChainMasks() .
adrian [Wed, 26 Jan 2011 10:08:37 +0000 (10:08 +0000)]
Break out the chainmask init code into a new function - ar5416InitChainMasks() .

ath9k does a few different things here during config - if it's an early
AR5416 with two chains, it enables all three chains for calibration and
then restores the chainmask to the original values after initial
calibration has completed.

The reason behind this commit is to begin breaking out the chainmask
configuration for this specific reason; follow-up commits will add
the chainmask restore in the ar5416Reset() routine.

13 years ago* fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with
adrian [Wed, 26 Jan 2011 09:37:43 +0000 (09:37 +0000)]
* fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with
  something else
* add HAL_DEBUG_GPIO, for some GPIO related debugging I'm tinkering with
  at the moment.