yongari [Wed, 17 Dec 2008 06:01:03 +0000 (06:01 +0000)]
For RTL8168C SPIN2 controllers, make sure to take the controller
out of sleep mode prior to accessing to PHY. This should fix device
attach failure seen on these controllers. Also enable the sleep
mode when device is put into sleep state.
murray [Wed, 17 Dec 2008 04:15:38 +0000 (04:15 +0000)]
1. Correct capitalization of a closing tag (no effect on output).
2. Ensure all &arch entities end with ';' (no effect on output).
3. Ensure all &arch lists for drivers/features are comma-separated.
attilio [Tue, 16 Dec 2008 23:16:10 +0000 (23:16 +0000)]
1) Fix a deadlock in the VFS:
- threadA runs vfs_rel(mp1)
- threadB does unmount the mp1 fs, sets MNTK_UNMOUNT and drop MNT_ILOCK()
- threadA runs vfs_busy(mp1) and, as long as, MNTK_UNMOUNT is set, sleeps
waiting for threadB to complete the unmount
- threadB, in vfs_mount_destroy(), finds mnt_lock > 0 and sleeps waiting
for the refcount to expire.
Fix the deadlock by adding a flag called MNTK_REFEXPIRE which signals the
unmounter is waiting for mnt_ref to expire.
The vfs_busy contenders got awake, fails, and if they retry the
MNTK_REFEXPIRE won't allow them to sleep again.
2) Simplify significantly the code of vfs_mount_destroy() trimming
unnecessary codes:
- as long as any reference exited, it is no-more possible to have
write-op (primarty and secondary) in progress.
- it is no needed to drop and reacquire the mount lock.
- filling the structures with dummy values is unuseful as long as
it is going to be freed.
Tested by: pho, Andrea Barberio <insomniac at slackware dot it>
Discussed with: kib
trasz [Tue, 16 Dec 2008 21:13:11 +0000 (21:13 +0000)]
According to phk@, VOP_STRATEGY should never, _ever_, return
anything other than 0. Make it so. This fixes
"panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648",
encountered when writing to an orphaned filesystem. Reason
for the panic was the following assert:
KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp));
at vfs_bio:bufstrategy().
imp [Tue, 16 Dec 2008 20:07:47 +0000 (20:07 +0000)]
Start to clean up the MIPS elf machine dependent file.
o Add support for compiling elf64 for this file (the rest of the changes are
coming later)
o Fill in some misssing relocation types. We need to support these in
elf_machdep.c's relocation routines eventually, but that's future work
too.
trasz [Tue, 16 Dec 2008 17:04:52 +0000 (17:04 +0000)]
Implement g_vfs_orphan(). Without it, the filesystem never closes
the device, which means refcount on periph drivers never drops,
which means cam_sim_free() never returns, which results in umass
sleeping there ad infinitum.
rwatson [Tue, 16 Dec 2008 17:03:22 +0000 (17:03 +0000)]
A few locking fixes and cleanups to pfil hook registration,
unregistration, and execution:
- Add some brackets for clarity and trim a bit of vertical whitespace.
- Remove comments that may not contribute to clarity, such as "Lock"
before acquiring a lock and "Get memory" before allocating memory.
- During hook registration, don't drop pfil_list_lock between checking
for a duplicate and registering the hook, as this leaves a race
condition by failing to enforce the "no duplicate hooks" invariant.
- Don't lock the hook during registration, since it's not yet in use.
- Document assumption that hooks will be quiesced before being
unregistered.
- Don't write-lock hooks during removal because they are assumed
quiesced.
- Rename "done" label to "locked_error" to be clear that it's an error
path on the way out of hook execution.
trasz [Tue, 16 Dec 2008 16:57:33 +0000 (16:57 +0000)]
Add SIM refcounting. This is slightly different from what DragonFly
does - in DragonFly, it's cam_sim_release() what actually frees the
SIM; cam_sim_free does nothing more than calling cam_sim_release().
Here, we drain in cam_sim_free, waiting for refcount to drop to zero.
We cannot do the same think DragonFly does, because after cam_sim_free
returns, client would destroy the sim->mtx, and CAM would trip over
an initialized mutex.
trasz [Tue, 16 Dec 2008 16:54:51 +0000 (16:54 +0000)]
Get rid of dead_sim. There is no way to make it work - any attempt
to actually use it would panic on mtx operation, as dead_sim doesn't
have a proper mutex. Even if it had a properly initialized mutex,
it wouldn't have properly locked and owned one.
mav [Tue, 16 Dec 2008 16:04:40 +0000 (16:04 +0000)]
Call ata_legacy() only once on attach and save it's result. Scanning PCI
configuration registers (which are not going to change) on every interrupt
looks expensive, especially when interrupt is shared. Profiling shows me 3%
of time spent by atapci0 on pure network load due to IRQ sharing with em0.
mav [Tue, 16 Dec 2008 13:58:37 +0000 (13:58 +0000)]
Avoid 256 integer divisions per rc4_init() call. Replace it with using
separate index variable.
It gives more then double rc4_init() performance increase on tested i386 P4.
It also gives about 15% speedup to PPTP VPN with stateless MPPE encryption
(by ng_mppc) which calls rc4_init() for every packet.
delphij [Tue, 16 Dec 2008 05:03:22 +0000 (05:03 +0000)]
Don't count InFramesL2FilterDiscards into Ierr. This value does not represent
a real packet error but simply indicate that an unexpected unicast or multicast
error was received by the NIC, which was not counted in the past as well.
Reported by: many (on -stable@)
Reviewed by: davidch
MFC after: 3 days
mav [Tue, 16 Dec 2008 01:24:05 +0000 (01:24 +0000)]
If possible, try to obtain max_mhz on cpufreq attach instead of first request.
On HyperThreading CPUs logical cores have same frequency, so setting it
on any core will change the other's one. In most cases first request
to the second core will be the "set" request, done after setting frequency
of the first core. In such case second CPU will obtain throttled frequency
of the first core as it's max_mhz making cpufreq broken due to different
frequency sets.
kensmith [Tue, 16 Dec 2008 01:18:10 +0000 (01:18 +0000)]
Stop treating Xorg as a distribution in the mainline portion of sysinstall
and leave it to be handled in the packages section (or post-install
completely) along with all the other packages.
sam [Mon, 15 Dec 2008 22:50:50 +0000 (22:50 +0000)]
Fix ucastkey teardown for drivers that plumb clear keys or similar
(e.g. ath): we must check the key index and not whether the key
points at a cipher other than "undef". This looks like it's been
broken for a while. Might be worth adding an explicit clear cipher
at some point though this would require changes to the usage of
IEEE80211_KEY_UNDEFINED.
wilko [Mon, 15 Dec 2008 21:54:23 +0000 (21:54 +0000)]
By default assume a 8139 chip if the EEPROM contents prove inconclusive. The
same LOM hardware with goofed-up EEPROM programming also needed reading the
Ethernet address from the chips registers as the EEPROM did not have a
sensible address programmed.
Patch developed by: pyun@
Funky hardware on loan: www.id-it.nl
bz [Mon, 15 Dec 2008 21:50:54 +0000 (21:50 +0000)]
Another step assimilating IPv[46] PCB code - directly use
the inpcb names rather than the following IPv6 compat macros:
in6pcb,in6p_sp, in6p_ip6_nxt,in6p_flowinfo,in6p_vflag,
in6p_flags,in6p_socket,in6p_lport,in6p_fport,in6p_ppcb and
sotoin6pcb().
Apart from removing duplicate code in netipsec, this is a pure
whitespace, not a functional change.
Discussed with: rwatson
Reviewed by: rwatson (version before review requested changes)
MFC after: 4 weeks (set the timer and see then)
marius [Mon, 15 Dec 2008 21:42:38 +0000 (21:42 +0000)]
Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSI
controllers. Reading this register, for which there are indications
that it doesn't really exist, returns 0 on at least some 12160
and doing so on Sun Fire V880 causes a data access error exception.
nwhitehorn [Mon, 15 Dec 2008 15:31:10 +0000 (15:31 +0000)]
Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular,
the code for parsing interrupt maps) to PowerPC and reflect their new MI
status by moving them to the shared dev/ofw directory.
This commit also modifies the OFW PCI enumeration procedure on PowerPC to
allow the bus to find non-firmware-enumerated devices that Apple likes to add,
and adds some useful Open Firmware properties (compat and name) to the pnpinfo
string of children on OFW SBus, EBus, PCI, and MacIO links. Because of the
change to PCI enumeration on PowerPC, X has started working again on PPC
machines with Grackle hostbridges.
qingli [Mon, 15 Dec 2008 06:10:57 +0000 (06:10 +0000)]
This main goals of this project are:
1. separating L2 tables (ARP, NDP) from the L3 routing tables
2. removing as much locking dependencies among these layers as
possible to allow for some parallelism in the search operations
3. simplify the logic in the routing code,
The most notable end result is the obsolescent of the route
cloning (RTF_CLONING) concept, which translated into code reduction
in both IPv4 ARP and IPv6 NDP related modules, and size reduction in
struct rtentry{}. The change in design obsoletes the semantics of
RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland
applications such as "arp" and "ndp" have been modified to reflect
those changes. The output from "netstat -r" shows only the routing
entries.
Quite a few developers have contributed to this project in the
past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and
Andre Oppermann. And most recently:
- Kip Macy revised the locking code completely, thus completing
the last piece of the puzzle, Kip has also been conducting
active functional testing
- Sam Leffler has helped me improving/refactoring the code, and
provided valuable reviews
- Julian Elischer setup the perforce tree for me and has helped
me maintaining that branch before the svn conversion
sam [Mon, 15 Dec 2008 01:26:33 +0000 (01:26 +0000)]
Fix definition of IEEE80211_CHAN_MAX; it was defined as 255 but
really was meant to be 256. Adjust usage accordingly and replace
bogus usage of this value in checking IEEE channel #'s.
NB: this causes an ABI change; ifconfig must be recompiled
sam [Mon, 15 Dec 2008 01:09:01 +0000 (01:09 +0000)]
0 is a potential ISO CC; use new NO_COUNTRY #define to identify
when the CC is not set. Note NO_COUNTRY is set to 0xffff for now
(must be 16 bits as ieee80211_regdomain struct defines sku's and
cc's as uint16_t which may need fixing).
sam [Mon, 15 Dec 2008 01:06:49 +0000 (01:06 +0000)]
o distinguish between adhoc and ahdemo modes
o do not require 1/2 and 1/4 rate channels be present in the
calibration list when doing a gsm regulatory change; the
existing 900MHz cards are not self-identifying so there is
no way (using the calibration channel list) to check
sam [Mon, 15 Dec 2008 01:00:18 +0000 (01:00 +0000)]
Improve regdomain.xml parser:
o store XML_Parser in the state block so we can report line numbers for errors
o complain about netband w/o mode
o complain about unknown modes
o complain about band w/o enclosing netband
o complain about duplicate freqband
o complain about unknown channel flags
o complain about band w/o freqband's
o complain about band w/o maxpower
o complain about country w/o ISO cc
o complain about country w/o regdomain reference
sam [Mon, 15 Dec 2008 00:47:24 +0000 (00:47 +0000)]
Replace adhoc checks in ieee80211_start with a per-node flag that
indicates if an association id is required before outbound traffic
is permitted. This cleans up the previous change that broke mcast
traffic "to the stack" in ap mode as a side effect.
sam [Sun, 14 Dec 2008 22:26:57 +0000 (22:26 +0000)]
Combine ath rate control modules with ath after bringing ath_hal
src into the tree. The old split was balanced on module dependencies
and symbol exposure that no longer exists. Users that want a module
setup with rate control algorithm other than sample must override
ATH_RATE in the ath module Makefile.
mav [Sun, 14 Dec 2008 20:15:30 +0000 (20:15 +0000)]
To avoid one doubtless netgraph SMP scalability limitation point, switch
node queues processing from single swi:net thread to several specialized
threads.
phk [Sun, 14 Dec 2008 20:03:46 +0000 (20:03 +0000)]
Move the code that injects received characters into the tty system into
a separate public function ucomrxchars(), to avoid requirement of
simple metadata prefixing on the USB data stream.